/* ========================================
   龍門傳奇 - 東方賭場奢華風格
   ======================================== */

:root {
  /* 主要色彩 - 金色與深紅 */
  --gold: #FFD700;
  --gold-light: #FFF4C4;
  --gold-dark: #B8860B;
  --crimson: #DC143C;
  --crimson-dark: #8B0000;
  --black: #0A0A0A;
  --black-light: #1A1A1A;
  --black-lighter: #2A2A2A;
  
  /* 功能色 */
  --success: #00FF88;
  --error: #FF4444;
  --info: #00CED1;
  
  /* 字體 */
  --font-display: 'Cinzel', serif;
  --font-body: 'Noto Sans TC', sans-serif;
  
  /* 陰影 */
  --shadow-gold: 0 0 30px rgba(255, 215, 0, 0.3);
  --shadow-crimson: 0 0 30px rgba(220, 20, 60, 0.3);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background: linear-gradient(135deg, var(--black) 0%, var(--crimson-dark) 50%, var(--black) 100%);
  min-height: 100vh;
  color: var(--gold-light);
  overflow-x: hidden;
  position: relative;
}

/* 背景粒子 */
.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--gold);
  border-radius: 50%;
  opacity: 0.6;
  animation: float 15s infinite ease-in-out;
}

@keyframes float {
  0%, 100% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.6;
  }
  90% {
    opacity: 0.6;
  }
  100% {
    transform: translateY(-100px) rotate(720deg);
    opacity: 0;
  }
}

/* 主容器 */
.container {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr 200px;
  grid-template-rows: auto auto auto 1fr;
  gap: 20px;
  background: rgba(10, 10, 10, 0.7);
  border-radius: 20px;
  min-height: 100vh;
}

/* 頂部標題 */
.header {
  grid-column: 1 / -1;
  text-align: center;
  padding: 30px 0;
}

.title {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 900;
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 50%, var(--gold-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: var(--shadow-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {
  0%, 100% {
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.5));
  }
  50% {
    filter: drop-shadow(0 0 40px rgba(255, 215, 0, 0.8));
  }
}

.title-icon {
  font-size: 2.5rem;
  animation: dragonWiggle 2s ease-in-out infinite;
}

@keyframes dragonWiggle {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}

.subtitle {
  font-family: var(--font-body);
  font-size: 1.2rem;
  color: var(--gold-dark);
  letter-spacing: 8px;
  margin-top: 10px;
  text-transform: uppercase;
}

/* 玩家信息 */
.player-info {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  gap: 40px;
  padding: 20px;
  background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.1), transparent);
  border-top: 1px solid rgba(255, 215, 0, 0.2);
  border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.player-chips, .player-id {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
}

.chip-icon {
  font-size: 1.5rem;
}

.chip-label, .id-label {
  color: rgba(255, 244, 196, 0.7);
}

.chip-value, .id-value {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--gold);
  font-size: 1.4rem;
  min-width: 80px;
}

/* 遊戲狀態 */
.game-status {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  padding: 15px;
}

.status-phase {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--gold);
  padding: 10px 30px;
  background: linear-gradient(135deg, var(--crimson-dark), var(--black));
  border: 2px solid var(--gold);
  border-radius: 30px;
  box-shadow: var(--shadow-gold);
}

.countdown {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.countdown-number {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--crimson);
  text-shadow: 0 0 20px rgba(220, 20, 60, 0.5);
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.countdown-label {
  font-size: 1rem;
  color: var(--gold-dark);
}

/* 遊戲區域 */
.game-area {
  grid-column: 1;
  position: relative;
  background: linear-gradient(180deg, var(--black-light) 0%, var(--black) 100%);
  border: 3px solid var(--gold-dark);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-lg), inset 0 0 100px rgba(0, 0, 0, 0.5);
  min-height: 450px;
}

/* 掉落區域 */
.drop-zone {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: 
    radial-gradient(circle at 50% 0%, rgba(255, 215, 0, 0.1) 0%, transparent 50%),
    linear-gradient(180deg, var(--black-lighter) 0%, var(--black-light) 100%);
}

.pins {
  position: absolute;
  top: 50px;
  left: 0;
  right: 0;
  bottom: 100px;
}

