/* ============================================================
   SEVEN-CARD SHOW -- design tokens
   Aesthetic: a late-night card lounge. Ink-navy room, a single
   brass spotlight over the table, cream card stock. The Joker is
   lit like the one prop on stage; the SHOW button is the dare.
   ============================================================ */

:root {
  /* --- color --- */
  --ink-900: #0b0f18;
  --ink-800: #10121e;
  --ink-700: #171b2c;
  --panel: #1b2036;
  --panel-alt: #232a45;
  --line: rgba(212, 162, 76, 0.16);
  --line-bright: rgba(212, 162, 76, 0.4);

  --gold: #d4a24c;
  --gold-bright: #f0c878;
  --gold-dim: #8a6a34;

  --cream: #ede6d6;
  --cream-dim: #a8a493;

  --danger: #c1483d;
  --danger-bright: #e2685c;
  --success: #4fa490;
  --success-bright: #6fc7b2;

  --card-face: #faf6ec;
  --card-ink: #191712;
  --card-red: #b0392f;
  --card-black: #1c1a17;

  /* --- type --- */
  --font-display: Georgia, 'Iowan Old Style', 'Palatino Linotype', 'Times New Roman', serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'SF Mono', 'Cascadia Code', Consolas, Menlo, monospace;

  /* --- layout --- */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-card: 0 6px 16px rgba(0, 0, 0, 0.45), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  --shadow-panel: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background:
    radial-gradient(ellipse at 50% -10%, rgba(212, 162, 76, 0.10), transparent 55%),
    linear-gradient(180deg, var(--ink-900), var(--ink-800) 60%, var(--ink-900));
  color: var(--cream);
  font-family: var(--font-body);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  margin: 0;
  letter-spacing: 0.01em;
}

p {
  margin: 0;
}

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: var(--gold-bright);
}

:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}

.mono {
  font-family: var(--font-mono);
}

.hidden {
  display: none !important;
}

/* ============================================================
   Home screen
   ============================================================ */

.home-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  text-align: center;
  gap: 28px;
  position: relative;
  overflow: hidden;
}

.home-screen::before {
  content: '';
  position: absolute;
  top: -20%;
  left: 50%;
  width: 900px;
  height: 900px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(212, 162, 76, 0.16), transparent 60%);
  pointer-events: none;
}

.home-eyebrow {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-size: 11px;
  color: var(--gold);
}

.home-title {
  font-size: clamp(42px, 9vw, 84px);
  line-height: 0.98;
  color: var(--cream);
  text-shadow: 0 2px 24px rgba(212, 162, 76, 0.25);
}

.home-title em {
  font-style: italic;
  color: var(--gold-bright);
}

.home-subtitle {
  font-size: 17px;
  color: var(--cream-dim);
  max-width: 460px;
  line-height: 1.5;
}

.home-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 320px;
  z-index: 1;
}

.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  padding: 14px 22px;
  border-radius: var(--radius-md);
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease, border-color 120ms ease;
  border: 1px solid transparent;
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #221806;
  box-shadow: 0 8px 20px rgba(212, 162, 76, 0.25);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 10px 26px rgba(212, 162, 76, 0.4);
}

.btn-secondary {
  background: var(--panel);
  border-color: var(--line);
  color: var(--cream);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--line-bright);
  background: var(--panel-alt);
}

.btn-ghost {
  background: transparent;
  color: var(--cream-dim);
  padding: 10px 16px;
}

.btn-ghost:hover:not(:disabled) {
  color: var(--cream);
}

.btn-danger {
  background: linear-gradient(180deg, var(--danger-bright), var(--danger));
  color: #2a0d0a;
}

.btn:disabled {
  opacity: 0.4;
  box-shadow: none;
}

/* ============================================================
   Generic screen shell (setup, rules, results)
   ============================================================ */

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 18px 60px;
}

.screen-panel {
  width: 100%;
  max-width: 640px;
  background: linear-gradient(180deg, var(--panel), var(--ink-700));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
  padding: 32px;
}

.screen-title {
  font-size: 30px;
  color: var(--cream);
  margin-bottom: 6px;
}

.screen-subtitle {
  color: var(--cream-dim);
  font-size: 14px;
  margin-bottom: 24px;
}

.field-group {
  margin-bottom: 22px;
}

.field-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}

.field-hint {
  font-size: 12.5px;
  color: var(--cream-dim);
  margin-top: 8px;
}

