/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Georgia', serif;
  background: #1a1a1a;
  color: #f0e8d8;
  height: 100vh;
  overflow: hidden;
  user-select: none;
}

.screen { display: none; width: 100vw; height: 100vh; }
.screen.active { display: flex; }

/* ── Splash ───────────────────────────────────────────────────────────────── */
#screen-splash {
  position: relative;
  align-items: center;
  justify-content: center;
  background: #000;
}

#splash-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, #1a0e06 0%, #000 70%);
}

#splash-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

#splash-img {
  max-width: min(1300px, 99vw);
  max-height: 94vh;
  object-fit: contain;
}

#splash-lang-btns {
  display: flex;
  gap: 18px;
  justify-content: center;
}

#app-version {
  position: absolute;
  bottom: 12px;
  right: 16px;
  z-index: 2;
  font-family: Georgia, serif;
  font-size: 0.75rem;
  color: rgba(240, 232, 216, 0.45);
  pointer-events: none;
}

.btn-splash-lang {
  background: linear-gradient(135deg, #7db88a, #85c4c4, #d4c97a);
  border: none;
  border-radius: 10px;
  color: #0e2414;
  font-family: Georgia, serif;
  font-size: 0.95rem;
  font-weight: bold;
  letter-spacing: 0.08em;
  padding: 10px 28px;
  cursor: pointer;
  box-shadow: 0 3px 16px rgba(100,180,120,0.3);
  transition: all 0.2s;
}

.btn-splash-lang:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(100,180,120,0.5);
}

.lang-flag {
  font-size: 1.6rem;
  vertical-align: -3px;
  margin-right: 4px;
}

/* ── Landing ──────────────────────────────────────────────────────────────── */
#screen-landing {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

#felt-preview {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.35);
  transition: background-image 0.4s;
}

#btn-music-toggle {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255,220,150,0.25);
  background: rgba(10,8,6,0.6);
  color: #f5dfa0;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s;
}
#btn-music-toggle:hover { background: rgba(10,8,6,0.85); transform: scale(1.08); }
#btn-music-toggle.muted { color: #6a5e48; }

.landing-panel {
  position: relative;
  z-index: 2;
  background: rgba(10,8,6,0.75);
  border: 1px solid rgba(255,220,150,0.2);
  border-radius: 20px;
  padding: 36px 44px;
  width: min(820px, 95vw);
  max-height: 68vh;
  overflow-y: auto;
  backdrop-filter: blur(8px);
}

.landing-title {
  text-align: center;
  margin-bottom: 8px;
}

/* Back arrow to step 1, top-left corner of the panel (visible on step 2 only) */
#btn-landing-back {
  position: absolute;
  top: 14px;
  left: 14px;
  background: none;
  border: 1px solid rgba(245,223,160,0.35);
  border-radius: 8px;
  color: #f5dfa0;
  font-size: 1.05rem;
  line-height: 1;
  padding: 6px 13px;
  cursor: pointer;
  transition: all 0.15s;
}
#btn-landing-back:hover {
  background: rgba(245,223,160,0.12);
  transform: translateX(-2px);
}

.landing-title h1 {
  font-size: 2.4rem;
  color: #f5dfa0;
  letter-spacing: 0.05em;
}

.landing-title p {
  color: #a89878;
  font-style: italic;
  font-size: 0.95rem;
  margin-top: 4px;
}

.landing-divider {
  border: none;
  border-top: 1px solid rgba(255,220,150,0.15);
  margin: 22px 0;
}

.landing-section h3 {
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c8a860;
  margin-bottom: 14px;
}

/* Skin grid */
#skin-grid {
  display: flex;
  gap: 20px;
  justify-content: center;
}

.skin-card {
  cursor: pointer;
  border: 2px solid rgba(255,220,150,0.2);
  border-radius: 12px;
  padding: 12px 16px;
  text-align: center;
  transition: all 0.2s;
  background: rgba(255,255,255,0.04);
}

