.entrance { min-height: 100dvh; background: #080808; }
.cover { position: relative; min-height: 100dvh; overflow: hidden; padding: 0; }
.cover-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center 35%; }
.cover-picture { position: absolute; inset: 0; }
.cover-actions { position: absolute; z-index: 1; inset: 0; pointer-events: none; }
.cover-play { position: absolute; top: 83.5%; left: 50%; transform: translateX(-50%); width: 46%; max-width: 240px; min-height: 38px; margin: 0; padding: 8px 12px; background: #05050548; color: #f4f3f0; border: 1px solid #d74646; border-radius: 999px; font-size: 13px; font-weight: 500; letter-spacing: .08em; text-shadow: 0 1px 8px #000; pointer-events: auto; animation: cover-vibrate 3.8s ease-in-out infinite; }
.cover-play.primary { min-height: 38px; background: #05050548; border-radius: 999px; }
.cover-play:active { transform: translate(-50%, 1px); animation: none; }
@keyframes cover-vibrate {
  0%, 91%, 100% { margin-left: 0; }
  92%, 96% { margin-left: -2px; }
  94%, 98% { margin-left: 2px; }
}
@media (prefers-reduced-motion: reduce) { .cover-play { animation: none; } }
.cover-tagline { display: none; }
#entrance-status { position: relative; margin: 12px auto 0; max-width: 420px; font-size: 13px; line-height: 1.6; }
.onboarding { position: relative; isolation: isolate; overflow: hidden; min-height: 100dvh; max-width: 680px; margin: auto; padding: max(20px, env(safe-area-inset-top)) 28px max(28px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; background: #080808; }
.onboarding::before { content: ""; position: absolute; z-index: -1; inset: 0; background: url("onboarding-light-seam.png") center / cover no-repeat; filter: brightness(.62); opacity: .86; pointer-events: none; }
.onboarding::after { content: ""; position: absolute; z-index: 0; top: 0; bottom: 0; left: 50%; width: var(--onboarding-beam-width, 2px); transform: translateX(-50%); background: rgba(244, 242, 238, .14); box-shadow: 0 0 18px 5px rgba(244, 242, 238, .14); transition: width .65s ease; pointer-events: none; }
.onboarding > * { position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) { .onboarding::after { transition: none; } }
.onboarding-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 12px; }
#onboarding-count { color: #aaa; font-variant-numeric: tabular-nums; }
.onboarding-content { flex: 1; padding: 48px 0 36px; display: flex; flex-direction: column; justify-content: center; }
.onboarding-content h1 { font-family: var(--serif); font-size: 42px; line-height: 1.2; max-width: 500px; }
.onboarding-content p { font-size: 16px; line-height: 1.8; color: #c0c0bd; max-width: 490px; margin: 24px 0 0; }
.onboarding-content .onboarding-note { font-size: 13px; color: #92928f; line-height: 1.7; }
.onboarding-content .onboarding-policy { color: #f4f3f0; text-decoration-color: var(--accent); text-underline-offset: 4px; }
.onboarding-install { align-self: flex-start; max-width: 340px; margin-top: 24px; }
.onboarding-footer .primary { width: 100%; font-size: 15px; min-height: 54px; }
.onboarding-dots { display: flex; justify-content: center; gap: 8px; margin-bottom: 28px; }
.onboarding-dots span { width: 24px; height: 3px; background: #414141; }
.onboarding-dots span.active { background: #f4f3f0; }
.entrance.replay-overlay { position: fixed; inset: 0; z-index: 50; min-height: 100dvh; overflow-y: auto; overscroll-behavior: contain; }
body.replaying-onboarding .navigation,
body.replaying-onboarding .composer,
body.replaying-onboarding .latest-message,
body.replaying-onboarding #connection-status { display: none !important; }
body.map-reference .board-bottomline, body.map-reference .turn-bar { display: none; }
.quiet { min-height: 44px; padding: 10px 8px; }
.icon-button { width: 44px; height: 44px; min-height: 44px; }
.primary { min-height: 52px; border-radius: 8px; }
.conversation-link, .reading-surface, .board-wrap, dialog { border-radius: 8px; }
.navigation button { min-height: 58px; }
.progress span { color: #aaa; }
button:active:not(:disabled) { opacity: .82; }
.app { max-width: 920px; padding: 0 28px 28px; }
.legal-links { display: flex; flex-wrap: wrap; gap: 12px 24px; margin: 22px 0 6px; padding-top: 16px; border-top: 1px solid #333; font-size: 12px; }
.legal-links a { color: #aaa; text-decoration-color: #d74646; text-underline-offset: 3px; }
.install-home-button { width: 100%; margin-top: 14px; }
.masthead { position: relative; height: 72px; justify-content: center; border-bottom: 0; }
.masthead #app-support { position: absolute; left: 0; transform: translateY(34px); }
#app-support { border: 0; border-radius: 0; background: transparent; color: #f4f3f0; }
#app-support svg { width: 24px; height: 24px; }
.wordmark { font-size: 22px; font-weight: 500; letter-spacing: -.04em; }
.brand-dot { display: inline-block; width: 6px; height: 6px; margin: 13px 0 0 5px; border-radius: 50%; background: var(--accent); }
.preview-label, .nav-caption, .dialogue-heading > .eyebrow, .query-band, .game-aside, .page-footer, .board-bottomline, .turn-bar { display: none; }
.navigation { height: 48px; gap: 28px; position: static; background: transparent; backdrop-filter: none; border-top: 0; padding: 0; justify-content: flex-start; }
.navigation button { width: auto; height: 48px; font-size: 13px; }
.navigation button.active::after { top: auto; bottom: -1px; left: 0; right: 0; }
.navigation #dialogue-tab { order: -1; }
.dialogue-heading { padding: 24px 0 18px; }
.dialogue-heading h1 { font-size: 22px; }
.dialogue-heading .quiet { font-size: 13px; }
.reading-surface { padding: 22px 28px; }
.messages { padding: 0; }
.message { font-size: 16px; line-height: 1.8; margin: 16px 0 28px; }
.message h2 { font-size: 28px; }
.message blockquote { font-family: inherit; font-size: 17px; line-height: 1.7; }
.message.user { margin-left: 24px; }
.message .state-image { width: 100%; max-height: 280px; object-fit: cover; margin-bottom: 20px; }
.live-controls { flex-direction: column; gap: 10px; }
.live-controls .context-hint { margin: 2px 4px 0; color: #777; font-size: 13px; line-height: 1.5; text-align: center; }
.live-controls .primary { width: 100%; min-height: 52px; font-size: 14px; background: #222; color: #fff; text-decoration: none; }
.answer-form textarea { font-size: 16px; min-height: 52px; }
.map-layout { display: block; }
.cell { aspect-ratio: 1; }
.cell .name { font-size: 10px; }
.cell .number { font-size: 11px; }
.board-wrap { box-shadow: none; border-color: #454545; }
.state-image { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.turn-scene { max-width: 580px; min-height: min(700px, 92dvh); max-height: 94dvh; text-align: center; padding: 56px 28px 28px; background: #111; color: #f4f3f0; }
.turn-scene::backdrop { background: #080808eb; }
#skip-turn { position: absolute; top: 12px; right: 20px; }
.animated-die { display: grid; place-items: center; width: 120px; height: 120px; margin: 54px auto 32px; color: #f4f3f0; }
.animated-die svg { width: 110px; height: 110px; stroke-width: 1; }
.animated-die.rolling { animation: tumble .6s ease-in-out infinite; }
@keyframes tumble { 0% { transform: rotate(-18deg) scale(.9); } 50% { transform: rotate(22deg) scale(1); } 100% { transform: rotate(-18deg) scale(.9); } }
.turn-track { display: flex; justify-content: center; gap: 6px; margin: 40px 0; }
.turn-cell { display: grid; place-items: center; width: 42px; height: 56px; border-bottom: 1px solid #777; color: #aaa; font-variant-numeric: tabular-nums; }
.turn-cell.active { color: #fff; background: #303030; border-color: #d74646; }
.turn-cell .token { position: static; width: 14px; height: 14px; }
.turn-number { display: block; font-size: 15px; color: #b1b1ad; margin-top: 26px; }
.turn-scene h2 { font-size: 34px; margin: 16px 0 24px; }
.turn-scene p { color: #bdbdb8; font-size: 15px; line-height: 1.75; text-align: left; }
.turn-scene .primary { background: #f4f3f0; color: #111; margin-top: 24px; }
body.preparing #request-button, body.preparing #dialogue-level { display: none; }
body.preparing .dialogue-heading { padding-top: 8px; }
@media (min-width: 701px) { .cover-photo { object-fit: contain; } }
@media (max-width: 700px) {
  .cover-photo { object-fit: cover; object-position: center; }
  .app { padding: 0 20px max(20px, env(safe-area-inset-bottom)); }
  .reading-surface { margin: 0 -20px; padding: 18px 20px 24px; }
  .header-actions { gap: 0; }
  .header-actions .quiet { font-size: 12px; }
  .dialogue-heading .quiet { max-width: 45%; text-align: right; }
  .cell .name { font-size: 8px; }
  .cell { padding: 5px; }
  .turn-scene { width: calc(100% - 20px); padding: 54px 22px 24px; }
  #toast { bottom: max(24px, env(safe-area-inset-bottom)); }
}
@media (max-height: 650px) { .onboarding-content { padding-top: 24px; } .onboarding-content h1 { font-size: 34px; } .animated-die { margin: 25px auto; } }
@media (prefers-reduced-motion: reduce) { .animated-die.rolling { animation: none; } }

.app { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
.navigation { position: fixed; inset: auto 0 0; z-index: 20; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; width: 100%; height: auto; min-height: 72px; padding: 6px max(8px, calc((100vw - 864px) / 2)) calc(6px + env(safe-area-inset-bottom)); background: #151515; border-top: 1px solid #3b3b3b; }
.navigation button { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; width: 100%; height: 58px; padding: 4px; font-size: 12px; color: #bdbdbd; }
.navigation button svg { width: 22px; height: 22px; }
.navigation button.active { color: #fff; background: #292929; border-radius: 8px; }
.navigation button.active::after { display: none; }
.navigation button:focus-visible { outline: 2px solid #f4f3f0; outline-offset: -2px; }
.utility-view { padding: 12px 0 24px; }
.utility-view h1 { margin-top: 0; font-size: 26px; margin-bottom: 28px; }
.utility-view h2 { font-size: 20px; margin: 28px 0 12px; }
.utility-view p { font-size: 16px; line-height: 1.75; color: #c6c6c6; }
#rules-content { display: flex; flex-direction: column; gap: 12px; }
#rules-content > section { padding: 18px 20px; border: 1px solid #454545; border-left: 3px solid var(--accent); border-radius: 8px; background: #242424; color: #f4f3f0; }
#rules-content > section h2 { margin: 0 0 9px; color: #f4f3f0; font-size: 16px; font-weight: 500; line-height: 1.45; }
#rules-content > section p { margin: 0; color: #f4f3f0; font-size: 14px; line-height: 1.75; }
#rules-content > section p + p { margin-top: 10px; color: #c6c6c2; font-size: 12px; }
#rules-replay { margin-top: 16px; }
.game-menu-view { max-width: 620px; min-height: calc(100dvh - 190px); margin: 0 auto; padding: 16px 0 32px; }
.game-menu-view h1 { max-width: 520px; margin: 0 0 12px; font-family: var(--serif); font-size: clamp(34px, 8vw, 48px); font-weight: 400; line-height: 1.12; }
.game-menu-lead { max-width: 470px; margin: 0 0 28px; color: #bdbdb8; font-size: 15px; line-height: 1.65; }
.game-menu-card { margin: 0 0 18px; padding: 20px; border: 1px solid #4a4a45; border-top: 2px solid var(--accent); border-radius: 8px; background: #191917; }
.game-menu-card .eyebrow { color: #bdbdb8; }
.game-menu-query { margin: 16px 0 20px; color: #f4f3f0; font-family: var(--serif); font-size: 21px; line-height: 1.45; overflow-wrap: anywhere; }
.game-menu-description { margin: 0 0 14px; color: #bdbdb8; font-size: 14px; line-height: 1.65; }
.game-menu-progress { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.game-menu-progress strong { font-size: 14px; font-weight: 500; }
.game-menu-progress span { color: #bdbdb8; font-size: 13px; }
.game-menu-track { height: 2px; margin-bottom: 18px; background: #454541; }
.game-menu-track span { display: block; height: 100%; background: var(--accent); }
.game-menu-view .primary, .game-menu-view .secondary-action { width: 100%; min-height: 52px; }
.game-menu-view .secondary-action { display: flex; align-items: center; justify-content: center; margin-top: 12px; padding: 13px 22px; border: 1px solid #454545; border-radius: 8px; background: #242424; color: #f4f3f0; font-size: 15px; font-weight: 500; }
.game-menu-note { margin: 14px 0 0; color: #92928f; font-size: 12px; line-height: 1.55; text-align: center; }
.game-menu-purchases { display: grid; gap: 10px; margin-top: 16px; }
.game-menu-purchases .bundle-purchase { flex-direction: column; gap: 5px; border-color: var(--accent); }
.bundle-purchase-title { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; font-weight: 600; }
.bundle-purchase-prices { color: #f07171; font-size: 12px; font-weight: 500; }
.game-access-card .game-menu-query { margin-bottom: 10px; }
.game-access-card .game-menu-description { margin-bottom: 0; }
.game-access-card .primary { display: flex; align-items: center; justify-content: center; margin-top: 12px; padding: 12px 18px; border: 1px solid var(--accent); border-radius: 999px; color: #f4f3f0; text-align: center; text-decoration: none; }
.game-payment-refresh { display: block; margin: 10px auto 0; color: #c6c6c2; text-decoration: underline; text-underline-offset: 3px; }
.game-menu-empty { margin: 40px 0 24px; padding: 24px 0; border-top: 1px solid #3b3b3b; border-bottom: 1px solid #3b3b3b; }
.game-menu-empty h2 { margin: 0 0 10px; font-family: var(--serif); font-size: 25px; font-weight: 400; }
.game-menu-empty p { max-width: 430px; margin: 0; color: #bdbdb8; font-size: 14px; line-height: 1.65; }
.current-game { display: flex; flex-direction: column; gap: 16px; width: 100%; padding: 22px; text-align: left; color: #f4f3f0; background: #242424; border: 1px solid #454545; border-radius: 8px; }
.current-game span { overflow-wrap: anywhere; }
.current-game span:last-child { display: flex; align-items: center; justify-content: space-between; }
.current-game svg { width: 20px; height: 20px; }
#current-game-state { color: #bdbdbd; font-size: 14px; }
.masthead[hidden] { display: none; }
.dialogue-heading { padding: 0 0 8px; }
.dialogue-heading > div { justify-content: flex-start; }
#dialogue-level { display: flex; align-items: center; gap: 8px; min-height: 44px; max-width: 100%; padding: 8px 0; font-size: 14px; text-align: left; }
#dialogue-level-name { overflow-wrap: anywhere; }
#dialogue-level svg { flex-shrink: 0; width: 16px; height: 16px; }
#dialogue-level:focus-visible { outline: 2px solid #f4f3f0; outline-offset: 3px; }
body.preparing .dialogue-heading { display: none; }
.latest-message { position: fixed; z-index: 21; bottom: calc(88px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; max-width: calc(100% - 32px); padding: 10px 16px; border: 1px solid #666; border-radius: 8px; background: #222; color: #fff; font-size: 14px; white-space: nowrap; }
.latest-message svg { width: 18px; height: 18px; }
.live-controls .secondary-action { display: flex; align-items: center; justify-content: center; align-self: flex-start; width: fit-content; max-width: 100%; min-height: 44px; padding: 10px 18px; border: 1px solid var(--accent); border-radius: 999px; background: transparent; color: #f4f4f0; font-size: 14px; text-decoration: none; text-align: center; }
.live-controls .secondary-action:disabled { opacity: .5; }
.access-offer { margin: 28px 0 20px; padding: 22px; border: 1px solid #575750; border-top: 2px solid #d74646; border-radius: 8px; background: #1b1b19; color: #f4f3f0; }
.access-offer > .eyebrow { color: #d5d4cf; }
.access-offer h2 { margin: 8px 0 6px; font-size: 22px; font-weight: 500; }
.access-offer-intro { margin: 0 0 18px; color: #c6c6c2; font-size: 14px; line-height: 1.6; }
.access-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.access-option { min-width: 0; padding: 16px; border: 1px solid #555550; border-radius: 8px; background: #242422; }
.access-option h3 { margin: 0 0 8px; font-size: 15px; }
.access-option p { margin: 0 0 12px; color: #d0d0cb; font-size: 13px; line-height: 1.55; }
.access-option .access-price { color: #fff; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bundle-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.bundle-price del { color: #9b9b96; font-size: 15px; font-weight: 400; }
.bundle-price strong { color: #fff; font-size: 23px; }
.bundle-price .bundle-saving { color: #f07171; font-size: 13px; font-weight: 600; }
.gift-badge { display: inline-block; padding: 3px 8px; border-radius: 999px; background: #d74646; color: #fff; font-size: 12px; font-weight: 600; vertical-align: middle; }
.access-price span { color: #c6c6c2; font-size: 12px; font-weight: 400; }
.access-option .primary, .access-option .secondary-action { width: 100%; min-height: 48px; margin-top: 4px; padding: 10px 12px; font-size: 13px; }
.access-option .secondary-action { display: flex; align-items: center; justify-content: center; border: 1px solid #c6c6c2; border-radius: 8px; color: #fff; text-align: center; }
@media (max-width: 520px) { .access-offer { margin: 20px 0 16px; padding: 16px; } .access-options { grid-template-columns: 1fr; } .access-option { padding: 14px; } }
:root { --composer-height: 0px; --keyboard-inset: 0px; --navigation-height: calc(76px + env(safe-area-inset-bottom)); }
.app { padding-top: max(var(--telegram-content-safe-top, 0px), env(safe-area-inset-top, 0px)); padding-bottom: calc(var(--navigation-height) + var(--composer-height) + 24px); }
body.dialogue-open { background: #111; }
.dialogue-view { min-height: 100dvh; background: #111; color: #f4f4f0; }
.dialogue-view .reading-surface { background: #111; color: #f4f4f0; }
.composer { position: fixed; z-index: 22; bottom: var(--navigation-height); left: 50%; transform: translateX(-50%); width: min(864px, 100%); padding: 12px 20px; background: #f4f4f0; color: #222; border-top: 0; }
.composer .answer-form { margin: 0; padding: 0; border: 0; align-items: flex-end; }
.composer textarea { resize: none; min-height: 52px; max-height: 144px; overflow-y: auto; }
.composer .answer-form button { flex-shrink: 0; min-width: 44px; min-height: 44px; }
.composer #voice-review { flex-wrap: wrap; margin-bottom: 12px; }
.composer #voice-review button { min-width: 44px; }
body.keyboard-open { --navigation-height: 0px; }
body.keyboard-open .navigation { display: none; }
body.keyboard-open .composer { bottom: var(--keyboard-inset); padding-bottom: 12px; }
.latest-message { bottom: calc(var(--navigation-height) + var(--composer-height) + var(--keyboard-inset) + 12px); }
#toast { bottom: calc(var(--navigation-height) + var(--composer-height) + var(--keyboard-inset) + 12px); }
#connection-status { position: fixed; z-index: 24; bottom: calc(var(--navigation-height) + var(--composer-height) + var(--keyboard-inset) + 12px); left: 50%; transform: translateX(-50%); width: min(440px, calc(100% - 32px)); padding: 14px 16px; border: 1px solid #666; border-radius: 8px; background: #222; color: #fff; font-size: 14px; line-height: 1.5; }
#connection-status button { min-height: 44px; margin-top: 8px; padding: 8px 12px; color: #fff; border: 1px solid #aaa; border-radius: 8px; }
.pending-message .caption { font-size: 12px; }
.message { max-width: 680px; margin: 20px auto 28px; font-size: 16px; line-height: 1.65; overflow-wrap: anywhere; }
.message.user { margin-left: auto; margin-right: 0; max-width: min(90%, 600px); padding: 16px 18px; }
.message p { margin: 0 0 16px; }
.message p:last-child { margin-bottom: 0; }
.message h2 { font-size: 21px; line-height: 1.3; margin: 12px 0 18px; }
.message h3 { font-size: 13px; line-height: 1.5; margin: 22px 0 8px; }
.message strong, .message b { font-weight: 600; }
.message blockquote { font-family: inherit; font-size: 14px; line-height: 1.55; margin: 18px 0; padding-left: 16px; border-left: 2px solid #b14444; }
.message ul, .message ol { padding-left: 24px; margin: 16px 0; }
.message li { margin: 8px 0; }
.message pre { max-width: 100%; overflow-x: auto; white-space: pre; font-size: 14px; }
.message .current-question { display: block; margin: 18px 0 10px; padding: 12px 14px; border-left: 3px solid #b14444; background: #e9e9e3; color: #202020; font-size: 14px; font-weight: 500; line-height: 1.55; }
.message .state-image { aspect-ratio: 4 / 3; max-height: 320px; }
.map-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.map-actions button { min-height: 44px; font-size: 14px; }
.board-wrap { max-height: min(56dvh, 620px); overflow-y: auto; overscroll-behavior-y: contain; }
.board .cell { aspect-ratio: auto; min-height: 84px; padding: 7px 5px; position: relative; }
.board .cell .name { font-size: 10px; line-height: 1.3; overflow-wrap: anywhere; }
.board .cell.current { outline: 2px solid #f4f3f0; outline-offset: -3px; }
.visited-mark { position: absolute; right: 4px; top: 4px; width: 12px; height: 12px; color: #ddd; }
#turn-wait { text-align: center; font-size: 14px; color: #bdbdb8; }
.turn-scene .turn-cell { border-radius: 8px; }
.turn-scene .turn-cell.active { transition: background-color .15s ease; }
@media (prefers-reduced-motion: reduce) { .turn-scene *, .cell.landing { animation: none !important; transition: none !important; } }
/* Chat turns use alignment and a restrained red edge to distinguish speakers. */
.messages { display: flex; flex-direction: column; gap: 4px; }
.message { box-sizing: border-box; width: fit-content; max-width: min(90%, 620px); margin: 8px auto 8px 0; padding: 16px 18px; border-radius: 8px; font-size: 14px; line-height: 1.55; }
.message.assistant { border-left: 3px solid var(--accent); background: #262626; color: #f4f4f0; }
.message.assistant blockquote, .message.assistant .current-question {
  margin: 0;
  padding: 0;
  border-left: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
}
.message.user { width: fit-content; max-width: min(82%, 560px); margin: 8px 0 8px auto; padding: 14px 17px; border: 1px solid #454545; background: #303030; color: #f4f4f0; }
.message .caption { color: #c0c0ba; font-size: 10px; letter-spacing: 0; }
.message .current-question { border-left-color: var(--accent); background: transparent; color: inherit; }
.message.user, .message .current-question, #toast, #request-form textarea,
.answer-form textarea, #history-messages { border-radius: 8px; }
#new-game { min-height: 48px; margin-bottom: 24px; }
.history-game { margin-top: 16px; }
.game-meta { font-size: 14px; line-height: 1.6; color: #bbb; }
#history-detail { margin-top: 24px; }
#history-messages { margin-top: 24px; padding: 20px; background: #f4f4f0; color: #222; }
@media (max-width: 700px) {
  .dialogue-view { margin: 0 -20px; padding: 0 20px; }
  .game-menu-view { min-height: calc(100dvh - 160px); padding-top: 16px; }
  .game-menu-card { padding: 18px 16px; }
  .map-actions { margin-bottom: 8px; }
  .board-topline { display: none; }
  .board-wrap {
    max-height: min(50dvh, 430px);
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
  }
  .board { grid-auto-rows: 84px; }
  .board .cell { min-height: 84px; padding: 7px 5px; }
  .board .cell .number { font-size: 11px; }
  .board .cell .name { margin-top: 6px; font-size: 10px; line-height: 1.25; }
  .app { padding-bottom: calc(var(--navigation-height) + var(--composer-height) + 24px); }
  #toast { bottom: calc(90px + env(safe-area-inset-bottom)); }
  .message { max-width: 92%; padding: 14px 15px; margin-top: 6px; margin-bottom: 6px; }
  .message.user { max-width: 84%; }
}

/* Shared action styling; navigation and content tiles keep their own patterns. */
.primary,
.secondary-action,
.quiet,
#retry-connection,
#connection-status button,
.map-actions button,
.board-bottomline button,
#voice-review button {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  transition: background-color .16s ease, border-color .16s ease, opacity .16s ease;
}
.primary > svg:last-child { margin-left: 0; }
.onboarding-footer .primary,
.game-menu-view .primary,
.game-menu-view .secondary-action,
.access-option .primary,
.access-option .secondary-action {
  min-height: 48px;
}
.primary:active:not(:disabled),
.secondary-action:active:not(:disabled),
.quiet:active:not(:disabled),
#retry-connection:active:not(:disabled),
.map-actions button:active:not(:disabled),
.board-bottomline button:active:not(:disabled),
#voice-review button:active:not(:disabled) {
  background: rgba(215, 70, 70, .12);
}
.primary:disabled,
.secondary-action:disabled,
.quiet:disabled,
#retry-connection:disabled,
.map-actions button:disabled,
.board-bottomline button:disabled,
#voice-review button:disabled {
  opacity: .45;
}
.icon-button,
#voice-record,
.send,
dialog .close,
.query-band button {
  box-sizing: border-box;
  display: inline-grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--accent);
  border-radius: 50%;
  background: transparent;
  color: inherit;
}
.composer #voice-record,
.composer .send { color: #222; }
.composer #voice-record.recording {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.send { flex-shrink: 0; }
.query-band button { color: #f4f3f0; }
dialog .close { color: #222; border: 0; border-radius: 0; background: transparent; box-shadow: none; outline: none; }
dialog .close svg { width: 24px; height: 24px; }
dialog .close:focus-visible { color: var(--accent); outline: none; box-shadow: none; }
.latest-message {
  border-color: var(--accent);
  border-radius: 999px;
  background: #222;
}
.game-menu-view .secondary-action,
.access-option .secondary-action,
.live-controls .secondary-action {
  border-color: var(--accent);
  border-radius: 999px;
  background: transparent;
}
.live-controls .primary { background: transparent; color: #f4f3f0; }
.turn-scene .primary { margin-top: 24px; background: transparent; color: #f4f3f0; }
.access-option .secondary-action { color: #fff; }
.conversation-link {
  background: #242424;
  color: #f4f3f0;
  border: 1px solid #454545;
  border-top: 2px solid var(--accent);
}
.link-bottom {
  width: fit-content;
  max-width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font-size: 13px;
  line-height: 1.35;
}
.current-game span:last-child {
  width: fit-content;
  max-width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  font-size: 13px;
}
#connection-status button { color: #fff; }
dialog .primary {
  margin-top: 26px;
  background: transparent;
  color: #222;
}
button:focus-visible,
a.secondary-action:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Keep the red accent for the primary way to start or resume a journey. */
.game-menu-card { border-top: 1px solid #4a4a45; }
.game-menu-view .primary {
  border-color: #666;
  color: #d0d0cb;
}
.game-menu-card[aria-label="Новая игра"] .primary,
.game-menu-view .secondary-action {
  border-color: var(--accent);
  color: #f4f3f0;
}
.game-menu-view .secondary-action {
  width: calc(100% - 40px);
  margin-right: 20px;
  margin-left: 20px;
}
.game-wallet-summary {
  margin-top: 0;
  margin-bottom: 12px;
  padding: 11px 16px;
  border-top: 1px solid #4a4a45;
}
.game-wallet-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.game-wallet-summary .game-menu-query {
  margin: 0;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}
.game-wallet-count {
  flex: 0 0 auto;
  color: #f4f3f0;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}
.game-wallet-summary .game-menu-description { margin: 0; font-size: 12px; line-height: 1.5; }
.game-menu-purchase-heading { margin: 20px 0 0; color: #aaa9a4; font-size: 12px; }
.game-menu-view .game-menu-purchases { margin: 0 0 18px; }
.game-menu-card[aria-label="Незавершённая игра"] {
  margin-bottom: 12px;
  padding: 16px;
}
.game-menu-card[aria-label="Незавершённая игра"] .game-menu-query {
  margin: 11px 0 12px;
  font-size: 19px;
  line-height: 1.32;
}
.game-menu-card[aria-label="Незавершённая игра"] .game-menu-progress { margin-bottom: 7px; }
.game-menu-card[aria-label="Незавершённая игра"] .game-menu-track { margin-bottom: 12px; }
@media (max-width: 700px) {
  .game-menu-view .secondary-action {
    width: calc(100% - 32px);
    margin-right: 16px;
    margin-left: 16px;
  }
}
.dialogue-view .message.assistant { border-left: 3px solid var(--accent); }
.dialogue-view .live-controls .primary,
.dialogue-view .live-controls .secondary-action,
.dialogue-view #dialogue-level,
.dialogue-view .latest-message {
  border-color: #666;
}
.dialogue-view .live-controls .primary,
.dialogue-view .live-controls .secondary-action { color: #d0d0cb; }
#games-view #new-game { border-color: var(--accent); color: #f4f3f0; }
#games-view .current-game span:last-child {
  min-height: 0;
  padding: 0;
  border: 0;
  color: #bdbdb8;
  font-size: 14px;
}
#games-view .history-game span:last-child { font-size: 13px; }

/* App-wide type scale from the approved screen preview. */
body { font-size: 15px; }
.utility-view h1,
.page-heading h1,
.game-menu-view h1,
#history-title,
dialog h2,
.turn-scene h2 {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 400;
  line-height: 1.2;
}
.utility-view h1 { margin-bottom: 22px; }
.page-heading { padding: 6px 0 8px; }
.page-heading h1 { margin: 0; }
.game-menu-view h1 { max-width: 520px; }
.game-menu-query { font-size: 23px; line-height: 1.4; }
.position h2,
.game-menu-empty h2 { font-family: var(--serif); font-size: 25px; line-height: 1.25; }
.onboarding-content h1 { font-size: 32px; line-height: 1.2; }
.onboarding-content p,
.game-menu-lead,
.game-menu-description,
.game-menu-empty p,
.access-offer-intro,
.access-option p:not(.access-price),
.turn-scene p,
.utility-view > p,
#rules-content > section p,
#history-detail > p {
  font-size: 15px;
  line-height: 1.65;
}
.message { font-size: 15px; line-height: 1.6; }
.message h2 { font-family: var(--sans); font-size: 21px; line-height: 1.35; }
.message h3 { font-size: 15px; line-height: 1.45; }
.message blockquote { font-size: 15px; line-height: 1.6; }
.message .current-question { font-size: 15px; line-height: 1.6; }
#rules-content > section p { font-size: 14px; line-height: 1.65; }
.game-meta,
.current-game #current-game-state,
.game-menu-progress span,
.game-menu-note,
.message .caption,
.meta,
#history-detail > p {
  font-size: 12px;
  line-height: 1.55;
}
.navigation button { font-size: 11px; }
#rules-content > section h2 {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.45;
}
.access-option h3 { font-size: 16px; line-height: 1.4; }
.access-option .access-price { font-size: 20px; }
dialog p { font-size: 15px; line-height: 1.65; }
#request-form label { font-size: 13px; }
.composer textarea { font-size: 16px; line-height: 1.5; }
.board .cell .name { font-size: 10px; }
.board .cell .number { font-size: 11px; }
