/* Silk Rummy — brand & site styles */
:root {
  --bg: #fbf8f1;
  --bg-2: #f4eee1;
  --surface: #ffffff;
  --surface-2: #f5efe2;
  --ink: #17201c;
  --muted: #5d6862;
  --line: #e7dfcd;
  --felt: #0f3d2e;
  --felt-2: #0a2c21;
  --felt-3: #1a5a43;
  --felt-ink: #f4efe3;
  --gold: #b8892c;
  --gold-hi: #f2d58a;
  --gold-lo: #c39233;
  --gold-soft: #f6ebcf;
  --accent: #0f6b4c;
  --ruby: #b8322a;
  --red: #c0392b;
  --black: #1c2420;
  --ok: #1e7b4f;
  --ok-soft: #dff1e6;
  --bad: #b3362b;
  --bad-soft: #f8e0dc;
  --shadow-sm: 0 1px 2px rgb(23 32 28 / .06);
  --shadow: 0 1px 2px rgb(23 32 28 / .05), 0 8px 24px rgb(23 32 28 / .07);
  --shadow-lg: 0 2px 6px rgb(23 32 28 / .06), 0 24px 60px rgb(23 32 28 / .14);
  --radius: 18px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: Fraunces, Georgia, serif;
  --header-bg: rgb(251 248 241 / .82);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1311; --bg-2: #101916; --surface: #131d19; --surface-2: #1a2621; --ink: #ece7db; --muted: #a2aca6;
    --line: #26342e; --gold: #d9b263; --gold-soft: #33291a; --accent: #4fc093; --red: #e0675a; --ok: #5fcf96; --ok-soft: #173326;
    --bad: #ef8a7e; --bad-soft: #3a1f1c; --header-bg: rgb(12 19 17 / .8);
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .3); --shadow-lg: 0 24px 60px rgb(0 0 0 / .45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c1311; --bg-2: #101916; --surface: #131d19; --surface-2: #1a2621; --ink: #ece7db; --muted: #a2aca6;
  --line: #26342e; --gold: #d9b263; --gold-soft: #33291a; --accent: #4fc093; --red: #e0675a; --ok: #5fcf96; --ok-soft: #173326;
  --bad: #ef8a7e; --bad-soft: #3a1f1c; --header-bg: rgb(12 19 17 / .8);
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .3); --shadow-lg: 0 24px 60px rgb(0 0 0 / .45);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16.5px/1.7 var(--font); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; letter-spacing: -.015em; font-weight: 700; }
h1 { font-size: clamp(2rem, 4.8vw, 3rem); margin: .3em 0 .45em; }
h2 { font-size: clamp(1.45rem, 3vw, 1.95rem); margin: 1.8em 0 .5em; }
h3 { font-size: 1.18rem; margin: 1.4em 0 .4em; }
::selection { background: var(--gold-soft); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 99; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }

.wrap { margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 800px; }
.wrap.wide { max-width: 1180px; }
@media (min-width: 760px) { .wrap { padding: 0 28px; } }
main { min-height: 60vh; padding-bottom: 56px; }

/* Logo */
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; }
.logo-mark { width: 36px; height: 36px; filter: drop-shadow(0 2px 4px rgb(10 44 33 / .25)); }
.logo-word { font-family: var(--display); font-weight: 700; font-size: 1.4rem; letter-spacing: -.02em; line-height: 1; }
.logo-word em { font-style: italic; font-weight: 600; color: var(--gold); margin-left: 2px; }
.logo.on-dark { color: #f4efe3; }
.logo.on-dark em { color: var(--gold-hi); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 30; background: var(--header-bg); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; gap: 20px; min-height: 68px; }
.site-nav { display: flex; gap: 2px; margin-left: auto; }
.site-nav a { color: var(--muted); text-decoration: none; padding: 8px 14px; border-radius: 10px; font-weight: 600; font-size: .95rem; position: relative; }
.site-nav a:hover { color: var(--ink); background: var(--surface-2); }
.site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav a[aria-current="page"]::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 2px; border-radius: 2px; background: var(--gold); }
.header-cta { flex: none; }
.nav-toggle { display: none; width: 42px; height: 42px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; cursor: pointer; padding: 0; flex-direction: column; justify-content: center; align-items: center; gap: 4px; }
.nav-toggle span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--ink); transition: .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
@media (max-width: 860px) {
  .header-row { gap: 10px; }
  .header-cta { margin-left: auto; }
  .nav-toggle { display: flex; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 68px; background: var(--bg); border-bottom: 1px solid var(--line); flex-direction: column; padding: 8px 16px 18px; box-shadow: var(--shadow); }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px 10px; font-size: 1.05rem; }
  .site-nav a[aria-current="page"]::after { display: none; }
  .site-nav a[aria-current="page"] { background: var(--surface-2); }
}
@media (max-width: 380px) { .logo-word { font-size: 1.2rem; } .logo-mark { width: 32px; height: 32px; } .header-cta { padding: 7px 10px; } }

/* Breadcrumbs */
.crumbs { font-size: .85rem; color: var(--muted); padding-top: 22px; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }

/* Prose */
.prose p, .prose li { max-width: 72ch; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--gold); }
.prose img { border-radius: var(--radius); }
.lead { font-size: 1.18rem; color: var(--muted); line-height: 1.6; }
.eyebrow { display: inline-block; font: 700 .76rem var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin-bottom: 10px; }

.callout { background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent); border-radius: 14px; padding: 16px 20px; margin: 1.5em 0; }
.callout.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.callout.warn { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.callout > :first-child { margin-top: 0; }
.callout > :last-child { margin-bottom: 0; }

.table-wrap { overflow-x: auto; margin: 1.3em 0; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); }
table { border-collapse: collapse; width: 100%; font-size: .95rem; background: var(--surface); }
th, td { text-align: left; padding: 11px 15px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface-2); font-weight: 700; font-size: .88rem; }
tr:last-child td { border-bottom: 0; }

