/* The lobby and the active board share game state, but have separate layouts. */
body[data-screen] .app-shell { width: min(1040px, calc(100% - 80px)); margin: 0 auto; }
body[data-screen] .masthead { height: 88px; min-height: 0; gap: 24px; padding: 0; flex-wrap: nowrap; }
body[data-screen] .brand { gap: 10px; }
body[data-screen] .brand h1 { font-size: 22px; }
body[data-screen] .brand img { width: 38px; height: 38px; }
body[data-screen] .brand span { font-size: 8px; }
body[data-screen] .game-types { align-self: stretch; align-items: stretch; padding: 0; gap: 12px; background: none; border-radius: 0; }
body[data-screen] .game-types button { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; height: auto; min-width: 82px; padding: 0 12px; border-radius: 0; font-size: 13px; }
body[data-screen] .game-types svg { width: 18px; height: 18px; }
body[data-screen] .game-types button[aria-selected=true] { color: var(--green); font-weight: 650; }
body[data-screen] .game-types button[aria-selected=true]::after { content: ''; position: absolute; height: 3px; left: 12px; right: 12px; bottom: -1px; background: var(--green); }
body[data-screen] .header-actions { gap: 4px; }
body[data-screen] .header-divider, body[data-screen] .edition, body[data-screen] #help-button, body[data-screen] #settings-button { display: none; }
body[data-screen] main { padding: 36px 0 44px; min-height: calc(100dvh - 153px); }
body[data-screen] footer { min-height: 65px; }
.hub-page { max-width: 900px; margin: 0 auto; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 30px; }
.page-kicker { color: var(--muted); font-size: 10px; font-weight: 550; }
.page-heading h2 { font-size: 30px; line-height: 1.3; font-weight: 650; margin: 8px 0 0; }
.local-label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.local-label > span { width: 5px; height: 5px; background: var(--green); border-radius: 50%; }
.page-badge { padding: 7px 10px; border-radius: 4px; font-size: 11px; white-space: nowrap; }
.daily-accent { color: #476fa5; background: #eaf0f9; }
.campaign-accent { color: #b65b4a; background: #faeae4; }
.hub-page .rank-summary { padding: 20px 0; margin: 0; border-top: 1px solid var(--line); gap: 16px 30px; }
.hub-page .rank-identity { gap: 20px; flex: 1; }
.hub-page .rank-identity strong { font-size: 19px; }
.hub-page .rank-metrics { max-width: 400px; font-size: 11px; }
.hub-page #rank-reward { display: none; }
.hub-page .rank-insignia { --insignia-width: 132px; }
.classic-launch { display: flex; align-items: center; flex-direction: column; text-align: center; padding: 32px 0 30px; }
.launch-logo { width: 76px; height: 76px; }
.classic-launch h3 { font-size: 23px; font-weight: 550; margin: 16px 0 24px; }
#home-difficulty { width: min(420px, 100%); }
#home-difficulty .difficulty { width: 100%; margin: 0; padding: 5px; gap: 4px; }
#home-difficulty .difficulty button { flex: 1; min-width: 0; padding: 10px; font-size: 13px; }
#home-difficulty .difficulty .custom-level { flex: 0 0 44px; }
#home-difficulty .difficulty button span { font-size: 10px; }
.launch-spec { margin: 16px 0 22px; font-size: 12px; color: var(--muted); }
.launch-button { min-width: 210px; min-height: 48px; font-size: 14px; gap: 12px; padding: 12px 24px; }
.launch-button svg { width: 18px; height: 18px; }
.launch-save { display: block; min-height: 17px; margin-top: 12px; font-size: 11px; line-height: 1.5; color: var(--muted); }
.home-destinations { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.entertainment-destination { grid-column: 1 / -1; border-top: 1px solid var(--line); }
.destination { display: flex; align-items: center; gap: 16px; padding: 24px 12px; text-align: left; min-width: 0; }
.destination + .destination { border-left: 1px solid var(--line); padding-left: 30px; }
.destination:hover { background: var(--surface); }
.destination-icon { width: 42px; height: 42px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; }
.destination strong { display: block; font-size: 14px; font-weight: 600; }
.destination small { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; }
.destination > svg { margin-left: auto; color: var(--muted); width: 16px; }
.daily-overview { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 24px; padding: 0 0 28px; border-bottom: 1px solid var(--line); }
.daily-overview > span { display: flex; flex-direction: column; gap: 10px; font-size: 11px; color: var(--muted); }
.daily-overview strong { color: var(--text); font-size: 23px; font-weight: 550; font-variant-numeric: tabular-nums; }
.daily-overview > span:last-child strong { font-size: 14px; line-height: 28px; }
#daily-content .daily-sidebar { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 44px; padding: 28px 0; border: 0; }
#daily-content .daily-calendar-section { border: 0; padding: 0; }
#daily-content .daily-route-section { padding: 0; }
#daily-content .daily-day, #daily-content .daily-calendar-blank { height: 48px; }
#daily-content .daily-day { font-size: 13px; }
#daily-content .daily-day[aria-pressed=true] { background: var(--green-soft); border-color: var(--green); }
#daily-content .daily-calendar-toolbar { margin-bottom: 16px; }
#daily-content .daily-route-section h3 { margin: 9px 0 25px; font-size: 14px; }
#daily-content .daily-tiers button { min-height: 83px; padding: 16px 12px; }
#daily-content .daily-tiers button[aria-pressed=true] { background: var(--surface); }
.page-launch { display: flex; align-items: center; justify-content: space-between; gap: 24px; border-top: 1px solid var(--line); padding-top: 24px; }
.page-launch > div { min-width: 0; }
.page-launch strong { display: block; font-size: 16px; font-weight: 600; }
.page-launch > div > span { display: block; color: var(--muted); margin-top: 9px; font-size: 11px; line-height: 1.7; }
.campaign-brief { display: flex; gap: 36px; padding: 0 0 24px; border-bottom: 1px solid var(--line); }
.campaign-brief > span { display: flex; gap: 9px; align-items: center; font-size: 11px; color: var(--muted); }
.campaign-brief strong { font-size: 17px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.campaign-brief svg { width: 16px; color: var(--green); }
.campaign-brief > span:nth-child(2) svg { color: var(--red); }
#campaign-content .campaign-sidebar { display: flex; flex-direction: column; gap: 0; padding: 0; border: 0; }
#campaign-content .campaign-summary { order: 2; border: 0; margin: 0; padding: 0; }
#campaign-content .campaign-summary > :not(.campaign-best) { display: none; }
#campaign-content .campaign-best { border: 0; margin: 0 0 22px; padding: 0; justify-content: flex-end; }
#campaign-content .campaign-best strong { margin-left: 8px; width: auto; }
#campaign-content .campaign-route-section { margin: 0; padding: 0; }
#campaign-content .campaign-route-section .section-title { margin: 24px 0 0; }
#campaign-content .campaign-route { display: grid; grid-template-columns: repeat(var(--map-columns), minmax(0, 1fr)); gap: 0; margin: 18px 0; padding: 18px 0; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 24px 24px; }
#campaign-content .campaign-route li { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: flex-start; gap: 7px; height: 102px; border: 0; padding: 0 4px; font-size: 11px; text-align: center; color: var(--muted); }
#campaign-content .route-number { position: relative; z-index: 1; display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; background: var(--bg); font-size: 12px; color: var(--muted); }
#campaign-content .route-mines { margin: 0; font-size: 10px; background: var(--bg); padding: 1px 4px; }
#campaign-content .campaign-route li > span:nth-child(2) { background: var(--bg); padding: 1px 4px; z-index: 1; }
#campaign-content .campaign-route li::before { content: ''; position: absolute; top: 18px; height: 0; border-top: 2px dashed var(--line); left: 50%; width: 100%; z-index: -1; }
#campaign-content .campaign-route li[data-direction=left]::before { left: auto; right: 50%; }
#campaign-content .campaign-route li[data-direction=down]::before { top: 18px; left: 50%; width: 0; height: 102px; border-top: 0; border-left: 2px dashed var(--line); }
#campaign-content .campaign-route li.route-end::before { display: none; }
#campaign-content .campaign-route .current { color: var(--green); }
#campaign-content .campaign-route .current .route-number { background: var(--green); color: var(--surface); border-color: var(--green); box-shadow: 0 0 0 5px var(--green-soft); }
#campaign-content .campaign-route .complete .route-number { background: var(--green-soft); color: var(--green); border-color: var(--green); }
#campaign-content .campaign-route .complete::before { border-color: var(--green); border-top-style: solid; border-left-style: solid; }
#profile-page .medal-summary { margin: 0; padding: 24px 0; border-bottom: 1px solid var(--line); }
#profile-page .medal-summary-heading h3 { font-size: 14px; }
#profile-stats .sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 42px; padding: 26px 0; border: 0; }
#profile-stats .totals-section { grid-column: 1 / -1; grid-row: 1; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
#profile-stats .totals { justify-content: flex-start; gap: 100px; padding-top: 10px; }
#profile-stats .totals strong { font-size: 28px; }
#profile-stats .stats-section { margin: 0; }
#profile-stats .recent-section { display: block; }
#profile-stats .sidebar-art { display: none; }
.profile-links { display: grid; grid-template-columns: 1fr 1fr; column-gap: 42px; border-top: 1px solid var(--line); }
.profile-links button { display: flex; align-items: center; gap: 12px; min-height: 62px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; }
.profile-links button:hover { color: var(--green); }
.profile-links button > svg:first-child { width: 18px; color: var(--muted); }
.profile-links button > svg:last-child { width: 16px; margin-left: auto; color: var(--muted); }
.profile-links small { margin-left: auto; color: var(--muted); font-size: 11px; }
.profile-links small + svg:last-child { margin-left: 0; }
#profile-replays .replay-history { margin-top: 30px; scroll-margin-top: 24px; }
body[data-screen=game] main { padding-top: 24px; }
.game-page { max-width: 100%; margin: 0 auto; }
.game-session-heading { display: flex; align-items: center; gap: 14px; margin: 0 auto 26px; max-width: 680px; }
.game-session-heading h2 { margin: 0 0 5px; font-size: 18px; font-weight: 600; }
.game-session-heading > div > span { color: var(--muted); font-size: 11px; }
.game-session-heading > button:last-child { margin-left: auto; }
.game-page > .game-heading { display: none; }
.game-page .workspace, .game-page .workspace.wide { display: block; }
.game-page .play-area { width: 100%; max-width: 680px; margin: auto; }
.game-page .wide .play-area { max-width: 100%; }
.game-page .board-stage { background: none; border: 0; border-radius: 0; padding: 8px 0; box-shadow: none; }
.board-view-controls { display: flex; align-items: center; justify-content: flex-end; gap: 5px; max-width: 640px; margin: 0 auto 8px; min-height: 34px; }
.board-view-controls .icon-button { width: 32px; height: 32px; flex-shrink: 0; }
.board-view-controls svg { width: 17px; height: 17px; }
.board-view-controls input { width: 104px; min-width: 40px; height: 24px; accent-color: var(--green); cursor: pointer; }
.board-view-controls output { width: 42px; text-align: center; font: 11px ui-monospace, monospace; font-variant-numeric: tabular-nums; color: var(--muted); }
#board-zoom-fit[aria-pressed=true] { background: var(--green-soft); color: var(--green); }
#board[data-zoomed] { --cell: var(--zoom-cell) !important; --gap: var(--zoom-gap) !important; }
#board[data-zoomed] .cell { font-size: var(--zoom-font); }
#board[data-zoomed] .cell svg { width: var(--zoom-icon); height: var(--zoom-icon); }
.combo-testing .board-view-controls { display: none; }
.game-page .game-toolbar, .game-page .play-controls, .game-page .board-bottom, .game-page .campaign-hud { width: 100%; max-width: 640px; margin-left: auto; margin-right: auto; }
.game-page .game-toolbar { margin-bottom: 16px; }
.game-page .play-controls { margin-top: 18px; }
.game-page .combo-live { position: static; max-width: 640px; margin-left: auto; margin-right: auto; }
.game-page .session-extras { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; min-height: 44px; max-width: 640px; margin: 0 auto 12px; }
.game-page .session-extras .combo-live { flex: 1 1 190px; width: auto; min-height: 40px; margin: 0; padding: 0; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 3px 8px; }
.game-page .combo-current strong { font-size: 24px; min-width: 26px; line-height: 30px; }
.game-page .combo-score-block { gap: 5px; }
.game-page .combo-score-block > strong { font-size: 19px; }
.game-page .combo-score-block > span { font-size: 10px; }
.game-page .pause-tip { display: none; }
.game-page .pause-overlay { gap: 12px; }
.game-page .campaign-hud { margin-bottom: 14px; padding-bottom: 14px; }
[data-theme=dark] .daily-accent { background: #293747; color: #a2bfe5; }
[data-theme=dark] .campaign-accent { background: #422f2b; color: #e6ac97; }
[data-theme=dark] #campaign-content .campaign-route .current .route-number { color: #17281f; }
@media (max-width: 800px) {
  body[data-screen] .app-shell { width: calc(100% - 40px); }
  body[data-screen] .masthead { gap: 12px; }
  body[data-screen] .game-types { gap: 0; }
  body[data-screen] .game-types button { min-width: 68px; padding: 0 10px; gap: 6px; }
  body[data-screen] .game-types svg { width: 16px; }
  .hub-page .rank-metrics { max-width: 340px; }
  #daily-content .daily-sidebar { gap: 24px; }
  .campaign-brief { gap: 20px; }
}
@media (max-width: 620px) {
  body[data-screen] .app-shell { width: calc(100% - 36px); }
  body[data-screen] .masthead { height: 72px; }
  body[data-screen] .brand h1 { font-size: 20px; }
  body[data-screen] .brand img { width: 34px; height: 34px; }
  body[data-screen] main { padding: 25px 0 30px; min-height: calc(100dvh - 210px); }
  body[data-screen] .game-types { position: fixed; z-index: 20; bottom: 0; left: 0; right: 0; width: 100%; height: calc(66px + env(safe-area-inset-bottom)); padding: 0 8px env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
  body[data-screen] .game-types button { flex-direction: column; gap: 6px; font-size: 10px; min-width: 0; padding: 10px 2px; }
  body[data-screen] .game-types svg { width: 20px; height: 20px; }
  body[data-screen] .game-types button[aria-selected=true]::after { left: calc(50% - 12px); right: auto; top: 0; width: 24px; height: 2px; bottom: auto; }
  body[data-screen] footer { margin-bottom: calc(66px + env(safe-area-inset-bottom)); min-height: 60px; }
  body[data-screen=game] footer { margin-bottom: 0; }
  .page-heading { margin-bottom: 24px; }
  .page-heading h2 { font-size: 26px; }
  .page-kicker { font-size: 9px; }
  .local-label { font-size: 10px; }
  .hub-page .rank-summary { gap: 12px; padding: 16px 0; }
  .hub-page .rank-identity { gap: 18px; }
  .hub-page .rank-insignia { --insignia-width: 116px; }
  .hub-page .rank-identity strong { font-size: 17px; }
  .hub-page .rank-metrics { flex-basis: 100%; max-width: none; gap: 4px 12px; font-size: 10px; }
  .hub-page #rank-next { margin-left: auto; }
  .hub-page .rank-progress { margin-top: 2px; height: 5px; }
  .classic-launch { padding: 24px 0; }
  .launch-logo { width: 62px; height: 62px; }
  .classic-launch h3 { font-size: 20px; margin: 13px 0 20px; }
  #home-difficulty .difficulty button { padding: 9px 4px; font-size: 12px; }
  .launch-spec { font-size: 11px; margin: 13px 0 18px; }
  .classic-launch .launch-button { width: 100%; }
  .home-destinations { gap: 0; }
  .destination, .destination + .destination { gap: 9px; padding: 18px 8px; }
  .destination-icon { width: 30px; height: 34px; border-radius: 5px; }
  .destination-icon svg { width: 17px; }
  .destination strong { font-size: 12px; }
  .destination small { font-size: 9px; line-height: 1.6; margin-top: 5px; }
  .destination > svg { display: none; }
  .daily-overview { gap: 12px; padding-bottom: 22px; }
  .daily-overview > span { font-size: 10px; gap: 8px; }
  .daily-overview strong { font-size: 21px; }
  .daily-overview > span:last-child strong { font-size: 11px; line-height: 1.8; }
  #daily-content .daily-sidebar { grid-template-columns: minmax(0, 1fr); gap: 22px; padding: 22px 0; }
  #daily-content .daily-day, #daily-content .daily-calendar-blank { height: 43px; }
  #daily-content .daily-calendar { gap: 2px; }
  #daily-content .daily-route-section h3 { margin: 0 0 12px; }
  #daily-content .daily-tiers button { min-height: 65px; padding: 10px; }
  .page-launch { flex-direction: column; align-items: stretch; gap: 16px; padding-top: 20px; }
  .page-launch strong { font-size: 14px; }
  .page-launch .launch-button { width: 100%; min-width: 0; }
  #daily-page, #campaign-page { padding-bottom: 100px; }
  #daily-page .page-launch, #campaign-page .page-launch { position: fixed; z-index: 19; bottom: calc(66px + env(safe-area-inset-bottom)); left: 0; right: 0; min-height: 92px; padding: 14px 18px; flex-direction: row; align-items: center; gap: 12px; background: var(--surface); }
  #daily-page .page-launch strong, #campaign-page .page-launch strong { font-size: 12px; line-height: 1.6; }
  #daily-page .page-launch > div > span, #campaign-page .page-launch > div > span { font-size: 10px; margin-top: 4px; }
  #daily-page .page-launch .launch-button, #campaign-page .page-launch .launch-button { min-width: 112px; min-height: 44px; width: auto; flex-shrink: 0; font-size: 12px; padding: 10px 12px; gap: 6px; }
  .campaign-brief { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; padding-bottom: 20px; }
  .campaign-brief > span { flex-wrap: wrap; gap: 6px; font-size: 10px; }
  .campaign-brief strong { font-size: 15px; }
  .campaign-brief svg { width: 14px; }
  #campaign-content .campaign-route li { font-size: 10px; }
  #profile-stats .sidebar { grid-template-columns: 1fr; gap: 24px; }
  #profile-stats .totals { justify-content: space-between; gap: 16px; }
  #profile-stats .totals-section { grid-column: 1; }
  .profile-links { grid-template-columns: 1fr; }
  .game-session-heading { gap: 10px; margin-bottom: 22px; }
  .game-session-heading h2 { font-size: 16px; }
  .game-page .game-toolbar { gap: 6px; }
  .game-page .counter, .campaign-active .game-page .counter { min-width: 0; gap: 7px; }
  .game-page .counter-symbol { width: 25px; }
  .game-page .counter strong { font-size: 21px; }
  .game-page .board { --cell: min(40px, calc((100vw - 68px) / 9)); }
  .game-page .campaign-hud { gap: 14px; grid-template-columns: minmax(0, 1fr) 125px; }
  .game-page .mission-name strong { font-size: 14px; }
  .game-page .wide .board-stage { padding: 8px 0; }
}
