:root {
    --font-display: 'Fraunces', 'Georgia', serif;
    --font-ui: 'Nunito Sans', 'Trebuchet MS', sans-serif;
    --bg: #f5efdf;
    --panel: rgba(255, 251, 243, 0.84);
    --panel-strong: rgba(255, 249, 239, 0.94);
    --ink: #304332;
    --ink-soft: #536455;
    --line: rgba(84, 93, 71, 0.14);
    --shadow: 0 18px 50px rgba(68, 62, 42, 0.16);
    --shadow-soft: 0 12px 30px rgba(76, 64, 42, 0.12);
    --accent: #d78d52;
    --accent-soft: #f0c98c;
    --accent-strong: #a35d33;
    --accent-wash: rgba(215, 141, 82, 0.18);
    --success: #67895b;
    --world-backdrop-image: url('../images/forest-glade.webp');
    --world-backdrop-overlay: linear-gradient(180deg, rgba(250, 244, 231, 0.6), rgba(234, 225, 204, 0.88));
    --wheel-size: min(22vh, 20vw, 14rem);
    --app-height: 100svh;
    --hero-focus-x: center;
    --hero-focus-y: 30%;
    --hero-label-left: 1rem;
    --hero-label-right: auto;
    --hero-label-align: left;
    color-scheme: light;
}

@font-face {
    font-family: 'Fraunces';
    src: url('../fonts/fraunces-latin-600.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Nunito Sans';
    src: url('../fonts/nunito-sans-latin-500.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Nunito Sans';
    src: url('../fonts/nunito-sans-latin-700.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    overflow: hidden;
}

body {
    position: fixed;
    inset: 0;
    margin: 0;
    width: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.55), transparent 42%),
        linear-gradient(180deg, #f9f3e6 0%, #efe7d2 55%, #e2ddc7 100%);
    color: var(--ink);
    font-family: var(--font-ui);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    user-select: none;
}

button,
input,
textarea,
select {
    font: inherit;
}

img {
    display: block;
    max-width: 100%;
}

.app-shell {
    position: relative;
    min-height: var(--app-height);
    height: var(--app-height);
    max-height: var(--app-height);
    overflow: hidden;
    padding:
        max(0.9rem, env(safe-area-inset-top))
        max(0.9rem, env(safe-area-inset-right))
        max(1rem, env(safe-area-inset-bottom))
        max(0.9rem, env(safe-area-inset-left));
}

.app-shell[data-world='fox'] {
    --hero-label-left: 0.68rem;
    --hero-label-right: auto;
    --hero-label-align: left;
    --world-backdrop-image: url('../images/forest-glade.webp');
    --world-backdrop-overlay: linear-gradient(180deg, rgba(250, 244, 231, 0.6), rgba(234, 225, 204, 0.88));
}

.app-shell[data-world='owl'] {
    --hero-focus-y: 27%;
    --hero-label-left: auto;
    --hero-label-right: 0.68rem;
    --hero-label-align: right;
    --panel: rgba(245, 248, 255, 0.82);
    --panel-strong: rgba(248, 251, 255, 0.94);
    --ink: #2a3652;
    --ink-soft: #5b6785;
    --shadow: 0 18px 50px rgba(39, 52, 86, 0.16);
    --shadow-soft: 0 12px 30px rgba(39, 52, 86, 0.12);
    --world-backdrop-image: url('../images/world-owl-bg.webp');
    --world-backdrop-overlay: linear-gradient(180deg, rgba(224, 231, 255, 0.34), rgba(198, 210, 237, 0.82));
}

.app-shell[data-world='hare'] {
    --hero-focus-y: 29%;
    --hero-label-left: auto;
    --hero-label-right: 0.68rem;
    --hero-label-align: right;
    --panel: rgba(255, 252, 243, 0.84);
    --panel-strong: rgba(255, 252, 246, 0.95);
    --ink: #3f4730;
    --ink-soft: #667055;
    --shadow: 0 18px 50px rgba(92, 87, 48, 0.16);
    --shadow-soft: 0 12px 30px rgba(92, 87, 48, 0.12);
    --world-backdrop-image: url('../images/world-hare-bg.webp');
    --world-backdrop-overlay: linear-gradient(180deg, rgba(255, 248, 228, 0.28), rgba(226, 221, 180, 0.8));
}

.app-shell[data-world='quail'] {
    --hero-focus-y: 27%;
    --hero-label-left: auto;
    --hero-label-right: 0.68rem;
    --hero-label-align: right;
    --panel: rgba(255, 250, 238, 0.84);
    --panel-strong: rgba(255, 252, 243, 0.95);
    --ink: #4a3f2c;
    --ink-soft: #736650;
    --shadow: 0 18px 50px rgba(106, 83, 40, 0.16);
    --shadow-soft: 0 12px 30px rgba(106, 83, 40, 0.12);
    --world-backdrop-image: url('../images/world-quail-bg.webp');
    --world-backdrop-overlay: linear-gradient(180deg, rgba(255, 238, 201, 0.28), rgba(220, 190, 125, 0.74));
}

.app-shell[data-world='sheep'] {
    --hero-focus-y: 28%;
    --hero-label-left: 0.68rem;
    --hero-label-right: auto;
    --hero-label-align: left;
    --panel: rgba(250, 253, 246, 0.84);
    --panel-strong: rgba(253, 255, 250, 0.95);
    --ink: #36433b;
    --ink-soft: #607061;
    --shadow: 0 18px 50px rgba(67, 85, 74, 0.16);
    --shadow-soft: 0 12px 30px rgba(67, 85, 74, 0.12);
    --world-backdrop-image: url('../images/world-sheep-bg.webp');
    --world-backdrop-overlay: linear-gradient(180deg, rgba(234, 245, 235, 0.28), rgba(201, 221, 201, 0.78));
}

.app-shell[data-world='wolf'] {
    --hero-focus-y: 29%;
    --hero-label-left: auto;
    --hero-label-right: 0.68rem;
    --hero-label-align: right;
    --panel: rgba(244, 248, 249, 0.83);
    --panel-strong: rgba(247, 251, 252, 0.94);
    --ink: #263641;
    --ink-soft: #586a75;
    --shadow: 0 18px 50px rgba(36, 49, 59, 0.18);
    --shadow-soft: 0 12px 30px rgba(36, 49, 59, 0.12);
    --world-backdrop-image: url('../images/world-wolf-bg.webp');
    --world-backdrop-overlay: linear-gradient(180deg, rgba(211, 226, 230, 0.28), rgba(155, 179, 186, 0.82));
}

.app-shell[data-accent='sunrise'] {
    --accent: #d7894d;
    --accent-soft: #f2c471;
    --accent-strong: #9a5b36;
    --accent-wash: rgba(215, 137, 77, 0.16);
}

.app-shell[data-accent='moss'] {
    --accent: #7a9762;
    --accent-soft: #c5d39b;
    --accent-strong: #476237;
    --accent-wash: rgba(122, 151, 98, 0.18);
}

.app-shell[data-accent='brook'] {
    --accent: #6d95b7;
    --accent-soft: #b9d7eb;
    --accent-strong: #406985;
    --accent-wash: rgba(109, 149, 183, 0.18);
}

.app-shell[data-accent='river'] {
    --accent: #5c8f9c;
    --accent-soft: #b7dbe1;
    --accent-strong: #3d6771;
    --accent-wash: rgba(92, 143, 156, 0.18);
}

.app-shell[data-accent='cloud'] {
    --accent: #8b8db3;
    --accent-soft: #d4d5ea;
    --accent-strong: #61628b;
    --accent-wash: rgba(139, 141, 179, 0.17);
}

.app-shell[data-accent='meadow'] {
    --accent: #88a744;
    --accent-soft: #d8e59a;
    --accent-strong: #587424;
    --accent-wash: rgba(136, 167, 68, 0.18);
}

.app-shell[data-accent='garden'] {
    --accent: #c97854;
    --accent-soft: #f0c39c;
    --accent-strong: #92492a;
    --accent-wash: rgba(201, 120, 84, 0.18);
}

.app-shell[data-accent='frost'] {
    --accent: #7a9ab0;
    --accent-soft: #d7e6ef;
    --accent-strong: #547184;
    --accent-wash: rgba(122, 154, 176, 0.18);
}

.app-shell[data-accent='amber'] {
    --accent: #d1974b;
    --accent-soft: #f4d19d;
    --accent-strong: #9a6831;
    --accent-wash: rgba(209, 151, 75, 0.18);
}

.app-shell[data-accent='peach'] {
    --accent: #d4886d;
    --accent-soft: #f5cdb7;
    --accent-strong: #9e5842;
    --accent-wash: rgba(212, 136, 109, 0.18);
}

.app-shell[data-accent='lagoon'] {
    --accent: #5a9c94;
    --accent-soft: #c8e6df;
    --accent-strong: #36736c;
    --accent-wash: rgba(90, 156, 148, 0.18);
}

.app-shell[data-accent='forest'] {
    --accent: #6b8c4d;
    --accent-soft: #d6e4b0;
    --accent-strong: #445f31;
    --accent-wash: rgba(107, 140, 77, 0.18);
}

.backdrop {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.backdrop__wash {
    position: absolute;
    inset: -5%;
    background:
        var(--world-backdrop-overlay),
        var(--world-backdrop-image) center center / cover no-repeat;
    filter: saturate(0.94) blur(2px);
    transform: scale(1.04);
}

.backdrop__grain {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.45) 0, rgba(255, 255, 255, 0) 24%),
        radial-gradient(circle at 85% 18%, rgba(255, 255, 255, 0.28) 0, rgba(255, 255, 255, 0) 20%),
        radial-gradient(circle at 30% 80%, rgba(212, 196, 150, 0.2) 0, rgba(212, 196, 150, 0) 16%);
}

.app-frame {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: clamp(0.8rem, 1.4vw, 1rem);
    height: 100%;
}

.legal-dock {
    position: absolute;
    left: 50%;
    bottom: max(0.08rem, env(safe-area-inset-bottom));
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transform: translateX(-50%);
    pointer-events: auto;
}

.legal-dock,
.legal-dock a {
    color: rgba(48, 67, 50, 0.72);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.legal-dock a:hover,
.legal-dock a:focus-visible {
    color: rgba(48, 67, 50, 0.92);
    text-decoration: underline;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.section-label,
.hero__flora {
    margin: 0;
    color: var(--accent-strong);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.brand__title {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 2vw + 1.1rem, 3rem);
    font-weight: 600;
    line-height: 1.05;
    color: color-mix(in srgb, var(--ink) 92%, #122016 8%);
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.72),
        0 0 0.55rem rgba(255, 255, 255, 0.72),
        0 0.12rem 0.36rem rgba(42, 33, 21, 0.16);
}

.brand__world {
    margin: 0;
    min-width: 0;
    color: color-mix(in srgb, var(--ink) 78%, var(--ink-soft) 22%);
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0;
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.78),
        0 0 0.48rem rgba(255, 255, 255, 0.72),
        0 0.08rem 0.24rem rgba(42, 33, 21, 0.14);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.icon-button {
    display: inline-grid;
    place-items: center;
    width: 3.35rem;
    min-width: 3.35rem;
    min-height: 3.35rem;
    padding: 0;
}

.button-icon {
    width: 1.45rem;
    height: 1.45rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.stage {
    display: grid;
    grid-template-rows: minmax(8.75rem, 0.74fr) minmax(0, 0.88fr) minmax(16rem, 1.18fr);
    gap: clamp(0.75rem, 1.3vw, 1rem);
    min-height: 0;
}

.card {
    border: 1px solid rgba(255, 255, 255, 0.62);
    border-radius: 1.85rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0) 32%),
        linear-gradient(180deg, var(--panel-strong), var(--panel));
    box-shadow:
        var(--shadow),
        inset 0 0 0 1px rgba(255, 255, 255, 0.36),
        inset 0 -12px 24px rgba(175, 145, 96, 0.08);
    backdrop-filter: blur(16px);
}

.board,
.composer {
    border-color: rgba(255, 255, 255, 0.72);
    background:
        radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0) 34%),
        linear-gradient(180deg, rgba(255, 253, 247, 0.96), rgba(247, 240, 226, 0.84));
    box-shadow:
        0 18px 46px rgba(66, 57, 37, 0.16),
        0 0 0 1px rgba(255, 255, 255, 0.32),
        inset 0 0 0 1px rgba(255, 255, 255, 0.55),
        inset 0 -16px 26px rgba(192, 163, 116, 0.08);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(18rem, 0.95fr);
    gap: clamp(0.8rem, 1.4vw, 1rem);
    padding: clamp(1rem, 1.8vw, 1.3rem);
    min-height: 0;
    overflow: hidden;
}