.skin-card:hover { border-color: rgba(255,220,150,0.5); background: rgba(255,255,255,0.08); }
.skin-card.active { border-color: #f5dfa0; background: rgba(245,223,160,0.1); }

.skin-card img {
  width: 70px;
  height: 140px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  margin: 0 auto 8px;
}

.skin-card span {
  font-size: 0.85rem;
  color: #c8b890;
}

/* Felt dots */
#felt-grid {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: center;
}

.felt-dot {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.2);
  background-size: cover;
  background-position: center;
  cursor: pointer;
  transition: all 0.2s;
}

.felt-dot:hover { transform: scale(1.15); border-color: rgba(255,220,150,0.6); }
.felt-dot.active { border-color: #f5dfa0; transform: scale(1.2); box-shadow: 0 0 0 2px rgba(245,223,160,0.4); }

/* Player count */
.count-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 18px;
}

.count-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,220,150,0.2);
  border-radius: 8px;
  color: #c8b890;
  font-size: 1.1rem;
  line-height: 1;
  font-family: Georgia, serif;
  padding: 8px 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.count-btn:hover { background: rgba(255,255,255,0.1); }
.count-btn.active { background: rgba(245,223,160,0.15); border-color: #f5dfa0; color: #f5dfa0; }

/* Slots */
#slots-container { display: flex; flex-direction: column; align-items: center; gap: 10px; }

.slot-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  padding: 10px 14px;
}

/* Rows beyond the selected player count keep their space (the panel is always
   sized for 5 players) but are invisible. */
.slot-row.slot-ghost { visibility: hidden; }

.slot-label { color: #a89878; font-size: 0.85rem; min-width: 90px; }

.slot-row input[type="text"] {
  flex: 0 0 220px;
  width: 220px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,220,150,0.2);
  border-radius: 6px;
  color: #f0e8d8;
  font-family: Georgia, serif;
  font-size: 0.9rem;
  padding: 6px 10px;
  outline: none;
  transition: border-color 0.2s;
}

.slot-row input[type="text"]:focus { border-color: rgba(245,223,160,0.6); }
.slot-row input[type="text"]::placeholder { color: #6a5e48; }

/* Toggle */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.toggle-label input[type="checkbox"] { display: none; }

.toggle-track {
  width: 40px;
  height: 22px;
  background: rgba(255,255,255,0.15);
  border-radius: 11px;
  position: relative;
  transition: background 0.2s;
}

.toggle-label input:checked + .toggle-track { background: rgba(100,180,120,0.5); }

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: #f0e8d8;
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle-label input:checked + .toggle-track .toggle-thumb { transform: translateX(18px); }
.toggle-text { font-size: 0.82rem; color: #a89878; width: 48px; text-align: left; }

/* Start button */
.btn-start-wrap {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 16px 44px;
  background: rgba(10,8,6,0.75);
  border: 1px solid rgba(255,220,150,0.2);
  border-radius: 20px;
  backdrop-filter: blur(8px);
}

#btn-start,
#btn-landing-next {
  background: linear-gradient(135deg, #7db88a, #85c4c4, #d4c97a);
  border: none;
  border-radius: 12px;
  color: #0e2414;
  font-family: Georgia, serif;
  font-size: 1.1rem;
  font-weight: bold;
  letter-spacing: 0.05em;
  padding: 14px 48px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 20px rgba(100,180,120,0.3);
}

#btn-start:hover,
#btn-landing-next:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(100,180,120,0.5);
}

#btn-tutorial {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(245,223,160,0.25);
  border-radius: 10px;
  color: #c8b890;
  font-family: Georgia, serif;
  font-size: 0.9rem;
  padding: 10px 32px;
  cursor: pointer;
  transition: all 0.2s;
}
#btn-tutorial:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(245,223,160,0.5);
  color: #f5dfa0;
}

/* ── Game Table ────────────────────────────────────────────────────────────── */
#screen-game {
  position: relative;
  flex-direction: column;
}

#game-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}

#game-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.25);
}

/* Player zones */
.player-zone {
  position: absolute;
  z-index: 2;
  /* --zone-alpha is set per felt in applyFelt() (brighter felt → darker veil) */
  background: rgb(0 0 0 / var(--zone-alpha, 0.45));
  border: 1px solid rgba(255,220,150,0.15);
  border-radius: 12px;
  padding: 10px 14px;
  transition: border-color 0.3s, box-shadow 0.3s;
  min-width: 140px;
}

