/* ==========================================================================
   Casino Dealer Practice App - Premium Stylesheet
   ========================================================================== */

/* --- CSS Variables & Design Tokens --- */
:root {
  --felt-green-grad: linear-gradient(135deg, #0f462c 0%, #061d12 100%);
  --felt-green: #0a331f;
  --gold: #e5c158;
  --gold-hover: #f3d782;
  --gold-glow: 0 0 15px rgba(229, 193, 88, 0.4);
  --dark-gold: #aa862c;
  --red: #df4747;
  --red-glow: 0 0 15px rgba(223, 71, 71, 0.4);
  --green: #2ecc71;
  --green-glow: 0 0 15px rgba(46, 204, 113, 0.4);
  --blue: #3498db;
  
  --dark-bg: #090a0f;
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-card-bg: rgba(10, 15, 25, 0.7);
  
  --font-serif: 'Cinzel', 'Noto Sans JP', serif;
  --font-sans: 'Outfit', 'Noto Sans JP', sans-serif;
  
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-card-hover: 0 15px 40px rgba(0, 0, 0, 0.6);
  --shadow-btn: 0 4px 10px rgba(0, 0, 0, 0.3);
  
  --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-fast: all 0.1s ease;
}

/* --- Base Reset & Setup --- */
.hidden {
  display: none !important;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body, html {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background-color: var(--dark-bg);
  font-family: var(--font-sans);
  color: #f5f6fa;
  display: flex;
  justify-content: center;
  align-items: center;
}

#app-container {
  width: 100%;
  height: 100%;
  max-width: 500px; /* Mobile first frame */
  background: var(--felt-green-grad);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

/* For larger PC screens, allow centered display with a clean container */
@media (min-width: 768px) {
  body {
    background-color: #0b0c10;
  }
  #app-container {
    height: 92%;
    border-radius: 20px;
    border: 2px solid var(--gold);
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.9), var(--gold-glow);
  }
}

/* --- Typography --- */
h1, h2, h3, h4, .brand-title, .brand-subtitle {
  font-family: var(--font-serif);
  letter-spacing: 1px;
}

.gold-text {
  color: var(--gold);
}
.red-text {
  color: var(--red);
}
.text-green {
  color: var(--green);
}
.text-red {
  color: var(--red);
}
.text-gold {
  color: var(--gold);
}
.text-blue {
  color: var(--blue);
}
.text-glow {
  text-shadow: 0 0 10px rgba(229, 193, 88, 0.5);
}

/* --- Button Styles --- */
.btn {
  font-family: var(--font-sans);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-btn);
}

.btn:active {
  transform: scale(0.96);
}

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

.btn-gold {
  background: linear-gradient(135deg, var(--gold) 0%, var(--dark-gold) 100%);
  color: #111;
  text-shadow: 0 0.5px 1px rgba(255, 255, 255, 0.4);
}
.btn-gold:hover {
  background: linear-gradient(135deg, var(--gold-hover) 0%, var(--gold) 100%);
  box-shadow: var(--gold-glow);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
}
.btn-outline:hover {
  background: rgba(229, 193, 88, 0.1);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  padding: 0;
}
.btn-icon:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-danger {
  background: linear-gradient(135deg, var(--red) 0%, #a82e2e 100%);
  color: white;
}
.btn-danger:hover {
  box-shadow: var(--red-glow);
}

/* --- Glassmorphic Container Card --- */
.glass-card {
  background: var(--glass-card-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
}

/* --- Screen Transitions --- */
.app-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 1;
  overflow-y: auto; /* Enable scroll inside screens */
}

#game-screen {
  overflow: hidden !important;
}

.app-screen.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  z-index: 10;
}

/* ==========================================================================
   LOBBY SCREEN STYLING
   ========================================================================== */
#welcome-screen {
  align-items: center;
  padding: 24px;
}

.welcome-card {
  margin: auto 0; /* Vertical centering if space, else scrollable */
  padding: 32px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.casino-logo-wrapper {
  margin-bottom: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.lobby-logo {
  max-width: 140px;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), var(--gold-glow);
  border: 1px solid var(--glass-border);
}

.brand-title {
  font-size: 2.6rem;
  font-weight: 900;
  background: linear-gradient(180deg, #fff 30%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: var(--gold-glow);
  line-height: 1;
}

.brand-subtitle {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--gold);
  border-bottom: 2px solid var(--gold);
  padding-bottom: 6px;
  width: 80%;
  margin-top: -10px;
}

.brand-desc {
  font-size: 0.9rem;
  color: #a4b0be;
  margin-bottom: 5px;
  line-height: 1.4;
}

/* Form Inputs */
.input-group {
  width: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.input-group input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 12px 16px;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 1rem;
  transition: var(--transition-smooth);
}

.input-group input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: var(--gold-glow);
}

