/* Northcell Play - shared styles (WAVE5 "Festival & Felt", docs/spec/DESIGN-DIRECTION.md). The original token names are kept so games that read them re-tune; --nc-* and --fam-* are pf/ui v2. */
:root{
  --bg:#FAF6EE; --fg:#27221C; --muted:#5E5547; --card:#FFFFFF;
  --rule:#E7DFD0; --link:#A8430A; --accent:#C2410C;
  --accent-soft:#F3EBDC; --maxw:44rem;

  --on-accent:#fff; --radius:10px; --gutter:12px; --felt:#2f6b4a; --back:#1f5aa6;

  --nc-canvas:#FAF6EE; --nc-surface:#FFFFFF; --nc-ink:#27221C;
  --nc-success:#2BA84A; --nc-danger:#C23A2A; --nc-warning:#E8A13C; --nc-info:#3B82D6;

  --nc-strip-bg:#FFFFFF; --nc-strip-ink:#27221C; --nc-strip-sub:#5E5547; --nc-invalid:#B42318; --nc-invalid-chip:#C23A2A; --nc-warning-chip:#B7791F;
  --nc-lattice:rgba(60,40,10,.045); --nc-shadow:rgba(40,25,8,.28);

  --nc-fast:120ms; --nc-base:200ms; --nc-grand:500ms; --nc-pop:cubic-bezier(.34,1.56,.64,1); --nc-out:ease-out;

  --fam-base:#D94A38; --fam-bright:#FFB347; --fam-deep:#7C1F1A; --fam-mid:#a13026; --fam-trim:#D9A441; --fam-ink:#27221C; --fam-edge:#D94A38;
}
@media (prefers-color-scheme:dark){
  :root{--bg:#131422; --fg:#F2F3FA; --muted:#A9ACC4;
    --card:#1D1F33; --rule:#34375A; --link:#FFB347;
    --accent:#FFB347; --accent-soft:#1D1F33; --on-accent:#27150A; --felt:#1b6a42; --back:#2c6db8;
    --nc-canvas:#131422; --nc-surface:#1D1F33; --nc-ink:#F2F3FA; --nc-lattice:rgba(255,255,255,.04); --nc-shadow:rgba(0,0,0,.6);
    --nc-strip-bg:#1D1F33; --nc-strip-ink:#F2F3FA; --nc-strip-sub:#A3A6C4; --nc-invalid:#FF8A7A; --nc-warning-chip:#E8A13C;}
}
[data-family=board]{--fam-mid:#a13026; --fam-base:#D94A38; --fam-bright:#FFB347; --fam-deep:#7C1F1A; --fam-trim:#D9A441; --fam-edge:#D94A38}
[data-family=cards]{--fam-mid:#145536; --fam-base:#1E7A4C; --fam-bright:#35B878; --fam-deep:#0E3D27; --fam-trim:#C9A24A; --fam-edge:#1E7A4C}
[data-family=desk]{--fam-mid:#095e5d; --fam-base:#0E8A8A; --fam-bright:#35C4C4; --fam-deep:#06403F; --fam-trim:#9BE3E3; --fam-edge:#0E8A8A}
[data-family=puzzle]{--fam-mid:#40409f; --fam-base:#5A5BD6; --fam-bright:#8E8FF0; --fam-deep:#2E2E7A; --fam-trim:#C9CAFF; --fam-edge:#5A5BD6}
[data-family=word]{--fam-mid:#56368a; --fam-base:#7A4FBF; --fam-bright:#A97FE8; --fam-deep:#3E2566; --fam-trim:#E2CCFF; --fam-edge:#7A4FBF}
[data-game=tile-match]{--fam-mid:#8E2B22; --fam-base:#A8382B; --fam-bright:#F2C14E; --fam-deep:#5A1D16; --fam-trim:#F2C14E; --fam-edge:#A8382B}
[data-family=energy]{--fam-mid:#b6510c; --fam-base:#F97316; --fam-bright:#FFC53D; --fam-deep:#8A3A05; --fam-trim:#FFE08A; --fam-edge:#C2410C}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: light dark; }
body { margin: 0; background-color: var(--bg); color: var(--fg); font: 16px/1.65 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  background-image: repeating-linear-gradient(45deg, var(--nc-lattice) 0 1px, transparent 1px 30px), repeating-linear-gradient(-45deg, var(--nc-lattice) 0 1px, transparent 1px 30px); }
a { color: var(--link); }
img { max-width: 100%; height: auto; }

.nav { border-bottom: 1px solid var(--rule); background: color-mix(in srgb, var(--bg) 90%, transparent); }
.nav .wrap { max-width: 1320px; margin: 0 auto; padding: 10px var(--gutter); display: flex; flex-wrap: wrap; align-items: center; gap: 2px 9px; min-height: 48px; }
.nav .brand { font-weight: 700; font-size: 1.05rem; color: var(--fg); text-decoration: none; margin-right: 4px; }
.nav .item { color: var(--muted); text-decoration: none; font-size: .86rem; }
@media (min-width: 600px) { .nav .wrap { gap: 2px 14px; } .nav .item { font-size: .92rem; } }
.nav .item:hover, .nav .item:focus-visible { color: var(--fg); }
.site-footer { margin-top: 48px; border-top: 1px solid var(--rule); padding: 24px var(--gutter); color: var(--muted); font-size: .9rem; }
.site-footer .in { max-width: 1320px; margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; }
.site-footer a { color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px 12px; margin: 0; padding: 0; list-style: none; }
.card { display: block; position: relative; text-decoration: none; color: var(--fg); border-radius: 14px; transition: transform var(--nc-base) var(--nc-out); }
.card::after { content: ""; position: absolute; inset: 0; border-radius: 14px; box-shadow: 0 18px 26px -10px var(--nc-shadow); opacity: 0; transition: opacity var(--nc-base) var(--nc-out); pointer-events: none; }
.card img { display: block; width: 100%; height: auto; aspect-ratio: 5 / 3; border-radius: 14px; background: var(--card); box-shadow: 0 2px 0 rgba(0,0,0,.22), 0 6px 14px -8px var(--nc-shadow); }
@media (hover: hover) { .card:hover { transform: translateY(-4px); } .card:hover::after, .card:focus-visible::after { opacity: 1; } }
.card:active { transform: scale(.96); }
.card:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.card .nm { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

.game-layout { max-width: 1320px; margin: 0 auto; padding: 0 var(--gutter); }
.column { display: flex; flex-direction: column; min-width: 0; }
.column > h1 { order: 0; margin: 8px 0; font-size: 1.25rem; line-height: 1.25; }
.stage { order: 1; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; overflow: clip;
  height: clamp(280px, calc(100vh - 200px), 600px); height: clamp(280px, calc(100svh - 200px), 600px);
  background: var(--accent-soft); border: 1px solid var(--rule); border-radius: var(--radius);
  padding-bottom: 56px; }
.stage canvas { display: block; touch-action: none; }
.stage canvas:not([data-fit]) { visibility: hidden; }
.nc-strip { order: 1; display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 6px 0 12px; overflow: hidden; background: var(--nc-strip-bg); color: var(--nc-strip-ink);
  border: 1px solid var(--rule); border-top: 2px solid var(--fam-edge); border-radius: 12px;
  position: relative; z-index: 3; margin: -56px 8px 4px; box-shadow: 0 6px 16px -8px var(--nc-shadow); }
.nc-strip { pointer-events: none; } .nc-strip-more { pointer-events: auto; }
.nc-strip:empty, .nc-strip[data-empty] { visibility: hidden; }
.nc-strip-chip { flex: none; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 4px; background: var(--fam-edge); color: #fff; font: 800 13px/1 system-ui, sans-serif; font-style: normal; }
.nc-strip-body { flex: 1; min-width: 0; max-height: 100%; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.nc-strip-text { font-size: 14px; line-height: 1.25; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nc-strip-sub { font-size: 13px; line-height: 1.25; color: var(--nc-strip-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nc-strip-more { flex: none; width: 48px; height: 48px; border: 1px solid var(--rule); border-radius: 50%; background: var(--card); color: var(--fg); font: inherit; font-weight: 800; cursor: pointer; }
.nc-strip-chip[hidden], .nc-strip-sub[hidden], .nc-strip-more[hidden] { display: none; }
.nc-strip[data-tone=warning] .nc-strip-chip { background: var(--nc-warning-chip); }
.nc-strip[data-tone=invalid] { border-top-color: var(--nc-invalid); }
.nc-strip[data-tone=invalid] .nc-strip-chip { background: var(--nc-invalid-chip); }
.nc-strip[data-tone=invalid] .nc-strip-text { color: var(--nc-invalid); }
.nc-strip.nc-shake { animation-timing-function: cubic-bezier(.61,1,.88,1); }
@media (prefers-color-scheme:dark) { .nc-strip:not([data-tone=invalid]) { border-top-color: var(--fam-bright); } }
.controls { order: 2; display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; height: 48px; margin-top: 8px; }
.pf-btn { min-height: 48px; padding: 0 10px; white-space: nowrap; border: 1px solid var(--rule); border-radius: 8px; background: var(--card); color: var(--fg); font: inherit; font-size: .9rem; cursor: pointer; }
.pf-btn:hover, .pf-btn:focus-visible { border-color: var(--accent); }
.pf-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.pf-best { margin-left: auto; white-space: nowrap; font-weight: 600; font-variant-numeric: tabular-nums; }
.pitch { order: 4; margin: 16px 0 0; color: var(--muted); }
.ad-slot { background: transparent; }
.ad-slot[data-reserved] { border-radius: 18px; border: 1px solid var(--rule); background: radial-gradient(#8883 1px, #0000 1.6px) 0 0 / 16px 16px, color-mix(in srgb, var(--card) 80%, #0000); }
.ad-below { order: 3; width: 336px; max-width: 100%; height: 280px; margin: 16px auto 0; }
.ad-end { order: 9; width: 336px; max-width: 100%; height: 280px; margin: 24px auto 0; }
.content { order: 5; }
.content section { margin-top: 28px; }
.content h2 { font-size: 1.2rem; margin: 0 0 8px; }
.content table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.content th, .content td { border: 1px solid var(--rule); padding: 6px 10px; text-align: left; }
.content details { border-bottom: 1px solid var(--rule); padding: 8px 0; }
.content summary { cursor: pointer; font-weight: 600; }
.meta { color: var(--muted); font-size: .9rem; }
.rail { display: none; }
.promo[hidden] { display: none; }
.column > .content { width: 100%; }

.pf-overlay.setup { justify-content: flex-start; gap: 6px; padding: 10px 12px; overflow-y: auto; }
.pf-overlay.setup h2 { font-size: 1.15rem; }
.pf-overlay.setup .row { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: .92rem; }
.pf-overlay.setup .pf-btn { min-height: 48px; min-width: 48px; padding: 0 12px; }
.pf-overlay.setup label { font-size: .92rem; min-height: 48px; display: flex; align-items: center; gap: 6px; }
.pf-overlay.setup .dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
.pf-overlay.setup .row span:nth-child(2) { min-width: 56px; text-align: left; }

.pf-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px; text-align: center; background: color-mix(in srgb, var(--bg) 82%, transparent); }
.pf-overlay[hidden] { display: none; }
.pf-overlay h2 { margin: 0; font-size: 1.4rem; }
.pf-overlay p { margin: 0; color: var(--muted); }

@media (min-width: 1360px) {
  :root { --gutter: 20px; }
  .game-layout { display: grid; grid-template-columns: 300px 720px 300px; gap: 20px; justify-content: center; align-items: start; max-width: none; padding: 0; }
  .rail { display: block; align-self: stretch; }
  .rail .ad-slot { position: sticky; top: 16px; width: 300px; height: 600px; }
  .ad-below, .ad-end { display: none; }
  .column > h1 { font-size: 1.6rem; margin: 16px 0 4px; }
  .pitch { order: 0; margin-top: 0; margin-bottom: 12px; }

  .column > h1, .pitch, .stage, .controls { margin-inline: 32px; }
  .nc-strip { margin-inline: 40px; }
  .stage { height: clamp(320px, calc(100vh - 210px), 600px); height: clamp(320px, calc(100svh - 210px), 600px); }
}

.rows2 .controls { height: auto; min-height: 102px; flex-wrap: wrap; align-content: flex-start; }
.rows2 .stage { height: clamp(280px, calc(100vh - 226px), 600px); height: clamp(280px, calc(100svh - 226px), 600px); }

@media (min-width: 1360px) { .rows2.bar2 .controls { height: 102px; min-height: 102px; } .rows2.bar2 .stage { height: clamp(320px, calc(100vh - 262px), 600px); height: clamp(320px, calc(100svh - 262px), 600px); } }
@media (min-width: 1360px) { .rows2 .controls { height: 48px; min-height: 48px; } .rows2 .stage { height: clamp(320px, calc(100vh - 210px), 600px); height: clamp(320px, calc(100svh - 210px), 600px); } }

.pf-overlay.solid { background: var(--bg); }

.pf-overlay.rules p { font-size: .85rem; line-height: 1.35; text-align: left; color: var(--fg); }

.chess-moves { order: 2; counter-reset: mv; list-style: none; margin: 10px 0 0; padding: 6px 10px; height: 78px; overflow-y: auto; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 2px 16px; background: var(--card); border: 1px solid var(--rule); border-radius: 8px; font-size: .88rem; line-height: 1.45; font-variant-numeric: tabular-nums; }
.chess-moves li { counter-increment: mv; white-space: nowrap; }
.chess-moves li::before { content: counter(mv) "."; color: var(--muted); margin-right: 5px; }

.nc-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border: 1px solid var(--rule); border-radius: 999px; background: var(--card); color: var(--fg);
  font: inherit; font-size: .95rem; font-weight: 700; white-space: nowrap; cursor: pointer; text-decoration: none; box-shadow: 0 2px 0 rgba(0,0,0,.18);
  transition: transform var(--nc-fast) var(--nc-pop); }
.nc-btn:hover, .nc-btn:focus-visible { border-color: var(--fam-base); }
.nc-btn:active { transform: scale(.96); }
.nc-btn:focus-visible, .nc-chip:focus-visible { outline: 3px solid var(--fam-bright); outline-offset: 2px; }
.nc-primary { background: var(--fam-bright); border-color: var(--fam-bright); color: var(--fam-ink); box-shadow: 0 3px 0 color-mix(in srgb, var(--fam-deep) 70%, transparent); }
.nc-ibtn { padding: 0 12px; min-height: 48px; font-size: .88rem; }
.nc-ico { flex: none; }
.nc-chip { display: inline-flex; align-items: center; min-height: 48px; padding: 0 16px; border: 1px solid var(--rule); border-radius: 999px; background: var(--card); color: var(--fg); font: inherit; font-size: .92rem; font-weight: 700; cursor: pointer; transition: transform var(--nc-fast) var(--nc-pop); }
.nc-chip:active { transform: scale(.96); }
.nc-opt[aria-checked="true"], .nc-chip[aria-pressed="true"] { background: var(--fam-deep); border-color: var(--fam-bright); color: #fff; box-shadow: inset 0 0 0 1px var(--fam-bright); }
.nc-stat { padding: 0 11px; min-height: 36px; margin-left: auto; cursor: default; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.nc-bar { gap: 6px; }
.nc-bar .nc-ibtn { position: relative; flex: none; flex-direction: column; gap: 2px; min-width: 48px; padding: 3px 5px; border-radius: 14px; }
.nc-bar .nc-lbl { font-size: 13px; line-height: 1; font-weight: 800; white-space: nowrap; }
.nc-bar :is([data-act=sound],[data-act=fullscreen]) .nc-lbl { font-size: 0; }
.nc-bar :is([data-act=sound],[data-act=fullscreen]) .nc-lbl::after { content: "Sound"; font-size: 13px; }
.nc-bar [data-act=fullscreen] .nc-lbl::after { content: "Full"; }
@media (min-width: 560px) { .nc-bar { gap: 8px; } .nc-bar .nc-ibtn { flex-direction: row; gap: 8px; padding: 0 12px; border-radius: 999px; } .nc-bar :is([data-act=sound],[data-act=fullscreen]) .nc-lbl { font-size: inherit; } .nc-bar .nc-lbl::after { content: none !important; } }
.nc-status { display: flex; align-items: center; gap: 10px; margin: 8px 0 0; font-size: 1rem; line-height: 1.35; font-weight: 700; min-height: 1.35em; }
.nc-dot { display: inline-block; flex: none; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--fg); }
.nc-dot[hidden] { display: none; }
.stage > .nc-status { position: absolute; left: 12px; top: 8px; margin: 0; z-index: 1; pointer-events: none; padding: 4px 12px 4px 8px; border-radius: 999px; background: color-mix(in srgb, var(--card) 88%, transparent); }
.nc-sr, .nc-banner + .nc-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.nc-cover { padding: 0; overflow: hidden; background: linear-gradient(160deg, var(--fam-base), var(--fam-deep)); }
.nc-cover-art { position: absolute; inset: 0; opacity: .5; }
.nc-cover-art svg { width: 100%; height: 100%; }
.nc-cover-panel { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; width: min(92%, 420px); max-height: 94%; overflow-y: auto; padding: 16px; border-radius: 20px; background: color-mix(in srgb, var(--card) 94%, transparent); border: 2px solid var(--fam-trim); box-shadow: 0 14px 30px -10px var(--nc-shadow); }
.nc-cover-panel h2 { margin: 0; font-size: 1.5rem; font-weight: 800; letter-spacing: -.01em; }
.nc-sub { margin: 0; color: var(--muted); font-size: .95rem; }
.nc-seg { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; }
.nc-seg-lbl { flex: 0 0 100%; text-align: center; font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.nc-go { min-width: 160px; margin-top: 4px; }
.nc-confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.nc-result { inset: auto 8px 8px 8px; max-height: calc(45% - 8px); display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; gap: 0; padding: 0; overflow: visible; background: none; }
.nc-result::before { content: ""; position: absolute; left: -8px; right: -8px; bottom: 100%; height: 40px; background: linear-gradient(to top, rgba(0,0,0,.28), transparent); pointer-events: none; }
.nc-result[data-motion=live]:not([data-docked]) { animation: nc-dock 300ms cubic-bezier(.2,.8,.2,1) both; }
.nc-result-card { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 4px; width: 100%; max-height: 100%; padding: 8px 10px 8px; border-radius: 22px; background: linear-gradient(160deg, var(--fam-mid), var(--fam-deep)); border: 2px solid var(--fam-trim); box-shadow: 0 18px 34px -10px rgba(0,0,0,.6);
  min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--fam-trim) transparent;
  background: linear-gradient(to top, var(--fam-deep) 40%, transparent) center bottom / 100% 26px no-repeat local, radial-gradient(farthest-side at 50% 100%, rgba(0,0,0,.55), transparent) center bottom / 100% 14px no-repeat scroll, linear-gradient(160deg, var(--fam-mid), var(--fam-deep)); }
.nc-result-card > * { flex-shrink: 0; }
.nc-result.nc-peek::before, .nc-result.nc-peek .nc-result-card { display: none; }
.nc-result-back { align-self: flex-end; min-height: 48px; padding: 0 18px; box-shadow: 0 8px 18px -8px rgba(0,0,0,.6); }
.nc-result-back[hidden] { display: none; }
.stage .nc-lifted { transition: transform 300ms ease-out; }
.nc-result[data-kind=lose] .nc-result-card { background: linear-gradient(160deg, color-mix(in srgb, var(--fam-deep) 55%, #454b62), color-mix(in srgb, var(--fam-deep) 55%, #22263a)); border-color: color-mix(in srgb, var(--fam-base) 40%, #8e94ad); }
.nc-result[data-kind=draw] .nc-result-card { background: linear-gradient(160deg, color-mix(in srgb, var(--fam-deep) 70%, #454b62), color-mix(in srgb, var(--fam-deep) 40%, #22263a)); }
/* rd-round4: the burst (halo; rays on a win) vs the calm settled card */
.nc-result-card { isolation: isolate; }
.nc-result-card::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity 400ms ease-out; --r: color-mix(in srgb, var(--fam-trim) 50%, #0000); background: repeating-conic-gradient(from 4deg at 50% 20%, var(--r) 0 7deg, #0000 7deg 18deg); mask-image: radial-gradient(circle at 50% 20%, #000 14%, #0000 64%); }
[data-moment=burst] .nc-result-card::after { opacity: 1; }
.nc-result:not([data-kind=win]) .nc-result-card::after { --r: #fff3; }
[data-moment=burst] .nc-result-card { --h: var(--fam-bright); box-shadow: 0 0 0 4px var(--h), 0 0 40px 10px color-mix(in srgb, var(--h) 60%, #0000), 0 18px 34px -10px #0009; }
[data-moment=burst] .nc-result:not([data-kind=win]) .nc-result-card { --h: color-mix(in srgb, var(--fam-base) 55%, #c4c8d8); }
.nc-confetti[data-fx=fade] { opacity: 0; transition: opacity 400ms ease-out; }
.nc-banner { width: 100%; display: flex; justify-content: center; transform-origin: 50% 60%; animation: nc-banner-in var(--nc-grand) var(--nc-pop) both; }
.nc-banner-art { display: block; width: auto; max-width: 100%; height: 32px; }
.nc-result-line, .pf-overlay.nc-result .nc-result-line { margin: 0; color: #fff; font-size: .95rem; line-height: 1.25; font-weight: 700; text-align: center; text-shadow: 0 1px 0 rgba(0,0,0,.4); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nc-stats { display: flex; gap: 6px; }
.nc-stats[hidden] { display: none; }
.nc-stat-tile { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; padding: 2px 4px 4px; border-radius: 12px; background: rgba(0,0,0,.24); color: #fff; }
.nc-stat-tile b { font-size: 1.1rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.nc-stat-tile span { font-size: 14px; line-height: 1.05; font-weight: 700; letter-spacing: .01em; text-align: center; max-width: 100%; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nc-stat-tile.nc-accent b { color: var(--fam-trim); }
.nc-stat-bar { display: block; width: 100%; height: 4px; margin: 1px 0 2px; border-radius: 2px; background: rgba(255,255,255,.22); overflow: hidden; }
.nc-stat-bar > i { display: block; height: 100%; background: var(--fam-trim); transform-origin: left center; animation: nc-bar 600ms cubic-bezier(.2,.8,.2,1) 200ms both; }
.nc-stat-tile b { animation: nc-roll 400ms cubic-bezier(.2,.8,.2,1) 120ms both; }
@keyframes nc-bar { from { transform: scaleX(0); } }
@keyframes nc-roll { from { opacity: 0; transform: translateY(8px); } }
.stage .nc-result { z-index: 2; }

.stage { container-type: size; }
@container (max-height: 460px) {
  .nc-banner-art { height: 30px; }
  .nc-result-line, .pf-overlay.nc-result .nc-result-line { font-size: 14px; line-height: 1.15; -webkit-line-clamp: 3; }
  .nc-result-card { gap: 2px; padding: 4px 8px; }
  .nc-stat-tile b { font-size: 1.05rem; line-height: 1; }
  .nc-stats { gap: 4px; }
  .nc-stat-tile { padding: 1px 4px 3px; }
  .nc-stat-tile span { font-size: 14px; letter-spacing: 0; }
  .nc-stat-bar { margin: 0 0 1px; height: 3px; }
}
.nc-stars svg { width: 44px; height: 44px; }
@container (max-height: 460px) { .nc-stars svg { width: 22px; height: 22px; } }
@container (max-height: 380px) {
  .nc-banner-art { height: 24px; }
}
.nc-result-actions { display: flex; gap: 8px; }
.nc-result-actions .nc-btn { flex: 1 1 0; min-width: 0; min-height: 48px; padding: 0 10px; white-space: normal; line-height: 1.1; text-align: center; }
.nc-result-actions .nc-primary { flex-grow: 1.25; }
.nc-result-actions .nc-btn:focus-visible { outline-offset: -5px; }
.nc-btn[hidden], .nc-chip[hidden] { display: none; }
.nc-ghost { background: transparent; border-color: rgba(255,255,255,.65); color: #fff; box-shadow: none; }
.nc-result[data-motion=static] .nc-banner { animation: none; }
.nc-pop { animation: nc-pop var(--nc-base) var(--nc-out); }
.nc-shake { animation: nc-shake 180ms linear; }
@keyframes nc-dock { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes nc-banner-in { 0% { transform: scale(.55); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
@keyframes nc-pop { 0% { transform: scale(1); } 50% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes nc-shake { 0%, 100% { transform: translateX(0); } 17% { transform: translateX(-4px); } 33% { transform: translateX(4px); } 50% { transform: translateX(-3px); } 67% { transform: translateX(3px); } 83% { transform: translateX(-1px); } }

[data-family=cards] .stage { --nc-felt: repeating-linear-gradient(91deg, rgba(0,0,0,.09) 0 2px, transparent 2px 9px, rgba(255,214,160,.05) 9px 10px, transparent 10px 17px) padding-box, radial-gradient(ellipse at 50% 40%, #5A3A1F, #3F2814 70%, #2E1D0E) padding-box; border: 6px solid transparent; border-radius: 12px;
  background: var(--nc-felt),
    repeating-linear-gradient(92deg, rgba(0,0,0,.07) 0 2px, transparent 2px 7px, rgba(255,220,170,.05) 7px 8px, transparent 8px 13px) border-box,
    linear-gradient(180deg, #C99561 0%, #A8743F 35%, #875A2E 75%, #6A4422 100%) border-box;
  box-shadow: inset 0 0 0 1.5px rgba(226,176,74,.7), 0 10px 22px -12px var(--nc-shadow); }
[data-family=cards] .stage canvas:not(.nc-confetti) { box-shadow: 0 0 0 1.5px rgba(226,176,74,.75), 0 6px 18px -4px rgba(0,0,0,.55); }
@media (prefers-color-scheme:dark) { [data-family=cards] .stage { background: var(--nc-felt),
    repeating-linear-gradient(92deg, rgba(0,0,0,.07) 0 2px, transparent 2px 7px, rgba(255,220,170,.05) 7px 8px, transparent 8px 13px) border-box,
    linear-gradient(180deg, #B07A45 0%, #8A5A2B 35%, #6A4220 75%, #4E2F15 100%) border-box; } }

.nc-glint { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(ellipse 70% 45% at 50% 22%, rgba(226,176,74,.5), rgba(226,176,74,0) 70%); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .card:hover, .card:active, .nc-btn:active, .nc-chip:active, .mood:active { transform: none; }
  .stage .nc-confetti { display: none; }
  .nc-strip, .nc-result, .nc-ring { animation: none !important; transition: none !important; }
}

/* ---- lobby mood chips (contrast-guarded) ---- */
:root { --mood-fun-a:#8A3A05; --mood-fun-b:#C2410C; --mood-think-a:#2E2E7A; --mood-think-b:#5A5BD6; --mood-table-a:#0E3D27; --mood-table-b:#1E7A4C; --mood-word-a:#3E2566; --mood-word-b:#7A4FBF; --mood-two-a:#7C1F1A; --mood-two-b:#C23A2A; }

.pf-btn { border-radius: 999px; font-weight: 600; box-shadow: 0 2px 0 rgba(0,0,0,.18); transition: transform var(--nc-fast) var(--nc-pop); }
.pf-btn:hover, .pf-btn:focus-visible { border-color: var(--fam-base); }
.pf-btn:active { transform: scale(.96); }
.pf-primary { background: var(--fam-bright); border-color: var(--fam-bright); color: var(--fam-ink); box-shadow: 0 3px 0 color-mix(in srgb, var(--fam-deep) 70%, transparent); }
.pf-overlay.setup .pf-btn.sel, .pf-btn[aria-pressed="true"].sel { background: var(--fam-deep); border-color: var(--fam-bright); color: #fff; box-shadow: inset 0 0 0 1px var(--fam-bright); }
.pf-best { padding: 0 8px; border-radius: 999px; background: color-mix(in srgb, var(--card) 80%, transparent); }
.pf-overlay.setup { isolation: isolate; background: linear-gradient(180deg, color-mix(in srgb, var(--fam-bright) 24%, var(--bg)), var(--bg) 75%); box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--fam-trim) 65%, transparent); border-radius: var(--radius); }
.pf-overlay.setup::before { content: ""; position: absolute; right: 0; bottom: 0; width: min(64%, 320px); aspect-ratio: 5 / 3; z-index: -1; background: var(--art, none) center / cover no-repeat; opacity: .2; pointer-events: none; -webkit-mask-image: radial-gradient(closest-side, #000 55%, transparent); mask-image: radial-gradient(closest-side, #000 55%, transparent); }
.pf-overlay.setup h2 { font-weight: 800; letter-spacing: -.01em; }

.pf-overlay.setup.cover { flex-flow: column nowrap; justify-content: safe center; gap: 8px; padding: 10px 12px 12px; box-shadow: none; background: var(--bg); }
.pf-overlay.setup.cover::before { position: relative; inset: auto; z-index: auto; order: -1; flex: 1 1 0; align-self: stretch; width: auto; min-height: 84px; max-height: calc((100cqw - 24px) * .6); aspect-ratio: auto; margin: 0 0 2px; opacity: 1; -webkit-mask-image: none; mask-image: none; background: var(--art, none) center / contain no-repeat; filter: drop-shadow(0 8px 14px var(--nc-shadow)); }
.pf-overlay.setup.cover { container-type: inline-size; }
.pf-overlay.setup.cover > h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.pf-overlay.setup.cover > p { color: var(--fg); font-size: .9rem; line-height: 1.3; max-width: 420px; }
.pf-overlay.setup.cover .row { width: min(100%, 440px); flex-wrap: nowrap !important; gap: 6px; }
.pf-overlay.setup.cover .row > .pf-btn { flex: 1 1 0; min-width: 0; min-height: 48px; padding: 0 8px; white-space: normal; line-height: 1.15; }
.pf-overlay.setup.cover .row > span:first-child { flex: none; min-width: 0; font-weight: 700; }
.pf-overlay.setup.cover .row:has(> [aria-pressed]) { padding: 2px; gap: 2px; border-radius: 16px; background: var(--card); border: 1px solid var(--rule); }
.pf-overlay.setup.cover .row:has(> [aria-pressed]) > .pf-btn { border-color: transparent; background: transparent; box-shadow: none; border-radius: 13px; min-height: 48px; }
.pf-overlay.setup.cover .row:has(> [aria-pressed]) > .pf-btn.sel { background: var(--fam-deep); color: #fff; box-shadow: inset 0 0 0 1px var(--fam-bright), 0 2px 0 rgba(0,0,0,.2); }
.pf-overlay.setup.cover .row > .pf-primary { flex-grow: 1.6; font-size: 1.05rem; font-weight: 800; }
.pf-overlay.setup.cover label { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--rule); width: min(100%, 440px); }
.pf-overlay.setup.cover label input { width: 22px; height: 22px; accent-color: var(--fam-base); }
.pf-overlay.setup.cover .opts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; width: min(100%, 440px); }
.pf-overlay.setup.cover .opts label { width: auto; justify-content: flex-start; gap: 8px; padding: 2px 8px; font-size: 13px; line-height: 1.15; text-align: left; }
.pf-overlay.setup.cover .seat { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; column-gap: 5px; font-size: 13px; }
.pf-overlay.setup.cover .seat b { flex-basis: 100%; font-size: .9rem; }
.pf-overlay.setup.cover .row:has(> [aria-pressed]) > .pf-btn { padding: 0 3px; }
.pf-overlay.setup.cover .row:has(> :nth-child(5)) > .pf-btn { font-size: 13px; }

.nc-backdrop { position: absolute; inset: 0; pointer-events: none; background: center / 100% 100% no-repeat; border-radius: inherit; }
.nc-has-backdrop > canvas:not(.nc-confetti) { position: relative; }