.player-zone.active-turn {
  border-width: 3px;
  border-color: rgba(245,223,160,0.8);
  animation: zone-glow-pulse 1.6s ease-in-out infinite;
}

/* Breathing glow on the active player's zone + gentle pulse on their name,
   so the eye is drawn to whose turn it is. */
@keyframes zone-glow-pulse {
  0%, 100% { box-shadow: 0 0 12px rgba(245,223,160,0.25); }
  50%      { box-shadow: 0 0 26px rgba(245,223,160,0.55); }
}

.player-zone.active-turn .player-name {
  display: inline-block;
  transform-origin: left center;
  animation: name-pulse 1.6s ease-in-out infinite;
}

@keyframes name-pulse {
  0%, 100% { transform: scale(1);    text-shadow: none; }
  50%      { transform: scale(1.04); text-shadow: 0 0 8px rgba(245,223,160,0.7); }
}

.zone-north  { top: 12px;  left: 50%;  transform: translateX(-50%); }
/* East/west zones sit in the upper third, ABOVE their played-cards row (which
   lands at 54% height): a wide combo then passes below the info zone instead
   of covering it. 34% also stays clear of the NW/NE corner zones (5 players). */
.zone-west   { top: 34%;   left: 12px; transform: translateY(-50%); }
.zone-east   { top: 34%;   right: 12px; transform: translateY(-50%); }
.zone-northwest { top: 12px; left: 12px; }
.zone-northeast { top: 12px; right: 12px; }
.zone-south  {
  bottom: 24px;
  left: 16px;
  /* The local zone always reads one notch darker than the opponents' */
  background: rgb(0 0 0 / calc(var(--zone-alpha, 0.45) + 0.1));
}

.zone-info { display: flex; flex-direction: column; gap: 3px; }
.player-name { font-size: 0.9rem; color: #f5dfa0; }
.card-count  { font-size: 0.75rem; color: #a89878; font-family: monospace; }

.zone-stats { display: flex; gap: 8px; }

.zone-stat {
  font-size: 0.75rem;
  color: #a89878;
  font-family: monospace;
  position: relative;
  cursor: default;
  display: inline-block;
}
.zone-stat::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10,8,6,0.92);
  border: 1px solid rgba(245,223,160,0.3);
  color: #f5dfa0;
  font-size: 0.72rem;
  font-family: Georgia, serif;
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 100;
}
.zone-stat:hover::after { opacity: 1; }

.local-info { flex-direction: row; align-items: center; gap: 16px; }

.opp-card-back {
  position: absolute;
  width: 40px;
  height: 80px;
  object-fit: cover;
  border-radius: 5px;
  box-shadow: 1px 1px 4px rgba(0,0,0,0.5);
}

.revealed-mini-row {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.revealed-mini {
  width: 28px;
  height: 56px;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 1px 1px 3px rgba(0,0,0,0.4);
}

/* Play area — full-screen transparent card canvas */
#play-area {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

/* Each player's card group lands at a position on the table */
.play-group {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transform: translate(-50%, -50%);
}

.play-group-label {
  font-size: 0.7rem;
  color: rgba(245,223,160,0.7);
  background: rgba(0,0,0,0.55);
  border-radius: 4px;
  padding: 2px 7px;
  white-space: nowrap;
}

.play-group-combo {
  font-size: 0.68rem;
  color: #f5dfa0;
  background: rgba(245,223,160,0.12);
  border: 1px solid rgba(245,223,160,0.3);
  border-radius: 4px;
  padding: 1px 7px;
  white-space: nowrap;
}

.play-group-cards {
  display: flex;
  /* Spacing comes from inline margin-left on each card (renderPlayArea), which
     goes negative to overlap the cards when a combo is too wide. */
}

.play-card {
  width: 60px;
  height: 120px;
  object-fit: contain;
  border-radius: 7px;
  box-shadow: 2px 3px 10px rgba(0,0,0,0.6);
}

/* Host indicator in center */
#host-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(245,223,160,0.2);
  border-radius: 10px;
  padding: 5px 14px;
  font-size: 0.72rem;
  color: #a89878;
  pointer-events: none;
  white-space: nowrap;
}