.pin {
  position: absolute;
  width: 12px;
  height: 12px;
  background: radial-gradient(circle, var(--gold) 0%, var(--gold-dark) 100%);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--gold), inset 0 -2px 4px rgba(0, 0, 0, 0.3);
}

/* 球 */
.ball {
  position: absolute;
  width: 30px;
  height: 30px;
  background: radial-gradient(circle at 30% 30%, #fff 0%, var(--gold) 30%, var(--gold-dark) 100%);
  border-radius: 50%;
  box-shadow: 
    0 0 20px var(--gold),
    inset -5px -5px 15px rgba(0, 0, 0, 0.3);
  left: 50%;
  top: 0;
  transform: translate(-50%, -50%);
  opacity: 0;
  z-index: 10;
  transition: opacity 0.3s;
}

.ball.active {
  opacity: 1;
}

.ball.dropping {
  transition: none;
}

/* 下注格子 */
.slots {
  display: flex;
  height: 100px;
  border-top: 3px solid var(--gold);
}

.slot {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-right: 1px solid rgba(255, 215, 0, 0.3);
  background: linear-gradient(180deg, rgba(255, 215, 0, 0.05) 0%, transparent 100%);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.slot:last-child {
  border-right: none;
}

.slot::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--slot-color, var(--gold));
  opacity: 0.8;
}

.slot:hover {
  background: linear-gradient(180deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 215, 0, 0.05) 100%);
}

.slot.selected {
  background: linear-gradient(180deg, rgba(255, 215, 0, 0.3) 0%, rgba(255, 215, 0, 0.1) 100%);
  box-shadow: inset 0 0 30px rgba(255, 215, 0, 0.2);
}

.slot.winner {
  animation: winnerPulse 0.5s ease-in-out 3;
}

@keyframes winnerPulse {
  0%, 100% {
    background: linear-gradient(180deg, rgba(255, 215, 0, 0.3) 0%, rgba(255, 215, 0, 0.1) 100%);
  }
  50% {
    background: linear-gradient(180deg, rgba(255, 215, 0, 0.6) 0%, rgba(255, 215, 0, 0.3) 100%);
  }
}

.slot-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--slot-color, var(--gold));
  text-shadow: 0 0 10px var(--slot-color, var(--gold));
}

.slot-multiplier {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--gold-light);
  opacity: 0.8;
}

.slot-bet-total {
  position: absolute;
  bottom: 5px;
  font-size: 0.75rem;
  color: var(--gold-dark);
}

/* 結果覆蓋層 */
.result-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s;
  z-index: 100;
}

.result-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.result-content {
  text-align: center;
  transform: scale(0.8);
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.result-overlay.show .result-content {
  transform: scale(1);
}

.result-icon {
  font-size: 5rem;
  animation: bounce 0.6s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

.result-text {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 30px var(--gold);
  margin: 20px 0;
}

.result-multiplier {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--crimson);
}

/* 下注區域 */
.betting-area {
  grid-column: 1;
  background: linear-gradient(180deg, var(--black-light) 0%, var(--black) 100%);
  border: 2px solid var(--gold-dark);
  border-radius: 15px;
  padding: 20px;
}

.bet-controls {
  margin-bottom: 20px;
}

.bet-amount-selector {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 15px;
}

.bet-btn {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  padding: 10px 20px;
  background: linear-gradient(180deg, var(--black-lighter) 0%, var(--black-light) 100%);
  border: 2px solid var(--gold-dark);
  color: var(--gold);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.bet-btn:hover {
  background: linear-gradient(180deg, var(--gold-dark) 0%, var(--gold) 100%);
  color: var(--black);
  box-shadow: var(--shadow-gold);
}

.bet-btn.selected {
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: var(--black);
  box-shadow: var(--shadow-gold);
}

.bet-btn.all-in {
  background: linear-gradient(180deg, var(--crimson) 0%, var(--crimson-dark) 100%);
  border-color: var(--crimson);
}

.bet-btn.all-in:hover {
  background: linear-gradient(180deg, #FF4444 0%, var(--crimson) 100%);
  box-shadow: var(--shadow-crimson);
}

.current-bet {
  text-align: center;
  padding: 15px;
  background: rgba(255, 215, 0, 0.1);
  border-radius: 10px;
}

.bet-label {
  color: var(--gold-dark);
  margin-right: 10px;
}

.bet-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
}

.slot-bets {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.slot-bet-item {
  text-align: center;
  padding: 10px 5px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  border: 1px solid rgba(255, 215, 0, 0.2);
}

.slot-bet-item.has-bet {
  background: rgba(255, 215, 0, 0.15);
  border-color: var(--gold);
}

.slot-bet-name {
  font-size: 0.8rem;
  color: var(--gold-dark);
  margin-bottom: 5px;
}

.slot-bet-amount {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--gold);
}

/* 右側面板 */
.players-panel, .history-panel, .current-bets-panel {
  grid-column: 2;
  background: linear-gradient(180deg, var(--black-light) 0%, var(--black) 100%);
  border: 2px solid var(--gold-dark);
  border-radius: 15px;
  padding: 15px;
  max-height: 250px;
  overflow-y: auto;
}

.panel-title {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--gold);
  text-align: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--gold-dark);
  margin-bottom: 10px;
}

