/* PickPlay — light, game-like and mobile first. System fonts only. */
:root {
  color-scheme: light;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --bg: #f4f7f5;
  --surface: #ffffff;
  --surface-2: #eef3f0;
  --surface-3: #e3ebe6;
  --text: #15291f;
  --muted: #56685e;
  --border: #dce5df;
  --border-strong: #c3d1c9;
  --brand: #236b50;
  --accent: #236b50;
  --accent-hover: #1b5942;
  --accent-shadow: #174a37;
  --accent-ink: #ffffff;
  --accent-soft: #dff2e8;
  --accent-strong: #1b5942;
  --focus: #f08c00;
  --good: #237533;
  --good-soft: #d3f9d8;
  --bad: #c92a2a;
  --bad-soft: #ffe8e8;
  --warn: #a35a00;
  --rail: #7f9387;
  --shadow-sm: 0 1px 2px rgba(18, 44, 32, .06);
  --shadow: 0 10px 28px rgba(18, 44, 32, .10);
  --t-mint: #d8f2e5; --t-violet: #ebe3fb; --t-blue: #dde9fb; --t-orange: #fde6d4; --t-sky: #dcecff;
  --t-red: #fde0e0; --t-yellow: #fff0c2; --t-lilac: #ece7f6; --t-green: #dff3e5; --t-indigo: #e3e6ff;
}
/* Each script gets its own system font first, so Han characters and kana use the right glyphs. */
:root:lang(ko) { --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Noto Sans CJK KR", system-ui, Roboto, "Noto Sans", sans-serif; }
:root:lang(ja) { --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, "Noto Sans JP", "Noto Sans CJK JP", system-ui, Roboto, "Noto Sans", sans-serif; }
:root:lang(zh-CN) { --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC", system-ui, Roboto, "Noto Sans", sans-serif; }
:root:lang(zh-TW) { --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Microsoft JhengHei UI", "Microsoft JhengHei", "Noto Sans TC", "Noto Sans CJK TC", system-ui, Roboto, "Noto Sans", sans-serif; }
:root:lang(hi) { --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Kohinoor Devanagari", "Nirmala UI", "Noto Sans Devanagari", system-ui, Roboto, "Noto Sans", sans-serif; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1814;
  --surface: #17231e;
  --surface-2: #1f2e27;
  --surface-3: #283a32;
  --text: #e8f2ec;
  --muted: #a3b6ab;
  --border: #2a3b33;
  --border-strong: #3c5148;
  --accent: #7fd8a8;
  --accent-hover: #9be4bd;
  --accent-shadow: #4e9a72;
  --accent-ink: #0e2419;
  --accent-soft: #1d3a2c;
  --accent-strong: #9be4bd;
  --good: #69db7c;
  --good-soft: #1f3d27;
  --bad: #ff8787;
  --bad-soft: #3d1f1f;
  --warn: #ffc078;
  --rail: #728b7f;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 10px 28px rgba(0, 0, 0, .35);
  --t-mint: #1c3a2d; --t-violet: #2e2645; --t-blue: #1f2f47; --t-orange: #43301f; --t-sky: #1c3048;
  --t-red: #432424; --t-yellow: #3f3517; --t-lilac: #2f2a3d; --t-green: #1f3a28; --t-indigo: #262b4d;
}
.tint-mint { --tint: var(--t-mint); } .tint-violet { --tint: var(--t-violet); } .tint-blue { --tint: var(--t-blue); }
.tint-orange { --tint: var(--t-orange); } .tint-sky { --tint: var(--t-sky); } .tint-red { --tint: var(--t-red); }
.tint-yellow { --tint: var(--t-yellow); } .tint-lilac { --tint: var(--t-lilac); } .tint-green { --tint: var(--t-green); } .tint-indigo { --tint: var(--t-indigo); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overflow-x: hidden; overflow-x: clip; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 16px; line-height: 1.5;
  overflow-x: hidden; overflow-x: clip; transition: opacity .12s ease-out;
}
html.i18n-pending body { opacity: 0; animation: pp-show 0s linear 1.6s forwards; }
@keyframes pp-show { to { opacity: 1; } }
:lang(hi) body, :lang(hi) .btn, :lang(hi) input, :lang(hi) textarea { line-height: 1.7; }
:lang(ko) :is(h1, h2, h3, p, .card-title, .card-desc, .btn, .field-label, .switch-label) { word-break: keep-all; overflow-wrap: anywhere; }
:lang(ja), :lang(zh-CN), :lang(zh-TW) { line-break: strict; }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -.02em; }
:lang(hi) :is(h1, h2, h3) { line-height: 1.45; letter-spacing: 0; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button, a, label, select, summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
img, svg, canvas { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 12px; top: -80px; z-index: 50; padding: 10px 14px; border-radius: 10px; background: var(--surface); color: var(--text); font-weight: 700; box-shadow: var(--shadow); }
.skip-link:focus { top: 12px; }
.skip-link:not(:focus) { width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.step-title:focus { outline: none; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-fill { fill: currentColor; stroke: none; }

/* ---------- Header & footer ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-inner { max-width: 1120px; margin: 0 auto; min-height: 60px; padding: 8px 16px; display: flex; align-items: center; gap: 12px; }
.brand { display: inline-flex; flex-shrink: 0; align-items: center; gap: 8px; min-height: 44px; color: var(--text); text-decoration: none; font-weight: 900; font-size: 21px; letter-spacing: -.035em; white-space: nowrap; }
.brand-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--brand); color: #fff; font-size: 19px; font-weight: 900; letter-spacing: 0; transform: rotate(-8deg); flex: none; }
.header-nav { display: none; }
.header-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; font-weight: 700; color: var(--muted); text-decoration: none; }
.header-nav a:hover { color: var(--text); }
.header-tools { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; min-width: 0; }
.lang-picker { min-width: 0; }
.icon-button { flex-shrink: 0; }
.lang-picker { position: relative; display: flex; align-items: center; }
.lang-picker select {
  -webkit-appearance: none; appearance: none; min-height: 44px; width: 11.5rem; max-width: 100%; padding: 8px 30px 8px 36px;
  border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 16px; font-weight: 650; text-overflow: ellipsis; cursor: pointer;
}
.lang-picker select:hover, .icon-button:hover { border-color: var(--border-strong); }
.lang-picker .icon { position: absolute; pointer-events: none; color: var(--muted); }
.lang-picker .icon:first-child { inset-inline-start: 11px; width: 18px; height: 18px; }
.lang-picker .chevron { inset-inline-end: 8px; width: 16px; height: 16px; }
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); padding: 0; }
.theme-toggle .icon { display: none; }
[data-theme-choice="system"] .theme-auto, [data-theme-choice="light"] .theme-light, [data-theme-choice="dark"] .theme-dark { display: block; }
html:not([data-theme-choice]) .theme-auto { display: block; }

.site-footer { max-width: 1120px; margin: 48px auto 0; padding: 24px 16px 32px; border-top: 1px solid var(--border); font-size: 14px; color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.footer-brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 650; }
.footer-brand .brand-mark { width: 26px; height: 26px; font-size: 15px; border-radius: 8px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--text); font-weight: 650; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.footer-bottom { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; font-size: 13px; }
.link-button { min-height: 44px; padding: 0; border: 0; background: none; color: var(--muted); text-decoration: underline; font-size: 13px; }
.link-button:hover { color: var(--text); }
.footer-status { min-height: 1.2em; margin-top: 4px; font-size: 13px; color: var(--accent-strong); }

/* ---------- Layout primitives ---------- */
.page { max-width: 1120px; margin: 0 auto; padding: 18px 16px 0; }
.panel { min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 18px; box-shadow: var(--shadow-sm); }
.section-title { font-size: 18px; font-weight: 800; margin: 28px 0 12px; }
.hint { font-size: 13px; line-height: 1.5; color: var(--muted); }
.centered { text-align: center; justify-content: center; }
.mini-title { font-size: 14px; font-weight: 800; color: var(--muted); margin: 0; }
.mini-title:focus { outline: none; }

/* ---------- Buttons & controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; max-width: 100%;
  padding: 10px 18px; border-radius: 14px; border: 1.5px solid transparent; font-size: 15px; font-weight: 750; line-height: 1.25;
  text-align: center; text-decoration: none; overflow-wrap: anywhere; transition: background-color .15s, border-color .15s, transform .08s, box-shadow .15s;
}
.btn .icon { width: 20px; height: 20px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 3px 0 var(--accent-shadow); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-primary:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--accent-shadow); }
.btn-secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text); box-shadow: 0 2px 0 var(--border); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); }
.btn-soft { background: var(--accent-soft); color: var(--accent-strong); }
.btn-soft:hover:not(:disabled) { filter: brightness(.97); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn-small { min-height: 44px; padding: 8px 12px; font-size: 14px; border-radius: 12px; gap: 6px; }
.btn-small .icon { width: 18px; height: 18px; }
.btn-large { min-height: 56px; padding: 14px 26px; font-size: 17px; border-radius: 16px; }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; }
.stage-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; width: 100%; }
.stage-actions .btn-large { flex: 1 1 220px; max-width: 360px; }
.secondary-actions .btn { flex: 0 1 auto; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; text-align: start; }
.field-label { font-size: 14px; font-weight: 700; color: var(--text); }
.text-input, .entries-text, .number-input, .stepper-input {
  width: 100%; min-height: 48px; padding: 10px 12px; border: 1.5px solid var(--border-strong); border-radius: 12px;
  background: var(--surface); color: var(--text); font-size: 16px; line-height: 1.45;
}
.text-input:focus, .entries-text:focus, .number-input:focus { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--accent); }
[aria-invalid="true"] { border-color: var(--bad) !important; background: var(--bad-soft) !important; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
::placeholder { color: var(--muted); opacity: .8; }

.stepper { display: inline-flex; align-items: stretch; width: max-content; max-width: 100%; border: 1.5px solid var(--border-strong); border-radius: 14px; overflow: hidden; background: var(--surface); }
.stepper-btn { display: grid; place-items: center; width: 48px; min-height: 48px; border: 0; background: var(--surface-2); color: var(--text); padding: 0; }
.stepper-btn:hover:not(:disabled) { background: var(--surface-3); }
.stepper-btn:disabled { opacity: .4; cursor: not-allowed; }
.stepper-input { width: 4.2em; border: 0; border-radius: 0; text-align: center; font-size: 18px; font-weight: 800; padding: 6px 4px; }
.stepper-input:focus { outline: none; background: var(--surface-2); }
.stepper:focus-within { outline: 3px solid var(--focus); outline-offset: 1px; }

.segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); max-width: 100%; }
.segment { position: relative; display: flex; }
.segment input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.segment span { display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 6px 12px; border-radius: 10px; font-size: 14px; font-weight: 750; color: var(--muted); text-align: center; line-height: 1.2; }
.segment input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
:root[data-theme="dark"] .segment input:checked + span { background: var(--surface-3); }
.segment input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 1px; }
.segment input:disabled { cursor: not-allowed; }
.segment input:disabled + span { opacity: .55; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; text-align: start; font-size: 14px; font-weight: 650; }
.switch-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; flex: none; width: 44px; height: 26px; border-radius: 999px; background: var(--border-strong); transition: background-color .15s; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s; }
.switch-input:checked + .switch-track { background: var(--accent); }
.switch-input:checked + .switch-track::after { transform: translateX(18px); }
.switch-input:focus-visible + .switch-track { outline: 3px solid var(--focus); outline-offset: 2px; }
.switch-input:disabled ~ * { opacity: .55; }

.chip-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-button { min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: 14px; font-weight: 750; }
.chip-button:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.chip-button:disabled { opacity: .5; cursor: not-allowed; }
.chip-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.chip-list li { max-width: 100%; padding: 4px 12px; border-radius: 999px; background: var(--surface-2); font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.chip-list li:first-child { background: var(--accent-soft); font-weight: 800; }
.option-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: center; gap: 12px 20px; width: 100%; }
.preset-row { display: flex; flex-direction: column; gap: 8px; width: 100%; text-align: start; }

.message { width: 100%; margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--text); font-size: 14px; font-weight: 650; text-align: start; overflow-wrap: anywhere; }
.message[data-tone="error"] { background: var(--bad-soft); color: var(--text); border-inline-start: 4px solid var(--bad); }

/* ---------- Home ---------- */
.home-hero { padding: 6px 0 4px; }
.home-hero h1 { font-size: clamp(30px, 7vw, 48px); font-weight: 900; letter-spacing: -.035em; margin-bottom: 8px; }
.lead { max-width: 640px; font-size: clamp(15px, 2.2vw, 18px); color: var(--muted); }
.featured-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.compact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.game-card {
  position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 12px;
  border-radius: 20px; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none;
  box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s, border-color .15s;
}
.game-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.game-card:active { transform: translateY(0); }
.card-art { display: grid; place-items: center; border-radius: 15px; background: var(--tint); aspect-ratio: 16 / 10; }
.card-art svg { width: min(58%, 96px); height: auto; }
.card-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.card-title { font-size: 17px; font-weight: 850; line-height: 1.25; overflow-wrap: anywhere; }
.card-desc { font-size: 14px; line-height: 1.4; color: var(--muted); overflow-wrap: anywhere; }
.card-play { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 800; color: var(--accent-strong); }
.card-play .icon { width: 18px; height: 18px; transition: transform .15s; }
.game-card:hover .card-play .icon { transform: translateX(3px); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .card-art svg, .mini-art svg { transition: transform .35s cubic-bezier(.3,1.4,.5,1); }
  .game-card:hover .card-art svg, .game-card:focus-visible .card-art svg, .mini-card:hover .mini-art svg { transform: scale(1.08) rotate(-4deg); }
  a[href="/wheel/"]:hover .card-art svg, a[href="/wheel/"]:hover .mini-art svg { transform: rotate(60deg); transition-duration: .7s; }
  a[href="/coin-flip/"]:hover .card-art svg, a[href="/coin-flip/"]:hover .mini-art svg { transform: rotateY(180deg); transition-duration: .5s; }
  a[href="/dice/"]:hover .card-art svg, a[href="/dice/"]:hover .mini-art svg { transform: rotate(18deg) translateY(-3px); }
}
.game-card.compact .card-art { width: 48px; height: 48px; aspect-ratio: auto; border-radius: 14px; flex: none; }
.game-card.compact .card-art svg { width: 36px; }
.game-card.compact .card-title { font-size: 16px; }
.game-card.compact .card-play { margin-top: 6px; }
.crew-section { display: grid; gap: 18px; margin-top: 36px; padding: 20px; border-radius: 24px; background: var(--surface); border: 1px solid var(--border); }
.crew-art { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--t-blue); }
.crew-art svg { width: 40px; }
.crew-copy h2 { font-size: clamp(22px, 4.5vw, 30px); font-weight: 850; margin: 14px 0 8px; }
.crew-copy p { color: var(--muted); }
.crew-use { margin-top: 16px !important; font-weight: 700; color: var(--text) !important; font-size: 14px; }
.chip-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip-link { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-weight: 750; font-size: 14px; text-decoration: none; }
.chip-link:hover { filter: brightness(.96); }
.crew-editor { display: flex; flex-direction: column; gap: 10px; box-shadow: none; background: var(--bg); }
.crew-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.saved-text { font-size: 14px; color: var(--muted); font-weight: 650; }

/* ---------- Game pages ---------- */
.crumbs { margin-bottom: 6px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--muted); font-size: 14px; font-weight: 750; text-decoration: none; }
.back-link:hover { color: var(--text); }
.back-link .icon { width: 18px; height: 18px; }
.game-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.game-art { display: grid; place-items: center; flex: none; width: 56px; height: 56px; border-radius: 16px; background: var(--tint); }
.game-art svg { width: 42px; }
.game-head h1 { font-size: clamp(25px, 5.5vw, 38px); font-weight: 900; }
.game-head p { margin-top: 2px; font-size: 15px; color: var(--muted); }
.game-head-text { min-width: 0; }
.game-head-tools { margin-inline-start: auto; display: flex; flex: none; gap: 6px; }
.motion-toggle { color: var(--muted); }
.motion-toggle[aria-pressed="true"] { color: var(--accent-strong); background: var(--accent-soft); border-color: var(--accent); }
.motion-toggle[aria-pressed="true"] .motion-stopped { display: none; }
.sound-toggle { margin-inline-start: auto; align-self: center; flex: none; color: var(--muted); }
.sound-toggle .sound-on, .sound-toggle[aria-pressed="true"] .sound-off { display: none; }
.sound-toggle[aria-pressed="true"] .sound-on { display: block; }
.sound-toggle[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }
.game-root { min-height: 380px; }
.game-layout { display: grid; gap: 14px; }
.layout-single { max-width: 720px; margin: 0 auto; }
.stage { position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.stage.is-busy { cursor: progress; }
.stage > .field { width: 100%; }
.result-hint { color: var(--muted); font-size: 15px; font-weight: 600; }
.result-kicker { display: block; font-size: 12px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
:lang(hi) .result-kicker, :lang(ko) .result-kicker, :lang(ja) .result-kicker, :lang(zh-CN) .result-kicker, :lang(zh-TW) .result-kicker { letter-spacing: .02em; font-size: 13px; }
.result-big { display: block; max-width: 100%; font-size: clamp(28px, 7vw, 46px); font-weight: 900; line-height: 1.15; color: var(--text); overflow-wrap: anywhere; }
.history { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; padding-top: 12px; border-top: 1px solid var(--border); }

.more-games { margin-top: 40px; }
.mini-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mini-card { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 10px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: 14px; font-weight: 750; line-height: 1.25; transition: border-color .15s, transform .15s; }
.mini-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.mini-art { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--tint); }
.mini-art svg { width: 30px; }
.mini-name { min-width: 0; overflow-wrap: anywhere; }
.how-to { max-width: 760px; margin-top: 36px; padding-top: 4px; }
.how-steps { counter-reset: step; list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.how-steps li { counter-increment: step; display: flex; gap: 12px; align-items: flex-start; }
.how-steps li::before { content: counter(step); display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); font-weight: 850; font-size: 14px; }
.how-to > p { color: var(--muted); line-height: 1.7; }

/* Entry list editor */
.entries { display: flex; flex-direction: column; gap: 10px; }
.entries-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.entries-label { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 850; }
.count-badge { display: inline-grid; place-items: center; min-width: 28px; height: 24px; padding: 0 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 850; }
.entries-body { display: flex; flex-direction: column; gap: 8px; }
.entries-text { min-height: 150px; resize: vertical; }
.entries-preview { display: none; margin: 0; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entries-toggle { display: none; }
.example-note { color: var(--accent-strong); font-weight: 650; }
.duplicate-note { border-inline-start: 3px solid var(--focus); padding-inline-start: 8px; }
.tool-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.saved-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 14px; background: var(--surface-2); }
.saved-info { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 650; color: var(--muted); }
.saved-info .icon { width: 18px; height: 18px; }
.saved-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* Wheel */
.motion-notice { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; margin: 0 0 20px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); font-size: 14px; }
.motion-notice > span { flex: 1 1 220px; }
.wheel-box { position: relative; width: min(100%, 470px); aspect-ratio: 1; margin: 10px auto 0; }
.wheel-frame { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; box-shadow: 0 12px 30px rgba(10, 40, 28, .18); }
.wheel-disc { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; }
.wheel-canvas { display: block; width: 100%; height: 100%; }
.is-spinning .wheel-disc { will-change: transform; }
.wheel-labels { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.wheel-label { transform-origin: 0 0; }
.wheel-label text { font-family: inherit; font-weight: 800; fill: #13241d; }
.wheel-label.is-winner text { font-weight: 950; }
.wheel-roster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; margin: 16px 0 0; padding: 12px 0 0; list-style: none; border-top: 1px solid var(--border); text-align: start; }
.wheel-roster li { display: flex; align-items: baseline; gap: 7px; padding: 5px 6px; min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.wheel-entry-number { flex: none; min-width: 22px; padding: 1px 3px; border-radius: 5px; background: var(--entry-color); color: #13241d; text-align: center; font-weight: 800; }
.wheel-roster .is-winner { border-radius: 8px; background: var(--accent-soft); font-weight: 850; }
.wheel-pointer { position: absolute; top: -12px; left: 50%; z-index: 2; width: 0; height: 0; margin-left: -18px; border-left: 18px solid transparent; border-right: 18px solid transparent; border-top: 36px solid #e8590c; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .3)); transform-origin: 50% 0; }
.wheel-pointer::before { content: ""; position: absolute; top: -42px; left: -9px; width: 18px; height: 18px; border-radius: 50%; background: #e8590c; border: 3px solid #fff; }
.wheel-box.is-win .wheel-frame { animation: wheel-win .65s ease-out; }
@keyframes wheel-win { 0% { box-shadow: 0 0 0 0 rgba(255, 200, 69, .85), 0 12px 30px rgba(10, 40, 28, .18); } 100% { box-shadow: 0 0 0 26px rgba(255, 200, 69, 0), 0 12px 30px rgba(10, 40, 28, .18); } }
.wheel-hub { position: absolute; left: 50%; top: 50%; z-index: 2; display: grid; place-items: center; width: 23%; height: 23%; min-width: 60px; min-height: 60px; padding: 0; border-radius: 50%; border: 5px solid #1f5c45; background: #fff; color: #1f5c45; font-size: clamp(13px, 3.4vw, 19px); font-weight: 950; letter-spacing: .04em; transform: translate(-50%, -50%); box-shadow: 0 4px 12px rgba(0, 0, 0, .2); transition: transform .12s; }
.wheel-hub:hover:not(:disabled) { transform: translate(-50%, -50%) scale(1.05); }
.wheel-hub:disabled { cursor: progress; }
.result-slot { position: relative; display: grid; place-items: center; width: 100%; min-height: 92px; }
.result-win { display: none; flex-direction: column; align-items: center; gap: 2px; max-width: 100%; padding: 10px 24px; border-radius: 18px; background: var(--accent-soft); }
.result-slot[data-state="win"] .result-win { display: flex; }
.result-slot[data-state="win"] .result-hint { display: none; }
.result-slot[data-state="spinning"] .result-hint { color: var(--text); font-weight: 750; }

/* Name picker */
.picker-board { position: relative; display: grid; gap: 10px; width: 100%; }
.picker-board[data-size="one"] { grid-template-columns: 1fr; }
.picker-board[data-size="few"] { grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.picker-board[data-size="many"] { grid-template-columns: repeat(auto-fill, minmax(min(100%, 130px), 1fr)); }
.slot { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 76px; padding: 12px; border-radius: 18px; background: var(--surface-2); border: 2px dashed var(--border-strong); font-size: clamp(20px, 5vw, 28px); font-weight: 850; line-height: 1.2; overflow-wrap: anywhere; min-width: 0; }
.picker-board[data-size="one"] .slot { min-height: 150px; font-size: clamp(32px, 9vw, 56px); }
.picker-board[data-state="rolling"] .slot:not(.locked) { border-style: solid; border-color: var(--border-strong); color: var(--muted); }
.slot.locked { background: var(--accent-soft); border: 2px solid var(--accent); color: var(--text); }
.slot-index { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 14px; font-weight: 850; }
.slot-name { min-width: 0; }
.slot { position: relative; --reel-h: var(--reel-height, 72px); }
.picker-board[data-size="one"] .slot { --reel-h: var(--reel-height, 140px); }
.picker-board:not([data-size="one"]) .slot { padding-inline-start: 46px; }
.picker-board:not([data-size="one"]) .slot-index { position: absolute; inset-inline-start: 10px; top: 50%; transform: translateY(-50%); z-index: 1; }
.picker-board[data-state="rolling"] .slot:not(.locked) { height: calc(var(--reel-h) + 4px); min-height: 0; overflow: hidden; }
.reel-window { position: absolute; inset: 0; overflow: hidden; -webkit-mask-image: linear-gradient(transparent, #000 26%, #000 74%, transparent); mask-image: linear-gradient(transparent, #000 26%, #000 74%, transparent); }
.picker-board:not([data-size="one"]) .reel-window { inset-inline-start: 46px; }
.reel { position: absolute; inset: 0 0 auto 0; will-change: transform; }
.reel-item { display: flex; align-items: center; justify-content: center; height: var(--reel-h); padding: 0 10px; white-space: normal; overflow-wrap: anywhere; line-height: 1.12; font-size: var(--reel-font, inherit); color: var(--muted); }
.reel-item:last-child { color: var(--text); }
.pick-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 8px; text-align: start; }
.pick-list li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: var(--accent-soft); font-weight: 750; overflow-wrap: anywhere; animation: deal .3s both; }
.pick-list .slot-index { width: 24px; height: 24px; font-size: 12px; }

/* Teams */
.team-shuffle { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; width: min(100%, 260px); margin: 16px auto; padding: 14px 24px; }
.team-shuffle-token { display: grid; place-items: center; flex: 0 0 52px; height: 48px; border-radius: 12px; background: var(--team); color: #fff; font-weight: 850; box-shadow: 0 3px 0 var(--border); }
.team-placeholder { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 0 6px; }
.placeholder-art { width: 120px; height: 56px; border-radius: 16px; background: repeating-linear-gradient(90deg, var(--surface-2) 0 52px, transparent 52px 68px); }
.per-team { align-self: center; font-weight: 700; }
.team-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 12px; width: 100%; text-align: start; }
.team-results:empty { display: none; }
.team-card { min-width: 0; overflow: hidden; border-radius: 18px; background: var(--surface); border: 1.5px solid var(--team); }
.team-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 10px 14px; background: var(--team); color: #fff; font-size: 17px; font-weight: 850; }
.team-size { font-size: 13px; font-weight: 700; white-space: nowrap; }
.team-card ul { list-style: none; margin: 0; padding: 10px 12px 12px; display: grid; gap: 6px; }
.team-card li { padding: 7px 10px; border-radius: 10px; background: var(--surface-2); font-weight: 650; overflow-wrap: anywhere; }
.deal .team-card li { animation: deal .32s both; }
@keyframes deal { from { opacity: 0; transform: translateY(8px) scale(.96); } }
.team-0 { --team: #237533; } .team-1 { --team: #1971c2; } .team-2 { --team: #c13e0b; } .team-3 { --team: #862e9c; }
.team-4 { --team: #c2255c; } .team-5 { --team: #0b7285; } .team-6 { --team: #8f5b00; } .team-7 { --team: #4263eb; }

/* Ladder */
.layout-ladder { max-width: 980px; margin: 0 auto; }
.ladder-setup, .ladder-play { display: flex; flex-direction: column; gap: 14px; }
.step-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; text-align: start; }
.step-badge { display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 900; }
.step-title { font-size: 18px; font-weight: 850; }
.ladder-lists { display: grid; gap: 16px; }
.ladder-lists .entries { padding: 0; border: 0; box-shadow: none; background: none; border-radius: 0; }
.ladder-lists .entries-text { min-height: 170px; }
.quick-fill { padding-top: 2px; }
.quick-fill-label { font-size: 13px; font-weight: 700; color: var(--muted); margin-inline-end: 2px; }
.ladder-match { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; font-size: 14px; font-weight: 700; background: var(--surface-2); }
.ladder-match[data-state="ok"] { color: var(--good); background: var(--good-soft); }
.ladder-match[data-state="warn"] { color: var(--warn); }
.ladder-match .icon { width: 18px; height: 18px; }
.ladder-bar-text { margin-inline-start: auto; font-size: 13px; font-weight: 700; color: var(--muted); }
.ladder-tools { padding-top: 4px; }
.ladder-tools .btn { flex: 0 1 auto; }
.ladder-tip { text-align: center; font-weight: 700; color: var(--text); }
.ladder-progress { text-align: center; font-size: 13px; font-weight: 750; color: var(--muted); }
.ladder-scroll { width: 100%; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; padding: 6px 0 10px; border-radius: 14px; scrollbar-width: thin; }
.ladder-scroll:focus-visible { outline-offset: -3px; }
.ladder-board { margin: 0 auto; }
.ladder-row { display: grid; }
.ladder-player { --path: #888; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; min-height: 60px; margin: 0 2px; padding: 6px 2px; border-radius: 14px; border: 2px solid var(--path); background: var(--surface); color: var(--text); font-size: var(--label-size, 14px); font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; hyphens: auto; box-shadow: 0 3px 0 var(--path); transition: transform .1s; }
.ladder-player:hover:not(:disabled) { transform: translateY(-2px); }
.ladder-player:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--path); }
.ladder-player.is-played { background: var(--surface-2); background: color-mix(in srgb, var(--path) 20%, var(--surface)); }
.ladder-player.is-active { outline: 3px solid var(--path); outline-offset: 2px; }
.ladder-player:disabled { cursor: progress; opacity: 1; }
.ladder-player-name { max-width: 100%; }
.ladder-dot { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--path); color: #fff; flex: none; font-size: 12px; font-weight: 900; line-height: 1; }
.ladder-player.is-next:not(:disabled) { animation: ladder-nudge 1.8s ease-in-out infinite; }
@keyframes ladder-nudge { 0%, 60%, 100% { transform: translateY(0); } 20% { transform: translateY(-4px); } 40% { transform: translateY(0); } }
.ladder-svg { display: block; overflow: visible; }
.ladder-rails line { stroke: var(--rail); stroke-linecap: round; }
.ladder-rails .rail { stroke-width: 5; transform-box: fill-box; transform-origin: 50% 0; }
.ladder-rails .rung { stroke-width: 4; transform-box: fill-box; transform-origin: 0 50%; }
.ladder-trace { fill: none; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; transition: opacity .25s; }
.ladder-trace.done { stroke-width: 5; opacity: .9; }
.ladder-glow { fill: none; stroke-width: 18; stroke-linecap: round; stroke-linejoin: round; opacity: .22; }
.ladder-glow.done { display: none; }
.ladder-svg.is-focus .ladder-trace.done { opacity: .28; }
.ladder-token circle { stroke: #fff; stroke-width: 3; }
.ladder-token text { fill: #fff; font-size: 12px; font-weight: 900; font-family: inherit; pointer-events: none; }
.token-body { transform-box: fill-box; transform-origin: 50% 50%; }
.ladder-ripple { fill: none; stroke-width: 3; transform-box: fill-box; transform-origin: 50% 50%; }
.ladder-rung-flash { stroke-width: 14; stroke-linecap: round; opacity: 0; }
.ladder-skip { text-align: center; font-size: 13px; font-weight: 650; color: var(--muted); margin-top: -6px; }
.ladder-bottom { perspective: 700px; }
.is-busy .ladder-scroll { cursor: pointer; }
.ladder-prize { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; min-height: 60px; margin: 0 2px; padding: 6px 2px; border-radius: 14px; background: var(--surface-2); border: 2px dashed var(--border-strong); text-align: center; font-size: var(--label-size, 14px); font-weight: 850; line-height: 1.2; overflow-wrap: anywhere; hyphens: auto; }
.ladder-question { font-size: 24px; font-weight: 900; color: var(--muted); }
.ladder-prize.revealed { border: 2px solid var(--path); background: var(--surface); background: color-mix(in srgb, var(--path) 16%, var(--surface)); }
:lang(ko) .ladder-prize-text, :lang(ko) .ladder-player-name, :lang(ko) .ladder-result-outcome { word-break: keep-all; }
.ladder-prize-owner { font-size: 11px; font-weight: 750; color: var(--muted); }
.ladder-result { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0; align-self: center; max-width: 100%; padding: 12px 28px; border-radius: 20px; border: 2.5px solid var(--path); background: var(--surface); background: color-mix(in srgb, var(--path) 10%, var(--surface)); }
.ladder-result-name { font-size: 15px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; overflow-wrap: anywhere; }
.ladder-result-arrow { color: var(--path); font-weight: 900; line-height: 1; }
.ladder-result-outcome { font-size: clamp(26px, 6.5vw, 40px); font-weight: 900; line-height: 1.15; overflow-wrap: anywhere; text-align: center; }
.ladder-summary { width: 100%; display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--border); }
.ladder-summary-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 8px; }
.ladder-summary-list li { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border-inline-start: 4px solid var(--path); text-align: start; }
.summary-name { font-weight: 700; overflow-wrap: anywhere; }
.summary-arrow { color: var(--muted); }
.ladder-summary-list strong { overflow-wrap: anywhere; }
.scroll-hint { text-align: center; }

/* Dice */
.dice-tray { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: clamp(14px, 5vw, 30px); width: 100%; min-height: 180px; padding: 26px 16px; border: 0; border-radius: 24px; background: radial-gradient(circle at 50% 35%, #2f8a5f, #1d5f41 75%); box-shadow: inset 0 0 0 6px rgba(0, 0, 0, .12), inset 0 10px 30px rgba(0, 0, 0, .25); }
.dice-tray:disabled { cursor: progress; }
.die { --die: clamp(74px, 22vw, 104px); position: relative; display: grid; width: var(--die); height: var(--die); border-radius: 22%; background: #fff; box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .08), 0 8px 14px rgba(0, 0, 0, .35); }
.die.d6 { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); padding: calc(var(--die) * .14); gap: calc(var(--die) * .03); }
.pip { display: block; border-radius: 50%; margin: 9%; min-width: 0; min-height: 0; }
.pip.on { background: #1d2b26; }
.die.poly { place-items: center; align-content: center; background: none; box-shadow: none; filter: drop-shadow(0 7px 7px rgba(0, 0, 0, .35)); }
.die.poly::before { content: ""; position: absolute; inset: 0; background: #fff; clip-path: var(--shape); }
.die.poly b { position: relative; font-size: clamp(28px, 8vw, 40px); font-weight: 900; line-height: 1; color: #1d2b26; }
.die.poly small { position: relative; font-size: 10px; font-weight: 800; color: #6b7b73; }
.d4 { --shape: polygon(50% 3%, 97% 93%, 3% 93%); } .d4 b { margin-top: 26%; }
.d8 { --shape: polygon(50% 1%, 99% 50%, 50% 99%, 1% 50%); }
.d10 { --shape: polygon(50% 1%, 98% 42%, 50% 99%, 2% 42%); }
.d12 { --shape: polygon(50% 2%, 98% 37%, 80% 96%, 20% 96%, 2% 37%); }
.d20 { --shape: polygon(50% 1%, 95% 26%, 95% 74%, 50% 99%, 5% 74%, 5% 26%); }
.die.is-idle { opacity: .6; }
.die3d { --s: clamp(66px, 20vw, 92px); position: relative; width: var(--s); height: var(--s); perspective: 560px; }
.die-lift, .die3d .cube { position: absolute; inset: 0; transform-style: preserve-3d; }
.cube-face { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); padding: calc(var(--s) * .14); gap: calc(var(--s) * .03);
  border-radius: 20%; background: #fbfbf8; box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, .07), inset 0 -5px 10px rgba(0, 0, 0, .08); -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.cube-face.f1 { transform: translateZ(calc(var(--s) / 2)); }
.cube-face.f6 { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }
.cube-face.f2 { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); }
.cube-face.f5 { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); }
.cube-face.f3 { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); }
.cube-face.f4 { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); }
.cube-face .pip { margin: 9%; }
.die-shadow { position: absolute; left: 10%; right: 10%; bottom: -16%; height: 18%; border-radius: 50%; background: rgba(0, 0, 0, .45); filter: blur(5px); opacity: .5; }
.die3d.is-idle { opacity: .75; }
.dice-options { padding-top: 10px; border-top: 1px solid var(--border); }
.dice-options .field { align-items: center; }
.rolling .die { animation: tumble .9s cubic-bezier(.3, .7, .4, 1); }
.rolling .die:nth-child(2) { animation-name: tumble-b; }
.rolling .die:nth-child(3) { animation-duration: .85s; }
@keyframes tumble { 0% { transform: translateY(0) rotate(0); } 25% { transform: translateY(-30px) rotate(-130deg); } 50% { transform: translateY(0) rotate(-230deg); } 70% { transform: translateY(-10px) rotate(-310deg); } 100% { transform: translateY(0) rotate(-360deg); } }
@keyframes tumble-b { 0% { transform: translateY(0) rotate(0); } 25% { transform: translateY(-24px) rotate(120deg); } 50% { transform: translateY(0) rotate(240deg); } 70% { transform: translateY(-8px) rotate(320deg); } 100% { transform: translateY(0) rotate(360deg); } }
.dice-total { display: flex; flex-direction: column; align-items: center; min-height: 92px; justify-content: center; }
.dice-total-value { font-size: clamp(44px, 12vw, 64px); font-weight: 950; line-height: 1.05; font-variant-numeric: tabular-nums; }
.dice-total[data-state="idle"] .dice-total-value { color: var(--muted); }
.dice-total[data-state="rolling"] .dice-total-value { opacity: .35; }
.dice-breakdown { font-size: 15px; font-weight: 700; color: var(--muted); }

/* Coin */
.coin-scene { display: grid; justify-items: center; gap: 8px; width: 100%; padding: 26px 0 4px; border: 0; background: none; perspective: 900px; color: inherit; }
.coin-scene:disabled { cursor: progress; }
.coin { position: relative; width: clamp(170px, 50vw, 220px); aspect-ratio: 1; transform-style: preserve-3d; transform: rotateX(0deg); }
.coin-face { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 50%; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.coin-face.heads { background: radial-gradient(circle at 34% 28%, #fff1bf, #f3c552 42%, #c8922a 100%); color: #7a4f00; box-shadow: inset 0 0 0 7px #d9a53a, inset 0 0 0 10px #f8dc86, 0 0 0 2px #b9861f; transform: translateZ(1px); }
.coin-face.tails { background: radial-gradient(circle at 34% 28%, #ffffff, #d3dce7 42%, #8e9eb2 100%); color: #33475d; box-shadow: inset 0 0 0 7px #9fb0c3, inset 0 0 0 10px #eef3f8, 0 0 0 2px #7d8ea3; transform: rotateX(180deg) translateZ(1px); }
.coin-art { width: 54%; height: 54%; }
.coin-word { max-width: 78%; font-size: clamp(13px, 3.8vw, 17px); font-weight: 900; letter-spacing: .12em; line-height: 1.1; text-transform: uppercase; text-align: center; overflow-wrap: anywhere; }
:lang(hi) .coin-word, :lang(ko) .coin-word, :lang(ja) .coin-word, :lang(zh-CN) .coin-word, :lang(zh-TW) .coin-word { letter-spacing: .02em; }
.coin-shadow { width: 58%; height: 14px; border-radius: 50%; background: rgba(0, 0, 0, .28); filter: blur(5px); opacity: .5; }
.coin-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.coin-legend li { display: flex; align-items: center; gap: 8px; padding: 5px 14px 5px 5px; border-radius: 999px; background: var(--surface-2); font-size: 13px; text-align: start; line-height: 1.25; }
.coin-legend strong { display: block; font-size: 14px; }
.coin-mini { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; flex: none; }
.coin-mini svg { width: 28px; height: 28px; }
.coin-mini.heads { background: #f3c552; color: #7a4f00; box-shadow: inset 0 0 0 2px #c8922a; }
.coin-mini.tails { background: #d3dce7; color: #33475d; box-shadow: inset 0 0 0 2px #8e9eb2; }
.coin-result { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 110px; }
.coin-result .result-kicker, .coin-result .coin-result-word, .coin-result .coin-verdict { display: none; }
.coin-result[data-state="done"] .result-hint { display: none; }
.coin-result[data-state="done"] :is(.result-kicker, .coin-result-word, .coin-verdict:not([hidden])) { display: block; }
.coin-result[data-state="flipping"] .result-hint { visibility: hidden; }
.coin-result-word { font-size: clamp(38px, 11vw, 58px); font-weight: 950; letter-spacing: .04em; line-height: 1.1; text-transform: uppercase; }
.coin-result-word[data-side="heads"] { color: #9a6700; }
.coin-result-word[data-side="tails"] { color: #4a5d73; }
:root[data-theme="dark"] .coin-result-word[data-side="heads"] { color: #f3c552; }
:root[data-theme="dark"] .coin-result-word[data-side="tails"] { color: #d3dce7; }
.coin-verdict { font-size: 16px; font-weight: 800; }
.coin-verdict[data-tone="good"] { color: var(--good); }
.coin-verdict[data-tone="bad"] { color: var(--bad); }

/* Rock paper scissors */
.rps-arena { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; width: 100%; max-width: 520px; }
.rps-side { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; padding: 14px 6px; border-radius: 20px; background: var(--surface-2); }
.rps-who { font-size: 13px; font-weight: 850; color: var(--muted); }
.rps-hand { display: block; font-size: clamp(58px, 17vw, 92px); line-height: 1.1; }
.cpu .rps-hand { transform: scaleX(-1); }
.rps-move { min-height: 1.5em; font-weight: 850; overflow-wrap: anywhere; }
.rps-vs { font-size: 15px; font-weight: 950; color: var(--muted); }
.shake .you .rps-hand { animation: pump .28s ease-in-out 3; }
.shake .cpu .rps-hand { animation: pump-cpu .28s ease-in-out 3; }
.rps-side { transition: background-color .2s, opacity .2s; }
.rps-side.is-winner { background: #d3f9d8; }
.rps-side.is-loser { opacity: .62; }
:root[data-theme="dark"] .rps-side.is-winner { background: #1f4d2b; }
.you.is-winner .rps-hand { animation: punch-you .5s cubic-bezier(.3,1.5,.5,1); }
.cpu.is-winner .rps-hand { animation: punch-cpu .5s cubic-bezier(.3,1.5,.5,1); }
.you.is-loser .rps-hand { animation: lose-hand .32s ease-out; transform: scale(.82) rotate(-8deg); transition: transform .3s; }
.cpu.is-loser .rps-hand { animation: lose-hand .32s ease-out; transform: scaleX(-1) scale(.82) rotate(-8deg); transition: transform .3s; }
.is-draw .rps-hand { animation: draw-wiggle .45s ease-in-out; }
.cpu.is-draw .rps-hand { animation-name: draw-wiggle-cpu; }
@keyframes punch-you { 40% { transform: translateX(14px) scale(1.28) rotate(6deg); } }
@keyframes punch-cpu { 0%, 100% { transform: scaleX(-1); } 40% { transform: scaleX(-1) translateX(14px) scale(1.28) rotate(6deg); } }
@keyframes draw-wiggle { 30% { transform: rotate(-8deg); } 70% { transform: rotate(8deg); } }
@keyframes draw-wiggle-cpu { 0%, 100% { transform: scaleX(-1); } 30% { transform: scaleX(-1) rotate(-8deg); } 70% { transform: scaleX(-1) rotate(8deg); } }
@keyframes pump { 50% { transform: translateY(-16px) rotate(-10deg); } }
@keyframes pump-cpu { 0%, 100% { transform: scaleX(-1); } 50% { transform: scaleX(-1) translateY(-16px) rotate(-10deg); } }
.rps-badge { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 58px; max-width: 100%; padding: 10px 24px; border-radius: 999px; background: var(--surface-2); font-size: clamp(20px, 5.5vw, 28px); font-weight: 950; }
.rps-badge-icon:empty { display: none; }
.rps-badge[data-state="idle"] { font-size: 18px; color: var(--muted); }
.rps-badge[data-state="shaking"] { font-size: 21px; color: var(--text); background: var(--accent-soft); }
.rps-badge[data-state="win"] { background: #d3f9d8; color: #1b5e20; }
.rps-badge[data-state="lose"] { background: #ffe3e3; color: #a61e1e; }
.rps-badge[data-state="draw"] { background: #e9ecef; color: #343a40; }
:root[data-theme="dark"] .rps-badge[data-state="win"] { background: #1f4d2b; color: #b2f2bb; }
:root[data-theme="dark"] .rps-badge[data-state="lose"] { background: #4d1f1f; color: #ffc9c9; }
:root[data-theme="dark"] .rps-badge[data-state="draw"] { background: #343a40; color: #e9ecef; }
.rps-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: 100%; max-width: 520px; }
.rps-choice { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-width: 0; min-height: 112px; padding: 12px 6px; border-radius: 20px; border: 2px solid var(--border-strong); background: var(--surface); color: var(--text); box-shadow: 0 4px 0 var(--border-strong); transition: transform .1s, border-color .15s; }
.rps-choice:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-2px); }
.rps-choice:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--border-strong); }
.rps-choice.picked { border-color: var(--accent); background: var(--accent-soft); }
.rps-choice:disabled { cursor: progress; }
.rps-choice-hand { font-size: clamp(40px, 11vw, 58px); line-height: 1.1; }
.rps-choice-label { font-size: 15px; font-weight: 850; overflow-wrap: anywhere; }
.rps-streak { font-weight: 850; color: var(--accent-strong); }
.stats { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 22px; width: 100%; padding-top: 14px; border-top: 1px solid var(--border); }
.stat { display: flex; flex-direction: column; align-items: center; min-width: 60px; }
.stat strong { font-size: 26px; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; font-weight: 650; color: var(--muted); }

/* Random number */
.number-fields { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: 10px; width: 100%; }
.number-fields > .field:last-child { grid-column: 1 / -1; }
.range-dash { padding-bottom: 12px; font-weight: 900; color: var(--muted); }
.number-input { font-size: 20px; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }
.number-board { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 130px; padding: 6px 0; }
.number-ball { display: inline-grid; place-items: center; min-width: 58px; height: 58px; max-width: 100%; padding: 0 14px; border-radius: 999px; background: var(--surface-2); border: 2px solid var(--border-strong); font-size: 20px; font-weight: 850; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.number-ball.big { min-width: 140px; height: auto; min-height: 140px; padding: 10px 26px; background: #3b7bf0; border: 0; color: #fff; font-size: clamp(30px, 10vw, 60px); box-shadow: inset 0 -8px 0 rgba(0, 0, 0, .14); }
.number-ball.placeholder { background: var(--surface-2); color: var(--muted); box-shadow: inset 0 0 0 2px var(--border-strong); }
.number-board[data-state="done"] .number-ball:not(.big) { background: var(--accent-soft); border-color: var(--accent); }
.number-board[data-state="rolling"] .number-ball { color: var(--muted); }
.number-board[data-state="rolling"] .number-ball.big { color: rgba(255, 255, 255, .7); }
.number-board[data-state="rolling"] .number-ball.locked { color: var(--text); background: var(--accent-soft); border-color: var(--accent); }
.number-board[data-state="rolling"] .number-ball.big.locked { color: #fff; background: #3b7bf0; }

/* Yes / No */
.yesno-question { max-width: 100%; font-size: 18px; font-weight: 750; color: var(--text); overflow-wrap: anywhere; }
.yesno-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: min(100%, 340px); min-height: 230px; padding: 18px; border: 0; border-radius: 30px; background: var(--surface-2); color: var(--text); box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .06); transition: background-color .2s; }
.yesno-card:disabled { cursor: progress; }
.yesno-icon { font-size: 28px; font-weight: 900; line-height: 1; min-height: 28px; }
.yesno-word { font-size: clamp(60px, 17vw, 100px); font-weight: 950; line-height: 1; letter-spacing: -.02em; overflow-wrap: anywhere; max-width: 100%; }
.yesno-line { font-size: 16px; font-weight: 750; opacity: .92; }
.yesno-card[data-state="idle"] .yesno-word { color: var(--muted); }
.yesno-card[data-state="thinking"] { animation: wobble .5s ease-in-out infinite; }
.yesno-card[data-state="yes"] { background: #2b8a3e; color: #fff; }
.yesno-card[data-state="no"] { background: #c92a2a; color: #fff; }
@keyframes wobble { 25% { transform: rotate(-3deg); } 75% { transform: rotate(3deg); } }

/* Time-estimation challenge: no progress ring or live elapsed digits. */
.challenge-layout[data-playing="true"] { display: block; max-width: 680px; margin-inline: auto; }
.challenge-stage { scroll-margin-top: 12px; }
.challenge-setup, .challenge-play { display: flex; flex-direction: column; align-items: center; gap: 16px; width: 100%; text-align: center; }
.challenge-setup .field { width: 100%; }
.challenge-setup h2 { font-size: clamp(21px, 4vw, 28px); line-height: 1.25; }
.challenge-emblem { display: grid; place-items: center; width: 104px; height: 104px; border: 7px solid var(--accent); outline: 2px dashed var(--border-strong); outline-offset: 7px; margin: 12px 0 6px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); font-size: 45px; font-weight: 900; transform: rotate(-6deg); }
.challenge-presets { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px; }
.challenge-presets .btn { padding-inline: 6px; font-size: 15px; min-width: 0; }
.challenge-presets .btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); box-shadow: inset 0 -3px 0 var(--accent-shadow); }
.challenge-custom { display: flex; align-items: center; gap: 12px; justify-content: center; }
.challenge-custom input { max-width: 110px; text-align: center; font-size: 20px; font-weight: 800; }
.challenge-turn { color: var(--muted); font-size: 13px; font-weight: 750; }
.challenge-target { border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); padding: 8px 18px; font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.challenge-player { font-size: clamp(24px, 5vw, 34px); line-height: 1.2; overflow-wrap: anywhere; max-width: 100%; }
.challenge-arena { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.challenge-cue { font-size: 17px; color: var(--muted); font-weight: 650; max-width: 360px; }
.challenge-stage[data-state="countdown"] .challenge-cue { font-size: 100px; line-height: 1.6; color: var(--accent-strong); font-weight: 900; }
#challenge-stop { width: min(100%,220px); height: 180px; border-radius: 50%; background: #c92a2a; color: #fff; border: 7px solid var(--bad-soft); box-shadow: 0 8px 0 #8e1c1c,0 14px 26px rgba(100,20,20,.15); font-size: clamp(24px,6vw,32px); font-weight: 950; touch-action: manipulation; user-select: none; -webkit-user-select: none; padding: 14px; }
#challenge-stop:hover { background: #b02525; }
#challenge-stop:active { transform: translateY(4px); box-shadow: 0 4px 0 #8e1c1c; }
#challenge-stop span { overflow-wrap: anywhere; }
.challenge-key { font-size: 12px; }
.challenge-result { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 9px; }
.challenge-result:focus { outline: none; }
.challenge-actual { font-size: clamp(36px,9vw,58px); font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.2; overflow-wrap: anywhere; }
.challenge-difference { font-size: 17px; font-weight: 750; }
.challenge-grade { border-radius: 999px; padding: 9px 18px; font-size: 20px; font-weight: 900; background: var(--surface-2); color: var(--text); }
.challenge-grade[data-grade="perfect"],.challenge-grade[data-grade="amazing"] { background: var(--good-soft); color: var(--good); }
.challenge-best { width: 100%; border-top: 1px dashed var(--border-strong); padding-top: 16px; font-size: 14px; color: var(--muted); }
.challenge-finish-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; width: 100%; }
.challenge-final { width: 100%; display: flex; flex-direction: column; gap: 16px; }
.challenge-winner { border-radius: 22px; padding: 16px; background: var(--accent-soft); color: var(--accent-strong); }
.challenge-trophy { font-size: 38px; line-height: 1.1; }
.challenge-winner-names { font-size: clamp(24px,5vw,32px); font-weight: 900; overflow-wrap: anywhere; }
.challenge-ranking { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; text-align: start; }
.challenge-ranking > li { display: grid; grid-template-columns: 32px minmax(0,1fr); gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 16px; }
.challenge-ranking > li[data-rank="1"] { border-color: var(--accent); background: var(--accent-soft); }
.challenge-rank { display: grid; place-items: center; align-self: start; width: 30px; height: 30px; background: var(--surface-2); color: var(--text); border-radius: 50%; font-weight: 850; }
.challenge-standing { min-width: 0; }
.challenge-standing-name { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; overflow-wrap: anywhere; font-size: 17px; }
.challenge-standing-name strong { min-width: 0; max-width: 100%; }
.challenge-tie { color: var(--accent-strong); font-size: 12px; font-weight: 800; }
.challenge-metrics { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 6px; }
.challenge-metrics > div { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; font-size: 14px; }
.challenge-completed { width: 100%; text-align: start; border-top: 1px solid var(--border); padding-top: 12px; font-size: 14px; }
.challenge-completed summary { min-height: 44px; padding-block: 10px; cursor: pointer; color: var(--muted); }
.challenge-completed-list { padding: 0; list-style: none; display: grid; gap: 8px; }
.challenge-completed-list li { display: flex; justify-content: space-between; gap: 10px; }
.challenge-completed-list span { overflow-wrap: anywhere; min-width: 0; }
.challenge-completed-list strong { flex-shrink: 0; font-variant-numeric: tabular-nums; }
@media (max-width: 480px) {
  .challenge-play { gap: 12px; }
  .challenge-stage[data-state="running"] { padding-block: 18px; }
  #challenge-stop { height: 166px; width: 200px; }
  .challenge-setup > .btn, #challenge-start, #challenge-next { width: 100%; }
}

/* Info pages */
.article { max-width: 760px; margin: 8px auto 0; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.article h1 { font-size: clamp(26px, 5.5vw, 38px); font-weight: 900; margin-bottom: 6px; }
.article p { font-size: 16px; line-height: 1.75; }
.not-found { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px 0 8px; text-align: center; }
.big-404 { font-size: clamp(80px, 22vw, 128px); font-weight: 950; line-height: 1; letter-spacing: -.05em; color: var(--accent); }
.not-found h1 { font-size: clamp(24px, 5vw, 34px); font-weight: 900; }
.not-found p { color: var(--muted); max-width: 520px; }

/* Feedback effects */
.pop { animation: pop .38s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes pop { from { transform: scale(.86); opacity: .4; } to { transform: scale(1); opacity: 1; } }
.confetti { position: absolute; inset: -40px 0 -20px; overflow: hidden; pointer-events: none; z-index: 3; }
.confetti i { position: absolute; top: 55%; width: 8px; height: 12px; border-radius: 2px; }

/* ---------- Responsive ---------- */
@media (max-width: 899px) {
  .entries[data-collapsed="true"] .entries-body { display: none; }
  .entries[data-collapsed="true"] .entries-preview { display: block; }
  .entries[data-collapsed="true"] { gap: 4px; padding-block: 12px; }
  .entries-toggle { display: inline-flex; }
}
@media (min-width: 560px) {
  .compact-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .number-fields { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) minmax(0, .8fr); }
  .number-fields > .field:last-child { grid-column: auto; }
}
@media (min-width: 700px) {
  .mini-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .page { padding: 26px 24px 0; }
  .header-inner { padding: 10px 24px; }
  .header-nav { display: block; }
  .panel { padding: 24px; }
  .ladder-lists { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game-head { gap: 18px; margin-bottom: 22px; }
  .game-art { width: 68px; height: 68px; border-radius: 20px; }
  .game-art svg { width: 50px; }
  .site-footer { padding-inline: 24px; }
}
@media (min-width: 900px) {
  .featured-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
  .game-card { padding: 14px; }
  .game-card.compact { flex-direction: row; align-items: center; gap: 14px; }
  .crew-section { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); padding: 32px; gap: 36px; align-items: start; }
  .layout-split { grid-template-columns: minmax(0, 1.45fr) minmax(300px, 1fr); align-items: start; gap: 18px; }
  .layout-split > .stage { grid-column: 1; grid-row: 1; padding: 28px; }
  .layout-split > .entries { grid-column: 2; grid-row: 1; position: sticky; top: 16px; }
}
@media (max-width: 480px) {
  .game-head-tools { flex-direction: column; }
  .lang-picker select { width: 8.4rem; padding-inline-start: 10px; padding-inline-end: 26px; }
  .lang-picker .icon:first-child { display: none; }
  .result-slot { min-height: 68px; }
}
@media (max-width: 380px) {
  .header-inner { padding: 8px 12px; gap: 8px; }
  .brand { font-size: 18px; gap: 6px; }
  .brand-mark { width: 28px; height: 28px; font-size: 16px; }
  .header-tools { gap: 6px; }
  .page { padding-inline: 12px; }
  .panel { padding: 14px; border-radius: 18px; }
  .game-card { padding: 10px; }
  .card-title { font-size: 16px; }
  .btn-large { padding-inline: 18px; }
  .rps-choice { min-height: 100px; }
  .rps-choice-label { font-size: 14px; }
}
@media (max-width: 519px) {
  .ladder-bar-text { display: none; }
  .ladder-play { margin-inline: -8px; padding-inline: 6px; border-radius: 18px; }
}
@media (max-width: 419px) {
  .mini-grid { gap: 8px; }
  .mini-card { flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px; }
  .mini-art { width: 36px; height: 36px; border-radius: 11px; }
  .mini-art svg { width: 27px; }
  .mini-name { overflow-wrap: break-word; hyphens: auto; }
}
@media (hover: none) {
  .game-card:hover, .mini-card:hover, .rps-choice:hover:not(:disabled), .ladder-player:hover:not(:disabled) { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html:not([data-motion="full"]) *, html:not([data-motion="full"]) *::before, html:not([data-motion="full"]) *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
html[data-motion="reduce"] *, html[data-motion="reduce"] *::before, html[data-motion="reduce"] *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
.btn:active:not(:disabled) { transform: scale(.98); }
.icon-button:active { transform: scale(.96); }

@keyframes lose-hand { 25% { translate: -3px 0; } 65% { translate: 3px 0; } 100% { translate: 0 0; } }