details.faq { border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 0; margin: 10px 0; box-shadow: var(--shadow-sm); }
details.faq summary { cursor: pointer; font-weight: 700; padding: 15px 48px 15px 18px; list-style: none; position: relative; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 1.4rem; font-weight: 400; color: var(--gold); transition: transform .2s; }
details.faq[open] summary::after { transform: translateY(-50%) rotate(45deg); }
details.faq > :not(summary) { padding: 0 18px; margin-top: 0; }
details.faq > :last-child { padding-bottom: 16px; margin-bottom: 0; }

/* Playing-card chips */
.hand { display: inline-flex; flex-wrap: wrap; gap: 4px; vertical-align: middle; margin: 2px 0; }
.pc { display: inline-flex; align-items: center; gap: 1px; min-width: 2.4em; justify-content: center; padding: 2px 7px; border: 1px solid #d7cdb8; border-radius: 7px;
  background: linear-gradient(#fff, #faf6ec); color: var(--black); font-weight: 800; font-size: .9em; line-height: 1.5; box-shadow: 0 1px 0 rgb(0 0 0 / .08); font-family: var(--font); }
.pc i { font-style: normal; }
.pc.red { color: #c0392b; }
.pc.joker { color: #7a4fb8; font-size: .85em; }
.pc.joker small { font-size: .7em; margin-left: 2px; }
.pc.wild { box-shadow: 0 0 0 2px #d8b062; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; border-radius: 12px; border: 1px solid transparent; font: 700 1rem var(--font);
  text-decoration: none; cursor: pointer; background: var(--accent); color: #fff; transition: transform .1s, filter .15s, box-shadow .15s; white-space: nowrap;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .18), 0 4px 14px rgb(15 107 76 / .25); }
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(1px); }
.btn.gold { background: linear-gradient(180deg, #f2d58a 0%, #d6a945 55%, #c39233 100%); color: #2a1f08; border-color: #b8892c;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .5), 0 6px 18px rgb(184 137 44 / .35); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); filter: none; }
.btn.small { padding: 8px 14px; font-size: .9rem; border-radius: 10px; }
.btn.lg { padding: 15px 28px; font-size: 1.08rem; border-radius: 14px; }
.btn:disabled { opacity: .42; cursor: not-allowed; filter: none; box-shadow: none; }

/* Tiles */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; margin: 22px 0; }
a.tile, div.tile { position: relative; display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 20px; text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow-sm); transition: transform .18s, box-shadow .18s, border-color .18s; }
a.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); }
a.tile::after { content: "→"; position: absolute; right: 20px; top: 20px; color: var(--gold); opacity: 0; transform: translateX(-4px); transition: .18s; font-weight: 700; }
a.tile:hover::after { opacity: 1; transform: none; }
.tile h3 { margin: 0 0 6px; font-size: 1.15rem; }
.tile p { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.55; }
.tile .tag { display: inline-block; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--gold); margin-bottom: 8px; }

/* Forms (tools) */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin: 22px 0; }
label { font-weight: 700; font-size: .9rem; }
input[type="number"], input[type="text"], select { font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); width: 100%; }
input:focus, select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 25%, transparent); }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.row > .field { flex: 1 1 160px; }
.result { font-size: 1.1rem; font-weight: 600; }
.badge { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.gold { background: var(--gold-soft); color: var(--gold); }

/* Footer */
.site-footer { background: var(--felt-2); color: #c9c2b0; padding: 0 0 22px; font-size: .93rem; margin-top: 40px; }
.footer-cta { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; transform: translateY(-40px); margin-bottom: -10px;
  background: radial-gradient(ellipse at 85% 0%, #2a7a5a 0%, var(--felt) 55%, #0b3326 100%); border: 1px solid rgb(242 213 138 / .25); border-radius: 22px; padding: 28px 32px; box-shadow: var(--shadow-lg); max-width: 1124px; }
.footer-cta h2 { color: #fff; margin: 0 0 4px; font-size: 1.6rem; }
.footer-cta p { margin: 0; color: #d8d1bf; }
.site-footer h2:not(.footer-cta h2) { font: 800 .74rem var(--font); text-transform: uppercase; letter-spacing: .12em; color: var(--gold-hi); margin: 6px 0 12px; }
.site-footer a:not(.btn):not(.logo) { color: #c9c2b0; text-decoration: none; display: block; padding: 4px 0; }
.site-footer a:not(.btn):not(.logo):hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 28px; }
.free-note { max-width: 40ch; margin: 14px 0; }
.pledges { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pledges li { font-size: .78rem; font-weight: 700; color: var(--gold-hi); border: 1px solid rgb(242 213 138 / .3); border-radius: 999px; padding: 3px 10px; }
.copy { border-top: 1px solid rgb(255 255 255 / .08); margin-top: 30px; padding-top: 18px; font-size: .82rem; display: flex; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; color: #9e978a; }
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
  .footer-cta { margin-left: 16px; margin-right: 16px; padding: 22px; }
}

/* Reveal-on-scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

@media print {
  .site-header, .site-footer, .crumbs, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ================= Game (play/) ================= */
.layout-game main { padding-bottom: 0; }
.game-shell { --cw: 70px; --overlap: -32px; position: relative; color: var(--felt-ink); padding: 16px 0 22px;
  background: radial-gradient(ellipse 90% 70% at 50% 35%, #123f30 0%, #0a231b 60%, #061611 100%); }
.game-shell:fullscreen { overflow: auto; padding-top: 10px; }
.game-bar { max-width: 1180px; margin: 0 auto; padding: 0 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
@media (min-width: 760px) { .game-bar, .table-wrap-outer { padding: 0 28px; } }
.game-title h1 { font-size: 1.3rem; margin: 0; color: #fff; }
.mode-label { font-size: .84rem; color: #cbbf9f; }
.scores { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { background: rgb(255 255 255 / .07); border: 1px solid rgb(255 255 255 / .1); padding: 5px 12px; border-radius: 999px; font-size: .88rem; }
.chip b { color: #f2d58a; margin-left: 2px; }
.chip small { color: #b9b19f; font-weight: 500; }
.bar-actions { display: flex; gap: 6px; align-items: center; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; border: 1px solid rgb(255 255 255 / .14); background: rgb(255 255 255 / .05); color: #e8e1cf; cursor: pointer; padding: 0; }
.icon-btn:hover { background: rgb(255 255 255 / .12); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .mute { display: none; }
.icon-btn.muted .waves { display: none; }
.icon-btn.muted .mute { display: block; }
.icon-btn[hidden], .install-btn[hidden] { display: none; }
.btn.on-felt { color: #f4efe3; border-color: rgb(255 255 255 / .22); background: rgb(255 255 255 / .05); }

.table-wrap-outer { max-width: 1180px; margin: 14px auto 0; padding: 0 16px; }
.table { position: relative; min-height: 620px; display: grid; grid-template-rows: auto auto 1fr; gap: 10px; padding: 18px 20px 20px; border-radius: 44px;
  background:
    radial-gradient(ellipse 70% 60% at 50% 45%, rgb(255 255 255 / .07), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(170deg, #1d6a4d 0%, #145039 50%, #0f412f 100%);
  box-shadow: inset 0 0 0 2px rgb(242 213 138 / .35), inset 0 0 80px rgb(0 0 0 / .45), 0 0 0 9px #3a2416, 0 0 0 11px #6b4528, 0 0 0 12px #2a180d, 0 30px 70px rgb(0 0 0 / .55); }

/* Seats */
.seat-bot { display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative; }
.player-tag { display: inline-flex; align-items: center; gap: 10px; background: rgb(0 0 0 / .28); border: 1px solid rgb(255 255 255 / .1); padding: 5px 14px 5px 5px; border-radius: 999px; transition: box-shadow .3s, border-color .3s; }
.seat.active .player-tag, .seat-you.active .status { border-color: rgb(242 213 138 / .6); box-shadow: 0 0 0 4px rgb(242 213 138 / .14), 0 0 24px rgb(242 213 138 / .25); }
.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; font: 700 1rem var(--display); font-style: normal; color: #fff; flex: none;
  background: linear-gradient(140deg, #8a6fd1, #5a3fa0); box-shadow: inset 0 0 0 2px rgb(255 255 255 / .35); }
.avatar.a-easy { background: linear-gradient(140deg, #3fb5a5, #1d7a6d); }
.avatar.a-normal { background: linear-gradient(140deg, #e08aa6, #a5466a); }
.avatar.a-hard { background: linear-gradient(140deg, #e3b24f, #9c5b1f); }
.pname { display: flex; flex-direction: column; line-height: 1.15; }
.pname b { font-size: .95rem; }
.pname small { font-size: .74rem; color: #cbbf9f; }
.thinking { display: inline-flex; gap: 3px; margin-left: 2px; }
.thinking[hidden] { display: none; }
.thinking i { width: 6px; height: 6px; border-radius: 50%; background: #f2d58a; animation: dots 1s infinite ease-in-out; }
.thinking i:nth-child(2) { animation-delay: .15s; }
.thinking i:nth-child(3) { animation-delay: .3s; }
@keyframes dots { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.bot-hand { --cw: 44px; display: flex; justify-content: center; min-height: 72px; padding-top: 6px; }
.bot-hand .card { margin-left: -30px; transform: translateY(var(--y)) rotate(var(--a)); transform-origin: 50% 120%; box-shadow: 0 2px 6px rgb(0 0 0 / .35); }
.bot-hand .card:first-child { margin-left: 0; }
.bubble { position: absolute; left: calc(50% + 120px); top: 2px; background: #fff; color: #17201c; font-size: .86rem; font-weight: 600; padding: 7px 13px; border-radius: 14px 14px 14px 4px;
  opacity: 0; transform: translateY(6px) scale(.95); transition: .25s; pointer-events: none; max-width: 240px; box-shadow: 0 8px 24px rgb(0 0 0 / .3); }
.bubble.show:not(:empty) { opacity: 1; transform: none; }

/* Centre piles */
.center { display: flex; justify-content: center; align-items: flex-end; gap: clamp(18px, 7vw, 72px); padding: 8px 0 4px; --cw: 74px; }
.pile { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pile-label { font-size: .72rem; font-weight: 700; color: #cbbf9f; text-transform: uppercase; letter-spacing: .12em; }
.stack { position: relative; width: var(--cw); height: calc(var(--cw) * 1.4); background: none; border: 0; padding: 0; cursor: pointer; border-radius: 10px; transition: transform .15s; }
.stack:disabled { cursor: default; }
.stack:not(:disabled):hover { transform: translateY(-3px); }
.stack > .card { position: absolute; left: 0; top: 0; }
.stack .card.back:nth-of-type(2) { transform: translate(2px, -2px); }
.stack .card.back:nth-of-type(3) { transform: translate(4px, -4px); }
.stack .count { position: absolute; right: -12px; bottom: -10px; z-index: 3; background: linear-gradient(180deg, #f2d58a, #c39233); color: #2a1f08; font-size: .72rem; font-weight: 800; border-radius: 999px; padding: 2px 8px; box-shadow: 0 2px 6px rgb(0 0 0 / .3); }
.cut-card { position: absolute; left: 50%; top: 50%; transform: translate(-8%, -50%) rotate(90deg); --cw: 64px; z-index: 0; }
.cut-card .card { box-shadow: 0 2px 6px rgb(0 0 0 / .3); }
.stack.open .card.under { transform: rotate(-7deg) translate(-6px, 2px); filter: brightness(.92); }
.stack.glow::before { content: ""; position: absolute; inset: -6px; border-radius: 14px; border: 2px solid rgb(242 213 138 / .8); animation: ring 1.4s ease-in-out infinite; pointer-events: none; z-index: 4; }
@keyframes ring { 50% { box-shadow: 0 0 24px rgb(242 213 138 / .6); opacity: .6; } }
.stack.open.drop-target::before { content: "Drop here"; position: absolute; inset: -8px; border-radius: 14px; border: 2px dashed rgb(242 213 138 / .55); display: flex; align-items: flex-end; justify-content: center;
  font-size: .66rem; font-weight: 700; color: #f2d58a; padding-bottom: 2px; transform: translateY(18px); pointer-events: none; opacity: 0; transition: opacity .2s; }
.is-dragging ~ * .stack.open.drop-target::before, body:has(.is-dragging) .stack.open.drop-target::before { opacity: 1; }
.stack.open.drop-hover { transform: scale(1.08); }
.stack.open.drop-hover::before { opacity: 1; border-style: solid; background: rgb(242 213 138 / .12); }
.wild-info { display: flex; flex-direction: column; align-items: center; gap: 4px; padding-bottom: 20px; }
.wild-info b { font: 700 1.05rem var(--display); color: #f2d58a; background: rgb(0 0 0 / .25); border: 1px solid rgb(242 213 138 / .3); padding: 4px 14px; border-radius: 999px; }

/* Your seat */
.seat-you { display: flex; flex-direction: column; align-items: center; gap: 10px; align-self: end; }
.status { font-weight: 700; text-align: center; padding: 6px 16px; border-radius: 999px; background: rgb(0 0 0 / .25); border: 1px solid rgb(255 255 255 / .1); color: #f4efe3; min-height: 1.4em; font-size: .95rem; transition: .3s; }
.status:empty { visibility: hidden; }
.status.go { color: #fff; }
.game-tip { display: flex; align-items: flex-start; gap: 10px; background: rgb(242 213 138 / .14); border: 1px solid rgb(242 213 138 / .35); color: #f4efe3; font-size: .86rem; padding: 8px 12px; border-radius: 12px; max-width: 640px; }
.game-tip[hidden] { display: none; }
.game-tip button { background: none; border: 0; color: #f2d58a; cursor: pointer; font-size: 1rem; padding: 0 2px; }
.your-hand { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 14px 20px; padding-top: 20px; min-height: calc(var(--cw) * 1.4 + 48px); }
.group { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.group-cards { display: flex; padding: 0 2px; }
.group-cards .card + .card { margin-left: var(--overlap); }
.your-hand .card { cursor: grab; touch-action: none; transition: translate .14s ease, box-shadow .14s ease, opacity .14s; }
.your-hand .card:hover { translate: 0 -6px; }
.your-hand .card.selected { translate: 0 -20px; box-shadow: 0 0 0 3px #f2d58a, 0 12px 22px rgb(0 0 0 / .4); }
.your-hand .card.fresh { box-shadow: 0 0 0 3px #6fe0a8, 0 6px 14px rgb(0 0 0 / .35); }
.your-hand .card.dragging { opacity: .25; }
.drag-ghost { position: fixed !important; left: 0; top: 0; z-index: 1000; pointer-events: none; margin: 0 !important; translate: none !important; box-shadow: 0 24px 40px rgb(0 0 0 / .45) !important; cursor: grabbing; }
.drop-caret { position: fixed; width: 4px; border-radius: 4px; background: #f2d58a; box-shadow: 0 0 12px #f2d58a; z-index: 999; pointer-events: none; display: none; }
.new-group-zone { display: none; width: calc(var(--cw) * .9); height: calc(var(--cw) * 1.4); border: 2px dashed rgb(242 213 138 / .5); border-radius: 10px; align-items: center; justify-content: center; text-align: center;
  color: #f2d58a; font-size: .72rem; font-weight: 700; margin-bottom: 26px; padding: 4px; }
.is-dragging .new-group-zone { display: flex; }
.new-group-zone.drop-hover { background: rgb(242 213 138 / .14); border-style: solid; }
.group-label { font-size: .7rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: rgb(0 0 0 / .28); color: #cbbf9f; white-space: nowrap; }
.group-label.ok { background: rgb(46 160 105 / .32); color: #b5f0cf; }
.group-label.bad { background: rgb(200 70 60 / .3); color: #ffbdb2; }
.group-label.bad:empty::before { content: "Not valid"; }
.move-here { font: 700 .7rem var(--font); background: transparent; border: 1px dashed rgb(242 213 138 / .7); color: #f2d58a; border-radius: 999px; padding: 2px 9px; cursor: pointer; }
.hand-points { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 10px; font-size: .86rem; min-height: 1.6em; }
.pts-pill { background: rgb(0 0 0 / .25); padding: 3px 12px; border-radius: 999px; color: #e2dccb; }
.pts-pill b { color: #f2d58a; }
.pts-pill.ok { background: rgb(46 160 105 / .35); color: #d3f7e3; }
.hand-points .hint { color: #f2d58a; padding: 3px 0; }
.controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ctl { display: inline-flex; align-items: center; gap: 7px; font: 700 .9rem var(--font); color: #f4efe3; background: rgb(255 255 255 / .07); border: 1px solid rgb(255 255 255 / .16);
  padding: 9px 15px; border-radius: 12px; cursor: pointer; transition: background .15s, transform .1s, opacity .15s; }
.ctl svg { width: 18px; height: 18px; }
.ctl:hover:not(:disabled) { background: rgb(255 255 255 / .14); }
.ctl:active:not(:disabled) { transform: translateY(1px); }
.ctl.primary { background: #1f8a62; border-color: #34a879; }
.ctl.primary:hover:not(:disabled) { background: #24a072; }
.ctl.gold { background: linear-gradient(180deg, #f2d58a, #c39233); color: #2a1f08; border-color: #b8892c; }
.ctl.danger { color: #ffbdb2; }
.ctl:disabled { opacity: .38; cursor: not-allowed; }

/* Overlays */
.overlay { position: absolute; inset: 0; background: rgb(4 16 12 / .72); display: grid; place-items: center; z-index: 10; padding: 16px; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); border-radius: 44px; }
.overlay[hidden] { display: none; }
.dialog { background: var(--surface); color: var(--ink); border-radius: 22px; padding: 24px; width: min(480px, 100%); box-shadow: 0 30px 80px rgb(0 0 0 / .5); max-height: calc(100% - 8px); overflow: auto; animation: pop .35s cubic-bezier(.2,.8,.2,1); }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.97); } }
.dialog.wide { width: min(880px, 100%); }
.dialog h2 { margin: 0 0 8px; font-size: 1.5rem; }
.setup { width: min(560px, 100%); }
.setup-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.setup-head h2 { margin: 0; }
.setup-mark { width: 46px; height: 46px; flex: none; }
.fine-l { margin: 0; color: var(--muted); font-size: .88rem; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.stats[hidden] { display: none; }
.stats div { background: var(--surface-2); border-radius: 12px; padding: 8px; text-align: center; }
.stats b { display: block; font: 700 1.25rem var(--display); color: var(--gold); }
.stats span { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.dialog fieldset { border: 0; padding: 0; margin: 0 0 16px; }
.dialog legend { font-weight: 800; font-size: .74rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 8px; }
.mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.opp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.opt, .opp { position: relative; cursor: pointer; font-weight: 400; }
.opt input, .opp input { position: absolute; opacity: 0; pointer-events: none; }
.opt > span, .opp > span { display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 14px; transition: .15s; background: var(--surface); }
.opp > span { align-items: center; text-align: center; padding: 12px 8px; }
.opt b, .opp b { font-size: .95rem; color: var(--ink); }
.opt small, .opp small { font-size: .78rem; color: var(--muted); }
.opp .avatar { width: 42px; height: 42px; margin-bottom: 4px; }
.opt input:checked + span, .opp input:checked + span { border-color: var(--gold); background: var(--gold-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 20%, transparent); }
.opt input:focus-visible + span, .opp input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.deal-btn { width: 100%; }
.result-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.dialog.wide .result-actions { position: sticky; bottom: -24px; background: var(--surface); padding: 12px 0 4px; margin-bottom: -4px; }
.result-hero { display: flex; align-items: center; gap: 16px; margin: -24px -24px 14px; padding: 22px 24px; border-radius: 22px 22px 0 0; }
.result-hero.win { background: linear-gradient(135deg, #f6e3a8, #e2bd62); color: #2a1f08; }
.result-hero.loss { background: var(--surface-2); }
.result-hero h2 { margin: 0 0 2px; }
.result-hero p { margin: 0; }
.result-icon { font-size: 2.2rem; width: 62px; height: 62px; display: grid; place-items: center; border-radius: 50%; background: rgb(255 255 255 / .55); flex: none; }
.match-msg { font: 700 1.1rem var(--display); padding: 12px 16px; border-radius: 14px; background: var(--surface-2); margin-bottom: 8px; }
.match-msg.win { background: var(--ok-soft); color: var(--ok); }
.res-hand { border-radius: 16px; padding: 12px 14px; margin: 10px 0; background: linear-gradient(170deg, #1a5f45, #0f412f); color: var(--felt-ink); }
.res-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.res-groups { display: flex; flex-wrap: wrap; gap: 12px 16px; --cw: 46px; --overlap: -20px; }
.res-group { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.res-note { margin: 8px 0 0; font-size: .85rem; color: #f2d58a; }
.res-totals { font-weight: 600; color: var(--muted); }

.log-box { max-width: 1180px; margin: 22px auto 0; padding: 0 16px; font-size: .84rem; color: #b9b19c; }
@media (min-width: 760px) { .log-box { padding: 0 28px; } }
.log-box summary { cursor: pointer; font-weight: 700; color: #cbbf9f; width: max-content; }
.log { list-style: none; padding: 6px 0 0; margin: 0; max-height: 120px; overflow: auto; }
.log li:first-child { color: #f4efe3; }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 2000; display: none; }
.confetti.on { display: block; }
.below-game { padding-top: 24px; }

@media (max-width: 760px) {
  .game-shell { --cw: 48px; --overlap: -25px; padding-top: 10px; }
  .game-title h1 { font-size: 1.05rem; }
  .table { min-height: 560px; padding: 12px 8px 14px; border-radius: 26px; gap: 6px;
    box-shadow: inset 0 0 0 2px rgb(242 213 138 / .3), inset 0 0 50px rgb(0 0 0 / .4), 0 0 0 5px #3a2416, 0 0 0 6px #6b4528, 0 18px 40px rgb(0 0 0 / .5); }
  .overlay { border-radius: 26px; padding: 8px; }
  .bot-hand { --cw: 32px; min-height: 52px; }
  .bot-hand .card { margin-left: -22px; }
  .bubble { left: auto; right: 4px; top: -4px; max-width: 46%; font-size: .76rem; }
  .center { --cw: 54px; gap: 22px; }
  .cut-card { display: none; }
  .wild-info b { font-size: .9rem; padding: 3px 10px; }
  .your-hand { gap: 12px 10px; padding-top: 16px; }
  .your-hand .card.selected { translate: 0 -14px; }
  .ctl { padding: 8px 11px; font-size: .82rem; gap: 5px; }
  .ctl svg { width: 16px; height: 16px; }
  .mode-grid { grid-template-columns: repeat(2, 1fr); }
  .stats b { font-size: 1.05rem; }
  .dialog { padding: 18px; }
  .result-hero { margin: -18px -18px 12px; padding: 16px 18px; }
  .dialog.wide .result-actions { bottom: -18px; }
  .res-groups { --cw: 38px; --overlap: -17px; }
  .scores .chip { font-size: .8rem; padding: 4px 10px; }
}
@media (max-width: 380px) { .game-shell { --cw: 44px; --overlap: -23px; } .ctl { padding: 7px 9px; } }

/* ================= Tools ================= */
.muted { color: var(--muted); font-size: .92rem; }
.panel-title { margin: 0 0 10px; font-size: 1.2rem; }
.inline { display: flex; gap: 8px; }
.type-field { flex: 2 1 280px !important; }
.picked-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 8px; }
.picked-head .spacer { flex: 1; }
.picked { min-height: 46px; display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; border: 1px dashed var(--line); border-radius: 12px; background: var(--bg); font-size: 1.05rem; }
.picked button.pc { cursor: pointer; }
.picked button.pc:hover { text-decoration: line-through; }
.picker-wrap { margin-top: 14px; }
.picker-wrap summary { cursor: pointer; font-weight: 600; margin-bottom: 8px; }
.picker-grid { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 5px; }
.pc.pick { cursor: pointer; min-width: 0; padding: 6px 0; font-size: .92rem; width: 100%; }
.pc.pick:hover:not(:disabled) { border-color: var(--gold); }
.pc.pick:disabled { opacity: .3; cursor: not-allowed; }
.picker-extra { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.picker-extra .pc.pick { width: auto; padding: 6px 12px; }
@media (max-width: 640px) { .picker-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.tool-result p { margin: 8px 0; }
.res-head-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.big-verdict { font: 700 1.3rem var(--display); }
.big-verdict.ok { color: var(--ok); }
.big-verdict.bad { color: var(--bad); }
.big-verdict b { font-size: 2.2rem; color: var(--gold); }
.res-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid var(--line); }
.res-line:last-of-type { border-bottom: 0; }
.tip { background: var(--gold-soft); padding: 8px 12px; border-radius: 10px; }

.names { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0 12px; }
.tracker-head { display: flex; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.score-table input { width: 70px; padding: 6px 8px; }
.score-table td, .score-table th { white-space: nowrap; }
.score-table tfoot th, .score-table tfoot td { background: var(--surface-2); }
.score-table .out { color: var(--bad); font-weight: 700; }
.score-table .lead-cell { color: var(--ok); font-weight: 700; }
.entry { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.entry-cell { display: grid; gap: 6px; }
.quick { display: flex; gap: 4px; flex-wrap: wrap; }
.quick .q { font: 600 .75rem var(--font); padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); cursor: pointer; }
.quick .q:hover { border-color: var(--gold); }
.actions { margin-top: 16px; }
.winner { font: 700 1.2rem var(--display); color: var(--gold); min-height: 0; margin: 8px 0; }
.winner:empty { display: none; }

.sheet { background: #fff; color: #111; border: 1px solid var(--line); border-radius: 12px; padding: 20px; overflow-x: auto; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 12px; }
.sheet-head > div { display: grid; }
.sheet-title { font: 700 1.4rem var(--display); }
.sheet table { background: #fff; font-size: .9rem; }
.sheet th, .sheet td { border: 1px solid #999; padding: 9px 8px; color: #111; background: #fff; }
.sheet th { background: #f2efe7; }
.sheet td:first-child, .sheet th:first-child { width: 48px; text-align: center; }
.sheet-foot { font-size: .78rem; color: #444; margin: 10px 0 0; }
@media print {
  .layout-wide .wrap > h1 { display: none; }
  .sheet { border: 0; padding: 0; }
  .sheet th, .sheet td { padding: 7px 6px; }
}

/* ================= Playing cards (shared) ================= */
.card { --w: var(--cw, 64px); position: relative; display: inline-block; width: var(--w); height: calc(var(--w) * 1.4); border-radius: calc(var(--w) * .12);
  background: linear-gradient(160deg, #ffffff 0%, #fbf7ee 100%); color: #1c2420; border: 1px solid #ddd3bf; flex: none; padding: 0; text-align: left;
  box-shadow: 0 1px 1px rgb(0 0 0 / .12), 0 3px 8px rgb(0 0 0 / .18); font-family: var(--font); user-select: none; -webkit-user-select: none; overflow: hidden; }
.card.red { color: #c3312a; }
.card .ci { position: absolute; display: flex; flex-direction: column; align-items: center; font-weight: 800; font-size: calc(var(--w) * .25); line-height: .92; letter-spacing: -.04em; }
.card .ci i { font-style: normal; font-size: .82em; letter-spacing: 0; }
.card .ci b { font-size: .42em; letter-spacing: .02em; writing-mode: vertical-rl; margin-top: 2px; }
.card .ci.tl { left: 7%; top: 5%; }
.card .ci.br { right: 7%; bottom: 5%; transform: rotate(180deg); }
.card .ci .wj { font-style: normal; color: #c08f2f; font-size: .62em; margin-top: 2px; }
.card .cc { position: absolute; inset: 0; display: grid; place-items: center; font-size: calc(var(--w) * .5); line-height: 1; }
.card .cc.ace { font-size: calc(var(--w) * .62); }
.card .cc.court > span { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 54%; height: 58%; border: 1.5px solid currentColor; border-radius: calc(var(--w) * .06);
  font: 700 calc(var(--w) * .36)/1 var(--display); background: linear-gradient(160deg, rgb(242 213 138 / .35), rgb(242 213 138 / .08)); box-shadow: inset 0 0 0 2px #fff; }
.card .cc.court i { font-style: normal; font-size: .55em; font-family: var(--font); }
.card.joker { color: #6d43b0; }
.card .cc.joker-c { font-size: calc(var(--w) * .58); background: radial-gradient(circle at 50% 48%, rgb(109 67 176 / .12) 0 30%, transparent 31%); }
.card.wild { box-shadow: 0 0 0 2px #e2bd62, 0 3px 8px rgb(0 0 0 / .18); }
.card.back { background:
    radial-gradient(circle at 50% 50%, rgb(242 213 138 / .28) 0 16%, transparent 17%),
    repeating-linear-gradient(45deg, rgb(242 213 138 / .13) 0 1.5px, transparent 1.5px 8px),
    repeating-linear-gradient(-45deg, rgb(242 213 138 / .13) 0 1.5px, transparent 1.5px 8px),
    linear-gradient(160deg, #1f7354, #0a2c21);
  border: calc(var(--w) * .05) solid #fbf7ee; }
.card.back::after { content: "♠"; position: absolute; inset: 0; display: grid; place-items: center; color: #e9c873; font-size: calc(var(--w) * .34); text-shadow: 0 1px 0 rgb(0 0 0 / .3); }
.card.empty { background: rgb(0 0 0 / .16); border: 2px dashed rgb(255 255 255 / .22); box-shadow: none; }

/* ================= Home ================= */
.home-hero { position: relative; overflow: hidden; color: var(--felt-ink); background: var(--felt-2); padding: 64px 0 84px; }
.hero-felt { position: absolute; inset: 0; background:
  radial-gradient(ellipse 60% 70% at 72% 40%, #2b7d5c 0%, transparent 70%),
  radial-gradient(ellipse 80% 90% at 10% 0%, #134a37 0%, transparent 60%),
  linear-gradient(180deg, #0f3d2e, #0a2c21);
}
.hero-felt::after { content: ""; position: absolute; inset: 0; opacity: .5; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E"); }
.hero-grid { position: relative; display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; }
.hero-pill { display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 700; color: #f2d58a; background: rgb(242 213 138 / .1); border: 1px solid rgb(242 213 138 / .28); padding: 6px 14px; border-radius: 999px; }
.hero-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: #6fe0a8; box-shadow: 0 0 0 3px rgb(111 224 168 / .25); }
.home-hero h1 { font-size: clamp(2.5rem, 6vw, 4.3rem); color: #fff; margin: 18px 0 16px; line-height: 1.02; letter-spacing: -.03em; }
.home-hero h1 em { font-style: italic; font-weight: 600; background: linear-gradient(180deg, #f8e3a4, #d6a945); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-copy > p { font-size: 1.18rem; color: #d7d0bf; max-width: 50ch; margin: 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-ghost { background: rgb(255 255 255 / .06); color: #fff; border-color: rgb(255 255 255 / .22); box-shadow: none; }
.hero-ghost:hover { background: rgb(255 255 255 / .12); }
.hero-facts { list-style: none; padding: 0; margin: 36px 0 0; display: flex; flex-wrap: wrap; gap: 10px 28px; }
.hero-facts li { display: flex; flex-direction: column; }
.hero-facts b { font: 700 1.7rem/1 var(--display); color: #f2d58a; }
.hero-facts span { font-size: .82rem; color: #b9b19f; margin-top: 4px; }
.hero-visual { position: relative; height: 380px; }
.fan { position: absolute; left: 50%; top: 52%; --cw: 128px; }
.fan .card { position: absolute; left: calc(var(--cw) / -2); top: calc(var(--cw) * -.7); transform-origin: 50% 120%;
  transform: translateX(var(--x)) rotate(var(--r)); box-shadow: 0 2px 4px rgb(0 0 0 / .2), 0 24px 40px rgb(0 0 0 / .35);
  animation: deal-in .8s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--d) * 90ms + 150ms); transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.fan:hover .card { transform: translateX(calc(var(--x) * 1.15)) translateY(-8px) rotate(calc(var(--r) * 1.15)); }
@keyframes deal-in { from { transform: translate(0, 160px) rotate(0) scale(.85); opacity: 0; } }
.float-badge { position: absolute; background: #fff; color: #17201c; font-weight: 700; font-size: .9rem; padding: 10px 16px; border-radius: 14px; box-shadow: 0 16px 40px rgb(0 0 0 / .3);
  display: flex; align-items: center; gap: 8px; animation: floaty 5s ease-in-out infinite, pop-in .6s .9s both; }
.float-badge.b1 { left: 0; top: 30px; }
.float-badge.b2 { right: 0; bottom: 24px; animation-delay: -2.5s, 1.2s; }
.ok-dot { width: 22px; height: 22px; border-radius: 50%; background: #1e7b4f; color: #fff; display: grid; place-items: center; font-size: .75rem; }
@keyframes floaty { 50% { transform: translateY(-8px); } }
@keyframes pop-in { from { opacity: 0; scale: .8; } }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 10px; }
  .hero-visual { height: 250px; order: -1; }
  .fan { --cw: 88px; }
  .float-badge { font-size: .78rem; padding: 7px 11px; }
  .float-badge.b1 { left: 4%; top: 0; }
  .float-badge.b2 { right: 4%; bottom: 0; }
  .home-hero { padding: 28px 0 56px; }
}
@media (max-width: 420px) { .fan { --cw: 74px; } .fan .card { --x2: 1; } .hero-facts { gap: 10px 20px; } .hero-actions .btn { flex: 1 1 100%; } }

.home-band { position: relative; margin-top: -40px; z-index: 2; }
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.feature h3 { margin: 12px 0 6px; font-size: 1.08rem; }
.feature p { margin: 0; color: var(--muted); font-size: .93rem; line-height: 1.55; }
.f-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--gold-soft); color: var(--gold); }
.f-icon svg { width: 24px; height: 24px; }
@media (max-width: 960px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .features { grid-template-columns: 1fr; } }

.home-section { padding: 72px 0 8px; }
.home-section.alt { padding-bottom: 8px; }
.sec-head { text-align: center; max-width: 640px; margin: 0 auto 32px; }
.sec-head.left { text-align: left; margin: 0; }
.sec-head h2 { margin: 0 0 12px; font-size: clamp(1.8rem, 4vw, 2.6rem); }
.sec-head p { color: var(--muted); font-size: 1.08rem; margin: 0; }

.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.mode-card { position: relative; display: flex; flex-direction: column; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 26px; text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s, border-color .2s; overflow: hidden; }
.mode-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--gold) 50%, var(--line)); }
.mode-card.featured { background: linear-gradient(170deg, #134a37, #0a2c21); color: #f4efe3; border-color: rgb(242 213 138 / .35); }
.mode-card.featured p, .mode-card.featured .mode-meta { color: #cfc8b6; }
.mode-card h3 { margin: 10px 0 0; font-size: 1.4rem; }
.mode-card p { margin: 0; color: var(--muted); flex: 1; }
.mode-art { display: flex; gap: 4px; font-size: 1.15rem; }
.mode-art .pc { padding: 6px 9px; box-shadow: 0 4px 10px rgb(0 0 0 / .12); }
.mode-art .pc:nth-child(1) { transform: rotate(-8deg); }
.mode-art .pc:nth-child(3) { transform: rotate(8deg); }
.mode-meta { font-size: .82rem; color: var(--muted); font-weight: 600; }
.mode-go { font-weight: 800; color: var(--gold); margin-top: 6px; }
.featured .mode-go { color: #f2d58a; }
.ribbon { position: absolute; top: 18px; right: -34px; transform: rotate(35deg); background: linear-gradient(180deg, #f2d58a, #c39233); color: #2a1f08; font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 4px 40px; }
@media (max-width: 860px) { .modes { grid-template-columns: 1fr; } }

.puzzle-section { background: linear-gradient(180deg, transparent, var(--bg-2) 30%, var(--bg-2) 80%, transparent); padding-bottom: 40px; }
.puzzle-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 40px; align-items: center; }
@media (max-width: 960px) { .puzzle-grid { grid-template-columns: 1fr; } }
.ticks { list-style: none; padding: 0; margin: 18px 0; }
.ticks li { padding-left: 28px; position: relative; margin: 8px 0; }
.ticks li::before { content: "✓"; position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); font-size: .72rem; font-weight: 800; display: grid; place-items: center; }
.text-link { font-weight: 700; text-decoration: none; color: var(--gold); }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: s; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.step h3 { margin: 14px 0 6px; }
.step p { color: var(--muted); margin: 0 0 14px; font-size: .95rem; }
.step-n { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--felt); color: #f2d58a; font: 700 1.1rem var(--display); }
.step .hand .pc { font-size: 1.1rem; padding: 5px 9px; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }
.center-cta { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

.game-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.game-chips a { text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); padding: 10px 18px; border-radius: 999px; font-weight: 700; box-shadow: var(--shadow-sm); transition: .15s; }
.game-chips a:hover { border-color: var(--gold); transform: translateY(-2px); }

/* ================= Daily puzzle ================= */
.puzzle { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 24px; box-shadow: var(--shadow-lg); }
.pz-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.pz-title { margin: 0; font-size: 1.45rem; }
.pz-streak { flex: none; text-align: center; background: var(--felt); color: #f2d58a; border-radius: 14px; padding: 8px 12px; line-height: 1.1; }
.pz-streak b { display: block; font: 700 1.5rem var(--display); }
.pz-streak span { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #cfc8b6; }
.pz-wild { margin: 10px 0 14px; font-size: .95rem; }
.pz-hand { --cw: 54px; display: flex; flex-wrap: wrap; gap: 6px; padding: 16px; border-radius: 16px; background: radial-gradient(ellipse at 50% 30%, #1d6447, var(--felt) 70%); }
.pz-hand .card { animation: deal-in .5s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * 40ms); }
.pz-actions { display: flex; gap: 10px; margin-top: 16px; }
.pz-actions .btn { flex: 1; }
.pz-actions .btn.chosen { opacity: 1; outline: 3px solid var(--gold); }
.pz-result:empty { display: none; }
.pz-result { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.pz-verdict { font: 700 1.2rem var(--display); margin: 0 0 4px; }
.pz-verdict.ok { color: var(--ok); }
.pz-verdict.bad { color: var(--bad); }
.pz-groups { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 10px 0; }
.pz-group { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.pz-next { font-size: .9rem; color: var(--muted); }
.puzzle.won { animation: glow-win 1.2s ease; }
@keyframes glow-win { 30% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--ok) 35%, transparent), var(--shadow-lg); } }
.puzzle-page { max-width: 760px; margin: 10px 0 30px; }
@media (max-width: 560px) { .pz-hand { --cw: 40px; gap: 4px; padding: 10px; } .puzzle { padding: 16px; } }
