/* Accademia Aurora 0.29.5 — T.2–T.7. All typography sizes live here.
 * Nine semantic roles; headline and reading share a size but not a family/leading.
 * Base scale at 16px browser default. No root-size reduction; browser zoom remains available.
 * Fonts are prepared locally by tools/prepare-fonts.py; no runtime font network requests.
 */
@font-face {font-family:Display;src:url('assets/fonts/forum-regular.woff2') format('woff2');font-weight:400;font-style:normal;font-display:swap}
@font-face {font-family:Reading;src:url('assets/fonts/pt-serif-regular.woff2') format('woff2');font-weight:400;font-style:normal;font-display:swap}
@font-face {font-family:Reading;src:url('assets/fonts/pt-serif-bold.woff2') format('woff2');font-weight:700;font-style:normal;font-display:swap}
:root {
 --ff-display:Display,serif;
 --ff-reading:Reading,serif;
 --ff-ui:-apple-system,BlinkMacSystemFont,"SF Pro Text",system-ui,sans-serif;
 --font:var(--ff-ui);
 --t-display:1.75rem; --lh-display:2.125rem;
 --t-title:1.375rem; --lh-title:1.75rem;
 --t-headline:1.0625rem; --lh-headline:1.375rem;
 --t-body:1.0625rem; --lh-body:1.5rem;
 --t-reading:1.0625rem; --lh-reading:1.6875rem;
 --t-callout:1rem; --lh-callout:1.375rem;
 --t-footnote:.8125rem; --lh-footnote:1.125rem;
 --t-caption:.75rem; --lh-caption:1rem;
 --t-tab:.6875rem; --lh-tab:.8125rem;
 --surface:#0d1d22; --text:#ece8da; --muted:#b8c7c5; --text-muted:var(--muted);
 --gold:#d5b575; --teal:#72c9bd;
}
/* Both dimensions exclude a landscape phone from the tablet text scale. */
@media(min-width:700px) and (min-height:700px) {
 :root {
 --t-display:2.0125rem; --lh-display:2.44375rem;
 --t-title:1.58125rem; --lh-title:2.0125rem;
 --t-headline:1.221875rem; --lh-headline:1.58125rem;
 --t-body:1.221875rem; --lh-body:1.725rem;
 --t-reading:1.221875rem; --lh-reading:1.940625rem;
 --t-callout:1.15rem; --lh-callout:1.58125rem;
 --t-footnote:.934375rem; --lh-footnote:1.29375rem;
 --t-caption:.8625rem; --lh-caption:1.15rem;
 --t-tab:.75rem; --lh-tab:1rem;
 }
}
html {font-size:100%;-webkit-text-size-adjust:100%;text-size-adjust:100%}