.hero__copy {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    justify-content: space-between;
    min-width: 0;
}

.hero__title {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 1.4vw + 1rem, 2.45rem);
    line-height: 1.05;
}

.hero__title-button {
    display: inline-block;
    max-width: 100%;
    min-height: 1.55rem;
    padding: 0;
    border: 0;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    color: inherit;
    font: inherit;
    line-height: inherit;
    text-align: inherit;
    letter-spacing: inherit;
    cursor: pointer;
}

.hero__title-button:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.86);
    outline-offset: 0.14rem;
    border-radius: 0.36rem;
}

.hero__theme,
.hero__ambience,
.hero__caption,
.board__status,
.basket__copy,
.journey-card__copy,
.composer__meta {
    margin: 0;
    color: var(--ink-soft);
    line-height: 1.42;
}

.hero__art {
    position: relative;
    margin: 0;
    align-self: stretch;
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
    border-radius: 1.5rem;
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0) 48%),
        radial-gradient(circle at top left, rgba(255, 248, 239, 0.85), rgba(255, 248, 239, 0) 45%),
        var(--accent-wash);
}

.hero__art img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: var(--hero-focus-x) var(--hero-focus-y);
}

.hero__caption {
    position: absolute;
    left: 1rem;
    bottom: 1rem;
    max-width: min(60%, 24rem);
    padding: 0.8rem 1rem;
    border-radius: 1rem;
    background: rgba(255, 249, 238, 0.8);
    box-shadow: var(--shadow-soft);
}

.meter {
    display: grid;
    gap: 0.45rem;
}

.meter__labels {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: var(--ink-soft);
    font-size: 0.92rem;
}

.meter__track {
    height: 0.8rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.45);
}

.meter__fill {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), var(--accent-soft));
    transition: width 380ms ease;
}

.playfield {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(14.2rem, 21rem);
    gap: clamp(0.75rem, 1.3vw, 1rem);
    min-height: 0;
}

.board,
.basket,
.journey-card,
.composer {
    padding: clamp(0.9rem, 1.4vw, 1.1rem);
}

.board {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 0.8rem;
    min-height: 0;
}

.board__header,
.basket__header,
.journey-card__header,
.composer__top,
.journey-overlay__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.board__actions,
.overlay__actions,
.composer__actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    min-width: 0;
}

.crossword-board {
    display: grid;
    place-items: center;
    min-height: 0;
    height: 100%;
    padding: clamp(0.45rem, 0.85vw, 0.8rem);
    border-radius: 1.5rem;
    background:
        radial-gradient(circle at 50% 6%, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.3) 42%, rgba(238, 230, 211, 0.2) 100%),
        rgba(255, 253, 246, 0.38);
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.42),
        inset 0 -12px 24px rgba(190, 167, 125, 0.1);
    overflow: hidden;
}

.crossword-board__grid {
    display: grid;
    gap: clamp(0.14rem, 0.24vw, 0.24rem);
    width: 100%;
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: var(--crossword-aspect);
}

.crossword-cell {
    position: relative;
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 0;
    aspect-ratio: 1;
    border-radius: clamp(0.4rem, 0.6vw, 0.72rem);
    background: rgba(255, 250, 243, 0.95);
    border: 1px solid rgba(208, 184, 151, 0.34);
    box-shadow: inset 0 -5px 10px rgba(212, 198, 175, 0.18);
}

.crossword-cell--block {
    border: 0;
    background: transparent;
    box-shadow: none;
}

.crossword-cell[data-found='true'] {
    background: linear-gradient(180deg, rgba(249, 253, 243, 0.96), rgba(236, 247, 222, 0.95));
    border-color: rgba(109, 144, 86, 0.3);
}

.crossword-cell[data-hinted='true'] {
    background: linear-gradient(180deg, rgba(254, 248, 236, 0.96), rgba(247, 232, 199, 0.94));
    border-color: rgba(210, 167, 96, 0.32);
}

.crossword-cell[data-visible='false'] {
    background:
        linear-gradient(180deg, rgba(239, 232, 213, 0.94), rgba(230, 220, 196, 0.8));
}

.crossword-cell[data-visible='false']::after {
    content: '';
    position: absolute;
    left: 20%;
    right: 20%;
    top: 50%;
    height: 0.16rem;
    border-radius: 999px;
    background: rgba(118, 114, 94, 0.22);
    transform: translateY(-50%);
}

.crossword-cell__letter {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: var(--ink);
    font-weight: 800;
    font-size: clamp(0.9rem, 1.08vw + 0.26rem, 1.28rem);
    line-height: 1;
    letter-spacing: 0.02em;
    text-align: center;
}

.side-stack {
    display: grid;
    grid-template-rows: minmax(0, 1fr) minmax(0, 0.92fr);
    gap: clamp(0.75rem, 1.3vw, 1rem);
    min-height: 0;
}