/* Mode Selection Cards */
.mode-selection-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 5px 0;
}

.mode-group-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 6px;
}

.modes-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.mode-select-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 10px 14px;
  text-align: left;
  cursor: pointer;
  transition: var(--transition-smooth);
  color: #f5f6fa;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.mode-select-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 4px;
  background: transparent;
  transition: var(--transition-smooth);
}

.mode-select-card.active {
  background: rgba(229, 193, 88, 0.08);
  border-color: var(--gold);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.mode-select-card.active::before {
  background: var(--gold);
}

.mode-select-card[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  border-color: rgba(255, 255, 255, 0.05);
}

.mode-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  align-self: flex-start;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.bj-badge { background: #34495e; color: #fff; }
.baccarat-badge { background: #9b59b6; color: #fff; }
.poker-badge { background: #d35400; color: #fff; }

.mode-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.mode-desc {
  font-size: 0.75rem;
  color: #a4b0be;
}

.welcome-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  width: 100%;
}

/* Compact Stats inside welcome card */
.lobby-stats-section {
  width: 100%;
  margin-top: 10px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
}

.lobby-stats-section h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
}

.stats-grid-compact {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stat-box-compact {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
}

.stat-box-compact .label {
  font-size: 0.65rem;
  color: #747d8c;
  margin-bottom: 2px;
}

.stat-box-compact .value {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
}

/* ==========================================================================
   GAME SCREEN STYLING
   ========================================================================== */
.game-header {
  height: 44px;
  min-height: 44px;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  z-index: 10;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dealer-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-mode-banner {
  font-family: var(--font-serif);
}

.mode-label {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--gold);
  border: 1px solid var(--gold);
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 1px;
  background: rgba(229, 193, 88, 0.05);
}

.shoe-status {
  font-size: 0.7rem;
  font-weight: 600;
  color: #a4b0be;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Live Score Dashboard */
.live-dashboard {
  display: none !important; /* Hide by default for mobile-first */
  height: 52px;
  min-height: 52px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  text-align: center;
}

.dash-item {
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.dash-item:last-child {
  border-right: none;
}

.dash-label {
  font-size: 0.6rem;
  color: #747d8c;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.dash-val {
  font-size: 1rem;
  font-weight: 700;
  margin-top: 1px;
}

/* Play Field Table Styling */
.play-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 6px;
  position: relative;
  justify-content: center;
}

.felt-border {
  flex: 1;
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 6px;
  position: relative;
  min-height: 0;
}

.table-brand {
  font-family: var(--font-serif);
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.12);
  text-align: center;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
  width: 100%;
  padding-bottom: 2px;
  letter-spacing: 0.5px;
}

/* Cards Area */
.cards-area {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 100%;
  flex-wrap: wrap;
  min-height: 82px;
}

.card-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.25);
  font-size: 0.9rem;
}

.card-placeholder i {
  font-size: 2rem;
  animation: rotate 2s linear infinite;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Card Component Design */
.card-item {
  width: 56px;
  height: 82px;
  background-color: #ffffff;
  border-radius: 6px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
  color: #1d1d1d;
  position: relative; /* reference for absolute coordinates */
  border: 1px solid #dcdde1;
  font-family: 'Cinzel', Georgia, serif;
  animation: dealCard 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
  opacity: 0;
  transform: translateY(-50px) rotate(-15deg);
  overflow: hidden;
}

@keyframes dealCard {
  to {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
  }
}

.card-item.red-suit {
  color: var(--red);
}

.card-top-left {
  position: absolute;
  top: 4px;
  left: 5px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 0.9;
}

.card-bottom-right {
  position: absolute;
  bottom: 4px;
  right: 5px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 0.9;
  transform: rotate(180deg);
}

.card-rank {
  font-size: 0.95rem;
  font-weight: 700;
}

.card-suit {
  font-size: 0.65rem;
  margin-top: -1px;
}

.card-center-suit {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.0rem;
  line-height: 1;
}

/* Prompt and Helper Text */
.prompt-container {
  text-align: center;
  width: 100%;
  z-index: 5;
}

.prompt-text {
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 1px;
}

.helper-guide {
  font-size: 0.62rem;
  color: var(--gold);
  background: rgba(229, 193, 88, 0.1);
  border: 1px solid rgba(229, 193, 88, 0.2);
  border-radius: 4px;
  padding: 1px 4px;
  display: inline-block;
}

/* Toast Message Overlay */
.toast {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: rgba(10, 15, 25, 0.92);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 16px 28px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.toast-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.toast-content i {
  font-size: 2.2rem;
}

.toast.success {
  border-color: var(--green);
  box-shadow: var(--green-glow), 0 10px 30px rgba(0, 0, 0, 0.5);
}
.toast.success i {
  color: var(--green);
}

.toast.error {
  border-color: var(--red);
  box-shadow: var(--red-glow), 0 10px 30px rgba(0, 0, 0, 0.5);
}
.toast.error i {
  color: var(--red);
}

.toast-msg {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

/* ==========================================================================
   INPUT & KEYPAD STYLING
   ========================================================================== */
.input-section {
  background: rgba(9, 10, 15, 0.85);
  border-top: 1px solid var(--glass-border);
  padding: 6px 10px 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Display typed text */
.input-display-wrapper {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 2px 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 30px;
}

.input-display {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-display:empty::before {
  content: attr(placeholder);
  color: rgba(255, 255, 255, 0.25);
  font-size: 1rem;
  font-weight: 400;
}

.keypad-container {
  width: 100%;
}

/* Main virtual keypad grids */
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  width: 100%;
}

.keypad-poker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  width: 100%;
}

.keypad-poker-grid .poker-key-btn:first-child {
  grid-column: span 3;
  height: 52px;
}

.keypad-bc-condition-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  width: 100%;
}

.keypad-bc-condition-grid .bc-condition-btn:first-child {
  grid-column: span 2;
  height: 62.4px; /* 93.6px x 2/3 */
}

.keypad-bc-condition-grid .bc-condition-btn:not(:first-child) {
  height: 131.625px; /* 175.5px x 3/4 */
}

.keypad-bc-sub-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  width: 100%;
}

/* Touch keys */
.key-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 1.1rem;
  height: 78px;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.poker-key-btn, .bc-condition-btn, .bc-sub-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 5px;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  height: 78px;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  border-left: 3px solid var(--gold);
}

.bc-condition-btn {
  font-size: 1.15rem;
  font-weight: 700;
  flex-direction: column;
  gap: 4px;
}

.bc-condition-sub-note {
  font-size: 0.7rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.4);
}

