/* Art direction B, the same colours as the app (ios/PokerGame/Sources/App/Theme.swift). The room is always dark and
   lamp-lit, so there is one theme. Quiet-ui rules: one accent (amber), no borders on everything, capsules for one-line
   controls (TW-1), no small description lines (PG-1). */
:root {
  --cream: #F6EBD6;
  --cream-dim: rgba(246, 235, 214, .72);
  --ink: #2A1A10;
  --amber: #F2A93B;
  --card-face: #FBF3E2;
  --card-red: #B3362C;
  --card-black: #22170F;
  --chip: #C8483A;
  --glass: rgba(246, 235, 214, .12);
  --glass-strong: rgba(28, 19, 13, .72);
  --room: #1C130D;
  --sheet: #232325;
  --sheet-row: #2C2C2E;
  --text: #ECECEC;
  --text-2: rgba(255, 255, 255, .60);
  --hair: rgba(255, 255, 255, .10);
  --serif: ui-serif, "New York", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--room); color: var(--text); font-family: var(--sans);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* One phone-shaped column, so the table looks the same on a phone and a laptop. */
#app { max-width: 440px; margin: 0 auto; height: 100dvh; position: relative; overflow: hidden; }

/* ---------- Lobby ---------- */
.lobby { height: 100%; overflow-y: auto; padding: 0 16px 24px; }
.lobby header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: center;
  height: 56px; background: linear-gradient(var(--room) 70%, transparent); }
.lobby h1 { margin: 0; font-size: 17px; font-weight: 600; }
.balance { position: absolute; right: 0; padding: 0 14px; height: 36px; border-radius: 18px; background: var(--glass);
  font-weight: 600; font-variant-numeric: tabular-nums; display: flex; align-items: center; }
.scene { display: block; width: 100%; aspect-ratio: 2 / 1; border-radius: 22px; overflow: hidden; position: relative;
  margin-top: 16px; transition: transform .12s ease-out; }
.scene:active { transform: scale(.98); }
.scene img { width: 100%; height: 100%; object-fit: cover; display: block; }
.scene span { position: absolute; left: 18px; bottom: 12px; font: 600 32px/1 var(--serif); color: var(--cream);
  text-shadow: 0 1px 6px rgba(0, 0, 0, .8); }

/* ---------- Friends sheet ---------- */
dialog { border: 0; padding: 0; background: var(--sheet); color: var(--text); width: min(440px, 100vw);
  max-width: 100vw; max-height: 92dvh; border-radius: 22px 22px 0 0; margin: auto auto 0; }
dialog::backdrop { background: rgba(0, 0, 0, .5); }
.sheet { padding: 8px 16px 28px; }
.sheet-bar { display: flex; align-items: center; justify-content: center; height: 52px; position: relative; }
.sheet-bar h2 { margin: 0; font-size: 17px; font-weight: 600; }
.sheet-bar .close { position: absolute; left: 0; width: 40px; height: 40px; border-radius: 20px; background: var(--sheet-row);
  font-size: 18px; }
.group { background: var(--sheet-row); border-radius: 14px; margin-top: 18px; overflow: hidden; }
.row { display: flex; align-items: center; justify-content: space-between; min-height: 50px; padding: 0 16px; gap: 12px; }
.row + .row { box-shadow: inset 0 1px 0 var(--hair); }
.row select { background: none; border: 0; color: var(--amber); font: inherit; text-align: right; appearance: none;
  padding-right: 2px; }
.row input { flex: 1; background: none; border: 0; color: var(--text); font: 20px var(--serif); letter-spacing: .12em;
  text-transform: uppercase; min-width: 0; }