.basket,
.journey-card {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 0.75rem;
    min-height: 0;
}

.basket__count {
    display: grid;
    place-items: center;
    min-width: 2.8rem;
    min-height: 2.8rem;
    padding: 0.25rem;
    border-radius: 1rem;
    background: linear-gradient(180deg, rgba(255, 246, 229, 0.96), rgba(246, 224, 192, 0.95));
    color: var(--accent-strong);
    box-shadow: inset 0 -8px 14px rgba(205, 167, 122, 0.18);
}

.basket__trigger {
    width: 100%;
    min-width: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.basket__trigger:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.84);
    outline-offset: 0.16rem;
    border-radius: 1rem;
}

.basket__list {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 0.45rem;
    min-height: 0;
    overflow: auto;
    padding-right: 0.1rem;
}

.bonus-chip,
.journey-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(208, 184, 151, 0.36);
    box-shadow: inset 0 -6px 12px rgba(231, 214, 187, 0.2);
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 700;
}

.basket__empty {
    color: var(--ink-soft);
    font-size: 0.95rem;
    line-height: 1.45;
}

.journey-card__mini,
.journey-overlay__grid {
    display: grid;
    gap: 0.65rem;
}

.journey-card__mini {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.journey-overlay__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.journey-pill,
.journey-node {
    position: relative;
    text-align: left;
}

.journey-pill {
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    min-height: 4rem;
    border-radius: 1rem;
    padding: 0.55rem 0.6rem;
    overflow: hidden;
}

.journey-card__mini .journey-pill {
    min-height: 2.5rem;
    padding: 0.3rem 0.4rem;
}

.journey-pill[data-completed='true'],
.journey-node[data-completed='true'] {
    background: linear-gradient(180deg, rgba(246, 252, 236, 0.96), rgba(228, 241, 210, 0.92));
    border-color: rgba(109, 144, 86, 0.28);
}

.journey-pill[data-current='true'],
.journey-node[data-current='true'] {
    outline: 2px solid rgba(255, 255, 255, 0.65);
    box-shadow:
        0 0 0 3px rgba(255, 255, 255, 0.18),
        var(--shadow-soft);
}

.journey-pill[data-locked='true'],
.journey-node[data-locked='true'] {
    opacity: 0.44;
}

.journey-pill__title,
.journey-node__title {
    margin: 0;
    width: 100%;
    min-width: 0;
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.journey-card__mini .journey-pill__title {
    font-size: 0.78rem;
}

.journey-pill__meta,
.journey-node__meta {
    margin: 0.18rem 0 0;
    width: 100%;
    min-width: 0;
    color: var(--ink-soft);
    font-size: 0.82rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.journey-card__mini .journey-pill__meta {
    margin-top: 0.08rem;
    font-size: 0.7rem;
}

.composer {
    display: grid;
    grid-template-rows: auto minmax(calc(var(--wheel-size) + 1rem), 1fr) auto;
    gap: 0.8rem;
    min-height: 0;
}

.composer__word {
    margin-top: 0.2rem;
    min-height: 2.4rem;
    font-family: var(--font-display);
    font-size: clamp(1.45rem, 1.6vw + 0.9rem, 2.3rem);
    line-height: 1;
}

.wheel {
    position: relative;
    display: grid;
    place-items: center;
    min-height: calc(var(--wheel-size) + 1rem);
    touch-action: none;
    pointer-events: none;
}

.wheel::before {
    content: '';
    position: absolute;
    width: calc(var(--wheel-size) + 2.2rem);
    height: calc(var(--wheel-size) + 2.2rem);
    border-radius: 50%;
    background:
        radial-gradient(circle at center, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0.16) 66%, rgba(255, 255, 255, 0) 100%),
        radial-gradient(circle at center, var(--accent-wash), transparent 70%);
    border: 1px dashed rgba(160, 154, 126, 0.22);
}

.wheel__letters,
.wheel__lines {
    position: relative;
    width: calc(var(--wheel-size) + 0.6rem);
    height: calc(var(--wheel-size) + 0.6rem);
    max-width: 100%;
}

.wheel__letters,
.wheel__center,
.letter-tile {
    pointer-events: auto;
}

.wheel__lines {
    position: absolute;
    z-index: 1;
}

.wheel__center {
    position: absolute;
    z-index: 2;
    display: grid;
    place-items: center;
    width: clamp(4rem, 7vw, 5rem);
    height: clamp(4rem, 7vw, 5rem);
    border-radius: 50%;
    border: 0;
    padding: 0;
    background: linear-gradient(180deg, rgba(253, 248, 240, 0.97), rgba(236, 223, 197, 0.96));
    box-shadow: var(--shadow-soft);
    color: var(--accent-strong);
    font-weight: 800;
    line-height: 1;
    text-align: center;
    cursor: pointer;
}

.letter-tile {
    position: absolute;
    z-index: 3;
    left: 50%;
    top: 50%;
    width: clamp(3rem, 5.4vw, 4.2rem);
    height: clamp(3rem, 5.4vw, 4.2rem);
    border-radius: 50%;
    border: 0;
    background:
        radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0) 42%),
        linear-gradient(180deg, rgba(255, 248, 238, 0.96), rgba(231, 214, 186, 0.94));
    box-shadow:
        0 14px 24px rgba(124, 96, 62, 0.16),
        inset 0 -8px 15px rgba(194, 163, 119, 0.16);
    color: var(--ink);
    font-weight: 800;
    font-size: clamp(1.1rem, 1.7vw, 1.5rem);
    transform: translate(-50%, -50%);
    transition: transform 220ms ease, box-shadow 220ms ease, background 220ms ease;
    cursor: pointer;
}

.letter-tile[data-selected='true'] {
    background:
        radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0) 38%),
        linear-gradient(180deg, rgba(252, 242, 221, 0.98), rgba(238, 201, 136, 0.96));
    box-shadow:
        0 18px 28px rgba(152, 103, 54, 0.22),
        inset 0 -8px 18px rgba(211, 140, 70, 0.2);
}

.letter-tile:focus-visible,
.quiet-button:focus-visible,
.soft-button:focus-visible,
.primary-button:focus-visible,
.wheel__center:focus-visible,
.journey-node:focus-visible,
.world-card:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.88);
    outline-offset: 2px;
}

.composer__actions {
    display: grid;
    grid-template-columns: minmax(9.5rem, 0.84fr) minmax(13.5rem, 1.16fr);
    justify-content: end;
    align-items: end;
    gap: 0.8rem;
}

.quiet-button,
.soft-button,
.primary-button {
    border: 0;
    border-radius: 999px;
    padding: 0.72rem 1rem;
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.hint-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.44rem;
    min-height: 2.7rem;
    padding: 0.42rem 0.86rem 0.42rem 0.52rem;
    white-space: nowrap;
}

.hint-button__icon {
    flex: 0 0 auto;
    width: 2.05rem;
    height: 2.05rem;
    object-fit: contain;
    filter: drop-shadow(0 0 0.42rem rgba(234, 196, 73, 0.52));
    transform: rotate(-8deg);
}

.hint-button__text {
    font-weight: 700;
}

.hint-button.is-glowing {
    background:
        radial-gradient(circle at 32% 42%, rgba(255, 238, 116, 0.42), transparent 46%),
        rgba(255, 255, 255, 0.78);
    box-shadow:
        0 0 0 4px rgba(245, 217, 102, 0.14),
        0 0 1.25rem rgba(240, 203, 81, 0.52),
        var(--shadow-soft);
}

.hint-button.is-glowing .hint-button__icon {
    animation: fireflyGlow 880ms ease;
}

.quiet-button,
.soft-button {
    background: rgba(255, 255, 255, 0.68);
    color: var(--ink);
    box-shadow: var(--shadow-soft);
}

.primary-button {
    background: linear-gradient(180deg, var(--accent), var(--accent-strong));
    color: #fffaf2;
    box-shadow: 0 16px 28px rgba(120, 72, 43, 0.24);
    font-weight: 800;
}

#resetButton {
    min-height: 3.45rem;
    font-weight: 700;
}

#submitButton {
    position: relative;
    min-width: clamp(13.5rem, 26vw, 17rem);
    min-height: clamp(4.25rem, 5vw, 5rem);
    padding: 0.92rem 1.45rem;
    border-radius: 999px;
    background:
        radial-gradient(circle at 30% 24%, rgba(255, 232, 202, 0.22), rgba(255, 232, 202, 0) 38%),
        linear-gradient(180deg, color-mix(in srgb, var(--accent-soft) 28%, var(--accent) 72%), var(--accent-strong));
    box-shadow:
        0 20px 34px rgba(120, 72, 43, 0.28),
        inset 0 -8px 16px rgba(110, 54, 30, 0.16);
    font-size: clamp(1.08rem, 0.68vw + 0.98rem, 1.45rem);
    letter-spacing: 0.01em;
}