.players-list, .history-list, .current-bets-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.player-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  background: rgba(255, 215, 0, 0.05);
  border-radius: 8px;
  border-left: 3px solid var(--gold);
}

.player-item.self {
  background: rgba(255, 215, 0, 0.15);
  border-left-color: var(--crimson);
}

.player-name {
  font-size: 0.9rem;
  color: var(--gold-light);
}

.player-chips-small {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--gold);
}

.history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: rgba(255, 215, 0, 0.05);
  border-radius: 8px;
}

.history-slot {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  min-width: 40px;
}

.history-winners {
  font-size: 0.8rem;
  color: var(--success);
}

.current-bet-item {
  padding: 8px;
  background: rgba(255, 215, 0, 0.05);
  border-radius: 8px;
  font-size: 0.85rem;
}

.current-bet-item .better {
  color: var(--gold-dark);
}

.current-bet-item .bet-info {
  color: var(--gold);
}

/* 錯誤提示 */
.error-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: linear-gradient(135deg, var(--crimson) 0%, var(--crimson-dark) 100%);
  color: white;
  padding: 15px 30px;
  border-radius: 10px;
  box-shadow: var(--shadow-crimson);
  transition: transform 0.3s ease;
  z-index: 1000;
}

.error-toast.show {
  transform: translateX(-50%) translateY(0);
}

/* 響應式設計 */
@media (max-width: 1200px) {
  .container {
    grid-template-columns: 1fr;
  }
  
  .players-panel, .history-panel, .current-bets-panel, .chat-panel {
    grid-column: 1;
    max-height: 200px;
  }
}

@media (max-width: 768px) {
  .title {
    font-size: 2rem;
  }
  
  .title-icon {
    font-size: 1.5rem;
  }
  
  .player-info {
    flex-direction: row;
    gap: 15px;
    align-items: center;
  }
  
  .bet-amount-selector {
    gap: 5px;
  }
}
/* 滾動條樣式 */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--black-light);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: var(--gold-dark);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gold);
}

/* 動畫延遲工具類 */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }


/* ========================================
   大廳界面樣式
   ======================================== */

.lobby-container {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 30px 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.lobby-container.hidden {
  display: none;
}

.lobby-header {
  text-align: center;
  margin-bottom: 40px;
}

.lobby-title {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 900;
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 50%, var(--gold-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  animation: titleGlow 3s ease-in-out infinite;
}

.lobby-subtitle {
  font-family: var(--font-body);
  font-size: 1.2rem;
  color: var(--gold-dark);
  letter-spacing: 8px;
  margin-top: 10px;
  text-transform: uppercase;
}

.lobby-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* 玩家設置 */
.player-setup {
  background: linear-gradient(180deg, var(--black-light) 0%, var(--black) 100%);
  border: 2px solid var(--gold-dark);
  border-radius: 15px;
  padding: 25px;
}

.setup-title, .section-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--gold);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--gold-dark);
}

.section-subtitle {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--gold-dark);
  margin-bottom: 15px;
}

/* 表單樣式 */
.form-group {
  margin-bottom: 15px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  color: var(--gold-dark);
  margin-bottom: 8px;
}