.row input::placeholder { color: var(--text-2); letter-spacing: 0; text-transform: none; }
.row .action { color: var(--amber); width: 100%; text-align: left; height: 50px; }
.row .action:disabled { color: var(--text-2); }
.name { font: 600 24px var(--serif); padding: 14px 16px; }
.error { color: #FB923C; margin: 14px 4px 0; }
.age { text-align: center; padding: 40px 8px 20px; }
.age h3 { font: 600 30px/1.2 var(--serif); margin: 0 0 28px; }
.big { display: block; width: 100%; height: 52px; border-radius: 26px; font-weight: 600; margin-top: 12px; }
.big.primary { background: var(--amber); color: var(--ink); }
.big.plain { background: var(--sheet-row); }

/* ---------- Table ---------- */
.table { position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden;
  background: var(--room) url(img/table-bg.jpg) center / cover no-repeat; }
.table::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(rgba(0, 0, 0, .45) 0%, transparent 14%, transparent 55%, rgba(23, 13, 8, .92) 80%); }
.table > * { position: relative; z-index: 1; }
.top { display: flex; align-items: center; justify-content: space-between; padding: max(8px, env(safe-area-inset-top)) 16px 0; height: 60px; }
.round { width: 44px; height: 44px; border-radius: 22px; background: var(--glass-strong); color: var(--cream);
  display: grid; place-items: center; font-size: 20px; }
.blinds { color: var(--cream-dim); font-size: 13px; font-variant-numeric: tabular-nums; }
.stage { flex: 1; position: relative; }
.seat { position: absolute; width: 96px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  transform: translateX(-50%); transition: opacity .2s; }
.seat.out { opacity: .4; }
.portrait { width: 60px; height: 60px; border-radius: 30px; background: var(--ink); position: relative;
  box-shadow: 0 0 0 2px rgba(246, 235, 214, .35); display: grid; place-items: center; font: 600 20px var(--serif);
  color: var(--cream); }
.portrait img { width: 100%; height: 100%; border-radius: 30px; object-fit: cover; }
.seat.turn .portrait { box-shadow: 0 0 0 4px var(--amber), 0 0 14px rgba(242, 169, 59, .6); }
.ai { position: absolute; right: -6px; bottom: -4px; background: var(--ink); color: var(--amber); font: 700 10px var(--sans);
  padding: 1px 5px; border-radius: 6px; }
.dealer { position: absolute; left: -8px; top: -6px; width: 22px; height: 22px; border-radius: 11px; background: var(--cream);
  color: var(--ink); font: 700 12px/22px var(--serif); text-align: center; box-shadow: 0 0 0 1.5px var(--ink); }
/* Generated names are two words ("Clever Plover"): wrap onto two lines rather than cut them off. */
.seat .nm { font: 600 15px/1.1 var(--serif); color: var(--cream); max-width: 96px; text-align: center;
  overflow-wrap: anywhere; text-shadow: 0 0 3px #000, 0 0 3px #000; }
.seat .st { font-size: 12px; color: var(--cream-dim); font-variant-numeric: tabular-nums; position: relative;
  text-shadow: 0 0 3px #000; }
.win { color: var(--amber); font-weight: 700; position: absolute; left: calc(100% + 6px); white-space: nowrap; }
.seat.right .win { left: auto; right: calc(100% + 6px); }
.shown { display: flex; gap: 3px; margin-top: 2px; }
.bet { position: absolute; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 5px;
  font: 600 13px var(--sans); color: var(--cream); font-variant-numeric: tabular-nums; }
.bet::before { content: ""; width: 14px; height: 14px; border-radius: 7px; background: var(--card-face);
  box-shadow: inset 0 0 0 3px var(--chip); }
.center { position: absolute; left: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column;
  align-items: center; gap: 10px; }
.pot { font: 600 17px var(--serif); color: var(--cream); min-height: 22px; }
.board { display: flex; gap: 6px; }
.card { width: 44px; height: 62px; border-radius: 6px; background: var(--card-face); box-shadow: inset 0 0 0 1.5px var(--ink),
  2px 3px 0 rgba(0, 0, 0, .45); display: flex; flex-direction: column; align-items: center; justify-content: center;
  font: 600 22px/1 var(--serif); color: var(--card-black); }
.card i { font-style: normal; font-size: 19px; margin-top: 2px; }
.card.red { color: var(--card-red); }
.card.slot { background: none; box-shadow: inset 0 0 0 1px rgba(246, 235, 214, .16); }
.card.sm { width: 30px; height: 42px; font-size: 15px; border-radius: 4px; }
.card.sm i { font-size: 13px; margin: 0; }
.card.lg { width: 70px; height: 98px; font-size: 34px; border-radius: 10px; }
.card.lg i { font-size: 29px; }
.you { position: absolute; left: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column;
  align-items: center; gap: 8px; }
.you .hand { display: flex; gap: 8px; position: relative; }
.you.out .hand { opacity: .45; }
.you .st { font: 600 17px var(--serif); color: var(--cream); font-variant-numeric: tabular-nums; position: relative; }
.you.turn .st { color: var(--amber); }
.you .bet { top: -26px; left: 50%; }
/* Your avatar and title on your own seat, laid over so the cards and stack don't move (owner, 2026-11-28). */
.you .portrait.mine { position: absolute; right: calc(100% + 12px); top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 22px; font-size: 16px; }
.you .portrait.mine img { border-radius: 22px; }
.you.out .portrait.mine { opacity: .45; }
.you .tt { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); white-space: nowrap; margin-top: 2px;
  font: 600 11px/1.1 var(--sans, system-ui); color: var(--amber); text-shadow: 0 0 3px rgba(0,0,0,.9); }
.bubble { position: absolute; width: 150px; background: var(--cream); color: var(--ink); font: 14px/1.25 var(--serif);
  text-align: center; padding: 6px 10px; border-radius: 12px; transform: translateX(-50%); z-index: 5;
  animation: fade .2s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateX(-50%) scale(.92); } }