.bc-sub-btn {
  font-size: 1.1rem;
  font-weight: 700;
  white-space: nowrap;
}

.key-btn:active, .poker-key-btn:active, .bc-condition-btn:active, .bc-sub-btn:active {
  background: rgba(255, 255, 255, 0.18);
  transform: scale(0.95);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Keypad variations */
.key-btn.special-key {
  color: var(--gold);
  font-weight: 700;
}

.key-btn.disabled-key {
  opacity: 0.1;
  pointer-events: none;
}

.key-btn.action-key {
  color: #a4b0be;
}

.key-btn.wide-key {
  grid-column: span 1;
}

.key-btn.bust-key {
  background: linear-gradient(135deg, rgba(223, 71, 71, 0.15) 0%, rgba(223, 71, 71, 0.05) 100%);
  border-color: rgba(223, 71, 71, 0.3);
  color: #ff6b6b;
  font-size: 1rem;
  font-weight: 700;
}

.key-btn.submit-key {
  background: linear-gradient(135deg, var(--gold) 0%, var(--dark-gold) 100%);
  color: #111;
  font-size: 1rem;
  font-weight: 700;
  grid-column: span 1;
}
.key-btn.submit-key:active {
  background: var(--gold-hover);
}

#keypad-numeric, #keypad-poker {
  display: none;
}

#keypad-numeric.active, #keypad-poker.active {
  display: grid;
}

/* ==========================================================================
   MODAL DIALOG STYLING
   ========================================================================== */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 100%;
  max-width: 440px;
  max-height: 90%;
  display: flex;
  flex-direction: column;
  animation: modalEnter 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalEnter {
  from { transform: translateY(20px) scale(0.96); }
  to { transform: translateY(0) scale(1); }
}

.modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.setting-desc {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.setting-desc .title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.setting-desc .detail {
  font-size: 0.75rem;
  color: #a4b0be;
  line-height: 1.3;
}

.setting-section-header {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 15px;
  margin-top: 5px;
}

.setting-section-header h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gold);
}

.input-tip {
  font-size: 0.75rem;
  color: #747d8c;
  line-height: 1.3;
  margin-top: -2px;
}

/* Danger Zone */
.danger-zone {
  border: 1px dashed rgba(223, 71, 71, 0.3);
  border-radius: 8px;
  padding: 14px;
  background: rgba(223, 71, 71, 0.02);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.danger-zone h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: #ff6b6b;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: flex-end;
}

/* --- Toggle Switch Styling --- */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  min-width: 48px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: .3s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .3s;
}

input:checked + .slider {
  background-color: var(--gold);
}

input:checked + .slider:before {
  transform: translateX(22px);
  background-color: #111;
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

/* ==========================================================================
   UPDATED / ADDED STYLES FOR V3
   ========================================================================== */

.chips-badge {
  background: #16a085;
  color: #fff;
}

/* Texas Hold'em Card Section Layout */
.texas-cards-area {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.texas-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.texas-section-label {
  display: none !important; /* Hide on mobile first */
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--gold);
  background: rgba(229, 193, 88, 0.08);
  border: 1px solid rgba(229, 193, 88, 0.25);
  padding: 2px 10px;
  border-radius: 20px;
  letter-spacing: 1px;
}

.cards-area-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  width: 100%;
  min-height: 82px;
}

/* Chips Practice Layout */
.chips-area {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.chips-felt-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 12px;
}

.chips-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 1px;
}

.chips-grid {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 4px;
  width: 100%;
  min-height: 60px;
  padding-bottom: 2px;
}

.chip-total-banner {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
  padding: 1px 6px;
  border-radius: 8px;
  font-family: var(--font-sans);
}

/* 3D Chip Stack */
.chip-stack {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  position: relative;
  width: 38px;
  height: 54px;
}

.chip-stack-item {
  position: absolute;
  transition: var(--transition-smooth);
}

.chip-stack-item:nth-child(1) { bottom: 0; }
.chip-stack-item:nth-child(2) { bottom: 2px; }
.chip-stack-item:nth-child(3) { bottom: 4px; }
.chip-stack-item:nth-child(4) { bottom: 6px; }
.chip-stack-item:nth-child(5) { bottom: 8px; }
.chip-stack-item:nth-child(6) { bottom: 10px; }
.chip-stack-item:nth-child(7) { bottom: 12px; }
.chip-stack-item:nth-child(8) { bottom: 14px; }
.chip-stack-item:nth-child(9) { bottom: 16px; }
.chip-stack-item:nth-child(10) { bottom: 18px; }

/* Casino Chip CSS */
.casino-chip {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.65rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.3);
  position: relative;
  color: #fff;
  border: 1.5px dashed rgba(255, 255, 255, 0.65);
}

