:root {
  --ink: #17231f;
  --muted: #7c8782;
  --line: #e7e8e3;
  --paper: #fffefb;
  --cream: #f5f3ec;
  --purple: #6f4ca5;
  --purple-soft: #f1eafa;
  --orange: #ee7045;
  --orange-soft: #fff1e9;
  --font-geist-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--cream); color: var(--ink); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input { font: inherit; }
button { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.loading-screen { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--muted); }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: inline-grid; place-items: center; background: var(--ink); color: white; font: 700 17px var(--font-geist-mono); box-shadow: inset 0 -3px 0 #0002; }

.app-shell { min-height: 100vh; }
.topbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 28px; background: var(--paper); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 750; letter-spacing: -.02em; }
.top-actions { display: flex; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.mobile-game-select { display: none; }
.button { border: 1px solid var(--line); border-radius: 10px; background: white; padding: 10px 15px; cursor: pointer; font-weight: 650; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: .15s ease; }
.button:hover { transform: translateY(-1px); box-shadow: 0 5px 15px #1f282310; }
.button.primary { background: var(--ink); color: white; border-color: var(--ink); }
.button.ghost { background: transparent; }
.finish-button { border-color: var(--orange); background: var(--orange); color: white; }
.finish-button:hover { background: #df6139; }
.history-count { min-width: 20px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 10px; background: var(--purple-soft); color: var(--purple); font: 750 9px var(--font-geist-mono); }

.workspace { min-height: calc(100vh - 72px); display: grid; grid-template-columns: minmax(0, 1fr); }
.games-panel { padding: 26px 16px; border-right: 1px solid var(--line); background: #f9f7f1; display: flex; flex-direction: column; }
.section-label { padding: 0 8px 12px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.section-label button { border: 0; background: transparent; font-size: 20px; cursor: pointer; color: var(--ink); }
.game-list { display: grid; gap: 5px; }
.game-card { width: 100%; display: grid; grid-template-columns: 36px 1fr; gap: 10px; text-align: left; border: 1px solid transparent; background: transparent; padding: 11px 10px; border-radius: 11px; cursor: pointer; }
.game-card:hover { background: #fff9; }
.game-card.active { background: white; border-color: var(--line); box-shadow: 0 8px 25px #1b251f0a; }
.game-card strong, .game-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-card strong { font-size: 13px; margin-bottom: 4px; }
.game-card small { color: var(--muted); font-size: 10px; }
.mini-avatars { display: flex; padding-top: 2px; }
.mini-avatars i { width: 20px; height: 20px; border: 2px solid white; border-radius: 50%; margin-right: -9px; }
.legend { margin-top: auto; padding: 18px 8px 0; border-top: 1px solid var(--line); display: grid; gap: 9px; color: var(--muted); font-size: 10px; }
.legend span { display: flex; align-items: center; gap: 8px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; }
.legend-dot.current { background: var(--purple); }
.legend-dot.round { background: var(--orange); }

.board-area { min-width: 0; padding: 44px clamp(22px, 5vw, 72px) 70px; }
.paused-banner { max-width: 1180px; margin: 0 auto 22px; padding: 12px 13px 12px 17px; border: 1px solid #d8cbea; border-radius: 12px; background: var(--purple-soft); color: #543879; display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 12px; }
.paused-banner b { margin-right: 4px; }
.paused-banner .button { padding: 8px 13px; white-space: nowrap; }
.board-heading { max-width: 1180px; margin: 0 auto 25px; display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; }
.eyebrow { font: 700 10px var(--font-geist-mono); letter-spacing: .14em; color: var(--muted); }
.eyebrow i { display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: #50a77b; box-shadow: 0 0 0 4px #50a77b1a; }
.game-title { display: block; width: min(540px, 100%); margin: 9px 0 7px; padding: 0; border: 0; border-bottom: 1px solid transparent; background: transparent; color: var(--ink); font-size: clamp(27px, 3vw, 42px); line-height: 1.1; font-weight: 750; letter-spacing: -.045em; outline: none; }
.game-title:focus { border-color: var(--line); }
.board-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.leader-card { min-width: min(540px, 48vw); border: 1px solid var(--line); background: white; border-radius: 13px; padding: 12px 14px; box-shadow: 0 10px 30px #1f282308; }
.leader-card > span { color: var(--muted); font: 700 9px var(--font-geist-mono); letter-spacing: .1em; text-transform: uppercase; }
.ranking-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; gap: 8px; margin-top: 8px; }
.ranking-player { min-width: 0; display: grid; grid-template-columns: auto 30px minmax(0, 1fr); grid-template-areas: "position avatar name" "position avatar score"; align-items: center; column-gap: 7px; padding-right: 8px; border-right: 1px solid var(--line); }
.ranking-player:last-child { padding-right: 0; border-right: 0; }
.ranking-position { grid-area: position; color: var(--purple); font: 850 12px var(--font-geist-mono); }
.leader-avatar { grid-area: avatar; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: white; font-size: 11px; font-weight: 800; }
.ranking-name { grid-area: name; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 800; }
.ranking-player b { grid-area: score; color: var(--purple); font: 800 10px var(--font-geist-mono); }

.score-table-wrap { max-width: 1180px; max-height: max(300px, calc(100vh - 265px)); margin: auto; overflow: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 50px #26362c0b; }
.score-table { width: 100%; min-width: 760px; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.score-table th, .score-table td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.score-table tr > :last-child { border-right: 0; }
.score-table thead th { position: sticky; z-index: 4; top: 0; height: 82px; padding: 10px 12px; background: #fbfaf6; text-align: left; box-shadow: 0 1px 0 var(--line); }
.score-table .round-heading { width: 64px; color: var(--muted); }
.score-table thead th:not(.round-heading) { position: sticky; top: 0; display: table-cell; }
.score-table thead th.is-leader { background: var(--purple-soft); box-shadow: inset 0 3px 0 var(--purple); }
.player-avatar { float: left; width: 38px; height: 38px; margin-right: 10px; border-radius: 50%; display: grid; place-items: center; color: white; font-size: 14px; font-weight: 800; }
.player-meta strong, .player-meta small { display: block; }
.player-meta strong { padding-top: 1px; font-size: 21px; line-height: 1.08; font-weight: 850; }
.player-meta small { margin-top: 4px; color: var(--muted); font-size: 9px; font-weight: 550; }
.crown { position: absolute; right: 8px; top: 8px; width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; background: var(--purple); color: white; font-size: 16px; box-shadow: 0 4px 12px #6f4ca555; }
.score-table tbody th { width: 64px; padding: 0; background: #fbfaf6; text-align: center; vertical-align: middle; }
.score-table tbody th strong, .score-table tbody th small, .score-table tfoot th strong, .score-table tfoot th small { display: block; }
.score-table tbody th strong, .score-table tfoot th strong { font-size: 11px; }
.score-table tbody th small, .score-table tfoot th small { margin-top: 4px; color: var(--muted); font-size: 9px; font-weight: 500; }
.score-table tbody th > .round-cell, .score-table tfoot th > .round-cell { width: 100%; display: flex; align-items: center; justify-content: center; }
.score-table tbody th > .round-cell { min-height: 74px; }
.round-number { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); font-family: var(--font-geist-mono); font-size: 13px; font-weight: 800; line-height: 1; cursor: pointer; transition: .15s ease; }
.round-number:hover, .round-number:focus-visible { border-color: #c76655; background: #fff1ed; color: #a84434; outline: none; box-shadow: 0 0 0 3px #c7665518; }
.score-table td { height: 74px; padding: 8px 12px; background: white; text-align: center; }
.score-table td.round-winner { background: #e4d5f3; box-shadow: inset 0 0 0 1px #6f4ca54a; }
.score-table tr.current-round > * { border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
.score-table tr.current-round > :first-child { border-left: 2px solid var(--ink); }
.score-table tr.current-round > :last-child { border-right: 2px solid var(--ink); }
.score-table tr.current-round .round-number { border-color: var(--ink); background: var(--ink); color: white; }
.score-entry { position: relative; height: 56px; display: flex; align-items: center; justify-content: center; gap: 7px; }
.score-entry input { width: 58px; padding: 7px 3px; border: 0; border-bottom: 2px solid #cfd3cc; background: transparent; color: var(--ink); text-align: center; font: 850 21px var(--font-geist-mono); outline: none; }
.score-entry input:focus { border-color: var(--ink); }
.score-entry input:disabled { opacity: .5; cursor: not-allowed; }
.score-entry input::-webkit-inner-spin-button { appearance: none; }
.running-total { padding: 5px 7px; border-radius: 6px; background: #f0eee8; color: var(--ink); font: 850 20px var(--font-geist-mono); letter-spacing: -.04em; white-space: nowrap; }
.winner-badge { position: absolute; bottom: -2px; color: var(--orange); font: 800 7px var(--font-geist-mono); letter-spacing: .09em; }
.score-table tfoot th, .score-table tfoot td { height: 108px; border-bottom: 0; background: #f8f7f2; vertical-align: middle; }
.score-table tfoot th { padding: 0; text-align: center; vertical-align: middle; }
.score-table tfoot th > .total-cell { min-height: 108px; }
.total-symbol { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 9px; background: var(--ink); color: white; font-family: var(--font-geist-mono); font-size: 17px; font-weight: 800; line-height: 1; }
.score-table tfoot td { position: relative; }
.score-table tfoot td.is-leader { background: var(--purple-soft); box-shadow: inset 0 -3px 0 var(--purple); }
.grand-total { display: block; color: var(--ink); font-family: var(--font-geist-mono); font-size: 44px; font-weight: 900; line-height: 1; letter-spacing: -.055em; }
.points-label { color: var(--muted); font: 800 9px var(--font-geist-mono); letter-spacing: .12em; }
.score-table tfoot td small { display: block; margin-top: 7px; color: var(--muted); font-size: 9px; }
.add-round { display: flex; align-items: center; justify-content: center; gap: 6px; max-width: 1180px; width: 100%; margin: 14px auto 0; padding: 12px; border: 1px dashed #cfd3cc; border-radius: 11px; background: transparent; color: var(--muted); text-align: center; cursor: pointer; font-weight: 650; }
.add-round:hover { background: white; color: var(--ink); }
.add-round:disabled { opacity: .45; cursor: not-allowed; background: transparent; color: var(--muted); }

.scrim { position: fixed; inset: 0; z-index: 8; border: 0; background: #101a1666; backdrop-filter: blur(2px); }
.game-menu { position: fixed; z-index: 9; top: 0; right: 0; width: min(420px, 92vw); height: 100vh; height: 100dvh; max-height: 100dvh; padding: 30px; padding-bottom: max(42px, calc(24px + env(safe-area-inset-bottom))); background: var(--paper); box-shadow: -25px 0 80px #0c171133; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; -webkit-overflow-scrolling: touch; }
.menu-heading { display: flex; align-items: flex-start; justify-content: space-between; }
.menu-heading small { color: var(--muted); font: 700 9px var(--font-geist-mono); letter-spacing: .12em; }
.menu-heading h2 { margin: 5px 0 0; font-size: 28px; letter-spacing: -.04em; }
.menu-heading button { border: 0; background: transparent; font-size: 27px; cursor: pointer; }
.game-menu > p { margin: 10px 0 25px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.player-editor { display: grid; gap: 10px; }
.player-edit-row { display: grid; grid-template-columns: 24px 34px minmax(0, 1fr); align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.player-toggle { position: relative; width: 24px; height: 24px; display: grid; place-items: center; cursor: pointer; }
.player-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.player-toggle span { width: 22px; height: 22px; display: grid; place-items: center; border: 2px solid #c9cec8; border-radius: 7px; background: white; transition: .15s ease; }
.player-toggle span::after { content: "✓"; color: white; font-size: 14px; font-weight: 900; opacity: 0; transform: scale(.6); transition: .15s ease; }
.player-toggle input:checked + span { border-color: var(--purple); background: var(--purple); box-shadow: 0 0 0 3px #6f4ca518; }
.player-toggle input:checked + span::after { opacity: 1; transform: scale(1); }
.player-toggle input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.player-toggle input:disabled + span { opacity: .55; cursor: not-allowed; }
.player-edit-row input[type="color"] { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; overflow: hidden; background: transparent; cursor: pointer; }
.player-name-editor > span { display: block; color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .1em; }
.player-name-editor > input { width: 100%; margin-top: 4px; padding: 0; border: 0; outline: 0; font-weight: 700; background: transparent; }
.add-player { width: 100%; margin-top: 12px; border-style: dashed; }
.reset-names-button { width: 100%; margin-top: 10px; padding: 8px; border: 0; background: transparent; color: var(--muted); font-size: 11px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.reset-names-button:hover { color: var(--ink); }
.menu-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line); }
.danger-button { border: 0; background: transparent; color: #b2493b; font-size: 12px; cursor: pointer; }
.danger-button:disabled { opacity: .3; cursor: not-allowed; }

.modal-backdrop { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 20px; background: #101a167a; backdrop-filter: blur(4px); }
.new-game-modal { width: min(440px, 100%); padding: 30px; border-radius: 18px; background: var(--paper); box-shadow: 0 30px 100px #0e19134d; }
.new-game-modal h2 { margin: 20px 0 6px; font-size: 27px; letter-spacing: -.04em; }
.new-game-modal p { margin: 0 0 23px; color: var(--muted); font-size: 13px; }
.new-game-modal label { display: grid; gap: 8px; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.new-game-modal label input { padding: 12px 13px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--ink); text-transform: none; letter-spacing: 0; outline: none; }
.new-game-modal label input:focus { border-color: var(--ink); }
.new-game-modal > div { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.finish-symbol { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--purple-soft); color: var(--purple); font-weight: 850; font-size: 20px; }
.delete-round-symbol { background: #fff0ec; color: #b2493b; }
.button.delete-round-confirm { border-color: #b2493b; background: #b2493b; color: white; }
.button.delete-round-confirm:hover { background: #963b30; }
.finish-modal > p { line-height: 1.5; }
.choice-card { width: 100%; margin-top: 9px; padding: 15px; display: grid; grid-template-columns: 38px 1fr; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 12px; background: white; text-align: left; cursor: pointer; transition: .15s ease; }
.choice-card:hover { transform: translateY(-1px); box-shadow: 0 8px 25px #1f282310; }
.choice-card > span:first-child { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--purple-soft); color: var(--purple); font-size: 18px; font-weight: 800; }
.choice-card strong, .choice-card small { display: block; }
.choice-card strong { font-size: 13px; }
.choice-card small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.choice-card.discard-choice > span:first-child { background: #fff0ec; color: #b2493b; }
.choice-card.discard-choice strong { color: #9e3f33; }
.fun-tab-button { width: 46px; height: 42px; padding: 3px; overflow: hidden; }
.fun-tab-button img { width: 36px; height: 36px; display: block; border-radius: 8px; object-fit: cover; }
.fun-panel { width: min(480px, 94vw); }
.fun-panel > p { margin: 10px 0 22px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.fun-grid { display: grid; gap: 16px; }
.fun-card { position: relative; width: 100%; padding: 0; overflow: hidden; border: 2px solid transparent; border-radius: 16px; background: var(--ink); color: white; cursor: pointer; box-shadow: 0 12px 28px #17231f1f; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.fun-card:hover, .fun-card:focus-visible { border-color: var(--purple); outline: none; box-shadow: 0 16px 36px #17231f2b; transform: translateY(-2px); }
.fun-card:active { transform: scale(.985); }
.fun-card img { width: 100%; height: 190px; display: block; object-fit: cover; transition: transform .2s ease; }
.fun-card:hover img { transform: scale(1.025); }
.fun-counter { position: absolute; top: 12px; right: 12px; min-width: 58px; height: 46px; padding: 0 13px; display: grid; place-items: center; border: 2px solid #ffffffc7; border-radius: 24px; background: #17231fe6; color: white; font: 900 24px var(--font-geist-mono); line-height: 1; box-shadow: 0 7px 20px #0005; backdrop-filter: blur(7px); }
.fun-counter.is-popping { animation: counter-pop .28s ease; }
.fun-card-caption { position: absolute; right: 0; bottom: 0; left: 0; padding: 30px 16px 14px; background: linear-gradient(transparent, #101a16e8); text-align: left; }
.fun-card-caption strong, .fun-card-caption small { display: block; }
.fun-card-caption strong { font-size: 21px; line-height: 1; }
.fun-card-caption small { margin-top: 5px; color: #ffffffc7; font-size: 10px; }
.fun-return { position: sticky; bottom: -1px; margin-top: 22px; padding-top: 14px; padding-bottom: 2px; background: linear-gradient(transparent, var(--paper) 24%); }
.fun-return .button { width: 100%; }
@keyframes counter-pop { 50% { transform: scale(1.2); background: var(--purple); } }
.history-panel { width: min(520px, 94vw); }
.history-section-title { color: var(--muted); font: 800 9px var(--font-geist-mono); letter-spacing: .11em; }
.victory-summary { margin-top: 24px; padding: 16px; border: 1px solid #d8cbea; border-radius: 13px; background: var(--purple-soft); }
.victory-ranking { display: grid; gap: 8px; margin-top: 12px; }
.victory-row { display: grid; grid-template-columns: 22px 32px minmax(0, 1fr) auto; align-items: center; gap: 9px; min-height: 38px; padding: 5px 8px; border-radius: 9px; background: #fffefbcc; }
.victory-position { color: var(--purple); text-align: center; font: 850 12px var(--font-geist-mono); }
.victory-avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: white; font-size: 11px; font-weight: 850; }
.victory-row strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.victory-row b { color: var(--purple); font: 800 10px var(--font-geist-mono); white-space: nowrap; }
.victory-player-copy { min-width: 0; }
.victory-player-copy strong, .victory-player-copy small { display: block; }
.victory-player-copy small { margin-top: 3px; color: var(--muted); font: 700 8px var(--font-geist-mono); }
.history-games-title { margin-top: 25px; }
.history-list { display: grid; gap: 12px; margin-top: 10px; padding-bottom: 20px; }
.history-card { padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #fbfaf6; }
.history-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.history-card-heading strong { font-size: 15px; }
.history-card-heading button { border: 0; background: transparent; color: #b05845; font-size: 19px; cursor: pointer; }
.history-card time { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; text-transform: capitalize; }
.history-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.history-stats span { padding: 9px; border-radius: 8px; background: white; color: var(--muted); font-size: 10px; }
.history-stats b { color: var(--ink); font: 750 13px var(--font-geist-mono); }
.history-winner { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 10px; margin-top: 10px; padding: 10px; border-radius: 9px; background: var(--purple-soft); color: var(--purple); }
.history-winner > span:first-child { display: grid; place-items: center; font-size: 18px; }
.history-winner small, .history-winner strong { display: block; }
.history-winner small { font: 750 7px var(--font-geist-mono); letter-spacing: .1em; }
.history-winner strong { margin-top: 2px; font-size: 12px; }
.history-ranking { display: grid; gap: 6px; margin-top: 12px; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.history-subtitle { margin-bottom: 3px; color: var(--muted); font: 800 8px var(--font-geist-mono); letter-spacing: .1em; }
.history-player-row { display: grid; grid-template-columns: 22px 28px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 34px; padding: 3px 5px; border-radius: 7px; background: #f8f7f2; }
.history-player-position { color: var(--purple); text-align: center; font: 800 10px var(--font-geist-mono); }
.history-player-avatar { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: white; font-size: 9px; font-weight: 850; }
.history-player-row strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.history-game-player-copy { min-width: 0; }
.history-game-player-copy strong, .history-game-player-copy small { display: block; }
.history-game-player-copy small { margin-top: 3px; overflow: hidden; color: #8b6508; text-overflow: ellipsis; white-space: nowrap; font: 800 8px var(--font-geist-mono); }
.history-player-row b { color: var(--ink); font: 850 11px var(--font-geist-mono); white-space: nowrap; }
.empty-history { min-height: 55vh; display: grid; place-content: center; justify-items: center; text-align: center; color: var(--muted); }
.empty-history > span { width: 48px; height: 48px; margin-bottom: 12px; display: grid; place-items: center; border-radius: 14px; background: var(--purple-soft); color: var(--purple); font-size: 23px; }
.empty-history strong { color: var(--ink); }
.empty-history p { max-width: 250px; line-height: 1.5; }

@media (min-width: 700px) and (max-width: 1180px) {
  .board-area { padding-right: 18px; padding-left: 18px; }
  .score-table { min-width: 0; }
  .score-table .round-heading, .score-table tbody th { width: 54px; }
  .score-table thead th { padding-right: 8px; padding-left: 8px; }
  .player-avatar { width: 32px; height: 32px; margin-right: 6px; font-size: 12px; }
  .player-meta strong { max-width: 86px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 18px; }
  .player-meta small { font-size: 8px; }
  .score-table td { padding-right: 5px; padding-left: 5px; }
  .score-entry { gap: 3px; }
  .score-entry input { width: 43px; font-size: 17px; }
  .running-total { padding: 4px 5px; font-size: 17px; }
  .crown { right: 4px; top: 5px; width: 24px; height: 24px; font-size: 14px; }
}

@media (max-width: 840px) {
  .topbar { padding: 12px 16px; }
  .workspace { grid-template-columns: 1fr; }
  .games-panel { display: none; }
  .mobile-game-select { display: block; max-width: 220px; padding: 9px 30px 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--ink); }
  .board-area { padding: 28px 14px 50px; }
  .board-heading { align-items: stretch; flex-direction: column; gap: 18px; }
  .leader-card { min-width: 0; width: 100%; }
  .game-title { font-size: 30px; }
}

@media (max-width: 520px) {
  .topbar { align-items: stretch; flex-direction: column; gap: 10px; }
  .brand { justify-content: center; }
  .top-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .top-actions .button { min-width: 0; padding: 9px 7px; font-size: 10px; }
  .game-menu { padding: 24px 18px; }
  .fun-card img { height: 160px; }
  .paused-banner { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