#submitButton:disabled {
    opacity: 1;
    cursor: not-allowed;
    background:
        radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0) 38%),
        linear-gradient(180deg, #ead6c2, #d5ae91);
    color: #57341f;
    box-shadow:
        0 12px 22px rgba(120, 72, 43, 0.14),
        inset 0 -6px 12px rgba(110, 54, 30, 0.1);
}

.quiet-button[aria-pressed='true'] {
    background: rgba(240, 249, 231, 0.9);
    color: var(--success);
}

.overlay {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding:
        max(1rem, env(safe-area-inset-top))
        max(1rem, env(safe-area-inset-right))
        max(1rem, env(safe-area-inset-bottom))
        max(1rem, env(safe-area-inset-left));
    background: rgba(56, 62, 46, 0.24);
    backdrop-filter: blur(14px);
}

.overlay[hidden] {
    display: none;
}

.overlay__card {
    width: min(92vw, 46rem);
    max-height: min(88vh, 44rem);
    padding: clamp(1rem, 2vw, 1.5rem);
    border-radius: 1.85rem;
    background: linear-gradient(180deg, rgba(255, 252, 245, 0.98), rgba(247, 239, 225, 0.96));
    box-shadow: 0 24px 80px rgba(54, 49, 36, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.58);
}

.overlay__card--legal {
    width: min(94vw, 62rem);
    max-height: min(88vh, 46rem);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 0.9rem;
}

.overlay__card--worlds {
    --accent-strong: #854523;
    --ink-soft: #455446;
    width: min(96vw, 74rem);
    max-height: min(90vh, 48rem);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 1rem;
}

.legal-overlay__header {
    align-items: center;
}

.legal-overlay__body {
    min-height: 0;
    overflow: auto;
    padding-right: 0.25rem;
}

.legal-overlay__status {
    margin: 0;
    color: var(--ink-soft);
}

.legal-document {
    color: var(--ink);
}

.legal-document__eyebrow {
    margin: 0;
    color: var(--accent-strong);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.legal-document__title {
    margin: 0.3rem 0 0;
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 2vw + 0.95rem, 2.5rem);
    line-height: 1.08;
}

.legal-document__intro,
.legal-document__note,
.legal-document__section p,
.legal-document__section li {
    color: var(--ink-soft);
    line-height: 1.55;
}

.legal-document__intro,
.legal-document__note {
    margin: 0.8rem 0 0;
}

.legal-document__sections {
    display: grid;
    gap: 0.8rem;
    margin-top: 1rem;
}

.legal-document__section {
    padding: 0.95rem 1rem;
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(208, 184, 151, 0.3);
    box-shadow: inset 0 -8px 14px rgba(230, 216, 194, 0.16);
}

.legal-document__section h2 {
    margin: 0 0 0.45rem;
    font-size: 1rem;
    line-height: 1.2;
}

.legal-document__section p,
.legal-document__section ul {
    margin: 0;
}

.legal-document__section p + p,
.legal-document__section p + ul,
.legal-document__section ul + p {
    margin-top: 0.65rem;
}

.legal-document__section a {
    color: var(--accent-strong);
}

.legal-list {
    padding-left: 1.15rem;
}

html.legal-page,
body.legal-page {
    height: auto;
    overflow: auto;
}

body.legal-page {
    position: relative;
    inset: auto;
    min-height: 100vh;
    user-select: text;
}

.legal-page-shell {
    min-height: 100vh;
    height: auto;
}

.legal-page__main {
    position: relative;
    z-index: 1;
    padding: clamp(1rem, 2vw, 1.6rem);
}

.legal-page__card {
    width: min(100%, 70rem);
    margin: 0 auto;
    padding: clamp(1rem, 2vw, 1.4rem);
}

.legal-page__toolbar {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 0.9rem;
}

.legal-page__back {
    text-decoration: none;
}

.overlay__title {
    margin: 0.35rem 0 0;
    font-family: var(--font-display);
    font-size: clamp(1.55rem, 1.6vw + 1rem, 2.3rem);
    line-height: 1.06;
}

.overlay__copy {
    margin: 0.7rem 0 0;
    color: var(--ink-soft);
    line-height: 1.5;
}

.fullscreen-help {
    display: grid;
    gap: 1rem;
}

.bonus-overlay {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 0.9rem;
}

.bonus-overlay__header {
    align-items: flex-start;
}

.bonus-overlay__summary {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    gap: 0.55rem;
    min-height: 2.4rem;
    padding: 0.36rem 0.48rem 0.36rem 0.8rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.68);
    box-shadow: var(--shadow-soft);
    color: var(--ink-soft);
    font-weight: 800;
}

.bonus-overlay__summary strong {
    display: grid;
    place-items: center;
    min-width: 2rem;
    min-height: 2rem;
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(255, 246, 229, 0.96), rgba(246, 224, 192, 0.95));
    color: var(--accent-strong);
}

.bonus-overlay__list {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 0.58rem;
    min-height: 7rem;
    overflow: auto;
    padding: 0.1rem 0.2rem 0.2rem 0;
}

.bonus-overlay__list .bonus-chip {
    min-height: 2.4rem;
    padding: 0.48rem 0.86rem;
    font-size: 1rem;
}

.bonus-overlay__empty {
    margin: 0;
    color: var(--ink-soft);
    line-height: 1.45;
}

.fullscreen-help__header {
    align-items: flex-start;
}

.fullscreen-help__steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
}

.fullscreen-help__steps span {
    display: grid;
    min-height: 3.2rem;
    place-items: center;
    padding: 0.7rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.72);
    color: var(--ink);
    font-size: 0.88rem;
    font-weight: 800;
    text-align: center;
    line-height: 1.14;
}

.completion-card__stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
    margin: 1rem 0 1.2rem;
}

.completion-card__stats div {
    padding: 0.85rem 0.95rem;
    border-radius: 1.15rem;
    background: rgba(255, 255, 255, 0.72);
}

.completion-card__stats span {
    display: block;
    color: var(--ink-soft);
    font-size: 0.85rem;
}

.completion-card__stats strong {
    display: block;
    margin-top: 0.2rem;
    font-size: 1.3rem;
}

.journey-overlay {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 1rem;
}

.world-overlay__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 0.9rem;
    min-height: 0;
    overflow: auto;
    padding-right: 0.2rem;
}