.text-input {
  width: 100%;
  background: var(--ink-900);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--cream);
  padding: 11px 12px;
  font-size: 15px;
  font-family: var(--font-body);
}

.text-input:focus-visible {
  border-color: var(--gold);
}

.player-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.player-row .text-input {
  flex: 1;
}

.chip-toggle {
  display: flex;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.chip-toggle button {
  padding: 10px 12px;
  font-size: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  color: var(--cream-dim);
  background: var(--ink-900);
}

.chip-toggle button.active {
  background: var(--gold);
  color: #221806;
  font-weight: 700;
}

.remove-player {
  color: var(--danger-bright);
  font-size: 18px;
  width: 34px;
  flex-shrink: 0;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.preset-chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--ink-900);
  color: var(--cream-dim);
  font-family: var(--font-mono);
  font-size: 13px;
}

.preset-chip.active {
  border-color: var(--gold);
  color: var(--gold-bright);
  background: rgba(212, 162, 76, 0.1);
}

.error-banner {
  background: rgba(193, 72, 61, 0.15);
  border: 1px solid rgba(193, 72, 61, 0.4);
  color: var(--danger-bright);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 18px;
}

.screen-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

/* ============================================================
   Rules screen
   ============================================================ */

.rules-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rules-list .rule-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.rules-list .rule-item:last-child {
  border-bottom: none;
}

.rule-num {
  font-family: var(--font-mono);
  color: var(--gold);
  font-size: 13px;
}

.rule-text {
  font-size: 14px;
  line-height: 1.55;
  color: var(--cream);
}

.rule-text b {
  color: var(--gold-bright);
}

/* ============================================================
   Game screen -- the table
   ============================================================ */

.game-screen {
  flex: 1;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
}

.game-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 15, 24, 0.6);
  gap: 12px;
  flex-wrap: wrap;
}

.game-topbar .brand {
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--gold-bright);
}

.turn-meta {
  display: flex;
  gap: 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--cream-dim);
  flex-wrap: wrap;
}

.turn-meta strong {
  color: var(--cream);
}

.topbar-buttons {
  display: flex;
  gap: 8px;
}

.icon-btn {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--cream-dim);
  border-radius: var(--radius-sm);
  padding: 7px 11px;
  font-size: 12px;
  font-family: var(--font-mono);
}

.icon-btn:hover {
  border-color: var(--line-bright);
  color: var(--cream);
}

.opponents-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  padding: 16px 12px 4px;
  flex-wrap: wrap;
}

.opponent-plaque {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  min-width: 128px;
  text-align: center;
  position: relative;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.opponent-plaque.is-turn {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), 0 0 20px rgba(212, 162, 76, 0.25);
}

.opponent-plaque.is-eliminated {
  opacity: 0.4;
}

.opponent-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.opponent-bot-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--gold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.opponent-meta {
  display: flex;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--cream-dim);
  margin-top: 4px;
}

.opponent-turn-tag {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: #221806;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
}

.eliminated-tag {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--danger);
  color: var(--cream);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 999px;
}

/* --- table center --- */

.table-center {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 20px;
}

.table-felt {
  position: relative;
  width: min(680px, 92vw);
  aspect-ratio: 2.1 / 1;
  border-radius: 50% / 45%;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(212, 162, 76, 0.10), transparent 65%),
    linear-gradient(180deg, #161d30, #10152400);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 6vw, 56px);
}

.center-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.center-slot-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cream-dim);
}

.joker-slot .center-slot-label {
  color: var(--gold-bright);
}

.joker-glow {
  position: relative;
}

.joker-glow::after {
  content: '';
  position: absolute;
  inset: -22px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 200, 120, 0.35), transparent 68%);
  z-index: -1;
  animation: jokerPulse 3.2s ease-in-out infinite;
}

@keyframes jokerPulse {
  0%, 100% { opacity: 0.55; transform: scale(0.96); }
  50% { opacity: 1; transform: scale(1.05); }
}

.joker-effect-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--gold-bright);
  background: rgba(212, 162, 76, 0.12);
  border: 1px solid var(--line-bright);
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.draw-pile-stack {
  position: relative;
  width: 74px;
  height: 104px;
}

.draw-pile-stack .stack-card {
  position: absolute;
  inset: 0;
}

.draw-pile-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--cream-dim);
}

/* --- playing card --- */