.invite { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.invite .code { font: 600 40px var(--serif); letter-spacing: .18em; color: var(--cream); user-select: all; }
.pill { height: 44px; padding: 0 22px; border-radius: 22px; background: var(--amber); color: var(--ink); font-weight: 600;
  box-shadow: inset 0 0 0 1.5px var(--ink); }
.closed { font: 600 20px/1.3 var(--serif); color: var(--cream); text-align: center; padding: 0 32px; }

/* Action bar: fixed height so the raise slider never moves the table (as in the app). */
.bar { height: 158px; padding: 0 16px max(8px, env(safe-area-inset-bottom)); display: flex; flex-direction: column;
  justify-content: flex-end; gap: 12px; }
.timer { height: 4px; border-radius: 2px; background: rgba(246, 235, 214, .15); overflow: hidden; }
.timer div { height: 100%; background: var(--amber); border-radius: 2px; }
.timer.late div { background: var(--card-red); }
.buttons { display: flex; gap: 10px; }
.buttons button { flex: 1; height: 53px; border-radius: 27px; background: var(--glass-strong); color: var(--cream);
  font-weight: 600; font-size: 19px; box-shadow: inset 0 0 0 1px rgba(246, 235, 214, .12); transition: transform .1s; }
.buttons button:active { transform: scale(.97); }
.buttons button.primary { background: var(--amber); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.raise { display: flex; flex-direction: column; gap: 8px; }
.quick { display: flex; gap: 8px; justify-content: center; }
.quick button { height: 32px; padding: 0 12px; border-radius: 16px; background: var(--glass); color: var(--cream); font-size: 13px; }
input[type=range] { width: 100%; accent-color: var(--amber); }

/* Chat and seat menus */
.menu { position: absolute; z-index: 20; background: #2C2C2E; border-radius: 14px; padding: 6px; min-width: 200px;
  box-shadow: 0 0 0 1px var(--hair); }
.menu .emoji { display: flex; flex-wrap: wrap; justify-content: space-between; padding: 4px 4px 8px; font-size: 24px;
  max-width: 236px; } /* six to a row: with a pack there are twelve */
.menu .emoji button { width: 36px; height: 36px; border-radius: 8px; }
.menu > button { display: block; width: 100%; text-align: left; height: 40px; padding: 0 12px; border-radius: 8px; }
.menu .danger { color: #FF6B5E; }
.seat .tt { font: 600 11px/1.1 var(--sans, system-ui); color: var(--amber); max-width: 96px; text-align: center;
  text-shadow: 0 0 3px rgba(0,0,0,.9); overflow-wrap: break-word; margin-top: 2px; }
.menu .info { display: flex; justify-content: space-between; gap: 16px; padding: 6px 12px; font-size: 14px; }
.menu .info .num { color: var(--text-2); font-variant-numeric: tabular-nums; }
.menu .info.title { color: var(--amber); font-weight: 600; }
.menu h4 { margin: 4px 12px 6px; font-weight: 600; font-size: 13px; color: var(--text-2); }
@media (hover: hover) {
  .menu button:hover, .quick button:hover { background: rgba(255, 255, 255, .07); }
}
.lobby header .menu { position: absolute; }
.menu .note { margin: 4px 12px 6px; color: var(--amber); font-variant-numeric: tabular-nums; min-height: 0; }
.menu .note:empty { display: none; }
/* Left and right seats sit beside the board: a long name wraps onto two short lines instead of reaching the cards. */
.seat.beside .nm { white-space: normal; max-width: 64px; text-align: center; line-height: 1.1; }
.menu .sep { height: 1px; background: var(--hair); margin: 6px 8px; }
button.blinds { height: 44px; padding: 0 12px; }
.menu .note { display: block; }
.link-code { display: block; font: 600 28px var(--serif); letter-spacing: .16em; color: var(--cream); padding: 4px 0;
  user-select: all; }
.link-row { display: flex; gap: 8px; align-items: center; }
.link-input { flex: 1; min-width: 0; height: 36px; border-radius: 8px; border: 0; background: rgba(255, 255, 255, .08);
  color: var(--text); font: 18px var(--serif); letter-spacing: .12em; text-transform: uppercase; padding: 0 10px; }
.link-input::placeholder { letter-spacing: 0; text-transform: none; color: var(--text-2); }
.link-row button { height: 36px; padding: 0 14px; border-radius: 18px; background: var(--amber); color: var(--ink); font-weight: 600; }

/* Rewards (server/nakama/rewards.go): rank rosettes, card backs, felts, the weekly table. */
.lobby .trophy { position: absolute; left: 0; width: 40px; height: 36px; border-radius: 18px; background: var(--glass);
  display: grid; place-items: center; color: var(--cream); }
.seat .nm .rank { display: inline-block; vertical-align: -2px; margin-right: 3px; }
.card.back { background: var(--card-face); position: relative; }
.card.back::before { content: ""; position: absolute; inset: 2.5px; border-radius: 3px; background: #7A2E28;
  box-shadow: inset 0 0 0 2px #7A2E28, inset 0 0 0 2.8px rgba(246, 235, 214, .45); }
.card.back.navy::before { background: #24365A; box-shadow: inset 0 0 0 2px #24365A, inset 0 0 0 2.8px rgba(246, 235, 214, .45); }
.card.back.forest::before { background: #2E5233; box-shadow: inset 0 0 0 2px #2E5233, inset 0 0 0 2.8px rgba(246, 235, 214, .45); }
.card.back.gold::before { background: #6B4D1F; box-shadow: inset 0 0 0 2px #6B4D1F, inset 0 0 0 2.8px var(--amber); }
.card.back.midnight::before { background: #12121A; box-shadow: inset 0 0 0 2px #12121A, inset 0 0 0 2.8px var(--amber); }
.winner { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--amber);
  font: 600 22px var(--serif); }
.winner div { color: var(--cream); }
.section { margin: 22px 16px 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.row.look { width: 100%; text-align: left; }
.row.look.locked .grow { color: var(--text-2); }
.row.look.locked .swatch { opacity: .4; }
.grow { flex: 1; }
.dim { color: var(--text-2); font-variant-numeric: tabular-nums; }
.tick { color: var(--amber); font-weight: 700; }
.swatch { width: 34px; height: 44px; display: grid; place-items: center; }
.swatch.felt { border-radius: 6px; background-size: 260%; background-position: center; } /* the baize, not the rail */
.rankrow { min-height: 72px; }
.rankrow .rank { display: grid; }
.rankname { font: 600 22px var(--serif); }
.trophies { display: flex; align-items: center; gap: 6px; color: var(--amber); font-weight: 600; font-size: 20px; }
.place { width: 28px; }
.me { font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }
.switch { width: 22px; height: 22px; accent-color: var(--amber); }
.portrait .backs { position: absolute; left: -16px; bottom: -10px; width: 44px; height: 42px; transform: scale(.7);
  transform-origin: bottom left; }
.portrait .backs .card { position: absolute; top: 0; }
.portrait .backs .card:first-child { left: 0; transform: rotate(-10deg); }
.portrait .backs .card:last-child { left: 10px; transform: rotate(8deg); }

/* Season track and avatars */
.step { width: 44px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.step.reached { color: var(--amber); }
.row.season { gap: 14px; }
.row.season progress { flex: 1; accent-color: var(--amber); height: 6px; }
.avatar { width: 40px; height: 40px; border-radius: 20px; object-fit: cover; }
.avatar.initials { display: grid; place-items: center; background: var(--ink); color: var(--cream); font: 600 13px var(--serif); }

/* Web purchases (Stripe): price at the right of a menu row; the result after coming back from Stripe's page. */
.menu > button.buy { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.menu .price { color: var(--text-2); font-variant-numeric: tabular-nums; }
.note.banner { text-align: center; margin: 4px 16px 0; color: var(--amber); }

/* ---------- Wide windows (owner 2026-11-29: big screens get their own layout) ---------- */
.wide #app { max-width: none; }
.wide .lobby { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px;
  max-width: 1300px; margin: 0 auto; align-content: start; }
.wide .lobby > header { grid-column: 1 / -1; }
.wide .lobby > .scene { margin: 0; }
.stage-in { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.wide .bar { width: 100%; max-width: 560px; margin-left: auto; margin-right: auto; }
/* The painted oval turned a quarter, so its rail runs the long way round the players. */
.wide .table { background: var(--room) !important; }
.wide .table::before { content: ""; position: absolute; left: 50%; top: 50%; width: 100vh; height: 100vw;
  transform: translate(-50%, -50%) rotate(90deg); background: var(--felt) center / cover no-repeat; z-index: 0; }

.menu .google-row { padding: 6px 8px 4px; min-height: 0; }
.menu button.google { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 40px;
  border-radius: 20px; background: #131314; border: 1px solid #8e918f; color: #e3e3e3; font: 500 14px var(--sans); }
.wide .lobby > .note.banner { grid-column: 1 / -1; margin: 0; }

/* Ladder points after a hand, by your stack (instant feedback, 2026-11-29). Above the stack, so a title below stays. */
.you .pts { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 30px; white-space: nowrap;
  font: 700 16px var(--sans); color: var(--amber); text-shadow: 0 0 3px rgba(0,0,0,.9); animation: pts-rise 2.2s ease-out forwards; }
.you .pts.down { color: var(--cream-dim); }
@keyframes pts-rise { 0% { opacity: 0; transform: translate(-50%, 6px); } 12% { opacity: 1; transform: translate(-50%, 0); }
  80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -8px); } }

.out-of-chips { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 14px; }
.out-of-chips .pill.plain { background: var(--glass-strong); color: var(--cream); }
.out-of-chips .note { color: var(--cream-dim); font-size: 13px; margin: 2px 0 0; text-align: center; max-width: 260px; }

.you .hand-name { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 8px; white-space: nowrap;
  font: 600 13px var(--sans); color: var(--cream-dim); text-shadow: 0 0 3px rgba(0,0,0,.9); }

/* Chips held by the anti-dumping limit (server OpHeld): one plain line over the board, amber like other notes. */
.held { color: var(--amber); font-weight: 600; font-size: 14px; margin-bottom: 8px; text-align: center; }