.world-card {
    position: relative;
    display: grid;
    grid-template-rows: minmax(7.2rem, 0.92fr) minmax(0, 1fr);
    width: 100%;
    min-height: 18rem;
    padding: 0;
    border: 1px solid rgba(208, 184, 151, 0.32);
    border-radius: 1.5rem;
    overflow: hidden;
    background: rgba(255, 252, 245, 0.82);
    box-shadow: var(--shadow-soft);
    color: var(--ink);
    cursor: pointer;
    text-align: left;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.world-card[data-current='true'] {
    border-color: rgba(255, 255, 255, 0.74);
    box-shadow:
        0 0 0 3px rgba(255, 255, 255, 0.22),
        0 18px 40px rgba(54, 49, 36, 0.16);
}

.world-card[data-current='true']::after {
    content: 'Aktiv';
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    z-index: 2;
    padding: 0.33rem 0.6rem;
    border-radius: 999px;
    background: rgba(255, 250, 241, 0.92);
    box-shadow: var(--shadow-soft);
    color: var(--accent-strong);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.world-card__preview {
    display: block;
    min-height: 100%;
    background-color: rgba(221, 214, 194, 0.82);
    background-position: center 28%;
    background-repeat: no-repeat;
    background-size: cover;
}

.world-card__body {
    display: grid;
    align-content: start;
    gap: 0.42rem;
    padding: 0.95rem 1rem 1rem;
    min-height: 0;
}

.world-card__animal {
    color: var(--accent-strong);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.world-card__title {
    font-family: var(--font-display);
    font-size: clamp(1.28rem, 0.85vw + 1rem, 1.6rem);
    line-height: 1.02;
}

.world-card__summary,
.world-card__detail {
    color: var(--ink-soft);
    line-height: 1.4;
}

.world-card__summary {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.world-card__progress {
    margin-top: 0.1rem;
    color: var(--accent-strong);
    font-size: 0.88rem;
    font-weight: 800;
}

.world-card__detail {
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.journey-overlay__grid {
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    min-height: 0;
}

.journey-node {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    width: 100%;
    min-height: 6rem;
    padding: 0.9rem 1rem;
    border-radius: 1.35rem;
    border: 1px solid rgba(208, 184, 151, 0.32);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: var(--shadow-soft);
    cursor: pointer;
}

.journey-node[disabled] {
    cursor: not-allowed;
}

.journey-node__badge {
    display: inline-grid;
    place-items: center;
    width: 1.9rem;
    height: 1.9rem;
    margin-bottom: 0.2rem;
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(254, 247, 236, 0.95), rgba(238, 222, 196, 0.92));
    color: var(--accent-strong);
    font-weight: 800;
}

.app-shell.is-success .board,
.app-shell.is-success .composer {
    animation: cardPulse 420ms ease;
}

.app-shell.is-soft .board {
    animation: softBounce 320ms ease;
}

.app-shell.is-warning .composer {
    animation: gentleShake 320ms ease;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@keyframes cardPulse {
    0% {
        transform: none;
        box-shadow: var(--shadow);
    }
    45% {
        transform: none;
        box-shadow:
            0 22px 48px rgba(108, 84, 52, 0.2),
            0 0 0 1px rgba(132, 174, 98, 0.18);
    }
    100% {
        transform: none;
        box-shadow: var(--shadow);
    }
}

@keyframes softBounce {
    0%,
    100% {
        transform: none;
        box-shadow: var(--shadow);
    }
    45% {
        transform: none;
        box-shadow:
            0 22px 46px rgba(142, 111, 66, 0.2),
            0 0 0 1px rgba(223, 180, 79, 0.2);
    }
}

@keyframes gentleShake {
    0%,
    100% {
        transform: none;
        box-shadow: var(--shadow);
    }
    25% {
        transform: none;
        box-shadow:
            0 20px 44px rgba(132, 69, 46, 0.18),
            0 0 0 1px rgba(183, 89, 58, 0.22);
    }
    60% {
        transform: none;
        box-shadow:
            0 20px 44px rgba(132, 69, 46, 0.18),
            0 0 0 1px rgba(183, 89, 58, 0.22);
    }
}

@keyframes fireflyGlow {
    0%,
    100% {
        filter: drop-shadow(0 0 0.42rem rgba(234, 196, 73, 0.52));
        transform: rotate(-8deg) scale(1);
    }

    42% {
        filter:
            drop-shadow(0 0 0.35rem rgba(255, 247, 150, 0.95))
            drop-shadow(0 0 1.05rem rgba(241, 198, 55, 0.76));
        transform: rotate(-5deg) scale(1.13);
    }
}

@media (hover: hover) and (pointer: fine) {
    .quiet-button:hover,
    .soft-button:hover,
    .primary-button:hover,
    .wheel__center:hover,
    .journey-node:hover,
    .world-card:hover {
        transform: translateY(-1px);
    }

    .letter-tile:hover {
        box-shadow:
            0 18px 28px rgba(124, 96, 62, 0.22),
            inset 0 -8px 15px rgba(194, 163, 119, 0.18);
    }
}

@media (min-width: 821px) {
    :root {
        --wheel-size: min(24vh, 22vw, 15rem);
    }

    .stage {
        grid-template-rows: minmax(7.8rem, 0.46fr) minmax(17.4rem, 1.38fr) minmax(11.2rem, 0.72fr);
    }

    .hero {
        grid-template-columns: minmax(0, 1.16fr) minmax(19rem, 0.9fr);
        gap: 0.85rem;
        padding: 1rem 1.15rem;
    }

    .hero__copy {
        gap: 0.42rem;
    }

    .hero__theme,
    .hero__ambience {
        line-height: 1.3;
    }

    .hero__caption {
        left: 0.9rem;
        bottom: 0.9rem;
        padding: 0.68rem 0.88rem;
    }

    .playfield {
        grid-template-columns: minmax(0, 1fr) minmax(13.8rem, 18.2rem);
        gap: 0.82rem;
    }

    .board {
        gap: 0.62rem;
    }

    .board__header,
    .basket__header,
    .journey-card__header {
        align-items: center;
    }

    .crossword-board {
        padding: clamp(0.32rem, 0.56vw, 0.58rem);
    }

    .composer {
        grid-template-columns: minmax(13.2rem, 0.72fr) minmax(13rem, 17rem) minmax(18rem, 1fr);
        grid-template-rows: minmax(0, 1fr);
        gap: 1rem;
        align-items: center;
    }

    .composer__top {
        grid-column: 1;
        grid-row: 1;
        align-self: center;
        justify-content: flex-start;
    }

    .composer__word {
        min-height: 1.9rem;
        max-width: 10ch;
    }

    .wheel {
        grid-column: 2;
        grid-row: 1;
        width: 100%;
        min-height: calc(var(--wheel-size) + 0.5rem);
        height: calc(var(--wheel-size) + 0.5rem);
        justify-self: center;
        align-self: center;
    }

    .wheel::before {
        width: calc(var(--wheel-size) + 1.15rem);
        height: calc(var(--wheel-size) + 1.15rem);
    }

    .wheel__letters,
    .wheel__lines {
        width: calc(var(--wheel-size) + 0.35rem);
        height: calc(var(--wheel-size) + 0.35rem);
    }

    .composer__actions {
        grid-column: 3;
        grid-row: 1;
        display: grid;
        grid-template-columns: minmax(8.8rem, 0.84fr) minmax(13.5rem, 1.16fr);
        gap: 0.75rem;
        align-self: center;
        justify-self: stretch;
        align-items: center;
    }

    #resetButton {
        min-height: 3.35rem;
    }

    #submitButton {
        min-width: 0;
        min-height: 4.35rem;
        padding: 0.96rem 1.2rem;
    }
}

@media (min-width: 821px) and (max-height: 920px) {
    :root {
        --wheel-size: min(23vh, 21vw, 14rem);
    }

    .app-shell {
        padding-bottom: max(2.35rem, env(safe-area-inset-bottom));
    }

    .stage {
        grid-template-rows: minmax(6rem, 0.34fr) minmax(19rem, 1.56fr) minmax(11.8rem, 0.62fr);
    }

    .hero {
        padding: 0.92rem 1rem;
    }

    .hero__art {
        align-self: center;
        height: clamp(4.25rem, 8.8vh, 5.05rem);
        max-height: clamp(4.25rem, 8.8vh, 5.05rem);
    }

    .hero__copy {
        gap: 0.34rem;
    }

    .hero__ambience,
    .hero__caption {
        display: none;
    }

    .hero__title {
        font-size: clamp(1.28rem, 1.06vw + 0.96rem, 2.12rem);
    }

    .hero__theme {
        font-size: 0.96rem;
    }

    .hero .meter {
        display: none;
    }

    .basket,
    .journey-card {
        gap: 0.52rem;
    }

    .basket__copy,
    .journey-card__copy,
    .basket__empty {
        display: none;
    }

    .wheel::before {
        width: calc(var(--wheel-size) + 1.6rem);
        height: calc(var(--wheel-size) + 1.6rem);
    }

    .wheel__letters,
    .wheel__lines {
        width: calc(var(--wheel-size) + 0.9rem);
        height: calc(var(--wheel-size) + 0.9rem);
    }

    .wheel__center {
        width: clamp(3.45rem, 5.6vw, 4rem);
        height: clamp(3.45rem, 5.6vw, 4rem);
        font-size: 0.8rem;
    }
}

@media (min-width: 821px) and (min-height: 821px) and (max-height: 920px) {
    .stage {
        grid-template-rows: minmax(6.9rem, 0.4fr) minmax(17.8rem, 1.34fr) minmax(13.6rem, 0.76fr);
    }
}

@media (min-width: 821px) and (max-width: 1100px) {
    .board {
        gap: 0.44rem;
    }

    .board__status {
        display: none;
    }

    .board__actions {
        flex-wrap: nowrap;
        gap: 0.42rem;
    }

    .board__actions .quiet-button:not(.hint-button) {
        padding: 0.62rem 0.82rem;
        font-size: 0.9rem;
    }

    .basket,
    .journey-card {
        gap: 0.56rem;
    }

    .basket__header,
    .journey-card__header {
        align-items: center;
    }

    .basket__copy,
    .journey-card__copy {
        display: none;
    }

    .hint-button {
        width: 2.9rem;
        min-width: 2.9rem;
        height: 2.9rem;
        min-height: 2.9rem;
        padding: 0.24rem;
    }

    .hint-button__icon {
        width: 2.35rem;
        height: 2.35rem;
    }

    .crossword-board {
        padding: clamp(0.24rem, 0.42vw, 0.4rem);
    }

    .hint-button__text {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
}

@media (max-width: 1024px) and (orientation: portrait) {
    .stage {
        grid-template-rows: minmax(9.75rem, auto) minmax(0, 0.96fr) minmax(15rem, 1.08fr);
    }

    .hero {
        grid-template-columns: minmax(0, 1fr) minmax(15rem, 0.85fr);
    }

    .playfield {
        grid-template-columns: minmax(0, 1fr) minmax(12rem, 16rem);
    }
}

@media (max-width: 820px) {
    .app-shell {
        padding:
            max(0.75rem, env(safe-area-inset-top))
            max(0.75rem, env(safe-area-inset-right))
            max(1.55rem, env(safe-area-inset-bottom))
            max(0.75rem, env(safe-area-inset-left));
    }

    .topbar {
        align-items: center;
    }

    .topbar__actions {
        width: auto;
        justify-content: flex-end;
        flex-wrap: nowrap;
    }

    .stage {
        grid-template-rows: minmax(10.5rem, 0.82fr) minmax(9.25rem, 1fr) minmax(13.5rem, 1.02fr);
    }

    .hero {
        grid-template-columns: minmax(0, 1.22fr) minmax(9rem, 0.78fr);
        align-items: stretch;
    }

    .hero__art {
        min-height: 0;
    }

    .hero__ambience {
        display: none;
    }

    .hero__caption {
        position: static;
        margin: 0.55rem 0 0;
        padding: 0.55rem 0.7rem;
        font-size: 0.9rem;
    }

    .playfield {
        grid-template-columns: 1fr;
    }

    .side-stack {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: none;
    }

    .overlay__card--legal {
        width: min(95vw, 56rem);
    }

    .overlay__card--worlds {
        width: min(95vw, 62rem);
    }

    .world-overlay__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) and (min-width: 641px) {
    :root {
        --wheel-size: clamp(10rem, 18vw, 11.6rem);
    }

    .topbar__actions .quiet-button {
        padding: 0.62rem 0.88rem;
        font-size: 0.9rem;
    }

    .stage {
        grid-template-rows: minmax(10rem, 0.76fr) minmax(16rem, 1fr) minmax(14.8rem, 0.96fr);
        gap: 0.75rem;
    }

    .hero {
        gap: 0.8rem;
        padding: 0.9rem;
    }

    .hero__title {
        font-size: clamp(1.3rem, 1.1vw + 1rem, 2rem);
    }

    .hero__theme {
        font-size: 0.94rem;
        line-height: 1.34;
    }

    .hero__caption {
        display: none;
    }

    .playfield {
        grid-template-columns: minmax(0, 1fr) minmax(12.6rem, 14.6rem);
        gap: 0.72rem;
    }

    .side-stack {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
        gap: 0.72rem;
    }

    .board,
    .basket,
    .journey-card,
    .composer {
        padding: 0.85rem;
    }

    .board {
        gap: 0.42rem;
    }

    .board__status,
    .basket__copy,
    .journey-card__copy,
    .composer__meta {
        display: none;
    }

    .board__actions .quiet-button,
    .journey-card__header .quiet-button {
        padding: 0.58rem 0.84rem;
        font-size: 0.86rem;
    }

    .crossword-board {
        min-height: 11.75rem;
        padding: 0.28rem;
    }

    .basket,
    .journey-card {
        gap: 0.52rem;
    }

    .basket__header,
    .journey-card__header,
    .board__header,
    .composer__top {
        gap: 0.56rem;
    }

    .bonus-chip {
        min-height: 1.72rem;
        padding: 0.28rem 0.56rem;
        font-size: 0.78rem;
    }

    .basket__empty {
        font-size: 0.8rem;
        line-height: 1.32;
    }

    .journey-card__mini {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.42rem;
        align-content: start;
    }

    .journey-pill {
        min-height: 2.08rem;
        padding: 0.18rem 0.26rem;
    }

    .journey-card__mini .journey-pill {
        min-height: 2.08rem;
        padding: 0.18rem 0.26rem;
    }

    .journey-card__mini .journey-pill__title {
        font-size: 0.66rem;
    }

    .journey-card__mini .journey-pill__meta {
        font-size: 0.58rem;
    }

    .composer {
        grid-template-columns: minmax(12rem, 1fr) minmax(12rem, 15.4rem);
        grid-template-rows: minmax(0, 1fr) auto;
        gap: 0.75rem 0.95rem;
        align-items: stretch;
    }

    .composer__top {
        grid-column: 1;
        grid-row: 1;
        align-self: start;
        justify-content: flex-start;
    }

    .composer__word {
        min-height: 1.65rem;
        font-size: clamp(1.12rem, 0.8vw + 0.98rem, 1.6rem);
    }

    .wheel {
        grid-column: 2;
        grid-row: 1 / span 2;
        min-height: calc(var(--wheel-size) + 0.5rem);
        height: 100%;
        align-self: center;
    }

    .wheel::before {
        width: calc(var(--wheel-size) + 1rem);
        height: calc(var(--wheel-size) + 1rem);
    }

    .wheel__letters,
    .wheel__lines {
        width: calc(var(--wheel-size) + 0.2rem);
        height: calc(var(--wheel-size) + 0.2rem);
    }

    .composer__actions {
        grid-column: 1;
        grid-row: 2;
        grid-template-columns: minmax(0, 0.84fr) minmax(0, 1.16fr);
        gap: 0.58rem;
        justify-content: stretch;
    }

    #resetButton {
        min-height: 3.1rem;
        font-size: 0.96rem;
    }

    #submitButton {
        min-width: 0;
        min-height: 3.65rem;
        padding: 0.8rem 1.05rem;
        font-size: 1.02rem;
    }
}

@media (max-width: 640px) {
    :root {
        --wheel-size: clamp(8.35rem, 35vw, 9.2rem);
    }

    .overlay {
        padding:
            max(0.7rem, env(safe-area-inset-top))
            max(0.7rem, env(safe-area-inset-right))
            max(0.7rem, env(safe-area-inset-bottom))
            max(0.7rem, env(safe-area-inset-left));
    }

    .fullscreen-help {
        width: min(94vw, 24rem);
        border-radius: 1.2rem;
    }

    .fullscreen-help__header {
        gap: 0.75rem;
    }

    .fullscreen-help__steps {
        grid-template-columns: 1fr;
        gap: 0.48rem;
    }

    .fullscreen-help__steps span {
        min-height: 2.65rem;
        padding: 0.56rem 0.7rem;
        font-size: 0.84rem;
    }

    .app-shell {
        padding:
            max(0.68rem, env(safe-area-inset-top))
            max(0.58rem, env(safe-area-inset-right))
            max(1.38rem, env(safe-area-inset-bottom))
            max(0.58rem, env(safe-area-inset-left));
    }

    .app-frame {
        gap: 0.32rem;
    }

    .legal-dock,
    .legal-dock a {
        font-size: 0.56rem;
        letter-spacing: 0.06em;
    }

    .brand__title {
        font-size: clamp(1.45rem, 5.9vw, 1.95rem);
    }

    .brand__world {
        font-size: 0.78rem;
    }

    .topbar {
        gap: 0.48rem;
    }

    .topbar__actions {
        display: flex;
        gap: 0.34rem;
        width: auto;
        flex: 0 0 auto;
        flex-wrap: nowrap;
    }

    .topbar__actions .quiet-button {
        min-height: 2.48rem;
        padding: 0.56rem 0.68rem;
        font-size: 0.76rem;
    }

    .topbar__actions .icon-button {
        width: 2.48rem;
        min-width: 2.48rem;
        padding: 0;
    }

    .topbar__actions .button-icon {
        width: 1.24rem;
        height: 1.24rem;
    }

    .stage {
        grid-template-rows: clamp(5.25rem, 14.8vh, 6.25rem) minmax(13rem, 1.18fr) minmax(13.65rem, 1.02fr);
        gap: 0.3rem;
    }

    .hero {
        position: relative;
        display: block;
        min-height: 0;
        padding: 0;
        overflow: hidden;
        border-radius: 1.32rem;
    }

    .hero__copy {
        position: absolute;
        left: var(--hero-label-left);
        right: var(--hero-label-right);
        bottom: 0.54rem;
        z-index: 2;
        display: block;
        max-width: min(46%, 10rem);
        padding: 0.42rem 0.62rem;
        border-radius: 0.96rem;
        background: rgba(255, 252, 244, 0.9);
        border: 1px solid rgba(255, 255, 255, 0.58);
        box-shadow:
            0 12px 28px rgba(72, 61, 41, 0.16),
            inset 0 0 0 1px rgba(255, 255, 255, 0.36);
        backdrop-filter: blur(8px);
        text-align: var(--hero-label-align);
    }

    .hero__title {
        font-size: clamp(1.02rem, 4vw, 1.32rem);
        line-height: 1.04;
    }

    .hero__title-button {
        display: block;
        width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .hero__theme {
        display: none;
    }

    .hero__art {
        position: absolute;
        inset: 0;
        display: block;
        width: 100%;
        height: 100%;
        max-width: none;
        aspect-ratio: auto;
        min-height: 0;
        border-radius: inherit;
    }

    .hero__art img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: var(--hero-focus-x) var(--hero-focus-y);
    }

    .hero__caption {
        display: none;
    }

    .hero__flora,
    .hero__ambience,
    .meter {
        display: none;
    }

    .meter__labels {
        font-size: 0.72rem;
    }

    .meter__track {
        height: 0.58rem;
    }

    .section-label {
        font-size: 0.7rem;
    }

    .playfield {
        grid-template-rows: minmax(0, 1fr) 2.5rem;
        height: 100%;
        gap: 0.24rem;
    }

    .board,
    .basket,
    .journey-card,
    .composer {
        padding: 0.52rem;
    }

    .board__status,
    .basket__copy,
    .journey-card__copy,
    .composer__meta {
        font-size: 0.82rem;
        line-height: 1.28;
    }

    .board__status,
    .basket__copy,
    #shuffleButtonTop,
    .composer__meta {
        display: none;
    }

    .journey-card__copy {
        display: none;
    }

    .board {
        padding: 0.42rem;
        position: relative;
        gap: 0;
        grid-template-rows: minmax(0, 1fr);
    }

    .board__header {
        position: absolute;
        top: 0.34rem;
        left: 0.82rem;
        right: 0.62rem;
        z-index: 3;
        align-items: center;
        min-height: 0;
        pointer-events: none;
    }

    .board__actions {
        position: absolute;
        top: 0.22rem;
        right: 0.28rem;
        z-index: 4;
        flex: 0 0 auto;
        flex-wrap: nowrap;
        gap: 0;
        pointer-events: auto;
    }

    .hint-button {
        position: relative;
        width: 2.92rem;
        min-width: 2.92rem;
        height: 2.92rem;
        min-height: 2.92rem;
        padding: 0.06rem;
        overflow: visible;
        background:
            radial-gradient(circle at 42% 38%, rgba(255, 242, 137, 0.5), rgba(255, 255, 255, 0.9) 58%),
            rgba(255, 255, 255, 0.9);
        box-shadow:
            0 0 0 4px rgba(255, 238, 150, 0.22),
            0 12px 28px rgba(88, 68, 38, 0.16);
    }

    .hint-button__icon {
        width: 2.78rem;
        height: 2.78rem;
        transform: none;
    }

    .hint-button__text {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .journey-card__header .quiet-button {
        min-height: 2.36rem;
        padding: 0.46rem 0.66rem;
        font-size: 0.76rem;
    }

    .crossword-board {
        height: 100%;
        min-height: 0;
        padding: 2.88rem 0.28rem 0.26rem;
        border-radius: 1.12rem;
    }

    .crossword-board__grid {
        gap: 0.12rem;
    }

    .crossword-cell {
        border-radius: 0.38rem;
    }

    .crossword-cell__letter {
        font-size: clamp(0.78rem, 2.4vw, 1rem);
    }

    .target-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
    }

    .target-grid--compact {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.34rem;
    }

    .target-grid--compact .target-slot {
        min-height: 1.74rem;
        padding: 0.18rem 0.18rem;
        gap: 0.12rem;
    }

    .target-grid--compact .target-slot__letter {
        width: 0.96rem;
        height: 1.28rem;
        border-radius: 0.44rem;
        font-size: 0.66rem;
    }

    .target-group {
        padding: 0.5rem;
        gap: 0.42rem;
    }

    .target-slot {
        min-height: 2.5rem;
        padding: 0.35rem 0.4rem;
        gap: 0.18rem;
    }

    .target-slot__letter {
        width: 1.12rem;
        height: 1.55rem;
        border-radius: 0.54rem;
        font-size: 0.74rem;
    }

    .side-stack {
        grid-template-columns: minmax(0, 0.96fr) minmax(0, 1.04fr);
        gap: 0.42rem;
        align-self: end;
        min-height: 0;
        height: 2.5rem;
    }

    .basket,
    .journey-card {
        grid-template-rows: 1fr;
        gap: 0;
        min-height: 0;
        padding: 0 0.34rem;
        border-radius: 1.08rem;
        overflow: hidden;
    }

    .basket__header,
    .journey-card__header,
    .board__header,
    .composer__top {
        gap: 0.5rem;
    }

    .basket__header,
    .journey-card__header {
        align-items: center;
        min-height: 0;
        width: 100%;
        min-width: 0;
        overflow: hidden;
    }

    .basket__header > div,
    .journey-card__header > div {
        min-width: 0;
        overflow: hidden;
    }

    .basket__header .section-label,
    .journey-card__header .section-label {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .basket__count {
        flex: 0 0 auto;
        min-width: 1.55rem;
        min-height: 1.55rem;
        border-radius: 0.78rem;
        font-size: 0.78rem;
    }

    .basket__list,
    .journey-card__mini {
        display: none;
    }

    .bonus-chip {
        min-height: 1.45rem;
        padding: 0.2rem 0.4rem;
        font-size: 0.72rem;
    }

    .basket__empty {
        font-size: 0.72rem;
    }

    .journey-card__header {
        gap: 0.35rem;
    }

    .journey-pill {
        min-height: 1.88rem;
        padding: 0.16rem 0.22rem;
        border-radius: 0.9rem;
    }

    .journey-card__mini .journey-pill {
        min-height: 1.72rem;
        padding: 0.14rem 0.2rem;
    }

    .journey-pill__title {
        font-size: 0.58rem;
    }

    .journey-pill__meta {
        margin-top: 0.08rem;
        font-size: 0.5rem;
    }

    .composer {
        position: relative;
        padding: 0.52rem 0.62rem 0.9rem;
        gap: 0.34rem;
        grid-template-rows: minmax(calc(var(--wheel-size) + 0.18rem), 1fr) auto;
    }

    .composer__top {
        position: absolute;
        top: 0.54rem;
        left: 0.64rem;
        right: 0.64rem;
        z-index: 4;
        pointer-events: none;
    }

    .composer__top[data-has-word='false'] {
        display: none;
    }

    .composer__top .section-label {
        display: none;
    }

    .composer__word {
        margin-top: 0;
        min-height: 1.28rem;
        font-size: clamp(1.08rem, 4.6vw, 1.45rem);
        line-height: 0.98;
        min-width: 1px;
        max-width: 15ch;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .wheel {
        min-height: calc(var(--wheel-size) + 0.18rem);
        align-self: center;
    }

    .wheel::before {
        width: calc(var(--wheel-size) + 0.64rem);
        height: calc(var(--wheel-size) + 0.64rem);
    }

    .wheel__letters,
    .wheel__lines {
        width: calc(var(--wheel-size) + 0.48rem);
        height: calc(var(--wheel-size) + 0.48rem);
    }

    .wheel__center {
        width: 3.05rem;
        height: 3.05rem;
        font-size: 0.72rem;
    }

    .letter-tile {
        width: 2.82rem;
        height: 2.82rem;
        font-size: 1.04rem;
    }

    .quiet-button,
    .soft-button,
    .primary-button {
        padding: 0.5rem 0.62rem;
    }

    .hint-button {
        gap: 0;
        padding: 0.04rem;
    }

    .composer__actions {
        display: grid;
        grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
        gap: 0.4rem;
        position: relative;
        z-index: 4;
        margin-top: 0;
    }

    #resetButton {
        min-height: 2.78rem;
        font-size: 0.98rem;
    }

    #submitButton {
        min-width: 0;
        min-height: 3.05rem;
        padding: 0.66rem 0.92rem;
        font-size: 1.02rem;
    }

    #resetButton,
    #submitButton {
        box-shadow:
            0 6px 12px rgba(88, 68, 38, 0.12),
            inset 0 -4px 9px rgba(132, 101, 61, 0.08);
    }

    #submitButton:disabled {
        box-shadow:
            0 5px 10px rgba(120, 72, 43, 0.1),
            inset 0 -4px 9px rgba(110, 54, 30, 0.08);
    }

    .completion-card__stats {
        grid-template-columns: 1fr;
    }

    .overlay__card--legal {
        width: min(96vw, 40rem);
        max-height: min(90vh, 42rem);
        padding: 0.9rem;
        gap: 0.7rem;
    }

    .overlay__card--worlds {
        width: min(96vw, 38rem);
        max-height: min(94vh, 42rem);
        padding: 0.74rem;
        gap: 0.54rem;
    }

    .world-overlay__header {
        gap: 0.36rem;
    }

    .world-overlay__header .overlay__title {
        font-size: clamp(1.22rem, 4.8vw, 1.5rem);
    }

    .world-overlay__header .overlay__copy {
        margin-top: 0.4rem;
        font-size: 0.74rem;
        line-height: 1.22;
    }

    .world-overlay__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.44rem;
    }

    .world-card {
        grid-template-rows: 3.55rem minmax(0, 1fr);
        min-height: 9.2rem;
    }

    .world-card__body {
        gap: 0.12rem;
        padding: 0.4rem 0.48rem 0.48rem;
    }

    .world-card__title {
        font-size: 0.98rem;
    }

    .world-card__animal {
        font-size: 0.6rem;
    }

    .world-card__summary,
    .world-card__detail,
    .world-card__progress {
        font-size: 0.7rem;
        line-height: 1.2;
    }

    .world-card__summary {
        -webkit-line-clamp: 1;
    }

    .world-card[data-current='true']::after {
        top: 0.55rem;
        right: 0.55rem;
        padding: 0.22rem 0.45rem;
        font-size: 0.58rem;
    }

    .legal-document__title {
        font-size: clamp(1.35rem, 5.2vw, 1.8rem);
    }

    .legal-document__sections {
        gap: 0.65rem;
    }

    .legal-document__section {
        padding: 0.8rem 0.82rem;
    }
}