.pcard {
  width: 74px;
  height: 104px;
  border-radius: 8px;
  background: var(--card-face);
  box-shadow: var(--shadow-card);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px 7px;
  font-family: var(--font-display);
  user-select: none;
  flex-shrink: 0;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.pcard.red { color: var(--card-red); }
.pcard.black { color: var(--card-black); }

.pcard .rank {
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
}

.pcard .suit-center {
  align-self: center;
  font-size: 26px;
  line-height: 1;
}

.pcard .rank.bottom {
  align-self: flex-end;
  transform: rotate(180deg);
}

.pcard.zero-value {
  outline: 2px dashed var(--success);
  outline-offset: -3px;
}

.pcard.zero-value::before {
  content: '0';
  position: absolute;
  bottom: 4px;
  left: 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--success);
  background: rgba(79, 164, 144, 0.15);
  border-radius: 4px;
  padding: 0 3px;
  transform: none;
}

.pcard.card-back {
  background:
    repeating-linear-gradient(135deg, var(--gold-dim) 0 6px, #1b2036 6px 12px);
  border: 2px solid var(--ink-900);
}

.pcard.joker-card {
  outline: 2px solid var(--gold);
  outline-offset: -3px;
  box-shadow: 0 0 24px rgba(212, 162, 76, 0.35), var(--shadow-card);
}

.pcard.selected {
  transform: translateY(-14px);
  box-shadow: 0 0 0 2px var(--gold-bright), 0 10px 20px rgba(0, 0, 0, 0.5);
}

.pcard.selectable:hover {
  transform: translateY(-8px);
}

.pcard.disabled-card {
  opacity: 0.45;
}

.open-card-slot .pcard {
  width: 84px;
  height: 118px;
}

.open-card-slot .pcard .rank { font-size: 19px; }
.open-card-slot .pcard .suit-center { font-size: 30px; }

/* Discard pile: a couple of faded "ghost" cards peeking out behind the
   Open Card so it always reads as a growing pile, even when a matching
   play keeps the same rank on top (only the suit/card actually changes). */
.open-card-stack {
  position: relative;
}

.stack-ghost {
  position: absolute;
  inset: 0;
  width: 84px;
  height: 118px;
  border-radius: 8px;
  background: var(--card-face);
  box-shadow: var(--shadow-card);
  opacity: 0.45;
  z-index: 0;
}

.stack-ghost-1 { transform: translate(5px, 5px) rotate(4deg); opacity: 0.4; }
.stack-ghost-2 { transform: translate(-5px, 7px) rotate(-5deg); opacity: 0.25; }

.open-card-stack .pcard { position: relative; z-index: 1; }

/* --- card motion --- */

@keyframes cardLanded {
  0% { transform: translateY(-46px) scale(0.7) rotate(-8deg); opacity: 0; }
  60% { transform: translateY(4px) scale(1.05) rotate(2deg); opacity: 1; }
  100% { transform: translateY(0) scale(1) rotate(0deg); opacity: 1; }
}

.pcard.card-landed {
  animation: cardLanded 420ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes cardDealIn {
  0% { transform: translateY(30px) scale(0.85); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.pcard.card-deal-in {
  animation: cardDealIn 380ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes cardPopIn {
  0% { transform: translateY(24px) scale(0.5) rotate(6deg); opacity: 0; box-shadow: 0 0 0 rgba(212, 162, 76, 0); }
  55% { transform: translateY(-6px) scale(1.08) rotate(-2deg); opacity: 1; box-shadow: 0 0 22px rgba(212, 162, 76, 0.55); }
  100% { transform: translateY(0) scale(1) rotate(0deg); opacity: 1; box-shadow: var(--shadow-card); }
}

.pcard.card-pop-in {
  animation: cardPopIn 460ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hand-cards-hidden .pcard.card-back {
  opacity: 0.92;
}

/* ============================================================
   Player hand + action bar
   ============================================================ */

.hand-area {
  padding: 10px 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid var(--line);
  background: rgba(11, 15, 24, 0.55);
}

.hand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.you-status {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--cream-dim);
}

.you-status strong {
  color: var(--gold-bright);
}

.hand-cards {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 6px 6px;
  justify-content: center;
  flex-wrap: wrap;
}

.action-bar {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.action-btn {
  min-width: 132px;
  padding: 13px 18px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.03em;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--cream);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.action-btn small {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 10px;
  color: var(--cream-dim);
  letter-spacing: 0.04em;
}

.action-btn:not(:disabled):hover {
  border-color: var(--line-bright);
  transform: translateY(-2px);
}

.action-btn.play {
  background: linear-gradient(180deg, var(--success-bright), var(--success));
  color: #062822;
  border-color: transparent;
}

.action-btn.exchange {
  background: linear-gradient(180deg, #6b7fbf, #4b5c94);
  color: #eef0fb;
  border-color: transparent;
}

.action-btn.show {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #221806;
  border-color: transparent;
}

.action-btn.show.available {
  animation: showPulse 1.8s ease-in-out infinite;
}

@keyframes showPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(240, 200, 120, 0.5); }
  50% { box-shadow: 0 0 0 10px rgba(240, 200, 120, 0); }
}

.action-btn:disabled {
  background: var(--panel);
  color: var(--cream-dim);
}

.inline-hint {
  text-align: center;
  font-size: 12px;
  color: var(--cream-dim);
  min-height: 16px;
}

.inline-hint.is-error {
  color: var(--danger-bright);
}

/* ============================================================
   Scoreboard + event log drawer
   ============================================================ */

.side-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(340px, 88vw);
  background: linear-gradient(180deg, var(--panel), var(--ink-700));
  border-left: 1px solid var(--line);
  box-shadow: -20px 0 40px rgba(0, 0, 0, 0.4);
  transform: translateX(100%);
  transition: transform 220ms ease;
  z-index: 40;
  display: flex;
  flex-direction: column;
  padding: 20px;
  gap: 18px;
  overflow-y: auto;
}

.side-drawer.open {
  transform: translateX(0);
}

.drawer-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
  z-index: 39;
}

.drawer-scrim.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer-title {
  font-size: 18px;
  color: var(--gold-bright);
}

.score-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.score-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream-dim);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.score-table td {
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
  color: var(--cream);
}

.score-table td.num {
  font-family: var(--font-mono);
  text-align: right;
}

.status-pill {
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: 0.06em;
}

.status-pill.active {
  background: rgba(79, 164, 144, 0.18);
  color: var(--success-bright);
}

.status-pill.eliminated {
  background: rgba(193, 72, 61, 0.18);
  color: var(--danger-bright);
}

.threshold-warning {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--danger-bright);
}

.event-log {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--cream-dim);
  max-height: 260px;
  overflow-y: auto;
}

