:root {
  --bg: #f4f7fb;
  --ink: #1a2744;
  --muted: #5c6b82;
  --gold: #e2a31a;
  --gold-ink: #2a2108;
  --violet: #2f6fed;
  --danger: #9d3040;
  --felt: #127a45;
  --line: rgba(26, 39, 68, 0.1);
  --card-w: 84px;
  --card-h: 126px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Sora", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

button, input { font: inherit; }

button { cursor: pointer; }

.atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-color: #f4f7fb;
  background-image:
    radial-gradient(900px 420px at 8% -10%, rgba(242, 193, 78, 0.2), transparent 60%),
    radial-gradient(760px 460px at 100% 0%, rgba(47, 111, 237, 0.1), transparent 55%);
  background-repeat: no-repeat;
  z-index: -1;
}

body.playing .atmosphere {
  background-image:
    radial-gradient(900px 420px at 8% -10%, rgba(242, 193, 78, 0.2), transparent 60%),
    radial-gradient(760px 460px at 100% 0%, rgba(47, 111, 237, 0.1), transparent 55%),
    url("pokeball.svg");
  background-repeat: no-repeat, no-repeat, repeat;
  background-size: auto, auto, 64px 64px;
}

.shell {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 12px 0 32px;
}

.topbar, .dock, .stage, .drawers {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.logo {
  height: 108px;
  width: auto;
  max-width: min(320px, 78vw);
  object-fit: contain;
  object-position: left center;
  flex: 0 0 auto;
  display: block;
}

.home {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 12px 0 64px;
}

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

.home .logo {
  height: 72px;
  width: auto;
  max-width: min(240px, 58vw);
  object-fit: contain;
  object-position: left center;
}

.home-nav .top-actions { justify-content: flex-end; }

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 36px;
  align-items: center;
  padding: 36px 0 8px;
}