/* Mapped legacy component roles; font overrides removed from source stylesheets. */
body {
    font-size: var(--t-callout);
    line-height: var(--lh-callout);
    font-weight: 400;
    font-family: var(--ff-ui)
}
button,input,select {
    font: inherit
}
h1,h2,h3 {
    font-family: var(--ff-display);
    font-weight: 400
}
h1 {
    font-size: var(--t-title);
    line-height: var(--lh-body)
}
h2 {
    font-size: var(--t-title)
}
h3 {
    font-size: var(--t-title)
}
small {
    font-size: var(--t-caption)
}
.eyebrow {
    font-size: var(--t-caption);
    letter-spacing: .16em
}
.brand-emblem {
    font-size: var(--t-display);
    line-height: var(--lh-display);
    font-weight: 400;
    font-family: var(--ff-display)
}
.brand-name {
    font-size: var(--t-title);
    line-height: var(--lh-title);
    font-weight: 400;
    font-family: var(--ff-display);
    letter-spacing: .12em
}
.brand-sub {
    font-size: var(--t-caption);
    letter-spacing: .23em
}
.sidebar-foot {
    font-size: var(--t-caption)
}
.breadcrumb {
    font-size: var(--t-footnote)
}
.resource strong {
    font-weight: 400
}
.page-heading p {
    font-size: var(--t-footnote)
}
.plain-button {
    font-size: var(--t-footnote)
}
.practice-title {
    font-family: var(--ff-display);
    font-size: var(--t-headline)
}
.practice-title small {
    font-size: var(--t-caption);
    line-height: var(--lh-caption);
    font-weight: 400;
    font-family: var(--ff-ui)
}
.move-counter {
    font-size: var(--t-caption)
}
.move-counter strong {
    font-size: var(--t-display);
    line-height: var(--lh-display);
    font-weight: 400;
    font-family: var(--ff-display)
}
.mode-tab {
    font-size: var(--t-footnote)
}
.flask-id {
    font-size: var(--t-caption);
    line-height: var(--lh-caption);
    font-weight: 400;
    font-family: var(--ff-display)
}
.instruction {
    font-size: var(--t-footnote)
}
.tool {
    font-size: var(--t-caption)
}
.tool .tool-symbol {
    font-size: var(--t-title);
    line-height: var(--lh-body)
}
.quest-card p,.info-card p {
    font-size: var(--t-footnote)
}
.quest-list li {
    font-size: var(--t-footnote)
}
.button.primary {
    font-weight: 600
}
.info-card .eyebrow {
    font-size: var(--t-caption)
}
.info-card h3 {
    font-size: var(--t-headline)
}
.chapter-card {
    font-size: var(--t-footnote)
}
.chapter-card strong {
    font-weight: 400
}
.seal {
    font-size: var(--t-title)
}
.seal .special-tag {
    font-size: var(--t-body)
}
.room-content p {
    font-size: var(--t-footnote)
}
.quest-badge {
    font-size: var(--t-caption);
    letter-spacing: .04em
}
.item-symbol {
    font-size: var(--t-display);
    line-height: var(--lh-display);
    font-weight: 400;
    font-family: var(--ff-display)
}
.item-rank {
    font-size: var(--t-caption);
    letter-spacing: 2px
}
.generator {
    font-size: var(--t-footnote)
}
.generator small {
    font-size: var(--t-caption)
}
.merge-selection {
    font-size: var(--t-footnote)
}
.order button {
    font-size: var(--t-footnote)
}
.document .doc-no {
    font-size: var(--t-display);
    line-height: var(--lh-display);
    font-weight: 400;
    font-family: var(--ff-display)
}
.document h3 {
    font-size: var(--t-headline)
}
.document p {
    font-size: var(--t-footnote)
}
.document .stamp {
    font-size: var(--t-caption)
}
.archive-form label {
    font-size: var(--t-footnote)
}
.archive-form p {
    font-size: var(--t-footnote)
}
.fact {
    font-size: var(--t-caption)
}
.choice {
    font-size: var(--t-footnote)
}
.choice p {
    font-size: var(--t-caption)
}
.character-identity p {
    font-size: var(--t-caption)
}
.character-symbol {
    font-size: var(--t-display)
}
.level-button {
    font-family: var(--ff-display)
}
.level-button small {
    font-size: var(--t-caption);
    line-height: var(--lh-caption);
    font-weight: 400;
    font-family: var(--ff-ui)
}
.map-mode {
    font-size: var(--t-caption)
}
.dialog h2 {
    font-size: var(--t-display)
}
.dialog p {
    font-size: var(--t-callout)
}
.dialog-close {
    font-size: var(--t-display)
}
.victory-mark {
    font-size: var(--t-display)
}
.stars {
    font-size: var(--t-display);
    letter-spacing: 12px
}
#toast {
    font-size: var(--t-footnote)
}
.task-link {
    font-size: var(--t-footnote)
}
.warning {
    font-size: var(--t-footnote)
}
.evidence-note {
    font-size: var(--t-footnote)
}
.seal-guide {
    font-size: var(--t-caption)
}
.inventory-actions button {
    font-size: var(--t-footnote)
}
.narrative {
    font-family: var(--ff-display);
    line-height: var(--lh-headline);
    font-size: var(--t-headline)
}
.mode-count {
    font-size: var(--t-caption)
}
.mobile-nav button {
    font-size: var(--t-tab)
}
@media (max-width:1150px) {
    .brand-name {
        font-size: var(--t-headline)
    }
}
@media (max-width:1150px) {
    .item-symbol {
        font-size: var(--t-title)
    }
}
@media (max-width:900px) {
    .mobile-brand {
        font-size: var(--t-headline);
        line-height: var(--lh-headline);
        font-weight: 400;
        font-family: var(--ff-display)
    }
}
@media (max-width:900px) {
    .resources {
        font-size: var(--t-footnote)
    }
}
@media (max-width:680px) {
    body {
        font-size: var(--t-callout)
    }
}
@media (max-width:680px) {
    .mobile-brand {
        font-size: var(--t-body);
        line-height: var(--lh-body)
    }
}
@media (max-width:680px) {
    .page-heading .eyebrow {
        font-size: var(--t-caption);
        letter-spacing: .12em
    }
}
@media (max-width:680px) {
    .page-heading p {
        font-size: var(--t-caption)
    }
}
@media (max-width:680px) {
    .plain-button {
        font-size: var(--t-caption)
    }
}
@media (max-width:680px) {
    .practice-title {
        font-size: var(--t-headline)
    }
}
@media (max-width:680px) {
    .mode-tab {
        font-size: var(--t-caption)
    }
}
@media (max-width:680px) {
    .instruction {
        font-size: var(--t-footnote)
    }
}
@media (max-width:680px) {
    .tool {
        font-size: var(--t-caption)
    }
}
@media (max-width:680px) {
    .tool .tool-symbol {
        font-size: var(--t-title)
    }
}
@media (max-width:680px) {
    .document .doc-no {
        font-size: var(--t-title)
    }
}
@media (max-width:680px) {
    .map-controls {
        font-size: var(--t-footnote)
    }
}
@media (max-width:680px) {
    .dialog h2 {
        font-size: var(--t-display)
    }
}
@media (max-width:680px) {
    .generator {
        font-size: var(--t-caption)
    }
}
@media (max-width:680px) {
    .merge-cell .item-symbol {
        font-size: var(--t-title)
    }
}
@media (max-width:680px) {
    .seal {
        font-size: var(--t-display)
    }
}
@media (max-width:680px) {
    .chapter-card {
        font-size: var(--t-caption)
    }
}
@media (max-width:680px) {
    .seal-guide {
        font-size: var(--t-caption)
    }
}
.inventory-summary {
    line-height: var(--lh-body)
}
.purchase-history {
    line-height: var(--lh-body)
}
.story-list p {
    font-size: var(--t-body);
    line-height: var(--lh-body)
}
.mobile-nav span {
    font-size: var(--t-tab)
}
@media (max-width:680px) {
    .story-list h2 {
        font-size: var(--t-title)
    }
}
.seal-lock {
    font-size: var(--t-caption)
}
body {
    font-size: var(--t-body)
}
.quest-card p,.info-card p,.quest-list li {
    font-size: var(--t-footnote)
}
.nav-button {
    font-size: var(--t-footnote)
}
.character-identity p {
    font-size: var(--t-footnote)
}
.tool {
    font-size: var(--t-footnote)
}
@media (max-width:680px) {
    .tool {
        font-size: var(--t-caption)
    }
}
@media (max-width:680px) {
    .mobile-nav button {
        font-size: var(--t-tab)
    }
}
@media (max-width:680px) {
    .quest-list li {
        font-size: var(--t-footnote)
    }
}
.target-depth {
    font-size: var(--t-footnote);
    line-height: var(--lh-footnote);
    font-weight: 700;
    font-family: var(--ff-ui)
}
.companion-panel p,.companion-panel small {
    font-size: var(--t-footnote);
    line-height: var(--lh-body)
}
.chapter-store>p {
    line-height: var(--lh-body)
}
.book-dossiers summary {
    font-size: var(--t-callout);
    line-height: var(--lh-body)
}
.book-dossiers p {
    line-height: var(--lh-body)
}
.book-reading {
    font-size: var(--t-body);
    line-height: var(--lh-body)
}
.gift-package select {
    font: inherit
}
.collection-note {
    font-size: var(--t-footnote)
}
.portrait-pending span {
    font-size: var(--t-footnote)
}
.age-portraits span {
    font-size: var(--t-footnote)
}
#card-language {
    font: inherit
}
.scene-card small {
    font-size: var(--t-caption);
    line-height: var(--lh-body)
}
.scene-number {
    font-family: var(--ff-display);
    font-size: var(--t-title)
}
.scene-document p {
    font-size: var(--t-title);
    line-height: var(--lh-title);
    font-weight: 400;
    font-family: var(--ff-display)
}
.scene-card {
    font-size: var(--t-caption)
}
.scene-card small {
    font-size: var(--t-caption)
}
.scene-card {
    font-size: var(--t-footnote);
    line-height: var(--lh-body)
}
.scene-card small,.book-profile small {
    font-size: var(--t-caption);
    line-height: var(--lh-body)
}
.scene-card strong {
    font-weight: 600
}
.scene-number {
    font-family: var(--ff-display);
    font-variant-numeric: tabular-nums
}
.book-profile h3 {
    line-height: var(--lh-body)
}
.book-profile p {
    font-size: var(--t-footnote);
    line-height: var(--lh-body)
}
.scene-document p {
    font-family: var(--ff-ui);
    font-size: var(--t-headline);
    line-height: var(--lh-body)
}
.resource strong,.move-counter strong {
    font-variant-numeric: tabular-nums
}
input,select,textarea {
    font-size: var(--t-body)
}
@media (max-width:420px) {
    .scene-number {
        font-size: var(--t-headline)
    }
}
.flask-id {
    font-family: var(--ff-ui);
    font-size: var(--t-caption);
    letter-spacing: .1em
}
.seal {
    font-size: var(--t-title)
}
.item-symbol:has(.relic-art) {
    line-height: var(--lh-body)
}
.stars {
    letter-spacing: .12em
}
.workshop-gallery p {
    font-size: var(--t-footnote)
}
.catalogue-item small {
    font-size: var(--t-caption)
}
.essence-manifest p {
    font-size: var(--t-footnote)
}
.essence-manifest span {
    font-weight: 700
}
.crafting-panel summary {
    font-size: var(--t-headline)
}
.crafting-recipes h3 {
    font-size: var(--t-headline)
}
.crafting-recipes p {
    font-size: var(--t-footnote)
}
.journey-intro h1 {
    font-size: var(--t-display)
}
.journey-intro p,.journey-toggle {
    font-size: var(--t-body);
    line-height: var(--lh-body)
}
.journey-goal {
    font-size: var(--t-body);
    line-height: var(--lh-body)
}
.flask-id {
    font-size: var(--t-footnote)
}
.reader-page {
    line-height: var(--lh-body)
}
.reader-page p {
    font-size: inherit;
    line-height: inherit
}
.reader-tools .button {
    font-size: var(--t-footnote)
}
blockquote footer {
    font-size: var(--t-footnote)
}
.campus-caption strong {
    font-size: var(--t-headline)
}
.campus-task p {
    line-height: var(--lh-body)
}
.campus-room-button span {
    font-size: var(--t-display)
}
.cloud-badge {
    font-size: var(--t-caption)
}
.product-benefits {
    line-height: var(--lh-body)
}
.first-session-note {
    line-height: var(--lh-body)
}
.room-source {
    font-size: var(--t-caption)
}
@media (max-width:600px) {
    .cloud-badge {
        font-size: var(--t-caption)
    }
}
@media (max-width:600px) {
    .campus-caption strong {
        font-size: var(--t-callout)
    }
}
.welcome-content h1 {
    font-size: var(--t-title);
    line-height: var(--lh-body)
}
.welcome-content p {
    font-size: var(--t-body);
    line-height: var(--lh-body)
}
.welcome-play {
    font-size: var(--t-headline)
}
.welcome-note {
    font-size: var(--t-footnote)
}
.welcome-details p {
    font-size: var(--t-footnote)
}
html {
    font-size: var(--t-body)
}
body {
    font-family: var(--ff-ui);
    font-size: var(--t-body);
    line-height: var(--lh-body)
}
button,input,select,textarea {
    font-family: var(--ff-ui);
    font-size: var(--t-body);
    line-height: var(--lh-body)
}
h1,h2,h3 {
    font-family: var(--ff-ui);
    letter-spacing: -.02em
}
h1 {
    font-size: var(--t-display);
    font-weight: 700;
    line-height: var(--lh-body)
}
h2 {
    font-size: var(--t-title);
    font-weight: 600;
    line-height: var(--lh-body)
}
h3 {
    font-size: var(--t-headline);
    font-weight: 600;
    line-height: var(--lh-body)
}
p {
    line-height: var(--lh-body)
}
small {
    font-size: var(--t-caption);
    line-height: var(--lh-body)
}
.eyebrow {
    font-size: var(--t-caption);
    letter-spacing: .06em;
    line-height: var(--lh-body);
    font-weight: 600
}
.page-heading p,.quest-card p,.info-card p,.collection-note {
    font-size: var(--t-callout);
    line-height: var(--lh-body)
}
.button {
    font-size: var(--t-callout);
    font-weight: 600;
    line-height: var(--lh-body)
}
.plain-button {
    line-height: var(--lh-callout);
    font-size: var(--t-callout)
}
.resource strong,.move-counter strong,.flask-id {
    font-family: var(--ff-ui);
    font-variant-numeric: tabular-nums;
    font-weight: 600
}
.practice-title {
    font-family: var(--ff-ui);
    font-size: var(--t-headline);
    font-weight: 600
}
.practice-title small {
    font-size: var(--t-footnote);
    line-height: var(--lh-footnote);
    font-weight: 400;
    font-family: var(--ff-ui)
}
.move-counter strong {
    font-size: var(--t-display)
}
.move-counter {
    font-size: var(--t-caption);
    letter-spacing: .025em
}
.mode-tab,.nav-button {
    font-size: var(--t-callout);
    font-weight: 500
}
.tool {
    font-size: var(--t-footnote);
    line-height: var(--lh-body)
}
.journey-goal {
    font-size: var(--t-callout);
    line-height: var(--lh-body)
}
.dialog h2 {
    font-size: var(--t-title)
}
.dialog p {
    font-size: var(--t-body);
    line-height: var(--lh-body)
}
.dialog small,.evidence-note {
    font-size: var(--t-footnote);
    line-height: var(--lh-body)
}
.brand-name,.brand-emblem,.brand-sub {
    font-family: var(--ff-display)
}
.reader-page {
    font-family: var(--ff-display)
}
.reader-page h2 {
    font-family: var(--ff-display);
    letter-spacing: 0
}
.reader-page p {
    font-size: inherit;
    line-height: inherit
}
.shop-comparison {
    font-size: var(--t-callout)
}
.shop-comparison th {
    font-weight: 600
}
.shop-comparison td {
    line-height: var(--lh-body)
}
.campus-task p,.campus-material,.campus-room-button {
    font-size: var(--t-callout);
    line-height: var(--lh-body)
}
.welcome-content h1 {
    letter-spacing: -.025em
}
.welcome-note {
    font-size: var(--t-footnote)
}
.character-identity h3,.character-name,.card-name {
    font-family: var(--ff-ui);
    font-size: var(--t-title);
    font-weight: 600;
    line-height: var(--lh-body);
    letter-spacing: -.015em
}
.character-identity p {
    font-size: var(--t-callout);
    line-height: var(--lh-body)
}
.character-identity small {
    font-size: var(--t-footnote)
}
.scene-card strong {
    font-family: var(--ff-ui);
    font-size: var(--t-footnote);
    font-weight: 600;
    line-height: var(--lh-body);
    letter-spacing: 0
}
.scene-card small {
    font-size: var(--t-footnote);
    line-height: var(--lh-body)
}
.scene-number {
    font-family: var(--ff-ui);
    font-size: var(--t-caption);
    font-weight: 600;
    letter-spacing: .03em
}
.age-portraits p,.age-portraits span {
    font-size: var(--t-footnote);
    line-height: var(--lh-body)
}
@media (max-width:600px) {
    .character-identity h3 {
        font-size: var(--t-headline)
    }
}
@media (max-width:600px) {
    .brand-sub {
        letter-spacing: .12em
    }
}
@media (max-width:600px) {
    .nav-button {
        font-size: var(--t-footnote)
    }
}
@media (max-width:600px) {
    .flask-id {
        font-size: var(--t-footnote)
    }
}
.age-portraits span:first-of-type {
    font-weight: 600
}
.scene-document p {
    font-family: var(--ff-ui);
    font-size: var(--t-headline);
    line-height: var(--lh-body)
}
.sidebar-foot,.breadcrumb {
    font-size: var(--t-footnote);
    line-height: var(--lh-body)
}
@media (max-width:380px) {
    .age-portraits span {
        font-size: var(--t-footnote)
    }
}
.card-expand {
    font-size: var(--t-callout);
    line-height: var(--lh-callout);
    font-weight: 600;
    font-family: var(--ff-ui)
}
.card-viewer header span {
    font-size: var(--t-callout)
}
body[data-route='play'] .practice-title {
    font-size: var(--t-body);
    line-height: var(--lh-body)
}
body[data-route='play'] .practice-title small {
    font-size: var(--t-caption)
}
body[data-route='play'] .move-counter {
    font-size: var(--t-caption);
    line-height: var(--lh-body)
}
body[data-route='play'] .move-counter strong {
    font-size: var(--t-title)
}
body[data-route='play'] .journey-goal {
    font-size: var(--t-footnote);
    line-height: var(--lh-body)
}
body[data-route='play'] .journey-goal small {
    font-size: var(--t-caption)
}
body[data-route='play'][data-mode='sort'] .instruction {
    font-size: var(--t-footnote)
}
@media (max-width:900px) {
    .mobile-nav button {
        font-size: var(--t-tab);
        line-height: var(--lh-tab)
    }
}
@media (max-width:900px) {
    body[data-route='play'] .cloud-badge {
        font-size: var(--t-caption)
    }
}
@media (max-width:420px) {
    .card-viewer header span {
        font-size: var(--t-footnote)
    }
}
@media (max-width:900px) {
    body[data-route='play'] .level-compact-header {
        font-size: var(--t-footnote)
    }
}
@media (max-width:900px) {
    .level-back,.level-help {
        font-size: var(--t-display)
    }
}
@media (max-width:900px) {
    .level-help {
        font-size: var(--t-headline)
    }
}
@media (max-width:900px) {
    .level-moves {
        font-size: var(--t-caption)
    }
}
@media (max-width:900px) {
    body[data-route='play'] .flask-id {
        font-size: var(--t-caption)
    }
}
@media (max-width:900px) {
    body[data-route='play'] .tools .tool {
        font-size: var(--t-caption)
    }
}
@media (max-width:900px) {
    body[data-route='play'] .tools .tool-symbol {
        font-size: var(--t-headline)
    }
}
@media (max-width:360px) and (max-height:600px) {
    body[data-route='play'] .level-compact-header {
        font-size: var(--t-caption)
    }
}
@media (max-width:900px) {
    body[data-route='tutorial'] .tutorial-compact-header {
        font-size: var(--t-footnote);
        font-weight: 700
    }
}
@media (max-width:900px) {
    body[data-route='tutorial'] .tutorial-status {
        font-size: var(--t-footnote);
        line-height: var(--lh-body)
    }
}
@media (max-width:900px) {
    body[data-route='tutorial'] .tutorial-skip {
        font-size: var(--t-footnote)
    }
}
@media (max-width:900px) {
    body[data-route='play'] .tools .tool {
        font-size: var(--t-footnote)
    }
}
@media (min-width:700px) and (max-width:900px) and (orientation:portrait) {
    body[data-route='play'] .level-compact-header,body[data-route='tutorial'] .tutorial-compact-header {
        font-size: var(--t-headline)
    }
}
@media (min-width:700px) and (max-width:900px) and (orientation:portrait) {
    body[data-route='play'] .level-moves {
        font-size: var(--t-callout)
    }
}
@media (min-width:700px) and (max-width:900px) and (orientation:portrait) {
    body[data-route='play'] .tools .tool {
        font-size: var(--t-callout)
    }
}
@media (max-width:900px) and (orientation:landscape) {
    body[data-route='play'] .flask-id {
        line-height: var(--lh-body)
    }
}
.build-version {
    font-size: var(--t-caption);
    line-height: var(--lh-caption);
    font-weight: 600;
    font-family: var(--ff-ui);
    font-variant-numeric: tabular-nums
}
.settings-version {
    font-size: var(--t-caption);
    font-variant-numeric: tabular-nums
}
@media (max-width:900px) {
    body[data-route='tutorial'] .tutorial-copy h1 {
        font-size: var(--t-title);
        line-height: var(--lh-body)
    }
}
@media (max-width:900px) {
    body[data-route='tutorial'] .tutorial-copy p {
        font-size: var(--t-footnote);
        line-height: var(--lh-body)
    }
}
@media (max-width:360px) and (max-height:600px) {
    body[data-route='tutorial'] .tutorial-copy h1 {
        font-size: var(--t-headline)
    }
}
@media (max-width:360px) and (max-height:600px) {
    body[data-route='tutorial'] .tutorial-copy p {
        font-size: var(--t-caption)
    }
}
@media (max-width:900px) and (orientation:landscape) {
    body[data-route='tutorial'] .tutorial-copy h1 {
        font-size: var(--t-headline)
    }
}
@media (max-width:900px) and (orientation:landscape) {
    body[data-route='tutorial'] .tutorial-copy p {
        font-size: var(--t-caption)
    }
}
body[data-route='play'] .mobile-nav button {
    font-size: var(--t-tab)
}
.mode-progress {
    font-size: var(--t-footnote)
}
body[data-route='play'] .mode-tab {
    font-size: var(--t-footnote)
}
body[data-route='play'] .journey-goal {
    font-size: var(--t-footnote)
}
body[data-route='play'] .journey-goal small {
    font-size: var(--t-caption)
}
body[data-route='play'] .instruction {
    font-size: var(--t-caption);
    line-height: var(--lh-body)
}
body[data-route='play'] .tool {
    font-size: var(--t-caption)
}
body[data-route='play'] .tool-symbol {
    font-size: var(--t-headline)
}
.play-skills summary,.companion-panel summary,.merge-help summary {
    font-size: var(--t-footnote)
}
body[data-route='play'] .essence-manifest {
    font-size: var(--t-caption)
}
body[data-route='play'] .flask-id {
    font-size: var(--t-caption)
}
.character-identity .character-role {
    font-size: var(--t-footnote);
    line-height: var(--lh-body);
    letter-spacing: 0
}
.character-identity .character-cycle {
    font-size: var(--t-caption);
    line-height: var(--lh-body)
}
.card-viewer-caption {
    font-size: var(--t-footnote);
    line-height: var(--lh-body)
}
.book-profile .character-identity h3 {
    font-size: var(--t-title);
    font-weight: 600;
    line-height: var(--lh-body);
    letter-spacing: 0
}
.book-profile .character-identity .character-role {
    font-size: var(--t-callout);
    font-weight: 400;
    line-height: var(--lh-body);
    letter-spacing: 0
}
.book-profile .character-identity .character-cycle {
    font-size: var(--t-footnote);
    line-height: var(--lh-body)
}
.card-viewer header span {
    font-weight: 600;
    line-height: var(--lh-body);
    letter-spacing: 0
}
.card-viewer-caption {
    font-size: var(--t-callout);
    line-height: var(--lh-body)
}
.seal-guide {
    font-size: var(--t-footnote)
}
.practice .instruction,.practice .journey-goal small {
    font-size: var(--t-footnote);
    line-height: var(--lh-body)
}
.practice .tools button {
    font-size: var(--t-footnote)
}
.unlock-note {
    font-size: var(--t-callout)
}
.reader-dialog .reader-page {
    line-height: var(--lh-body)
}
@media (max-width:600px) {
    .practice-title {
        font-size: var(--t-headline)
    }
}
@media (max-width:600px) {
    .book-collection-card .character-role {
        font-size: var(--t-callout);
        line-height: var(--lh-body)
    }
}
.flask-button .flask-id {
    line-height: var(--lh-body)
}
.campus-scene-caption strong {
    font-size: var(--t-headline);
    line-height: var(--lh-body)
}
.campus-scene-caption p {
    font-size: var(--t-footnote)
}
.campus-stage-track span {
    font-size: var(--t-footnote);
    line-height: var(--lh-body)
}
.campus-observation p {
    font-size: var(--t-body);
    line-height: var(--lh-body)
}
.campus-observation .eyebrow {
    font-size: var(--t-footnote);
    letter-spacing: .06em
}
.campus-total {
    font-size: var(--t-footnote)
}
.campus-room-button {
    font-size: var(--t-callout);
    line-height: var(--lh-body)
}
.campus-room-button small {
    font-size: var(--t-footnote)
}
.campus-material>span {
    font-size: var(--t-callout);
    line-height: var(--lh-body)
}
.generator>span {
    font-size: var(--t-callout)
}
.generator small {
    font-size: var(--t-footnote)
}
.room-source {
    font-size: var(--t-footnote);
    line-height: var(--lh-body)
}
.supply-route p {
    font-size: var(--t-body);
    line-height: var(--lh-body)
}
@media (max-width:760px) {
    .campus-scene-caption .button {
        font-size: var(--t-footnote)
    }
}
.mj-tile .mj-mark {
    font-size: var(--t-footnote);
    font-weight: 700;
    line-height: var(--lh-body)
}
.mj-aside p {
    font-size: var(--t-body);
    line-height: var(--lh-body)
}
.mj-levels button {
    font-size: var(--t-body)
}
.mj-count {
    font-variant-numeric: tabular-nums
}
.mj-complete h2 {
    font-family: var(--ff-ui)
}
.mj-legend ul {
    font-size: var(--t-footnote);
    line-height: var(--lh-body)
}
.mj-feedback p {
    font-size: var(--t-footnote)
}