@media (max-width: 640px) and (min-height: 700px) {
    .stage {
        grid-template-rows: clamp(4.7rem, 11.2vh, 5.05rem) minmax(16rem, 2.8fr) minmax(13.6rem, 0.55fr);
    }

    .composer {
        gap: 0.22rem;
    }

    .crossword-board {
        padding-top: 2.05rem;
    }

    #resetButton {
        min-height: 2.75rem;
    }

    #submitButton {
        min-height: 3rem;
    }
}

@media (max-width: 640px) and (max-height: 700px) {
    :root {
        --wheel-size: clamp(7.95rem, 30vw, 8.3rem);
    }

    .stage {
        grid-template-rows: clamp(4.6rem, 13.2vh, 5.1rem) minmax(11.8rem, 1.18fr) minmax(12.2rem, 0.94fr);
        gap: 0.24rem;
    }

    .hero__copy {
        max-width: min(48%, 9rem);
    }

    .playfield {
        grid-template-rows: minmax(0, 1fr) 2.4rem;
        gap: 0.2rem;
    }

    .composer {
        overflow: hidden;
        padding: 0.46rem 0.56rem 0.9rem;
        gap: 0.3rem;
        grid-template-rows: minmax(calc(var(--wheel-size) + 0.08rem), 1fr) auto;
    }

    .wheel {
        min-height: calc(var(--wheel-size) + 0.08rem);
    }

    .wheel::before {
        width: calc(var(--wheel-size) + 0.44rem);
        height: calc(var(--wheel-size) + 0.44rem);
    }

    .wheel__letters,
    .wheel__lines {
        width: calc(var(--wheel-size) + 0.22rem);
        height: calc(var(--wheel-size) + 0.22rem);
    }

    .letter-tile {
        width: 2.35rem;
        height: 2.35rem;
        font-size: 0.98rem;
    }

    .composer__actions {
        gap: 0.34rem;
        position: relative;
        z-index: 4;
        margin-top: 0;
    }
}

