: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: 100dvh;
    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: 100vh;
    height: var(--app-height);
    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'] {
    --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'] {
    --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'] {
    --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'] {
    --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'] {
    --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'] {
    --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;
}

.brand__world {
    margin: 0;
    min-width: 0;
    color: var(--ink-soft);
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    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;
}

.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.4);
    border-radius: 1.85rem;
    background: linear-gradient(180deg, var(--panel-strong), var(--panel));
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.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;
}

.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__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;
    min-height: 0;
    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 {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
}

.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: rgba(255, 255, 255, 0.34);
    border: 1px solid rgba(255, 255, 255, 0.3);
    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%;
    bottom: 22%;
    height: 0.16rem;
    border-radius: 999px;
    background: rgba(118, 114, 94, 0.22);
}

.crossword-cell__letter {
    color: var(--ink);
    font-weight: 800;
    font-size: clamp(0.9rem, 1.08vw + 0.26rem, 1.28rem);
    letter-spacing: 0.02em;
}

.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__list {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 0.45rem;
    min-height: 0;
}

.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;
    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;
    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;
}

.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 {
    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 {
    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;
}

.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 center;
    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: scale(1);
    }
    45% {
        transform: scale(1.01);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes softBounce {
    0%,
    100% {
        transform: translateY(0);
    }
    45% {
        transform: translateY(-4px);
    }
}

@keyframes gentleShake {
    0%,
    100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-4px);
    }
    60% {
        transform: translateX(4px);
    }
}

@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(8.4rem, 0.52fr) minmax(16rem, 1.26fr) minmax(12.6rem, 0.78fr);
    }

    .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) {
    .hero {
        padding: 0.92rem 1rem;
    }

    .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;
    }

    .meter {
        gap: 0.32rem;
    }
}

@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(0.9rem, 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.65rem;
    }

    .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.38rem;
    }

    .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: min(30vw, 6.8rem);
    }

    .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));
    }

    .app-shell {
        padding:
            max(0.92rem, env(safe-area-inset-top))
            max(0.75rem, env(safe-area-inset-right))
            max(0.82rem, env(safe-area-inset-bottom))
            max(0.75rem, env(safe-area-inset-left));
    }

    .app-frame {
        gap: 0.42rem;
    }

    .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.74rem;
    }

    .topbar {
        gap: 0.55rem;
    }

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

    .topbar__actions .quiet-button {
        padding: 0.52rem 0.68rem;
        font-size: 0.78rem;
    }

    .stage {
        grid-template-rows: minmax(4.95rem, 0.36fr) minmax(17.8rem, 1.2fr) minmax(11.4rem, 1.14fr);
        gap: 0.34rem;
    }

    .hero {
        grid-template-columns: minmax(0, 1.28fr) minmax(6.8rem, 0.76fr);
        gap: 0.45rem;
        padding: 0.58rem;
    }

    .hero__title {
        font-size: clamp(1.08rem, 4.5vw, 1.4rem);
    }

    .hero__theme {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
        font-size: 0.76rem;
        line-height: 1.18;
    }

    .hero__caption {
        display: none;
    }

    .meter {
        gap: 0.3rem;
    }

    .meter__labels {
        font-size: 0.72rem;
    }

    .meter__track {
        height: 0.58rem;
    }

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

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

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

    .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 {
        gap: 0.5rem;
        grid-template-rows: auto minmax(0, 1fr);
    }

    .board__header {
        align-items: center;
    }

    .board__actions .quiet-button,
    .journey-card__header .quiet-button {
        padding: 0.48rem 0.64rem;
        font-size: 0.78rem;
    }

    .crossword-board {
        min-height: 8.25rem;
        padding: 0.28rem;
        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: repeat(2, minmax(0, 1fr));
        gap: 0.38rem;
        align-self: end;
    }

    .basket {
        gap: 0.34rem;
    }

    .journey-card {
        gap: 0.28rem;
        padding: 0.44rem 0.44rem 0.36rem;
    }

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

    .basket__count {
        min-width: 1.9rem;
        min-height: 1.9rem;
        border-radius: 0.78rem;
        font-size: 0.92rem;
    }

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

    .basket__empty {
        font-size: 0.72rem;
    }

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

    .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 {
        gap: 0.32rem;
        grid-template-rows: auto minmax(0, 1fr) auto;
    }

    .composer__word {
        min-height: 1.2rem;
        font-size: clamp(0.98rem, 4.2vw, 1.34rem);
    }

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

    .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.05rem);
        height: calc(var(--wheel-size) - 0.05rem);
    }

    .wheel__center {
        width: 2.38rem;
        height: 2.38rem;
        font-size: 0.66rem;
    }

    .letter-tile {
        width: 2.08rem;
        height: 2.08rem;
        font-size: 0.76rem;
    }

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

    .composer__actions {
        display: grid;
        grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
        gap: 0.38rem;
    }

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

    #submitButton {
        min-width: 0;
        min-height: 3rem;
        padding: 0.66rem 0.96rem;
        font-size: 1rem;
    }

    .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 (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0ms !important;
        scroll-behavior: auto !important;
    }
}