.form-input, .form-select {
  width: 100%;
  padding: 12px 15px;
  background: var(--black-lighter);
  border: 2px solid var(--gold-dark);
  border-radius: 10px;
  color: var(--gold-light);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
}

.form-input::placeholder {
  color: rgba(255, 244, 196, 0.4);
}

.form-select option {
  background: var(--black-light);
  color: var(--gold-light);
}

/* 創建房間區域 */
.create-room-section {
  background: linear-gradient(180deg, var(--black-light) 0%, var(--black) 100%);
  border: 2px solid var(--gold-dark);
  border-radius: 15px;
  padding: 25px;
}

.create-room-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* 賠率設置區域 */
.odds-section {
  background: rgba(255, 215, 0, 0.05);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 12px;
  padding: 15px;
  margin-top: 5px;
}

.odds-section .section-subtitle {
  font-size: 0.9rem;
  color: var(--gold);
  margin-bottom: 12px;
  text-align: center;
}

.odds-row .form-group {
  flex: 1;
}

.odds-row .form-select {
  text-align: center;
  font-weight: 600;
}
/* 加入房間區域 */
.join-room-section {
  background: linear-gradient(180deg, var(--black-light) 0%, var(--black) 100%);
  border: 2px solid var(--gold-dark);
  border-radius: 15px;
  padding: 25px;
  flex: 1;
}

.join-room-form {
  margin-bottom: 20px;
}

.code-input-group {
  display: flex;
  gap: 10px;
}

.code-input {
  text-transform: uppercase;
  letter-spacing: 4px;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
}

/* 房間列表 */
.rooms-list-section {
  margin-top: 10px;
}

.rooms-list {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rooms-loading, .rooms-empty {
  text-align: center;
  color: var(--gold-dark);
  padding: 30px;
}

.room-card {
  background: linear-gradient(135deg, var(--black-lighter) 0%, var(--black-light) 100%);
  border: 1px solid var(--gold-dark);
  border-radius: 12px;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.room-card:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow-gold);
  transform: translateX(5px);
}

.room-info {
  flex: 1;
}

.room-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--gold);
  margin-bottom: 5px;
}

.room-details {
  display: flex;
  gap: 15px;
  font-size: 0.85rem;
  color: var(--gold-dark);
}

.room-detail {
  display: flex;
  align-items: center;
  gap: 5px;
}

.room-join-btn {
  padding: 8px 20px;
}

/* 大廳底部 */
.lobby-footer {
  text-align: center;
  padding: 20px;
  border-top: 1px solid rgba(255, 215, 0, 0.2);
  margin-top: 30px;
}

.player-id-display {
  color: var(--gold-dark);
}

.player-id-display .id-value {
  color: var(--gold);
  font-family: var(--font-display);
  margin-left: 10px;
}

/* ========================================
   按鈕樣式
   ======================================== */

.btn {
  font-family: var(--font-display);
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: var(--black);
  border: 2px solid var(--gold);
}

.btn-primary:hover {
  box-shadow: var(--shadow-gold);
  transform: translateY(-2px);
}

.btn-danger {
  background: linear-gradient(180deg, var(--crimson) 0%, var(--crimson-dark) 100%);
  color: white;
  border: 2px solid var(--crimson);
}