@media (max-width: 460px) and (max-height: 700px) {
    .stage {
        grid-template-rows: clamp(4.45rem, 12.8vh, 4.95rem) minmax(12.2rem, 1.25fr) minmax(13rem, 0.85fr);
    }
}

@media (max-width: 640px) {
    html[data-usable-height='short'] {
        --wheel-size: clamp(7.95rem, 30vw, 8.3rem);
    }

    html[data-usable-height='short'] .stage {
        grid-template-rows: clamp(4.6rem, 13.2vh, 5.1rem) minmax(11.8rem, 1.18fr) minmax(12.2rem, 0.94fr);
        gap: 0.24rem;
    }

    html[data-usable-height='short'] .hero__copy {
        max-width: min(48%, 9rem);
    }

    html[data-usable-height='short'] .playfield {
        grid-template-rows: minmax(0, 1fr) 2.4rem;
        gap: 0.2rem;
    }

    html[data-usable-height='short'] .crossword-board {
        padding: 2.96rem 0.28rem 0.26rem;
    }

    html[data-usable-height='short'] .composer {
        overflow: hidden;
        padding: 0.46rem 0.56rem 0.9rem;
        gap: 0.3rem;
        grid-template-rows: minmax(calc(var(--wheel-size) + 0.08rem), 1fr) auto;
    }

    html[data-usable-height='short'] .wheel {
        min-height: calc(var(--wheel-size) + 0.08rem);
    }

    html[data-usable-height='short'] .wheel::before {
        width: calc(var(--wheel-size) + 0.44rem);
        height: calc(var(--wheel-size) + 0.44rem);
    }

    html[data-usable-height='short'] .wheel__letters,
    html[data-usable-height='short'] .wheel__lines {
        width: calc(var(--wheel-size) + 0.22rem);
        height: calc(var(--wheel-size) + 0.22rem);
    }

    html[data-usable-height='short'] .letter-tile {
        width: 2.35rem;
        height: 2.35rem;
        font-size: 0.98rem;
    }

    html[data-usable-height='short'] .composer__actions {
        gap: 0.34rem;
        position: relative;
        z-index: 4;
        margin-top: 0;
    }
}