.event-log div {
  border-bottom: 1px dashed var(--line);
  padding-bottom: 6px;
}

/* ============================================================
   Result overlays (SHOW result, round result, elimination, winner)
   ============================================================ */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 14, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
  animation: overlayFade 220ms ease;
}

@keyframes overlayFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.overlay-card {
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  background: linear-gradient(180deg, var(--panel), var(--ink-700));
  border: 1px solid var(--line-bright);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
  animation: overlayRise 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes overlayRise {
  from { transform: translateY(18px) scale(0.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.pass-overlay {
  background: rgba(6, 8, 14, 0.96);
  z-index: 60;
}

.pass-overlay-card {
  text-align: center;
}

.pass-icon {
  font-size: 44px;
  margin-bottom: 10px;
}

.result-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.result-tag.correct {
  background: rgba(79, 164, 144, 0.18);
  color: var(--success-bright);
  border: 1px solid var(--success);
}

.result-tag.wrong {
  background: rgba(193, 72, 61, 0.18);
  color: var(--danger-bright);
  border: 1px solid var(--danger);
}

.overlay-title {
  font-size: 28px;
  margin-bottom: 4px;
}

.overlay-sub {
  color: var(--cream-dim);
  font-size: 14px;
  margin-bottom: 22px;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 22px;
  font-size: 13.5px;
}

.results-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream-dim);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.results-table td {
  padding: 9px 6px;
  border-bottom: 1px solid var(--line);
}

.results-table td.num {
  font-family: var(--font-mono);
  text-align: right;
}

.results-table tr.is-winner td {
  color: var(--gold-bright);
  font-weight: 700;
}

.elimination-banner {
  background: rgba(193, 72, 61, 0.12);
  border: 1px solid rgba(193, 72, 61, 0.4);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
}

.elimination-banner .elim-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--danger-bright);
  margin-bottom: 6px;
}

.winner-hero {
  text-align: center;
  padding: 10px 0 26px;
}

.winner-trophy {
  font-size: 54px;
  margin-bottom: 10px;
}

.winner-name {
  font-size: 36px;
  color: var(--gold-bright);
  margin-bottom: 6px;
}

.winner-caption {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--cream-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.stat-row {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin-top: 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--cream-dim);
  flex-wrap: wrap;
}

.stat-row b {
  color: var(--cream);
  display: block;
  font-size: 16px;
}

/* ============================================================
   SHOW result: winner hero + View All Cards reveal
   ============================================================ */

.winner-hero-celebrate {
  position: relative;
  overflow: hidden;
}

.winner-trophy-bounce {
  animation: trophyBounce 700ms cubic-bezier(0.3, 0.6, 0.3, 1.4) both;
}

@keyframes trophyBounce {
  0% { transform: scale(0.3) translateY(-10px); opacity: 0; }
  55% { transform: scale(1.15) translateY(2px); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.winner-headline {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--gold-bright);
  margin-top: 10px;
}

.winner-hero-wrong .winner-name {
  color: var(--danger-bright);
  font-size: 26px;
}

.winner-hero-wrong .winner-trophy {
  color: var(--danger-bright);
}

.winner-hero-wrong .winner-headline {
  color: var(--success-bright);
}

.overlay-sub.is-error {
  color: var(--danger-bright);
}

/* Lightweight confetti: a handful of falling tinted rectangles behind
   the trophy. Purely decorative, capped so it never gets busy. */
.winner-confetti {
  position: absolute;
  inset: -10px 0 auto 0;
  height: 90px;
  pointer-events: none;
  overflow: hidden;
}

.winner-confetti::before,
.winner-confetti::after {
  content: '';
  position: absolute;
  top: -20px;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  background: var(--gold-bright);
  opacity: 0.85;
  animation: confettiFall 1100ms ease-in both;
}

.winner-confetti::before {
  left: 38%;
  background: var(--gold-bright);
  animation-delay: 60ms;
  transform: rotate(-12deg);
}

.winner-confetti::after {
  left: 58%;
  background: var(--success-bright);
  animation-delay: 180ms;
  transform: rotate(16deg);
}

@keyframes confettiFall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateY(110px) rotate(200deg); opacity: 0; }
}