/* Local hand */
#local-hand-wrap {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
}

#action-panel {
  position: absolute;
  bottom: 173px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  white-space: nowrap;
}

#local-hand {
  position: relative;
  height: 176px;
  min-width: 120px;
  display: flex;
  align-items: flex-end;
}

.hand-card {
  position: absolute;
  width: 88px;
  height: 176px;
  object-fit: contain;
  border-radius: 8px;
  cursor: pointer;
  transition: box-shadow 0.15s;
  box-shadow: 2px 3px 8px rgba(0,0,0,0.5);
  transform-origin: bottom center;
}

.hand-card:hover { box-shadow: 0 0 0 2px rgba(245,223,160,0.5), 0 6px 16px rgba(0,0,0,0.5); filter: brightness(1.12); }
.hand-card.selected { box-shadow: 0 0 0 2px #f5dfa0, 0 8px 20px rgba(245,223,160,0.4); }

.hand-empty {
  color: #6a5e48;
  font-style: italic;
  font-size: 0.85rem;
  padding: 10px;
  white-space: nowrap;
}


.action-info {
  font-size: 0.82rem;
  color: #a89878;
  font-style: italic;
}

.combo-tag {
  background: rgba(245,223,160,0.2);
  color: #f5dfa0;
  border: 1px solid rgba(245,223,160,0.4);
  border-radius: 6px;
  font-size: 0.82rem;
  padding: 3px 10px;
}

.combo-error {
  color: #e87878;
  font-size: 0.82rem;
}

.btn {
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: Georgia, serif;
  font-size: 0.88rem;
  padding: 8px 16px;
  transition: all 0.15s;
}

.btn-play    { background: linear-gradient(135deg, #7db88a, #85c4c4, #d4c97a); color: #0e2414; font-weight: bold; }
.btn-prepare { background: rgba(255,255,255,0.1); color: #c8b890; border: 1px solid rgba(255,255,255,0.15); }
.btn-clear   { background: rgba(200,80,80,0.2); color: #e89898; border: 1px solid rgba(200,80,80,0.3); }

.btn:hover { opacity: 0.85; transform: translateY(-1px); }

/* Message bar */
#message-bar {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  background: rgba(0,0,0,0.6);
  color: #f5dfa0;
  font-size: 0.85rem;
  padding: 6px 18px;
  border-radius: 20px;
  border: 1px solid rgba(245,223,160,0.2);
  backdrop-filter: blur(6px);
  white-space: nowrap;
  max-width: 80vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Intro overlay */
#intro-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: none;
  pointer-events: none;
  overflow: hidden;
}

/* Pass turn overlay */
#pass-turn-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: rgba(0,0,0,0.8);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

#pass-turn-overlay.visible { display: flex; }

#pass-turn-overlay h2 { color: #f5dfa0; font-size: 1.6rem; }
#pass-turn-overlay p  { color: #a89878; font-size: 1rem; }

#btn-ready {
  background: linear-gradient(135deg, #7db88a, #85c4c4, #d4c97a);
  border: none;
  border-radius: 10px;
  color: #1a1408;
  font-family: Georgia, serif;
  font-size: 1rem;
  font-weight: bold;
  padding: 12px 36px;
  cursor: pointer;
}

/* When a player sits at the north seat (4-player layout), the centered message
   bar and turn-order pills would cover their zone — dock them in the top-left
   corner instead, which that layout leaves free (NW/NE seats unused, west at
   mid-height). */
#screen-game.has-north #message-bar,
#screen-game.has-north #turn-order {
  left: 16px;
  transform: none;
}

/* ── Turn Order ────────────────────────────────────────────────────────────── */
#turn-order {
  position: absolute;
  top: 52px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,220,150,0.15);
  border-radius: 20px;
  padding: 4px 10px;
  backdrop-filter: blur(6px);
}

.turn-chip {
  font-size: 0.72rem;
  color: #a89878;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  transition: all 0.3s;
}

.turn-chip.active {
  background: rgba(245,223,160,0.2);
  color: #f5dfa0;
  font-weight: bold;
  border: 1px solid rgba(245,223,160,0.4);
}

.turn-arrow {
  color: rgba(255,220,150,0.4);
  font-size: 0.65rem;
}

/* ── Game Over ─────────────────────────────────────────────────────────────── */
#screen-gameover {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(10,8,6,0.95);
}

