/* Layout: one phone-width column on a felt table; screens swap in place, bottom tab bar for the app screens */
:root {
  --felt: #0E2A20;
  --felt-2: #143A2C;
  --felt-3: #1D4C3A;
  --line: #2C5E4A;
  --cream: #F4EFE3;
  --muted: #B6CBBF;
  --gold: #E0B04B;
  --gold-ink: #2A1E05;
  --card: #FBF8F1;
  --ink: #17221D;
  --suit-red: #C0392B;
  --good: #63C795;
  --bad: #EE8A7E;
  --wood: #6B4728;
  --display: 'Oswald', 'Arial Narrow', Arial, sans-serif;
  --body: 'DM Sans', 'Segoe UI', Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--felt);
  color: var(--cream);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.45;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.app { max-width: 440px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }
.testbar {
  font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--gold);
  padding-block: 10px; text-align: center; border-bottom: 1px dashed var(--line);
}
main { flex: 1; padding-block: 20px 24px; }
.screen { display: flex; flex-direction: column; gap: 18px; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; margin: 0; text-wrap: balance; letter-spacing: .01em; }
h1 { font-size: 34px; line-height: 1.1; text-transform: uppercase; }
h2 { font-size: 26px; line-height: 1.15; }
h3 { font-size: 19px; }
p { margin: 0; }
a { color: var(--gold); }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--gold); font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, textarea:focus-visible, input:focus-visible, .choice:focus-within { outline: 2px solid var(--gold); outline-offset: 2px; }
.btn {
  display: block; text-align: center; text-decoration: none;
  border: 0; border-radius: 12px; padding: 14px 18px; font-weight: 700; font-size: 16px;
  background: var(--gold); color: var(--gold-ink); width: 100%;
}
.btn.ghost { background: transparent; color: var(--cream); border: 1px solid var(--line); }
.btn.danger { background: transparent; color: var(--bad); border: 1px solid var(--bad); }
.btn:disabled { opacity: .45; cursor: default; }
.panel { background: var(--felt-2); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 10px; }

/* Playing cards */
.cards { display: flex; gap: 6px; flex-wrap: wrap; }
.pc {
  width: 46px; height: 64px; border-radius: 7px; background: var(--card); color: var(--ink);
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--display); font-size: 22px; line-height: 1; box-shadow: 0 2px 0 rgba(0,0,0,.35);
}
.pc i { font-style: normal; font-size: 20px; margin-top: 3px; }
.pc.r { color: var(--suit-red); }
.pc.sm { width: 34px; height: 48px; font-size: 17px; }
.pc.sm i { font-size: 15px; }