.home-kicker {
  margin: 0;
  color: #8a6410;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.home h1 {
  margin: 10px 0 14px;
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(36px, 5vw, 58px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.02;
}

.home-lead {
  max-width: 480px;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
}

.home-hero .landing-actions { justify-content: flex-start; }
.home-hero .fineprint { max-width: 420px; margin: 12px 0 0; }

.home-preview {
  background: radial-gradient(120% 90% at 50% 30%, #1b9a58, #0c5a34 72%);
  border-radius: 28px;
  padding: 22px 16px 18px;
  color: #fff;
  box-shadow: 0 18px 40px rgba(12, 90, 52, 0.22);
}

.preview-duel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.preview-hand {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.preview-card {
  width: 84px;
  aspect-ratio: 2 / 3;
  height: auto;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px;
  border-radius: 12px;
  background: var(--type);
  color: var(--ink);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.18);
}

.preview-card span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.preview-card strong {
  font-size: 13px;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.preview-side p, .preview-note {
  margin: 8px 0 0;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
}

.preview-vs {
  font-family: Fraunces, Georgia, serif;
  font-size: 22px;
  font-weight: 700;
}

.preview-note { color: rgba(255, 255, 255, 0.82); font-weight: 500; }

.home-section { margin-top: 28px; }

.home-section h2 {
  margin: 0 0 12px;
  font-family: Fraunces, Georgia, serif;
  font-size: 28px;
  letter-spacing: -0.03em;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.home-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.home-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 10px 28px rgba(26, 39, 68, 0.04);
}

.home-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.home-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.home-card .btn { margin-top: 14px; }

.home-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-steps li {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}

.home-steps span {
  display: block;
  margin-bottom: 6px;
  color: #8a6410;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.home-steps strong { display: block; margin-bottom: 4px; }
.home-steps p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; }

.waiting {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  padding: 28px 20px;
}

.waiting h1 {
  margin: 0;
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(32px, 6vw, 48px);
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.landing-play {
  margin-top: 6px;
  padding: 14px 22px;
  font-size: 16px;
}

.salon {
  width: min(1100px, calc(100% - 28px));
  margin: 0 auto;
  padding: 12px 0 40px;
}

.salon-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.salon-grid article, .arena-card, .lobby-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
}

.salon-grid h2 { margin: 0 0 8px; font-size: 20px; }
.salon-grid p { margin: 0 0 12px; color: var(--muted); line-height: 1.45; }
.code-line { color: var(--ink); }
.code-line strong { letter-spacing: 0.14em; font-size: 18px; }

.people { list-style: none; margin: 12px 0; padding: 0; }
.people li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.arena-card { margin-top: 12px; }
.arena-card header, .lobby-card {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.lobby-card { margin: 12px 0; }

.table-grid.seats-2 { grid-template-areas: ". north ." ". mid ." "south south south"; }
.table-grid.seats-3 { grid-template-areas: ". . ." "west mid east" "south south south"; }
.table-grid.seats-5 {
  grid-template-areas:
    "nw . ne"
    "west mid east"
    "south south south";
}
.pos-north { grid-area: north; }
.pos-west { grid-area: west; }
.pos-east { grid-area: east; }
.pos-nw { grid-area: nw; }
.pos-ne { grid-area: ne; }
.pos-north .card, .pos-west .card, .pos-east .card, .pos-nw .card, .pos-ne .card,
.seat-4 .card { width: 64px; height: 92px; }
.pos-north .sprite, .pos-west .sprite, .pos-east .sprite, .pos-nw .sprite, .pos-ne .sprite,
.seat-4 .sprite { height: 40px; }

@media (max-width: 860px) {
  .salon-grid, .home-hero, .home-grid, .home-modes, .home-steps { grid-template-columns: 1fr; }
  .home-nav { flex-direction: column; }
  .home .logo { object-position: center; }
  .home-nav .top-actions, .home-hero .landing-actions { justify-content: center; }
  .home-hero { text-align: center; padding-top: 20px; }
  .home-lead, .home-hero .fineprint { margin-left: auto; margin-right: auto; }
  .preview-duel { grid-template-columns: 1fr; justify-items: center; }
  .preview-vs { margin: 4px 0; }
}

.home-ladder {
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
}

.top-actions, .rule-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.drawers {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.drawer-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 600;
}

.drawer-btn::after {
  content: "";
  display: inline-block;
  margin-left: 8px;
  border: 4px solid transparent;
  border-top-color: currentColor;
  transform: translateY(2px);
}

.drawer-btn.on {
  border-color: var(--gold);
  color: #8a6410;
}

.drawer-btn.on::after {
  border-top-color: transparent;
  border-bottom-color: currentColor;
  transform: translateY(-2px);
}

.drawer-body {
  flex-basis: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 10px 28px rgba(26, 39, 68, 0.05);
}

.scale ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 4px 12px;
}

.scale li {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 8px;
  align-items: start;
  padding: 4px 6px;
  border-radius: 8px;
  color: var(--ink);
  font-size: 13px;
}

.scale small {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.scale li.mark { background: rgba(242, 193, 78, 0.08); }

.scale li.held {
  outline: 1px solid rgba(242, 193, 78, 0.7);
  background: rgba(242, 193, 78, 0.14);
}

.scale li.on-board { box-shadow: inset 3px 0 0 #7ec8ff; }

.scale .pwr {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

.callout {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.facts {
  display: flex;
  gap: 22px;
  margin: 0 0 8px;
}

.facts div { display: flex; flex-direction: column; gap: 2px; }

.facts dt {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.facts dd {
  margin: 0;
  font-weight: 700;
  font-size: 18px;
}

.stage { min-width: 0; }

.table {
  position: relative;
}

.rail {
  position: absolute;
  inset: 18px 8px 8px;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 30%, #c48856, #6a3d24 42%, #3a2014 78%);
  box-shadow:
    0 24px 50px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.felt {
  position: absolute;
  inset: 40px 28px 30px;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(255, 255, 255, 0.16), transparent 32%),
    radial-gradient(ellipse at 50% 48%, #25a262 0%, #0d6b3e 62%, #083d24 100%);
  box-shadow:
    inset 0 0 0 8px rgba(64, 36, 18, 0.28),
    inset 0 0 70px rgba(0, 0, 0, 0.28);
}

.table-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr) 176px;
  grid-template-areas:
    ". north ."
    "west mid east"
    "south south south";
  gap: 14px 8px;
  padding: 48px 28px 26px;
  align-items: center;
  justify-items: center;
}

.center {
  grid-area: mid;
  width: min(560px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.pot {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 120px;
  padding: 6px 16px 8px;
  border-radius: 999px;
  background: rgba(8, 24, 16, 0.55);
  border: 1px solid rgba(242, 193, 78, 0.35);
}

.pot span, .street {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #d7ecdf;
}

.pot strong {
  font-family: Fraunces, Georgia, serif;
  font-size: 28px;
  color: var(--gold);
  line-height: 1.1;
}

.board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  align-items: start;
}

.board-cell { min-width: 0; perspective: 700px; }

.match {
  min-height: 28px;
  margin: 4px 0 0;
  text-align: center;
  font-size: 10px;
  line-height: 1.25;
  font-weight: 700;
}

.match .gain,
.match .weak { display: block; }
.match .gain { color: #e7ffc8; }
.match .weak { color: #ffd0d4; }

.slot {
  width: 100%;
  max-width: 92px;
  height: auto;
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.12);
}

.seat {
  position: static;
  width: auto;
  max-width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.hero-row {
  grid-area: south;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-areas:
    "left cards right"
    ". plate .";
  align-items: center;
  column-gap: 16px;
  row-gap: 8px;
}

.play {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(220px, 100%);
}

.play-left { grid-area: left; justify-self: end; align-items: flex-end; }
.play-right { grid-area: right; justify-self: start; align-items: flex-start; }
.hero-cards { grid-area: cards; display: flex; flex-direction: column; align-items: center; gap: 6px; perspective: 700px; }
.hero-row .plate { grid-area: plate; }
.hero-row.turn .plate {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(242, 193, 78, 0.2);
}
.hero-row.winner .plate { border-color: #b6f3cd; }

.play .btn { box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2); }
.play .bet-row { display: flex; flex-wrap: wrap; gap: 8px; }
.play .presets { flex-wrap: wrap; }
.play .presets .btn { padding: 6px 8px; font-size: 12px; }
.play .raise-box,
.play .presets {
  width: 100%;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 14px;
  padding: 6px 8px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.14);
}
.play .hint {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  text-align: right;
}

.seat-2 { grid-area: north; }
.seat-2 .seat-body { flex-direction: column-reverse; }
.seat-1 { grid-area: west; }
.seat-3 { grid-area: east; }

.seat-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.holes {
  display: flex;
  gap: 6px;
  perspective: 700px;
}

.holes.dim { opacity: 0.45; filter: grayscale(0.4); }

.plate {
  width: min(180px, 100%);
  max-width: 100%;
  padding: 7px 10px 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.8);
  color: var(--ink);
  text-align: center;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.seat.turn .plate {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(242, 193, 78, 0.2);
}

.seat.winner .plate { border-color: #b6f3cd; }
.seat.winner .holes,
.hero-row.winner .hero-cards { animation: victor-hop 0.55s ease 0.25s both; }
.seat.ko .holes,
.hero-row.ko .hero-cards { animation: table-ko 0.55s ease 0.7s both; }
.seat.ko .card,
.hero-row.ko .card { filter: grayscale(0.72); opacity: 0.72; }

.who {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 600;
}

.avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  color: #1b1408;
  font-size: 10px;
  font-weight: 700;
}

.stack {
  margin-top: 2px;
  color: #8a6410;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 700;
}

.tags {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 4px;
  min-height: 16px;
}

.tag {
  font-size: 10px;
  letter-spacing: 0.04em;
  border-radius: 999px;
  padding: 1px 6px;
  background: #eef2f8;
  color: #3d4c66;
}

.tag.dealer { background: var(--gold); color: var(--gold-ink); font-weight: 700; }
.tag.allin { background: #7c4dff; color: white; }
.tag.out { color: var(--danger); }

.hand-name {
  max-width: 100%;
  font-size: 11px;
  color: #e7fff2;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wager {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(8, 20, 14, 0.78);
  border: 1px solid rgba(242, 193, 78, 0.4);
  color: var(--gold);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.chip {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, transparent 38%, #f2c14e 40% 48%, #8d6416 50% 62%, #f2c14e 64%);
  box-shadow: 0 0 0 2px #f2c14e;
}

.card {
  width: var(--card-w);
  height: auto;
  aspect-ratio: 2 / 3;
  flex: 0 0 auto;
  border-radius: 12px;
  background: linear-gradient(180deg, #fffaf2, #f3eadc);
  color: #241c14;
  padding: 6px 6px 7px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-top: 4px solid var(--type, #f2c14e);
  position: relative;
  overflow: hidden;
}

.sprite {
  width: auto;
  max-width: 100%;
  height: clamp(24px, 7vw, 58px);
  flex: 0 0 auto;
  object-fit: contain;
  align-self: center;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 2px;
}

.badge {
  border-radius: 999px;
  padding: 1px 5px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.stage {
  margin-top: 2px;
  color: #6d645b;
  font-size: 9px;
}

.card.deal { animation: deal 0.38s ease both; }
.card.motion-draw,
.card.motion-to-hand,
.card.motion-to-board { z-index: 3; }
.card.motion-draw { animation: draw-flip 0.62s ease both; }
.card.motion-to-hand { animation: to-hand 0.62s ease both; }
.card.motion-to-board { animation: to-board 0.62s ease both; }

.card.win {
  transform: translateY(-6px);
  box-shadow: 0 0 0 3px var(--gold), 0 12px 20px rgba(0, 0, 0, 0.28);
}

.card-top, .card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.power {
  font-family: Fraunces, Georgia, serif;
  font-weight: 700;
  font-size: 20px;
  line-height: 1;
}

.suit {
  width: 16px;
  height: 16px;
  display: block;
}

.suit svg { width: 16px; height: 16px; display: block; }
.suit.rubis { color: #d83242; }
.suit.saphir { color: #2f74e0; }
.suit.emeraude { color: #1f9a62; }
.suit.ambre { color: #e0a020; }

.type-name {
  margin-top: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--type);
}

.mon {
  margin-top: auto;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: -0.03em;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board .card,
.board .slot {
  width: 100%;
  max-width: 92px;
  height: auto;
  aspect-ratio: 2 / 3;
}

.board .card { padding: 5px; }

.board .sprite { height: clamp(22px, 6vw, 44px); }
.board .mon { font-size: 11px; }

.card-foot {
  margin-top: 4px;
  color: #6d645b;
  font-size: 10px;
}

.card.back {
  background:
    radial-gradient(circle at 50% 42%, #31436e, #171d31 72%);
  border-color: rgba(242, 193, 78, 0.7);
  align-items: center;
  justify-content: center;
  padding: 0;
}

.back-mark {
  width: 42%;
  aspect-ratio: 1;
  border: 2px solid #e6c56a;
  border-radius: 50%;
  position: relative;
}

.back-mark::before {
  content: "";
  position: absolute;
  inset: 22%;
  background: #e6c56a;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

.seat-0 .card { width: 102px; height: 146px; }
.seat-0 .sprite { height: 66px; }
.seat-1 .card, .seat-3 .card, .seat-2 .card {
  width: 76px;
  height: 112px;
  padding: 4px;
}
.seat-1 .sprite, .seat-3 .sprite, .seat-2 .sprite { height: 40px; }
.seat-1 .mon, .seat-3 .mon, .seat-2 .mon { font-size: 11px; }
.seat-1 .badge, .seat-3 .badge, .seat-2 .badge { font-size: 8px; }

.banner {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  box-shadow: 0 10px 28px rgba(26, 39, 68, 0.05);
}

.banner p {
  margin: 0;
  line-height: 1.45;
}

.journal .log-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 220px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-list li {
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink);
}

.log-list .result { color: #8a6410; }
.log-list .board { color: #0d6b3e; }
.log-list .blind { color: #2f5fa8; }

.dock {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 10px 28px rgba(26, 39, 68, 0.05);
}

.hero-readout .kicker {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.hero-readout strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.actions { display: flex; flex-direction: column; gap: 8px; }

.action-row, .presets, .auto {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  font-weight: 600;
  color: var(--ink);
  background: #eef2f8;
}

.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: 0.45; cursor: default; filter: none; }
.btn.fold { background: #fde8ea; color: var(--danger); }
.btn.call { background: var(--gold); color: var(--gold-ink); }
.btn.raise, .btn.primary { background: var(--violet); color: white; }
.btn.ghost {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
}

.btn.ghost.on {
  border-color: var(--gold);
  color: var(--gold);
}

.btn.ghost.muted { opacity: 0.55; }
.btn-short { display: none; }

.account-btn {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-card { width: min(440px, 100%); }
.auth-fields { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.auth-fields label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }
.auth-fields input {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
}
.auth-error { color: var(--danger); font-size: 13px; font-weight: 600; }
.auth-switch {
  margin-top: 12px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--violet);
  font-weight: 700;
}
.ladder { list-style: none; margin: 10px 0 0; padding: 0; }
.ladder li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}
.ladder .me b { color: #8a6410; }
.ladder em { font-style: normal; font-weight: 700; }
.ladder-actions { margin-top: 12px; }

.ability-row { display: flex; flex-wrap: wrap; gap: 8px; }

.hint {
  margin: 0;
  color: #8a6410;
  font-size: 13px;
}

.card.selectable { cursor: pointer; box-shadow: 0 0 0 3px rgba(242, 193, 78, 0.9); }
.card.picked { transform: translateY(-8px); }

.raise-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  width: 100%;
  flex: 1;
}

.raise-box input[type="range"] {
  flex: 1;
  accent-color: var(--violet);
}

#raise-readout {
  min-width: 64px;
  font-variant-numeric: tabular-nums;
  color: #8a6410;
  font-weight: 700;
}

.auto {
  color: var(--muted);
  font-size: 13px;
  justify-content: flex-end;
}

.keys, .fineprint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(26, 39, 68, 0.28);
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-card {
  width: min(680px, 100%);
  max-height: min(820px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  background: #fff;
  color: var(--ink);
  border-radius: 22px;
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(26, 39, 68, 0.16);
}

.modal-body {
  overflow: auto;
  padding: 22px 22px 8px;
}

.modal-card h2 {
  margin: 0 0 8px;
  font-family: Fraunces, Georgia, serif;
  font-size: 32px;
}

.modal-card h3 {
  margin: 18px 0 6px;
  font-size: 15px;
}

.modal-card p, .modal-card li { color: #243044; line-height: 1.5; }
.modal-card ol, .modal-card ul { margin: 8px 0 0; padding-left: 18px; }

.modal-card .modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 22px 16px;
  border-top: 1px solid var(--line);
}

@keyframes deal {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

@keyframes draw-flip {
  0% { opacity: 0; transform: translateY(16px) rotateY(90deg) scale(0.78); }
  55% { opacity: 1; transform: rotateY(-14deg) scale(1.08); box-shadow: 0 0 0 3px var(--gold); }
  100% { transform: none; }
}

@keyframes to-hand {
  0% { transform: translateY(-64px) scale(0.8); box-shadow: 0 0 0 3px var(--gold); }
  100% { transform: none; }
}

@keyframes to-board {
  0% { transform: translateY(64px) scale(0.8); box-shadow: 0 0 0 3px var(--gold); }
  100% { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .card.deal,
  .card.motion-draw,
  .card.motion-to-hand,
  .card.motion-to-board { animation: none; }
  .fx-layer i,
  .fx-layer::before,
  .fx-copy,
  .duel,
  .duel-team,
  .duel-bolt,
  .ko-tag,
  .seat.winner .holes,
  .hero-row.winner .hero-cards,
  .seat.ko .holes,
  .hero-row.ko .hero-cards { animation: none; }
  .duel-team.lose { filter: grayscale(0.85); opacity: 0.7; }
}

.fx-layer {
  position: fixed;
  inset: 0;
  z-index: 12;
  pointer-events: none;
  overflow: hidden;
}

.fx-layer::before {
  content: "";
  position: absolute;
  inset: 0;
  animation: fx-wash 2.2s ease forwards;
}

.fx-copy {
  position: absolute;
  left: 50%;
  top: 38%;
  transform: translate(-50%, -50%);
  min-width: 180px;
  padding: 14px 26px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  text-align: center;
  box-shadow: 0 16px 40px rgba(26, 39, 68, 0.16);
  animation: fx-pop 0.4s ease both;
  pointer-events: auto;
}

.fx-stay .fx-copy { animation: fx-pop 0.4s ease both; }

.fx-copy strong {
  display: block;
  font-family: Fraunces, Georgia, serif;
  font-size: 40px;
  line-height: 1;
}

.fx-copy span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.fx-layer i {
  position: absolute;
  left: var(--x);
  top: 62%;
  opacity: 0;
  animation-duration: var(--d);
  animation-delay: var(--delay);
  animation-timing-function: ease-in;
  animation-fill-mode: forwards;
}

.fx-win i { animation-name: fx-rise; }
.fx-loss i { animation-name: fx-fall; }

.fx-fire::before { background: radial-gradient(circle at 50% 70%, rgba(240, 136, 56, 0.42), transparent 58%); }
.fx-fire i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffe7a8, #f08838 60%, transparent 72%);
  box-shadow: 0 0 12px #f08838;
}

.fx-water::before { background: radial-gradient(circle at 50% 20%, rgba(77, 146, 234, 0.38), transparent 60%); }
.fx-water i {
  width: 9px;
  height: 14px;
  border-radius: 50% 50% 50% 50% / 35% 35% 65% 65%;
  background: linear-gradient(#d7e9ff, #4d92ea);
}

.fx-grass::before { background: radial-gradient(circle at 50% 80%, rgba(92, 186, 62, 0.35), transparent 58%); }
.fx-grass i {
  width: 9px;
  height: 16px;
  border-radius: 0 80% 0 80%;
  background: linear-gradient(#b6e7a4, #3d9a2a);
}

.fx-electric::before { background: radial-gradient(circle at 50% 40%, rgba(246, 210, 48, 0.4), transparent 55%); }
.fx-electric i {
  width: 3px;
  height: 34px;
  border-radius: 2px;
  background: linear-gradient(#fff8d0, #f6d230 40%, #fff);
  box-shadow: 0 0 12px #f6d230;
  transform: rotate(18deg);
}

.fx-ground::before { background: radial-gradient(ellipse at 50% 88%, rgba(176, 132, 62, 0.4), transparent 55%); }
.fx-ground i {
  width: 34px;
  height: 12px;
  border-radius: 50%;
  background: rgba(168, 124, 58, 0.75);
  filter: blur(1px);
}

.fx-rock::before { background: radial-gradient(circle at 50% 10%, rgba(150, 122, 48, 0.32), transparent 58%); }
.fx-rock i {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  background: linear-gradient(140deg, #ead48a, #8d7428);
}
.fx-rock.fx-loss .fx-copy { animation: fx-pop 0.4s ease both, fx-shake 0.45s linear 0.15s 2; }
.fx-layer.fx-stay .fx-copy,
.fx-layer.fx-stay .duel { animation: fx-pop 0.35s ease both; }

.duel {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(820px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  padding: 14px 16px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 40px rgba(26, 39, 68, 0.18);
  animation: fx-pop 0.35s ease both;
  pointer-events: auto;
}

.duel-actions {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.duel-line {
  margin: 0;
  text-align: center;
  font-weight: 700;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.duel-reason {
  margin: 4px 0 10px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.duel-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px 10px;
}

.duel-team {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  position: relative;
}
.duel-team.win { animation: duel-lunge 0.45s ease 0.2s both; }
.duel-team.lose { animation: duel-ko 0.55s ease 0.75s both; }

.duel-fighter { margin: 0; width: 108px; max-width: 100%; min-width: 0; text-align: center; }
.duel-pics { display: flex; gap: 2px; justify-content: center; flex-wrap: wrap; }
.duel-pics img { width: 34px; height: 34px; object-fit: contain; }
.duel-fighter b,
.duel-fighter small { display: block; }
.duel-fighter b { font-size: 13px; }
.duel-fighter small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  max-height: 2.5em;
  overflow: hidden;
}

.duel-bolt {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex: none;
  animation: duel-shot 0.45s ease 0.45s both;
}

.duel-clash {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  max-width: 100%;
}
.ko-tag {
  position: static;
  align-self: center;
  margin: 0 0 6px;
  background: #9d3040;
  color: white;
  font-style: normal;
  font-weight: 700;
  font-size: 12px;
  border-radius: 999px;
  padding: 2px 7px;
  animation: ko-pop 0.3s ease 0.9s both;
}

@keyframes victor-hop {
  0%, 100% { transform: none; }
  45% { transform: translateY(-12px) scale(1.05); }
}

@keyframes table-ko {
  0%, 100% { transform: none; }
  30% { transform: translateX(-8px) rotate(-2deg); }
  60% { transform: translateX(8px) rotate(2deg); }
}

@keyframes duel-lunge {
  0% { opacity: 0; transform: translateX(-8px); }
  35% { opacity: 1; }
  70% { transform: translateX(6px); }
  100% { transform: none; }
}

@keyframes duel-ko {
  0% { filter: none; transform: none; opacity: 1; }
  35% { transform: translateX(12px) rotate(-3deg); }
  100% { filter: grayscale(0.9); opacity: 0.6; transform: none; }
}

@keyframes duel-shot {
  0% { opacity: 0; transform: translateX(-16px) scale(0.4); }
  45% { opacity: 1; transform: scale(1.2); }
  100% { opacity: 1; transform: none; }
}

@keyframes ko-pop {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: none; }
}

.fx-ice::before { background: radial-gradient(circle at 50% 30%, rgba(190, 235, 235, 0.7), transparent 62%); }
.fx-ice i {
  width: 8px;
  height: 8px;
  background: #fff;
  border: 1px solid #86d4d4;
  box-shadow: 0 0 8px #fff;
  transform: rotate(45deg);
}

.fx-flying::before { background: linear-gradient(90deg, transparent, rgba(168, 152, 224, 0.28), transparent); }
.fx-flying i {
  width: 54px;
  height: 3px;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, #a898e0, transparent);
}
.fx-flying.fx-win i { animation-name: fx-sweep; }
.fx-flying.fx-loss i { animation-name: fx-sweep-back; }

@keyframes fx-pop {
  from { opacity: 0; transform: translate(-50%, -40%) scale(0.86); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes fx-out {
  to { opacity: 0; visibility: hidden; }
}

@keyframes fx-wash {
  0% { opacity: 0; }
  18% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes fx-rise {
  0% { opacity: 0; transform: translateY(24px) scale(0.7); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-68vh) scale(1.05); }
}

@keyframes fx-fall {
  0% { opacity: 0; transform: translateY(-58vh) scale(0.7); }
  22% { opacity: 1; }
  100% { opacity: 0; transform: translateY(16vh) scale(1); }
}

@keyframes fx-sweep {
  0% { opacity: 0; transform: translateX(-36vw); }
  25% { opacity: 0.95; }
  100% { opacity: 0; transform: translateX(42vw); }
}

@keyframes fx-sweep-back {
  0% { opacity: 0; transform: translateX(36vw); }
  25% { opacity: 0.95; }
  100% { opacity: 0; transform: translateX(-42vw); }
}

@keyframes fx-shake {
  0%, 100% { transform: translate(-50%, -50%); }
  25% { transform: translate(calc(-50% - 6px), -50%); }
  75% { transform: translate(calc(-50% + 6px), -50%); }
}

@media (max-width: 1180px) {
  .journal .log-list { max-height: 180px; }
}

@media (max-width: 760px) {
  body.playing .atmosphere { background-size: auto, auto, 34px 34px; }
  .preview-card { width: min(84px, 28vw); }
  .shell, .salon { width: min(100% - 16px, 1280px); }
  .topbar, .dock, .banner { flex-direction: column; align-items: center; }
  .top-actions { justify-content: center; }
  .dock { grid-template-columns: 1fr; width: 100%; }
  .logo, .landing-logo {
    height: 72px;
    width: auto;
    max-width: 72vw;
    object-fit: contain;
    object-position: center;
  }
  .table-grid,
  .table-grid.seats-2,
  .table-grid.seats-3,
  .table-grid.seats-5 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-areas:
      "west north east"
      "mid mid mid"
      "south south south";
    padding: 18px 6px 12px;
    gap: 8px 4px;
  }
  .table-grid.seats-2 {
    grid-template-areas:
      "north north north"
      "mid mid mid"
      "south south south";
  }
  .table-grid.seats-3 {
    grid-template-areas:
      "west . east"
      "mid mid mid"
      "south south south";
  }
  .table-grid.seats-5 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-areas:
      "nw ne west east"
      "mid mid mid mid"
      "south south south south";
  }
  .pot { min-width: 0; padding: 2px 8px 3px; }
  .pot span { font-size: 9px; letter-spacing: 0.06em; }
  .pot strong { font-size: 14px; }
  .stack { font-size: 11px; }
  .plate { padding: 4px 6px 5px; }
  .wager { font-size: 11px; padding: 2px 6px; }
  .hero-row {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    grid-template-areas:
      "left cards right"
      "plate plate plate";
    column-gap: 6px;
  }
  .hero-row:has(.play-extra) {
    grid-template-areas:
      "left cards right"
      "extra extra extra"
      "plate plate plate";
  }
  .play-right { display: contents; }
  .play-right .bet-row { grid-area: right; }
  .play-extra { grid-area: extra; width: 100%; }
  .play-left, .play-right .bet-row {
    justify-self: stretch;
    align-items: stretch;
    width: auto;
    min-width: 0;
  }
  .play { width: 100%; gap: 6px; }
  .play-left .ability-row, .play .bet-row { flex-direction: column; align-items: stretch; }
  .play .btn {
    width: 100%;
    padding: 8px 4px;
    font-size: 12px;
    line-height: 1.15;
    white-space: normal;
  }
  .play .btn-long { display: none; }
  .play .btn-short { display: inline; }
  .play-extra .btn { width: auto; flex: 1 1 auto; }
  .play .hint { text-align: center; font-size: 11px; }
  .hero-row .plate { justify-self: center; width: min(150px, 100%); }
  .board { gap: 4px; }
  .holes { width: 100%; justify-content: center; min-width: 0; }
  .board .card, .board .slot {
    width: 100%;
    max-width: none;
    height: auto;
    aspect-ratio: 2 / 3;
    flex: none;
  }
  .seat { width: 100%; min-width: 0; }
  .seat .card, .seat-1 .card, .seat-2 .card, .seat-3 .card, .seat-4 .card {
    width: calc(50% - 4px);
    max-width: 58px;
    height: auto;
    aspect-ratio: 2 / 3;
    flex: 0 1 auto;
    min-width: 0;
  }
  .hero-row .card, .seat-0 .card {
    width: min(112px, 24vw);
    max-width: min(112px, 24vw);
    height: auto;
    aspect-ratio: 2 / 3;
    flex: 0 0 auto;
  }
  .board .sprite, .seat .sprite, .seat-1 .sprite, .seat-2 .sprite, .seat-3 .sprite {
    width: auto;
    max-width: 92%;
    height: clamp(20px, 7vw, 40px);
    max-height: none;
    object-fit: contain;
  }
  .hero-row .mon, .hero-row .badges, .hero-row .stage { flex: 0 0 auto; }
  .hero-row .sprite, .seat-0 .sprite {
    width: 100%;
    max-width: 100%;
    height: 0;
    flex: 1 1 auto;
    min-height: 0;
    object-fit: contain;
    object-position: center bottom;
  }
  .fx-copy strong { font-size: 28px; }
  .duel { width: min(820px, calc(100vw - 16px)); padding: 12px; }
  .duel-row { grid-template-columns: 1fr; justify-items: center; }
  .duel-bolt { justify-self: center; }
  .duel-fighter { width: min(108px, 100%); }
  .duel-pics img { width: 34px; height: 34px; object-fit: contain; }
}

@media (max-width: 359px) {
  .hero-row, .hero-row:has(.play-extra) {
    grid-template-columns: 1fr;
    grid-template-areas:
      "cards"
      "left"
      "right"
      "plate";
  }
  .play-right { display: flex; }
  .play-left, .play-right, .play-right .bet-row {
    justify-self: center;
    align-items: center;
    width: min(280px, 100%);
  }
  .play-left .ability-row, .play .bet-row { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .play .btn { width: auto; }
  .play .btn-long { display: inline; }
  .play .btn-short { display: none; }
  .hero-row .card, .seat-0 .card {
    width: min(132px, 40vw);
    max-width: min(132px, 40vw);
  }
}