.gameover-panel {
  text-align: center;
  padding: 48px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,220,150,0.2);
  border-radius: 20px;
  min-width: 320px;
}

.gameover-panel h2 { font-size: 2rem; color: #f5dfa0; margin-bottom: 8px; }
.gameover-panel .subtitle { color: #a89878; font-style: italic; margin-bottom: 24px; }
#winner-names { font-size: 1.6rem; color: #e8c060; margin-bottom: 8px; }
#winner-stats { font-size: 0.85rem; color: #a89878; margin-bottom: 28px; line-height: 1.8; }

#btn-play-again {
  background: linear-gradient(135deg, #7db88a, #85c4c4, #d4c97a);
  border: none;
  border-radius: 10px;
  color: #1a1408;
  font-family: Georgia, serif;
  font-size: 1rem;
  font-weight: bold;
  padding: 12px 36px;
  cursor: pointer;
  transition: all 0.2s;
}

#btn-play-again:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(200,160,60,0.4); }

/* ── Tea Party Overlay ─────────────────────────────────────────────────────── */
#tea-party-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: rgba(0,0,0,0.82);
  display: none;
  align-items: center;
  justify-content: center;
}
#tea-party-overlay.visible { display: flex; }

.tea-overlay-panel {
  background: rgba(18,14,8,0.97);
  border: 1px solid rgba(245,223,160,0.3);
  border-radius: 18px;
  padding: 28px 36px;
  min-width: 420px;
  max-width: 620px;
  max-height: 80vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.tea-combo-badge {
  display: inline-block;
  background: rgba(245,223,160,0.15);
  border: 1px solid rgba(245,223,160,0.4);
  color: #f5dfa0;
  border-radius: 8px;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 12px;
  margin-bottom: 6px;
}

.tea-winner-line {
  font-size: 1.25rem;
  color: #e8c060;
}

.tea-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  flex-wrap: wrap;
}
.tea-row.winner  { background: rgba(245,223,160,0.08); border-color: rgba(245,223,160,0.3); }
.tea-row.matching { border-color: rgba(100,200,120,0.25); }

.tea-row-name  { min-width: 80px; font-size: 0.85rem; color: #c8b890; }
.tea-row-combo { font-size: 0.75rem; background: rgba(245,223,160,0.12); color: #f5dfa0; border-radius: 4px; padding: 2px 8px; white-space: nowrap; }
.tea-row-cards { display: flex; gap: 4px; flex: 1; }

.tea-card-img {
  width: 30px;
  height: 60px;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 1px 2px 4px rgba(0,0,0,0.5);
}

.tea-badge {
  font-size: 0.72rem;
  border-radius: 4px;
  padding: 2px 8px;
  white-space: nowrap;
}
.tea-badge.win   { background: rgba(245,223,160,0.2); color: #f5dfa0; }
.tea-badge.match { background: rgba(100,200,120,0.15); color: #80e090; }
.tea-badge.none  { background: rgba(255,255,255,0.06); color: #6a5e48; }

#btn-tea-continue {
  align-self: flex-end;
  background: linear-gradient(135deg, #7db88a, #85c4c4, #d4c97a);
  border: none;
  border-radius: 8px;
  color: #1a1408;
  font-family: Georgia, serif;
  font-size: 0.9rem;
  font-weight: bold;
  padding: 10px 28px;
  cursor: pointer;
  transition: all 0.2s;
}
#btn-tea-continue:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(200,160,60,0.4); }

/* ── Discard Overlay ───────────────────────────────────────────────────────── */
#discard-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: rgba(0,0,0,0.88);
  display: none;
  align-items: center;
  justify-content: center;
}
#discard-overlay.visible { display: flex; }

.discard-panel {
  background: rgba(18,14,8,0.97);
  border: 1px solid rgba(245,223,160,0.3);
  border-radius: 18px;
  padding: 32px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  min-width: 380px;
}

#discard-title {
  font-size: 1rem;
  color: #f5dfa0;
  text-align: center;
}

#discard-pool {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.discard-card {
  width: 64px;
  height: 128px;
  object-fit: contain;
  cursor: pointer;
  transition: filter 0.15s, transform 0.15s;
  filter: drop-shadow(2px 3px 6px rgba(0,0,0,0.5));
}
.discard-card:hover { transform: translateY(-4px); filter: drop-shadow(0 0 3px rgba(245,223,160,0.6)) drop-shadow(2px 3px 6px rgba(0,0,0,0.5)); }
.discard-card.selected {
  transform: translateY(-8px);
  filter: drop-shadow(0 0 2px #f5dfa0) drop-shadow(0 0 5px rgba(245,223,160,0.7)) drop-shadow(2px 4px 8px rgba(0,0,0,0.6));
}

/* Yellow→orange while it means "discard nothing" (a warning look), green once
   at least one card is selected (a confirming look). */
#btn-discard-confirm {
  background: linear-gradient(135deg, #e06a3c, #e8c95a, #e89a4a);
  border: none;
  border-radius: 10px;
  color: #1a1408;
  font-family: Georgia, serif;
  font-size: 0.95rem;
  font-weight: bold;
  padding: 12px 32px;
  cursor: pointer;
  transition: all 0.2s;
}
#btn-discard-confirm.has-selection {
  background: linear-gradient(135deg, #7db88a, #85c4c4, #94c47d);
}
#btn-discard-confirm:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(200,160,60,0.4); }

/* ── Tutorial Panel ────────────────────────────────────────────────────────── */
#tut-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 200;
  display: none;
  pointer-events: all;
}
#tut-panel.visible { display: block; }

#tut-inner {
  background: rgba(14,10,4,0.97);
  border: 1px solid rgba(245,223,160,0.45);
  border-radius: 16px;
  padding: 24px 30px;
  max-width: 520px;
  min-width: 360px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.7), 0 0 0 1px rgba(245,223,160,0.1);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#tut-title {
  font-size: 1rem;
  font-weight: bold;
  color: #f5dfa0;
  letter-spacing: 0.03em;
}

#tut-text {
  font-size: 0.85rem;
  color: #c8b890;
  line-height: 1.65;
}