/* Home */
.hello { display: flex; justify-content: space-between; align-items: end; gap: 12px; }
.streak { text-align: right; font-size: 13px; color: var(--muted); }
.streak b { display: block; font-family: var(--display); font-size: 26px; color: var(--gold); font-weight: 500; }
.xp { height: 8px; background: var(--felt-3); border-radius: 99px; overflow: hidden; }
.xp span { display: block; height: 100%; width: 62%; background: var(--gold); }
.tile {
  text-align: left; border: 1px solid var(--line); background: var(--felt-2); border-radius: 18px;
  padding: 18px; display: flex; flex-direction: column; gap: 8px; width: 100%;
}
.tile.hero { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.tile.hero .eyebrow { color: var(--gold-ink); }
.tile .row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* Quiz */
.qhead { display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dots { display: flex; gap: 6px; }
.dots span { width: 26px; height: 6px; border-radius: 99px; background: var(--felt-3); }
.dots span.on { background: var(--gold); }
.dots span.ok { background: var(--good); }
.dots span.ko { background: var(--bad); }
.board { background: var(--felt-3); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.board .lbl { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.hands { display: flex; flex-direction: column; gap: 10px; }
.hand {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  background: var(--felt-2); border: 2px solid var(--line); border-radius: 14px; padding: 10px 14px; text-align: left;
}
.hand .who { font-weight: 700; }
.hand .res { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.hand.win { border-color: var(--good); }
.hand.pick-ko { border-color: var(--bad); }
.verdict { font-weight: 700; }
.verdict.ok { color: var(--good); }
.verdict.ko { color: var(--bad); }
.share { white-space: pre-line; font-family: var(--display); font-size: 18px; text-align: center; padding: 14px; background: var(--felt-3); border-radius: 12px; }

/* Parcours */
.mods { display: flex; flex-direction: column; gap: 10px; }
.mod { display: flex; gap: 14px; align-items: center; text-align: left; width: 100%; padding: 14px; border-radius: 14px; background: var(--felt-2); border: 1px solid var(--line); }
.mod .num { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); background: var(--felt-3); }
.mod.done .num { background: var(--good); color: var(--felt); }
.mod.cur { border-color: var(--gold); }
.mod.cur .num { background: var(--gold); color: var(--gold-ink); }
.mod .txt { flex: 1; min-width: 0; }
.tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 3px 8px; border-radius: 99px; background: var(--felt-3); color: var(--muted); white-space: nowrap; }
.tag.prem { background: var(--gold); color: var(--gold-ink); }

/* Table */
.tablewrap { padding: 26px 26px 34px; }
.ptable {
  position: relative; aspect-ratio: 1.55; max-width: 100%;
  background: radial-gradient(ellipse at 50% 45%, #2A6A50 0%, #1B4B39 70%);
  border: 8px solid var(--wood); border-radius: 50%;
}
.pot { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); text-align: center; font-size: 12px; color: var(--muted); }
.pot b { display: block; color: var(--cream); font-size: 15px; }
.seat {
  position: absolute; transform: translate(-50%, -50%); min-width: 54px; text-align: center;
  background: var(--felt); border: 1px solid var(--line); border-radius: 10px; padding: 4px 6px; font-size: 11px; line-height: 1.2;
}
.seat b { display: block; font-size: 12px; }
.seat.out { opacity: .45; }
.seat.me { border-color: var(--gold); background: var(--gold); color: var(--gold-ink); }
.seat .d { display: inline-block; width: 16px; height: 16px; border-radius: 50%; background: var(--cream); color: var(--ink); font-weight: 700; font-size: 10px; line-height: 16px; margin-left: 3px; }
.spot { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; }
.acts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.act { border: 1px solid var(--line); background: var(--felt-2); border-radius: 12px; padding: 14px 8px; font-weight: 700; }
.act.sel-ok { border-color: var(--good); background: #1E5640; }
.act.sel-ko { border-color: var(--bad); background: #4A2723; }
.act.right { border-color: var(--good); }
.disclaimer { font-size: 12px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 10px; }

/* Premium */
.price { display: flex; gap: 10px; }
.price > div { flex: 1; text-align: center; padding: 14px 8px; border-radius: 14px; border: 1px solid var(--line); background: var(--felt-2); }
.price > div.best { border-color: var(--gold); }
.price b { display: block; font-family: var(--display); font-size: 24px; font-weight: 500; }
.perks { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }

/* Forms */
fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
legend { font-weight: 700; margin-bottom: 8px; padding: 0; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span { display: inline-block; padding: 9px 13px; border-radius: 99px; border: 1px solid var(--line); background: var(--felt-2); font-size: 14px; }
.choice input:checked + span { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); font-weight: 700; }
.scale .choice span { width: 46px; text-align: center; padding-inline: 0; }
.scale-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); max-width: 270px; }
textarea, input[type=text], input[type=password] {
  width: 100%; border-radius: 12px; border: 1px solid var(--line); background: var(--felt-2); color: var(--cream);
  font: inherit; padding: 12px; resize: vertical;
}
.err { color: var(--bad); font-size: 14px; }
.copybox { width: 100%; min-height: 160px; font-size: 13px; }

/* Bottom nav */
nav.tabs {
  position: sticky; bottom: 0; background: var(--felt); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(4, 1fr); padding-bottom: env(safe-area-inset-bottom, 0px);
}
nav.tabs button { background: none; border: 0; padding: 10px 2px 12px; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px; }
nav.tabs button .ic { font-size: 18px; line-height: 1; }
nav.tabs button.on { color: var(--gold); font-weight: 700; }

@media (prefers-reduced-motion: no-preference) {
  .screen { animation: rise .22s ease-out; }
  @keyframes rise { from { transform: translateY(6px); } to { transform: none; } }
}