.chip-green {
  background: radial-gradient(circle, #2bcbba 0%, #0fb9b1 100%);
}

.chip-blue {
  background: radial-gradient(circle, #2e86de 0%, #130cb7 100%);
}

.chip-pink {
  background: radial-gradient(circle, #fda7df 0%, #d859b6 100%);
}

.chip-red-gold {
  background: radial-gradient(circle, #eb3b5a 0%, #b3102c 100%);
  border-color: var(--gold);
}

/* Keypad Spans */
.key-btn.wide-key-span-3 {
  grid-column: span 3;
  background: linear-gradient(135deg, var(--gold) 0%, var(--dark-gold) 100%);
  color: #111;
  font-size: 1.05rem;
  font-weight: 700;
  height: 52px;
}

.key-btn.wide-key-span-3:active {
  background: var(--gold-hover);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   DESKTOP / PC LANDSCAPE MEDIA QUERY (Side-by-side design)
   ========================================================================== */
@media (min-width: 768px) {
  body {
    overflow: auto; /* Enable page scroll if screen is too small */
  }

  #app-container {
    max-width: 840px; /* Extended width for side-by-side layout */
    height: 92%;
    min-height: 560px;
    max-height: 900px;
    border-radius: 16px;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.9), var(--gold-glow);
  }

  #game-screen {
    display: grid;
    grid-template-columns: 55% 45%;
    grid-template-rows: auto auto 1fr;
    height: 100%;
    overflow: hidden;
  }

  .game-header {
    grid-column: span 2;
    height: 56px;
    min-height: 56px;
    padding: 0 16px;
  }
  
  .dealer-badge {
    font-size: 0.85rem;
    padding: 4px 10px;
  }
  
  .mode-label {
    font-size: 0.8rem;
    padding: 2px 8px;
  }
  
  .shoe-status {
    font-size: 0.75rem;
  }

  .live-dashboard {
    display: grid !important; /* Restore score dashboard */
    grid-column: span 2;
  }

  .play-field {
    grid-column: 1;
    height: 100%;
    border-right: 1px solid var(--glass-border);
    padding: 16px;
    overflow-y: auto; /* Enable vertical scroll inside table area */
  }

  .felt-border {
    justify-content: space-between;
    gap: 0;
    padding: 16px 12px;
  }

  .card-item {
    width: 76px;
    height: 112px;
    border-radius: 8px;
  }
  
  .card-rank {
    font-size: 1.05rem;
  }
  
  .card-suit {
    font-size: 0.75rem;
  }
  
  .card-center-suit {
    font-size: 2rem;
  }
  
  .card-top-left {
    top: 5px;
    left: 6px;
  }
  
  .card-bottom-right {
    bottom: 5px;
    right: 6px;
  }
  
  .cards-area {
    min-height: 120px;
    gap: 12px;
  }
  
  .cards-area-row {
    min-height: 112px;
    gap: 8px;
  }
  
  .texas-cards-area {
    gap: 24px;
  }
  
  .texas-section {
    gap: 6px;
  }
  
  .texas-section-label {
    display: inline-block !important;
  }

  .prompt-text {
    font-size: 0.95rem;
    margin-bottom: 4px;
  }
  
  .helper-guide {
    font-size: 0.75rem;
    padding: 4px 10px;
  }

  .input-section {
    grid-column: 2;
    height: 100%;
    border-top: none;
    justify-content: center;
    padding: 16px 20px 24px 20px;
    background: rgba(9, 10, 15, 0.95);
    overflow-y: auto; /* Enable vertical scroll inside inputs area */
  }

  .keypad-poker-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .poker-key-btn:last-child {
    grid-column: span 1 !important;
  }

  .keypad-bc-condition-grid, .keypad-bc-sub-grid {
    gap: 8px !important;
  }

  .key-btn {
    height: 84px;
    font-size: 1.4rem;
  }

  .poker-key-btn, .bc-condition-btn, .bc-sub-btn {
    height: 84px;
    font-size: 0.95rem;
  }

  .keypad-bc-condition-grid .bc-condition-btn:first-child {
    height: 62.4px; /* 93.6px x 2/3, unchanged from mobile */
  }

  .keypad-bc-condition-grid .bc-condition-btn:not(:first-child) {
    height: 141.75px; /* 189px x 3/4 */
  }

  .bc-condition-btn {
    font-size: 1.35rem;
    font-weight: 700;
    flex-direction: column;
    gap: 4px;
  }

  .bc-condition-sub-note {
    font-size: 0.85rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.4);
  }

  .bc-sub-btn {
    font-size: 1.3rem;
    font-weight: 700;
    white-space: nowrap;
  }

  .key-btn.wide-key-span-3 {
    height: 84px;
    font-size: 1.05rem;
  }

  .chips-grid {
    min-height: 120px;
    gap: 16px;
    padding-bottom: 10px;
  }
  
  .chip-stack {
    width: 54px;
    height: 90px;
  }
  
  .casino-chip {
    width: 50px;
    height: 50px;
    border-width: 3.5px;
    font-size: 0.8rem;
  }
  
  .chip-total-banner {
    font-size: 1.1rem;
    padding: 5px 14px;
  }

  /* Two column layout for welcome lobby cards on PC */
  .modes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 4px;
  }


  .chips-multiplier-huge {
    font-size: 3rem;
  }
}

/* --- Added for UI requirements --- */
.chips-multiplier-huge {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--gold);
  text-shadow: var(--gold-glow);
  margin-bottom: -4px;
  font-family: var(--font-serif);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  15%, 45%, 75% { transform: translateX(-4px); }
  30%, 60%, 90% { transform: translateX(4px); }
}