#tut-text b { color: #f5dfa0; }

#tut-ok {
  align-self: flex-end;
  background: linear-gradient(135deg, #7db88a, #85c4c4, #d4c97a);
  border: none;
  border-radius: 8px;
  color: #0e2414;
  font-family: Georgia, serif;
  font-size: 0.85rem;
  font-weight: bold;
  padding: 8px 24px;
  cursor: pointer;
  transition: all 0.15s;
}
#tut-ok:hover { transform: translateY(-1px); opacity: 0.9; }

.tut-combo-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.tut-combo-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tut-combo-cards {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
  width: 80px;
}

.tut-card-mini {
  width: 30px;
  height: 60px;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 1px 2px 5px rgba(0,0,0,0.5);
}

/* Example rows (valid ✓ / invalid ✗) in the combo-example tutorial steps */
.tut-combo-row.tut-ex {
  padding: 5px 8px;
  border-radius: 8px;
}
.tut-combo-row.ok  { background: rgba(125,184,138,0.13); }
.tut-combo-row.bad { background: rgba(232,120,120,0.10); }

.tut-verdict {
  font-weight: bold;
  font-size: 1rem;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}
.tut-combo-row.ok  .tut-verdict { color: #7db88a; }
.tut-combo-row.bad .tut-verdict { color: #e87878; }
.tut-combo-row.bad .tut-card-mini { opacity: 0.7; }

/* Example rows hold up to 6 cards — let the card strip size itself */
.tut-cards-free { width: auto; min-width: 66px; }

/* ── Scrollbar ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,220,150,0.2); border-radius: 3px; }