.btn-danger:hover {
  box-shadow: var(--shadow-crimson);
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.btn-large {
  padding: 15px 30px;
  font-size: 1.1rem;
  width: 100%;
}

.btn-icon {
  font-size: 1.2em;
}

/* ========================================
   遊戲界面樣式
   ======================================== */

.game-hidden,
.hidden {
  display: none !important;
}

.bet-slider {
  width: 100%;
  margin: 8px 0;
  accent-color: var(--gold);
  cursor: pointer;
}

.card-flip-wrapper { perspective: 600px; }
.card-flip-inner {
  transform-style: preserve-3d;
  animation: cardFlip 0.5s ease-out forwards;
}
@keyframes cardFlip {
  0%   { transform: rotateY(90deg) scale(0.8); opacity: 0; }
  100% { transform: rotateY(0deg)  scale(1);   opacity: 1; }
}

@keyframes winPulse  { 0%,100%{box-shadow:0 0 30px rgba(0,255,136,0.4)} 50%{box-shadow:0 0 80px rgba(0,255,136,0.9)} }
@keyframes losePulse { 0%,100%{box-shadow:0 0 30px rgba(255,68,68,0.4)}  50%{box-shadow:0 0 80px rgba(255,68,68,0.9)}  }
.result-overlay.win-effect  { animation: winPulse  0.6s ease-in-out 3; }
.result-overlay.lose-effect { animation: losePulse 0.6s ease-in-out 3; }

/* 房間信息欄 */
.room-info-bar {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: linear-gradient(90deg, var(--black-light) 0%, rgba(255, 215, 0, 0.1) 50%, var(--black-light) 100%);
  border: 1px solid var(--gold-dark);
  border-radius: 15px;
  margin-bottom: 10px;
}

.room-code-display {
  display: flex;
  align-items: center;
  gap: 10px;
}

.code-label {
  color: var(--gold-dark);
  font-size: 0.9rem;
}

.code-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 4px;
}

.btn-copy {
  background: transparent;
  border: 1px solid var(--gold-dark);
  color: var(--gold);
}

.btn-copy:hover {
  background: var(--gold);
  color: var(--black);
}

.room-name-display {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--gold-light);
}

.btn-leave {
  padding: 8px 20px;
}

/* 玩家角色 */
.player-role {
  display: flex;
  align-items: center;
}

.role-badge {
  padding: 5px 15px;
  background: linear-gradient(180deg, var(--black-lighter) 0%, var(--black-light) 100%);
  border: 1px solid var(--gold-dark);
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--gold-dark);
}

.role-badge.host {
  background: linear-gradient(180deg, var(--gold-dark) 0%, var(--gold) 100%);
  color: var(--black);
  border-color: var(--gold);
}

/* 等待覆蓋層 */
.waiting-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99;
  opacity: 1;
  transition: opacity 0.5s;
}

.waiting-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.waiting-content {
  text-align: center;
}

.waiting-icon {
  font-size: 4rem;
  animation: pulse 2s ease-in-out infinite;
}

.waiting-text {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--gold-dark);
  margin: 20px 0 30px;
}

.start-game-btn {
  display: none;
}

.start-game-btn.show {
  display: inline-flex;
}

.add-bot-btn {
  display: none;
  margin-top: 8px;
}

.add-bot-btn.show {
  display: inline-flex;
}

/* 聊天面板 */
.chat-panel {
  grid-column: 2;
  background: linear-gradient(180deg, var(--black-light) 0%, var(--black) 100%);
  border: 2px solid var(--gold-dark);
  border-radius: 15px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  max-height: 250px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 80px;
}

.chat-message {
  padding: 8px 10px;
  background: rgba(255, 215, 0, 0.05);
  border-radius: 8px;
  font-size: 0.85rem;
}

.chat-message .sender {
  color: var(--gold);
  font-weight: 500;
  margin-right: 8px;
}

.chat-message .text {
  color: var(--gold-light);
}

.chat-message.system {
  background: rgba(0, 206, 209, 0.1);
  text-align: center;
  color: var(--info);
  font-size: 0.8rem;
}

.chat-input-area {
  display: flex;
  gap: 8px;
}

.chat-input {
  flex: 1;
  padding: 8px 12px;
  background: var(--black-lighter);
  border: 1px solid var(--gold-dark);
  border-radius: 8px;
  color: var(--gold-light);
  font-family: var(--font-body);
  font-size: 0.9rem;
}

.chat-input:focus {
  outline: none;
  border-color: var(--gold);
}

.btn-send {
  background: var(--gold-dark);
  color: var(--gold-light);
  border: none;
  padding: 8px 15px;
}

.btn-send:hover {
  background: var(--gold);
  color: var(--black);
}

/* 成功提示 */
.success-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: linear-gradient(135deg, var(--success) 0%, #00AA55 100%);
  color: white;
  padding: 15px 30px;
  border-radius: 10px;
  box-shadow: 0 0 30px rgba(0, 255, 136, 0.3);
  transition: transform 0.3s ease;
  z-index: 1000;
}

.success-toast.show {
  transform: translateX(-50%) translateY(0);
}