.shake-animation {
  animation: shake 0.3s ease-in-out;
}

.input-group select.style-select {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 12px 16px;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 1rem;
  transition: var(--transition-smooth);
  cursor: pointer;
  width: 100%;
}

.input-group select.style-select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: var(--gold-glow);
}

.input-group select.style-select option {
  background-color: #0b0c10;
  color: #fff;
}

/* --- Google Auth Section --- */
.auth-section {
  width: 100%;
}

.auth-signin-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px 12px;
  border: 1px dashed var(--glass-border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
}

.auth-guest-note {
  font-size: 0.72rem;
  color: #747d8c;
  text-align: center;
  line-height: 1.4;
}

.auth-guest-note strong {
  color: #a4b0be;
}

.auth-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--gold);
  border-radius: 10px;
  background: rgba(229, 193, 88, 0.06);
}

.auth-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
  flex-shrink: 0;
}

.auth-user-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.auth-display-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auth-save-note {
  font-size: 0.68rem;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 4px;
}

.auth-signout-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #a4b0be;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  padding: 0;
  flex-shrink: 0;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-signout-btn:hover {
  border-color: var(--red);
  color: var(--red);
}

/* --- Countdown Overlay --- */
.countdown-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 15, 10, 0.92);
  backdrop-filter: blur(6px);
  z-index: 50;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 28px;
}

.countdown-overlay.hidden {
  display: none !important;
}

.countdown-start-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.countdown-ready-text {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  gap: 8px;
}

.countdown-start-btn {
  font-size: 1.4rem;
  font-family: var(--font-serif);
  letter-spacing: 4px;
  padding: 16px 56px;
  border-radius: 12px;
  animation: pulseGlow 1.8s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 15px rgba(229, 193, 88, 0.3); }
  50% { box-shadow: 0 0 40px rgba(229, 193, 88, 0.7); }
}

.countdown-number {
  font-size: 9rem;
  font-weight: 900;
  font-family: var(--font-serif);
  color: var(--gold);
  text-shadow: 0 0 40px rgba(229, 193, 88, 0.6);
  line-height: 1;
  animation: countPulse 0.9s ease-out forwards;
}

@keyframes countPulse {
  0% { transform: scale(1.6); opacity: 0; }
  40% { transform: scale(1); opacity: 1; }
  80% { transform: scale(0.95); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.9; }
}

.countdown-go {
  color: var(--green);
  text-shadow: 0 0 40px rgba(46, 204, 113, 0.6);
  font-size: 7rem;
  animation: countPulse 0.6s ease-out forwards;
}

/* ==========================================================================
   POKER COMPARE MODE STYLING
   ========================================================================== */
.compare-cards-area {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.compare-hand-btn {
  flex-direction: column;
  height: auto !important;
  min-height: 110px;
  padding: 10px;
  width: 100%;
  gap: 6px;
}

.compare-hand {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  flex: 1;
}

.compare-label {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 6px;
  letter-spacing: 1px;
}

.compare-vs {
  font-size: 1.5rem;
  font-weight: 900;
  font-family: var(--font-serif);
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.cards-area-row {
  display: flex;
  gap: 4px;
}

.keypad-compare-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  display: none;
}

.keypad-compare-grid.active {
  display: flex;
}

.compare-key-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 1.1rem;
  font-weight: 700;
  height: 64px;
  width: 100%;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.compare-key-btn:active {
  transform: scale(0.97);
  background: rgba(255, 255, 255, 0.15);
}

.btn-left { border-top: 4px solid var(--blue); }
.btn-right { border-bottom: 4px solid var(--red); }
.btn-tie { border-left: 4px solid #a4b0be; border-right: 4px solid #a4b0be; }

/* Scale down cards to fit 10 cards horizontally if needed */
.compare-cards-area .card-item {
  width: 44px;
  height: 64px;
  font-family: 'Cinzel', Georgia, serif;
}
.compare-cards-area .card-rank {
  font-size: 0.75rem;
}
.compare-cards-area .card-center-suit {
  font-size: 1.1rem;
}
.compare-cards-area .card-top-left {
  top: 3px;
  left: 4px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 0.9;
}
.compare-cards-area .card-bottom-right {
  bottom: 3px;
  right: 4px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 0.9;
  transform: rotate(180deg);
}
.compare-cards-area .card-suit {
  font-size: 0.5rem;
  margin-top: -2px;
}