@media (max-width: 460px) {
    html[data-usable-height='short'] .stage {
        grid-template-rows: clamp(4.45rem, 12.8vh, 4.95rem) minmax(12.2rem, 1.25fr) minmax(13rem, 0.85fr);
    }
}

@media (max-width: 640px) and (max-height: 600px) {
    :root {
        --wheel-size: clamp(7.8rem, 36vw, 8.5rem);
    }

    .app-frame {
        gap: 0.24rem;
    }

    .brand__title {
        font-size: clamp(1.42rem, 5.9vw, 1.82rem);
    }

    .brand__world {
        font-size: 0.72rem;
    }

    .topbar__actions .quiet-button {
        min-height: 2.28rem;
        padding: 0.46rem 0.56rem;
        font-size: 0.72rem;
    }

    .topbar__actions .icon-button {
        width: 2.28rem;
        min-width: 2.28rem;
        padding: 0;
    }

    .topbar__actions .button-icon {
        width: 1.15rem;
        height: 1.15rem;
    }

    .stage {
        grid-template-rows: clamp(4.45rem, 12.6vh, 4.8rem) minmax(13.4rem, 1.18fr) minmax(12.25rem, 0.82fr);
        gap: 0.24rem;
    }

    .hero__copy {
        left: var(--hero-label-left);
        right: var(--hero-label-right);
        bottom: 0.44rem;
        max-width: min(50%, 9rem);
        padding: 0.34rem 0.5rem;
        text-align: var(--hero-label-align);
    }

    .hero__title {
        font-size: clamp(0.94rem, 3.8vw, 1.16rem);
    }

    .playfield {
        grid-template-rows: minmax(0, 1fr) 2.38rem;
        gap: 0.18rem;
    }

    .board {
        padding: 0.3rem;
    }

    .crossword-board {
        padding: 3.02rem 0.2rem 0.18rem;
    }

    .side-stack {
        height: 2.38rem;
        gap: 0.36rem;
    }

    .basket,
    .journey-card {
        padding: 0 0.34rem;
    }

    .composer {
        padding: 0.42rem 0.54rem 0.9rem;
        gap: 0.24rem;
        grid-template-rows: minmax(calc(var(--wheel-size) + 0.02rem), 1fr) auto;
    }

    .wheel {
        min-height: calc(var(--wheel-size) + 0.02rem);
    }

    .wheel::before {
        width: calc(var(--wheel-size) + 0.42rem);
        height: calc(var(--wheel-size) + 0.42rem);
    }

    .wheel__letters,
    .wheel__lines {
        width: calc(var(--wheel-size) + 0.34rem);
        height: calc(var(--wheel-size) + 0.34rem);
    }

    .wheel__center {
        width: 2.72rem;
        height: 2.72rem;
        font-size: 0.68rem;
    }

    .letter-tile {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 0.98rem;
    }

    .composer__actions {
        gap: 0.34rem;
        margin-top: 0;
    }

    #resetButton {
        min-height: 2.75rem;
        font-size: 0.9rem;
    }

    #submitButton {
        min-height: 2.94rem;
        padding: 0.54rem 0.72rem;
        font-size: 0.94rem;
    }

    .overlay__card--worlds {
        max-height: min(96vh, 42rem);
        padding: 0.58rem;
        gap: 0.36rem;
    }

    .world-overlay__header {
        align-items: center;
    }

    .world-overlay__header .overlay__title {
        font-size: clamp(1.08rem, 4.4vw, 1.32rem);
    }

    .world-overlay__header .overlay__copy {
        display: none;
    }

    .world-overlay__grid {
        gap: 0.34rem;
    }

    .world-card {
        grid-template-rows: 3.2rem minmax(0, 1fr);
        min-height: 8.45rem;
    }

    .world-card__body {
        gap: 0.1rem;
        padding: 0.34rem 0.42rem 0.4rem;
    }

    .world-card__detail {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0ms !important;
        scroll-behavior: auto !important;
    }
}