/* 玩家列表中的房主標記 */
.player-item.host {
  border-left-color: var(--gold);
}

.player-item.host .player-name::after {
  content: ' 👑';
}

/* ========================================
   響應式設計補充
   ======================================== */

@media (max-width: 768px) {
  .lobby-title {
    font-size: 2.5rem;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .room-info-bar {
    flex-direction: column;
    gap: 15px;
  }
  
  .room-code-display {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .chat-panel {
    grid-column: 1;
  }
}
/* ========================================
   撲克牌樣式
   ======================================== */

.card-game-board {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  min-height: 450px;
}

/* 彩金池 */
.pot-display {
  text-align: center;
  margin-bottom: 30px;
}

.pot-label {
  font-size: 0.9rem;
  color: var(--gold-dark);
  display: block;
}

.pot-value {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

/* 門柱牌區域 */
.pillar-cards-area {
  text-align: center;
  margin-bottom: 30px;
}

.pillar-label, .shot-label {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--gold-dark);
  margin-bottom: 15px;
}

.pillar-cards {
  display: flex;
  gap: 40px;
  justify-content: center;
  margin-bottom: 10px;
}

.gate-info {
  font-size: 1rem;
  padding: 8px 15px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 20px;
  display: inline-block;
}

/* 射龍門牌區域 */
.shot-card-area {
  text-align: center;
  margin-bottom: 20px;
}

.shot-card {
  display: flex;
  justify-content: center;
}

/* 撲克牌 */
.card {
  width: 80px;
  height: 112px;
  background: linear-gradient(135deg, #fff 0%, #f0f0f0 100%);
  border: 2px solid #ddd;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.card-back {
  background: linear-gradient(135deg, var(--crimson-dark) 0%, var(--crimson) 100%);
  border-color: var(--gold-dark);
}

.card-back-design {
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: var(--gold);
  text-shadow: 0 0 10px var(--gold);
}

.card-value {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
}

.card-suit {
  font-size: 2rem;
  line-height: 1;
}

.reveal-animation {
  animation: cardReveal 0.5s ease-out;
}

@keyframes cardReveal {
  0% {
    transform: scale(0.5) rotateY(180deg);
    opacity: 0;
  }
  100% {
    transform: scale(1) rotateY(0deg);
    opacity: 1;
  }
}

/* 結果顯示 */
.result-display {
  padding: 15px 30px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 15px;
  border: 2px solid var(--gold);
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.3s;
}

.result-display.show {
  opacity: 1;
  transform: scale(1);
}

.result-display.win {
  border-color: var(--success);
  box-shadow: 0 0 30px rgba(0, 255, 136, 0.3);
}

.result-display .result-text {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--gold);
  text-align: center;
}

/* 當前回合玩家 */
.player-item.current-turn {
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.2), transparent);
  border-left-color: var(--success) !important;
  animation: currentPulse 1.5s ease-in-out infinite;
}

@keyframes currentPulse {
  0%, 100% { background: linear-gradient(90deg, rgba(255, 215, 0, 0.2), transparent); }
  50% { background: linear-gradient(90deg, rgba(255, 215, 0, 0.3), transparent); }
}

/* 下注確認按鈕 */
.btn-confirm-bet {
  width: 100%;
  margin-top: 15px;
  padding: 12px;
  font-size: 1.1rem;
}

.btn-confirm-bet:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 下注範圍 */
.bet-info {
  text-align: center;
  margin-bottom: 10px;
}

.bet-range-label {
  font-size: 0.85rem;
  color: var(--gold-dark);
}

.bet-range-value {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--gold);
  margin-left: 5px;
}

/* 歷史記錄樣式 */
.history-player {
  font-size: 0.8rem;
  color: var(--gold-dark);
  min-width: 50px;
}

.history-cards {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--gold);
}

.history-result {
  font-size: 0.75rem;
  color: var(--success);
  margin-left: auto;
}

/* ========================================
   手機響應式設計
   ======================================== */