/* Semantic roles. ID scope deliberately beats legacy media rules without !important. */
body {font-family:var(--ff-ui);font-size:var(--t-body);line-height:var(--lh-body)}
:is(#app,#modal-root) :is(button,input,select,textarea) {font-family:var(--ff-ui)}
:is(#app,#modal-root) :is(h1,.brand-name,.brand-emblem,.brand-sub) {font-family:var(--ff-display);font-size:var(--t-display);font-weight:400;line-height:var(--lh-display);letter-spacing:.02em;word-break:normal;overflow-wrap:break-word}
:is(#app,#modal-root) h2 {font-family:var(--ff-ui);font-size:var(--t-title);font-weight:700;line-height:var(--lh-title);letter-spacing:0}
:is(#app,#modal-root) h3 {font-family:var(--ff-ui);font-size:var(--t-headline);font-weight:600;line-height:var(--lh-headline);letter-spacing:0}
:is(#app,#modal-root) :is(p,.dialog p) {font-size:var(--t-body);line-height:var(--lh-body)}
:is(#app,#modal-root) :is(small,.eyebrow,.scene-number,.brand-sub) {font-size:var(--t-caption);font-weight:600;line-height:var(--lh-caption)}
:is(#app,#modal-root) .eyebrow {letter-spacing:.06em;text-transform:uppercase}
:is(#app,#modal-root) :is(.button,.plain-button,.mode-tab,.nav-button) {font-size:var(--t-headline);font-weight:600;line-height:var(--lh-headline);word-break:normal;overflow-wrap:break-word}
:is(#app,#modal-root) :is(.evidence-note,.collection-note,.page-heading p,.journey-toggle p,.quest-card p,.info-card p) {font-size:var(--t-callout);line-height:var(--lh-callout)}
:is(#app,#modal-root) :is(.resource,.chapter-card,.map-controls,.settings-row,.settings-row select,.quest-badge,.mode-progress,.sidebar-foot,.sidebar-foot p,.level-moves,.practice-title small,.move-counter,.quest-list li) {font-size:var(--t-footnote);line-height:var(--lh-footnote)}
:is(#app,#modal-root) :is(.resource,.resource strong,.move-counter strong,.level-moves,.chapter-card,.progress-track,.map-controls,.level-button,.price,.shop-price,.metrics-grid,.build-version,.settings-version,.quest-badge,.mode-progress,.map-meta) {font-family:var(--ff-ui);font-variant-numeric:lining-nums tabular-nums}
:is(#app,#modal-root) :is(.practice-title,.level-compact-header,.tutorial-compact-header,.move-counter strong) {font-family:var(--ff-ui);font-size:var(--t-headline);font-weight:600;line-height:var(--lh-headline)}
:is(#app,#modal-root) :is(.tool,.tools button,.tools small) {font-size:var(--t-footnote);font-weight:500;line-height:var(--lh-footnote)}
:is(#app,#modal-root) .tool-symbol {font-size:var(--t-headline);line-height:var(--lh-headline)}
:is(#app,#modal-root) .level-moves {font-size:var(--t-footnote);line-height:var(--lh-footnote)}
:is(#app,#modal-root) :is(.level-back,.level-help,.dialog-close) {font-family:var(--ff-ui);font-size:var(--t-title);line-height:var(--lh-title);font-weight:400}
#app .mobile-nav button {font-family:var(--ff-ui);font-size:var(--t-tab);line-height:var(--lh-tab);font-weight:500}
#app .mobile-nav button span {font-size:inherit;line-height:inherit}
/* Preserve current tab count and routes: this is T, not IA. */
#app .mobile-nav button {border-bottom-color:transparent}
#app .mobile-nav button.active {color:var(--gold);background:#1b3032;border-radius:8px}
#app .mobile-nav button.active svg {stroke:var(--gold)}
/* Every body of a document uses Reading, including inline book fragments. No new text. */
:is(#app,#modal-root) :is(.document,.scene-document,.book-reading,.reader-page,.narrative) {font-family:var(--ff-reading);font-size:var(--t-reading);font-weight:400;line-height:var(--lh-reading);letter-spacing:0;max-width:65ch}
:is(#app,#modal-root) :is(.document,.scene-document,.book-reading,.reader-page,.narrative) :is(p,li,blockquote) {font-family:inherit;font-size:inherit;line-height:inherit;font-weight:400;letter-spacing:0}
:is(#app,#modal-root) :is(.document,.scene-document,.book-reading,.reader-page) :is(h1,h2,h3) {font-family:var(--ff-display);font-weight:400;font-size:var(--t-display);line-height:var(--lh-display);letter-spacing:.02em}
:is(#app,#modal-root) :is(.document,.scene-document,.book-reading) :is(strong,b) {font-weight:700}
:is(#app,#modal-root) :is(.document .stamp,.document .eyebrow,.document .doc-no,.scene-document small,.scene-number) {font-family:var(--ff-ui);font-size:var(--t-caption);line-height:var(--lh-caption);letter-spacing:.06em}
#modal-root .reader-dialog .reader-page {font-size:calc(var(--t-reading) * var(--reader-scale,1));line-height:calc(var(--lh-reading) * var(--reader-scale,1));max-width:65ch}
#modal-root .reader-page p {font-size:inherit;line-height:inherit;color:inherit}
#modal-root .reader-tools {font-family:var(--ff-ui)}
/* T.5: one 56px header row on ordinary screens (the A3 playing header is unchanged). */
#app .topbar {height:56px;min-height:56px;max-height:56px;display:flex;flex-flow:row nowrap;align-items:center;padding:0;gap:8px;background:var(--surface);border-bottom:1px solid var(--line);width:100%}
#app .topbar .breadcrumb {display:none}
#app .topbar .mobile-brand {display:block;flex:1 1 auto;min-width:0;max-width:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-family:var(--ff-display);font-size:var(--t-headline);font-weight:400;line-height:var(--lh-headline);letter-spacing:0;color:var(--text)}
#app .topbar .resources {display:flex;flex:0 0 auto;flex-flow:row nowrap;align-items:center;gap:6px;min-width:0}
#app .topbar .resource {gap:4px;line-height:var(--lh-footnote)}
#app .topbar .resource strong {font-size:var(--t-footnote);font-weight:600}
#app .topbar .resource-label {display:none}
#app .topbar :is(.cloud-badge,.icon-button) {margin:0;flex:0 0 44px;width:44px;min-width:44px;height:44px;min-height:44px;padding:10px;border:0;border-radius:50%;display:grid;place-items:center;background:transparent;color:var(--gold);font-size:var(--t-title);line-height:var(--lh-title)}
#app .cloud-badge svg {width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
#app .cloud-badge[data-state='error'] {color:#edba9f}
#app .cloud-badge[data-state='saving'] {color:var(--teal)}
@media(max-width:360px){#app .topbar{gap:4px}#app .topbar .resources{gap:2px}#app .topbar .resource{gap:2px}}
/* T.6 splash: retain original image, copy, details, sign-in action and Play gradient. */
#app .welcome-screen {padding:calc(68px + env(safe-area-inset-top)) max(20px,env(safe-area-inset-right)) calc(56px + env(safe-area-inset-bottom)) max(20px,env(safe-area-inset-left));min-height:100dvh;justify-content:center;background:radial-gradient(ellipse at 50% 20%,#0c1d26,#030b12 75%)}
#app .welcome-logo {mix-blend-mode:lighten;width:min(35svh,260px);height:auto;max-width:75vw;max-height:none;object-fit:contain}
#app .welcome-content {width:100%;max-width:560px;min-width:0}
#app .welcome-content h1 {font-family:var(--ff-display);font-size:var(--t-display);line-height:var(--lh-display);font-weight:400;letter-spacing:.02em;margin:4px 0 16px}
#app .welcome-content p {max-width:100%;white-space:normal;overflow-wrap:break-word;word-break:normal;font-size:var(--t-body);line-height:var(--lh-body);color:var(--text)}
#app .welcome-content .welcome-play {max-width:100%;width:min(100%,326px);min-width:0;min-height:54px;margin:16px auto 0;font-size:var(--t-headline);line-height:var(--lh-headline);font-weight:600}
#app .welcome-content .welcome-auth {display:flex;align-items:center;justify-content:center;width:min(100%,326px);max-width:100%;min-width:0;min-height:48px;margin:0 auto 12px;padding:10px 16px;font-size:var(--t-headline);line-height:var(--lh-headline);font-weight:600;white-space:normal;text-align:center}
#app .welcome-content .welcome-note {margin-top:14px;font-size:var(--t-caption);line-height:var(--lh-caption);color:var(--muted)}
#app .welcome-details {margin:12px 0}
#app .welcome-details p {font-size:var(--t-callout);line-height:var(--lh-callout)}
#app .welcome-details summary {font-size:var(--t-callout);line-height:var(--lh-callout);min-height:44px;display:list-item;padding:12px 4px}
#app .welcome-content .plain-button {border:0;width:auto;min-height:44px;max-width:100%;padding:8px 0;font-size:var(--t-footnote);line-height:var(--lh-footnote);color:var(--teal)}
#app .welcome-language {font-size:var(--t-caption);line-height:var(--lh-caption)}
#app .build-version {position:fixed;left:calc(16px + env(safe-area-inset-left));bottom:calc(12px + env(safe-area-inset-bottom));font-family:var(--ff-ui);font-size:var(--t-caption);line-height:var(--lh-caption);font-weight:600;letter-spacing:0;color:var(--text-muted);background:#061115;padding:3px 6px;border-radius:4px;z-index:10;pointer-events:none}
#modal-root .settings-version {font-size:var(--t-caption);line-height:var(--lh-caption);font-weight:600;letter-spacing:0;color:var(--text-muted);background:var(--surface);padding:8px;border-radius:4px}
/* Tutorial: scale text without losing the A3 shared one-row board. */
#app .tutorial-copy h1 {font-family:var(--ff-ui);font-size:var(--t-title);font-weight:700;line-height:var(--lh-title);letter-spacing:0}
#app .tutorial-copy p {font-size:var(--t-callout);line-height:var(--lh-callout);color:var(--text)}
#app .tutorial-copy {background:#07191d;padding:10px 16px;text-align:center}
#app .tutorial-status {display:block;font-size:var(--t-footnote);line-height:var(--lh-footnote);text-align:center;min-height:0}
#app .tutorial-status strong {display:inline;margin-right:5px}
#app .tutorial-status span {display:inline}
#app .tutorial-skip {font-size:var(--t-footnote);line-height:var(--lh-footnote)}
#app .tutorial-bottom>.button {font-size:var(--t-headline);line-height:var(--lh-headline)}
#app .level-compact-header {white-space:nowrap}
#app .level-compact-header>span:first-of-type {min-width:0;overflow:hidden;text-overflow:ellipsis}
#app .level-back,#app .level-help {width:44px;min-width:44px;min-height:44px}
@media(max-width:360px){#app .level-compact-header{grid-template-columns:44px minmax(0,1fr) auto 44px;gap:2px;padding-inline:0}}
/* T.6: SVG stars are 10px artwork, not unreadable text at 10px. */
#app .map-stars {display:flex;gap:2px;align-items:center;justify-content:center;height:12px;margin-top:2px}
#app .map-stars svg {display:block;width:10px;height:10px;stroke:var(--gold);stroke-width:1.3;fill:none}
#app .map-stars .earned {fill:var(--gold)}
#app .level-button {font-family:var(--ff-ui);font-size:var(--t-headline);line-height:var(--lh-headline);font-weight:600;min-width:0;min-height:44px;opacity:1;color:var(--gold);background:#10262b}
#app .level-button:disabled {opacity:1;color:#c4cecb;background:#0d1d22;border-color:#415654}
/* Labels of unavailable content remain legible; art alone conveys dimming. */
:is(#app,#modal-root) button:disabled {opacity:1;color:var(--muted)}
:is(#app,#modal-root) .card-inactive {opacity:1;filter:none}
:is(#app,#modal-root) .card-inactive img {opacity:.55;filter:grayscale(1)}
/* No per-letter settings wraps; labels are not squeezed by their neighbouring text. */
:is(#app,#modal-root) .journey-toggle {flex-wrap:wrap;gap:12px;align-items:center;background:var(--surface)}
:is(#app,#modal-root) .journey-toggle>div {flex:1 1 180px;min-width:0}
:is(#app,#modal-root) .journey-toggle>button {flex:0 1 auto;white-space:nowrap;min-width:max-content;max-width:100%;font-size:var(--t-callout);line-height:var(--lh-callout);word-break:normal;overflow-wrap:normal}
#modal-root .settings-row {flex-wrap:wrap;gap:10px}
#modal-root .settings-row>label {flex:1 1 150px}
#modal-root .settings-row>select {max-width:100%;min-height:44px;flex:0 1 auto}
#modal-root .settings-row .switch {font-size:var(--t-footnote);line-height:var(--lh-footnote);min-width:64px;flex:0 0 64px}
/* T.7 readable surfaces: no small text directly on the scene artwork. */
#app :is(.page-heading,.chapter-card,.map-controls,.evidence-note,.collection-note,.section-toolbar) {background:var(--surface);border-radius:8px}
#app .page-heading {padding:18px 16px;margin:16px 0}
#app :is(.map-controls,.evidence-note,.collection-note) {padding:12px}
#app :is(.document,.scene-document),#modal-root .scene-document {background:#102321;color:var(--text)}
#app :is(.document,.scene-document) p,#modal-root .scene-document p {color:var(--text)}
#modal-root .dialog {background:var(--surface);color:var(--text)}
#modal-root .dialog>p {color:var(--text)}
#modal-root .dialog h2 {color:var(--text)}
#app :is(.muted,.document .stamp,.evidence-note,.character-cycle),#modal-root .muted {color:var(--muted)}
@media(prefers-contrast:more){:root{--text:#fff8e9;--muted:#dde9e6;--gold:#f1d398;--teal:#a3ebdb}#app .level-button:disabled{color:#e0e8e5}}
/* A short display may scroll the splash, but never behind the fixed version footer. */
body[data-route='splash'] #app {height:calc(100dvh - 36px);overflow-y:auto}
#app .welcome-screen {min-height:100%;padding-bottom:24px}
body[data-route='splash']::after {content:"";position:fixed;inset:auto 0 0;height:36px;background:#061115;z-index:9;pointer-events:none}
@media(max-height:640px) and (orientation:portrait) {
 #app .welcome-screen {padding-top:58px;padding-bottom:12px}
 #app .welcome-logo {width:84px}
 #app .welcome-content h1 {margin:4px 0 8px}
 #app .welcome-content .welcome-play {margin-top:12px;min-height:44px}
 #app .welcome-content .welcome-note {margin-top:12px}
 #app .welcome-details {margin:2px 0}
 #app .welcome-content .plain-button {min-height:44px;padding-block:6px}
}
#app .level-difficulty {font-family:var(--ff-ui);font-size:var(--t-footnote);line-height:var(--lh-footnote);font-weight:400;color:var(--muted)}
/* Root is never a scaled body role; otherwise rem tablet tokens would be scaled twice. */
html {font-size:100%}
/* Reading keeps the selected paper theme; document numerals must remain legible. */
#modal-root .reader-dialog .reader-page :is(h1,h2,h3) {color:inherit}
#app .document .doc-no {color:var(--gold)}
#app .fact {background:var(--surface);color:var(--text);opacity:1}
#app .fact.unknown {color:var(--muted)}
/* Disabled gold actions retain dark ink; dimming text on gold fails contrast. */
:is(#app,#modal-root) :is(.button.primary,button.primary):disabled {color:#102321}
#app .seal-guide {background:var(--surface);color:var(--text);border-radius:8px}
#app .main>:is(h2,h3,p) {background:var(--surface);border-radius:6px;padding:6px 10px}
#modal-root .dialog p.settings-version {font-family:var(--ff-ui);font-size:var(--t-caption);line-height:var(--lh-caption);font-weight:600;font-variant-numeric:tabular-nums;letter-spacing:0;color:var(--text-muted)}
/* T regression: larger type must not create an implicit grid row over the Match-3 board.
   No moves, goals, rewards or rules change. The 7x7 board is fitted between visible rows. */
@media(max-width:900px) {
 #app .practice-match {grid-template-rows:56px minmax(0,1fr) auto auto}
 #app .practice-match .match-board {grid-row:2;width:min(calc(100vw - 32px),calc(100dvh - 184px),540px);height:auto;aspect-ratio:1;max-height:100%;grid-template-rows:repeat(7,minmax(0,1fr));margin:0 auto;padding:4px;gap:4px;align-self:center;position:relative;z-index:2}
 #app .practice-match .seal {min-width:0;min-height:0;padding:0}
 #app .practice-match .seal-guide {grid-row:3;position:relative;z-index:2;min-height:32px;padding:4px 8px;margin:0;align-items:center;justify-content:center;align-self:center}
 #app .practice-match .tools {grid-row:4}
}

/* R0: build34 background control uses approved footnote role. */
.splash-motion-toggle{font-size:var(--t-footnote);line-height:var(--lh-footnote)}

.book-cycle-card h3{font-family:var(--ff-display);font-size:var(--t-title);line-height:var(--lh-title)}
.book-cycle-card ol{font-size:var(--t-body);line-height:var(--lh-body)}

.pulse-timer{font-variant-numeric:tabular-nums;font-size:var(--t-caption);white-space:nowrap}.shop-section{margin:24px 0}.shop-section h2{margin-bottom:16px}

body[data-route=play] .mobile-nav,body[data-route=play] .sidebar,body[data-route=tutorial] .mobile-nav,body[data-route=tutorial] .sidebar{display:none}body[data-route=play] .app-shell,body[data-route=tutorial] .app-shell{grid-template-columns:1fr}.ia-rooms,.ia-archive{display:flex;gap:12px;flex-wrap:wrap;margin-top:24px}.ia-rooms h2{flex-basis:100%}

/* 57: compact, consistent game UI; prose retains the reading family. */
:is(#app,#modal-root) :is(.lobby-card p,.level-store p,.shop-section .quest-card p,.mj-aside p){font-size:var(--t-callout);line-height:var(--lh-body)}
#app :is(.lobby-card h2,.shop-section h2,.level-store h2,.mj-aside h2){font-size:var(--t-title);line-height:var(--lh-title)}
#app :is(.lobby-card .eyebrow,.generator small,.merge-cell .item-rank){font-size:var(--t-caption);line-height:var(--lh-caption)}
#app :is(.lobby-card .gold,.mj-count,.merge-orders small,.generator small,.practice-top small){font-variant-numeric:lining-nums tabular-nums}
#app :is(.lobby-card .gold,.mj-count){font-size:var(--t-footnote);line-height:var(--lh-footnote)}
#app .lobby-card>.button{font-size:var(--t-callout);line-height:var(--lh-callout);white-space:normal;overflow-wrap:break-word;min-width:0}
#app .mj-aside .button{font-size:var(--t-callout);line-height:var(--lh-callout);white-space:normal;overflow-wrap:break-word}
#app .mj-tile .mj-mark{font-family:var(--ff-ui);font-size:var(--t-caption);font-weight:700;line-height:var(--lh-caption)}
#app :is(.mj-feedback p,.mj-legend p,.mj-legend li){font-size:var(--t-footnote);line-height:var(--lh-footnote)}
#app .generator small{white-space:normal;overflow-wrap:normal;word-break:normal}
#app .generator{min-width:0;padding-inline:4px}#app .generator>span{font-size:var(--t-callout);line-height:var(--lh-callout)}
#app .lobby-card>h2{padding-right:42px;margin:10px 0 14px}#app .lobby-card>p{margin:8px 0}#app .lobby-card>.gold{margin:10px 0 14px}
#app .level-store :is(h2,h3){margin:18px 0 12px}#app .level-store .quest-card h3{margin-top:0}#app .level-store .quest-card p{margin:10px 0 14px}
#app .shop-section .quest-card h3{margin-bottom:10px}#app .shop-section .quest-card p{margin:0 0 14px}
#app .mj-aside summary{font-size:var(--t-callout);line-height:var(--lh-callout)}
#app .mj-levels button{font-size:var(--t-callout);line-height:var(--lh-callout)}
@media(max-width:360px){#app .lobby-card{padding:20px 16px}#app .lobby-card .eyebrow{padding-right:40px}#app .lobby-emblem{right:16px;width:34px;height:34px}#app .mj-actions .button{flex-basis:90px}#app .mj-aside{padding:16px}}
#app .brand-name{font-size:var(--t-title);line-height:var(--lh-title)}
#app .brand-sub{font-size:var(--t-caption);line-height:var(--lh-caption)}
@media(max-width:600px){#app .topbar .mobile-brand{font-size:var(--t-callout);line-height:var(--lh-callout);white-space:normal;overflow-wrap:normal;word-break:normal;max-width:145px}}

#app .merge-screen-header h1{font-family:var(--ff-ui);font-size:var(--t-headline);line-height:var(--lh-headline);font-weight:600;letter-spacing:0}
#app .merge-screen-header .button{font-size:var(--t-footnote);line-height:var(--lh-footnote)}
body[data-route=merge] #app :is(.inventory-actions .button,.merge-selection){font-size:var(--t-footnote);line-height:var(--lh-footnote)}
body[data-route=merge] #app .generator small{font-size:var(--t-caption);line-height:var(--lh-caption)}
body[data-route=merge] #app .generator>span{font-size:var(--t-footnote);line-height:var(--lh-footnote)}
#app .practice-match .booster-tool>span:last-child{font-size:var(--t-footnote);line-height:var(--lh-footnote)}

/* 59: complete welcome overview remains readable and scrollable on a phone. */
#app .welcome-overview{text-align:left;padding:14px 16px;margin-top:8px;border:1px solid #3d555b;border-radius:12px;background:#0a1b22f2;overflow-wrap:break-word}
#app .welcome-overview :is(p,li){font-size:var(--t-callout);line-height:var(--lh-body);color:var(--text)}
#app .welcome-overview h2{font-family:var(--ff-ui);font-size:var(--t-headline);line-height:var(--lh-headline);margin:18px 0 8px}
#app .welcome-overview ul{padding-left:20px;margin:12px 0}
#app .welcome-overview li{margin:8px 0}
#app .welcome-screen:has(.welcome-details[open]){justify-content:flex-start}
#app .welcome-screen:has(.welcome-details[open]) .welcome-logo{flex-shrink:0}

body[data-guidance=false] #app :is(.practice .instruction,.practice .journey-goal,.practice .seal-guide,.merge-help){display:none}
/* 59: three destinations occupy the whole mobile bar, including Pro Max widths. */
#app .mobile-nav{grid-template-columns:repeat(3,minmax(0,1fr))}
@media(max-width:900px){
 #app .mobile-nav{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;position:relative;inset:auto;width:100%;max-width:none;min-height:60px;margin:0;padding:4px max(8px,env(safe-area-inset-right)) max(6px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));box-sizing:border-box;flex:0 0 auto;align-items:stretch}
 #app .mobile-nav button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-width:0;min-height:52px;margin:0;padding:4px 2px;text-align:center;line-height:var(--lh-caption);font-size:var(--t-caption);border-radius:10px}
 #app .mobile-nav button span{display:block;max-width:100%;font-size:inherit;line-height:inherit;white-space:nowrap;text-align:center;letter-spacing:0}
 #app .mobile-nav button svg{display:block;width:24px;height:24px;margin:0;flex:0 0 24px}
 body:is([data-route=play],[data-route=tutorial],[data-route=merge]) #app .mobile-nav{display:none}
 body[data-route=merge] #app .app-shell{height:100dvh;min-height:0;padding-top:0}
}

/* 59: Apple HIG web adaptation: readable type, comfortable non-board controls, zoom/reflow. */
:is(#app,#modal-root) :is(.button,.plain-button,.icon-button,.dialog-close,.switch,select,input:not([type=checkbox]):not([type=radio])){min-height:44px}
:is(#app,#modal-root) :is(.icon-button,.dialog-close){min-width:44px}
:is(#app,#modal-root) summary{min-height:44px;padding-block:10px;cursor:pointer}
:is(#app,#modal-root) :is(button,a,input,select,summary):focus-visible{outline:3px solid var(--teal);outline-offset:3px}
#modal-root .settings-row>label{overflow-wrap:break-word}
#modal-root .dialog-actions{flex-wrap:wrap}
#modal-root .dialog-actions>.button{max-width:100%;white-space:normal;overflow-wrap:break-word}
@media(prefers-reduced-motion:reduce){:is(#app,#modal-root) *, :is(#app,#modal-root) *::before, :is(#app,#modal-root) *::after{scroll-behavior:auto;animation-duration:.01ms;animation-iteration-count:1;transition-duration:.01ms}}
/* 60: book catalogue and chapter-grounded story entries. */
#app .world-cycle{margin:24px 0;padding:20px;border:1px solid #88764d;border-radius:16px;background:var(--surface)}
#app .world-cycle>h2{margin:8px 0 20px}
#app .world-book-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
#app .world-book{display:flex;flex-direction:column;gap:14px;min-width:0;padding:20px;background:#13292e;border:1px solid #425955;border-radius:12px}
#app .world-book h3{font-family:var(--ff-display);font-size:var(--t-title);line-height:var(--lh-title);overflow-wrap:break-word}
#app .world-book p,#app .world-story p{font-size:var(--t-body);line-height:var(--lh-body)}
#app .world-book .muted{font-size:var(--t-footnote);line-height:var(--lh-footnote)}
#app .world-book>.button{margin-top:auto;white-space:normal}
#app .world-story-picker{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin:16px 0;padding:16px;background:var(--surface);border-radius:10px}
#app .world-story-picker label{font-size:var(--t-body);line-height:var(--lh-body)}
#app .world-story-picker select{flex:1 1 240px;min-width:0;max-width:100%;font-size:var(--t-body);line-height:var(--lh-body)}
#app .world-story{max-width:72ch;margin:20px auto;padding:24px}
#app .world-story h2{margin:12px 0 20px}
#app .world-story p+p{margin-top:20px}
#app .world-chronicle>summary,#app .store-book-cycle>summary{font-size:var(--t-headline);line-height:var(--lh-headline);color:var(--gold)}
#app .store-book-cycle{margin:16px 0;padding:16px;background:var(--surface);border:1px solid #425955;border-radius:12px}
#app .store-book-cycle .shop-grid{margin-top:16px}
@media(max-width:1000px){#app .world-book-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){#app .world-book-grid{grid-template-columns:1fr}#app .world-cycle{padding:16px}#app .world-book{padding:16px}#app .world-story{padding:20px}}
/* Case inventory follows the existing semantic type scale. */
#app .case-material strong,.dialog .case-material strong{font-size:var(--t-footnote);line-height:var(--lh-footnote)}
#app .case-material small,.dialog .case-material small{font-size:var(--t-caption);line-height:var(--lh-caption)}
#app .practice-relation{font-size:var(--t-footnote);line-height:var(--lh-footnote)}

#app .merge-cell.task-reserved{border:2px solid #ffdc85;box-shadow:inset 0 0 0 2px #624923,0 0 12px #ffd87555}#app .task-lock{position:absolute;right:4px;top:3px;color:#ffe5a2;font-size:14px;text-shadow:0 1px 3px #000}

/* 67: keep icon boxes and labels separate at every game width. */
body[data-route=play] #app .practice-match .tools{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;align-items:stretch;padding:8px max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left))}
body[data-route=play] #app .practice-match .tools .tool{display:grid;grid-template-rows:40px auto;justify-items:center;align-content:center;gap:6px;min-width:0;max-width:none;min-height:84px;padding:8px 6px;font-family:var(--ff-ui);font-size:var(--t-footnote);font-weight:600;line-height:var(--lh-footnote);letter-spacing:0;text-transform:none}
body[data-route=play] #app .practice-match .tools [data-act=rules]{display:none}
body[data-route=play] #app .practice-match .tools .tool-symbol{display:grid;place-items:center;width:40px;height:40px;min-height:40px;margin:0;line-height:1}
body[data-route=play] #app .practice-match .tools .booster-art{width:40px;height:40px}
body[data-route=play] #app .practice-match .tools .tool-label{display:block;min-width:0;width:100%;font-family:var(--ff-ui);font-size:var(--t-footnote);font-weight:600;line-height:var(--lh-footnote);letter-spacing:0;text-align:center;white-space:normal;word-break:normal;overflow-wrap:normal;hyphens:none}
#app .mj-dead-end{position:relative;z-index:4;margin:0 0 20px;padding:16px;border:2px solid #f3ba83;border-radius:14px;background:#3b2426;color:#fff0d7;box-shadow:0 0 20px #f3ba8320}
#app .mj-dead-end strong{font-family:var(--ff-ui);font-size:var(--t-headline);font-weight:700;line-height:var(--lh-headline)}
#app .mj-dead-end p{font-size:var(--t-callout);line-height:var(--lh-callout);margin:8px 0 12px}
#app .mj-dead-end>div{display:flex;gap:10px;flex-wrap:wrap}
#app .mj-dead-end .button{font-size:var(--t-footnote);line-height:var(--lh-footnote);min-height:44px;flex:1 1 140px;white-space:normal}

/* 68: the legend reuses the exact SVG artwork rendered on special cubes. */
#app .practice-match .seal-guide{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;width:min(100%,540px);max-width:100%;margin-inline:auto;padding:6px 8px;min-height:44px;height:auto}
#app .practice-match .seal-guide>.seal-guide-item{display:flex;min-width:0;align-items:center;justify-content:center;gap:6px}
#app .practice-match .seal-guide-mark{display:grid;place-items:center;flex:0 0 28px;width:28px;height:28px;border:1px solid #ffe9a6;border-radius:7px;background:radial-gradient(circle at 35% 25%,#53658c,#252747 65%,#131527);color:#fff2b3;box-shadow:inset 0 1px 4px #e1f6ff70}
#app .practice-match .seal-guide-mark svg{display:block;width:22px;height:22px;filter:drop-shadow(0 1px 1px #000)}
#app .practice-match .seal-guide-label{font-family:var(--ff-ui);font-size:var(--t-footnote);font-weight:500;line-height:var(--lh-footnote);letter-spacing:0;text-transform:none;white-space:nowrap;word-break:normal;overflow-wrap:normal}
@media(max-width:600px){#app .practice-match .seal-guide>.seal-guide-item{flex-direction:column;gap:4px}#app .practice-match .seal-guide{padding-block:6px}}

/* Feedback 69: labels remain intact at narrow widths and larger text sizes. */
#modal-root .settings-row .switch{box-sizing:border-box;flex:0 0 auto;width:auto;min-width:76px;padding:10px 16px;white-space:nowrap;word-break:normal;overflow-wrap:normal;line-height:1.3;text-align:center}
.practice-match .seal.match-swapping{transition:transform 180ms ease-in-out;z-index:4}
.practice-match .seal.match-clearing{animation:match-clear69 260ms ease-out both}
@keyframes match-clear69{0%,40%{outline:3px solid #fff0b8;outline-offset:-3px}100%{opacity:.15;transform:scale(.85)}}
@media(prefers-reduced-motion:reduce){.practice-match .seal.match-swapping{transition:none}.practice-match .seal.match-clearing{animation:none}}

/* New seals enter at the top; surviving seals fall only by the removed spaces. */
.practice-match .match-board{overflow:hidden;position:relative}
.practice-match .seal.match-falling{animation:match-fall69 300ms cubic-bezier(.3,.02,.7,1) both;z-index:2}
@keyframes match-fall69{from{transform:translateY(var(--fall-y))}to{transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){.practice-match .seal.match-falling{animation:none}}

/* 70: the Academy name is a keyboard-accessible route back to the lobby. */
.brand-home{appearance:none;background:none;color:inherit;font:inherit;border:0;cursor:pointer;text-align:inherit}
.sidebar .brand-home{width:100%;border-bottom:1px solid #344043;text-align:center}
.brand-home .brand-name,.brand-home .brand-sub{display:block}
.topbar .mobile-brand.brand-home{padding:0;min-height:44px;text-align:left;flex-shrink:0}
.brand-home:hover{color:var(--gold)}
.brand-home:focus-visible{outline:2px solid var(--teal);outline-offset:4px;border-radius:4px}

/* 71: compact practice cards; preserve readable text and 44 px actions. */
#app .lobby-grid{gap:12px;margin:16px 0}
#app .lobby-card{padding:16px;border-radius:14px}
#app .lobby-card>h2{margin:0 0 6px;padding-right:40px;font-size:var(--t-headline);line-height:var(--lh-headline)}
#app .lobby-emblem{top:14px;right:16px;width:30px;height:30px}
#app .lobby-card>p{margin:4px 0;max-width:none;font-size:var(--t-footnote);line-height:var(--lh-footnote)}
#app .lobby-card>.practice-relation{padding:4px 8px;margin:4px 0 6px;font-size:var(--t-caption);line-height:var(--lh-caption)}
#app .lobby-card>.gold{margin:6px 0 4px}
#app .lobby-card>progress{display:block;width:100%;height:4px;margin:4px 0 10px}
#app .lobby-card>.button{margin:0 8px 0 0;padding:9px 14px;min-height:44px;font-size:var(--t-footnote);line-height:var(--lh-footnote)}
#app .lobby-stories>.eyebrow{padding-right:0;margin:0 0 4px}
#app .lobby-stories>p{margin-bottom:10px}
@media(max-width:360px){#app .lobby-card{padding:14px}#app .lobby-emblem{right:14px}}

#app .guest-notice{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;padding:10px 12px;margin:12px 0;background:var(--surface);border:1px solid var(--line);border-radius:8px;font:500 var(--t-footnote)/var(--lh-footnote) var(--ff-ui)}#app .guest-notice>span{flex:1 1 240px}#app .guest-notice .button{min-height:44px}

/* Four equal mobile targets: Academy, Archive, Shop and Settings. */
#app .mobile-nav{grid-template-columns:repeat(4,minmax(0,1fr))}
@media(max-width:900px){
 /* Align the navigation frame with the content, including asymmetric landscape insets. */
 #app .mobile-nav{width:calc(100% - max(12px,env(safe-area-inset-left)) - max(12px,env(safe-area-inset-right)));margin-left:max(12px,env(safe-area-inset-left));margin-right:max(12px,env(safe-area-inset-right));padding-inline:0}
}
#app .settings-control{min-height:44px;min-width:44px;white-space:nowrap}

/* Email sign-in keeps inputs readable at mobile text sizes. */
.dialog .email-auth{margin-top:16px;overflow-wrap:anywhere}
.dialog .email-auth form{display:grid;gap:10px}
.dialog .email-auth label{font-weight:600}
.dialog .email-auth input{box-sizing:border-box;width:100%;min-width:0;min-height:48px;padding:10px 12px;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:inherit;font:400 16px/1.5 var(--ff-ui)}
.dialog .email-auth input:focus-visible{outline:2px solid var(--gold);outline-offset:3px}
.dialog .email-auth-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.dialog .email-auth .button{min-height:44px;white-space:normal}
.dialog .email-auth-message{margin:0;min-height:1.5em}
.dialog .email-auth-message.is-error{color:#ffb4ab}
.dialog .email-auth-legacy{margin-top:20px;padding-top:14px;border-top:1px solid var(--line)}
.dialog .email-auth-legacy p{font-size:var(--t-footnote);line-height:var(--lh-footnote)}

.service-links{display:flex;flex-wrap:wrap;gap:4px 16px;align-items:center;margin:24px 0 8px;padding:12px 0;border-top:1px solid var(--line)}.service-links a{display:inline-flex;align-items:center;min-height:44px;color:var(--gold);font-size:var(--t-footnote);text-underline-offset:3px}.service-links a:focus-visible{outline:2px solid var(--gold);outline-offset:3px}

/* Optional mailings stay separate from identity and use full-label touch targets. */
#modal-root .mailing-choices{min-width:0;margin:8px 0;padding:12px 0 0;border:0;border-top:1px solid var(--line)}
#modal-root .mailing-choices legend{padding:0 8px 0 0;font-size:var(--t-footnote);line-height:var(--lh-footnote);color:var(--muted);font-weight:600}
#modal-root .mailing-choices .mailing-choice{display:grid;grid-template-columns:22px minmax(0,1fr);align-items:start;gap:12px;min-height:44px;margin:8px 0;padding:6px 0;text-align:left;font-size:var(--t-callout);line-height:var(--lh-callout);font-weight:400;cursor:pointer}
#modal-root .mailing-choices input[type=checkbox]{display:block;box-sizing:border-box;width:22px;height:22px;min-width:22px;min-height:22px;margin:1px 0 0;padding:0;accent-color:var(--gold);cursor:pointer}
#modal-root .mailing-choices .mailing-choice.is-unavailable{color:var(--muted);cursor:default}
#modal-root .mailing-choices .mailing-choice.is-unavailable input[type=checkbox]{cursor:default;opacity:.5}
#modal-root .mailing-unavailable{margin:12px 0;padding:12px 0 0;border-top:1px solid var(--line);font-size:var(--t-footnote);line-height:var(--lh-footnote);color:var(--muted)}
#modal-root .mailing-choices .mailing-note{margin:10px 0 0;font-size:var(--t-footnote);line-height:var(--lh-footnote);color:var(--muted)}
#modal-root .mailing-choice span{overflow-wrap:anywhere}
#modal-root .mailing-address{overflow-wrap:anywhere}
#modal-root .mailing-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:18px}
#modal-root .mailing-actions .button{flex:1 1 220px;white-space:normal}
#modal-root .mailing-message.is-error{color:#ffb4ab}
#modal-root .mailing-choices:disabled{opacity:.7}

/* Player IDs remain readable and selectable at narrow phone widths. */
#modal-root .player-profile{min-width:0;max-width:100%;overflow-wrap:anywhere}
#modal-root .player-profile-details{display:grid;gap:12px;margin:16px 0;min-width:0}
#modal-root .player-profile-details>div{min-width:0}
#modal-root .player-profile-details dt{margin:0 0 4px;color:var(--muted);font-size:var(--t-footnote);line-height:var(--lh-footnote)}
#modal-root .player-profile-details dd{margin:0;white-space:normal;overflow-wrap:anywhere;font-size:var(--t-body);line-height:var(--lh-body)}
#modal-root .player-profile-id-section{min-width:0;max-width:100%;margin:16px 0;padding:14px;border:1px solid var(--line);border-radius:12px;background:var(--surface)}
#modal-root .player-profile-id-label{color:var(--muted);font-size:var(--t-footnote);line-height:var(--lh-footnote)}
#modal-root .player-profile-id{display:block;box-sizing:border-box;min-width:0;max-width:100%;margin:8px 0 14px;padding:0;white-space:normal;overflow-wrap:anywhere;word-break:break-all;user-select:text;-webkit-user-select:text;font-family:ui-monospace,monospace;font-size:var(--t-body);line-height:var(--lh-body);color:var(--text)}
#modal-root .player-profile-id:focus-visible{outline:2px solid var(--gold);outline-offset:4px;border-radius:3px}
#modal-root .player-profile .button{max-width:100%;min-height:44px;white-space:normal}
#modal-root .player-profile-note{margin-top:12px;color:var(--muted);font-size:var(--t-footnote);line-height:var(--lh-footnote)}
#modal-root .player-profile-notice{margin-top:14px;padding:12px;border:1px solid var(--line);border-radius:8px;font-size:var(--t-callout);line-height:var(--lh-callout)}
#modal-root .player-profile-copy-status{margin-top:10px;min-height:1.5em;font-size:var(--t-footnote);line-height:var(--lh-footnote)}
#modal-root .player-profile-copy-status.is-error{color:#ffb4ab}

/* Temporary access and its administration fit the same narrow account dialog. */
#modal-root .player-profile-access{margin:18px 0;padding-top:14px;border-top:1px solid var(--line)}
#modal-root .player-profile-access h3{font-size:var(--t-headline);line-height:var(--lh-headline)}
#modal-root .tester-access{min-width:0;max-width:100%;overflow-wrap:anywhere}
#modal-root .tester-access p,#modal-root .tester-access li{font-size:var(--t-callout);line-height:var(--lh-callout)}
#modal-root .tester-access h3{margin:18px 0 12px;font-size:var(--t-headline);line-height:var(--lh-headline)}
#modal-root .tester-form{display:grid;gap:10px;min-width:0;margin-top:18px}
#modal-root .tester-form label{font-size:var(--t-callout);line-height:var(--lh-callout);font-weight:600}
#modal-root .tester-form textarea,#modal-root .tester-form select{box-sizing:border-box;width:100%;min-width:0;max-width:100%;min-height:48px;padding:10px 12px;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:inherit;font:400 var(--t-body)/var(--lh-body) var(--ff-ui)}
#modal-root .tester-form textarea{resize:vertical;white-space:pre-wrap;overflow-wrap:anywhere}
#modal-root .tester-access .tester-hint{margin:0 0 8px;color:var(--muted);font-size:var(--t-footnote);line-height:var(--lh-footnote)}
#modal-root .tester-access .button{min-height:44px;max-width:100%;white-space:normal;overflow-wrap:anywhere}
#modal-root .tester-actions{display:flex;flex-wrap:wrap;gap:10px;margin:14px 0}
#modal-root .tester-actions .button{flex:1 1 180px}
#modal-root .tester-player{min-width:0;max-width:100%;margin:12px 0;padding:12px;border:1px solid var(--line);border-radius:10px;background:var(--surface)}
#modal-root .tester-player code,#modal-root .tester-errors code{display:block;min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere;word-break:break-all;user-select:text;-webkit-user-select:text;font-size:var(--t-footnote);line-height:var(--lh-footnote)}
#modal-root .tester-player dl{display:grid;gap:10px;margin:10px 0 0}
#modal-root .tester-player dt{color:var(--muted);font-size:var(--t-footnote);line-height:var(--lh-footnote)}
#modal-root .tester-player dd{margin:4px 0 0;font-size:var(--t-callout);line-height:var(--lh-callout)}
#modal-root .tester-error,#modal-root .tester-errors{color:#ffb4ab}
#modal-root .tester-errors{padding-left:22px}
#modal-root .tester-list{margin-top:24px;padding-top:14px;border-top:1px solid var(--line)}
#modal-root .tester-access [data-tester-status]{min-height:1.5em}
#modal-root .tester-form :focus-visible,#modal-root .tester-access button:focus-visible{outline:2px solid var(--gold);outline-offset:3px}

/* The close action remains reachable while a long dialog scrolls. */
#modal-root .dialog-header{position:sticky;top:0;z-index:5;display:flex;align-items:flex-start;justify-content:space-between;gap:12px;background:var(--surface);padding:12px 0;margin-top:-12px}
#modal-root .dialog-header>div{min-width:0}
#modal-root .dialog-header h2{margin:8px 0 0}
#modal-root .dialog-header .dialog-close{position:static;flex:0 0 44px;background:var(--surface);border:1px solid var(--line);border-radius:50%}

.version-staff-link{pointer-events:auto;display:inline-flex;align-items:center;min-height:44px;color:inherit;text-decoration:underline;text-decoration-style:dotted;text-underline-offset:4px}
.player-name-actions{display:flex;flex-wrap:wrap;gap:12px;margin-block:16px}
:is(#player-name-editor,#admin-names) input{display:block;width:100%;min-height:44px;font:inherit;margin-block:8px 16px}
#admin-names code{overflow-wrap:anywhere}

body[data-route="splash"] #app{height:calc(100dvh - 76px - env(safe-area-inset-bottom))}

/* Compact player-name form: fixed header/footer, only the form content scrolls. */
#modal-root .dialog.player-name-dialog{width:min(100%,520px);padding:24px;display:flex;flex-direction:column;overflow:hidden}
#modal-root .player-name-dialog .dialog-header{position:static;flex-shrink:0;margin:0 0 16px;padding:0 0 12px;border-bottom:1px solid var(--line)}
#modal-root .player-name-dialog .dialog-header h2{font-size:var(--t-title);line-height:var(--lh-title);margin-top:8px}
#modal-root #player-name-editor{min-height:0;overflow-y:auto;overscroll-behavior:contain;padding-right:4px}
#modal-root #player-name-editor :is(.name-intro,label){font-size:var(--t-callout);line-height:var(--lh-callout)}
#modal-root #player-name-editor :is(.name-note,.name-rules p,[role=status]){font-size:var(--t-footnote);line-height:var(--lh-footnote);color:var(--muted)}
#modal-root #player-name-editor .name-rules{margin-block:8px 16px}
#modal-root #player-name-editor .name-rules summary{min-height:44px;align-content:center;font-size:var(--t-callout);line-height:var(--lh-callout);color:var(--gold);cursor:pointer}
#modal-root #player-name-editor input{font-size:var(--t-body);line-height:var(--lh-body);min-height:48px;padding:10px 12px;color:var(--text);background:#122b30;border:1px solid #526b70;border-radius:10px;caret-color:var(--gold);color-scheme:dark}
#modal-root #player-name-editor label{display:block;font-weight:600}
#modal-root #player-name-editor .player-name-actions{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-block:16px 4px}
#modal-root #player-name-editor .player-name-actions button{font-size:var(--t-callout);line-height:var(--lh-callout);padding:10px;min-height:48px}
#modal-root .player-name-dialog .dialog-actions{flex-shrink:0;margin-top:16px;padding-top:12px;border-top:1px solid var(--line)}
@media(max-width:350px){#modal-root #player-name-editor .player-name-actions{grid-template-columns:1fr}}
/* Stars prices and order IDs remain distinct and readable on narrow phones. */
:is(#app .stars-entry,#modal-root .stars-shop){min-width:0;max-width:100%;overflow-wrap:anywhere}
:is(#app .stars-entry,#modal-root .stars-shop) p{font-size:var(--t-callout);line-height:var(--lh-callout)}
:is(#app .stars-entry,#modal-root .stars-shop) .stars-note{color:var(--muted);font-size:var(--t-footnote);line-height:var(--lh-footnote)}
#modal-root .stars-shop h3{margin:0 0 12px;font-size:var(--t-headline);line-height:var(--lh-headline)}
#modal-root .stars-catalog{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,230px),1fr));gap:14px;margin:18px 0}
#modal-root :is(.stars-product,.stars-invoice,.stars-order){min-width:0;max-width:100%;padding:14px;border:1px solid var(--line);border-radius:12px;background:var(--surface)}
#modal-root .stars-product{display:flex;flex-direction:column;align-items:stretch}
#modal-root .stars-product .button{margin-top:auto}
#modal-root .stars-invoice{margin-block:18px;border-color:var(--gold)}
#modal-root .stars-orders{margin-top:24px;padding-top:16px;border-top:1px solid var(--line)}
#modal-root .stars-order{margin-top:14px}
#modal-root .stars-price{color:var(--gold);font-weight:700}
#modal-root .stars-order-id{display:block;min-width:0;max-width:100%;margin-block:12px;white-space:normal;overflow-wrap:anywhere;word-break:break-all;user-select:text;-webkit-user-select:text;font-size:var(--t-footnote);line-height:var(--lh-footnote)}
:is(#app .stars-entry,#modal-root .stars-shop) .button{max-width:100%;min-height:44px;white-space:normal;overflow-wrap:anywhere;text-align:center}
#modal-root .stars-actions{display:flex;flex-wrap:wrap;gap:10px;margin-block:16px}
#modal-root .stars-actions .button{flex:1 1 200px}
#modal-root .stars-links{display:flex;flex-wrap:wrap;gap:8px 18px}
#modal-root .stars-links a{display:inline-flex;align-items:center;min-height:44px;color:var(--gold);font-size:var(--t-footnote);line-height:var(--lh-footnote);text-underline-offset:3px}
#modal-root .stars-notice{padding:12px;border:1px solid var(--line);border-radius:8px}
#modal-root .stars-status{min-height:1.5em}
#modal-root .stars-status.is-error{color:#ffb4ab}
#modal-root .stars-shop :focus-visible{outline:2px solid var(--gold);outline-offset:3px}
#app .life-stock{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-block:12px}
#app .life-stock p{margin:0}
body[data-purchase-locked="true"] #modal-root .dialog-close{opacity:.5;pointer-events:none}

/* Owner payment decisions use explicit review and a narrow, selectable audit log. */
#stars-admin-entry{display:contents}
#modal-root .stars-admin{min-width:0;max-width:100%;overflow-wrap:anywhere}
#modal-root .stars-admin p,#modal-root .stars-admin label{font-size:var(--t-callout);line-height:var(--lh-callout)}
#modal-root .stars-admin h3{font-size:var(--t-headline);line-height:var(--lh-headline)}
#modal-root :is(.stars-admin-list,.stars-admin-audit){margin-top:24px;padding-top:16px;border-top:1px solid var(--line)}
#modal-root :is(.stars-admin-list,.stars-admin-audit) article,#modal-root .stars-admin-decision{min-width:0;max-width:100%;margin-block:14px;padding:14px;border:1px solid var(--line);border-radius:10px;background:var(--surface)}
#modal-root .stars-admin-decision{border-color:var(--gold)}
#modal-root .stars-admin-id{display:block;min-width:0;max-width:100%;margin-block:10px;white-space:normal;overflow-wrap:anywhere;word-break:break-all;user-select:text;-webkit-user-select:text;font-size:var(--t-footnote);line-height:var(--lh-footnote)}
#modal-root .stars-admin .button{min-height:44px;max-width:100%;white-space:normal;overflow-wrap:anywhere}
#modal-root .stars-admin-actions{display:flex;flex-wrap:wrap;gap:10px;margin-block:14px}
#modal-root .stars-admin-actions .button{flex:1 1 200px}
#modal-root .stars-admin-reason-form{display:grid;gap:10px}
#modal-root .stars-admin-search{display:grid;gap:10px;margin-block:18px}
#modal-root .stars-admin-search input{box-sizing:border-box;width:100%;min-width:0;max-width:100%;min-height:48px;padding:10px 12px;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:inherit;font:400 var(--t-body)/var(--lh-body) var(--ff-ui)}
#modal-root .stars-admin textarea{box-sizing:border-box;width:100%;min-width:0;max-width:100%;min-height:100px;padding:10px 12px;resize:vertical;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:inherit;font:400 var(--t-body)/var(--lh-body) var(--ff-ui)}
#modal-root .stars-admin-reason{white-space:pre-wrap;overflow-wrap:anywhere}
#modal-root .stars-admin-status{min-height:1.5em}
#modal-root .stars-admin-status.is-error{color:#ffb4ab}
#modal-root .stars-admin :focus-visible{outline:2px solid var(--gold);outline-offset:3px}

/* Paused book launch controls use the established type and button scale. */
.book-release-actions{display:grid;gap:10px;margin-block:16px}
.book-release-actions .button{width:100%;min-height:48px;white-space:normal;text-wrap:pretty}
.book-release-actions p{font-size:var(--t-footnote);line-height:var(--lh-footnote);margin:0}

/* Header occupies real layout space; only dialog contents scroll beneath it. */
#modal-root .dialog{display:flex;flex-direction:column;overflow:hidden;min-height:0}
#modal-root .dialog .dialog-header{position:static;flex:0 0 auto;margin:0;padding:0 0 20px;background:var(--surface)}
#modal-root .dialog-content{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;scroll-padding-block:12px;padding:0 2px 2px;overflow-wrap:anywhere}
#modal-root .dialog-content>.dialog-actions{margin-top:20px}
#modal-root .player-name-dialog #player-name-editor{overflow:visible;padding-right:0}
#modal-root .dialog .metrics-grid{align-items:start;gap:12px;margin:8px 0 20px}
#modal-root .dialog .metrics-grid p{margin:0;min-width:0;font-size:var(--t-callout);line-height:var(--lh-callout)}
#modal-root .dialog .metrics-grid strong{display:block;font-size:var(--t-title);line-height:var(--lh-title)}
#modal-root .dialog-content .button{max-width:100%;white-space:normal;overflow-wrap:anywhere}
/* Compact profile: keep account linking visible without a long identity preamble. */
#modal-root .player-profile-dialog .dialog-header{padding-bottom:14px;margin-bottom:14px;border-bottom:1px solid var(--line)}
#modal-root .player-profile-dialog .dialog-content{padding:2px 8px 12px 0;scrollbar-gutter:stable;scroll-padding-block:16px}
#modal-root .player-profile-dialog .player-profile{display:grid;gap:12px}
#modal-root .player-profile-dialog .player-profile>.button{justify-self:start}
#modal-root .player-profile-dialog :is(.player-profile-identity,.player-profile-access){margin:0;padding:0;border:1px solid var(--line);border-radius:10px;overflow:hidden}
#modal-root .player-profile-dialog :is(.player-profile-identity,.player-profile-access)>summary{padding:12px;cursor:pointer;font-size:var(--t-callout);line-height:var(--lh-callout);font-weight:600}
#modal-root .player-profile-dialog [data-player-role]{display:block;padding-top:4px;color:var(--muted);font-size:var(--t-footnote);line-height:var(--lh-footnote);font-weight:400}
#modal-root .player-profile-dialog :is(.player-profile-identity,.player-profile-access)>:not(summary){margin:12px}
#modal-root .player-profile-dialog .player-profile-copy-status:empty{display:none}
#modal-root .player-profile-dialog .account-links{margin:0;padding:14px 0 0;border-top:1px solid var(--line)}
#modal-root .player-profile-dialog .account-links h3{margin:0 0 12px}
#modal-root .player-profile-dialog .account-links form{display:grid;gap:10px}
#modal-root .player-profile-dialog .account-links label{display:grid;gap:8px;font-size:var(--t-callout);line-height:var(--lh-callout)}
#modal-root .player-profile-dialog .account-links input{width:100%;min-width:0;box-sizing:border-box;min-height:44px;padding:10px 12px;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--text);font:400 16px/1.4 var(--ff-ui)}
#modal-root .player-profile-dialog .account-links p{margin:10px 0;font-size:var(--t-footnote);line-height:var(--lh-footnote);color:var(--muted)}
#modal-root .player-profile-dialog .account-links summary{padding:10px 0;font-size:var(--t-callout);line-height:var(--lh-callout);cursor:pointer}
#modal-root .player-profile-dialog .account-links [data-link-status]:empty{display:none}
#modal-root .player-profile-dialog .dialog-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:16px;padding-top:16px;border-top:1px solid var(--line)}
#modal-root .player-profile-dialog .dialog-actions .button{margin:0;width:100%;min-width:0;padding:10px;font-size:var(--t-callout);line-height:var(--lh-callout)}
#modal-root .player-profile-dialog .dialog-actions [data-act=settings]{grid-column:1/-1}
@media(max-width:480px){#modal-root .player-profile-dialog{padding:22px 18px}#modal-root .player-profile-dialog .dialog-header .eyebrow{font-size:11px}#modal-root .player-profile-dialog .dialog-header h2{font-size:22px;line-height:1.25}}
@media(max-width:350px){#modal-root .player-profile-dialog .dialog-actions{grid-template-columns:1fr}}
@media(max-width:380px){#modal-root .dialog{padding:22px 18px}#modal-root .dialog .dialog-header h2{font-size:var(--t-title);line-height:var(--lh-title)}}

/* Shared support controls and keyboard-safe, scrollable modal content. */
html:not([data-telegram-mini-app=true]) #modal-root .dialog-backdrop{inset:0;height:auto;padding-top:calc(max(16px,env(safe-area-inset-top,0px)) + var(--dialog-visible-top,0px));padding-bottom:calc(max(16px,env(safe-area-inset-bottom,0px)) + max(0px,calc(var(--aurora-page-height,100dvh) - var(--dialog-visible-height,var(--aurora-page-height,100dvh)) - var(--dialog-visible-top,0px))))}
html:not([data-telegram-mini-app=true]) #modal-root .dialog{max-height:calc(var(--dialog-visible-height,var(--aurora-page-height,100dvh)) - max(16px,env(safe-area-inset-top,0px)) - max(16px,env(safe-area-inset-bottom,0px)))}
#modal-root .support-filters{display:flex;flex-wrap:wrap;gap:10px;margin-block:16px}
#modal-root .support-filters .button{flex:1 1 140px;margin:0}
#modal-root .support-filters [aria-pressed=true]{border-color:var(--gold);color:var(--gold)}
#modal-root :is(input,textarea,select):focus-visible{outline:2px solid var(--gold);outline-offset:3px}
@media(max-height:450px){#modal-root .dialog .dialog-header{padding-bottom:10px}#modal-root .dialog .dialog-header .eyebrow{display:none}#modal-root .dialog{padding-block:14px}}
#modal-root .save-comparison{width:100%;max-width:100%;table-layout:fixed;border-collapse:collapse;margin-block:16px;font-size:var(--t-callout);line-height:var(--lh-callout)}
#modal-root .save-comparison :is(th,td){padding:10px 6px;border-bottom:1px solid var(--line);text-align:start;overflow-wrap:anywhere}
#modal-root .save-comparison :is(td,thead th:not(:first-child)){text-align:center;font-variant-numeric:tabular-nums}
#modal-root .save-comparison caption{text-align:start;margin-bottom:8px;font-weight:600}
body[data-gameplay-admin=true] :is(.mobile-brand,.brand-sub,.welcome-content>h1)::after{content:"ADMIN · ∞";display:block;font-family:var(--ff-ui);font-size:var(--t-caption);line-height:var(--lh-caption);letter-spacing:0;color:var(--gold)}

.store-currency-panel{margin:0 0 20px;padding:16px;border:1px solid var(--line);border-radius:12px;background:var(--surface)}
.store-currency-controls{display:flex;gap:10px;flex-wrap:wrap;margin:12px 0}
.store-currency-controls .button{flex:1 1 80px;min-height:44px;padding:10px 12px;font-size:var(--t-callout);line-height:var(--lh-callout);font-variant-numeric:tabular-nums}
.store-currency-controls [aria-pressed=true]{border-color:var(--gold);color:var(--gold);background:var(--panel)}
.store-currency-panel p,.cash-store>p{font-size:var(--t-footnote);line-height:var(--lh-footnote);color:var(--muted)}
.cash-store{margin-block:24px}
.cash-store h2{margin-block:12px}
.cash-store .shop-grid{margin-top:16px}
.store-money-price{font-size:var(--t-title);line-height:var(--lh-title);font-variant-numeric:tabular-nums;color:var(--gold);margin-block:16px}

/* Swipes are confined to the game board; the surrounding page scrolls normally. */
.match-board{touch-action:none;user-select:none;-webkit-user-select:none}
.match-board .seal{cursor:grab}
.match-board .seal.match-dragging{cursor:grabbing;z-index:5;transition:none;filter:brightness(1.15)}

.store-currency-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}

.welcome-platform-note{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;margin:20px 0;padding:16px;border:1px solid var(--gold);border-radius:16px;background:rgba(9,27,32,.9);text-align:left;min-width:0}
.welcome-platform-note strong{display:block;color:var(--gold)}
#app .welcome-content .welcome-platform-note p{margin:0;font-size:var(--t-footnote);line-height:var(--lh-footnote)}
.welcome-platform-note .button{display:flex;align-items:center;justify-content:center;box-sizing:border-box;min-height:44px;width:100%;max-width:100%;min-width:0;margin:0;padding:10px 14px;text-align:center;text-decoration:none;white-space:normal;overflow-wrap:anywhere;line-height:var(--lh-footnote)}
html[data-telegram-mini-app=true] .welcome-platform-note{display:none}

.stars-terms{display:flex;align-items:flex-start;flex-wrap:wrap;gap:8px;margin:16px 0;line-height:1.5}.stars-terms input{width:24px;height:24px;flex:0 0 24px}

.operator-details{max-width:70ch;margin:1rem auto;color:var(--muted);font-size:.8rem;line-height:1.6;text-align:center;overflow-wrap:anywhere}

body[data-route="shop"] .shop-grid{gap:10px}body[data-route="shop"] .quest-card{padding:14px}body[data-route="shop"] .quest-card h3{margin:0 0 6px}body[data-route="shop"] .quest-card p{margin:6px 0;font-size:.875rem;line-height:1.45}.store-currency-controls{display:flex;flex-wrap:wrap;gap:6px}.store-currency-controls .button{flex:1 1 70px;padding:8px;min-height:44px}.store-currency-controls .button:disabled{opacity:.4}

#moderation-panel form{display:grid;gap:12px}#moderation-panel label{display:grid;gap:6px}#moderation-panel input,#moderation-panel select{width:100%;min-height:44px}#moderation-panel code{overflow-wrap:anywhere}

.account-links{margin-top:20px;border-top:1px solid var(--line);padding-top:16px}.account-links form,.account-links label{display:grid;gap:8px}.account-links input{width:100%;min-width:0;min-height:44px}.account-links code{display:block;overflow-wrap:anywhere;font-size:1.1rem;user-select:all}.account-links p{line-height:1.5}

body[data-route="shop"] .shop-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,155px),1fr))}.shop-pulse{padding:10px 14px;margin:12px 0;border:1px solid var(--line);border-radius:12px}.shop-pulse summary{cursor:pointer;min-height:28px;font-weight:600}.shop-pulse[open] summary{margin-bottom:10px}body[data-route="shop"] .quest-card{display:flex;flex-direction:column}body[data-route="shop"] .quest-card .button{margin-top:auto}body[data-route="shop"] .quest-card p{margin-bottom:12px}
body[data-route="shop"] .page-heading{padding:16px;margin-bottom:12px}body[data-route="shop"] .page-heading h1{margin:4px 0}body[data-route="shop"] .store-currency-panel{padding:14px}
@media(max-width:600px){body[data-route="shop"] .store-currency-controls{display:grid;grid-template-columns:repeat(6,minmax(0,1fr))}body[data-route="shop"] .store-currency-controls .button{grid-column:span 2;padding:8px 4px;white-space:nowrap}body[data-route="shop"] .store-currency-controls .button:nth-child(-n+2){grid-column:span 3}}

/* One visible navigation bar for all four practices, including focused mobile play. */
#app .game-navigation{display:flex;gap:8px;align-items:center;flex:0 0 auto;position:sticky;top:0;z-index:12;margin:0 0 12px;padding:8px 0;background:var(--bg,#071317)}
#app .game-navigation .button{flex:1;min-width:0;min-height:44px;margin:0;padding:8px 10px;font-size:var(--t-footnote);line-height:var(--lh-footnote);white-space:normal;text-align:center}
@media(max-width:680px){#app .game-navigation{margin-bottom:6px;gap:6px;padding-block:4px}#app .game-navigation .button{padding:6px}}

#app .merge-current-task{display:flex;flex-wrap:wrap;align-items:center;gap:10px;padding:12px;margin-bottom:10px;border:1px solid var(--gold);border-radius:10px;background:var(--surface)}
#app .merge-current-task>div{display:flex;flex:1;flex-wrap:wrap;gap:10px}
#app .merge-current-task span{display:inline-flex;align-items:center;gap:6px;font-size:var(--t-footnote);line-height:var(--lh-footnote)}
#app .merge-current-task .relic-art{width:36px;height:36px;object-fit:contain}
#app .merge-current-task .button{margin:0;min-height:44px;padding:8px 12px}
