:root {
  --ink: #142b28;
  --ink-2: #27443f;
  --cream: #f4eedf;
  --paper: #fffdf7;
  --coral: #d75942;
  --blue: #2f75b5;
  --gold: #d69b24;
  --green: #173f38;
  --green-light: #2e685a;
  --line: rgba(20, 43, 40, .14);
  --shadow: 0 24px 80px rgba(31, 50, 43, .13);
  --serif: Iowan Old Style, Baskerville, 'Times New Roman', serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --page-width: 1180px;
  --page-gutter: 20px;
  --page-gap: 32px;
  --app-safe-top: max(0px, calc(env(safe-area-inset-top, 0px) - 8px));
}

/* A living table: resume, step away, or finish deliberately. */
.returning-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; padding-block: 76px 54px; }
.returning-copy h1 { margin: 22px 0 24px; font: 500 clamp(48px, 5.7vw, 76px)/.98 var(--serif); letter-spacing: -.05em; }
.returning-copy h1 em { color: var(--coral); font-weight: 400; }
.returning-copy > p { max-width: 460px; color: #566b63; font: 19px/1.6 var(--serif); }
.resume-assurance { display: flex; align-items: center; gap: 10px; margin-top: 28px; color: #526b61; font-size: 12px; line-height: 1.5; }
.resume-assurance > span:first-child { display: grid; width: 27px; height: 27px; flex-shrink: 0; place-items: center; border-radius: 50%; background: #e0e8db; }
.returning-tables, .resume-stack { display: grid; gap: 18px; min-width: 0; }
.resume-card { position: relative; overflow: hidden; border: 1px solid #30554a; border-radius: 18px; color: #fff9eb; background: #173f35; box-shadow: 0 22px 60px rgba(16,48,37,.15); }
.resume-card-featured { padding: 25px 30px 0; background: radial-gradient(ellipse at 80% 30%, #2d5c46 0, transparent 65%), #173f35; }
.resume-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.resume-status { display: inline-flex; align-items: center; gap: 8px; color: #d3e3d5; font-size: 11px; font-weight: 650; }
.resume-status i { width: 6px; height: 6px; flex-shrink: 0; border-radius: 50%; background: #b6d7a9; box-shadow: 0 0 0 4px rgba(182,215,169,.1); }
.resume-code { color: #a8beb0; font-size: 10px; font-weight: 650; letter-spacing: .15em; }
.resume-card-main { position: relative; }
.resume-copy { min-width: 0; }
.resume-mode { color: #b5cabe; font-size: 10px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.resume-copy h2 { margin: 10px 0; color: #fff9eb; font: 500 34px/1.12 var(--serif); letter-spacing: -.025em; }
.resume-copy p { margin: 0; color: #c9d8ce; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.resume-tiles { display: flex; justify-content: center; padding: 31px 0 28px; }
.resume-tiles > span { display: grid; width: 57px; height: 77px; place-content: center; gap: 8px; text-align: center; color: #bf523e; border: 1px solid #e8dbc0; border-radius: 8px; background: linear-gradient(145deg, #fffdf3, #e7dabf); box-shadow: inset 0 0 0 3px #fdf5e4, 0 12px 18px #08251c55; font: 500 37px/.9 var(--serif); }
.resume-tiles > span:first-child { transform: rotate(-12deg) translateY(5px); }
.resume-tiles > span:nth-child(2) { z-index: 1; transform: translateY(-3px); }
.resume-tiles > span:last-child { transform: rotate(12deg) translateY(5px); }
.resume-tiles small { font: 8px var(--sans); }
.resume-card-actions { display: flex; align-items: center; gap: 16px; margin-top: 25px; }
.button-resume { flex: 1; justify-content: space-between !important; color: #173f35; background: #f1e6c9; box-shadow: 0 5px 16px #09291f33; }
.button-resume:hover { background: #fff3d9; }
.resume-exit { min-height: 44px; padding: 6px 0; cursor: pointer; border: 0; color: #c4d5c9; background: transparent; font-size: 11px; text-underline-offset: 4px; }
.resume-exit:hover { color: #fff2df; text-decoration: underline; }
.resume-card-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 25px; padding-block: 16px; color: #b0c4b7; border-top: 1px solid #ffffff17; font-size: 10px; }
.returning-footer { display: flex; grid-column: 1/-1; justify-content: space-between; margin: 0; padding-top: 25px; color: #5e7469; border-top: 1px solid var(--line); font-size: 12px; }
.returning-footer a { color: var(--ink); font-weight: 700; }
.returning-footer a span { margin-left: 15px; }
.invitation-note { margin-top: 24px; padding: 18px; border: 1px solid #d6c7a4; border-radius: 10px; background: #f5eace; }
.invitation-note strong { font-size: 12px; }
.invitation-note p, .returning-copy .legacy-note { margin: 7px 0 0; color: #637166; font: 12px/1.6 var(--sans); }
.resume-card-compact { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 26px; padding: 20px 24px; }
.resume-card-compact .resume-card-top { grid-column: 1/-1; }
.resume-card-compact .resume-copy h2 { font-size: 25px; margin: 6px 0; }
.resume-card-compact .resume-copy p { font-size: 11px; }
.resume-card-compact .resume-mode { font-size: 9px; }
.resume-card-compact .resume-card-actions { flex-direction: column; justify-content: center; gap: 0; margin: 0; }
.resume-card-compact .button-resume { width: 100%; flex: 0 0 auto; gap: 18px; font-size: 12px; }
.resume-card-compact .resume-exit { min-height: 32px; }
.lifecycle-dialog { width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); padding: 34px; overflow: auto; color: var(--ink); border: 1px solid #d8d0bd; border-radius: 20px; background: var(--paper); box-shadow: 0 30px 100px #05261b55; }
.lifecycle-dialog::backdrop { background: #061c18b8; backdrop-filter: blur(6px); }
.lifecycle-symbol { display: grid; width: 48px; height: 48px; place-items: center; margin-bottom: 24px; border-radius: 14px; color: #315e4c; background: #e4ecdf; font: 30px var(--serif); }
.lifecycle-symbol.is-destructive { color: #984731; background: #f2dfd3; }
.lifecycle-dialog .eyebrow { font-size: 9px; }
.lifecycle-dialog h2 { margin: 13px 0 16px; font: 500 35px/1.05 var(--serif); letter-spacing: -.035em; }
.lifecycle-dialog p { margin: 0; color: #63756b; font-size: 14px; line-height: 1.65; }
.lifecycle-detail { margin-top: 20px; padding: 14px 16px; border: 1px solid #e3dfd1; border-radius: 9px; background: #f5f1e6; color: #657267; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.lifecycle-actions { display: flex; gap: 10px; margin-top: 28px; }
.lifecycle-actions .button { flex: 1; padding: 12px 16px; font-size: 12px; line-height: 1.4; }
.button-danger { color: #fff9f2; background: #a34632; }
.button-danger:hover { background: #893a29; }
.lifecycle-dialog .lifecycle-error, .lifecycle-inline-error { margin: 16px 0 0; color: #983d2a; font-size: 12px; }
.lifecycle-inline-error { margin: 16px; padding: 12px; border-radius: 8px; background: #fbe4d9; }
.menu-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.menu-close { display: grid; width: 40px; height: 40px; place-items: center; flex-shrink: 0; border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; font-size: 23px; }
.menu-option { display: flex; width: 100%; min-height: 78px; align-items: center; gap: 15px; margin-top: 18px; padding: 16px; text-align: left; cursor: pointer; border: 1px solid #dde0d1; border-radius: 12px; color: #244a39; background: #f0f2e7; }
.menu-option > span:first-child { font: 26px var(--serif); }
.menu-option > span:nth-child(2) { flex: 1; }
.menu-option strong, .menu-option small { display: block; }
.menu-option strong { font-size: 13px; }
.menu-option small { margin-top: 5px; color: #607868; font-size: 11px; }
.menu-option-danger { margin-top: 10px; background: #fffaf4; border-color: #e5d6c9; color: #994c38; }
.menu-option-danger small { color: #866e61; }
.menu-back { width: 100%; margin-top: 24px; font-size: 12px; }
.abandoned-summary { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px clamp(18px, 4vw, 55px); border-bottom: 1px solid #d9c9b4; color: #543e30; background: #f4e5cf; }
.abandoned-summary h2 { margin: 0 0 7px; font: 500 27px var(--serif); }
.abandoned-summary p { max-width: 570px; margin: 0; color: #786451; font-size: 12px; line-height: 1.6; }
.abandoned-summary .button { flex-shrink: 0; font-size: 12px; }
.history-result.is-abandoned { color: #82654d; background: #f1e4d5; }
.closed-lobby { display: grid; min-height: calc(100dvh - 72px - var(--app-safe-top)); padding: 32px 20px; place-items: center; background: radial-gradient(ellipse at 50% 40%, #285244, transparent 65%); }
.closed-lobby > div { width: min(500px, 100%); padding: 38px; border: 1px solid #ffffff25; border-radius: 18px; color: #f5efdf; background: #10392f; }
.closed-lobby h1 { margin: 20px 0; font: 500 39px/1.05 var(--serif); }
.closed-lobby p { color: #d2e0d3; font-size: 14px; line-height: 1.6; }
.closed-lobby small { display: block; color: #adc4b3; font-size: 12px; line-height: 1.6; }
.closed-lobby .button { margin-top: 25px; }
.lifecycle-dialog :focus-visible, .resume-card :focus-visible, .returning-footer a:focus-visible, .game-menu-toggle:focus-visible { outline: 3px solid #dca65c; outline-offset: 4px; }
@media (max-width: 850px) {
  .returning-hero { gap: 32px; padding-block: 44px 40px; }
  .resume-card-featured { padding-inline: 22px; }
  .resume-card-featured .resume-card-actions { align-items: stretch; flex-direction: column; gap: 3px; }
  .resume-card-featured .resume-card-foot { margin-top: 12px; }
}
@media (max-width: 600px) {
  .returning-hero { grid-template-columns: 1fr; gap: 24px; padding-top: 30px; }
  .returning-copy h1 { margin: 17px 0; font-size: 46px; }
  .returning-copy > p { font-size: 16px; line-height: 1.5; }
  .resume-assurance { margin-top: 14px; font-size: 11px; }
  .resume-card-featured { padding-top: 20px; }
  .resume-tiles { padding-block: 18px; }
  .resume-tiles > span { width: 48px; height: 64px; font-size: 31px; }
  .resume-copy h2 { font-size: 31px; }
  .resume-card-featured .resume-card-actions { margin-top: 21px; }
  .resume-card-featured .button-resume { min-height: 50px; }
  .returning-footer { flex-direction: column; gap: 18px; line-height: 1.5; padding-top: 20px; }
  .resume-card-compact { grid-template-columns: 1fr; padding: 18px; }
  .resume-card-compact .resume-card-actions { flex-direction: row; gap: 14px; margin-top: 8px; }
  .resume-card-compact .button-resume { width: auto; flex: 1; padding-inline: 15px; }
  .resume-card-compact .resume-exit { min-height: 44px; max-width: 95px; line-height: 1.4; }
  .lifecycle-dialog { padding: 27px 22px; border-radius: 17px; }
  .lifecycle-dialog h2 { font-size: 32px; }
  .lifecycle-actions { flex-direction: column; }
  .lifecycle-actions .button { min-height: 46px; }
  .abandoned-summary { align-items: flex-start; flex-direction: column; gap: 16px; }
  .abandoned-summary .button { width: 100%; }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; }
body { margin: 0; color: var(--ink); font-family: var(--sans); background: var(--cream); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
/* Shared page frame; the actual game deliberately keeps its full-width rows. */
.wrap { width: min(var(--page-width), calc(100% - var(--page-gutter) * 2)); margin-inline: auto; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 26px; font-weight: 700; letter-spacing: -.04em; }
.brand-mark { display: grid; width: 38px; height: 38px; place-items: center; color: var(--cream); border-radius: 11px; background: var(--ink); font-size: 18px; font-style: italic; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.brand-light { color: var(--paper); }
.brand-light .brand-mark { color: var(--ink); background: var(--cream); }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; color: var(--coral); font-size: 11px; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; }
.eyebrow::before { width: 22px; height: 1px; content: ''; background: currentColor; }
.button { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; gap: 18px; padding: 0 22px; cursor: pointer; border: 0; border-radius: 8px; font-weight: 750; transition: transform .18s ease, background .18s ease, opacity .18s ease, box-shadow .18s ease; }
.button:not(:disabled):hover { transform: translateY(-2px); }
.button:focus-visible, input:focus-visible, .tile:focus-visible { outline: 3px solid rgba(215, 89, 66, .45); outline-offset: 3px; }
.button:disabled { cursor: not-allowed; opacity: .42; }
.button-primary { color: #fff; background: var(--coral); box-shadow: 0 10px 24px rgba(184, 64, 42, .2); }
.button-primary:not(:disabled):hover { background: #c94d38; box-shadow: 0 14px 30px rgba(184, 64, 42, .28); }
.button-ghost { border: 1px solid var(--line); background: rgba(255, 255, 255, .3); }
.button-large { min-height: 56px; padding-inline: 27px; }
.button-wide { width: 100%; min-height: 54px; justify-content: space-between; }
.flash { margin-top: 12px; padding: 14px 18px; border: 1px solid rgba(189, 64, 43, .25); border-radius: 10px; color: #873425; background: #fbe2da; }

/* PWA installation and lifecycle */
.nav-actions { display: flex; align-items: center; gap: 22px; }
.nav-install { padding: 7px 11px; cursor: pointer; border: 1px solid var(--line); border-radius: 7px; color: var(--ink-2); background: rgba(255,255,255,.35); font-size: 11px; font-weight: 750; }
.pwa-update { position: fixed; z-index: 150; right: 18px; bottom: 18px; display: grid; width: min(510px, calc(100vw - 36px)); grid-template-columns: 1fr auto auto; align-items: center; gap: 16px; padding: 15px 14px 15px 18px; border: 1px solid rgba(255,255,255,.15); border-radius: 12px; color: #f4f8f6; background: #173f38; box-shadow: 0 22px 70px rgba(0,0,0,.3); }
.pwa-update strong, .pwa-update small { display: block; }
.pwa-update strong { font-size: 12px; }
.pwa-update small { margin-top: 4px; color: #a8bdb7; font-size: 10px; }
.pwa-update .button { min-height: 40px; padding-inline: 15px; font-size: 11px; }
.pwa-update-dismiss { width: 30px; height: 30px; cursor: pointer; border: 0; color: #9db3ad; background: transparent; font-size: 22px; }
.pwa-dialog { width: min(430px, calc(100vw - 34px)); padding: 34px; border: 1px solid rgba(20,43,40,.12); border-radius: 18px; color: var(--ink); background: var(--paper); box-shadow: var(--shadow); text-align: center; }
.pwa-dialog::backdrop { background: rgba(7,28,24,.72); backdrop-filter: blur(5px); }
.pwa-dialog-mark { display: grid; width: 58px; height: 58px; margin: 0 auto 18px; place-items: center; border-radius: 15px; color: var(--cream); background: var(--ink); font-family: var(--serif); font-size: 27px; font-style: italic; }
.pwa-dialog h2 { margin: 0 0 12px; font-family: var(--serif); font-size: 31px; font-weight: 500; }
.pwa-dialog p { margin: 0; color: #657772; font-size: 13px; line-height: 1.6; }
.pwa-dialog-actions { display: flex; justify-content: center; margin-top: 24px; }

/* Landing */
.landing { min-height: 100vh; background: var(--cream); background-image: radial-gradient(circle at 20% 0, rgba(255,255,255,.95), transparent 36%), linear-gradient(rgba(24,54,49,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(24,54,49,.025) 1px, transparent 1px); background-size: auto, 28px 28px, 28px 28px; }
.site-nav { display: flex; height: calc(84px + var(--app-safe-top)); align-items: center; justify-content: space-between; padding-top: var(--app-safe-top); border-bottom: 1px solid var(--line); }
.nav-rule { font-size: 13px; font-weight: 700; }
.public-site-nav { position: relative; display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: clamp(24px,4vw,58px); }
.public-primary-nav { display: flex; min-width: 0; align-items: stretch; justify-content: center; align-self: stretch; gap: clamp(18px,3vw,38px); }
.public-primary-nav a { position: relative; display: flex; align-items: center; color: #5c6f69; font-size: 12px; font-weight: 750; }
.public-primary-nav a::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; content: ''; background: transparent; }
.public-primary-nav a:hover,.public-primary-nav a.is-active { color: var(--ink); }
.public-primary-nav a.is-active::after { background: var(--coral); }
.public-nav-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.public-mobile-menu { display: none; }
.public-mobile-menu summary { list-style: none; }
.public-mobile-menu summary::-webkit-details-marker { display: none; }
.hero { display: grid; min-height: 650px; grid-template-columns: 1.02fr .98fr; align-items: center; gap: 30px; padding-block: 60px 70px; }
.hero-copy { position: relative; z-index: 2; }
.hero h1 { max-width: 670px; margin: 22px 0 25px; font-family: var(--serif); font-size: clamp(53px, 6.1vw, 86px); font-weight: 500; letter-spacing: -.058em; line-height: .92; }
.hero h1 em { color: var(--coral); font-weight: 400; }
.hero-lead { max-width: 575px; margin: 0 0 30px; color: #51645f; font-family: var(--serif); font-size: 20px; line-height: 1.52; }
.hero-actions { display: flex; gap: 12px; }
.trust-row { display: flex; gap: 28px; margin-top: 26px; color: #60716c; font-size: 11px; font-weight: 700; letter-spacing: .045em; text-transform: uppercase; }
.trust-row span::before { margin-right: 7px; color: var(--green-light); content: '✓'; }
.hero-art { position: relative; min-height: 500px; transform: translateX(15px); }
.art-glow { position: absolute; inset: 80px 20px 30px 20px; border-radius: 50%; background: radial-gradient(circle, rgba(215,179,118,.37), transparent 65%); filter: blur(18px); }
.display-tile { position: absolute; display: flex; width: 128px; height: 180px; flex-direction: column; align-items: center; justify-content: center; border: 1px solid #dfd3b9; border-radius: 16px; background: linear-gradient(145deg, #fffef7, #e6dcc5); box-shadow: 0 32px 50px rgba(37,47,40,.25), inset 0 0 0 4px rgba(255,255,255,.38); transform-origin: 50% 120%; }
.display-tile::before { position: absolute; inset: 7px; content: ''; border: 1px solid rgba(37,46,41,.1); border-radius: 11px; }
.display-tile span { font-family: var(--serif); font-size: 76px; line-height: .8; }
.display-tile i { margin-top: 20px; font-size: 15px; font-style: normal; font-weight: 800; letter-spacing: .12em; }
.display-tile-1 { top: 96px; left: 30px; z-index: 1; color: var(--coral); transform: rotate(-19deg); }
.display-tile-2 { top: 48px; left: 155px; z-index: 2; color: var(--blue); transform: rotate(-5deg); }
.display-tile-3 { top: 85px; left: 285px; z-index: 3; color: var(--gold); transform: rotate(12deg); }
.display-tile-j { top: 214px; left: 190px; z-index: 4; color: var(--ink); transform: rotate(4deg); }
.display-tile-j span { font-size: 55px; }
.display-tile-j i { font-size: 9px; }
.hero-line { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.hero-line path { fill: none; stroke: rgba(215,89,66,.33); stroke-dasharray: 3 9; stroke-linecap: round; }
.rummy-positioning { display: grid; grid-template-columns: minmax(190px,.48fr) minmax(0,1fr); align-items: start; gap: clamp(32px,7vw,100px); margin-top: -24px; margin-bottom: 90px; padding-block: 34px 38px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.rummy-positioning .eyebrow { margin-top: 10px; }
.rummy-positioning h2 { margin: 0 0 17px; font: 500 clamp(34px,4vw,52px)/1 var(--serif); letter-spacing: -.045em; }
.rummy-positioning h2 em { color: var(--coral); font-weight: 400; }
.rummy-positioning p { max-width: 790px; margin: 0; color: #536762; font: 17px/1.72 var(--sans); }
.rummy-positioning p strong { color: var(--ink); font-weight: 750; }
.play-panel { position: relative; max-width: var(--page-width); margin-bottom: 130px; overflow: hidden; border: 1px solid rgba(20,43,40,.12); border-radius: 22px; background: #fffaf0; box-shadow: 0 28px 80px rgba(25,49,44,.12); }
.play-intro { position: relative; min-height: 250px; padding: 51px 390px 45px 54px; color: #f8f0dc; background: radial-gradient(circle at 82% 20%, rgba(84,145,121,.48), transparent 33%), radial-gradient(circle at 62% 120%, rgba(215,89,66,.2), transparent 35%), #163f37; }
.play-intro .eyebrow { color: #e58a73; }
.play-intro > div { margin-top: 22px; }
.play-intro h2 { margin: 0; font: 500 clamp(43px, 5vw, 61px)/.94 var(--serif); letter-spacing: -.052em; }
.play-intro h2 em { color: #f0ad8f; font-weight: 400; }
.play-intro p { max-width: 540px; margin: 20px 0 0; color: #bad0c6; font: 15px/1.65 var(--sans); }
.play-ornaments { position: absolute; z-index: 2; top: 34px; right: 48px; width: 290px; height: 190px; pointer-events: none; }
.play-ornaments::before { position: absolute; inset: 1px 14px 12px 0; content: ''; border: 1px dashed rgba(239,217,171,.2); border-radius: 50%; transform: rotate(-10deg); }
.play-ornaments::after { position: absolute; right: 13px; bottom: 19px; left: 5px; height: 12px; content: ''; border-radius: 3px 3px 10px 10px; background: linear-gradient(#a67c59, #74533d); box-shadow: 0 15px 22px rgba(4,20,16,.26); transform: rotate(4deg); }
.play-ornaments i { position: absolute; z-index: 2; top: 35px; display: grid; width: 67px; height: 95px; place-items: center; border: 1px solid #dacdaf; border-radius: 9px; background: linear-gradient(145deg, #fffdf3, #ded1b4); box-shadow: inset 0 0 0 4px rgba(255,255,255,.34), 0 18px 25px rgba(3,24,19,.3); font: 600 41px var(--serif); }
.play-ornaments i:first-child { left: 35px; color: var(--coral); transform: rotate(-12deg) translateY(15px); animation: play-tile-float 5.2s ease-in-out infinite; }
.play-ornaments i:nth-child(2) { left: 105px; color: var(--blue); transform: rotate(-2deg); animation: play-tile-float-middle 5.6s .4s ease-in-out infinite; }
.play-ornaments i:nth-child(3) { left: 176px; color: var(--gold); transform: rotate(10deg) translateY(12px); animation: play-tile-float-last 5.4s .8s ease-in-out infinite; }
.play-tabs { position: relative; z-index: 3; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 34px; border-bottom: 1px solid #ddd4c1; background: #163f37; }
.play-tabs button { position: relative; display: grid; min-height: 88px; grid-template-rows: 1fr 1fr; align-items: center; padding: 16px 26px; cursor: pointer; text-align: left; border: 0; border-radius: 15px 15px 0 0; color: #a9c0b7; background: transparent; transition: color .22s ease, background .22s ease, transform .22s ease; }
.play-tabs button strong, .play-tabs button small { display: block; }
.play-tabs button strong { align-self: end; color: #edf3eb; font-size: 13px; }
.play-tabs button small { align-self: start; margin-top: 3px; font-size: 10px; font-weight: 500; }
.play-tabs button.is-active { color: var(--coral); background: #fffaf0; transform: translateY(1px); }
.play-tabs button.is-active strong { color: var(--ink); }
.play-tabs button:focus-visible { z-index: 2; outline: 3px solid #e8a16f; outline-offset: -4px; }
.play-content { display: none; padding: 40px 52px 52px; background: radial-gradient(circle at 100% 0, rgba(235,215,175,.2), transparent 31%), #fffaf0; }
.play-content.is-active { display: block; animation: play-panel-in .42s cubic-bezier(.2,.8,.2,1); }
.play-step-head, .field-heading { display: block; padding-left: 14px; border-left: 2px solid rgba(215,89,66,.65); }
.play-step-head { margin-bottom: 20px; }
.play-step-head strong, .play-step-head small, .field-heading strong, .field-heading small { display: block; }
.play-step-head strong, .field-heading strong { font: 500 20px var(--serif); }
.play-step-head small, .field-heading small { margin-top: 3px; color: #78847e; font-size: 10px; line-height: 1.45; }
.mode-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin-bottom: 30px; }
.mode-card { position: relative; display: grid; min-height: 116px; grid-template-columns: 52px 1fr auto; gap: 14px; align-items: center; padding: 17px; cursor: pointer; text-align: left; border: 1px solid #ddd4c1; border-radius: 14px; color: var(--ink); background: rgba(255,255,255,.58); transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease, background .22s ease; }
.mode-card:hover { transform: translateY(-3px); border-color: #c8bda7; background: #fffdf7; box-shadow: 0 13px 30px rgba(31,50,43,.08); }
.mode-card.is-active { transform: translateY(-3px); border-color: rgba(215,89,66,.62); background: #fffdf8; box-shadow: 0 16px 34px rgba(87,57,39,.1), inset 0 0 0 1px rgba(215,89,66,.12); }
.mode-card:focus-visible { outline: 3px solid rgba(215,89,66,.35); outline-offset: 2px; }
.mode-icon { display: grid; width: 52px; height: 68px; place-items: center; border: 1px solid #dfd1b4; border-radius: 7px; color: var(--coral); background: linear-gradient(145deg, #fffef8, #e8dcc2); box-shadow: inset 0 0 0 3px rgba(255,255,255,.42), 0 8px 13px rgba(35,49,42,.13); font: 27px var(--serif); transform: rotate(-4deg); transition: transform .28s cubic-bezier(.2,.8,.2,1); }
.mode-card:nth-child(2) .mode-icon { color: var(--blue); transform: rotate(3deg); }
.mode-card:nth-child(3) .mode-icon { color: var(--gold); transform: rotate(-2deg); }
.mode-card.is-active .mode-icon { transform: translateY(-3px) rotate(2deg); }
.mode-copy strong, .mode-copy small { display: block; }
.mode-copy strong { font-size: 13px; }
.mode-copy small { margin-top: 6px; color: #71807b; font-size: 10px; line-height: 1.35; }
.mode-check { display: grid; width: 22px; height: 22px; place-items: center; border-radius: 50%; color: transparent; background: #e3e2d8; font-size: 10px; font-style: normal; transition: color .2s ease, background .2s ease, transform .2s ease; }
.mode-card.is-active .mode-check { color: #fff; background: var(--coral); transform: scale(1.08); }
.play-fields { display: grid; grid-template-columns: minmax(250px,.9fr) minmax(280px,1.1fr); gap: 28px; align-items: center; margin: 0 0 27px; padding: 26px 28px; border: 1px solid #e3dbc9; border-radius: 15px; background: rgba(244,238,223,.58); animation: field-reveal .42s cubic-bezier(.2,.8,.2,1); }
.play-fields.local-fields { display: block; }
.local-fields .field-heading { margin-bottom: 20px; }
[data-online-fields] .name-field input { margin-top: 0; }
.start-form label, .join-form label { display: block; color: #536762; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.start-form input, .join-form input { width: 100%; height: 50px; margin-top: 8px; padding: 0 15px; border: 1px solid #d8d0bd; border-radius: 9px; color: var(--ink); outline: 0; background: #fffdf8; font-size: 15px; text-transform: none; transition: border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.start-form input:hover, .join-form input:hover { border-color: #beb5a2; background: #fff; }
.start-form input:focus, .join-form input:focus { border-color: var(--coral); background: #fff; box-shadow: 0 0 0 3px rgba(215,89,66,.1); }
.player-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.player-entry { position: relative; display: grid; min-width: 0; grid-template-columns: 34px minmax(0,1fr); gap: 11px; align-items: center; padding: 10px 11px; border: 1px solid #ddd4c1; border-radius: 11px; background: #fffdf8; }
.player-entry:not(.is-fixed) { grid-template-columns: 34px minmax(0,1fr) 30px; }
.player-entry.is-fixed { background: #fff; }
.player-entry.is-arriving { animation: player-arrive .42s cubic-bezier(.2,.9,.2,1); }
.player-entry.is-leaving { pointer-events: none; animation: player-leave .22s ease forwards; }
.seat-number { display: grid; width: 32px; height: 42px; place-items: center; border: 1px solid #ded2b8; border-radius: 6px; color: var(--coral); background: linear-gradient(145deg, #fffdf5, #e9dec7); box-shadow: inset 0 0 0 2px rgba(255,255,255,.5); font: 19px var(--serif); }
.player-entry:nth-child(2) .seat-number { color: var(--blue); }
.player-entry:nth-child(3) .seat-number { color: var(--gold); }
.player-entry:nth-child(4) .seat-number { color: var(--ink); }
.player-entry label { min-width: 0; }
.player-entry label > span { display: block; }
.player-entry input { height: 31px; margin: 1px 0 0; padding: 0; border: 0; border-bottom: 1px solid transparent; border-radius: 0; background: transparent; font-size: 14px; }
.player-entry input:hover { border-bottom-color: #d8d0bd; background: transparent; }
.player-entry input:focus { border-bottom-color: var(--coral); background: transparent; box-shadow: none; }
.remove-player { display: grid; width: 30px; height: 30px; place-items: center; cursor: pointer; border: 1px solid #e1d8c6; border-radius: 50%; color: #8a7770; background: transparent; font-size: 20px; line-height: 1; transition: color .18s ease, background .18s ease, transform .18s ease; }
.remove-player:hover { color: #fff; background: var(--coral); transform: rotate(6deg); }
.player-add-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 13px; }
.add-player { display: inline-flex; min-height: 43px; align-items: center; gap: 10px; padding: 0 14px 0 8px; cursor: pointer; border: 1px dashed #b9b2a1; border-radius: 22px; color: #315e51; background: rgba(255,255,255,.5); font-size: 10px; transition: transform .18s ease, border-color .18s ease, background .18s ease; }
.add-player:hover { transform: translateY(-2px); border-color: var(--coral); background: #fff; }
.add-player > span { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; color: #fff; background: #315e51; font-size: 17px; font-weight: 400; }
.player-add-row > small { color: #89938e; font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.house-rule-toggle { position: relative; display: grid !important; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; margin: 2px 0 22px !important; padding: 14px 16px; cursor: pointer; border: 1px solid #e1d8c5; border-radius: 12px; background: rgba(255,255,255,.58); text-transform: none !important; transition: border-color .18s ease, background .18s ease; }
.house-rule-toggle:hover { border-color: #cfc3ab; background: #fff; }
.house-rule-toggle > input { position: absolute; width: 1px !important; height: 1px !important; margin: 0 !important; opacity: 0; }
.toggle-track { position: relative; display: block; width: 42px; height: 24px; border-radius: 20px; background: #c8cfca; transition: background .2s ease; }
.toggle-track i { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.18); transition: transform .2s ease; }
.house-rule-toggle input:checked + .toggle-track { background: var(--coral); }
.house-rule-toggle input:checked + .toggle-track i { transform: translateX(18px); }
.house-rule-toggle input:focus-visible + .toggle-track { outline: 3px solid rgba(215,89,66,.3); outline-offset: 3px; }
.house-rule-toggle strong, .house-rule-toggle small { display: block; letter-spacing: normal; }
.house-rule-toggle strong { color: var(--ink); font-size: 13px; text-transform: none; }
.house-rule-toggle small { margin-top: 4px; color: #71807b; font-size: 11px; font-weight: 500; line-height: 1.4; text-transform: none; }
.training-note { display: grid; grid-template-columns: 34px 1fr; gap: 11px; align-items: center; margin: -8px 0 22px; padding: 13px 14px; border: 1px solid #d7c99f; border-radius: 10px; color: #445e56; background: #faf3db; animation: field-reveal .42s cubic-bezier(.2,.8,.2,1); }
.training-note > span { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; color: #fff; background: #315e51; }
.training-note p, .training-note strong { display: block; margin: 0; }
.training-note p { font-size: 11px; line-height: 1.45; }
.training-note strong { margin-bottom: 2px; color: var(--ink); font-size: 12px; }
.play-submit { min-height: 62px; padding-inline: 20px; border-radius: 11px; }
.play-submit > span:first-child { display: grid; gap: 2px; text-align: left; }
.play-submit small, .play-submit strong { display: block; }
.play-submit small { color: #ffd6ca; font-size: 8px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.play-submit strong { font-size: 13px; }
.play-submit > span:last-child { display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid rgba(255,255,255,.3); border-radius: 50%; transition: transform .2s ease, background .2s ease; }
.play-submit:hover > span:last-child { background: rgba(255,255,255,.12); transform: translateX(3px); }
.play-content[data-panel="join"].is-active { display: grid; grid-template-columns: .82fr 1.18fr; gap: 42px; align-items: center; }
.join-invitation { display: grid; min-height: 330px; align-content: center; justify-items: center; padding: 35px; overflow: hidden; border-radius: 17px; color: #eef4e9; text-align: center; background: radial-gradient(circle at 50% 42%, #397566, #17463e 72%); box-shadow: inset 0 0 70px rgba(4,29,24,.25); }
.join-invitation > span { color: #e9a58f; font-size: 9px; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.join-invitation > div { display: flex; align-items: center; gap: 14px; margin: 29px 0 25px; }
.join-invitation i { display: grid; width: 68px; height: 68px; place-items: center; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; background: rgba(255,255,255,.09); font: italic 23px var(--serif); }
.join-invitation i:last-child { width: 78px; height: 98px; border-radius: 10px; color: var(--coral); background: linear-gradient(145deg, #fffdf3, #ded1b4); box-shadow: 0 17px 26px rgba(2,23,18,.3); font-size: 18px; transform: rotate(6deg); }
.join-invitation b { color: #88ad9f; font-weight: 400; letter-spacing: .18em; animation: invitation-pulse 1.8s ease-in-out infinite; }
.join-invitation small { max-width: 245px; color: #b3c9bf; font: italic 15px/1.55 var(--serif); }
.join-form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 12px; align-items: end; }
.join-form .field-heading, .join-form .button { grid-column: 1/-1; }
.join-form .field-heading { margin-bottom: 5px; }
.code-input { font-weight: 800; letter-spacing: .14em; text-transform: uppercase !important; }
.how-to { padding: 5px 0 140px; }
.how-to-head { display: grid; grid-template-columns: 1fr .72fr; align-items: end; gap: 10%; margin-bottom: 40px; }
.how-to-head h2 { margin: 17px 0 0; font-family: var(--serif); font-size: clamp(48px, 6vw, 74px); font-weight: 500; letter-spacing: -.055em; line-height: .91; }
.how-to-head h2 em { color: var(--coral); font-weight: 400; }
.how-to-head > p { max-width: 480px; margin: 0 0 5px; color: #5f716c; font-family: var(--serif); font-size: 19px; line-height: 1.55; }
.story-shell { overflow: hidden; border: 1px solid rgba(20,43,40,.12); border-radius: 22px; background: #fffaf0; box-shadow: 0 28px 80px rgba(25,49,44,.12); }
.story-viewport { display: flex; overflow: hidden; outline: 0; scroll-snap-type: x mandatory; }
.story-viewport:focus-visible { box-shadow: inset 0 0 0 3px rgba(215,89,66,.35); }
.story-slide { position: relative; display: grid; min-width: 100%; min-height: 555px; grid-template-columns: .78fr 1.22fr; overflow: hidden; scroll-snap-align: start; background: #f8f1e3; }
.story-copy { position: relative; z-index: 4; display: flex; flex-direction: column; justify-content: center; padding: clamp(35px, 6vw, 76px); }
.story-number { position: absolute; top: 34px; left: 38px; color: rgba(20,43,40,.12); font-family: var(--serif); font-size: 96px; font-style: italic; line-height: 1; }
.story-kicker { margin: 0 0 15px; color: var(--coral); font-size: 10px; font-weight: 850; letter-spacing: .17em; text-transform: uppercase; }
.story-copy h3 { margin: 0 0 21px; font-family: var(--serif); font-size: clamp(37px, 4.3vw, 57px); font-weight: 500; letter-spacing: -.05em; line-height: .96; }
.story-copy > p:last-child { max-width: 390px; margin: 0; color: #62736e; font-size: 14px; line-height: 1.65; }
.story-scene { position: relative; min-width: 0; overflow: hidden; background: radial-gradient(circle at 50% 48%, rgba(255,255,255,.7), transparent 50%), #eee3cc; }
.story-scene::after { position: absolute; inset: 0; pointer-events: none; content: ''; background-image: linear-gradient(rgba(20,43,40,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(20,43,40,.025) 1px, transparent 1px); background-size: 24px 24px; }
.story-tile { position: relative; z-index: 2; display: flex; width: 70px; height: 97px; flex: 0 0 auto; flex-direction: column; align-items: center; justify-content: center; color: var(--ink); border: 1px solid #d4c7aa; border-radius: 9px; background: linear-gradient(145deg, #fffef7, #ded2b7); box-shadow: 0 13px 20px rgba(24,39,34,.23), inset 0 0 0 4px rgba(255,255,255,.38); font-style: normal; transform-origin: 50% 115%; }
.story-tile::before { position: absolute; inset: 5px; content: ''; border: 1px solid rgba(37,46,41,.09); border-radius: 6px; }
.story-tile b { position: relative; z-index: 1; font-family: var(--serif); font-size: 45px; font-weight: 650; line-height: .8; }
.story-tile small { position: relative; z-index: 1; margin-top: 12px; font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.story-tile.tile-coral { color: var(--coral); }
.story-tile.tile-blue { color: var(--blue); }
.story-tile.tile-gold { color: var(--gold); }
.story-tile.tile-ink { color: #263b38; }
.story-tile.tile-joker b { color: var(--coral); font-size: 38px; }
.story-tile.tile-joker small { color: var(--ink); font-size: 7px; }
.story-tile > span { position: absolute; z-index: 5; top: -8px; right: -9px; padding: 4px 7px; border: 2px solid #fff9ed; border-radius: 10px; color: #fff; background: var(--gold); box-shadow: 0 4px 10px rgba(66,42,8,.2); font-size: 7px; font-weight: 900; letter-spacing: .08em; }
.story-rack { position: absolute; z-index: 2; right: 7%; bottom: 21%; display: flex; align-items: flex-end; padding: 12px 32px 17px; border-bottom: 13px solid #6d523e; border-radius: 8px 8px 16px 16px; background: linear-gradient(to bottom, transparent 78%, #a67c59 78%, #866248 100%); transform: rotate(-2deg); }
.story-rack .story-tile { margin-left: -7px; transform: translateY(30px) rotate(calc((var(--i) - 2.5) * 2deg)); opacity: 0; }
.story-slide.is-active .story-rack .story-tile { animation: story-deal .55s cubic-bezier(.2,.8,.2,1) forwards; animation-delay: calc(.12s + var(--i) * .08s); }
.story-slide.is-active .story-rack .is-new { animation-name: story-deal-new; }
.scene-note { position: absolute; z-index: 3; color: #66766f; font-family: var(--serif); font-size: 15px; font-style: italic; }
.scene-note-rack { top: 25%; right: 17%; transform: rotate(3deg); }
.scene-line, .score-line, .remix-arrows { position: absolute; z-index: 3; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.scene-line path, .score-line path, .remix-arrows path { fill: none; stroke: rgba(215,89,66,.55); stroke-width: 1.5; stroke-dasharray: 4 8; stroke-linecap: round; }
.story-table { background: radial-gradient(ellipse at 50% 35%, #397567, #17463e 73%); box-shadow: inset 0 0 100px rgba(4,29,24,.28); }
.story-table::after { opacity: .16; background-image: radial-gradient(circle, #fff 1px, transparent 1px); background-size: 22px 22px; }
.story-meld { position: absolute; z-index: 2; }
.story-meld > span { display: block; margin: 0 0 11px 4px; color: rgba(234,244,238,.62); font-size: 8px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.story-meld > div { display: flex; }
.story-meld .story-tile { width: 61px; height: 85px; margin-left: -4px; transform: translateY(15px); opacity: 0; }
.meld-run { top: 20%; left: 11%; transform: rotate(-2deg); }
.meld-group { right: 9%; bottom: 16%; transform: rotate(2deg); }
.story-slide.is-active .story-meld .story-tile { animation: meld-in .5s cubic-bezier(.2,.8,.2,1) forwards; }
.story-slide.is-active .story-meld .story-tile:nth-child(2) { animation-delay: .1s; }
.story-slide.is-active .story-meld .story-tile:nth-child(3) { animation-delay: .2s; }
.story-slide.is-active .story-meld .story-tile:nth-child(4) { animation-delay: .3s; }
.valid-stamp { position: absolute; z-index: 4; top: 17%; right: 11%; display: flex; align-items: center; gap: 7px; padding: 8px 11px; color: #d8eee3; border: 1px solid rgba(255,255,255,.18); border-radius: 20px; background: rgba(255,255,255,.08); font-size: 8px; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; opacity: 0; }
.valid-stamp b { display: grid; width: 18px; height: 18px; place-items: center; border-radius: 50%; color: #19493f; background: #7bc49c; }
.story-slide.is-active .valid-stamp { animation: stamp-in .4s .65s ease forwards; }
.opening-scene { display: grid; place-items: center; }
.opening-meld { position: absolute; z-index: 2; bottom: 18%; left: 12%; display: flex; transform: rotate(-3deg); }
.opening-meld .story-tile { margin-left: -4px; opacity: 0; transform: translateY(35px); }
.story-slide.is-active .opening-meld .story-tile { animation: meld-in .5s forwards; }
.story-slide.is-active .opening-meld .story-tile:nth-child(2) { animation-delay: .13s; }
.story-slide.is-active .opening-meld .story-tile:nth-child(3) { animation-delay: .26s; }
.score-orbit { position: absolute; z-index: 4; top: 17%; right: 15%; display: grid; width: 162px; height: 162px; place-content: center; justify-items: center; color: #ecf6f1; border: 1px dashed rgba(255,255,255,.32); border-radius: 50%; background: rgba(7,42,35,.28); box-shadow: 0 20px 50px rgba(3,24,20,.22); transform: scale(.72); opacity: 0; }
.story-slide.is-active .score-orbit { animation: score-in .7s .25s cubic-bezier(.2,.8,.2,1) forwards; }
.score-orbit strong { font-family: var(--serif); font-size: 57px; font-weight: 500; line-height: .9; }
.score-orbit small { color: #9bc0b3; font-size: 8px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.score-orbit i { position: absolute; right: 2px; bottom: 14px; display: grid; width: 36px; height: 36px; place-items: center; border: 4px solid #215248; border-radius: 50%; color: #17463e; background: #8bc9a5; font-style: normal; }
.remix-scene { perspective: 800px; }
.remix-tiles { position: absolute; z-index: 3; inset: 0; }
.remix-tiles .story-tile { position: absolute; transition: none; }
.remix-tile-1 { top: 25%; left: 13%; }
.remix-tile-2 { top: 25%; left: 25%; }
.remix-tile-3 { top: 25%; left: 37%; }
.remix-tile-4 { right: 32%; bottom: 21%; }
.remix-tile-5 { right: 20%; bottom: 21%; }
.remix-tile-6 { right: 8%; bottom: 21%; }
.story-slide.is-active .remix-tile-1 { animation: remix-one 2.8s .25s ease-in-out both; }
.story-slide.is-active .remix-tile-2 { animation: remix-two 2.8s .25s ease-in-out both; }
.story-slide.is-active .remix-tile-3 { animation: remix-three 2.8s .25s ease-in-out both; }
.story-slide.is-active .remix-tile-4 { animation: remix-four 2.8s .25s ease-in-out both; }
.story-slide.is-active .remix-tile-5, .story-slide.is-active .remix-tile-6 { animation: remix-settle 2.8s .25s ease-in-out both; }
.remix-label { position: absolute; z-index: 4; color: rgba(235,245,240,.58); font-size: 8px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.remix-before { top: 18%; left: 14%; }
.remix-after { right: 16%; bottom: 13%; }
.story-controls { display: flex; min-height: 88px; align-items: center; justify-content: space-between; padding: 0 28px 0 36px; border-top: 1px solid var(--line); background: rgba(255,253,247,.9); }
.story-progress { display: flex; align-self: stretch; gap: 8px; }
.story-progress button { position: relative; display: grid; min-width: 105px; grid-template-columns: auto 1fr; gap: 8px; align-content: center; cursor: pointer; border: 0; color: #8a9894; background: transparent; text-align: left; }
.story-progress button::before { position: absolute; top: -1px; right: 10px; left: 0; height: 3px; content: ''; border-radius: 0 0 3px 3px; background: var(--coral); transform: scaleX(0); transform-origin: left; transition: transform .35s ease; }
.story-progress button.is-active { color: var(--ink); }
.story-progress button.is-active::before { transform: scaleX(1); }
.story-progress span { color: var(--coral); font-family: var(--serif); font-size: 16px; font-style: italic; }
.story-progress b { font-size: 10px; letter-spacing: .04em; }
.story-arrows { display: flex; gap: 8px; }
.story-arrows button { display: grid; width: 43px; height: 43px; place-items: center; cursor: pointer; border: 1px solid var(--line); border-radius: 50%; background: #fff; font-size: 18px; transition: transform .18s, color .18s, border-color .18s; }
.story-arrows button:hover { color: var(--coral); border-color: var(--coral); transform: translateY(-2px); }
.how-to-finale { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 38px 4px 0; }
.how-to-finale p { margin: 0; }
.how-to-finale p span, .how-to-finale p strong { display: block; }
.how-to-finale p span { margin-bottom: 5px; color: var(--coral); font-size: 9px; font-weight: 850; letter-spacing: .15em; text-transform: uppercase; }
.how-to-finale p strong { font-family: var(--serif); font-size: clamp(23px, 3vw, 34px); font-weight: 500; }
.home-learning { padding: 10px 0 145px; }
.home-learning-head { display: grid; grid-template-columns: 1fr .7fr; align-items: end; gap: 9%; margin-bottom: 42px; }
.home-learning-head h2 { margin: 17px 0 0; font: 500 clamp(46px,6vw,72px)/.93 var(--serif); letter-spacing: -.055em; }
.home-learning-head h2 em { color: var(--coral); font-weight: 400; }
.home-learning-intro { max-width: 470px; margin: 0 0 4px; }
.home-learning-intro p { margin: 0; color: #60716c; font: 18px/1.6 var(--serif); }
.home-learning-intro a { display: inline-flex; align-items: center; gap: 16px; margin-top: 18px; padding-bottom: 5px; border-bottom: 1px solid rgba(20,43,40,.28); font-size: 10px; font-weight: 800; }
.home-learning-intro a span { color: var(--coral); }
.home-learning-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 13px; }
.home-learning-card { position: relative; display: flex; min-height: 245px; flex-direction: column; padding: 25px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,253,247,.65); transition: transform .2s ease, background .2s ease, box-shadow .2s ease; }
.home-learning-card:hover { transform: translateY(-4px); background: var(--paper); box-shadow: 0 18px 42px rgba(31,50,43,.08); }
.home-learning-card > small { color: var(--coral); font-size: 8px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.home-learning-card > strong, .home-learning-featured strong { margin-top: 41px; font: 500 26px/1.05 var(--serif); }
.home-learning-card p { margin: 12px 0 27px; color: #65756f; font-size: 11px; line-height: 1.6; }
.home-learning-card b { display: flex; justify-content: space-between; margin-top: auto; padding-top: 15px; border-top: 1px solid var(--line); font-size: 9px; letter-spacing: .04em; }
.home-learning-card b i { color: var(--coral); font-style: normal; }
.home-learning-featured { min-height: 330px; grid-column: span 2; grid-row: span 2; color: #f7efdc; background: radial-gradient(circle at 78% 18%,rgba(215,89,66,.2),transparent 29%),#173f38; }
.home-learning-featured:hover { background: radial-gradient(circle at 78% 18%,rgba(215,89,66,.27),transparent 31%),#173f38; }
.home-learning-featured > small { color: #efa98e; }
.home-learning-featured > div { max-width: 74%; margin-top: auto; }
.home-learning-featured strong { display: block; font-size: 34px; }
.home-learning-featured p { color: #bfd0c8; font-size: 12px; }
.home-learning-featured b { border-color: rgba(255,255,255,.18); }
.home-learning-tiles { position: absolute; top: 38px; right: 42px; display: flex; align-items: flex-start; }
.home-learning-tiles i { display: grid; width: 57px; height: 79px; margin-left: -7px; place-items: center; border: 1px solid #ddceb0; border-radius: 8px; background: linear-gradient(145deg,#fffdf3,#ded1b4); box-shadow: inset 0 0 0 3px rgba(255,255,255,.38),0 14px 22px rgba(3,24,19,.25); font: 500 36px var(--serif); }
.home-learning-tiles i:first-child { color: var(--coral); transform: rotate(-9deg) translateY(8px); }
.home-learning-tiles i:nth-child(2) { z-index: 1; color: var(--blue); }
.home-learning-tiles i:last-child { color: var(--gold); transform: rotate(9deg) translateY(8px); }
.home-playful { display: grid; grid-template-columns: .7fr 1.3fr; align-items: center; gap: 45px; margin-top: 18px; padding: 30px 34px; border: 1px solid rgba(20,43,40,.13); border-radius: 17px; background: radial-gradient(circle at 5% 100%,rgba(215,89,66,.13),transparent 30%),rgba(255,253,247,.72); }
.home-playful h3 { margin: 15px 0 0; font: 500 30px/1.02 var(--serif); letter-spacing: -.035em; }
.home-playful h3 em { color: var(--coral); font-weight: 400; }
.home-playful nav { display: grid; gap: 7px; }
.home-playful a { display: grid; min-height: 62px; grid-template-columns: 38px 1fr auto; align-items: center; gap: 13px; padding: 9px 13px; border: 1px solid transparent; border-radius: 11px; transition: background .18s ease,border-color .18s ease; }
.home-playful a:hover { border-color: var(--line); background: #fffdf7; }
.home-playful a > i { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; color: #fff; background: var(--coral); font: 800 10px var(--sans); }
.home-playful a span strong,.home-playful a span small { display: block; }
.home-playful a span strong { font: 500 17px var(--serif); }
.home-playful a span small { margin-top: 2px; color: #71807a; font-size: 9px; }
.home-playful a > b { color: var(--coral); font-size: 13px; }

@keyframes story-deal { to { opacity: 1; transform: translateY(0) rotate(calc((var(--i) - 2.5) * 2deg)); } }
@keyframes story-deal-new { 75% { opacity: 1; transform: translateY(-15px) rotate(5deg); } 100% { opacity: 1; transform: translateY(-8px) rotate(5deg); filter: drop-shadow(0 0 7px rgba(214,155,36,.7)); } }
@keyframes meld-in { to { opacity: 1; transform: translateY(0); } }
@keyframes stamp-in { from { opacity: 0; transform: rotate(-8deg) scale(.7); } to { opacity: 1; transform: rotate(-8deg) scale(1); } }
@keyframes score-in { to { opacity: 1; transform: scale(1); } }
@keyframes remix-one { 0%,30% { transform: translate(0,0); } 58%,100% { transform: translate(145px,170px); } }
@keyframes remix-two { 0%,30% { transform: translate(0,0); } 58%,100% { transform: translate(145px,170px); } }
@keyframes remix-three { 0%,30% { transform: translate(0,0); } 58%,100% { transform: translate(145px,170px); } }
@keyframes remix-four { 0%,30% { transform: translate(0,0); } 58%,100% { transform: translate(-218px,-120px); } }
@keyframes remix-four-mobile { 0%,30% { transform: translate(0,0); } 58%,100% { transform: translate(-118px,-105px); } }
@keyframes remix-settle { 50% { transform: translateY(-11px); } }

/* Game chrome */
.game-page { min-width: 320px; min-height: 100vh; overflow-x: hidden; background: #0d2b27; }
.game-header { position: relative; z-index: 20; display: grid; height: calc(72px + var(--app-safe-top)); grid-template-columns: 1fr auto 1fr; align-items: center; padding: var(--app-safe-top) 26px 0; color: #fff; border-bottom: 1px solid rgba(255,255,255,.1); background: #0d2b27; }
.game-header-actions { justify-self: end; display: flex; align-items: center; gap: 7px; }
.header-icon { display: grid; width: 38px; height: 38px; place-items: center; cursor: pointer; border: 1px solid rgba(255,255,255,.14); border-radius: 8px; color: #9bb6ae; background: rgba(255,255,255,.04); font-size: 16px; }
.header-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.header-icon:hover, .header-icon.is-enabled { color: #fff; border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.09); }
.push-toggle.is-enabled { color: #f0c55e; box-shadow: inset 0 0 0 1px rgba(240,197,94,.22); }
.push-toggle:disabled { cursor: not-allowed; opacity: .4; }
.connection { display: flex; align-items: center; gap: 8px; color: #9bb6ae; font-size: 11px; font-weight: 650; }
.connection i { width: 7px; height: 7px; border-radius: 50%; background: #58c68d; box-shadow: 0 0 0 4px rgba(88,198,141,.1); }
.connection.is-offline i { background: #e07965; }
.game-code { justify-self: end; display: grid; grid-template-columns: auto auto; grid-template-rows: 1fr 1fr; column-gap: 10px; align-items: center; padding: 6px 11px; cursor: pointer; border: 1px solid rgba(255,255,255,.14); border-radius: 8px; color: #fff; background: rgba(255,255,255,.04); }
.game-code small { color: #829f97; font-size: 8px; font-weight: 800; letter-spacing: .14em; }
.game-code strong { font-size: 12px; letter-spacing: .13em; }
.game-code span { grid-column: 2; grid-row: 1/3; color: #9bb6ae; }
#game-root { min-height: calc(100vh - 72px - var(--app-safe-top)); }
.loading-state, .fatal-state { display: grid; min-height: calc(100vh - 72px - var(--app-safe-top)); place-content: center; justify-items: center; gap: 12px; padding: 24px; color: #dce7e2; text-align: center; }
.loader { width: 36px; height: 36px; border: 2px solid rgba(255,255,255,.16); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.fatal-state strong { font-family: var(--serif); font-size: 28px; }
.fatal-state p { color: #91aba3; }
.fatal-state-card { width: min(560px, calc(100vw - 40px)); padding: clamp(29px, 6vw, 52px); text-align: left; border: 1px solid rgba(255,255,255,.14); border-radius: 20px; background: radial-gradient(circle at 90% 0, rgba(73,123,105,.3), transparent 45%), #123a33; box-shadow: 0 28px 90px rgba(0,0,0,.28); }
.fatal-state-card .eyebrow { font-size: 9px; }
.fatal-state-card strong { display: block; margin-top: 16px; color: #f4eedf; font-size: clamp(32px, 7vw, 45px); font-weight: 500; line-height: 1.04; letter-spacing: -.035em; }
.fatal-state-card p { margin: 17px 0 0; font-size: 13px; line-height: 1.7; }
.fatal-state-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.fatal-state-actions .button { font-size: 12px; }
.fatal-state-actions .button-soft { color: #d7e4df; border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.06); box-shadow: none; }
.fatal-state-actions .button-soft:hover { background: rgba(255,255,255,.11); }
.fatal-state-card small { display: block; margin-top: 25px; padding-top: 18px; color: #9db3aa; border-top: 1px solid rgba(255,255,255,.1); font-size: 10px; line-height: 1.6; }
@media (max-width: 520px) { .fatal-state-actions { flex-direction: column; } .fatal-state-actions .button { width: 100%; } }
.game-layout { min-height: calc(100vh - 72px - var(--app-safe-top)); background: #f2ecde; }
.player-strip { display: flex; min-height: 72px; align-items: center; justify-content: center; gap: 28px; padding: 10px 24px; border-bottom: 1px solid rgba(20,43,40,.11); background: #fbf8ef; }
.player-chip { position: relative; display: flex; min-width: 140px; align-items: center; gap: 10px; opacity: .65; }
.player-chip.is-active { opacity: 1; }
.player-chip.is-active::after { position: absolute; right: 0; bottom: -15px; left: 0; height: 3px; content: ''; border-radius: 3px 3px 0 0; background: var(--coral); }
.player-chip i { position: absolute; top: 2px; left: 27px; width: 8px; height: 8px; border: 2px solid #fff; border-radius: 50%; background: #59bf83; }
.player-avatar { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: #fff; background: var(--green-light); font-family: var(--serif); font-size: 18px; font-style: italic; }
.player-chip.is-me .player-avatar { color: #7a3b31; background: #f0c7bd; }
.player-chip strong, .player-chip small { display: block; white-space: nowrap; }
.player-chip strong { font-size: 12px; }
.player-chip small { margin-top: 3px; color: #788681; font-size: 9px; font-weight: 650; text-transform: uppercase; }
.turn-banner { display: flex; min-height: 67px; align-items: center; justify-content: space-between; padding: 10px clamp(18px, 4vw, 55px); color: #d9e5df; background: #17453d; }
.turn-banner > div:first-child span, .turn-banner > div:first-child strong { display: block; }
.turn-banner span { color: #89aaa0; font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.turn-banner strong { margin-top: 4px; font-family: var(--serif); font-size: 17px; font-weight: 500; }
.turn-banner.your-turn { background: #1c5147; box-shadow: inset 4px 0 var(--coral); }
.pile { display: grid; grid-template-columns: 28px auto; grid-template-rows: 1fr 1fr; column-gap: 8px; align-items: center; }
.mini-tile { width: 23px; height: 32px; grid-row: 1/3; border: 1px solid #c8bda5; border-radius: 3px; background: #eae2ce; box-shadow: -3px 2px 0 #bfb49b, -6px 4px 0 #8f8a76; }
.pile b { align-self: end; color: #fff; font-size: 12px; }
.pile small { align-self: start; color: #85a79d; font-size: 8px; text-transform: uppercase; }
.table-surface { position: relative; min-height: clamp(310px, 42vh, 500px); overflow: auto; padding: 22px clamp(16px, 4vw, 54px) 28px; background: radial-gradient(ellipse at 50% 20%, #2c6659 0, #1d5046 48%, #17453d 100%); box-shadow: inset 0 10px 38px rgba(0,0,0,.14); }
.felt-noise { position: absolute; inset: 0; pointer-events: none; opacity: .11; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.34'/%3E%3C/svg%3E"); }
.table-caption { position: relative; display: flex; align-items: center; justify-content: space-between; color: rgba(230,240,235,.55); }
.table-caption span { font-size: 9px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.table-caption small { font-family: var(--serif); font-size: 12px; font-style: italic; }
.meld-area { position: relative; display: flex; flex-wrap: wrap; gap: 22px 32px; align-content: flex-start; min-height: 190px; padding-top: 26px; }
.empty-table { display: grid; width: 100%; min-height: 180px; place-content: center; justify-items: center; color: rgba(229,239,234,.55); text-align: center; }
.empty-table > span { font-size: 25px; }
.empty-table strong { margin-top: 8px; color: rgba(244,249,246,.78); font-family: var(--serif); font-size: 20px; font-weight: 500; }
.empty-table p { margin: 5px 0; font-size: 11px; }
.meld { position: relative; min-width: 190px; padding: 23px 10px 9px; border: 1px dashed transparent; border-radius: 9px; transition: border .2s, background .2s; }
.table-surface.is-editable .meld:hover { border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.035); }
.meld-label { position: absolute; top: 1px; right: 8px; left: 8px; display: flex; justify-content: space-between; color: rgba(226,239,232,.45); font-size: 7px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.meld.is-valid .meld-label small { color: #87c7a6; }
.meld.is-incomplete .meld-label small { color: #e5bd77; }
.meld-tiles { display: flex; align-items: center; }
.meld-add { display: grid; width: 30px; height: 55px; margin-left: 7px; place-items: center; cursor: pointer; border: 1px dashed rgba(255,255,255,.2); border-radius: 6px; color: rgba(255,255,255,.45); background: transparent; }
.meld-add-start { margin-right: 7px; margin-left: 0; }
.table-surface.has-selection .meld-add { color: #fff; border-color: rgba(255,255,255,.55); background: rgba(255,255,255,.08); animation: insertion-pulse 1.4s ease-in-out infinite; }
.new-meld-zone { position: relative; display: flex; width: 190px; height: 44px; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; cursor: pointer; border: 1px dashed rgba(255,255,255,.24); border-radius: 8px; color: rgba(255,255,255,.56); background: rgba(255,255,255,.025); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.new-meld-zone span { font-size: 18px; font-weight: 300; }

/* Tiles */
.tile { position: relative; z-index: 2; width: 54px; height: 75px; flex: 0 0 auto; margin-left: -3px; padding: 0; cursor: grab; border: 0; border-radius: 7px; background: none; filter: drop-shadow(0 8px 6px rgba(4,22,18,.22)); transition: transform .16s cubic-bezier(.2,.8,.2,1), filter .16s, opacity .16s; touch-action: manipulation; }
.tile:first-child { margin-left: 0; }
.tile:hover { z-index: 5; transform: translateY(-5px) rotate(-1deg); filter: drop-shadow(0 13px 8px rgba(4,22,18,.27)); }
.tile.is-selected { z-index: 7; transform: translateY(-12px); filter: drop-shadow(0 0 3px #fff) drop-shadow(0 11px 8px rgba(4,22,18,.33)); }
.tile.is-dragging { opacity: .25; }
.tile.is-new { z-index: 6; transform: translateY(-8px); filter: drop-shadow(0 0 5px rgba(231,167,65,.82)) drop-shadow(0 12px 8px rgba(4,22,18,.3)); animation: new-tile-glow 2.2s ease-in-out 2; }
.tile.is-new:hover { transform: translateY(-11px) rotate(-1deg); }
.tile-new-badge { position: absolute; z-index: 4; top: 1px; right: -5px; display: grid; min-width: 27px; height: 15px; place-items: center; padding: 0 4px; border: 1px solid rgba(255,255,255,.8); border-radius: 8px; color: #fff; background: #d58e23; box-shadow: 0 3px 8px rgba(66,42,8,.25); font-family: var(--sans); font-size: 6px; font-weight: 900; letter-spacing: .08em; }
.tile-change-badge { position: absolute; z-index: 6; top: -7px; right: -5px; display: grid; min-width: 25px; height: 14px; place-items: center; padding: 0 4px; border: 1px solid #fff5d6; border-radius: 7px; color: #173f38; background: #f1cb70; box-shadow: 0 3px 9px #0a30264d; font-size: 6px; font-weight: 900; letter-spacing: .06em; }
.tile.is-recent-added { filter: drop-shadow(0 0 4px #efca7399) drop-shadow(0 8px 6px rgba(4,22,18,.22)); }
.tile.is-recent-changed::after { position: absolute; z-index: 7; top: 3px; right: 2px; width: 7px; height: 7px; content: ''; border: 1px solid #fff4d3; border-radius: 50%; background: #d5a842; box-shadow: 0 1px 4px #183c33a3; }
.tile svg { display: block; width: 100%; height: 100%; overflow: visible; }
.tile-shadow { fill: rgba(5,22,19,.29); transform: translate(1px, 2px); }
.tile-edge { fill: none; stroke: rgba(50,45,34,.1); stroke-width: 1; }
.tile-shine { fill: rgba(255,255,255,.42); }
.tile-number { font-family: var(--serif); font-size: 43px; font-weight: 650; }
.tile-symbol { font-family: var(--sans); font-size: 10px; font-weight: 900; letter-spacing: 1px; }
.tile-coral .tile-number, .tile-coral .tile-symbol { fill: var(--coral); }
.tile-blue .tile-number, .tile-blue .tile-symbol { fill: var(--blue); }
.tile-gold .tile-number, .tile-gold .tile-symbol { fill: var(--gold); }
.tile-ink .tile-number, .tile-ink .tile-symbol { fill: #263b38; }
.tile-joker .tile-number { fill: var(--coral); font-size: 38px; }
.tile-joker .tile-symbol { fill: var(--ink); font-size: 7px; }
.rack-panel { position: relative; z-index: 4; padding: 15px clamp(16px, 4vw, 54px) 19px; border-top: 1px solid #c8bdac; background: linear-gradient(#f7f2e6, #eee6d7); box-shadow: 0 -14px 40px rgba(10,31,27,.18); }
.rack-head { display: flex; height: 29px; align-items: start; justify-content: space-between; }
.rack-head span, .rack-head small { display: block; }
.rack-head span { font-family: var(--serif); font-size: 14px; font-weight: 650; }
.rack-head small { color: #88938f; font-size: 8px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.rack-head .drawn-label { color: #a96516; }
.rack-head button { padding: 3px 7px; cursor: pointer; border: 0; color: #6c7d78; background: transparent; font-size: 9px; font-weight: 700; text-transform: uppercase; }
.rack { display: flex; min-height: 89px; align-items: flex-end; justify-content: center; overflow-x: auto; padding: 6px 28px 10px; border-bottom: 8px solid #725743; border-radius: 5px 5px 12px 12px; background: linear-gradient(to bottom, transparent 82%, #a47c5a 82%, #8a684d 100%); scrollbar-width: thin; }
.rack .tile { width: 57px; height: 79px; margin-left: -4px; filter: drop-shadow(0 4px 4px rgba(60,43,28,.22)); }
.empty-rack { margin: auto; color: #7f8a86; font-family: var(--serif); font-style: italic; }
.game-actions { display: flex; min-height: 55px; flex-wrap: wrap; align-items: end; gap: 8px; padding-top: 9px; }
.action-muted { min-width: 46px; padding: 0 12px; color: #65746f; border: 1px solid rgba(20,43,40,.12); background: rgba(255,255,255,.38); font-size: 11px; }
.action-spacer { flex: 1; }
.button-opening { min-height: 40px; gap: 10px; padding-inline: 13px; color: #805119; border: 1px solid rgba(183,123,40,.28); background: #f8eacb; font-size: 10px; }
.button-opening small { display: grid; min-width: 35px; height: 22px; place-items: center; border-radius: 11px; color: #fff; background: #b67b2c; font-size: 8px; }
.opening-confirmed { align-self: center; padding: 7px 10px; border-radius: 7px; color: #28694e; background: #dcecdf; font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.button-draw { color: var(--ink); border: 1px solid rgba(20,43,40,.15); background: #faf7ef; }
.draw-icon { display: grid; width: 22px; height: 30px; place-items: center; border: 1px solid #bcb19d; border-radius: 3px; background: #efe7d4; }
.button-commit { min-width: 180px; justify-content: space-between; color: #fff; background: var(--coral); }
.waiting-turn { align-self: center; color: #73827e; font-family: var(--serif); font-size: 13px; font-style: italic; }

/* Lobby and handoff */
.lobby-shell { display: grid; min-height: calc(100vh - 72px); grid-template-columns: minmax(390px, 560px) 240px; place-content: center; gap: 50px; padding: 50px 20px; background: radial-gradient(circle at 65% 30%, rgba(81,137,116,.28), transparent 32%), linear-gradient(145deg, #143d36, #0c2824); }
.lobby-card { padding: 42px; border: 1px solid rgba(255,255,255,.11); border-radius: 18px; color: #eef5f1; background: rgba(6,28,24,.28); box-shadow: 0 30px 90px rgba(0,0,0,.18); backdrop-filter: blur(20px); }
.lobby-card h1 { margin: 15px 0 10px; font-family: var(--serif); font-size: 47px; font-weight: 500; letter-spacing: -.045em; }
.lobby-card > p { margin: 0 0 24px; color: #9bb2ab; line-height: 1.5; }
.share-link { display: flex; width: 100%; height: 48px; align-items: center; justify-content: space-between; padding: 0 14px; cursor: pointer; overflow: hidden; border: 1px solid rgba(255,255,255,.13); border-radius: 8px; color: #bfd0ca; background: rgba(255,255,255,.04); }
.share-link span { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.share-link b { flex: 0 0 auto; margin-left: 12px; color: #e68c77; font-size: 10px; text-transform: uppercase; }
.lobby-rule { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 12px; padding: 10px 13px; border-radius: 7px; color: #9eb3ad; background: rgba(255,255,255,.035); font-size: 9px; }
.lobby-rule span { color: #e68c77; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.lobby-rule strong { color: #c7d5d1; text-align: right; font-size: 10px; }
.lobby-players { margin: 24px 0; padding: 0; list-style: none; }
.lobby-players li { display: flex; align-items: center; gap: 12px; min-height: 60px; border-bottom: 1px solid rgba(255,255,255,.09); }
.lobby-players li div { flex: 1; }
.lobby-players strong, .lobby-players small { display: block; }
.lobby-players strong { font-size: 13px; }
.lobby-players small { margin-top: 3px; color: #75968d; font-size: 9px; font-weight: 700; text-transform: uppercase; }
.lobby-players li > i { width: 8px; height: 8px; border-radius: 50%; background: #61c58d; }
.lobby-players .empty-seat { opacity: .45; }
.empty-seat > span { display: grid; width: 38px; height: 38px; place-items: center; border: 1px dashed #8ca39c; border-radius: 50%; }
.waiting-pulse { padding: 14px; color: #9db2ac; text-align: center; font-size: 12px; }
.waiting-pulse i { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #e18a75; animation: pulse 1.2s infinite; }
.lobby-note { align-self: center; color: #a9beb7; }
.lobby-note span { display: block; color: rgba(244,237,218,.14); font-family: var(--serif); font-size: 130px; font-style: italic; line-height: .7; }
.lobby-note p { font-family: var(--serif); font-size: 18px; line-height: 1.5; }
.lobby-note strong { color: #e9927e; }
.handoff-screen { display: grid; min-height: calc(100vh - 72px); place-content: center; justify-items: center; padding: 30px; color: #eef5f1; text-align: center; background: radial-gradient(circle at 50% 42%, #255a4e, #0c2925 58%); }
.handoff-orbit { display: grid; width: 126px; height: 126px; margin-bottom: 25px; place-items: center; border: 1px dashed rgba(255,255,255,.2); border-radius: 50%; animation: soft-spin 18s linear infinite; }
.player-avatar-large { width: 76px; height: 76px; font-size: 37px; animation: soft-spin 18s linear reverse infinite; }
.handoff-screen h1 { margin: 16px 0 10px; font-family: var(--serif); font-size: 48px; font-weight: 500; letter-spacing: -.04em; }
.handoff-screen p { max-width: 470px; margin: 0 0 28px; color: #9bb2ab; line-height: 1.55; }

.winner-overlay { position: fixed; z-index: 50; inset: 0; display: grid; place-content: center; padding: 20px; color: #fff; text-align: center; background: rgba(8,31,27,.86); backdrop-filter: blur(18px); animation: fade-in .5s ease; }
.winner-overlay > div { position: relative; width: min(480px, calc(100vw - 40px)); padding: 48px; border: 1px solid rgba(255,255,255,.15); border-radius: 18px; background: rgba(36,83,72,.42); box-shadow: 0 30px 100px rgba(0,0,0,.28); }
.winner-close { position: absolute; top: 12px; right: 12px; display: grid; width: 44px; height: 44px; place-items: center; cursor: pointer; border: 1px solid rgba(255,255,255,.15); border-radius: 50%; color: #d9e7e1; background: rgba(255,255,255,.05); font-size: 25px; }
.winner-spark { display: block; color: #e9b853; font-size: 55px; animation: pulse 1.5s infinite; }
.winner-overlay h2 { margin: 10px; font-family: var(--serif); font-size: 48px; font-weight: 500; }
.winner-overlay p { max-width: 340px; margin: 12px auto 0; color: #adc1bb; line-height: 1.55; }
.winner-last-turn { min-height: 44px; margin-top: 4px; padding: 8px 12px; border: 0; border-radius: 7px; color: #f4d895; background: transparent; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.winner-last-turn:hover { background: rgba(255,255,255,.06); }
.winner-actions { display: flex; justify-content: center; gap: 9px; margin-top: 25px; }
.winner-actions .button { flex: 1; gap: 12px; padding-inline: 16px; }
.winner-actions .button-ghost { color: #eff6f2; border-color: rgba(255,255,255,.16); background: rgba(255,255,255,.06); }
.turn-banner.is-finished { background: #244d44; }
.result-reopen { display: flex; min-height: 44px; align-items: center; gap: 7px; padding: 0 13px; cursor: pointer; border: 1px solid rgba(255,255,255,.16); border-radius: 8px; color: #f3e6bd; background: rgba(255,255,255,.05); font-size: 11px; font-weight: 750; }
.result-reopen span { color: #e8bd57; font-size: 17px; }
.rack-panel.is-finished { box-shadow: 0 -10px 30px rgba(10,31,27,.12); }
#toast-region { position: fixed; z-index: 100; right: 18px; bottom: 18px; display: grid; gap: 8px; }
.toast { max-width: 380px; padding: 13px 17px; border: 1px solid rgba(255,255,255,.13); border-radius: 8px; color: #f4f8f6; background: #173f38; box-shadow: 0 15px 50px rgba(0,0,0,.25); font-size: 12px; animation: toast-in .25s ease; }
.toast-error { border-color: rgba(232,137,116,.5); background: #673a32; }
.is-busy { cursor: progress; }
.is-busy .button { pointer-events: none; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes soft-spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .4; transform: scale(.86); } }
@keyframes rise-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes play-panel-in { from { opacity: 0; transform: translateY(13px); } }
@keyframes field-reveal { from { opacity: 0; transform: translateY(-7px); } }
@keyframes player-arrive { from { opacity: 0; transform: translateY(-13px) scale(.97); } 70% { transform: translateY(2px) scale(1.01); } }
@keyframes player-leave { to { opacity: 0; transform: translateY(-8px) scale(.97); } }
@keyframes invitation-pulse { 50% { opacity: .45; letter-spacing: .28em; } }
@keyframes play-tile-float { 50% { transform: rotate(-9deg) translateY(8px); } }
@keyframes play-tile-float-middle { 50% { transform: rotate(1deg) translateY(-7px); } }
@keyframes play-tile-float-last { 50% { transform: rotate(7deg) translateY(5px); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes new-tile-glow { 50% { filter: drop-shadow(0 0 9px rgba(237,176,72,.95)) drop-shadow(0 14px 9px rgba(4,22,18,.34)); } }
@keyframes insertion-pulse { 50% { border-color: rgba(255,255,255,.85); background: rgba(255,255,255,.14); } }

@media (max-width: 850px) {
  .hero { min-height: 0; grid-template-columns: 1fr; padding-top: 50px; }
  .hero-art { min-height: 430px; transform: scale(.88); transform-origin: top center; }
  .rummy-positioning { grid-template-columns: 1fr; gap: 18px; margin-top: -18px; }
  .rummy-positioning .eyebrow { margin-top: 0; }
  .play-intro { padding-right: 330px; }
  .play-ornaments { right: 25px; transform: scale(.85); transform-origin: center right; }
  .play-content { padding-inline: 38px; }
  .mode-card { grid-template-columns: 45px 1fr; padding: 14px; }
  .mode-icon { width: 45px; height: 59px; }
  .mode-check { position: absolute; top: 9px; right: 9px; }
  .play-fields { grid-template-columns: 1fr; gap: 20px; }
  .how-to-head { grid-template-columns: 1fr; gap: 24px; }
  .how-to-head > p { max-width: 620px; }
  .home-learning-head { grid-template-columns: 1fr; gap: 24px; }
  .home-learning-grid { grid-template-columns: repeat(2,1fr); }
  .home-playful { grid-template-columns: 1fr; }
  .story-slide { min-height: 680px; grid-template-columns: 1fr; grid-template-rows: auto 390px; }
  .story-copy { justify-content: end; padding: 48px 48px 38px; }
  .story-number { top: 25px; right: 36px; left: auto; }
  .story-copy h3 { font-size: 45px; }
  .story-progress button { min-width: 82px; }
  .player-strip { justify-content: start; overflow-x: auto; }
  .lobby-shell { grid-template-columns: minmax(0, 560px); }
  .lobby-note { display: none; }
}

@media (max-width: 760px) {
  .public-site-nav { grid-template-columns: auto 1fr; gap: 18px; }
  .public-primary-nav,.public-site-nav .nav-install { display: none; }
  .public-nav-actions { min-width: 0; gap: 8px; }
  .public-mobile-menu { display: block; }
  .public-mobile-menu summary { display: grid; width: 42px; height: 42px; place-items: center; cursor: pointer; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: rgba(255,253,247,.72); }
  .public-mobile-menu summary svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
  .public-mobile-menu[open] summary { color: #fff; border-color: var(--ink); background: var(--ink); }
  .public-mobile-menu > nav { position: absolute; z-index: 50; top: calc(100% - 6px); right: 0; display: grid; width: min(330px,calc(100vw - var(--page-gutter) * 2)); gap: 3px; padding: 10px; border: 1px solid rgba(20,43,40,.14); border-radius: 15px; background: var(--paper); box-shadow: 0 24px 65px rgba(20,43,40,.2); }
  .public-mobile-menu > nav a { display: grid; min-height: 64px; grid-template-columns: 1fr; align-content: center; gap: 4px; padding: 10px 14px; border-radius: 10px; color: #5e706a; }
  .public-mobile-menu > nav a:hover,.public-mobile-menu > nav a.is-active { color: var(--ink); background: rgba(215,89,66,.08); }
  .public-mobile-menu > nav span { font: 500 18px var(--serif); }
  .public-mobile-menu > nav small { font-size: 9px; }
}

@media (max-width: 600px) {
  :root { --page-gutter: 13px; --page-gap: 24px; }
  .site-nav { height: calc(70px + var(--app-safe-top)); }
  .nav-rule { display: none; }
  .nav-actions { gap: 0; }
  .public-site-nav .brand { font-size: 23px; }
  .public-site-nav .brand-mark { width: 34px; height: 34px; border-radius: 9px; }
  .public-site-nav .nav-account { width: 78px; min-height: 42px; justify-content: center; gap: 7px; padding: 0 9px; }
  .public-site-nav .nav-account-copy,.public-site-nav .nav-account-arrow { display: none; }
  .public-site-nav .nav-account::after { content: 'Konto'; font-size: 10px; font-weight: 800; }
  .public-site-nav .nav-account .nav-account-avatar { width: 24px; height: 24px; font-size: 16px; }
  .hero { padding-top: 40px; }
  .hero h1 { font-size: 51px; }
  .hero-lead { font-size: 18px; }
  .hero-actions { flex-direction: column; }
  .trust-row { flex-wrap: wrap; gap: 10px 18px; }
  .hero-art { min-height: 340px; margin-inline: -35px; transform: scale(.68); transform-origin: top center; }
  .rummy-positioning { margin-top: -70px; margin-bottom: 62px; padding-block: 27px 30px; }
  .rummy-positioning h2 { font-size: 38px; }
  .rummy-positioning p { font-size: 15px; line-height: 1.65; }
  .play-panel { margin-top: -70px; }
  .rummy-positioning + .play-panel { margin-top: 0; }
  .play-intro { min-height: 0; padding: 27px 23px 29px; }
  .play-intro > div { margin-top: 14px; }
  .play-intro h2 { font-size: 38px; }
  .play-intro p, .play-ornaments { display: none; }
  .play-tabs { gap: 4px; padding-inline: 9px; }
  .play-tabs button { min-height: 64px; padding: 10px 13px; }
  .play-tabs button small { display: none; }
  .play-content { padding: 22px 15px 24px; }
  .play-step-head { margin-bottom: 15px; }
  .play-step-head small { display: none; }
  .play-step-head strong, .field-heading strong { font-size: 17px; }
  .mode-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-bottom: 20px; }
  .mode-card { min-height: 103px; grid-template-columns: 1fr; grid-template-rows: 48px auto; align-content: center; justify-items: center; gap: 7px; padding: 9px 5px; text-align: center; }
  .mode-icon { width: 38px; height: 48px; font-size: 21px; }
  .mode-copy strong { font-size: 10px; line-height: 1.2; }
  .mode-copy small { display: none; }
  .mode-check { position: absolute; top: 6px; right: 6px; width: 17px; height: 17px; font-size: 8px; }
  .play-fields { padding: 16px; }
  .play-fields[data-online-fields] { grid-template-columns: 1fr; gap: 13px; }
  .play-fields[data-online-fields] .field-heading small { display: none; }
  .player-list, .join-form { grid-template-columns: 1fr; }
  .player-entry { grid-template-columns: 34px minmax(0,1fr); }
  .player-entry:not(.is-fixed) { grid-template-columns: 34px minmax(0,1fr) 30px; }
  .player-add-row { align-items: flex-start; flex-direction: column; }
  .player-add-row > small { padding-left: 8px; }
  .play-content[data-panel="join"].is-active { grid-template-columns: 1fr; gap: 0; }
  .join-invitation { display: none; }
  .join-form .field-heading, .join-form .button { grid-column: auto; }
  .how-to { padding-bottom: 90px; }
  .how-to-head { margin-bottom: 27px; }
  .how-to-head h2 { font-size: 48px; }
  .how-to-head > p { font-size: 17px; }
  .story-shell { margin-inline: -3px; border-radius: 16px; }
  .story-viewport { overflow-x: auto; scrollbar-width: none; }
  .story-viewport::-webkit-scrollbar { display: none; }
  .story-slide { min-height: 625px; grid-template-rows: 270px 355px; }
  .story-copy { padding: 34px 27px 28px; }
  .story-number { top: 20px; right: 24px; font-size: 72px; }
  .story-copy h3 { margin-bottom: 14px; font-size: 36px; }
  .story-copy > p:last-child { font-size: 13px; line-height: 1.5; }
  .story-tile { width: 56px; height: 78px; }
  .story-tile b { font-size: 36px; }
  .story-rack { right: 1%; bottom: 22%; padding-inline: 17px; transform: rotate(-2deg) scale(.92); }
  .story-meld .story-tile { width: 49px; height: 69px; }
  .meld-run { top: 15%; left: 5%; }
  .meld-group { right: 5%; bottom: 12%; }
  .valid-stamp { top: 10%; right: 5%; }
  .score-orbit { top: 11%; right: 8%; width: 137px; height: 137px; }
  .score-orbit strong { font-size: 48px; }
  .opening-meld { bottom: 16%; left: 6%; }
  .remix-tile-1 { left: 5%; }
  .remix-tile-2 { left: 21%; }
  .remix-tile-3 { left: 37%; }
  .remix-tile-4 { right: 37%; }
  .remix-tile-5 { right: 21%; }
  .remix-tile-6 { right: 5%; }
  .story-slide.is-active .remix-tile-4 { animation-name: remix-four-mobile; }
  .story-controls { min-height: 72px; padding-inline: 16px; }
  .story-progress { flex: 1; justify-content: space-around; }
  .story-progress button { display: block; min-width: 0; padding: 0 9px; text-align: center; }
  .story-progress button::before { right: 5px; left: 5px; }
  .story-progress b { display: none; }
  .story-progress span { font-size: 18px; }
  .story-arrows { display: none; }
  .how-to-finale { align-items: stretch; flex-direction: column; padding-top: 30px; }
  .how-to-finale .button { width: 100%; }
  .home-learning { padding-bottom: 90px; }
  .home-learning-head h2 { font-size: 48px; }
  .home-learning-intro p { font-size: 16px; }
  .home-learning-grid { grid-template-columns: 1fr; }
  .home-learning-featured { min-height: 355px; grid-column: auto; grid-row: auto; }
  .home-learning-featured > div { max-width: 100%; }
  .home-learning-card { min-height: 205px; }
  .home-playful { padding: 25px 18px; }
  .home-playful a { padding-inline: 8px; }
  .game-header { height: calc(62px + var(--app-safe-top)); grid-template-columns: 1fr 1fr; padding: var(--app-safe-top) 13px 0; }
  .game-header .brand { font-size: 21px; }
  .game-header .brand-mark { width: 32px; height: 32px; }
  .connection { display: none; }
  .game-header-actions { gap: 5px; }
  .header-icon { width: 34px; height: 34px; }
  .game-header-actions [data-pwa-install] { display: none; }
  .game-code { padding-inline: 8px; }
  #game-root { min-height: calc(100vh - 62px - var(--app-safe-top)); }
  .player-strip { min-height: 62px; gap: 18px; padding-inline: 14px; }
  .player-chip { min-width: 118px; }
  .player-chip.is-active::after { bottom: -10px; }
  .turn-banner { min-height: 62px; }
  .turn-banner strong { max-width: 235px; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
  .table-surface { min-height: 38vh; padding-inline: 11px; }
  .table-caption { padding-inline: 5px; }
  .table-caption small { display: none; }
  .meld-area { gap: 17px 10px; }
  .meld { min-width: 150px; padding-inline: 3px; }
  .tile { width: 45px; height: 63px; }
  .meld-add { width: 23px; height: 47px; }
  .rack-panel { padding-inline: 9px; }
  .rack { justify-content: start; padding-inline: 18px; }
  .rack .tile { width: 51px; height: 71px; }
  .action-muted span { display: none; }
  .button-draw { padding-inline: 10px; font-size: 11px; }
  .button-commit { min-width: 142px; padding-inline: 13px; font-size: 11px; }
  .button-opening { order: -1; width: 100%; justify-content: space-between; }
  .opening-confirmed { order: -1; width: 100%; text-align: center; }
  .waiting-turn { display: none; }
  .lobby-card { padding: 26px 20px; }
  .lobby-card h1, .handoff-screen h1 { font-size: 39px; }
  .pwa-update { right: 10px; bottom: 10px; width: calc(100vw - 20px); grid-template-columns: 1fr auto; }
  .pwa-update small { display: none; }
  .pwa-update-dismiss { position: absolute; top: -10px; right: -5px; border-radius: 50%; color: #fff; background: #315b53; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .story-rack .story-tile, .story-meld .story-tile, .opening-meld .story-tile, .score-orbit, .valid-stamp { opacity: 1; transform: none; }
}

/* Mobile table tools. The document keeps its natural scroll; only long rows scroll sideways. */
#game-root { overflow-anchor: none; }
.game-layout { padding-bottom: var(--selection-space, 0px); }
.table-surface { overflow: hidden; }
.table-caption { gap: 12px; flex-wrap: wrap; }
.table-caption > div { display: grid; gap: 5px; }
.table-caption small { display: block; font-family: var(--sans); font-size: 10px; font-style: normal; }
.table-caption-actions { display: flex !important; flex-shrink: 0; grid-auto-flow: column; gap: 6px !important; }
.table-overview-button { min-height: 44px; flex-shrink: 0; padding: 0 14px; border: 1px solid #83ae9855; border-radius: 8px; color: #edf5ee; background: #ffffff0a; font-size: 12px; cursor: pointer; }
.recent-change-button { display: flex; min-height: 44px; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid #e1be6c99; border-radius: 8px; color: #fff4cf; background: #e0ad3c14; font-size: 11px; cursor: pointer; }
.recent-change-button b { display: grid; min-width: 20px; height: 20px; place-items: center; border-radius: 50%; color: #274c40; background: #f2cd75; font-size: 10px; }
.table-rule { position: relative; margin-top: 8px; color: #a5bdb1; font-size: 11px; }
.meld-area { min-width: 0; gap: 14px 18px; padding-top: 16px; }
.meld { width: max-content; min-width: 148px; max-width: 100%; padding: 0 6px 4px; }
.meld.has-recent-change { border-color: #efca735c; background: #f3d6870a; box-shadow: inset 3px 0 #efca73; }
.meld-label { position: relative; z-index: 1; top: auto; right: auto; left: auto; min-height: 32px; gap: 6px; align-items: center; padding: 0 8px 0 3px; letter-spacing: .02em; }
.meld-label button { min-height: 32px; padding: 2px 0; border: 0; color: #cfdfd5; background: transparent; text-align: left; font: inherit; font-size: 9px; cursor: pointer; }
.meld-label small { font-size: 8px; white-space: nowrap; }
.meld-tiles { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; margin-top: -10px; padding: 20px 8px 7px 3px; scrollbar-width: thin; scrollbar-color: #ffffff45 transparent; }
.tile-scroll-shell { position: relative; min-width: 0; max-width: 100%; }
.tile-scroll-shell::before, .tile-scroll-shell::after { position: absolute; z-index: 9; top: 12px; bottom: 7px; width: 23px; pointer-events: none; content: ''; opacity: 0; transition: opacity .15s; }
.tile-scroll-shell::before { left: 0; background: linear-gradient(90deg, var(--scroll-edge, #21574b), transparent); }
.tile-scroll-shell::after { right: 0; background: linear-gradient(-90deg, var(--scroll-edge, #21574b), transparent); }
.tile-scroll-shell.can-scroll-left::before, .tile-scroll-shell.can-scroll-right::after { opacity: 1; }
.meld-add { min-width: 40px; height: 54px; flex: 0 0 40px; }
.rack-panel { --scroll-edge: #f3edde; padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
.rack-head { height: auto; min-height: 39px; gap: 8px; align-items: center; }
.rack-head > div:first-child { min-width: 0; }
.rack-head em { margin-left: 4px; color: #83918a; font: 11px var(--sans); }
.rack-head small { font-size: 9px; letter-spacing: .02em; }
.rack-utilities { display: flex; flex: 0 0 auto; align-items: center; gap: 2px; }
.rack-utilities button { display: inline-flex; min-width: 36px; min-height: 44px; align-items: center; justify-content: center; gap: 4px; padding: 0 7px; cursor: pointer; border: 0; border-radius: 7px; color: #536d61; background: transparent; font-size: 12px; }
.rack-utilities button[aria-pressed="true"], .selection-caption button[aria-pressed="true"] { color: #fff; background: #2e685a; }
.rack { justify-content: flex-start; padding-top: 16px; overscroll-behavior-x: contain; }
.game-actions { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; gap: 8px; }
.game-actions .button { min-width: 0; min-height: 46px; padding-inline: 12px; gap: 6px; }
.game-actions .button-opening, .game-actions .opening-confirmed { grid-column: 1 / -1; }
.floating-tools { position: fixed; z-index: 30; right: max(10px, env(safe-area-inset-right, 0px)); bottom: 0; left: max(10px, env(safe-area-inset-left, 0px)); display: grid; max-width: 650px; gap: 5px; margin-inline: auto; padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); pointer-events: none; }
.floating-tools:empty { display: none; }
.floating-tools > * { pointer-events: auto; }
.selection-bar { padding: 7px 10px 9px; border: 1px solid #b5c7b9; border-radius: 12px; background: #fffdf5; color: var(--ink); box-shadow: 0 6px 24px #09251d26; }
.selection-caption { display: flex; min-height: 36px; align-items: center; gap: 8px; }
.selection-caption strong { flex: 1; font-size: 12px; }
.selection-caption button { min-height: 36px; padding: 0 9px; border: 0; border-radius: 6px; background: #edf0e8; color: #4e665b; font-size: 11px; cursor: pointer; }
.selection-caption button:last-child { min-width: 36px; background: transparent; font-size: 23px; }
.selection-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.selection-actions button { min-height: 44px; flex: 1; padding: 8px 10px; border: 1px solid #d2dccf; border-radius: 7px; color: #255447; background: #eaf0e5; font-size: 12px; font-weight: 700; cursor: pointer; }
.selection-actions button:first-child { color: #fff; border-color: #285c4e; background: #285c4e; }
.mini-bank { --scroll-edge: #f5eedf; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 0 6px 0 8px; border: 1px solid #cfc5b2; border-radius: 12px; background: #f5eedf; box-shadow: 0 -4px 30px #09231d40; }
.mini-bank-tiles, .sheet-bank { display: flex; align-items: flex-end; min-width: 0; overflow-x: auto; padding: 12px 3px 6px; overscroll-behavior-x: contain; scrollbar-width: thin; }
.mini-bank .tile { width: 41px; height: 57px; margin-left: -4px; }
.mini-bank .tile.is-selected, .sheet-bank .tile.is-selected { transform: translateY(-7px); }
.dock-buttons { display: flex; align-items: center; padding-left: 6px; }
.dock-buttons button { display: grid; min-width: 40px; min-height: 48px; align-content: center; justify-items: center; border: 0; border-radius: 7px; color: #315746; background: transparent; font-size: 22px; cursor: pointer; }
.dock-buttons small { font-size: 9px; }
.game-page button:focus-visible, .meld-tiles:focus-visible { outline: 3px solid #d89562; outline-offset: 2px; }
.game-sheet { position: fixed; inset: 0; display: none; width: min(680px, calc(100% - 24px)); max-width: none; max-height: min(88dvh, 850px); margin: auto; padding: 0; overflow: hidden; border: 1px solid #d6d9c7; border-radius: 18px; color: var(--ink); background: #f7f3e7; box-shadow: 0 24px 100px #001c1599; }
.game-sheet[open] { display: flex; flex-direction: column; }
.game-sheet::backdrop { background: #08251ccc; backdrop-filter: blur(4px); }
.has-game-sheet { overflow: hidden; }
.sheet-header { display: flex; flex-shrink: 0; min-height: 64px; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px; border-bottom: 1px solid #d4d9c8; }
.sheet-header h2 { margin: 0; font-family: var(--serif); font-size: 25px; font-weight: 500; letter-spacing: -.03em; }
.sheet-header h2:focus { outline: none; }
.sheet-header button { width: 44px; height: 44px; flex-shrink: 0; border: 1px solid #d6dccd; border-radius: 50%; color: #44624f; background: transparent; font-size: 27px; cursor: pointer; }
.sheet-body { min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; padding: 16px 18px 24px; }
.sheet-hint { margin: 0 0 18px; color: #697c6b; font-size: 12px; line-height: 1.6; }
.overview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.overview-card { min-width: 0; padding: 12px; border: 1px solid #cad4c3; border-radius: 10px; background: #fffdf5; text-align: left; cursor: pointer; }
.overview-card:disabled { opacity: .5; cursor: not-allowed; }
.overview-card.is-incomplete { border-color: #bf8946; background: #fbefdc; }
.overview-card.has-recent-change { border-color: #d7ae50; box-shadow: inset 3px 0 #e1b651; }
.overview-card > span:first-child { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.overview-card b { display: grid; width: 23px; height: 23px; place-items: center; border-radius: 50%; color: #4e715d; background: #e6ecdf; font-size: 11px; }
.overview-card small { color: #657a63; font-size: 10px; }
.overview-tiles { display: flex; gap: 3px; margin: 14px 0 10px; }
.overview-tiles i { display: grid; min-width: 0; width: 30px; height: 41px; align-content: center; justify-items: center; gap: 3px; border: 1px solid #d9ceba; border-radius: 4px; background: #f7f0de; font: 600 20px var(--serif); }
.overview-tiles i small { color: inherit; font-size: 6px; }
.preview-coral { color: var(--coral); }
.preview-blue { color: var(--blue); }
.preview-gold { color: #b78117; }
.preview-ink { color: var(--ink); }
.preview-joker { color: var(--coral); }
.sheet-footer { --scroll-edge: #f7f3e7; flex-shrink: 0; padding: 0 18px max(12px, env(safe-area-inset-bottom, 0px)); border-top: 1px solid #d4d9c8; }
.sheet-footer:has(> :first-child) { padding-top: 6px; }
.sheet-footer:empty { display: none; }
.sheet-footer .selection-bar { margin-top: 6px; box-shadow: none; }
.sheet-bank-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sheet-bank-head strong { font-size: 12px; }
.sheet-bank .tile { width: 46px; height: 64px; }
.expanded-rack { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px 6px; padding: 14px 0; }
.expanded-rack .tile { width: 48px; height: 67px; margin: 0; }
.sheet-sort, .sheet-jump { display: block; min-height: 44px; margin-top: 16px; padding: 8px 10px; border: 0; color: #486951; background: transparent; font-size: 12px; text-align: left; cursor: pointer; }
.focus-navigation { display: flex; align-items: center; justify-content: space-between; margin: -8px 0 12px; }
.focus-navigation button { min-width: 44px; min-height: 44px; padding: 0 8px; border: 0; border-radius: 8px; color: #496e56; background: transparent; font-size: 12px; cursor: pointer; }
.focus-navigation button:disabled { opacity: .3; }
.focus-felt { padding: 14px 10px; border-radius: 12px; background: #21574b; }
.focus-felt .meld { width: 100%; padding: 0; }
.focus-felt .meld-label { display: none; }
.focus-felt .tile { width: 54px; height: 75px; }
.focus-insert { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.focus-insert button { min-height: 44px; padding: 8px; border: 1px solid #c1d1ba; border-radius: 8px; color: #255640; background: #e5eddc; font-size: 12px; font-weight: 650; cursor: pointer; }
.insert-between { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 12px; }
.insert-between > small { width: 100%; color: #69806a; font-size: 11px; }
.insert-between button { min-width: 44px; min-height: 44px; border: 1px solid #d5ddcd; border-radius: 6px; background: #fffdf5; color: #405f46; font-size: 12px; cursor: pointer; }
.change-summary { display: grid; grid-template-columns: 45px 1fr; gap: 12px; align-items: center; padding: 15px; border: 1px solid #dfd3b5; border-radius: 12px; background: #fffaf0; }
.change-summary > span { display: grid; width: 43px; height: 43px; place-items: center; border-radius: 50%; color: #77551e; background: #f2d589; font-size: 20px; }
.change-summary strong { font-family: var(--serif); font-size: 18px; font-weight: 600; }
.change-summary p { margin: 4px 0 0; color: #687966; font-size: 11px; line-height: 1.45; }
.change-timeline { display: grid; gap: 0; margin: 15px 0; padding: 0; list-style: none; }
.change-timeline li { position: relative; display: grid; grid-template-columns: 38px 1fr; gap: 11px; padding: 11px 0; }
.change-timeline li:not(:last-child)::after { position: absolute; top: 48px; bottom: -2px; left: 18px; width: 1px; content: ''; background: #d7ddcd; }
.change-avatar { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 50%; color: #fff; background: #477765; font-family: var(--serif); font-style: italic; }
.change-timeline li > div > span { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.change-timeline strong { font-size: 12px; }
.change-timeline small { color: #8b9788; font-size: 9px; text-transform: uppercase; }
.change-timeline p { margin: 4px 0 7px; color: #617164; font-family: var(--serif); font-size: 13px; }
.change-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.change-tags em { padding: 5px 7px; border-radius: 12px; color: #6d4d17; background: #f3dfad; font-size: 9px; font-style: normal; font-weight: 750; }
.change-tags em.is-quiet { color: #708075; background: #e9ede5; }
.change-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 9px; padding: 10px 12px; border-radius: 8px; color: #6d7c6e; background: #ebece3; font-size: 10px; }
.change-legend i { width: 9px; height: 9px; border-radius: 50%; }
.change-legend i.is-new { background: #e5ba52; box-shadow: 0 0 0 3px #f1dca8; }
.change-legend i.is-changed { border: 2px solid #d3a741; background: transparent; }
.change-jump { width: 100%; margin-top: 8px; border-radius: 8px; background: #e8eee3; }
#toast-region { z-index: 60; bottom: calc(var(--floating-height, 0px) + 18px); pointer-events: none; }
@media (max-width: 600px) {
  .table-surface { padding: 14px 10px 20px; }
  .table-caption { padding-inline: 2px; }
  .table-caption small { font-size: 9px; }
  .table-rule { display: none; }
  .meld-area { gap: 10px 8px; }
  .meld { padding-inline: 3px; min-width: 140px; }
  .meld-label { gap: 4px; }
  .meld-label button { font-size: 8px; }
  .meld-label small { font-size: 7px; }
  .rack-panel { padding-inline: 10px; }
  .rack-utilities button { padding-inline: 6px; min-width: 34px; }
  .rack-utilities button span { display: none; }
  .rack-head small { max-width: 155px; font-size: 8px; }
  .rack { padding-inline: 4px; }
  .game-actions .button { font-size: 12px; }
  .game-sheet { inset: auto 0 0; width: 100%; max-height: 92dvh; margin: 0; border-radius: 18px 18px 0 0; border-bottom: 0; }
  .sheet-header { min-height: 57px; padding: 6px 14px; }
  .sheet-header h2 { font-size: 23px; }
  .sheet-body { padding: 12px 14px 18px; }
  .sheet-footer { padding-inline: 10px; }
  .overview-card { padding: 9px; }
  .overview-card small { font-size: 9px; }
  .overview-tiles { gap: 2px; }
  .overview-tiles i { font-size: 17px; }
  .sheet-footer .selection-caption { gap: 4px; }
  .selection-actions button { padding-inline: 7px; font-size: 11px; }
  .selection-caption strong { font-size: 11px; }
  .selection-caption button { min-height: 40px; }
  .sheet-bank-head strong { font-size: 11px; }
  .sheet-hint { margin-bottom: 12px; }
}
@media (max-height: 550px) {
  .game-sheet { max-height: 96dvh; }
  .sheet-header { min-height: 46px; padding-block: 1px; }
  .sheet-bank .tile { width: 35px; height: 49px; }
  .sheet-footer .selection-caption { min-height: 30px; }
  .sheet-footer .selection-caption button { min-height: 30px; }
  .sheet-bank-head .rack-utilities button { min-height: 32px; }
}
@media (hover: none) {
  .tile:hover { transform: none; }
  .tile.is-selected, .tile.is-selected:hover { transform: translateY(-8px); }
}
@media (max-width: 600px) {
  .winner-overlay { padding: 12px; }
  .winner-overlay > div { width: min(100%, 390px); padding: 40px 22px 24px; border-radius: 16px; }
  .winner-overlay h2 { margin-inline: 0; font-size: 40px; }
  .winner-overlay p { font-size: 13px; }
  .winner-actions { align-items: stretch; flex-direction: column; }
  .winner-actions .button { width: 100%; flex: 0 0 auto; }
.result-reopen { padding-inline: 10px; }
}

/* Accounts, progression and optional training coach */
.nav-back, .nav-logout { display: inline-flex; min-height: 44px; align-items: center; gap: 10px; padding: 8px 0; border: 0; color: #5d7166; background: transparent; font-size: 12px; font-weight: 650; cursor: pointer; }
.nav-back:hover, .nav-logout:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.flash-success { color: #235e49; border-color: #a8ceb8; background: #e5f2e7; }
.game-header-actions { display: flex; align-items: center; gap: 7px; }
.header-icon { display: grid; width: 38px; height: 38px; place-items: center; cursor: pointer; border: 1px solid rgba(255,255,255,.14); border-radius: 9px; color: #d8e6e0; background: rgba(255,255,255,.04); }

.account-page { min-height: 100vh; background: radial-gradient(circle at 20% 0, #fffdf8, transparent 35%), var(--cream); }
.account-shell { display: grid; align-content: start; gap: var(--page-gap); padding-block: var(--page-gap) 80px; }
.account-shell-login { min-height: calc(100dvh - 84px); align-content: center; padding-block: var(--page-gap); }
.account-shell > * { min-width: 0; }
.account-card { overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,253,247,.9); box-shadow: var(--shadow); }
.account-card-wide { display: grid; grid-template-columns: .9fr 1.1fr; }
.account-intro { padding: 52px 46px; color: #edf5f1; background: radial-gradient(circle at 80% 20%, #397264, transparent 36%), var(--green); }
.account-intro .eyebrow { color: #e9a38c; }
.account-intro h1, .account-form-head h1 { margin: 18px 0; font-family: var(--serif); font-size: clamp(42px, 5vw, 60px); font-weight: 500; letter-spacing: -.05em; line-height: .95; }
.account-intro h1 em { color: #eb927d; font-weight: 400; }
.account-intro > p { color: #a9c0b9; font-size: 13px; line-height: 1.65; }
.account-intro ul { display: grid; gap: 12px; margin: 25px 0 0; padding: 0; list-style: none; }
.account-intro li { position: relative; padding-left: 24px; color: #dce8e3; font-size: 12px; }
.account-intro li::before { position: absolute; left: 0; color: #edb962; content: '✦'; }
.account-form { display: grid; align-content: center; padding: 44px; }
.account-form-head { padding: 42px 42px 0; text-align: center; }
.account-form-head h1 { font-size: 50px; }
.account-form-head p { margin: -6px auto 0; color: #647670; font-size: 13px; line-height: 1.55; }
.account-form label { display: block; margin-bottom: 16px; color: #536762; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.account-form label small { color: #8a9994; font-weight: 550; }
.account-form input { width: 100%; height: 49px; margin-top: 7px; padding: 0 13px; border: 1px solid var(--line); border-radius: 8px; outline: 0; background: #fff; }
.account-form input:focus { border-color: var(--coral); box-shadow: 0 0 0 3px rgba(215,89,66,.1); }
.form-errors { margin-bottom: 17px; padding: 10px 13px; border-radius: 8px; color: #843d31; background: #f8ded7; }
.form-errors p { margin: 3px 0; font-size: 11px; }
.account-switch { margin: 19px 0 0; color: #73827e; text-align: center; font-size: 11px; }
.account-switch a { color: var(--coral); font-weight: 800; }

.profile-page { min-height: 100vh; background: radial-gradient(circle at 75% 0, #fff, transparent 32%), var(--cream); }
.profile-shell { display: grid; gap: var(--page-gap); padding-block: var(--page-gap) 80px; }
.profile-hero { display: grid; grid-template-columns: auto 1fr minmax(250px, .75fr); align-items: center; gap: 24px; padding: 34px; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,253,247,.78); box-shadow: 0 20px 60px rgba(31,50,43,.08); }
.profile-avatar { display: grid; width: 82px; height: 82px; place-items: center; border: 5px solid #fff; border-radius: 50%; color: #fff; background: var(--green-light); box-shadow: 0 0 0 2px #d8cab5, 0 10px 30px rgba(17,48,40,.18); }
.profile-avatar span { font: italic 37px var(--serif); }
.profile-hero h1 { margin: 6px 0 2px; font-family: var(--serif); font-size: 43px; font-weight: 500; letter-spacing: -.04em; }
.profile-hero p { margin: 0; color: #6d7f79; font-size: 12px; }
.level-progress > span { display: flex; justify-content: space-between; margin-bottom: 9px; font-size: 11px; }
.level-progress small { color: #788983; }
.level-progress > div { height: 10px; overflow: hidden; border-radius: 6px; background: #e2dfd2; }
.level-progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--coral), #e8ae57); }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.profile-panel { padding: 30px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,253,247,.78); }
.panel-head h2 { margin: 7px 0 22px; font-family: var(--serif); font-size: 31px; font-weight: 500; letter-spacing: -.035em; }
.achievement-list { display: grid; gap: 9px; }
.achievement-list > div { display: flex; min-height: 60px; align-items: center; gap: 13px; padding: 10px 13px; border: 1px solid #e3d5b6; border-radius: 10px; background: #fbf3df; }
.achievement-list > div > span { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 50%; color: #fff; background: #c59230; }
.achievement-list p, .achievement-list strong, .achievement-list small { display: block; margin: 0; }
.achievement-list strong { font-size: 12px; }
.achievement-list small { margin-top: 3px; color: #8a806b; font-size: 9px; }
.empty-copy { color: #71807b; font-family: var(--serif); font-style: italic; line-height: 1.55; }
.cosmetic-list { display: grid; gap: 8px; }
.cosmetic-choice { display: grid; width: 100%; min-height: 60px; grid-template-columns: 38px 1fr auto; align-items: center; gap: 12px; padding: 8px 11px; cursor: pointer; text-align: left; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.cosmetic-choice.is-selected { border-color: #5e947b; box-shadow: inset 0 0 0 1px #5e947b; }
.cosmetic-choice > i { display: block; width: 34px; height: 34px; border-radius: 9px; background: #3f7164; }
.cosmetic-choice strong, .cosmetic-choice small { display: block; }
.cosmetic-choice strong { font-size: 11px; }
.cosmetic-choice small { margin-top: 3px; color: #87938f; font-size: 8px; text-transform: uppercase; }
.cosmetic-choice b { color: #4d7e6b; font-size: 9px; }
.profile-history { padding-bottom: 18px; }
.history-list { display: grid; }
.history-list > a { display: grid; grid-template-columns: 70px 1fr auto; align-items: center; gap: 15px; min-height: 70px; padding: 9px 8px; border-top: 1px solid var(--line); }
.history-list p, .history-list strong, .history-list small { display: block; margin: 0; }
.history-list strong { font-size: 12px; }
.history-list small { margin-top: 4px; color: #84918d; font-size: 9px; }
.history-result { padding: 6px; border-radius: 6px; color: #665e50; background: #e7e1d3; text-align: center; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.history-result.is-win { color: #245c47; background: #dcecdf; }

/* Optional coaching occupies no extra row, even with an open hint. */
html:has(body.game-page) { scrollbar-gutter: stable; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.turn-banner { gap: 12px; }
.turn-copy { min-width: 0; flex: 1; }
.turn-actions { display: flex; flex-shrink: 0; align-items: center; gap: 18px; }
.coach-entry { position: relative; flex-shrink: 0; }
.coach-trigger { position: relative; display: flex; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; gap: 7px; padding: 0 12px; border: 1px solid #ffffff38; border-radius: 10px; background: #ffffff09; cursor: pointer; }
.coach-trigger:hover, .coach-trigger[aria-expanded="true"] { border-color: #e2c37d; background: #ffffff15; }
.coach-trigger .coach-spark { color: #e8c575; font-size: 21px; letter-spacing: 0; }
.coach-trigger .coach-trigger-label { color: #f4edda; font-size: 12px; letter-spacing: 0; text-transform: none; }
.coach-trigger.is-active { border-color: #dfbd68; background: #f1c96f19; }
.coach-trigger.is-active::after { position: absolute; top: 5px; right: 5px; width: 5px; height: 5px; border-radius: 50%; content: ''; background: #f3d994; }
.turn-banner .coach-intro { position: absolute; z-index: 15; top: calc(100% + 8px); right: 0; width: max-content; max-width: min(230px, calc(100vw - 24px)); padding: 10px 13px; border: 1px solid #d4bd85; border-radius: 9px; color: #4b482f; background: #fff4d8; box-shadow: 0 6px 20px #09231d33; font-size: 12px; font-weight: 600; letter-spacing: 0; line-height: 1.4; text-transform: none; pointer-events: none; }
.coach-intro::before { position: absolute; top: -5px; right: 17px; width: 8px; height: 8px; content: ''; border-top: 1px solid #d4bd85; border-left: 1px solid #d4bd85; background: #fff4d8; transform: rotate(45deg); }
.game-sheet.is-coach { inset: var(--coach-top, 12px) auto auto var(--coach-left, 12px); width: min(380px, calc(100% - 24px)); max-height: calc(100dvh - 24px); margin: 0; border-color: #d7c9a5; border-radius: 16px; box-shadow: 0 18px 60px #001c1555; }
.game-sheet.is-coach::backdrop { background: #08251c26; backdrop-filter: none; }
.is-coach .sheet-header { min-height: 64px; border-color: #dfdac9; }
.is-coach .sheet-header h2 { display: flex; align-items: center; gap: 10px; font-size: 21px; }
.coach-avatar { display: grid; width: 34px; height: 34px; flex-shrink: 0; place-items: center; border-radius: 50%; color: #fff; background: #315f52; font: italic 18px var(--serif); }
.is-coach .sheet-body { padding: 18px; }
.coach-steps { display: flex; gap: 12px; justify-content: space-between; margin: 0 0 22px; padding: 0; list-style: none; }
.coach-steps li { display: flex; align-items: center; gap: 5px; color: #6a786b; font-size: 11px; }
.coach-steps li > span { display: grid; width: 22px; height: 22px; flex-shrink: 0; place-items: center; border: 1px solid #d1d8c7; border-radius: 50%; font-size: 10px; }
.coach-steps [aria-current="step"] { color: #275a45; font-weight: 800; }
.coach-steps [aria-current="step"] > span { color: #fffaf0; border-color: #315f52; background: #315f52; }
.coach-steps .is-done > span { color: #315f52; border-color: #cbd7c3; background: #e5ecdf; }
.coach-copy h3 { margin: 0 0 10px; font: 500 25px/1.15 var(--serif); letter-spacing: -.02em; }
.coach-copy h3:focus { outline: none; }
.coach-copy p { margin: 0; color: #4f6557; font-size: 14px; line-height: 1.65; }
.coach-loading { display: flex; min-height: 44px; align-items: center; gap: 10px; color: #4f6557; font-size: 13px; }
.coach-loading .loader { width: 20px; height: 20px; flex-shrink: 0; border-color: #d2d9c8; border-top-color: #315f52; }
.coach-error { padding: 12px; border: 1px solid #dcbb9d; border-radius: 9px; color: #873e2b; background: #fbebdf; font-size: 13px; line-height: 1.5; }
.coach-panel-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 22px; }
.coach-panel-actions .button { min-height: 44px; flex: 1; gap: 12px; padding: 10px 15px; font-size: 12px; }
.coach-secondary { min-height: 44px; padding: 8px 3px; border: 0; border-radius: 6px; color: #4f6557; background: transparent; font-size: 12px; cursor: pointer; }
.coach-secondary:hover { text-decoration: underline; text-underline-offset: 3px; }
.coach-footnote { margin: 16px 0 0; color: #69786a; font-size: 11px; line-height: 1.5; }
.turn-banner.is-bot-thinking strong::after { display: inline-block; width: 18px; content: ' …'; overflow: hidden; vertical-align: bottom; animation: thinking 1.1s steps(4,end) infinite; }
.meld.is-coach-target { border-color: #f3ca6b; background: rgba(241,196,85,.11); box-shadow: 0 0 0 3px rgba(241,196,85,.08); }
.tile.is-coach-tile { z-index: 8; transform: translateY(-8px); filter: drop-shadow(0 0 7px #ffd46c) drop-shadow(0 10px 7px rgba(4,22,18,.28)); animation: coach-glow 1.4s ease-in-out 2; }
.tile-coach-badge { position: absolute; z-index: 2; top: 2px; right: 0; display: grid; width: 17px; height: 17px; place-items: center; border: 1px solid #b38322; border-radius: 50%; color: #584014; background: #f8db8c; font-size: 12px; }
.new-meld-zone.is-coach-action, .button-draw.is-coach-action { border: 1px solid #f3ca6b; color: #fff2c9; background: #5a6339; box-shadow: 0 0 0 3px #f1c45533; }
.winner-overlay > div { max-height: calc(100dvh - 30px); overflow-y: auto; }
.winner-progress { margin: 20px auto 0; padding: 14px; border: 1px solid rgba(255,255,255,.15); border-radius: 11px; background: rgba(255,255,255,.06); }
.winner-progress > span { color: #f1c96f; font-size: 13px; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.winner-overlay .winner-progress p { margin-top: 6px; font-size: 11px; }
.winner-progress > a { display: inline-block; margin-top: 8px; color: #f4d895; font-size: 10px; font-weight: 800; }
.winner-progress-guest > div { display: flex; align-items: center; justify-content: center; gap: 13px; margin-top: 12px; }
.winner-progress-guest .button { min-height: 43px; padding-inline: 15px; font-size: 10px; }
.winner-progress-guest > div > a:last-child { color: #d7e5df; font-size: 10px; text-decoration: underline; }

/* Cosmetic rewards affect presentation only, never game rules. */
.cosmetic-accent-sage, .accent_sage .profile-avatar { background: #6d9a81 !important; }
.cosmetic-accent-coral, .accent_coral .profile-avatar { background: #d75942 !important; }
.cosmetic-accent-gold, .accent_gold .profile-avatar { background: #c59432 !important; }
.cosmetic-table-moonlight, .table_moonlight .table-surface { background: radial-gradient(ellipse at 50% 20%, #416676, #294956 52%, #17323b) !important; }
.cosmetic-table-sandstone, .table_sandstone .table-surface { background: radial-gradient(ellipse at 50% 20%, #8b7157, #68503e 52%, #47362e) !important; }
.cosmetic-table-veteran, .table_veteran .table-surface { background: radial-gradient(ellipse at 50% 20%, #56497a, #3e365e 52%, #292440) !important; }
.cosmetic-rack-wood, .rack_warm_wood .rack { border-bottom-color: #543523 !important; background: linear-gradient(to bottom, transparent 82%, #936342 82%, #68432b 100%) !important; }
.cosmetic-frame-first { box-shadow: inset 0 0 0 3px #98b9a6; }
.cosmetic-frame-twenty { box-shadow: inset 0 0 0 3px #d9a84c; }
.cosmetic-frame-regular { box-shadow: inset 0 0 0 3px #d47761; }
.cosmetic-frame-veteran { box-shadow: inset 0 0 0 3px #665587; }
.frame_first_rounds .profile-avatar { box-shadow: 0 0 0 4px #98b9a6, 0 10px 30px rgba(17,48,40,.18); }
.frame_twenty .profile-avatar { box-shadow: 0 0 0 4px #d9a84c, 0 10px 30px rgba(17,48,40,.18); }
.frame_regular .profile-avatar { box-shadow: 0 0 0 4px #d47761, 0 10px 30px rgba(17,48,40,.18); }
.frame_veteran .profile-avatar { box-shadow: 0 0 0 4px #665587, 0 10px 30px rgba(17,48,40,.18); }
.banner_regular .profile-hero { background: linear-gradient(120deg, rgba(215,89,66,.1), transparent 46%), rgba(255,253,247,.88); }
.banner_geometric .profile-hero { background-color: rgba(255,253,247,.9); background-image: linear-gradient(30deg, rgba(55,105,91,.08) 12%, transparent 12.5%, transparent 87%, rgba(55,105,91,.08) 87.5%), linear-gradient(150deg, rgba(55,105,91,.08) 12%, transparent 12.5%, transparent 87%, rgba(55,105,91,.08) 87.5%); background-size: 36px 62px; }
.banner_veteran .profile-hero { color: #f3f0fa; background: radial-gradient(circle at 80% 10%, #675a91, transparent 35%), #342e4f; }
.banner_veteran .profile-hero p, .banner_veteran .level-progress small { color: #c2bbd4; }
.finish_quiet_spark .winner-spark { text-shadow: 0 0 18px #ffe2a0; animation-duration: 2.3s; }

@keyframes thinking { from { width: 0; } to { width: 18px; } }
@keyframes coach-glow { 50% { filter: drop-shadow(0 0 12px #ffe49c) drop-shadow(0 13px 8px rgba(4,22,18,.3)); } }

@media (max-width: 760px) {
  .account-card-wide, .profile-grid { grid-template-columns: 1fr; }
  .account-intro { padding: 38px 28px; }
  .account-form { padding: 30px 26px; }
  .profile-hero { grid-template-columns: auto 1fr; padding: 23px; }
  .level-progress { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  .nav-install { display: none; }
  .account-card { border-radius: 15px; }
  .account-form-head { padding: 32px 25px 0; }
  .account-form-head h1 { font-size: 42px; }
  .profile-hero { grid-template-columns: 64px 1fr; gap: 15px; }
  .profile-avatar { width: 62px; height: 62px; }
  .profile-avatar span { font-size: 29px; }
  .profile-hero h1 { font-size: 33px; }
  .profile-panel { padding: 22px 18px; }
  .turn-banner { padding-block: 9px; }
  .turn-copy strong { max-width: none; }
  .turn-actions { gap: 12px; }
  .coach-trigger { width: 44px; padding: 0; }
  .coach-trigger .coach-trigger-label { display: none; }
  .turn-banner .coach-intro { max-width: calc(100vw - 124px); }
  .game-sheet.is-coach { inset: auto 0 0; width: 100%; max-height: min(78dvh, 560px); border-radius: 18px 18px 0 0; border-bottom: 0; }
  .game-sheet.is-coach::backdrop { background: #08251c66; }
  .is-coach .sheet-body { padding: 16px 18px max(18px, env(safe-area-inset-bottom, 0px)); }
  .winner-progress-guest > div { align-items: stretch; flex-direction: column; }
  .game-header { grid-template-columns: minmax(0, 1fr) auto; }
}

@media (max-width: 400px) {
  .game-header .brand > span:last-child { display: none; }
  .game-header .header-icon { width: 36px; height: 40px; }
  .game-header-actions { gap: 5px; }
}

/* Device-local sound preferences. */
.feedback-toggle.has-sound { color: #f1d699; border-color: #ac975b; }
.feedback-settings [hidden] { display: none; }
.feedback-settings { width: min(530px, calc(100% - 28px)); max-height: calc(100dvh - 36px); padding: 26px; overflow-y: auto; overscroll-behavior: contain; color: #233f35; border: 1px solid #dfd4bd; border-radius: 20px; background: #fffcf5; box-shadow: 0 30px 100px #051d2466; }
.feedback-settings::backdrop { background: #092b24a8; backdrop-filter: blur(5px); }
.feedback-settings-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.feedback-settings h2 { margin: 6px 0 12px; font: 38px/1.05 var(--serif); letter-spacing: -.03em; }
.feedback-settings > p { margin: 0 0 20px; color: #66786e; font-size: 12px; line-height: 1.6; }
.feedback-close { width: 38px; height: 38px; flex: 0 0 auto; cursor: pointer; color: #456555; border: 1px solid #ded9c8; border-radius: 50%; background: transparent; font-size: 24px; }
.feedback-settings section { padding-block: 18px; border-top: 1px solid #e2ddcf; }
.feedback-settings section:last-child { padding-bottom: 0; }
.feedback-settings h3 { margin: 0 0 9px; font-size: 15px; }
.feedback-option { display: flex; align-items: center; justify-content: space-between; gap: 20px; cursor: pointer; }
.feedback-option strong, .feedback-option small { display: block; }
.feedback-option strong { font-size: 13px; }
.feedback-option small { margin-top: 5px; color: #6b7d72; font-size: 11px; line-height: 1.4; }
.feedback-option input { width: 22px; height: 22px; flex: 0 0 auto; accent-color: #2e6c51; }
.feedback-status { margin: 10px 0 14px; color: #607266; font-size: 11px; line-height: 1.55; }
.feedback-volume { display: block; margin: 19px 0 23px; }
.feedback-volume > span { display: flex; justify-content: space-between; margin-bottom: 9px; font-size: 12px; font-weight: 700; }
.feedback-volume input { width: 100%; height: 24px; accent-color: #2e6c51; }
.feedback-volume output { color: #65796c; font-weight: 500; }
.feedback-previews { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 17px; }
.feedback-previews button { display: flex; min-height: 44px; align-items: center; gap: 8px; padding: 10px; cursor: pointer; color: #325642; border: 1px solid #d6dece; border-radius: 9px; background: #f2f5eb; font-size: 11px; font-weight: 650; }
.feedback-previews button small { margin-left: auto; color: #748574; font-size: 9px; }
.feedback-previews button > span { font-size: 19px; }
.feedback-settings button:disabled { cursor: not-allowed; opacity: .5; }
.feedback-settings .button { min-height: 40px; }
.feedback-settings .push-toggle.is-enabled { color: #24563c; border-color: #91b399; box-shadow: none; background: #e4f0e2; }
.feedback-footnote { margin: 13px 0 0; color: #788376; font-size: 10px; line-height: 1.55; }
.feedback-done { width: 100%; margin-top: 18px; }
.feedback-settings :focus-visible { outline: 3px solid #bb713c; outline-offset: 3px; }
@media (max-width: 600px) {
  .feedback-settings { padding: 21px; max-height: calc(100dvh - 24px); }
  .feedback-settings h2 { font-size: 33px; }
}
