:root {
  color-scheme: light;
  --bg: #f3f2f8;
  --panel: #fff;
  --panel-hi: #f6f4fc;
  --ink: #211c37;
  --muted: #68627b;
  --line: #e5dfef;
  --danger: #b82743;
  --violet: #6045d6;
  --violet-deep: #2b1659;
  --gold: #ffdc6a;
  --soft-violet: #efebff;
  --shadow: 0 9px 26px #3122560b;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 280px; background: var(--bg); color: var(--ink); }
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:not(:disabled) { cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; }
h1, h2, p { margin: 0; }
svg { display: block; width: 19px; height: 19px; flex: none; }
.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; }
.shell { width: min(calc(100% - 34px), 880px); margin-inline: auto; }
.masthead { display: flex; justify-content: space-between; align-items: center; height: 67px; }
.brand { display: flex; align-items: center; gap: 9px; padding: 0; border: 0; background: none; font-size: 21px; font-weight: 780; letter-spacing: -.055em; }
.brand b { color: var(--violet); font-weight: 800; }
.tempo-brand-image { display: block; border-radius: 12px; background: #3c2289; }
.avatar { height: 37px; width: 37px; background: #e9e3fe; color: #4c32a7; border: 1px solid #ded4fd; border-radius: 50%; font-size: 14px; font-weight: 790; }
.app { padding: 8px 0 max(86px, calc(80px + env(safe-area-inset-bottom))); min-height: min(650px, 90vh); }
.tabs { position: fixed; z-index: 5; display: flex; align-items: stretch; gap: 6px; width: min(100%, 910px); inset: auto 0 0; margin: 0 auto; min-height: 61px; padding: 7px 13px calc(7px + env(safe-area-inset-bottom)); background: #fcfbff; border-radius: 19px 19px 0 0; border: 1px solid #e4deee; border-bottom: 0; box-shadow: 0 -6px 24px #2920480d; }
.tab { flex: 1; display: flex; justify-content: center; align-items: center; gap: 7px; min-width: 0; min-height: 43px; border: 1px solid transparent; border-radius: 11px; background: transparent; color: #67617a; font-size: 12px; font-weight: 720; }
.tab[aria-current="page"] { background: #eee9ff; color: #4b32b4; border-color: transparent; }
.tab svg { width: 18px; height: 18px; }
.tab:not([aria-current]):hover { background: #f4f0fc; color: #4b32b4; }
.tempo-heading { margin: 5px 0 19px; }
.tempo-heading h1, .tempo-profile-head h1 { font-size: clamp(30px, 6vw, 43px); line-height: 1.08; letter-spacing: -.055em; }
.tempo-heading p, .tempo-profile-head p { margin-top: 6px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.tempo-home { display: grid; gap: 15px; }
.tempo-hero { position: relative; overflow: hidden; display: flex; min-height: 224px; align-items: center; isolation: isolate; border-radius: 24px; color: #fff; background: radial-gradient(ellipse at 92% 16%, #7048e7, transparent 52%), linear-gradient(115deg, #261550, #4425a0 65%, #251151); box-shadow: 0 13px 25px #35226b24; }
.tempo-hero__body { position: relative; z-index: 1; padding: 22px 14px 22px 21px; width: 80%; }
.tempo-hero__art { position: absolute; z-index: 0; inset: 0 -5% 0 auto; width: 61%; background: url("tempo-mark.jpg") 52% 50% / cover no-repeat; -webkit-mask-image: linear-gradient(90deg, transparent, #000 31%, #000); mask-image: linear-gradient(90deg, transparent, #000 31%, #000); pointer-events: none; }
.tempo-date { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 30px; background: #ffffff20; color: #f2eaff; font-size: 12px; font-weight: 720; white-space: nowrap; }
.tempo-date svg { width: 14px; height: 14px; }
.tempo-hero h1 { margin: 12px 0 5px; max-width: 11ch; font-size: clamp(35px, 8.3vw, 59px); line-height: .99; font-weight: 810; letter-spacing: -.071em; text-wrap: balance; }
.tempo-hero p { color: #f3eaff; font-size: 13px; font-weight: 530; }
.tempo-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 8px 13px; border: 1px solid transparent; border-radius: 11px; background: var(--violet); color: #fff; font-weight: 750; font-size: 13px; line-height: 1.2; }
.tempo-button svg { width: 16px; height: 16px; }
.tempo-button:not(:disabled):hover { filter: brightness(.96); }
.tempo-button:disabled { opacity: .5; }
.tempo-button:focus-visible, .tempo-feature:focus-visible, .tempo-setting:focus-visible { outline: 2px solid #4f30d2; outline-offset: 3px; }
.tempo-hero-button { background: var(--gold); color: #342044; margin-top: 16px; padding-inline: 13px; box-shadow: 0 7px 17px #160f3240; }
.tempo-quiet { background: var(--soft-violet); color: #4a32a4; border-color: #e7defe; }
.tempo-text-button { padding: 6px 8px; min-height: 35px; background: transparent; color: #5436bc; }
.tempo-stat-strip, .tempo-stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.tempo-stat { display: flex; flex-wrap: wrap; row-gap: 4px; column-gap: 7px; align-items: center; min-width: 0; min-height: 79px; padding: 11px; background: var(--panel); border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow); }
.tempo-stat-icon { display: grid; width: 27px; height: 27px; place-content: center; background: #efeaff; color: #6b4edb; border-radius: 8px; flex: none; }
.tempo-stat:nth-child(2) .tempo-stat-icon { background: #fff1df; color: #a65b20; }
.tempo-stat:nth-child(3) .tempo-stat-icon { background: #e1f5f4; color: #167575; }
.tempo-stat-icon svg { width: 15px; height: 15px; }
.tempo-stat strong { font-size: clamp(15px, 4.8vw, 24px); white-space: nowrap; font-variant-numeric: tabular-nums; letter-spacing: -.06em; }
.tempo-stat-label { width: 100%; color: var(--muted); font-size: 11px; line-height: 1.16; }
.classic-card { min-width: 0; position: relative; overflow: hidden; min-height: 199px; border-radius: 20px; background: linear-gradient(125deg, #fff, #f9f5ff 70%); border: 1px solid #e9def7; box-shadow: var(--shadow); }
.classic-body { position: relative; z-index: 1; padding: 16px 13px 16px 16px; }
.classic-body h2, .tempo-section h2, .tempo-panel h2 { font-size: 20px; letter-spacing: -.038em; line-height: 1.18; }
.classic-body p { margin-top: 5px; color: var(--muted); font-size: 12px; }
.classic-art { position: absolute; right: -10px; bottom: 15px; transform: rotate(-13deg); opacity: .22; pointer-events: none; }
.art-tiles { display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); gap: 3px; padding: 4px; width: 99px; height: 99px; border-radius: 14px; background: #9a83e7; box-shadow: 0 7px 0 #59429f, 0 14px 18px #44306632; }
.art-tiles i { display: grid; place-items: center; background: #f8f3ff; border-radius: 6px; color: #5935bc; font-size: 21px; font-style: normal; font-weight: 850; }
.art-tiles i:nth-child(3n+1) { background: #ede3ff; }
.tempo-pills, .tempo-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.tempo-pills .tempo-pill { min-height: 34px; padding: 6px 9px; border-radius: 18px; background: #f2eeF9; color: #675985; font-size: 11px; }
.tempo-pills .tempo-pill.chosen { background: #e8e0ff; color: #4f2fbb; border-color: #ddd0fd; }
.tempo-actions.compact { gap: 4px; margin-top: 0; }
.tempo-section h2 { margin-bottom: 9px; }
.tempo-feature-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tempo-feature { background: var(--panel); display: flex; align-items: flex-start; flex-flow: column; text-align: left; position: relative; gap: 7px; min-width: 0; min-height: 117px; padding: 11px; border: 1px solid var(--line); border-radius: 15px; color: var(--ink); box-shadow: var(--shadow); }
.tempo-feature .feature-figure { width: 35px; height: 35px; display: grid; place-content: center; border-radius: 11px; background: #ded4ff; color: #4f35b7; }
.tempo-feature.season-card { background: #fffbf0; border-color: #f0e7ce; }
.tempo-feature.season-card .feature-figure { background: #ffebad; color: #88510c; }
.tempo-feature > svg { position: absolute; right: 10px; top: 15px; width: 16px; height: 16px; color: #7057ba; }
.feature-copy { display: grid; gap: 2px; }
.feature-copy strong { font-size: 14px; letter-spacing: -.035em; }
.feature-copy small { color: var(--muted); font-size: 11px; line-height: 1.3; }
.tempo-event { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 11px; align-items: center; padding: 13px; border: 1px solid #c9e7f0; background: #e4f6fc; color: #154f68; border-radius: 17px; }
.tempo-event.event-killer { border-color: #ebd5ed; background: #faeaf8; color: #70376b; }
.event-medal { display: grid; place-content: center; width: 41px; height: 41px; background: #ffffffb0; border-radius: 13px; }
.event-tag { font-size: 11px; font-weight: 750; }
.tempo-event h2 { margin: 3px 0; font-size: 17px; letter-spacing: -.035em; }
.tempo-event p, .event-progress { font-size: 11px; line-height: 1.35; }
.event-progress { display: block; margin-top: 4px; font-weight: 730; }
.tempo-event .tempo-mode-button { margin: 0; padding-inline: 8px; font-size: 11px; }

.tempo-segmented { display: flex; align-items: stretch; padding: 4px; gap: 3px; margin: 0 0 13px; background: #eae5f4; border-radius: 15px; overflow-x: auto; scrollbar-width: none; }
.tempo-segmented::-webkit-scrollbar { display: none; }
.tempo-segmented .tempo-segment { flex: 1 0 auto; padding: 7px 9px; min-height: 37px; border: 0; color: #66597f; background: transparent; white-space: nowrap; font-size: 12px; }
.tempo-segmented .tempo-segment.chosen { color: #4d2dbc; background: #fff; box-shadow: 0 2px 7px #27203714; }
.arena-banner { display: flex; align-items: center; gap: 14px; min-height: 133px; margin: 0 0 13px; padding: 17px; background: linear-gradient(120deg, #34206d, #6545c6); color: #fff; border-radius: 19px; }
.arena-banner h2 { margin-bottom: 4px; font-size: 24px; line-height: 1.05; letter-spacing: -.045em; }
.arena-banner p { color: #f6efff; font-size: 13px; line-height: 1.38; }
.arena-banner.arena-duel { background: linear-gradient(120deg, #31175d, #854aa4); }
.arena-banner.arena-season { background: linear-gradient(120deg, #462647, #775124); }
.arena-banner.arena-stars { background: linear-gradient(120deg, #312136, #844b32); }
.arena-emblem { width: clamp(55px, 16vw, 90px); aspect-ratio: 1; display: grid; place-content: center; flex: none; border: 2px solid #ffffff7a; border-radius: 25%; color: #3f254e; background: linear-gradient(150deg, #fff4c1, #ffcd69); box-shadow: 0 6px 0 #28173b4a; transform: rotate(-6deg); }
.arena-emblem svg { width: clamp(24px, 7vw, 42px); height: clamp(24px, 7vw, 42px); }
.arena-detail { display: inline-flex; margin-top: 10px; border-radius: 16px; padding: 4px 7px; background: #190a3f3b; color: #fff4ed; font-size: 11px; font-weight: 750; }
.arena-status { color: #764315; display: inline-block; background: #fff2d4; font-size: 11px; font-weight: 750; padding: 6px 8px; border-radius: 20px; margin-bottom: 9px; }
.tempo-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 17px; padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow); }
.tempo-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 7px; }
.tempo-muted { color: var(--muted); font-size: 13px; line-height: 1.48; }
.tempo-panel h2 + p, .tempo-panel-head + p { margin-top: 7px; }
.tempo-link { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; color: #4f33b8; font-size: 13px; font-weight: 740; }
.tempo-link svg { width: 15px; height: 15px; }
.tempo-notice { margin: 0 0 9px; padding: 9px 11px; border: 1px solid #e4dafb; border-radius: 10px; color: #5638a2; background: #f3edff; font-size: 13px; }
.tempo-ranking { width: 100%; margin-top: 10px; border: 1px solid var(--line); border-collapse: separate; border-spacing: 0; border-radius: 12px; overflow: hidden; table-layout: fixed; }
.tempo-ranking th { padding: 8px 10px; background: #f5f1fc; color: var(--muted); font-size: 11px; font-weight: 730; text-align: left; }
.tempo-ranking th:first-child { width: 62px; }
.tempo-ranking th:last-child { width: 86px; }
.tempo-ranking td { padding: 7px 10px; border-top: 1px solid var(--line); font-size: 13px; overflow-wrap: anywhere; }
.tempo-ranking th:last-child, .tempo-ranking td:last-child { text-align: right; }
.tempo-ranking td:last-child { color: #5235b2; font-weight: 780; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tempo-history { list-style: none; margin: 7px 0 0; padding: 0; }
.tempo-history li { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 9px; min-height: 43px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.tempo-history li:last-child { border-bottom: 0; }
.tempo-history li strong { color: #5235b2; font-variant-numeric: tabular-nums; }
.tempo-history small { margin-left: 6px; color: var(--muted); }
.rank-place { display: grid; place-content: center; width: 26px; height: 26px; border-radius: 8px; background: #efebf7; font-weight: 740; color: #584778; }
.tempo-ranking tbody tr:first-child .rank-place { background: #fff0be; color: #85551a; }
.duel-versus { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 6px 0 11px; }
.duel-versus div { display: grid; min-width: 0; gap: 4px; padding: 9px; color: #655583; background: #f3edfd; border-radius: 11px; font-size: 13px; }
.duel-versus strong { color: var(--ink); overflow-wrap: anywhere; }
.duel-link-label { color: var(--muted); font-size: 12px; }
.duel-link-label input { display: block; width: 100%; margin-top: 4px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fbf9ff; }
.duel-list { display: grid; margin-top: 5px; }
.duel-list-item { display: flex; align-items: center; gap: 7px; padding: 10px 0; border: 0; border-bottom: 1px solid var(--line); color: #3e2a7b; background: none; text-align: left; font-size: 13px; }
.duel-list-item:last-child { border-bottom: 0; }
.duel-list-item span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.duel-list-item small { color: var(--muted); }
.duel-list-item svg { width: 15px; height: 15px; }

.tempo-modes { display: grid; gap: 10px; }
.mode-card { position: relative; overflow: hidden; min-height: 154px; border-radius: 20px; border: 1px solid #e4d8ff; background: #eae1ff; color: #3e246e; }
.mode-info { position: relative; z-index: 1; padding: 15px; width: 69%; }
.mode-info h2 { font-size: 21px; line-height: 1.07; letter-spacing: -.043em; }
.mode-info p { margin-top: 5px; color: inherit; font-size: 12px; line-height: 1.4; }
.tempo-mode-button { margin-top: 12px; color: inherit; background: #fff; }
.mode-ice { background: #d9f3fc; color: #164e69; border-color: #bee8f5; }
.mode-killer { background: #f9e1f4; color: #722d66; border-color: #efd1e9; }
.mode-art { position: absolute; right: 7px; top: 30px; transform: rotate(-13deg); pointer-events: none; }
.mode-art > span:last-child { position: absolute; display: grid; place-content: center; border: 2px solid #fff; top: 35px; left: 35px; width: 43px; height: 43px; border-radius: 12px; background: #6342c9; color: #fff; box-shadow: 0 6px 8px #38265e46; }
.mode-ice .mode-art .art-tiles { background: #89d9f3; box-shadow: 0 7px 0 #4aa8cc, 0 14px 18px #37789528; }
.mode-ice .mode-art .art-tiles i { color: #1a6185; background: #eafaff; }
.mode-ice .mode-art > span:last-child { background: #247fa9; }
.mode-quick { background: #fff0c7; color: #694219; border-color: #f5e2ae; }
.mode-quick .mode-art .art-tiles { background: #f3c36a; box-shadow: 0 7px 0 #bc803f, 0 14px 18px #8754202e; }
.mode-quick .mode-art .art-tiles i { color: #8a551b; background: #fff5d9; }
.mode-quick .mode-art > span:last-child { background: #a96819; }
.mode-killer .mode-art .art-tiles { background: #dfa2d3; box-shadow: 0 7px 0 #b456a4, 0 14px 18px #7e427b2f; }
.mode-killer .mode-art .art-tiles i { color: #7b3972; background: #fff5fb; }
.mode-killer .mode-art > span:last-child { background: #9c4590; }

.tempo-profile-head { display: flex; align-items: center; gap: 10px; margin: 4px 0 17px; }
.tempo-profile-head > div { min-width: 0; flex: 1; }
.tempo-profile-head h1 { overflow-wrap: anywhere; font-size: clamp(24px, 5.8vw, 37px); }
.tempo-profile-avatar { flex: none; width: 48px; height: 48px; display: grid; place-content: center; border-radius: 15px; font-size: 26px; font-weight: 820; color: white; background: linear-gradient(145deg, #9070eb, #5933b9); }
.tempo-gear { font-size: 11px; padding-inline: 8px; flex: none; }
.tempo-stats-grid { grid-template-columns: 1fr 1fr; margin-top: 10px; }
.tempo-stats-grid .tempo-stat { background: #fbf9ff; box-shadow: none; }
.tempo-total { margin-top: 10px; }
.calendar-head h2::first-letter { text-transform: uppercase; }
.tempo-icon-button { min-height: 35px; min-width: 35px; padding: 0; background: #eee9fb; color: #5336ad; font-size: 24px; }
.tempo-calendar { margin-top: 9px; display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 4px; }
.cal-weekday { text-align: center; color: var(--muted); font-size: 11px; font-weight: 700; margin: 5px 0; }
.tempo-button.cal-day { min-height: 35px; padding: 0; background: #f4effb; color: #563f87; border-radius: 7px; font-weight: 730; font-size: 12px; }
.cal-day.done { background: #daeff2; color: #256b70; }
.cal-day.current { border-color: #7750ed; box-shadow: inset 0 0 0 1px #7750ed; }
.month-awards, .tempo-badge-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 6px; margin-top: 9px; }
.month-award, .tempo-badge { display: grid; justify-items: center; align-content: start; gap: 3px; min-width: 0; padding: 9px 4px; border: 1px solid #eee9f6; border-radius: 12px; text-align: center; color: #66597d; background: #fbf9ff; font-size: 11px; }
.month-award > span:last-child::first-letter { text-transform: uppercase; }
.month-award strong { color: #503474; font-size: 15px; }
.badge-medal { width: 38px; aspect-ratio: 1; display: grid; place-content: center; margin-bottom: 3px; color: #6d627f; background: #ece7f4; border-radius: 13px; }
.badge-medal svg { width: 21px; height: 21px; }
.earned .badge-medal { color: #845217; background: #ffeab0; box-shadow: 0 3px 0 #e9ce8b; }
.earned.color-1 .badge-medal { background: #d8d0ff; box-shadow: 0 3px 0 #c6b8f8; color: #5636b1; }
.earned.color-2 .badge-medal { background: #d5f4f2; box-shadow: 0 3px 0 #b5e2df; color: #24797e; }
.earned.color-3 .badge-medal { background: #f8d7ee; box-shadow: 0 3px 0 #e9badd; color: #903878; }
.tempo-badge h3 { margin: 1px 0 0; color: var(--ink); font-size: 12px; line-height: 1.14; }
.tempo-badge p { color: var(--muted); line-height: 1.3; }
.tempo-badge small { font-variant-numeric: tabular-nums; font-weight: 730; margin-top: 3px; }
.tempo-settings { display: grid; margin-top: 6px; }
.tempo-setting { display: flex; align-items: center; justify-content: space-between; min-height: 47px; gap: 6px; padding: 6px 0; background: transparent; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 13px; text-align: left; }
.tempo-setting:last-child { border-bottom: 0; }
.tempo-setting i { width: 37px; height: 21px; padding: 3px; border-radius: 20px; background: #d5cfe3; flex: none; }
.tempo-setting i::before { content: ""; display: block; width: 15px; height: 15px; background: #fff; border-radius: 50%; }
.tempo-setting[aria-checked="true"] i { background: var(--violet); }
.tempo-setting[aria-checked="true"] i::before { transform: translateX(16px); }

.game-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 11px; margin-bottom: 12px; }
.game-heading h1 { color: var(--ink); font-size: clamp(26px, 6vw, 43px); line-height: 1.06; letter-spacing: -.055em; }
.game-heading p { width: 100%; color: var(--muted); font-size: 13px; }
.game-heading .game-back { display: inline-flex; align-items: center; gap: 6px; padding: 0 11px; min-height: 42px; }
body[data-page="game"] .tabs { display: none; }
body[data-page="game"] .app { min-height: 0; padding-bottom: calc(15px + env(safe-area-inset-bottom)); }
.game-layout { display: grid; grid-template-columns: minmax(0, 486px) minmax(205px, 1fr); gap: 16px; align-items: start; }
.game-card { --game-line: #e5ddf3; --block-line: #786293; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: var(--shadow); }
.metric-strip { display: flex; align-items: stretch; gap: 5px; margin-bottom: 8px; }
.metric { display: grid; flex: 1; min-width: 0; gap: 2px; align-content: center; min-height: 43px; padding: 5px 8px; border-radius: 9px; background: #f6f2fc; }
.metric span { color: var(--muted); font-size: 10px; }
.metric strong { color: var(--ink); font-size: 14px; font-weight: 780; font-variant-numeric: tabular-nums; }
.metric .accent, .side-card .progress-text { color: #5532c1; }

.board { --dimension: 9; display: grid; grid-template: repeat(var(--dimension), minmax(0,1fr)) / repeat(var(--dimension), minmax(0,1fr)); width: 100%; aspect-ratio: 1; overflow: hidden; border: 2px solid var(--block-line); border-radius: 11px; background: #fff; touch-action: manipulation; }
.board-mini { --dimension: 6; }
.cell { position: relative; display: grid; place-items: center; min-width: 0; min-height: 0; padding: 0; border: 0; border-right: 1px solid var(--game-line); border-bottom: 1px solid var(--game-line); border-radius: 0; color: #472b8f; background: #fff; font-variant-numeric: tabular-nums; font-size: clamp(16px, 5.5vw, 27px); font-weight: 680; line-height: 1; user-select: none; }
.board:not(.board-mini) .cell:nth-child(3n):not(:nth-child(9n)), .board-mini .cell:nth-child(3n):not(:nth-child(6n)) { border-right: 2px solid var(--block-line); }
.board:not(.board-mini) .cell:nth-child(n+19):nth-child(-n+27),
.board:not(.board-mini) .cell:nth-child(n+46):nth-child(-n+54),
.board-mini .cell:nth-child(n+7):nth-child(-n+12),
.board-mini .cell:nth-child(n+19):nth-child(-n+24) { border-bottom: 2px solid var(--block-line); }
.board:not(.board-mini) .cell:nth-child(9n), .board-mini .cell:nth-child(6n) { border-right: 0; }
.board:not(.board-mini) .cell:nth-child(n+73), .board-mini .cell:nth-child(n+31) { border-bottom: 0; }
.cell.given { color: #26203d; background: #faf8ff; font-weight: 770; }
.cell.related { background: #f2edfc; }
.cell.same { background: #e8ddff; }
.cell.confirmed { color: #4d2bb8; }
.cell.confirmed::after { position: absolute; bottom: 4px; right: 4px; width: 7px; height: 4px; border: solid currentColor; border-width: 0 0 1.5px 1.5px; transform: rotate(-45deg); content: ""; pointer-events: none; }
.cell.frozen { color: #23678b; background: #ddf3fb; }
.cell.conflict { color: #a11d38; background: #ffeaf0; }
.cell.conflict::after { position: absolute; bottom: 4px; right: 4px; width: 5px; aspect-ratio: 1; background: currentColor; border-radius: 50%; content: ""; pointer-events: none; }
.cell.selected { z-index: 1; background: #e4d8ff; box-shadow: inset 0 0 0 2px #643cd0; }
.cell.selected.frozen { background: #ccecf8; }
.cell.selected.conflict { background: #fbdbe4; }
.cell:focus-visible { z-index: 1; outline: 2px solid #4d30aa; outline-offset: -3px; }
.cell-ice { font-size: 19px; }
.candidates { display: grid; grid-template: repeat(3, minmax(0,1fr)) / repeat(3, minmax(0,1fr)); align-items: center; width: 100%; height: 100%; padding: 2px; color: #5f4f80; font-size: clamp(8px, 2.35vw, 12px); font-weight: 730; }
.board-mini .candidates { grid-template-rows: repeat(2,minmax(0,1fr)); }
.cage-bounds { position: absolute; inset: 2px; border: 1px dashed transparent; pointer-events: none; }
.cage-top { border-top-color: #936abb; }
.cage-bottom { border-bottom-color: #936abb; }
.cage-left { border-left-color: #936abb; }
.cage-right { border-right-color: #936abb; }
.cage-sum { position: absolute; top: 3px; left: 3px; z-index: 1; padding: 0 1px; color: #45245d; background: #fff9; font-size: clamp(8px, 2.3vw, 11px); font-weight: 850; }
.cell:has(.cage-sum) .cell-value { transform: translate(2px, 3px); }
.pause-cover { display: flex; align-items: center; justify-content: center; text-align: center; padding: 14px; background: #f5f0ff; border-color: #d7c8f0; }
.pause-cover p { margin-bottom: 11px; font-weight: 780; }
.tools, .keypad { display: grid; gap: 5px; margin-top: 7px; }
.tools { grid-template-columns: repeat(3, minmax(0,1fr)); }
.tools.tools-practice { grid-template-columns: repeat(5, minmax(0,1fr)); }
.tool { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 42px; padding: 2px 0; border: 1px solid #e7def2; border-radius: 9px; color: #584c73; background: #fbf9fe; font-size: clamp(9px, 2.55vw, 11px); line-height: 1; font-weight: 640; }
.tool svg { width: 15px; height: 15px; }
.tool:disabled { color: #857995; background: #faf8fd; }
.tool[aria-pressed="true"] { color: #4725ac; border-color: #d0bdf7; background: #eee5ff; }
.keypad { grid-template-columns: repeat(9,minmax(0,1fr)); }
.keypad-mini { grid-template-columns: repeat(6,minmax(0,1fr)); }
.number-key { display: grid; place-content: center; justify-items: center; gap: 2px; min-width: 0; min-height: 45px; padding: 0; border: 1px solid #dfd2f5; border-radius: 9px; background: #f2ebff; color: #4e2dac; font-size: 21px; font-weight: 770; line-height: 1; font-variant-numeric: tabular-nums; }
.number-key:disabled { background: #f7f3fc; color: #7e6f99; border-color: #ede5f4; }
.number-count { color: #665783; font-size: 9px; font-weight: 700; }
.game-side { display: grid; gap: 9px; }
.side-card { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.side-head, .side-title { display: flex; align-items: center; gap: 7px; }
.side-head { justify-content: space-between; margin-bottom: 6px; }
.side-title { font-size: 14px; font-weight: 770; }
.side-title svg { color: #603bc1; width: 17px; height: 17px; }
.side-card p { color: var(--muted); font-size: 12px; line-height: 1.43; }
.progress-text, .countdown { color: #5734b3; font-size: 12px; font-weight: 740; font-variant-numeric: tabular-nums; white-space: nowrap; }
.meter { height: 5px; margin: 9px 0; overflow: hidden; background: #ede5f7; border-radius: 6px; }
.meter div { height: 100%; background: #7651de; border-radius: 6px; transition: width .18s ease; }
.next { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 9px; color: var(--muted); font-size: 12px; }
.action-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 10px; min-height: 40px; border: 1px solid transparent; border-radius: 10px; background: var(--violet); color: #fff; font-size: 13px; font-weight: 760; }
.action-btn.secondary { color: #4b30a4; border-color: #e5d9f8; background: #f2ebff; }
.win { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 8px; margin-bottom: 8px; padding: 9px; border: 1px solid #bce3d2; border-radius: 11px; color: #1d674c; background: #e7f8ef; font-size: 13px; }
.win .action-btn { min-height: 33px; margin-left: auto; }
@media (hover: hover) {
  .tool:not(:disabled):hover, .number-key:not(:disabled):hover { background: #efe6fb; color: #45278e; }
  .tempo-feature:hover { border-color: #d8c6f1; }
}
@media (min-width: 670px) {
  .tempo-home { grid-template-columns: minmax(0, 1.22fr) minmax(0, 1fr); gap: 15px 18px; }
  .tempo-hero, .tempo-stat-strip { grid-column: 1 / -1; }
  .tempo-event { grid-column: 1 / -1; }
  .tempo-hero { min-height: 277px; }
  .tempo-hero__body { padding: 29px 36px; }
  .tempo-hero__art { width: 53%; right: 0; background-position: center 43%; }
  .tempo-stat { padding: 13px; }
  .tempo-section { align-self: start; }
  .tempo-feature { min-height: 146px; }
  .tempo-modes { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .mode-card { min-height: 258px; }
  .mode-info { width: 100%; padding-top: 99px; }
  .mode-art { right: 16px; top: 0; transform: scale(.77) rotate(-15deg); }
  .tempo-panel { padding: 19px; }
  .tempo-badge-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .tempo-settings { max-width: 500px; }
}
@media (max-width: 669px) {
  .shell { width: min(calc(100% - 28px), 490px); }
  .masthead { height: 57px; }
  .tabs { min-height: 61px; padding-inline: 9px; border-inline: 0; }
  .tab { flex-direction: column; gap: 3px; font-size: 10px; }
  body[data-page="game"] .masthead { display: none; }
  .game-layout { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .game-card, .game-side { width: min(100%, max(280px, calc(100svh - 207px))); margin-inline: auto; }
  .game-card { padding: 7px; border-radius: 15px; }
  .game-heading { width: min(100%, max(280px, calc(100svh - 207px))); margin: 0 auto 8px; }
  .game-heading h1 { font-size: clamp(23px, 7vw, 32px); }
  .game-heading p { font-size: 12px; }
  .game-heading .game-back { min-width: 42px; padding: 0; }
  .game-back-label { display: none; }
  .game-side { gap: 7px; }
  .tool svg { width: 14px; height: 14px; }
}
@media (max-width: 360px) {
  .shell { width: calc(100% - 20px); }
  .tempo-stat { padding: 7px; column-gap: 4px; }
  .tempo-stat-icon { width: 22px; height: 22px; }
  .tempo-hero__art { width: 65%; right: -12%; }
  .tempo-gear { font-size: 0; min-width: 39px; }
  .tempo-gear svg { width: 18px; height: 18px; }
  .keypad { gap: 3px; }
}
@media (prefers-reduced-motion: reduce) { .meter div { transition: none; } }