@media (max-width: 768px) {
  /* 大廳 */
  .lobby-title {
    font-size: 2rem;
  }
  
  .title-icon {
    font-size: 1.5rem;
  }
  
  .lobby-subtitle {
    font-size: 0.9rem;
    letter-spacing: 4px;
  }
  
  .lobby-container {
    padding: 15px;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .odds-row {
    grid-template-columns: 1fr 1fr;
  }
  
  .odds-section {
    padding: 10px;
  }
  
  .room-card {
    flex-direction: column;
    gap: 10px;
  }
  
  .room-join-btn {
    width: 100%;
  }
  
  /* 遊戲界面 */
  .container {
    padding: 10px;
    gap: 10px;
    grid-template-columns: 1fr !important;
  }
  
  .header {
    padding: 10px 0;
  }
  
  .title {
    font-size: 1.8rem;
  }
  
  .room-info-bar {
    flex-direction: column;
    gap: 10px;
    padding: 10px;
  }
  
  .room-code-display {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .code-value {
    font-size: 1.2rem;
  }
  
  .player-info {
    flex-direction: row;
    gap: 15px;
    padding: 10px;
  }
  
  .chip-value {
    font-size: 1.1rem;
  }
  
  /* 撲克牌 */
  .card-game-board {
    padding: 15px 10px;
    min-height: auto;
  }
  
  .pot-value {
    font-size: 2rem;
  }
  
  .pillar-cards {
    gap: 20px;
  }
  
  .card {
    width: 60px;
    height: 84px;
  }
  
  .card-value {
    font-size: 1.3rem;
  }
  
  .card-suit {
    font-size: 1.5rem;
  }
  
  .card-back-design {
    font-size: 1.8rem;
  }
  
  .gate-info {
    font-size: 0.8rem;
  }
  
  /* 下注區域 */
  .betting-area {
    padding: 15px;
  }
  
  .bet-amount-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  
  .bet-btn {
    padding: 10px 8px;
    font-size: 0.9rem;
  }
  
  .bet-btn.all-in {
    grid-column: span 3;
  }
  
  /* 面板 */
  .players-panel,
  .history-panel,
  .current-bets-panel,
  .chat-panel {
    grid-column: 1;
    max-height: 180px;
  }
  
  .panel-title {
    font-size: 0.9rem;
  }
  
  .player-item {
    padding: 6px;
    font-size: 0.85rem;
  }
  
  /* 聊天 */
  .chat-input {
    font-size: 0.9rem;
  }
  
  .btn-send {
    padding: 6px 12px;
  }
  
  /* 等待覆蓋層 */
  .waiting-icon {
    font-size: 3rem;
  }
  
  .waiting-text {
    font-size: 1rem;
  }
  
  .start-game-btn {
    padding: 12px 20px;
    font-size: 1rem;
  }
  
  /* 結果顯示 */
  .result-display {
    padding: 10px 15px;
  }
  
  .result-display .result-text {
    font-size: 0.95rem;
  }
  
  /* 歷史 */
  .history-item {
    flex-wrap: wrap;
    gap: 5px;
  }
  
  .history-cards {
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .lobby-title {
    font-size: 1.6rem;
  }
  
  .title-icon {
    font-size: 1.2rem;
  }
  
  .form-label {
    font-size: 0.85rem;
  }
  
  .form-input,
  .form-select {
    padding: 10px;
    font-size: 0.9rem;
  }
  
  .card {
    width: 50px;
    height: 70px;
  }
  
  .card-value {
    font-size: 1.1rem;
  }
  
  .card-suit {
    font-size: 1.2rem;
  }
  
  .pillar-cards {
    gap: 15px;
  }
  
  .pot-value {
    font-size: 1.6rem;
  }
  
  .bet-amount-selector {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .bet-btn.all-in {
    grid-column: span 2;
  }
}

/* 猜大小按鈕 */
.no-gate-guess { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.no-gate-guess.hidden { display: none; }
.guess-label { color: var(--gold); font-size: 0.9rem; }
.guess-btn { padding: 8px 20px; background: rgba(255,255,255,0.1); border: 2px solid var(--gold-dark); color: var(--gold-light); border-radius: 8px; cursor: pointer; font-size: 1rem; font-weight: bold; transition: all 0.2s; }
.guess-btn.active { background: var(--gold-dark); color: #000; border-color: var(--gold); }
.guess-btn:hover { background: rgba(184,134,11,0.4); }
