/* Task-first app layer. Character art carries the theme; controls stay quiet. */
:root { --ui-surface: #21172d; --ui-border: #493751; --ui-copy: #d4c9df; }
.topbar { gap: 8px; padding-inline: 16px; }
.brand { font-size: 19px; gap: 7px; }
.brand-mark { width: 31px; height: 35px; }
.topbar-actions { gap: 8px; }
.profile-chip { min-height: 44px; gap: 5px; padding: 2px 8px 2px 3px; border-color: var(--ui-border); background: #261a33; }
.level-ring { width: 39px; height: 39px; padding: 0; background: none; overflow: visible; }
.level-ring .rig-character { width: 100%; height: 100%; }
.level-copy strong { font-size: 13px; }
.level-copy small { font-size: 9px; }
.screen-content > [data-screen] { padding: 16px 16px 22px; }
.screen-content > .hunt-page { display: block; }
.games-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 16px; }
.games-heading h1 { margin: 4px 0 0; font: 600 29px/1.1 var(--font-display); letter-spacing: -.025em; }
.games-heading .kicker { font-size: 11px; text-transform: none; letter-spacing: 0; color: var(--ui-copy); }
.today-count { flex-shrink: 0; padding: 7px 8px; border-radius: 9px; font-size: 11px; color: var(--ui-copy); background: #ffffff07; }
.game-hub { display: grid; gap: 12px; }
.game-card { min-width: 0; padding: 13px; border: 1px solid var(--ui-border); border-radius: 21px; background: var(--ui-surface); }
.game-card--hunt { background: linear-gradient(130deg,#2b2630,#1c1727); border-color: #627541; }
.game-card--sudoku { border-left: 3px solid #ba90ec; }
.game-card--schulte { border-left: 3px solid #92c66a; }
.game-card-top { display: flex; align-items: center; gap: 11px; }
.game-card-top > div { flex: 1; min-width: 0; }
.game-card h2 { margin: 0; font: 600 24px/1.1 var(--font-display); }
.game-card-top p { margin: 4px 0 0; font-size: 11px; color: var(--ui-copy); line-height: 1.3; }
.game-card-art { flex: 0 0 46px; width: 46px; height: 46px; }
.game-card-art .rig-character { width: 100%; height: 100%; transform: scale(1.2); }
.hunt-card-art img { width: 100%; height: 100%; object-fit: contain; transform: scale(1.3); }
.game-card .mode-mini-grid { width: 42px; flex-basis: 42px; gap: 2px; }
.game-card .mode-mini-grid i { height: 22px; }
.game-card--schulte .mode-mini-grid { transform: rotate(6deg); }
.game-card--schulte .mode-mini-grid i { color: #d3f7a9; background: #34442d; border-color: #93bd5866; }
.mode-progress { align-self: flex-start; padding: 4px 6px; font-size: 11px; font-weight: 800; color: var(--ui-copy); background: #ffffff08; border-radius: 7px; white-space: nowrap; }
.mode-progress small,.mode-progress b { display: block; text-align: center; }.mode-progress small { font-size: 8px; font-weight: 600; margin-bottom: 2px; }
.hunt-card-rule { display: flex; align-items: center; gap: 8px; margin: 9px 0; }
.hunt-card-rule > span { width: 44px; flex: 0 0 44px; height: 44px; }
.hunt-card-rule .rig-character { width: 100%; height: 100%; }
.hunt-card-rule strong { font-size: 12px; color: #e5f4ca; }
.hunt-card-rule p { margin: 2px 0 0; font-size: 12px; line-height: 1.35; color: var(--ui-copy); }
.hub-detail { margin: 11px 0; color: var(--ui-copy); font-size: 12px; line-height: 1.4; }
.game-card-actions { display: grid; grid-template-columns: minmax(0,1fr) 85px; gap: 10px; }
.primary-button { box-shadow: inset 0 1px 0 #ffffff65,0 3px 0 #598826; min-height: 48px; min-width: 0; padding-inline: 15px; border-radius: 14px; font-size: 14px; }
.primary-button:hover { transform: none; box-shadow: inset 0 1px 0 #ffffff65,0 3px 0 #598826; }
.primary-button:active { transform: translateY(2px); box-shadow: 0 1px 0 #598826; }
.secondary-button { min-height: 46px; box-shadow: none; border: 1px solid #86659b; border-radius: 14px; font-size: 14px; }
.hub-options { min-height: 48px; border: 1px solid #716077; border-radius: 14px; background: #ffffff06; font-size: 12px; font-weight: 800; }
.hub-options span { margin-left: 5px; font-size: 19px; }
.hub-note { margin: 15px 2px 0; color: #b5a8c3; font-size: 11px; text-align: center; }
.game-card--sudoku .primary-button { background: #dab9ff; box-shadow: inset 0 1px 0 #ffffff65,0 3px 0 #8060a5; }
.game-card--schulte .primary-button { background: #bddd94; box-shadow: inset 0 1px 0 #ffffff65,0 3px 0 #668341; }
.bottom-nav { background: #180f24; border-top-color: #3f2d4e; }
.nav-item { min-height: 52px; font-size: 11px; color: #baacc9; }
.nav-item.active { color: #d0fb81; background: #a1cb4510; }
button:focus-visible,a:focus-visible,summary:focus-visible { outline: 3px solid #f1c765; outline-offset: 3px; }
.text-button { min-height: 44px; }
.puzzle-lobby .puzzle-intro { min-height: 0; padding: 16px; margin-bottom: 14px; border-radius: 21px; background: var(--ui-surface); box-shadow: none; }
.puzzle-lobby .puzzle-intro::before { display: none; }
.puzzle-lobby .puzzle-intro h2 { font-size: 31px; margin: 6px 0 8px; }
.puzzle-lobby .puzzle-intro > p { max-width: calc(100% - 72px); font-size: 12px; }
.puzzle-lobby .puzzle-intro-art { width: 92px; right: 1px; bottom: 10px; }
.puzzle-lobby .puzzle-intro .modal-kicker { font-size: 10px; letter-spacing: .04em; }
.puzzle-back { margin: -6px 0 4px; }
.puzzle-ready-card { margin: 10px 0 4px; padding: 10px 12px; background: #251c31; border-radius: 16px; }
.puzzle-ready-number { box-shadow: none; }
.puzzle-ready-card small { font-size: 12px; }
.puzzle-lobby-heading { margin-top: 23px; gap: 10px; }
.puzzle-lobby-heading h3 { font-size: 21px; }
.puzzle-lobby-heading > span { font-size: 12px; }
.level-selection-note { margin: 8px 0 0; font-size: 12px; color: var(--ui-copy); }
.puzzle-level-options { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
.puzzle-level-options button { display: grid; gap: 5px; padding: 11px 3px; min-height: 95px; background: #251b32; border-color: var(--ui-border); }
.puzzle-level-options small { font-size: 11px; color: var(--ui-copy); }
.puzzle-level-options strong { font: 600 24px var(--font-display); }
.puzzle-level-options span { font-size: 10px; color: var(--ui-copy); }
.puzzle-level-options button:disabled { opacity: .65; }
.puzzle-lobby-note { font-size: 12px; margin-top: 13px; }
.saved-party { padding: 13px; background: #b2df6310; border: 1px solid #8caf5070; border-radius: 16px; display: flex; align-items: center; gap: 8px; }
.saved-party > div { flex: 1; min-width: 0; }
.puzzle-lobby .saved-party .puzzle-continue { width: auto; margin: 0; font-size: 12px; }
.saved-party strong,.saved-party small { display: block; }
.saved-party small { color: var(--ui-copy); margin-top: 4px; font-size: 12px; }
.puzzle-lobby .saved-party .primary-button { min-height: 46px; }
.puzzle-hud { padding: 6px 10px; flex-basis: 53px; gap: 18px; }
.puzzle-hud > span:not(:last-child) { display: grid; gap: 0; }
.puzzle-hud #puzzleTarget { padding: 8px 12px; font: 600 23px var(--font-display); white-space: nowrap; background: #b8e879; color: #1c2820; border-radius: 11px; }
.puzzle-stage[data-mode="sudoku"] #puzzleTarget { font-size: 18px; background: #dcc4f0; }
.sudoku-keypad button { min-height: 48px; gap: 0; line-height: 1; box-shadow: inset 0 1px 0 #ffffff30; }
.sudoku-keypad button strong { font: 600 23px var(--font-display); }
.sudoku-keypad button small { font: 700 9px var(--font-body); color: #e0d1ed; }
.sudoku-keypad button.number-complete { background: #261d30; color: #a99ab9; }
.puzzle-tools small { font-size: 10px; }
.puzzle-status { font-size: 12px; }
.mode-tabs { display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; padding: 4px; margin: 16px 0; background: #130d1c; border: 1px solid var(--ui-border); border-radius: 14px; }
.mode-tabs button { min-height: 44px; border: 0; border-radius: 10px; font-size: 13px; font-weight: 800; background: transparent; color: var(--ui-copy); }
.mode-tabs button[aria-pressed="true"] { background: #493354; color: #fff0ff; }
.trail-metrics { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.trail-metrics article { padding: 16px 13px; min-height: 90px; border: 1px solid var(--ui-border); border-radius: 17px; background: var(--ui-surface); }
.trail-metrics small { display: block; font-size: 12px; color: var(--ui-copy); }
.trail-metrics strong { display: block; margin-top: 9px; font: 600 26px var(--font-display); }
.trail-next { margin-top: 14px; padding: 13px; background: #b6f23208; border: 1px solid #b6f2322b; border-radius: 17px; }
.trail-next p { margin: 0 0 10px; font-size: 12px; line-height: 1.5; color: var(--ui-copy); }
.trail-next button { width: 100%; }
.trail-history-title { font-size: 18px; margin-top: 20px; }
.trail-row { padding: 13px 0; border-radius: 0; background: none; border-bottom: 1px solid #ffffff12; gap: 10px; }
.trail-row strong { font-size: 13px; }.trail-row small { font-size: 11px; line-height: 1.5; }.trail-row > b { white-space: nowrap; font-size: 15px; }
.cloud-status { font-size: 11px; }
.other-companions { margin-top: 22px; border-top: 1px solid var(--ui-border); }
.profile-page .personal-companions { margin-top: 15px; }
.personal-companions small { font-size: 11px; line-height: 1.3; }
.other-companions summary { cursor: pointer; padding: 17px 2px; min-height: 44px; font-size: 15px; font-weight: 800; }
.other-companions summary > span { display: block; color: var(--ui-copy); font-size: 11px; font-weight: 600; margin: 4px 0; }
.den-note { font-size: 12px; line-height: 1.5; color: var(--ui-copy); }
.ranking-modal .modal-note { font-size: 12px; line-height: 1.5; margin: 9px 0 16px; }
.ranking-modal h2 { font-size: 30px; }.ranking-period button { min-height: 44px; font-size: 13px; }.ranking-filter { font-size: 12px; }
.ranking-filter select { min-height: 44px; font-size: 13px; }.ranking-row-name { font-size: 14px; }.ranking-footnote { font-size: 11px; }
.modal h2 { font-size: 29px; line-height: 1.15; }
.result-modal,.puzzle-result-modal { padding: 16px 20px; }
.result-modal .result-cat,.puzzle-result-modal .result-cat { width: 68px; margin: 0 auto 1px; }
.result-modal .modal-kicker,.puzzle-result-modal .modal-kicker { font-size: 10px; }
.result-modal h2,.puzzle-result-modal h2 { margin: 7px 26px 9px; font-size: 27px; }
.result-message { margin: 0 0 12px; font-size: 12px; line-height: 1.4; }
.result-score { margin: 6px 0 13px; }.result-score strong { font-size: 49px; text-shadow: none; }
.result-stats { gap: 8px; margin-bottom: 12px; }.result-stats div { padding: 9px; border-radius: 13px; }.result-stats small { font-size: 12px; }.result-stats strong { font-size: 21px; }
.result-progress { padding: 10px; font-size: 12px; line-height: 1.4; margin: 0 0 13px; }
.result-modal .secondary-button,.puzzle-result-modal .secondary-button,.puzzle-result-modal .primary-button { width: 100%; margin-top: 9px; }
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0 0; }.result-actions .text-button { font-size: 13px; border: 1px solid var(--ui-border); border-radius: 12px; }
.result-ranking { font-size: 10px; line-height: 1.4; margin: 10px 0 0; padding: 0; background: none; border: 0; }
.puzzle-confirm-modal button { width: 100%; margin-top: 10px; }.puzzle-confirm-modal .modal-note { font-size: 14px; line-height: 1.6; }
@media (max-width:360px) {
  .topbar { padding-inline: 12px; }.brand { font-size: 17px; }.brand-mark { width: 26px; }.topbar-actions { gap: 5px; }.level-copy { display: none; }.profile-chip { padding: 2px; }
  .screen-content > [data-screen] { padding-inline: 12px; }.games-heading h1 { font-size: 25px; }.games-heading .kicker { font-size: 10px; }
  .game-card { padding: 11px; }.game-card-top { gap: 8px; }.game-card h2 { font-size: 22px; }.game-card-top p { font-size: 10px; }.game-card-actions { grid-template-columns: minmax(0,1fr) 78px; gap: 8px; }
  .game-hub { gap: 10px; }.games-heading { margin-bottom: 10px; }.hub-detail { margin-block: 8px; }.hub-note { margin-top: 12px; }
  .primary-button { font-size: 13px; padding-inline: 9px; }.puzzle-tools small { font-size: 9px; }.trail-row small { font-size: 10px; }
  .pet-room { height: 250px; }.pet-runner { width: 180px; height: 180px; }
}
@media (min-width:650px) {
  .game-hub { grid-template-columns: 1fr 1fr; }.game-card--hunt { grid-column: 1/-1; }.game-card--hunt .hunt-card-rule { margin: 14px 0; }
  .game-card--hunt .game-card-actions { grid-template-columns: 1fr 140px; }.games-heading h1 { font-size: 34px; }.game-card-top p { font-size: 12px; }
}
@media (max-height:700px) { .result-modal .result-cat,.puzzle-result-modal .result-cat { width: 45px; }.result-modal h2,.puzzle-result-modal h2 { font-size: 24px; }.result-score strong { font-size: 40px; }.result-stats div { padding: 7px; } }
@media (prefers-reduced-motion:reduce) { .primary-button:active { transform: none; } }