.elimination-preview {
  margin-top: 4px;
}

.elimination-preview .results-table {
  margin-bottom: 10px;
}

tr.is-eliminated-row td {
  color: var(--danger-bright);
}

/* --- View All Cards modal --- */

.reveal-overlay {
  z-index: 70;
  background: rgba(6, 8, 14, 0.92);
}

.reveal-overlay-card {
  max-width: 720px;
}

.reveal-players {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 22px;
}

.reveal-player-block {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.02);
}

.reveal-player-block.is-winner-block {
  border-color: var(--gold-bright);
  background: rgba(240, 200, 120, 0.08);
  box-shadow: 0 0 0 1px rgba(240, 200, 120, 0.25);
}

.reveal-player-name {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--cream-dim);
  margin-bottom: 10px;
}

.is-winner-block .reveal-player-name {
  color: var(--gold-bright);
}

.reveal-cards-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.reveal-card-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.reveal-card-wrap .pcard {
  width: 54px;
  height: 76px;
}

.reveal-card-wrap .pcard .rank { font-size: 13px; }
.reveal-card-wrap .pcard .suit-center { font-size: 18px; }

.reveal-card-value {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--cream-dim);
}

.reveal-total {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--cream);
}

/* ============================================================
   Toast (error / info messages)
   ============================================================ */

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--panel);
  border: 1px solid var(--line-bright);
  color: var(--cream);
  padding: 11px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  box-shadow: var(--shadow-panel);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
  z-index: 60;
  max-width: 90vw;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.is-error {
  border-color: rgba(193, 72, 61, 0.6);
  color: var(--danger-bright);
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 640px) {
  .pcard {
    width: 58px;
    height: 82px;
    padding: 5px 6px;
  }
  .pcard .rank { font-size: 14px; }
  .pcard .suit-center { font-size: 20px; }
  .open-card-slot .pcard { width: 68px; height: 96px; }
  .draw-pile-stack { width: 58px; height: 82px; }
  .table-felt { aspect-ratio: 1.5 / 1; }
  .action-btn { min-width: 100px; padding: 11px 12px; font-size: 12px; }
  .opponent-plaque { min-width: 100px; padding: 8px 10px; }
  .reveal-card-wrap .pcard { width: 44px; height: 62px; }
  .reveal-card-wrap .pcard .rank { font-size: 11px; }
  .reveal-card-wrap .pcard .suit-center { font-size: 15px; }
  .reveal-overlay-card { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
