:root {
    --aqua-50: #ecfeff;
    --aqua-100: #cffafe;
    --aqua-200: #a5f3fc;
    --aqua-300: #67e8f9;
    --aqua-400: #22d3ee;
    --aqua-500: #06b6d4;
    --aqua-600: #0891b2;
    --aqua-700: #0e7490;
    --aqua-800: #155e75;
    --orange-50: #fff7ed;
    --orange-100: #ffedd5;
    --orange-200: #fed7aa;
    --orange-300: #fdba74;
    --orange-400: #fb923c;
    --orange-500: #f97316;
    --orange-600: #ea580c;
    --orange-text: #c2410c;
    --ink: #0f172a;
    --ink-soft: #1e293b;
    --muted: #64748b;
    --muted-light: #94a3b8;
    --line: #e2e8f0;
    --line-strong: #cbd5e1;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --success: #22c55e;
    --success-dark: #15803d;
    --present: #facc15;
    --absent: #94a3b8;
    --danger: #ef4444;
    --danger-soft: #fff1f2;
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 26px;
    --radius-xl: 34px;
    --shadow-sm: 0 8px 24px rgba(15, 23, 42, .07);
    --shadow-md: 0 18px 50px rgba(15, 23, 42, .11);
    --shadow-aqua: 0 22px 50px rgba(6, 182, 212, .18);
    --sidebar: 248px;
    --public-max: 1240px;
    --public-gutter: 28px;
    --public-header-height: 84px;
    --ease: cubic-bezier(.2, .8, .2, 1);
    --bounce: cubic-bezier(.34, 1.56, .64, 1);
}

* {
    box-sizing: border-box;
}

.svg-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    pointer-events: none;
}

.ui-icon {
    width: 1em;
    height: 1em;
    display: inline-block;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: -.14em;
}

.eyebrow>span .ui-icon {
    width: 16px;
    height: 16px;
}

.nav-icon .ui-icon {
    width: 19px;
    height: 19px;
}

.mobile-nav-link>span .ui-icon {
    width: 21px;
    height: 21px;
}

.streak-flame .ui-icon,
.stat-icon .ui-icon,
.empty-state-icon .ui-icon,
.review-icon .ui-icon,
.review-complete-icon .ui-icon,
.result-icon .ui-icon,
.spark-mascot .ui-icon,
.success-face .ui-icon {
    width: .95em;
    height: .95em;
}

.icon-button .ui-icon,
.speak-button .ui-icon,
.password-toggle .ui-icon {
    width: 19px;
    height: 19px;
}

.points-icon,
.demo-points,
.pill,
.top-banner,
.summary-status,
.auth-perks span,
.mini-achievements span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.points-icon .ui-icon,
.demo-points .ui-icon,
.pill .ui-icon,
.top-banner .ui-icon,
.summary-status .ui-icon,
.auth-perks .ui-icon,
.mini-achievements .ui-icon {
    width: 15px;
    height: 15px;
}

.toast-icon .ui-icon {
    width: 18px;
    height: 18px;
}

.floating-chip>span .ui-icon,
.logo-cloud .ui-icon,
.benefit-grid article>span .ui-icon {
    width: 20px;
    height: 20px;
}

.logo-cloud div span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.hero-trust i {
    display: inline-grid;
    place-items: center;
}

.hero-trust i .ui-icon {
    width: 11px;
    height: 11px;
}

.demo-clue>span,
.clue-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.demo-clue>span .ui-icon,
.clue-label .ui-icon {
    width: 15px;
    height: 15px;
}

.step-illustration .ui-icon {
    width: 30px;
    height: 30px;
}

.benefit-grid article>span {
    display: grid;
    place-items: center;
}

.benefit-grid article>span .ui-icon {
    width: 25px;
    height: 25px;
}

.search-wrap>span {
    display: grid;
    place-items: center;
}

.search-wrap>span .ui-icon {
    width: 18px;
    height: 18px;
}

.btn>.ui-icon {
    width: 17px;
    height: 17px;
}

.keyboard-key .ui-icon {
    width: 18px;
    height: 18px;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--surface-soft);
    font-family: Inter, ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input {
    font: inherit;
}

button,
a {
    touch-action: manipulation;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    cursor: pointer;
}

[hidden] {
    display: none !important;
}

::selection {
    background: var(--aqua-200);
    color: var(--ink);
}

.skip-link {
    position: fixed;
    left: 16px;
    top: -80px;
    z-index: 9999;
    padding: 12px 18px;
    border-radius: 14px;
    background: var(--ink);
    color: #fff;
    font-weight: 800;
    transition: top .2s var(--ease);
}

.skip-link:focus {
    top: 16px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    font-size: 22px;
    font-weight: 950;
    letter-spacing: -.045em;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 15px;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(145deg, var(--aqua-400), var(--aqua-600));
    box-shadow: 0 10px 24px rgba(6, 182, 212, .26);
    transform-origin: 50% 75%;
}

.brand-mark span {
    font-size: 20px;
    line-height: 1;
    font-weight: 950;
}

.brand-mark i {
    position: absolute;
    z-index: -1;
    width: 27px;
    height: 27px;
    border-radius: 50%;
    right: -10px;
    top: -9px;
    background: var(--orange-500);
}

.brand:hover .brand-mark {
    animation: brand-wiggle .7s var(--bounce);
}

.btn {
    min-height: 48px;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 900;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    transition: transform .2s var(--bounce), box-shadow .2s var(--ease), background .2s var(--ease);
}

.btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 20%, rgba(255, 255, 255, .3) 50%, transparent 80%);
    transform: translateX(-130%);
}

.btn:hover {
    transform: translateY(-3px);
}

.btn:hover::after {
    animation: button-shine .8s var(--ease);
}

.btn:active {
    transform: translateY(0) scale(.975);
}

.btn:focus-visible,
.icon-button:focus-visible,
.nav-link:focus-visible,
.form-field:focus-visible,
.mobile-nav-link:focus-visible,
.word-card:focus-visible,
.keyboard-key:focus-visible {
    outline: 4px solid rgba(6, 182, 212, .23);
    outline-offset: 2px;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--aqua-500), var(--aqua-600));
    box-shadow: 0 12px 27px rgba(6, 182, 212, .24);
}

.btn-primary:hover {
    box-shadow: 0 18px 35px rgba(6, 182, 212, .3);
}

.btn-accent {
    color: #fff;
    background: linear-gradient(135deg, var(--orange-400), var(--orange-600));
    box-shadow: 0 12px 27px rgba(249, 115, 22, .24);
}

.btn-white {
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}

.btn-white:hover {
    border-color: var(--aqua-200);
    color: var(--aqua-700);
}

.btn-soft {
    color: var(--aqua-800);
    background: var(--aqua-50);
    border: 1px solid var(--aqua-100);
}

.btn-ghost {
    background: transparent;
    color: var(--muted);
}

.btn-block {
    width: 100%;
}

.btn-lg {
    min-height: 56px;
    padding-inline: 25px;
    font-size: 15px;
}

.btn-sm {
    min-height: 40px;
    padding-inline: 16px;
    font-size: 13px;
}

.btn.is-loading {
    pointer-events: none;
}

.btn.is-loading span {
    animation: arrow-run .8s linear infinite;
}

.icon-button {
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 15px;
    display: grid;
    place-items: center;
    background: #fff;
    color: var(--ink-soft);
    transition: .2s var(--bounce);
}

.icon-button:hover {
    transform: translateY(-2px) rotate(-4deg);
    color: var(--aqua-700);
    border-color: var(--aqua-200);
    background: var(--aqua-50);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--aqua-700);
    font-size: 12px;
    font-weight: 950;
    letter-spacing: .105em;
    text-transform: uppercase;
}

.eyebrow>span {
    width: 29px;
    height: 29px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: var(--orange-100);
    letter-spacing: 0;
    font-size: 14px;
}

.eyebrow.light {
    color: var(--aqua-100);
}

.eyebrow.light>span {
    background: rgba(255, 255, 255, .12);
}

.text-aqua {
    color: var(--aqua-600);
    position: relative;
    z-index: 0;
}

.text-aqua::after {
    content: "";
    position: absolute;
    z-index: -1;
    left: 1%;
    right: 0;
    bottom: 2px;
    height: 11px;
    border-radius: 99px;
    background: var(--orange-300);
    opacity: .7;
    transform: rotate(-1.2deg);
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 11px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.pill-orange {
    color: var(--orange-text);
    background: var(--orange-50);
    border-color: var(--orange-200);
}

.pill-aqua {
    color: var(--aqua-700);
    background: var(--aqua-50);
    border-color: var(--aqua-100);
}

.pill-green {
    color: var(--success-dark);
    background: #f0fdf4;
    border-color: #bbf7d0;
}

/* Public / landing */
.public-body {
    min-height: 100vh;
    background: #fff;
    overflow-x: hidden;
}

.ambient {
    position: fixed;
    z-index: -1;
    width: 440px;
    height: 440px;
    border-radius: 50%;
    filter: blur(100px);
    opacity: .27;
    pointer-events: none;
}

.ambient-aqua {
    right: -180px;
    top: -180px;
    background: var(--aqua-200);
    animation: ambient-drift 9s ease-in-out infinite alternate;
}

.ambient-orange {
    left: -220px;
    bottom: -220px;
    background: var(--orange-200);
    animation: ambient-drift 12s ease-in-out infinite alternate-reverse;
}

.public-header {
    width: 100%;
    height: var(--public-header-height);
    max-width: var(--public-max);
    margin: auto;
    padding: 0 var(--public-gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    position: relative;
    z-index: 30;
}

.public-nav {
    display: flex;
    align-items: center;
    gap: 30px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 800;
}

.public-nav a {
    position: relative;
}

.public-nav a::after {
    content: "";
    position: absolute;
    left: 50%;
    right: 50%;
    bottom: -7px;
    height: 3px;
    border-radius: 99px;
    background: var(--orange-400);
    transition: .2s var(--ease);
}

.public-nav a:hover {
    color: var(--aqua-700);
}

.public-nav a:hover::after {
    left: 0;
    right: 0;
}

.public-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hero-section {
    width: 100%;
    max-width: var(--public-max);
    min-height: calc(100svh - var(--public-header-height));
    margin: auto;
    padding: 52px var(--public-gutter) 72px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(460px, .88fr);
    gap: 68px;
    align-items: center;
}

.hero-copy h1 {
    margin: 17px 0 24px;
    font-size: clamp(52px, 6.6vw, 86px);
    line-height: .96;
    letter-spacing: -.078em;
    font-weight: 950;
}

.hero-copy>p {
    max-width: 650px;
    margin: 0;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.72;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
}

.hero-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 28px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 780;
}

.hero-trust span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.hero-trust i {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #dcfce7;
    color: var(--success-dark);
    font-style: normal;
    font-size: 11px;
}

.hero-game-stage {
    min-height: 565px;
    position: relative;
    display: grid;
    place-items: center;
}

.hero-blob {
    position: absolute;
    width: 510px;
    height: 490px;
    border-radius: 46% 54% 59% 41% / 42% 46% 54% 58%;
    background: linear-gradient(145deg, var(--aqua-100), var(--orange-100));
    transform: rotate(8deg);
    animation: blob-morph 9s ease-in-out infinite alternate;
}

.demo-card {
    width: min(100%, 466px);
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, .92);
    border-radius: 32px;
    background: rgba(255, 255, 255, .87);
    box-shadow: 0 32px 85px rgba(15, 23, 42, .17);
    backdrop-filter: blur(16px);
    position: relative;
    z-index: 3;
    transform: rotate(-1.2deg);
    animation: card-float 5s ease-in-out infinite;
}

.demo-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 17px;
}

.demo-card-top>div {
    display: grid;
    gap: 3px;
}

.tiny-label {
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.demo-card-top strong {
    font-size: 16px;
}

.demo-points {
    padding: 8px 10px;
    border-radius: 12px;
    background: var(--orange-50);
    color: var(--orange-text);
    font-size: 12px;
    font-weight: 950;
}

.demo-clue {
    padding: 18px;
    border-radius: 20px;
    background: var(--aqua-50);
    border: 1px solid var(--aqua-100);
}

.demo-clue>span {
    color: var(--aqua-700);
    font-size: 10px;
    font-weight: 950;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.demo-clue p {
    margin: 9px 0 0;
    font-size: 18px;
    line-height: 1.42;
    font-weight: 850;
    letter-spacing: -.025em;
}

.demo-grid {
    display: grid;
    gap: 7px;
    margin: 18px auto;
}

.demo-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 7px;
}

.demo-tile {
    aspect-ratio: 1;
    border: 2px solid var(--line-strong);
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: #fff;
    font-size: 20px;
    font-weight: 950;
}

.demo-tile.correct {
    color: #fff;
    background: var(--success);
    border-color: var(--success);
}

.demo-tile.present {
    color: #5f3900;
    background: var(--present);
    border-color: var(--present);
}

.demo-tile.absent {
    color: #fff;
    background: var(--absent);
    border-color: var(--absent);
}

.demo-row:nth-child(1) .demo-tile {
    animation: demo-flip 5.5s var(--ease) infinite;
}

.demo-row:nth-child(1) .demo-tile:nth-child(2) {
    animation-delay: .1s;
}

.demo-row:nth-child(1) .demo-tile:nth-child(3) {
    animation-delay: .2s;
}

.demo-row:nth-child(1) .demo-tile:nth-child(4) {
    animation-delay: .3s;
}

.demo-row:nth-child(1) .demo-tile:nth-child(5) {
    animation-delay: .4s;
}

.demo-row:nth-child(1) .demo-tile:nth-child(6) {
    animation-delay: .5s;
}

.demo-success {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 15px;
    border-radius: 17px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.success-face {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--success);
    animation: star-spin 4s ease-in-out infinite;
}

.demo-success div {
    display: grid;
    gap: 2px;
}

.demo-success small {
    color: var(--muted);
}

.floating-chip {
    position: absolute;
    z-index: 5;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: #fff;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 12px;
}

.floating-chip span {
    width: 32px;
    height: 32px;
    border-radius: 12px;
    background: var(--orange-100);
    display: grid;
    place-items: center;
}

.chip-streak {
    top: 38px;
    right: -2px;
    transform: rotate(3deg);
    animation: bob 3.8s ease-in-out infinite;
}

.chip-learned {
    bottom: 43px;
    left: -13px;
    transform: rotate(-3deg);
    animation: bob 4.4s .4s ease-in-out infinite reverse;
}

.floating-letter {
    position: absolute;
    z-index: 2;
    width: 60px;
    height: 60px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 25px;
    font-weight: 950;
    box-shadow: var(--shadow-md);
}

.letter-a {
    left: 12px;
    top: 67px;
    background: var(--aqua-500);
    transform: rotate(-11deg);
    animation: letter-hop 4s ease-in-out infinite;
}

.letter-z {
    right: 27px;
    bottom: 82px;
    background: var(--orange-500);
    transform: rotate(9deg);
    animation: letter-hop 4.8s .7s ease-in-out infinite reverse;
}

.logo-cloud {
    max-width: 1184px;
    margin: 0 auto 100px;
    padding: 25px 30px;
    border: 1px solid var(--line);
    border-radius: 25px;
    background: var(--surface-soft);
    text-align: center;
}

.logo-cloud p {
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.logo-cloud div {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 35px;
    flex-wrap: wrap;
    color: var(--ink-soft);
    font-size: 14px;
    font-weight: 850;
}

.landing-section {
    max-width: 1240px;
    margin: auto;
    padding: 0 28px 110px;
}

.section-heading {
    max-width: 700px;
    margin: 0 auto 42px;
    text-align: center;
}

.section-heading h2 {
    margin: 15px 0 14px;
    font-size: clamp(38px, 5vw, 60px);
    line-height: 1;
    letter-spacing: -.062em;
}

.section-heading p {
    color: var(--muted);
    line-height: 1.7;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.step-card {
    min-height: 350px;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: .25s var(--bounce);
    position: relative;
    overflow: hidden;
}

.step-card::after {
    content: "";
    position: absolute;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    right: -80px;
    bottom: -80px;
    background: var(--aqua-100);
    transition: .3s var(--ease);
}

.step-card:nth-child(2)::after {
    background: var(--orange-100);
}

.step-card:nth-child(3)::after {
    background: #dcfce7;
}

.step-card:hover {
    transform: translateY(-8px) rotate(.4deg);
    box-shadow: var(--shadow-md);
}

.step-card:hover::after {
    transform: scale(1.6);
}

.step-number {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--aqua-500);
    font-weight: 950;
}

.step-number.orange {
    background: var(--orange-500);
}

.step-number.green {
    background: var(--success);
}

.step-illustration {
    height: 120px;
    margin: 24px 0 22px;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: var(--aqua-50);
}

.clue-illustration {
    flex-direction: column;
}

.clue-illustration span {
    font-size: 37px;
    animation: bulb-glow 2.4s ease-in-out infinite;
}

.clue-illustration i {
    width: 90px;
    height: 7px;
    border-radius: 99px;
    background: var(--aqua-200);
}

.clue-illustration i:last-child {
    width: 62px;
}

.tiles-illustration {
    background: var(--orange-50);
}

.tiles-illustration b {
    width: 39px;
    height: 45px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--aqua-500);
    font-size: 18px;
    animation: tile-dance 2.7s var(--bounce) infinite;
}

.tiles-illustration b:nth-child(2) {
    animation-delay: .08s;
    background: var(--present);
    color: #5f3900;
}

.tiles-illustration b:nth-child(3) {
    animation-delay: .16s;
}

.tiles-illustration b:nth-child(4) {
    animation-delay: .24s;
    background: var(--absent);
}

.tiles-illustration b:nth-child(5) {
    animation-delay: .32s;
    background: var(--orange-500);
}

.learn-illustration {
    flex-direction: column;
    background: #f0fdf4;
}

.learn-illustration span {
    font-size: 28px;
    animation: sound-pulse 1.8s ease-in-out infinite;
}

.learn-illustration strong {
    font-size: 20px;
}

.learn-illustration small {
    color: var(--muted);
}

.step-card h3 {
    margin: 0 0 9px;
    font-size: 19px;
    letter-spacing: -.03em;
}

.step-card p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.65;
}

.benefit-section {
    max-width: 1184px;
    margin: 0 auto 100px;
    padding: 48px;
    border-radius: 38px;
    display: grid;
    grid-template-columns: 1fr 1.12fr;
    gap: 48px;
    align-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--ink), #164e63);
    position: relative;
    overflow: hidden;
}

.benefit-section::before {
    content: "";
    position: absolute;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    right: -150px;
    top: -170px;
    background: var(--orange-500);
    filter: blur(110px);
    opacity: .28;
}

.benefit-copy {
    position: relative;
    z-index: 1;
}

.benefit-copy h2 {
    margin: 15px 0 17px;
    font-size: clamp(36px, 4vw, 54px);
    line-height: 1;
    letter-spacing: -.06em;
}

.benefit-copy p {
    margin-bottom: 25px;
    color: #cdeaf0;
    line-height: 1.72;
}

.benefit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.benefit-grid article {
    min-height: 160px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 21px;
    background: rgba(255, 255, 255, .08);
    backdrop-filter: blur(8px);
    transition: .22s var(--bounce);
}

.benefit-grid article:hover {
    transform: translateY(-5px) rotate(-1deg);
    background: rgba(255, 255, 255, .12);
}

.benefit-grid article>span {
    font-size: 25px;
}

.benefit-grid strong {
    display: block;
    margin: 12px 0 5px;
}

.benefit-grid p {
    margin: 0;
    color: #cdeaf0;
    font-size: 13px;
    line-height: 1.55;
}

.benefit-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}

.landing-footer {
    max-width: 1240px;
    margin: auto;
    padding: 30px 28px 45px;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    color: var(--muted);
    font-size: 13px;
}

.landing-footer p {
    margin: 0;
}

/* Auth */
.auth-page {
    background: linear-gradient(145deg, var(--aqua-50), #fff 45%, var(--orange-50));
}

.auth-page-shell {
    width: 100%;
    min-height: 100svh;
    margin: 0;
}

.auth-header {
    width: 100%;
    max-width: var(--public-max);
    height: var(--public-header-height);
    margin: auto;
    padding: 0 var(--public-gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    position: relative;
    z-index: 30;
}

.auth-layout {
    min-height: calc(100svh - var(--public-header-height));
    display: grid;
    grid-template-columns: minmax(0, 1fr) max(560px, 46vw);
    align-items: stretch;
}

.auth-panel {
    min-width: 0;
    display: flex;
    align-items: center;
    padding: 38px 68px 64px max(var(--public-gutter), calc((100vw - var(--public-max)) / 2 + var(--public-gutter)));
}

.back-link {
    width: max-content;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    transition: .2s var(--ease);
}

.back-link:hover {
    transform: translateX(-4px);
    color: var(--aqua-700);
}

.auth-form-wrap {
    width: min(100%, 440px);
    margin: 0;
}

.auth-form-wrap h1 {
    margin: 17px 0 12px;
    font-size: clamp(42px, 4.5vw, 58px);
    line-height: 1;
    letter-spacing: -.064em;
}

.auth-form-wrap>p {
    margin: 0 0 27px;
    color: var(--muted);
    line-height: 1.66;
}

.auth-form {
    display: grid;
    gap: 16px;
}

.auth-form label {
    display: grid;
    gap: 8px;
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 900;
}

.form-field {
    width: 100%;
    height: 54px;
    padding: 0 16px;
    border: 1.5px solid var(--line-strong);
    border-radius: 16px;
    color: var(--ink);
    background: #fff;
    outline: none;
    transition: .18s var(--ease);
}

.form-field:hover {
    border-color: var(--aqua-400);
}

.form-field:focus {
    border-color: var(--aqua-500);
    box-shadow: 0 0 0 4px var(--aqua-100);
    transform: translateY(-1px);
}

.form-field::placeholder {
    color: var(--muted-light);
}

.password-wrap {
    position: relative;
    display: block;
}

.password-wrap .form-field {
    padding-right: 54px;
}

.password-toggle {
    position: absolute;
    right: 6px;
    top: 5px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    transition: .18s var(--bounce);
}

.password-toggle:hover {
    background: var(--aqua-50);
    transform: rotate(-8deg);
}

.field-hint {
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
}

.field-error {
    color: var(--danger);
    font-size: 11px;
    line-height: 1.45;
}

.form-alert {
    margin-bottom: 18px;
    padding: 13px 14px;
    border: 1px solid var(--orange-200);
    border-radius: 16px;
    display: flex;
    gap: 10px;
    color: var(--orange-text);
    background: var(--orange-50);
    font-size: 13px;
    font-weight: 760;
    animation: shake .48s var(--ease);
}

.auth-switch {
    margin-top: 22px !important;
    text-align: center;
    font-size: 14px;
}

.auth-switch a {
    color: var(--aqua-700);
    font-weight: 900;
}

.auth-art {
    min-height: calc(100svh - var(--public-header-height));
    padding: clamp(36px, 4vw, 64px);
    display: grid;
    place-items: center;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.auth-art::before {
    content: "";
    position: absolute;
    width: 540px;
    height: 540px;
    border-radius: 47% 53% 63% 37% / 54% 44% 56% 46%;
    background: linear-gradient(145deg, var(--aqua-200), var(--orange-200));
    transform: rotate(-8deg);
    animation: blob-morph 9s ease-in-out infinite alternate;
}

.auth-orbit {
    position: absolute;
    border: 1px dashed rgba(8, 145, 178, .35);
    border-radius: 50%;
    animation: orbit-spin 18s linear infinite;
}

.orbit-one {
    width: 650px;
    height: 650px;
}

.orbit-two {
    width: 780px;
    height: 780px;
    animation-direction: reverse;
    animation-duration: 25s;
}

.auth-float {
    position: absolute;
    z-index: 3;
    width: 60px;
    height: 60px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 25px;
    font-weight: 950;
    box-shadow: var(--shadow-md);
}

.float-one {
    left: 12%;
    top: 16%;
    background: var(--aqua-500);
    transform: rotate(-10deg);
    animation: letter-hop 4s ease-in-out infinite;
}

.float-two {
    right: 10%;
    bottom: 17%;
    background: var(--orange-500);
    transform: rotate(10deg);
    animation: letter-hop 4.6s .4s ease-in-out infinite reverse;
}

.auth-word-card {
    width: min(100%, 550px);
    padding: 34px;
    border: 1px solid rgba(255, 255, 255, .95);
    border-radius: 35px;
    background: rgba(255, 255, 255, .84);
    box-shadow: 0 30px 80px rgba(15, 23, 42, .16);
    backdrop-filter: blur(20px);
    position: relative;
    z-index: 2;
    animation: card-float 5s ease-in-out infinite;
}

.auth-word-card h2 {
    margin: 21px 0 4px;
    font-size: 55px;
    line-height: 1;
    letter-spacing: -.065em;
}

.phonetic {
    margin: 0;
    color: var(--aqua-700);
    font-size: 13px;
    font-weight: 850;
}

.auth-definition {
    margin: 24px 0 17px;
    font-size: 21px;
    line-height: 1.46;
    font-weight: 850;
    letter-spacing: -.026em;
}

.auth-example {
    padding: 15px 17px;
    border-radius: 17px;
    color: var(--muted);
    background: var(--surface-soft);
    font-size: 14px;
    font-style: italic;
    line-height: 1.5;
}

.auth-perks {
    display: grid;
    gap: 12px;
    margin-top: 25px;
}

.auth-perks span {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 800;
}

.auth-perks span::first-letter {
    color: var(--success);
}

.mascot-bubble {
    padding: 18px;
    border-radius: 20px;
    display: grid;
    grid-template-columns: 48px 1fr;
    column-gap: 13px;
    background: var(--aqua-50);
    border: 1px solid var(--aqua-100);
}

.mascot-bubble>span {
    grid-row: span 2;
    width: 48px;
    height: 48px;
    border-radius: 17px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--orange-500);
    font-size: 23px;
    animation: star-spin 4s ease-in-out infinite;
}

.mascot-bubble small {
    color: var(--muted);
    margin-top: 3px;
}

.signup-tiles {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin: 27px 0;
}

.signup-tiles b {
    aspect-ratio: 1;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--success);
    font-size: 22px;
    animation: tile-dance 3s var(--bounce) infinite;
}

.signup-tiles b:nth-child(2) {
    background: var(--present);
    color: #5f3900;
    animation-delay: .09s;
}

.signup-tiles b:nth-child(3) {
    animation-delay: .18s;
}

.signup-tiles b:nth-child(4) {
    background: var(--absent);
    animation-delay: .27s;
}

.signup-tiles b:nth-child(5) {
    animation-delay: .36s;
}

.signup-card h2 {
    margin: 0;
    font-size: 42px;
}

.mini-achievements {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 23px;
}

.mini-achievements span {
    padding: 9px 11px;
    border-radius: 999px;
    background: var(--orange-50);
    color: var(--orange-text);
    font-size: 11px;
    font-weight: 900;
}

/* App shell */
.app-body {
    min-height: 100vh;
    background: var(--surface-soft);
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: var(--sidebar);
    padding: 24px 18px;
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    background: #fff;
}

.sidebar-brand {
    padding: 0 10px 25px;
}

.sidebar-nav {
    display: grid;
    gap: 6px;
}

.nav-link {
    min-height: 56px;
    padding: 10px 12px;
    border-radius: 17px;
    display: flex;
    align-items: center;
    gap: 11px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 850;
    transition: .2s var(--bounce);
}

.nav-link:hover {
    color: var(--ink);
    background: var(--surface-soft);
    transform: translateX(3px);
}

.nav-link.active {
    color: var(--aqua-700);
    background: var(--aqua-50);
}

.nav-link.active .nav-icon {
    background: #fff;
    box-shadow: 0 6px 14px rgba(8, 145, 178, .11);
    animation: nav-pop .5s var(--bounce);
}

.nav-icon {
    width: 36px;
    height: 36px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    font-size: 17px;
    transition: .2s var(--bounce);
}

.nav-link:hover .nav-icon {
    transform: rotate(-7deg) scale(1.08);
}

.nav-badge {
    min-width: 22px;
    height: 22px;
    margin-left: auto;
    padding: 0 6px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--orange-500);
    font-size: 10px;
    font-weight: 950;
    animation: badge-pulse 2s ease-in-out infinite;
}

.sidebar-spacer {
    flex: 1;
}

.streak-mini {
    margin-bottom: 12px;
    padding: 15px;
    border: 1px solid var(--orange-100);
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(145deg, var(--orange-50), #fff);
    transition: .2s var(--bounce);
}

.streak-mini:hover {
    transform: translateY(-3px) rotate(-1deg);
    box-shadow: var(--shadow-sm);
}

.streak-flame {
    width: 39px;
    height: 39px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--orange-500);
    box-shadow: 0 8px 18px rgba(249, 115, 22, .22);
    animation: flame-flicker 1.8s ease-in-out infinite;
}

.streak-mini strong,
.streak-mini small {
    display: block;
}

.streak-mini strong {
    font-size: 14px;
}

.streak-mini small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
}

.user-mini {
    padding: 9px;
    border-radius: 17px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar,
.top-avatar {
    display: grid;
    place-items: center;
    color: var(--aqua-700);
    background: linear-gradient(145deg, var(--aqua-100), var(--aqua-200));
    font-weight: 950;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 14px;
}

.user-copy {
    min-width: 0;
    flex: 1;
}

.user-copy strong,
.user-copy small {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-copy strong {
    font-size: 13px;
}

.user-copy small {
    color: var(--muted);
    font-size: 10px;
}

.logout-button {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    color: var(--muted);
}

.app-main {
    min-width: 0;
    grid-column: 2;
}

.app-topbar {
    height: 76px;
    padding: 0 34px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 30;
}

.mobile-brand {
    display: none;
}

.breadcrumb {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 780;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.points-pill {
    height: 42px;
    padding: 0 14px;
    border: 1px solid var(--orange-100);
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--orange-text);
    background: var(--orange-50);
    font-size: 12px;
    font-weight: 900;
}

.points-pill>span:first-child {
    animation: star-bob 2.4s ease-in-out infinite;
}

.top-avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
}

.app-content {
    width: 100%;
    max-width: 1330px;
    margin: auto;
    padding: 34px 34px 58px;
    animation: page-rise .48s var(--ease);
}

.mobile-bottom-nav {
    display: none;
}

.page-head {
    margin-bottom: 25px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.page-head h1 {
    margin: 0 0 9px;
    font-size: clamp(32px, 4vw, 46px);
    line-height: 1;
    letter-spacing: -.058em;
}

.page-head p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.head-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.toast-stack {
    position: fixed;
    z-index: 100;
    top: 90px;
    right: 24px;
    width: min(390px, calc(100vw - 32px));
    display: grid;
    gap: 9px;
}

.toast {
    padding: 13px 14px;
    border: 1px solid var(--orange-200);
    border-radius: 17px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--orange-text);
    background: rgba(255, 247, 237, .96);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(12px);
    font-size: 13px;
    font-weight: 780;
    animation: toast-in .5s var(--bounce), shake .45s .55s var(--ease);
}

.toast-success {
    color: var(--success-dark);
    background: rgba(240, 253, 244, .97);
    border-color: #bbf7d0;
}

.toast>span:nth-child(2) {
    flex: 1;
}

.toast button {
    border: 0;
    background: transparent;
    color: currentColor;
    font-size: 20px;
}

.toast.is-leaving {
    animation: toast-out .3s var(--ease) forwards;
}

/* Gameplay */














.progress-track {
    width: 116px;
    height: 8px;
    border-radius: 99px;
    overflow: hidden;
    background: var(--line);
}

.progress-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--aqua-400), var(--aqua-600));
    transform-origin: left;
    animation: grow-width .9s var(--ease);
}

.clue-card {
    padding: 21px 22px;
    border: 1px solid var(--aqua-100);
    border-radius: 23px;
    text-align: center;
    background: linear-gradient(145deg, var(--aqua-50), #f8feff);
    position: relative;
}

.clue-card::after {
    content: "?";
    position: absolute;
    right: 18px;
    top: 8px;
    color: var(--aqua-200);
    font-size: 62px;
    font-weight: 950;
    line-height: 1;
    transform: rotate(9deg);
    animation: question-float 3s ease-in-out infinite;
}

.clue-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--aqua-700);
    font-size: 10px;
    font-weight: 950;
    letter-spacing: .1em;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}

.clue-label span {
    animation: bulb-glow 2s ease-in-out infinite;
}

.clue-text {
    max-width: 620px;
    margin: 11px auto 0;
    font-size: clamp(20px, 2.3vw, 27px);
    line-height: 1.34;
    letter-spacing: -.035em;
    font-weight: 900;
    position: relative;
    z-index: 1;
}







.game-tile {
    aspect-ratio: 1;
    min-width: 0;
    border: 2px solid var(--line-strong);
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: var(--ink);
    background: #fff;
    font-size: clamp(18px, 2.25vw, 23px);
    font-weight: 950;
    text-transform: uppercase;
    transform-style: preserve-3d;
}

.game-tile.typed {
    border-color: var(--aqua-500);
    background: var(--aqua-50);
    animation: typed-pop .22s var(--bounce);
}

.game-tile.G {
    color: #fff;
    border-color: var(--success);
    background: var(--success);
    animation: tile-reveal .62s var(--bounce) both;
    animation-delay: calc(var(--tile-index, 0) * 80ms);
}

.game-tile.Y {
    color: #5f3900;
    border-color: var(--present);
    background: var(--present);
    animation: tile-reveal .62s var(--bounce) both;
    animation-delay: calc(var(--tile-index, 0) * 80ms);
}

.game-tile.B {
    color: #fff;
    border-color: var(--absent);
    background: var(--absent);
    animation: tile-reveal .62s var(--bounce) both;
    animation-delay: calc(var(--tile-index, 0) * 80ms);
}













.guess-form {
    max-width: 560px;
    margin: 15px auto 0;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

.guess-input {
    height: 52px;
    padding: 0 16px;
    border: 1.5px solid var(--line-strong);
    border-radius: 16px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: .24em;
    font-weight: 950;
    outline: none;
    transition: .18s var(--ease);
}

.guess-input:focus {
    border-color: var(--aqua-500);
    box-shadow: 0 0 0 4px var(--aqua-100);
    transform: translateY(-1px);
}

.guess-form.is-submitting .guess-input {
    animation: submit-pulse .55s var(--ease);
}

.keyboard {
    max-width: 650px;
    margin: 14px auto 0;
    display: grid;
    gap: 5px;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 4px;
}

.keyboard-key {
    min-width: 29px;
    height: 36px;
    padding: 0 7px;
    border: 0;
    border-radius: 9px;
    display: grid;
    place-items: center;
    color: var(--ink-soft);
    background: #e8edf3;
    font-size: 11px;
    font-weight: 950;
    transition: .14s var(--bounce);
}

.keyboard-key:hover {
    transform: translateY(-3px) scale(1.04);
    background: var(--aqua-100);
}

.keyboard-key:active,
.keyboard-key.key-pop {
    transform: translateY(1px) scale(.92);
}

.keyboard-key.wide {
    min-width: 55px;
}

.keyboard-key.correct {
    color: var(--success-dark);
    background: #bbf7d0;
}

.keyboard-key.present {
    color: #713f12;
    background: #fef08a;
}

.keyboard-key.absent {
    color: #fff;
    background: var(--absent);
}









.legend-list {
    display: grid;
    gap: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.legend-tile {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 950;
}

.legend-tile.correct {
    background: var(--success);
}

.legend-tile.present {
    color: #5f3900;
    background: var(--present);
}

.legend-tile.absent {
    background: var(--absent);
}


















.word-reveal {
    margin-top: 14px;
    padding: 21px;
    border: 1px solid var(--aqua-100);
    border-radius: 23px;
    background: linear-gradient(145deg, var(--aqua-50), #fff);
    animation: reveal-rise .6s .12s var(--ease) both;
}

.word-reveal-head {
    display: flex;
    align-items: center;
    gap: 11px;
    flex-wrap: wrap;
}

.word-reveal h2 {
    margin: 0;
    font-size: 29px;
    letter-spacing: -.045em;
    text-transform: capitalize;
}

.speak-button {
    width: 42px;
    height: 42px;
    border: 1px solid var(--aqua-200);
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: var(--aqua-700);
    background: #fff;
    transition: .18s var(--bounce);
}

.speak-button:hover {
    transform: scale(1.08) rotate(-7deg);
}

.speak-button.is-speaking {
    animation: sound-pulse .9s ease-in-out infinite;
}

.word-reveal .definition-copy {
    margin: 13px 0 0;
    color: var(--ink-soft);
    line-height: 1.62;
}

.example-copy {
    margin-top: 13px;
    padding: 13px 15px;
    border-radius: 15px;
    color: var(--muted);
    background: #fff;
    font-size: 13px;
    font-style: italic;
    line-height: 1.55;
}

.share-card {
    margin-top: 16px;
    padding: 19px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--surface-soft);
    text-align: center;
}

.share-card pre {
    margin: 0 0 14px;
    white-space: pre-wrap;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
}

.come-back-copy {
    margin-top: 17px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

.come-back-copy a {
    color: var(--aqua-700);
    font-weight: 900;
}

/* Dashboard */
.dashboard-hero {
    margin-bottom: 19px;
    padding: 28px;
    border-radius: 31px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 28px;
    align-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--aqua-700), #164e63);
    position: relative;
    overflow: hidden;
}

.dashboard-hero::before {
    content: "";
    position: absolute;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    right: -110px;
    top: -130px;
    background: var(--orange-500);
    filter: blur(80px);
    opacity: .42;
}

.dashboard-hero-copy,
.dashboard-hero-visual {
    position: relative;
    z-index: 1;
}

.dashboard-hero h2 {
    margin: 9px 0 9px;
    font-size: clamp(30px, 4vw, 45px);
    line-height: 1;
    letter-spacing: -.055em;
}

.dashboard-hero p {
    max-width: 600px;
    margin: 0;
    color: #cfeef3;
    line-height: 1.65;
}

.dashboard-hero-visual {
    width: 138px;
    height: 138px;
    border: 11px solid rgba(255, 255, 255, .16);
    border-top-color: var(--orange-400);
    border-right-color: var(--orange-400);
    border-radius: 50%;
    display: grid;
    place-items: center;
    transform: rotate(8deg);
    animation: progress-spin-in 1.1s var(--bounce);
}

.dashboard-hero-visual>span {
    transform: rotate(-8deg);
    text-align: center;
}

.dashboard-hero-visual strong {
    display: block;
    font-size: 30px;
}

.dashboard-hero-visual small {
    color: #cfeef3;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.stat-card {
    min-height: 145px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: #fff;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: .22s var(--bounce);
}

.stat-card:hover {
    transform: translateY(-5px) rotate(.4deg);
    box-shadow: var(--shadow-md);
}

.stat-card::after {
    content: "";
    position: absolute;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    right: -48px;
    bottom: -48px;
    background: var(--aqua-100);
}

.stat-card:nth-child(2n)::after {
    background: var(--orange-100);
}

.stat-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.stat-main {
    margin-top: 14px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
}

.stat-value {
    font-size: 31px;
    line-height: 1;
    letter-spacing: -.05em;
    font-weight: 950;
}

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    background: var(--aqua-50);
    font-size: 19px;
    animation: stat-icon-float 3s ease-in-out infinite;
}

.stat-card:nth-child(2n) .stat-icon {
    background: var(--orange-50);
    animation-delay: .3s;
}

.stat-note {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.dashboard-lower {
    margin-top: 17px;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr);
    gap: 17px;
}

.panel-card {
    padding: 23px;
    border: 1px solid var(--line);
    border-radius: 27px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.panel-head {
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.panel-head h3 {
    margin: 0;
    font-size: 18px;
    letter-spacing: -.03em;
}

.rival-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 17px;
    border: 1px solid var(--orange-200);
    border-radius: 20px;
    background: linear-gradient(145deg, var(--orange-50), #fff);
}

.rival-avatar {
    width: 53px;
    height: 53px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--orange-500);
    font-size: 20px;
    font-weight: 950;
    animation: rival-peek 3s ease-in-out infinite;
}

.rival-copy {
    flex: 1;
}

.rival-copy small,
.rival-copy strong {
    display: block;
}

.rival-copy small {
    color: var(--muted);
}

.rival-gap {
    color: var(--orange-text);
    text-align: right;
}

.rival-gap strong,
.rival-gap small {
    display: block;
}

.rival-gap strong {
    font-size: 22px;
}

.top-banner {
    padding: 21px;
    border: 1px solid #bbf7d0;
    border-radius: 20px;
    text-align: center;
    color: var(--success-dark);
    background: #f0fdf4;
    font-weight: 900;
    animation: result-pop .65s var(--bounce);
}

.mini-chart {
    height: 170px;
    padding-top: 12px;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    gap: 10px;
}

.chart-bar-wrap {
    flex: 1;
    display: grid;
    gap: 8px;
    text-align: center;
    color: var(--muted);
    font-size: 10px;
}

.chart-bar {
    width: 100%;
    max-width: 40px;
    height: var(--height);
    margin: auto;
    border-radius: 12px 12px 5px 5px;
    background: linear-gradient(180deg, var(--aqua-400), var(--aqua-600));
    transform-origin: bottom;
    animation: chart-grow .9s var(--bounce) both;
    animation-delay: var(--delay);
}

.chart-bar-wrap:nth-child(2n) .chart-bar {
    background: linear-gradient(180deg, var(--orange-300), var(--orange-500));
}

/* Lexicon / word cards */
.lexicon-toolbar {
    margin-bottom: 18px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 21px;
    display: flex;
    align-items: center;
    gap: 11px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.search-wrap {
    flex: 1;
    position: relative;
}

.search-wrap span {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
}

.search-input {
    width: 100%;
    height: 48px;
    padding: 0 15px 0 44px;
    border: 1px solid var(--line);
    border-radius: 15px;
    outline: none;
    background: var(--surface-soft);
    transition: .18s var(--ease);
}

.search-input:focus {
    border-color: var(--aqua-400);
    box-shadow: 0 0 0 4px var(--aqua-100);
    background: #fff;
}

.lexicon-count {
    padding: 10px 13px;
    border-radius: 14px;
    color: var(--aqua-700);
    background: var(--aqua-50);
    font-size: 12px;
    font-weight: 900;
}

.lexicon-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.word-card {
    min-height: 185px;
    padding: 21px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: .22s var(--bounce);
    position: relative;
    overflow: hidden;
}

.word-card::after {
    content: "";
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    right: -58px;
    bottom: -58px;
    background: var(--aqua-100);
    transition: .3s var(--ease);
}

.word-card:nth-child(3n+2)::after {
    background: var(--orange-100);
}

.word-card:hover {
    transform: translateY(-6px) rotate(.4deg);
    border-color: var(--aqua-200);
    box-shadow: var(--shadow-md);
}

.word-card:hover::after {
    transform: scale(1.5);
}

.word-card-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.word-card-title {
    flex: 1;
}

.word-card-title h2 {
    margin: 0 0 5px;
    font-size: 24px;
    letter-spacing: -.042em;
    text-transform: capitalize;
}

.word-card-title p {
    margin: 0;
    color: var(--aqua-700);
    font-size: 11px;
    font-weight: 850;
}

.word-card .definition {
    margin: 16px 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.58;
}

.mastery-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 13px;
}

.mastery-dots {
    display: flex;
    gap: 5px;
}

.mastery-dots i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--line);
}

.mastery-dots i.filled {
    background: var(--success);
    animation: dot-pop .5s var(--bounce) both;
}

.mastery-label {
    color: var(--success-dark);
    font-size: 10px;
    font-weight: 900;
}

.empty-state {
    min-height: 360px;
    padding: 40px 20px;
    border: 1px dashed var(--line-strong);
    border-radius: 28px;
    display: grid;
    place-items: center;
    text-align: center;
    background: #fff;
}

.empty-state-icon {
    width: 90px;
    height: 90px;
    margin: auto;
    border-radius: 31px;
    display: grid;
    place-items: center;
    background: var(--aqua-50);
    font-size: 40px;
    animation: mascot-bounce 2.7s var(--bounce) infinite;
}

.empty-state h2 {
    margin: 18px 0 8px;
    font-size: 25px;
}

.empty-state p {
    max-width: 450px;
    margin: 0 auto 20px;
    color: var(--muted);
    line-height: 1.6;
}

/* Round summary */
.summary-hero {
    margin-bottom: 20px;
    padding: 31px;
    border-radius: 31px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 25px;
    color: #fff;
    background: linear-gradient(135deg, var(--aqua-700), #164e63);
    position: relative;
    overflow: hidden;
}

.summary-hero::after {
    content: "";
    position: absolute;
    width: 270px;
    height: 270px;
    border-radius: 50%;
    right: -100px;
    top: -130px;
    background: var(--orange-500);
    filter: blur(70px);
    opacity: .45;
}

.summary-hero-copy,
.summary-score {
    position: relative;
    z-index: 1;
}

.summary-hero h1 {
    margin: 9px 0 8px;
    font-size: clamp(36px, 4.5vw, 52px);
    line-height: 1;
    letter-spacing: -.06em;
}

.summary-hero p {
    margin: 0;
    color: #cfeef3;
}

.summary-score {
    display: flex;
    gap: 11px;
}

.summary-score>div {
    min-width: 105px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 19px;
    text-align: center;
    background: rgba(255, 255, 255, .09);
    backdrop-filter: blur(8px);
    animation: result-pop .6s var(--bounce) both;
}

.summary-score>div:nth-child(2) {
    animation-delay: .12s;
}

.summary-score strong,
.summary-score small {
    display: block;
}

.summary-score strong {
    font-size: 25px;
}

.summary-score small {
    margin-top: 3px;
    color: #cfeef3;
}

.summary-list {
    display: grid;
    gap: 11px;
}

.summary-word {
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-left: 5px solid var(--success);
    border-radius: 21px;
    background: #fff;
    box-shadow: var(--shadow-sm);
    display: grid;
    grid-template-columns: minmax(170px, .7fr) minmax(0, 1.3fr) auto;
    gap: 18px;
    align-items: center;
    transition: .2s var(--bounce);
}

.summary-word.failed {
    border-left-color: var(--orange-500);
}

.summary-word:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

.summary-word-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.summary-word-main h2 {
    margin: 0;
    font-size: 21px;
    text-transform: capitalize;
    letter-spacing: -.035em;
}

.summary-word-main small {
    color: var(--muted);
}

.summary-word-copy p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.summary-word-copy em {
    display: block;
    margin-top: 5px;
    color: var(--muted-light);
    font-size: 11px;
}

.summary-status {
    padding: 8px 10px;
    border-radius: 999px;
    color: var(--success-dark);
    background: #f0fdf4;
    font-size: 10px;
    font-weight: 900;
}

.failed .summary-status {
    color: var(--orange-text);
    background: var(--orange-50);
}

.summary-action {
    margin-top: 20px;
    text-align: center;
}

/* Word detail */
.word-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) 340px;
    gap: 18px;
}

.word-detail-card {
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 31px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.word-detail-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.word-detail-card h1 {
    margin: 10px 0 4px;
    font-size: clamp(45px, 6vw, 72px);
    line-height: .95;
    letter-spacing: -.073em;
    text-transform: capitalize;
}

.phonetic-line {
    color: var(--aqua-700);
    font-size: 14px;
    font-weight: 850;
}

.word-definition-large {
    margin: 28px 0 18px;
    font-size: 22px;
    line-height: 1.5;
    letter-spacing: -.025em;
    font-weight: 780;
}

.example-large {
    padding: 19px;
    border: 1px solid var(--orange-100);
    border-radius: 19px;
    color: var(--muted);
    background: var(--orange-50);
    font-style: italic;
    line-height: 1.65;
}

.detail-sidebar {
    display: grid;
    gap: 15px;
}

.mastery-card {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 25px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.mastery-card h3 {
    margin: 0 0 14px;
}

.mastery-meter {
    height: 13px;
    border-radius: 99px;
    overflow: hidden;
    background: var(--line);
}

.mastery-meter span {
    display: block;
    width: var(--mastery);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--aqua-400), var(--success));
    animation: grow-width 1s var(--ease);
}

.detail-stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    margin-top: 14px;
}

.detail-stat {
    padding: 13px;
    border-radius: 16px;
    background: var(--surface-soft);
}

.detail-stat strong,
.detail-stat small {
    display: block;
}

.detail-stat strong {
    font-size: 20px;
}

.detail-stat small {
    color: var(--muted);
}

/* Review */
.review-shell {
    max-width: 920px;
    margin: auto;
}

.review-progress-head {
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.review-progress-head .progress-track {
    flex: 1;
    width: auto;
    height: 10px;
}

.review-deck {
    min-height: 500px;
    position: relative;
}

.review-card {
    min-height: 470px;
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: 34px;
    display: none;
    place-items: center;
    text-align: center;
    background: #fff;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.review-card.is-active {
    display: grid;
    animation: review-card-in .55s var(--bounce);
}

.review-card::before,
.review-card::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.review-card::before {
    width: 210px;
    height: 210px;
    left: -120px;
    top: -120px;
    background: var(--aqua-100);
}

.review-card::after {
    width: 180px;
    height: 180px;
    right: -110px;
    bottom: -110px;
    background: var(--orange-100);
}

.review-card-content {
    max-width: 650px;
    position: relative;
    z-index: 1;
}

.review-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 18px;
    border-radius: 24px;
    display: grid;
    place-items: center;
    background: var(--aqua-50);
    font-size: 31px;
    animation: question-float 2.7s ease-in-out infinite;
}

.review-prompt {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.review-definition {
    margin: 0 auto 24px;
    font-size: clamp(25px, 4vw, 38px);
    line-height: 1.25;
    letter-spacing: -.045em;
    font-weight: 900;
}

.review-answer {
    display: none;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.review-card.is-revealed .review-answer {
    display: block;
    animation: reveal-rise .5s var(--bounce);
}

.review-answer h2 {
    margin: 0 0 4px;
    font-size: 43px;
    text-transform: capitalize;
    letter-spacing: -.055em;
}

.review-answer p {
    color: var(--muted);
}

.review-actions {
    margin-top: 18px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.review-complete {
    min-height: 430px;
    padding: 40px;
    border: 1px solid #bbf7d0;
    border-radius: 34px;
    display: none;
    place-items: center;
    text-align: center;
    background: linear-gradient(145deg, #f0fdf4, #fff);
}

.review-complete.is-active {
    display: grid;
    animation: result-pop .6s var(--bounce);
}

.review-complete-icon {
    width: 90px;
    height: 90px;
    margin: auto;
    border-radius: 31px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--success);
    font-size: 42px;
    animation: victory-wobble 1.2s var(--bounce);
}

/* Confetti */
.confetti-layer {
    position: fixed;
    z-index: 200;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.confetti-piece {
    position: absolute;
    top: -30px;
    width: 10px;
    height: 16px;
    border-radius: 3px;
    background: var(--confetti-color);
    left: var(--left);
    animation: confetti-fall var(--duration) linear forwards;
    animation-delay: var(--delay);
    transform: rotate(var(--rotation));
}

/* Reveal utilities */
[data-reveal] {
    opacity: 0;
    transform: translateY(25px);
    transition: opacity .65s var(--ease), transform .65s var(--ease);
    transition-delay: var(--reveal-delay, 0ms);
}

.reveal-visible {
    opacity: 1;
    transform: translateY(0);
}

.stagger-card {
    animation: stagger-up .55s var(--ease) both;
    animation-delay: calc(var(--stagger, 0) * 70ms);
}

/* Responsive */
@media (max-width: 1160px) {
    .auth-layout {
        grid-template-columns: 1fr;
        min-height: calc(100svh - var(--public-header-height));
        padding: 44px var(--public-gutter) 64px;
        align-items: center;
    }

    .auth-art {
        display: none;
    }

    .auth-panel {
        justify-content: center;
        padding: 0;
    }

    .auth-form-wrap {
        margin-inline: auto;
    }
}

@media (max-width: 1060px) {
    .public-nav {
        display: none;
    }

    .hero-section {
        grid-template-columns: 1fr;
        padding-top: 45px;
        text-align: center;
    }

    .hero-copy>p {
        margin-inline: auto;
    }

    .hero-actions,
    .hero-trust {
        justify-content: center;
    }

    .hero-game-stage {
        min-height: 600px;
    }

    .benefit-section {
        margin-inline: 28px;
    }



    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .word-detail-layout {
        grid-template-columns: 1fr;
    }

    .detail-sidebar {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 900px) {
    :root {
        --sidebar: 0px;
    }

    .sidebar {
        display: none;
    }

    .app-shell {
        display: block;
    }

    .app-main {
        grid-column: 1;
    }

    .app-topbar {
        height: 68px;
        padding: 0 18px;
    }

    .mobile-brand {
        display: inline-flex;
        font-size: 19px;
    }

    .mobile-brand .brand-mark {
        width: 38px;
        height: 38px;
        border-radius: 14px;
    }

    .breadcrumb {
        display: none;
    }

    .top-avatar {
        display: none;
    }

    .app-content {
        padding: 25px 20px 105px;
    }

    .mobile-bottom-nav {
        position: fixed;
        z-index: 60;
        left: 12px;
        right: 12px;
        bottom: max(10px, env(safe-area-inset-bottom));
        min-height: 72px;
        padding: 8px;
        border: 1px solid rgba(226, 232, 240, .95);
        border-radius: 24px;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        background: rgba(255, 255, 255, .94);
        box-shadow: 0 18px 45px rgba(15, 23, 42, .19);
        backdrop-filter: blur(17px);
    }

    .mobile-nav-link {
        min-width: 0;
        border-radius: 16px;
        display: grid;
        place-items: center;
        align-content: center;
        gap: 3px;
        color: var(--muted);
        position: relative;
        transition: .2s var(--bounce);
    }

    .mobile-nav-link>span {
        font-size: 20px;
        transition: .2s var(--bounce);
    }

    .mobile-nav-link small {
        font-size: 9px;
        font-weight: 850;
    }

    .mobile-nav-link.active {
        color: var(--aqua-700);
        background: var(--aqua-50);
    }

    .mobile-nav-link.active>span {
        transform: translateY(-2px) scale(1.12);
        animation: nav-pop .5s var(--bounce);
    }

    .mobile-nav-link i {
        position: absolute;
        right: 7px;
        top: 5px;
        min-width: 17px;
        height: 17px;
        padding: 0 4px;
        border-radius: 99px;
        display: grid;
        place-items: center;
        color: #fff;
        background: var(--orange-500);
        font-size: 8px;
        font-style: normal;
        font-weight: 950;
    }

    .game-focus .mobile-bottom-nav {
        position: static;
        margin: 0 12px 12px;
        width: auto;
    }

    .game-focus .app-content {
        padding-bottom: 28px;
    }





    .dashboard-lower {
        grid-template-columns: 1fr;
    }

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

    .step-card {
        min-height: auto;
    }

    .benefit-section {
        grid-template-columns: 1fr;
    }

    .summary-word {
        grid-template-columns: minmax(150px, .7fr) minmax(0, 1.3fr);
    }

    .summary-status {
        grid-column: 1 / -1;
        width: max-content;
    }

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

@media (max-width: 620px) {
    :root {
        --public-gutter: 18px;
        --public-header-height: 74px;
    }

    .public-header {
        height: var(--public-header-height);
        padding-inline: var(--public-gutter);
    }

    .public-actions .btn-ghost {
        display: none;
    }

    .public-actions .btn {
        min-height: 39px;
        padding-inline: 14px;
    }

    .hero-section {
        min-height: calc(100svh - var(--public-header-height));
        padding: 38px var(--public-gutter) 70px;
        gap: 32px;
    }

    .hero-copy h1 {
        font-size: clamp(45px, 14vw, 62px);
    }

    .hero-copy>p {
        font-size: 16px;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .hero-trust {
        display: grid;
        gap: 10px;
        text-align: left;
    }

    .hero-game-stage {
        min-height: 470px;
    }

    .hero-blob {
        width: 380px;
        height: 380px;
    }

    .demo-card {
        padding: 16px;
        border-radius: 25px;
        transform: none;
    }

    .demo-clue p {
        font-size: 15px;
    }

    .demo-tile {
        border-radius: 9px;
        font-size: 15px;
    }

    .floating-chip {
        display: none;
    }

    .floating-letter {
        width: 47px;
        height: 47px;
        border-radius: 16px;
        font-size: 20px;
    }

    .letter-a {
        left: 4px;
        top: 20px;
    }

    .letter-z {
        right: 4px;
        bottom: 25px;
    }

    .logo-cloud {
        margin: 0 18px 76px;
    }

    .logo-cloud div {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 13px;
    }

    .landing-section {
        padding: 0 18px 80px;
    }

    .section-heading h2 {
        font-size: 40px;
    }

    .benefit-section {
        margin: 0 18px 75px;
        padding: 30px 22px;
        border-radius: 29px;
    }

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

    .landing-footer {
        margin-inline: 18px;
        padding-inline: 0;
        flex-direction: column;
        text-align: center;
    }

    .auth-header {
        height: var(--public-header-height);
    }

    .auth-layout {
        min-height: calc(100svh - var(--public-header-height));
        padding: 34px var(--public-gutter) 54px;
    }

    .auth-form-wrap {
        text-align: center;
    }

    .auth-form-wrap h1 {
        font-size: 43px;
    }

    .auth-form-wrap>p {
        margin-inline: auto;
    }

    .auth-form {
        text-align: left;
    }

    .back-link {
        font-size: 12px;
    }

    .app-topbar {
        padding: 0 14px;
    }

    .top-actions {
        gap: 6px;
    }

    .sound-toggle {
        width: 39px;
        height: 39px;
    }

    .points-pill {
        height: 39px;
        padding: 0 10px;
    }

    .app-content {
        padding: 21px 14px 103px;
    }

    .page-head {
        display: block;
    }

    .page-head h1 {
        font-size: 34px;
    }

    .head-actions {
        margin-top: 14px;
        justify-content: flex-start;
    }







    .progress-track {
        width: 95px;
    }

    .clue-card {
        padding: 18px 15px;
    }

    .clue-text {
        font-size: 20px;
    }

    .clue-card::after {
        font-size: 46px;
    }



    .game-tile {
        border-radius: 9px;
        font-size: 18px;
    }

    .guess-form {
        grid-template-columns: 1fr;
    }

    .guess-form .btn {
        width: 100%;
    }

    .keyboard-key {
        min-width: 0;
        flex: 1;
        height: 36px;
        padding: 0 3px;
        font-size: 10px;
    }

    .keyboard-key.wide {
        flex: 1.6;
        min-width: 0;
    }







    .word-reveal {
        padding: 18px;
    }

    .dashboard-hero {
        padding: 23px;
        grid-template-columns: 1fr;
    }

    .dashboard-hero-visual {
        width: 110px;
        height: 110px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-card {
        min-height: 130px;
        padding: 16px;
    }

    .stat-value {
        font-size: 26px;
    }

    .dashboard-lower {
        gap: 12px;
    }

    .panel-card {
        padding: 18px;
    }

    .rival-card {
        align-items: flex-start;
    }

    .rival-gap {
        text-align: left;
    }

    .lexicon-toolbar {
        flex-wrap: wrap;
    }

    .search-wrap {
        flex-basis: 100%;
    }

    .word-card {
        min-height: auto;
    }

    .summary-hero {
        padding: 23px;
        grid-template-columns: 1fr;
    }

    .summary-score {
        width: 100%;
    }

    .summary-score>div {
        flex: 1;
    }

    .summary-word {
        grid-template-columns: 1fr;
    }

    .summary-status {
        grid-column: auto;
    }

    .word-detail-card {
        padding: 22px;
    }

    .word-detail-top {
        display: block;
    }

    .word-detail-top .speak-button {
        margin-top: 16px;
    }

    .detail-sidebar {
        grid-template-columns: 1fr;
    }

    .review-card {
        min-height: 450px;
        padding: 24px 18px;
    }

    .review-definition {
        font-size: 25px;
    }

    .review-actions .btn {
        flex: 1 1 100%;
    }

    .toast-stack {
        top: 78px;
        right: 12px;
        width: calc(100vw - 24px);
    }
}

/* Motion */
@keyframes brand-wiggle {

    0%,
    100% {
        transform: rotate(0)
    }

    25% {
        transform: rotate(-8deg) scale(1.05)
    }

    55% {
        transform: rotate(7deg) scale(1.08)
    }

    75% {
        transform: rotate(-3deg)
    }
}

@keyframes button-shine {
    to {
        transform: translateX(130%);
    }
}

@keyframes arrow-run {
    0% {
        transform: translateX(0)
    }

    50% {
        transform: translateX(5px)
    }

    100% {
        transform: translateX(0)
    }
}

@keyframes ambient-drift {
    to {
        transform: translate(50px, 35px) scale(1.12);
    }
}

@keyframes blob-morph {
    0% {
        border-radius: 46% 54% 59% 41% / 42% 46% 54% 58%;
        transform: rotate(8deg) scale(1)
    }

    100% {
        border-radius: 58% 42% 44% 56% / 52% 62% 38% 48%;
        transform: rotate(-2deg) scale(1.06)
    }
}

@keyframes card-float {

    0%,
    100% {
        transform: translateY(0) rotate(-1.2deg)
    }

    50% {
        transform: translateY(-10px) rotate(.2deg)
    }
}

@keyframes bob {

    0%,
    100% {
        translate: 0 0
    }

    50% {
        translate: 0 -10px
    }
}

@keyframes letter-hop {

    0%,
    100% {
        translate: 0 0
    }

    45% {
        translate: 0 -14px;
        rotate: -4deg
    }

    55% {
        translate: 0 -14px;
        rotate: 4deg
    }
}

@keyframes demo-flip {

    0%,
    13%,
    100% {
        transform: rotateX(0)
    }

    5% {
        transform: rotateX(90deg)
    }

    9% {
        transform: rotateX(0)
    }
}

@keyframes star-spin {

    0%,
    80%,
    100% {
        transform: rotate(0) scale(1)
    }

    88% {
        transform: rotate(160deg) scale(1.13)
    }

    96% {
        transform: rotate(360deg) scale(1)
    }
}

@keyframes bulb-glow {

    0%,
    100% {
        filter: drop-shadow(0 0 0 rgba(250, 204, 21, 0));
        transform: scale(1)
    }

    50% {
        filter: drop-shadow(0 0 12px rgba(250, 204, 21, .8));
        transform: scale(1.08)
    }
}

@keyframes tile-dance {

    0%,
    75%,
    100% {
        transform: translateY(0) rotate(0)
    }

    82% {
        transform: translateY(-11px) rotate(-5deg)
    }

    89% {
        transform: translateY(0) rotate(4deg)
    }

    95% {
        transform: translateY(-4px) rotate(0)
    }
}

@keyframes sound-pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(6, 182, 212, .22)
    }

    50% {
        transform: scale(1.08);
        box-shadow: 0 0 0 9px rgba(6, 182, 212, 0)
    }
}

@keyframes orbit-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes page-rise {
    from {
        opacity: 0;
        transform: translateY(12px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

@keyframes nav-pop {
    0% {
        transform: scale(.75) rotate(-8deg)
    }

    70% {
        transform: scale(1.12) rotate(3deg)
    }

    100% {
        transform: scale(1) rotate(0)
    }
}

@keyframes badge-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(249, 115, 22, .22)
    }

    50% {
        box-shadow: 0 0 0 7px rgba(249, 115, 22, 0)
    }
}

@keyframes flame-flicker {

    0%,
    100% {
        transform: rotate(-2deg) scale(1)
    }

    35% {
        transform: rotate(4deg) scale(1.08)
    }

    65% {
        transform: rotate(-5deg) scale(.97)
    }
}

@keyframes star-bob {

    0%,
    100% {
        transform: translateY(0) rotate(0)
    }

    50% {
        transform: translateY(-3px) rotate(10deg)
    }
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(35px) scale(.94)
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1)
    }
}

@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateX(40px) scale(.94)
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0)
    }

    20% {
        transform: translateX(-7px)
    }

    40% {
        transform: translateX(6px)
    }

    60% {
        transform: translateX(-4px)
    }

    80% {
        transform: translateX(3px)
    }
}

@keyframes grow-width {
    from {
        transform: scaleX(0)
    }

    to {
        transform: scaleX(1)
    }
}

@keyframes question-float {

    0%,
    100% {
        transform: translateY(0) rotate(9deg)
    }

    50% {
        transform: translateY(-7px) rotate(2deg)
    }
}

@keyframes typed-pop {
    from {
        transform: scale(.8) rotate(-3deg)
    }

    70% {
        transform: scale(1.09) rotate(2deg)
    }

    to {
        transform: scale(1) rotate(0)
    }
}

@keyframes tile-reveal {
    0% {
        transform: rotateX(90deg) scale(.88);
        opacity: .2
    }

    55% {
        transform: rotateX(-10deg) scale(1.07)
    }

    100% {
        transform: rotateX(0) scale(1);
        opacity: 1
    }
}

@keyframes empty-breathe {

    0%,
    100% {
        border-color: var(--aqua-200);
        box-shadow: 0 0 0 0 rgba(6, 182, 212, 0)
    }

    50% {
        border-color: var(--aqua-400);
        box-shadow: 0 0 0 4px rgba(6, 182, 212, .08)
    }
}

@keyframes submit-pulse {

    0%,
    100% {
        transform: scale(1)
    }

    50% {
        transform: scale(.985);
        background: var(--aqua-50)
    }
}

@keyframes mascot-bounce {

    0%,
    70%,
    100% {
        transform: translateY(0) rotate(0)
    }

    78% {
        transform: translateY(-10px) rotate(-8deg)
    }

    86% {
        transform: translateY(0) rotate(7deg)
    }

    93% {
        transform: translateY(-4px) rotate(0)
    }
}

@keyframes result-pop {
    from {
        opacity: 0;
        transform: scale(.82) translateY(16px)
    }

    70% {
        transform: scale(1.04) translateY(0)
    }

    to {
        opacity: 1;
        transform: scale(1)
    }
}

@keyframes victory-wobble {
    0% {
        transform: scale(.4) rotate(-25deg)
    }

    55% {
        transform: scale(1.16) rotate(9deg)
    }

    75% {
        transform: scale(.96) rotate(-5deg)
    }

    100% {
        transform: scale(1) rotate(0)
    }
}

@keyframes reveal-rise {
    from {
        opacity: 0;
        transform: translateY(18px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

@keyframes progress-spin-in {
    from {
        opacity: 0;
        transform: rotate(-120deg) scale(.5)
    }

    to {
        opacity: 1;
        transform: rotate(8deg) scale(1)
    }
}

@keyframes stat-icon-float {

    0%,
    100% {
        transform: translateY(0) rotate(0)
    }

    50% {
        transform: translateY(-5px) rotate(-5deg)
    }
}

@keyframes rival-peek {

    0%,
    100% {
        transform: translateX(0) rotate(0)
    }

    50% {
        transform: translateX(4px) rotate(5deg)
    }
}

@keyframes chart-grow {
    from {
        transform: scaleY(0)
    }

    to {
        transform: scaleY(1)
    }
}

@keyframes dot-pop {
    from {
        transform: scale(0)
    }

    70% {
        transform: scale(1.25)
    }

    to {
        transform: scale(1)
    }
}

@keyframes review-card-in {
    from {
        opacity: 0;
        transform: translateX(45px) rotate(2deg) scale(.95)
    }

    to {
        opacity: 1;
        transform: translateX(0) rotate(0) scale(1)
    }
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-30px) rotate(0);
        opacity: 1
    }

    100% {
        transform: translateY(110vh) rotate(900deg);
        opacity: .9
    }
}

@keyframes stagger-up {
    from {
        opacity: 0;
        transform: translateY(18px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}


/* SPELL 85% DESKTOP CANVAS: START */
/*
 * Public desktop sizing rule:
 * - use 85% of the available viewport on ordinary desktops;
 * - stop growing at 1440px on wide and ultrawide displays;
 * - scale internal spacing and visual elements fluidly instead of using
 *   transform: scale(), which would blur text and distort hit targets.
 */
@media (min-width: 1061px) {

    .public-header,
    .hero-section,
    .logo-cloud,
    .landing-section,
    .benefit-section,
    .landing-footer {
        width: min(85vw, 1440px);
        max-width: none;
    }

    .public-header {
        padding-inline: clamp(20px, 2.1vw, 34px);
    }

    .hero-section {
        padding: clamp(38px, 4.2vh, 56px) clamp(20px, 2.1vw, 34px) clamp(54px, 6vh, 76px);
        grid-template-columns: minmax(0, 1fr) minmax(400px, .88fr);
        gap: clamp(32px, 4vw, 64px);
    }

    .hero-copy h1 {
        font-size: clamp(52px, 5.4vw, 78px);
    }

    .hero-copy>p {
        font-size: clamp(16px, 1.18vw, 18px);
    }

    .hero-game-stage {
        min-height: clamp(480px, 43vw, 565px);
    }

    .hero-blob {
        width: clamp(410px, 36vw, 510px);
        height: clamp(400px, 34vw, 490px);
    }

    .demo-card {
        width: min(100%, clamp(400px, 33vw, 466px));
        padding: clamp(20px, 1.7vw, 24px);
        border-radius: clamp(26px, 2vw, 32px);
    }

    .floating-letter {
        width: clamp(50px, 4vw, 60px);
        height: clamp(50px, 4vw, 60px);
        border-radius: clamp(16px, 1.4vw, 20px);
        font-size: clamp(21px, 1.8vw, 25px);
    }

    .logo-cloud {
        padding: clamp(22px, 2vw, 30px);
    }

    .landing-section {
        padding-inline: clamp(20px, 2.1vw, 34px);
    }

    .steps-grid {
        gap: clamp(14px, 1.35vw, 20px);
    }

    .step-card {
        min-height: clamp(320px, 25vw, 350px);
        padding: clamp(23px, 2vw, 28px);
        border-radius: clamp(24px, 2vw, 28px);
    }

    .benefit-section {
        padding: clamp(34px, 3.4vw, 48px);
        gap: clamp(30px, 3.3vw, 48px);
        border-radius: clamp(30px, 2.8vw, 38px);
    }

    .landing-footer {
        padding-inline: clamp(20px, 2.1vw, 34px);
    }
}

@media (min-width: 1161px) {
    .auth-page-shell {
        width: min(85vw, 1440px);
        min-height: 100svh;
        margin-inline: auto;
    }

    .auth-header {
        width: 100%;
        max-width: none;
        padding-inline: clamp(20px, 2.1vw, 34px);
    }

    .auth-layout {
        width: 100%;
        grid-template-columns: minmax(380px, .88fr) minmax(460px, 1.12fr);
        gap: clamp(26px, 3.4vw, 54px);
        align-items: stretch;
    }

    .auth-panel {
        padding: clamp(30px, 3.6vh, 44px) 0 clamp(44px, 5.2vh, 64px) clamp(20px, 2.1vw, 34px);
    }

    .auth-form-wrap {
        width: min(100%, clamp(390px, 31vw, 440px));
    }

    .auth-form-wrap h1 {
        font-size: clamp(40px, 3.5vw, 54px);
    }

    .form-field {
        height: clamp(50px, 4vw, 54px);
    }

    .auth-art {
        min-width: 0;
        padding: clamp(24px, 2.8vw, 48px);
    }

    .auth-art::before {
        width: clamp(430px, 38vw, 540px);
        height: clamp(430px, 38vw, 540px);
    }

    .orbit-one {
        width: clamp(520px, 45vw, 650px);
        height: clamp(520px, 45vw, 650px);
    }

    .orbit-two {
        width: clamp(620px, 54vw, 780px);
        height: clamp(620px, 54vw, 780px);
    }

    .auth-float {
        width: clamp(50px, 4vw, 60px);
        height: clamp(50px, 4vw, 60px);
        border-radius: clamp(16px, 1.4vw, 20px);
        font-size: clamp(21px, 1.8vw, 25px);
    }

    .auth-word-card {
        width: min(100%, clamp(420px, 36vw, 550px));
        padding: clamp(24px, 2.3vw, 34px);
        border-radius: clamp(27px, 2.5vw, 35px);
    }

    .auth-word-card h2 {
        font-size: clamp(42px, 3.6vw, 55px);
    }

    .auth-definition {
        margin-block: clamp(18px, 1.7vw, 24px) clamp(14px, 1.2vw, 17px);
        font-size: clamp(17px, 1.4vw, 21px);
    }

    .auth-example {
        padding: clamp(13px, 1.2vw, 15px) clamp(14px, 1.3vw, 17px);
        font-size: clamp(13px, .95vw, 14px);
    }

    .signup-card h2 {
        font-size: clamp(36px, 3vw, 42px);
    }

    .signup-tiles {
        gap: clamp(6px, .65vw, 8px);
        margin-block: clamp(20px, 2vw, 27px);
    }

    .signup-tiles b {
        border-radius: clamp(11px, 1vw, 14px);
        font-size: clamp(18px, 1.5vw, 22px);
    }
}

/* SPELL 85% DESKTOP CANVAS: END */





/* SPELL NO-SCROLL PUZZLE STAGE: START */
:root {
    --game-topbar-height: 64px;
}

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

body.game-focus {
    height: 100dvh;
    overflow: hidden;
}

.game-focus .app-main {
    height: 100dvh;
    min-height: 0;
    display: grid;
    grid-template-rows: var(--game-topbar-height) minmax(0, 1fr);
    overflow: hidden;
}

.game-focus .app-topbar {
    height: var(--game-topbar-height);
    min-height: 0;
    padding-inline: clamp(16px, 2vw, 30px);
    position: relative;
    top: auto;
}

.game-focus .app-content {
    width: 100%;
    max-width: none;
    height: auto;
    min-height: 0;
    padding: clamp(10px, 1.5vh, 16px) clamp(12px, 1.7vw, 24px);
    overflow: hidden;
    animation: page-rise .4s var(--ease);
}

.game-focus .mobile-bottom-nav {
    display: none !important;
}

.puzzle-stage {
    width: min(100%, 1440px);
    height: 100%;
    min-height: 0;
    margin: auto;
    border: 1px solid var(--line);
    border-radius: clamp(22px, 2vw, 30px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    background: #fff;
    box-shadow: var(--shadow-sm);
    position: relative;
    isolation: isolate;
}

.puzzle-stage::before {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    right: -155px;
    top: -175px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--aqua-100), var(--orange-100));
    opacity: .72;
    z-index: -1;
    animation: ambient-drift 11s ease-in-out infinite alternate;
}

.puzzle-toolbar {
    min-height: clamp(58px, 8vh, 72px);
    padding: 10px clamp(14px, 2vw, 24px);
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: minmax(190px, 1fr) auto minmax(240px, 1fr);
    align-items: center;
    gap: clamp(12px, 2vw, 28px);
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(14px);
}

.puzzle-mode-title {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 11px;
}

.puzzle-mode-title>span:last-child {
    min-width: 0;
}

.puzzle-mode-title strong,
.puzzle-mode-title small {
    display: block;
}

.puzzle-mode-title strong {
    font-size: clamp(14px, 1.2vw, 17px);
    letter-spacing: -.025em;
}

.puzzle-mode-title small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 760;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.puzzle-mode-icon {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: #fff;
    background: linear-gradient(145deg, var(--aqua-500), var(--aqua-700));
    box-shadow: 0 9px 20px rgba(6, 182, 212, .2);
    animation: mascot-wave 3s ease-in-out infinite;
}

.puzzle-mode-icon .ui-icon {
    width: 20px;
    height: 20px;
}

.puzzle-toolbar-progress {
    display: grid;
    justify-items: center;
    gap: 5px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    white-space: nowrap;
}

.puzzle-toolbar-progress .progress-track {
    width: clamp(100px, 11vw, 145px);
}

.puzzle-toolbar-stats {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
}

.puzzle-toolbar-stats .pill {
    white-space: nowrap;
}

.puzzle-state {
    min-height: 0;
    overflow: hidden;
}

.puzzle-playing-state {
    padding: clamp(12px, 2vh, 24px) clamp(14px, 2.4vw, 34px);
    display: grid;
    grid-template-rows: minmax(80px, 1fr) auto auto auto auto;
    align-content: center;
    justify-items: center;
    gap: clamp(7px, 1.35vh, 14px);
}

.puzzle-clue-card {
    width: min(100%, 820px);
    min-height: 0;
    max-height: clamp(104px, 18vh, 168px);
    padding: clamp(13px, 2vh, 23px) clamp(16px, 2vw, 28px);
    display: grid;
    align-content: center;
    overflow: hidden;
}

.puzzle-clue-card .clue-text {
    max-height: 3.1em;
    overflow: hidden;
    font-size: clamp(18px, 2vw, 28px);
}

.active-guess-wrap {
    display: grid;
    justify-items: center;
    gap: 7px;
}

.active-guess-label {
    color: var(--aqua-700);
    font-size: 9px;
    font-weight: 950;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.active-guess-row,
.result-word-row {
    width: min(clamp(250px, 29vw, 390px), 90vw);
    display: grid;
    grid-template-columns: repeat(var(--word-length), minmax(0, 1fr));
    gap: clamp(5px, .65vw, 9px);
}

.active-guess-row .game-tile,
.result-word-row .game-tile {
    width: 100%;
    aspect-ratio: 1;
    font-size: clamp(19px, 2.1vw, 28px);
    border-radius: clamp(9px, 1vw, 14px);
}

.active-guess-row .game-tile {
    border-color: var(--aqua-300);
    animation: empty-breathe 2.5s ease-in-out infinite;
}

.active-guess-row .game-tile:nth-child(2) {
    animation-delay: .12s;
}

.active-guess-row .game-tile:nth-child(3) {
    animation-delay: .24s;
}

.active-guess-row .game-tile:nth-child(4) {
    animation-delay: .36s;
}

.active-guess-row .game-tile:nth-child(5) {
    animation-delay: .48s;
}

.active-guess-row .game-tile:nth-child(6) {
    animation-delay: .60s;
}

.active-guess-row .game-tile:nth-child(7) {
    animation-delay: .72s;
}

.active-guess-row .game-tile:nth-child(8) {
    animation-delay: .84s;
}

.puzzle-guess-form {
    width: min(100%, 650px);
    max-width: 650px;
    margin: 0;
    grid-template-columns: minmax(0, 1fr) auto;
}

.puzzle-guess-form .guess-input {
    min-width: 0;
}

.puzzle-guess-form .btn {
    white-space: nowrap;
}

.attempt-trail {
    width: min(100%, 920px);
    min-height: 48px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface-soft);
}

.attempt-trail-head {
    margin-bottom: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: var(--aqua-700);
    font-size: 9px;
    font-weight: 950;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.attempt-trail-head small {
    padding: 2px 6px;
    border-radius: 99px;
    color: var(--muted);
    background: #fff;
    font-size: 8px;
    letter-spacing: 0;
}

.attempt-sequence {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
}

.attempt-chip {
    min-width: 0;
    padding: 4px 7px 4px 5px;
    border: 1px solid var(--line);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    animation: reveal-rise .45s var(--bounce) both;
}

.attempt-chip.is-latest {
    border-color: var(--aqua-200);
    box-shadow: 0 5px 14px rgba(6, 182, 212, .1);
}

.attempt-number {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: var(--aqua-700);
    background: var(--aqua-50);
    font-size: 9px;
    font-weight: 950;
}

.attempt-word {
    display: flex;
    gap: 3px;
}

.attempt-letter {
    width: clamp(19px, 1.8vw, 25px);
    height: clamp(19px, 1.8vw, 25px);
    border-radius: 6px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--absent);
    font-size: clamp(8px, .85vw, 11px);
    font-weight: 950;
}

.attempt-letter.G,
.attempt-dot.G {
    background: var(--success);
}

.attempt-letter.Y,
.attempt-dot.Y {
    color: #5f3900;
    background: var(--present);
}

.attempt-letter.B,
.attempt-dot.B {
    background: var(--absent);
}

.attempt-dots {
    display: none;
    gap: 3px;
}

.attempt-dot {
    width: 8px;
    height: 8px;
    border-radius: 3px;
    display: block;
}

.attempt-empty-copy {
    margin: 0;
    color: var(--muted);
    text-align: center;
    font-size: 11px;
}

.puzzle-tools {
    width: min(100%, 920px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
}

.puzzle-tool-wrap {
    position: relative;
}

.puzzle-tool,
.puzzle-round-note {
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid var(--aqua-200);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: var(--aqua-700);
    background: var(--aqua-50);
    font-size: 10px;
    font-weight: 900;
}

.puzzle-tool {
    transition: .18s var(--bounce);
}

.puzzle-tool:hover,
.puzzle-tool[aria-expanded="true"] {
    transform: translateY(-2px);
    background: var(--aqua-100);
    box-shadow: 0 8px 20px rgba(6, 182, 212, .13);
}

.puzzle-tool .ui-icon,
.puzzle-round-note .ui-icon {
    width: 15px;
    height: 15px;
}

.puzzle-round-note {
    margin-left: auto;
    border-color: var(--line);
    color: var(--muted);
    background: #fff;
}

.puzzle-popover {
    position: absolute;
    z-index: 70;
    left: 0;
    bottom: calc(100% + 10px);
    width: min(310px, calc(100vw - 32px));
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 20px;
    color: var(--ink);
    background: rgba(255, 255, 255, .98);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(15px);
    animation: popover-in .25s var(--bounce);
}

.puzzle-popover.spark-popover {
    width: min(340px, calc(100vw - 32px));
    display: grid;
    grid-template-columns: 42px 1fr;
    align-items: center;
    gap: 11px;
    background: linear-gradient(145deg, #f5f3ff, var(--aqua-50));
}

.puzzle-popover strong {
    display: block;
    padding-right: 24px;
    font-size: 13px;
}

.puzzle-popover p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
}

.puzzle-popover-icon {
    width: 42px;
    height: 42px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(145deg, var(--aqua-500), #7c3aed);
    animation: star-spin 4s ease-in-out infinite;
}

.puzzle-popover-close {
    position: absolute;
    right: 8px;
    top: 8px;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: var(--muted);
    background: transparent;
}

.puzzle-popover-close:hover {
    color: var(--ink);
    background: var(--surface-soft);
}

.compact-legend {
    margin-top: 12px;
}

.compact-legend .legend-tile {
    width: 28px;
    height: 28px;
    border-radius: 8px;
}

.puzzle-result-state {
    padding: clamp(12px, 2vh, 24px) clamp(14px, 2.4vw, 34px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    align-content: center;
    gap: clamp(10px, 1.7vh, 18px);
}

.result-celebration {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    text-align: left;
    animation: result-pop .6s var(--bounce);
}

.result-celebration-icon {
    width: clamp(54px, 5vw, 70px);
    height: clamp(54px, 5vw, 70px);
    border-radius: 22px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: #fff;
    background: linear-gradient(145deg, var(--success), var(--success-dark));
    box-shadow: 0 14px 28px rgba(34, 197, 94, .22);
    animation: victory-wobble 1.2s .35s var(--bounce);
}

.result-celebration.failed .result-celebration-icon {
    background: linear-gradient(145deg, var(--orange-400), var(--orange-600));
    box-shadow: 0 14px 28px rgba(249, 115, 22, .22);
}

.result-celebration-icon .ui-icon {
    width: 30px;
    height: 30px;
}

.result-celebration h2 {
    margin: 3px 0 4px;
    font-size: clamp(28px, 3vw, 44px);
    line-height: 1;
    letter-spacing: -.055em;
}

.result-celebration p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.result-learning-grid {
    min-height: 0;
    width: min(100%, 1020px);
    margin: auto;
    display: grid;
    grid-template-columns: minmax(300px, .82fr) minmax(360px, 1.18fr);
    align-items: stretch;
    gap: clamp(12px, 1.8vw, 22px);
}

.result-answer-card,
.puzzle-result-state .word-reveal {
    min-height: 0;
    margin: 0;
    padding: clamp(16px, 2vw, 24px);
    border-radius: 24px;
    overflow: hidden;
}

.result-answer-card {
    border: 1px solid #bbf7d0;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 15px;
    background: linear-gradient(145deg, #f0fdf4, #fff);
}

.result-word-row {
    width: min(100%, 360px);
}

.result-rewards {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.result-rewards span {
    padding: 8px 10px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    background: #fff;
    font-size: 10px;
    font-weight: 800;
}

.result-rewards .ui-icon {
    width: 14px;
    height: 14px;
    color: var(--orange-500);
}

.puzzle-result-state .word-reveal {
    display: grid;
    align-content: center;
}

.puzzle-result-state .word-reveal h2 {
    font-size: clamp(24px, 2.4vw, 34px);
}

.puzzle-result-state .word-reveal .definition-copy {
    max-height: 4.6em;
    overflow: hidden;
    font-size: clamp(13px, 1.2vw, 16px);
    line-height: 1.48;
}

.puzzle-result-state .word-reveal .example-copy {
    max-height: 3.4em;
    overflow: hidden;
    margin-top: 9px;
    padding: 9px 12px;
    font-size: 11px;
}

.puzzle-result-actions {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.puzzle-result-actions .btn {
    min-width: 170px;
}

@keyframes popover-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(.96);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 1180px) and (min-width: 901px) {
    .puzzle-toolbar {
        grid-template-columns: minmax(170px, 1fr) auto minmax(170px, 1fr);
    }

    .puzzle-toolbar-stats .pill {
        padding-inline: 9px;
        font-size: 10px;
    }

    .attempt-chip:not(.is-latest) .attempt-word {
        display: none;
    }

    .attempt-chip:not(.is-latest) .attempt-dots {
        display: flex;
    }
}

@media (max-height: 800px) and (min-width: 901px) {
    :root {
        --game-topbar-height: 58px;
    }

    .game-focus .app-content {
        padding-block: 8px;
    }

    .puzzle-toolbar {
        min-height: 54px;
        padding-block: 7px;
    }

    .puzzle-playing-state,
    .puzzle-result-state {
        padding-block: 9px;
        gap: 7px;
    }

    .puzzle-clue-card {
        max-height: 112px;
        padding-block: 11px;
    }

    .puzzle-clue-card .clue-text {
        font-size: clamp(17px, 1.75vw, 22px);
    }

    .active-guess-row {
        width: min(clamp(235px, 25vw, 325px), 90vw);
    }

    .active-guess-row .game-tile {
        font-size: clamp(17px, 1.8vw, 23px);
    }

    .guess-input {
        height: 46px;
    }

    .puzzle-guess-form .btn {
        min-height: 46px;
    }

    .attempt-trail {
        min-height: 42px;
        padding-block: 6px;
    }

    .attempt-trail-head {
        margin-bottom: 5px;
    }

    .puzzle-tool,
    .puzzle-round-note {
        min-height: 34px;
    }

    .result-celebration-icon {
        width: 52px;
        height: 52px;
        border-radius: 18px;
    }

    .result-celebration h2 {
        font-size: clamp(27px, 2.6vw, 36px);
    }

    .result-answer-card,
    .puzzle-result-state .word-reveal {
        padding: 14px 17px;
    }
}

@media (max-width: 900px) {
    :root {
        --game-topbar-height: 58px;
    }

    body.game-focus {
        min-height: 0;
    }

    .game-focus .app-shell {
        height: 100dvh;
        display: block;
    }

    .game-focus .app-main {
        height: 100dvh;
        grid-template-rows: var(--game-topbar-height) minmax(0, 1fr);
    }

    .game-focus .app-topbar {
        height: var(--game-topbar-height);
        padding-inline: 12px;
    }

    .game-focus .app-content {
        height: auto;
        min-height: 0;
        padding: 7px 9px max(7px, env(safe-area-inset-bottom));
    }

    .puzzle-stage {
        border-radius: 21px;
    }

    .puzzle-toolbar {
        min-height: 50px;
        padding: 7px 10px;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
    }

    .puzzle-mode-icon {
        width: 34px;
        height: 34px;
        border-radius: 12px;
    }

    .puzzle-mode-icon .ui-icon {
        width: 17px;
        height: 17px;
    }

    .puzzle-mode-title {
        gap: 8px;
    }

    .puzzle-mode-title strong {
        font-size: 13px;
    }

    .puzzle-mode-title small {
        font-size: 8px;
    }

    .puzzle-toolbar-progress {
        justify-items: end;
    }

    .puzzle-toolbar-progress .progress-track {
        width: 75px;
    }

    .puzzle-toolbar-stats {
        display: none;
    }

    .puzzle-playing-state {
        padding: 9px 10px;
        grid-template-rows: minmax(72px, 1fr) auto auto auto auto;
        gap: 7px;
    }

    .puzzle-clue-card {
        max-height: 118px;
        padding: 11px 13px;
        border-radius: 17px;
    }

    .puzzle-clue-card::after {
        font-size: 38px;
        right: 10px;
    }

    .puzzle-clue-card .clue-text {
        max-height: 3.2em;
        margin-top: 7px;
        font-size: clamp(16px, 5vw, 20px);
    }

    .active-guess-wrap {
        gap: 5px;
    }

    .active-guess-row {
        width: min(76vw, 300px);
        gap: 5px;
    }

    .active-guess-row .game-tile {
        border-radius: 9px;
        font-size: 18px;
    }

    .puzzle-guess-form {
        width: 100%;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 7px;
    }

    .puzzle-guess-form .guess-input {
        height: 46px;
        padding-inline: 11px;
        border-radius: 13px;
        text-align: left;
        letter-spacing: .08em;
        font-size: 12px;
    }

    .puzzle-guess-form .btn {
        min-height: 46px;
        padding-inline: 13px;
        border-radius: 13px;
        font-size: 11px;
    }

    .attempt-trail {
        width: 100%;
        min-height: 45px;
        padding: 6px 8px;
        border-radius: 15px;
    }

    .attempt-trail-head {
        margin-bottom: 5px;
        font-size: 8px;
    }

    .attempt-sequence {
        flex-wrap: nowrap;
        gap: 5px;
    }

    .attempt-chip {
        padding: 3px 5px 3px 3px;
        gap: 4px;
    }

    .attempt-chip:not(.is-latest) .attempt-word {
        display: none;
    }

    .attempt-chip:not(.is-latest) .attempt-dots {
        display: flex;
    }

    .attempt-number {
        width: 19px;
        height: 19px;
        font-size: 8px;
    }

    .attempt-letter {
        width: clamp(16px, 5vw, 21px);
        height: clamp(16px, 5vw, 21px);
        border-radius: 5px;
        font-size: 8px;
    }

    .attempt-dot {
        width: 6px;
        height: 6px;
        border-radius: 2px;
    }

    .attempt-empty-copy {
        font-size: 9px;
    }

    .puzzle-tools {
        width: 100%;
        gap: 6px;
    }

    .puzzle-tool,
    .puzzle-round-note {
        min-height: 34px;
        padding-inline: 10px;
        font-size: 9px;
    }

    .puzzle-round-note {
        margin-left: auto;
    }

    .puzzle-popover {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: max(10px, env(safe-area-inset-bottom));
        width: auto;
    }

    .puzzle-result-state {
        padding: 9px 10px;
        gap: 8px;
    }

    .result-celebration {
        gap: 10px;
    }

    .result-celebration-icon {
        width: 47px;
        height: 47px;
        border-radius: 16px;
    }

    .result-celebration-icon .ui-icon {
        width: 23px;
        height: 23px;
    }

    .result-celebration h2 {
        font-size: 25px;
    }

    .result-celebration p {
        font-size: 10px;
    }

    .result-learning-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .result-answer-card,
    .puzzle-result-state .word-reveal {
        padding: 11px 13px;
        border-radius: 17px;
    }

    .result-answer-card {
        gap: 8px;
    }

    .result-word-row {
        width: min(72vw, 285px);
    }

    .result-word-row .game-tile {
        font-size: 17px;
        border-radius: 8px;
    }

    .result-rewards span {
        padding: 5px 8px;
        font-size: 8px;
    }

    .puzzle-result-state .word-reveal {
        display: block;
    }

    .puzzle-result-state .word-reveal-head {
        gap: 7px;
    }

    .puzzle-result-state .word-reveal h2 {
        font-size: 22px;
    }

    .puzzle-result-state .speak-button {
        width: 34px;
        height: 34px;
        border-radius: 11px;
    }

    .puzzle-result-state .word-reveal .definition-copy {
        margin-top: 7px;
        max-height: 3.1em;
        font-size: 12px;
    }

    .puzzle-result-state .word-reveal .example-copy {
        max-height: 2.9em;
        margin-top: 6px;
        padding: 6px 8px;
        font-size: 9px;
    }

    .puzzle-result-actions {
        gap: 7px;
    }

    .puzzle-result-actions .btn {
        min-width: 0;
        flex: 1;
        min-height: 43px;
        padding-inline: 11px;
        font-size: 10px;
    }
}

@media (max-height: 700px) and (min-width: 901px) {
    .puzzle-toolbar {
        min-height: 48px;
    }

    .puzzle-mode-icon {
        width: 34px;
        height: 34px;
    }

    .puzzle-playing-state {
        grid-template-rows: minmax(65px, 1fr) auto auto auto auto;
    }

    .puzzle-clue-card {
        max-height: 92px;
    }

    .puzzle-clue-card .clue-label {
        display: none;
    }

    .puzzle-clue-card .clue-text {
        margin-top: 0;
        max-height: 2.8em;
        font-size: 17px;
    }

    .active-guess-row {
        width: min(285px, 31vw);
    }

    .attempt-trail-head {
        display: none;
    }

    .attempt-chip:not(.is-latest) .attempt-word {
        display: none;
    }

    .attempt-chip:not(.is-latest) .attempt-dots {
        display: flex;
    }
}

body.native-keyboard-open {
    --game-topbar-height: 46px;
}

.native-keyboard-open .game-focus .app-topbar,
.native-keyboard-open .app-topbar {
    height: var(--game-topbar-height);
}

.native-keyboard-open .puzzle-toolbar {
    min-height: 40px;
    padding-block: 4px;
}

.native-keyboard-open .puzzle-mode-icon {
    width: 30px;
    height: 30px;
}

.native-keyboard-open .puzzle-mode-title small,
.native-keyboard-open .puzzle-toolbar-progress span:first-child {
    display: none;
}

.native-keyboard-open .puzzle-playing-state {
    padding-block: 5px;
    grid-template-rows: minmax(50px, 1fr) auto auto;
    gap: 5px;
}

.native-keyboard-open .puzzle-clue-card {
    max-height: 72px;
    padding-block: 7px;
}

.native-keyboard-open .puzzle-clue-card .clue-label {
    display: none;
}

.native-keyboard-open .puzzle-clue-card .clue-text {
    margin-top: 0;
    max-height: 2.7em;
    font-size: 14px;
}

.native-keyboard-open .active-guess-label {
    display: none;
}

.native-keyboard-open .active-guess-row {
    width: min(68vw, 250px);
}

.native-keyboard-open .attempt-trail,
.native-keyboard-open .puzzle-tools {
    display: none;
}

/* SPELL NO-SCROLL PUZZLE STAGE: END */

/* SPELL APP-WIDE SIDEBAR AND PUZZLE FIT: START */
:root {
    --sidebar-collapsed: 82px;
    --puzzle-viewport-margin: clamp(8px, 1vw, 16px);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 11px;
}

.sidebar-brand-toggle {
    flex: 0 0 42px;
    padding: 0;
    border: 0;
    font: inherit;
}

.sidebar-brand-toggle:focus-visible {
    outline: 4px solid rgba(6, 182, 212, .23);
    outline-offset: 3px;
}

.sidebar-brand-name {
    min-width: 0;
    white-space: nowrap;
    transition: max-width .24s var(--ease), opacity .18s var(--ease), transform .24s var(--ease);
}

.streak-flame {
    flex: 0 0 39px;
    min-width: 39px;
    max-width: 39px;
}

.streak-flame .ui-icon {
    width: 21px;
    height: 21px;
}

@media (min-width: 901px) {

    .app-shell,
    .game-focus .app-shell {
        grid-template-columns: var(--sidebar) minmax(0, 1fr);
        transition: grid-template-columns .28s var(--ease);
    }

    .sidebar,
    .game-focus .sidebar {
        width: var(--sidebar);
        padding-inline: 18px;
        overflow: hidden;
        transition: width .28s var(--ease), padding .28s var(--ease);
    }

    .game-focus .sidebar-brand {
        justify-content: flex-start;
        padding: 0 10px 25px;
    }

    .game-focus .nav-link {
        justify-content: flex-start;
        padding-inline: 12px;
        gap: 11px;
    }

    .game-focus .streak-mini {
        justify-content: flex-start;
        padding: 15px;
    }

    .game-focus .user-mini {
        justify-content: flex-start;
        padding-inline: 9px;
    }

    .app-body.game-focus:not(.sidebar-collapsed) .nav-link>span:not(.nav-icon):not(.nav-badge),
    .app-body.game-focus:not(.sidebar-collapsed) .streak-mini>span:last-child,
    .app-body.game-focus:not(.sidebar-collapsed) .user-copy,
    .app-body.game-focus:not(.sidebar-collapsed) .logout-button {
        width: auto;
        opacity: 1;
        overflow: visible;
        pointer-events: auto;
    }

    .app-body.sidebar-collapsed .app-shell,
    .app-body.game-focus.sidebar-collapsed .app-shell {
        grid-template-columns: var(--sidebar-collapsed) minmax(0, 1fr);
    }

    .app-body.sidebar-collapsed .sidebar,
    .app-body.game-focus.sidebar-collapsed .sidebar {
        width: var(--sidebar-collapsed);
        padding-inline: 12px;
        overflow: visible;
    }

    .app-body.sidebar-collapsed .sidebar-brand {
        justify-content: center;
        padding-inline: 0;
    }

    .app-body.sidebar-collapsed .sidebar-brand-name,
    .app-body.sidebar-collapsed .nav-link>span:not(.nav-icon):not(.nav-badge),
    .app-body.sidebar-collapsed .streak-mini>span:last-child,
    .app-body.sidebar-collapsed .user-copy,
    .app-body.sidebar-collapsed .logout-button {
        width: 0;
        max-width: 0;
        opacity: 0;
        overflow: hidden;
        pointer-events: none;
    }

    .app-body.sidebar-collapsed .sidebar-brand-name {
        transform: translateX(-8px);
    }

    .app-body.sidebar-collapsed .nav-link {
        position: relative;
        justify-content: center;
        padding-inline: 0;
        gap: 0;
    }

    .app-body.sidebar-collapsed .nav-icon {
        flex: 0 0 36px;
    }

    .app-body.sidebar-collapsed .nav-badge {
        position: absolute;
        right: 3px;
        top: 5px;
        min-width: 18px;
        height: 18px;
        margin: 0;
        padding: 0 4px;
        font-size: 8px;
    }

    .app-body.sidebar-collapsed .streak-mini {
        justify-content: center;
        padding: 10px;
        gap: 0;
    }

    .app-body.sidebar-collapsed .user-mini {
        justify-content: center;
        padding-inline: 0;
        gap: 0;
    }

    .app-body.sidebar-collapsed .user-mini form {
        display: none;
    }
}

/* The parent padding provides the requested small viewport margin. */
.game-focus .app-content {
    width: 100%;
    max-width: none;
    height: 100%;
    min-height: 0;
    padding: var(--puzzle-viewport-margin);
    display: grid;
    overflow: hidden;
}

.puzzle-stage {
    width: 100%;
    max-width: none;
    height: 100%;
    min-width: 0;
    min-height: 0;
    margin: 0;
}

.puzzle-toolbar-stats {
    min-width: max-content;
}

.puzzle-playing-state {
    overflow: visible;
}

.puzzle-tools {
    z-index: 35;
    overflow: visible;
}

.puzzle-tool-wrap,
.puzzle-popover {
    z-index: 36;
}

@media (max-width: 900px) {
    .game-focus .app-content {
        height: 100%;
        padding: 7px 9px max(7px, env(safe-area-inset-bottom));
        display: grid;
    }

    .puzzle-stage {
        width: 100%;
        height: 100%;
    }
}

/* SPELL APP-WIDE SIDEBAR AND PUZZLE FIT: END */

/* SPELL AUDIT REMEDIATION: START */
.puzzle-toolbar-title {
    margin: 0;
    font-size: clamp(14px, 1.2vw, 17px);
    line-height: 1.1;
    letter-spacing: -.025em;
}

.result-celebration h2 {
    margin: 0 0 4px;
    font-size: clamp(30px, 3.2vw, 44px);
    line-height: 1;
    letter-spacing: -.055em;
}

.puzzle-stage {
    width: min(100%, 1280px);
}

.puzzle-playing-state {
    grid-template-rows: minmax(96px, auto) auto auto auto auto;
    align-content: center;
}

.puzzle-clue-card,
.puzzle-clue-card .clue-text,
.puzzle-result-state .word-reveal .definition-copy,
.puzzle-result-state .word-reveal .example-copy {
    scrollbar-width: thin;
    scrollbar-color: var(--aqua-300) transparent;
}

.puzzle-clue-card .clue-text {
    max-height: 4.15em;
    overflow: auto;
    overscroll-behavior: contain;
}

[data-fit-text].is-overflowing {
    padding-right: 5px;
    overflow: auto;
    overscroll-behavior: contain;
}

.puzzle-result-state .word-reveal .definition-copy {
    max-height: 6.2em;
    overflow: auto;
}

.puzzle-result-state .word-reveal .example-copy {
    max-height: 5.2em;
    overflow: auto;
}

.active-guess-row[data-length="9"],
.active-guess-row[data-length="10"],
.result-word-row[data-length="9"],
.result-word-row[data-length="10"] {
    width: min(100%, 500px);
    gap: 5px;
}

.active-guess-row[data-length="11"],
.active-guess-row[data-length="12"],
.result-word-row[data-length="11"],
.result-word-row[data-length="12"] {
    width: min(100%, 570px);
    gap: 4px;
}

.active-guess-row[data-length="9"] .game-tile,
.active-guess-row[data-length="10"] .game-tile,
.active-guess-row[data-length="11"] .game-tile,
.active-guess-row[data-length="12"] .game-tile,
.result-word-row[data-length="9"] .game-tile,
.result-word-row[data-length="10"] .game-tile,
.result-word-row[data-length="11"] .game-tile,
.result-word-row[data-length="12"] .game-tile {
    font-size: clamp(13px, 1.45vw, 20px);
    border-radius: 9px;
}

.review-word-heading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.review-complete-title {
    margin: 20px 0 8px;
    font-size: 34px;
    letter-spacing: -.05em;
}

.review-complete-copy {
    max-width: 520px;
    margin: 0 auto 22px;
    color: var(--muted);
    line-height: 1.65;
}

.puzzle-mode-icon,
.active-guess-row .game-tile,
.puzzle-popover-icon {
    animation-iteration-count: 2;
}

.hero-blob,
.floating-letter,
.floating-chip,
.auth-word-card,
.auth-orbit,
.auth-float,
.signup-tiles b,
.tiles-illustration b {
    animation-iteration-count: 3;
}

@media (min-width: 901px) {
    .app-body.sidebar-collapsed [data-tooltip] {
        position: relative;
    }

    .app-body.sidebar-collapsed [data-tooltip]::after {
        content: attr(data-tooltip);
        position: absolute;
        z-index: 120;
        left: calc(100% + 12px);
        top: 50%;
        min-width: max-content;
        padding: 8px 10px;
        border-radius: 10px;
        color: #fff;
        background: var(--ink);
        box-shadow: var(--shadow-sm);
        font-size: 11px;
        font-weight: 800;
        line-height: 1;
        opacity: 0;
        pointer-events: none;
        transform: translate(6px, -50%);
        transition: opacity .16s var(--ease), transform .16s var(--ease);
    }

    .app-body.sidebar-collapsed [data-tooltip]:hover::after,
    .app-body.sidebar-collapsed [data-tooltip]:focus-visible::after {
        opacity: 1;
        transform: translate(0, -50%);
    }

    .app-body.sidebar-collapsed .user-mini {
        flex-direction: column;
        gap: 7px;
    }

    .app-body.sidebar-collapsed .user-mini form {
        display: block;
    }

    .app-body.sidebar-collapsed .logout-button {
        width: 34px;
        max-width: 34px;
        height: 34px;
        opacity: 1;
        overflow: visible;
        pointer-events: auto;
    }
}

@media (min-width: 1161px) and (max-height: 800px) {
    .auth-panel {
        min-height: 0;
        padding-top: 20px;
        padding-bottom: 28px;
        overflow-y: auto;
        scrollbar-width: thin;
    }

    .signup-wrap h1 {
        margin-top: 10px;
        font-size: clamp(38px, 4vw, 48px);
    }

    .signup-wrap>p {
        margin-bottom: 16px;
        line-height: 1.5;
    }

    .signup-wrap .auth-form {
        gap: 10px;
    }

    .signup-wrap .form-field {
        height: 48px;
    }

    .signup-wrap .auth-switch {
        margin-top: 14px !important;
    }

    .signup-art {
        padding: 22px;
    }

    .signup-art .auth-word-card {
        width: min(100%, 455px);
        padding: 23px;
    }

    .signup-art .signup-tiles {
        margin: 16px 0;
    }

    .signup-art .signup-card h2 {
        font-size: 34px;
    }

    .signup-art .auth-definition {
        margin: 14px 0 10px;
        font-size: 16px;
    }

    .signup-art .mini-achievements {
        margin-top: 13px;
    }
}

@media (max-width: 900px) {
    .puzzle-playing-state {
        grid-template-rows: minmax(84px, auto) auto auto auto auto;
    }

    .puzzle-clue-card .clue-text {
        max-height: 4.25em;
    }

    .active-guess-row[data-length="9"],
    .active-guess-row[data-length="10"],
    .active-guess-row[data-length="11"],
    .active-guess-row[data-length="12"] {
        width: min(94vw, 460px);
        gap: 3px;
    }

    .active-guess-row[data-length="9"] .game-tile,
    .active-guess-row[data-length="10"] .game-tile,
    .active-guess-row[data-length="11"] .game-tile,
    .active-guess-row[data-length="12"] .game-tile {
        border-width: 1.5px;
        border-radius: 7px;
        font-size: clamp(11px, 3vw, 16px);
    }
}

@keyframes mascot-wave {

    0%,
    100% {
        transform: rotate(0) translateY(0);
    }

    35% {
        transform: rotate(-7deg) translateY(-2px);
    }

    65% {
        transform: rotate(7deg) translateY(-2px);
    }
}

/* SPELL AUDIT REMEDIATION: END */




/* SPELL COHESIVE DESKTOP REFINEMENT: START */
/* Storage-backed navigation should never visibly open before restoring state. */
.app-body:not(.sidebar-state-ready) .app-shell,
.app-body:not(.sidebar-state-ready) .sidebar,
.app-body:not(.sidebar-state-ready) .sidebar-brand-name {
    transition: none !important;
}

.sidebar-brand-toggle:hover {
    animation: spell-logo-bounce-rotate .72s var(--bounce);
}

/* Stronger, consistent action hierarchy. */
.btn-primary {
    color: #fff;
    border: 1px solid var(--aqua-600);
    background: linear-gradient(135deg, var(--aqua-500), var(--aqua-700));
    box-shadow: 0 12px 28px rgba(8, 145, 178, .3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--aqua-400), var(--aqua-700));
    box-shadow: 0 18px 38px rgba(8, 145, 178, .36);
}

.btn-soft,
.btn-secondary,
.btn-white {
    color: var(--aqua-800);
    border: 2px solid var(--aqua-400);
    background: #fff;
    box-shadow: 0 9px 22px rgba(6, 182, 212, .13);
}

.btn-soft:hover,
.btn-secondary:hover,
.btn-white:hover {
    color: var(--aqua-800);
    border-color: var(--aqua-600);
    background: var(--aqua-50);
    box-shadow: 0 14px 30px rgba(6, 182, 212, .2);
}

.btn-ghost {
    color: var(--aqua-800);
    border: 1px solid var(--aqua-200);
    background: rgba(236, 254, 255, .65);
}

.btn:disabled {
    opacity: .62;
    cursor: wait;
    transform: none;
}

/* The puzzle card fills every available pixel inside the existing margin. */
.puzzle-stage {
    width: 100%;
    max-width: none;
}

/* Use proportional vertical rhythm rather than tightly stacked fixed gaps. */
.puzzle-playing-state {
    grid-template-rows: auto auto auto minmax(48px, auto) auto;
    align-content: space-evenly;
    row-gap: clamp(10px, 1.8vh, 22px);
    padding: clamp(16px, 2.4vh, 30px) clamp(18px, 2.6vw, 38px);
}

.puzzle-clue-card {
    width: min(100%, 980px);
    max-height: clamp(112px, 20vh, 184px);
}

.active-guess-wrap {
    gap: clamp(8px, 1.1vh, 13px);
}

.puzzle-guess-form {
    width: min(100%, 720px);
    max-width: 720px;
}

.attempt-trail,
.puzzle-tools {
    width: min(100%, 1120px);
}

/* Help becomes visible content when the stage has enough real space. */
.puzzle-help-inline .puzzle-tools {
    display: grid;
    grid-template-columns: minmax(285px, .95fr) minmax(390px, 1.3fr) auto;
    align-items: stretch;
    gap: 12px;
}

.puzzle-help-inline .puzzle-tool-wrap {
    min-width: 0;
    display: flex;
}

.puzzle-help-inline .puzzle-tool {
    display: none;
}

.puzzle-help-inline .puzzle-popover {
    position: relative;
    inset: auto;
    width: 100%;
    min-height: 74px;
    padding: 12px 14px;
    border-color: var(--aqua-100);
    border-radius: 18px;
    display: block;
    box-shadow: none;
    animation: none;
}

.puzzle-help-inline .puzzle-popover.spark-popover {
    width: 100%;
    grid-template-columns: 36px 1fr;
    display: grid;
}

.puzzle-help-inline .puzzle-popover-icon {
    width: 36px;
    height: 36px;
    border-radius: 13px;
}

.puzzle-help-inline .puzzle-popover-close {
    display: none;
}

.puzzle-help-inline .puzzle-popover strong {
    padding-right: 0;
}

.puzzle-help-inline .compact-legend {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin-top: 8px;
}

.puzzle-help-inline .compact-legend .legend-item {
    gap: 6px;
    font-size: 10px;
}

.puzzle-help-inline .compact-legend .legend-tile {
    width: 27px;
    height: 27px;
    border-radius: 8px;
}

.puzzle-help-inline .puzzle-round-note {
    height: 100%;
    margin-left: 0;
    align-self: stretch;
}

/* Give the first Lexicon row room for its border, shadow and hover lift. */
.lexicon-grid {
    padding: 9px 3px 16px;
    margin: -9px -3px -16px;
}

.word-card {
    isolation: isolate;
}

/* Review progress represents completed cards, beginning at zero. */
.review-progress-head .progress-fill,
.puzzle-toolbar-progress .progress-fill {
    transition: width .45s var(--ease);
}

@media (max-height: 760px) and (min-width: 901px) {
    .puzzle-playing-state {
        row-gap: clamp(7px, 1.1vh, 11px);
        padding-block: 10px;
    }

    .puzzle-clue-card {
        max-height: 108px;
    }
}

@media (max-width: 900px) {
    .puzzle-playing-state {
        grid-template-rows: auto auto auto minmax(44px, auto) auto;
        align-content: space-evenly;
        row-gap: clamp(7px, 1.25vh, 12px);
        padding: 10px 11px;
    }

    .puzzle-clue-card {
        width: 100%;
    }

    .puzzle-help-inline .puzzle-tools {
        display: flex;
    }
}

@media (max-width: 620px) {
    .head-actions .btn {
        flex: 1 1 150px;
    }

    .review-progress-head {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        gap: 8px;
    }

    .review-progress-head .tiny-label {
        grid-column: 1 / -1;
        text-align: right;
    }

    .lexicon-grid {
        padding: 7px 1px 14px;
        margin: -7px -1px -14px;
    }
}

@keyframes spell-logo-bounce-rotate {

    0%,
    100% {
        transform: translateY(0) rotate(0) scale(1);
    }

    28% {
        transform: translateY(-8px) rotate(-10deg) scale(1.06);
    }

    55% {
        transform: translateY(1px) rotate(8deg) scale(1.08);
    }

    76% {
        transform: translateY(-3px) rotate(-4deg) scale(1.03);
    }
}

/* SPELL COHESIVE DESKTOP REFINEMENT: END */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .001ms !important;
    }

    [data-reveal] {
        opacity: 1;
        transform: none;
    }

    .confetti-layer {
        display: none;
    }
}

/* SPELL RESPONSIVE SPACING REMEDIATION: START */
/*
 * Authoritative responsive spacing rules.
 * These selectors intentionally live at the end of the shared stylesheet so
 * earlier historical patch declarations cannot stretch page content again.
 */

/* Keep the active puzzle interaction cohesive on ordinary screens. */
.puzzle-playing-state {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto auto auto;
    grid-template-areas:
        "clue"
        "guess"
        "form"
        "attempts"
        "tools";
    align-content: center;
    justify-items: center;
    row-gap: clamp(12px, 2.1vh, 30px);
}

.puzzle-clue-card {
    grid-area: clue;
}

.active-guess-wrap {
    grid-area: guess;
}

.puzzle-guess-form {
    grid-area: form;
}

.attempt-trail {
    grid-area: attempts;
}

.puzzle-tools {
    grid-area: tools;
}

/* Review uses the remaining desktop height rather than sitting at the top. */
.review-page .app-content {
    min-height: calc(100dvh - 76px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}

.review-page .review-shell {
    width: 100%;
    align-self: center;
}

/* Wide, data-rich pages receive their own canvases. */
@media (min-width: 1600px) {
    .dashboard-page .app-content {
        max-width: 1800px;
    }

    .dashboard-page .stats-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .dashboard-page .dashboard-lower {
        grid-template-columns: minmax(0, 1.6fr) minmax(380px, .4fr);
    }

    .lexicon-page .app-content {
        max-width: 1680px;
    }

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

@media (min-width: 2400px) {
    .dashboard-page .app-content {
        max-width: 1880px;
    }

    .lexicon-page .app-content {
        max-width: 1880px;
    }

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

/* Use ultrawide puzzle space structurally instead of stretching one column. */
@media (min-width: 1900px) and (min-height: 760px) {
    .puzzle-playing-state {
        grid-template-columns: minmax(620px, 1.35fr) minmax(420px, .65fr);
        grid-template-rows: auto auto auto;
        grid-template-areas:
            "clue attempts"
            "guess tools"
            "form tools";
        align-content: center;
        align-items: center;
        justify-items: stretch;
        column-gap: clamp(34px, 3.2vw, 72px);
        row-gap: clamp(18px, 2.2vh, 30px);
        padding-inline: clamp(34px, 3.6vw, 76px);
    }

    .puzzle-clue-card {
        width: 100%;
        max-width: none;
    }

    .active-guess-wrap,
    .puzzle-guess-form {
        width: min(100%, 780px);
        max-width: 780px;
        justify-self: center;
    }

    .attempt-trail,
    .puzzle-tools {
        width: 100%;
        max-width: none;
    }

    .attempt-trail {
        align-self: end;
    }

    .puzzle-tools {
        align-self: start;
    }

    .puzzle-help-inline .puzzle-tools {
        grid-template-columns: minmax(0, 1fr);
        align-content: start;
        gap: 12px;
    }

    .puzzle-help-inline .puzzle-round-note {
        min-height: 48px;
    }

    .puzzle-result-state .result-learning-grid {
        width: min(100%, 1500px);
    }
}

/* Compact laptop heights retain every control without cramped stacking. */
@media (max-height: 760px) and (min-width: 901px) {
    .puzzle-playing-state {
        row-gap: clamp(7px, 1.2vh, 12px);
    }
}

/* Mobile uses bounded spacing: tall phones do not become vertically sparse. */
@media (max-width: 900px) {
    .puzzle-playing-state {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto auto auto auto;
        grid-template-areas:
            "clue"
            "guess"
            "form"
            "attempts"
            "tools";
        align-content: start;
        row-gap: clamp(8px, 1.45vh, 18px);
        padding-top: clamp(20px, 4.5vh, 38px);
        padding-bottom: 10px;
    }

    .review-page .app-content {
        min-height: 0;
        display: block;
    }
}

/* Put the learning task above decorative/header space on narrow screens. */
@media (max-width: 620px) {

    .review-page .app-content,
    .lexicon-page .app-content {
        padding-top: 17px;
    }

    .review-page .page-head,
    .lexicon-page .page-head {
        margin-bottom: 13px;
    }

    .review-page .page-head h1,
    .lexicon-page .page-head h1 {
        margin-bottom: 6px;
        font-size: clamp(29px, 9vw, 34px);
    }

    .review-page .page-head p,
    .lexicon-page .page-head p {
        font-size: 12px;
        line-height: 1.45;
    }

    .review-page .head-actions,
    .lexicon-page .head-actions {
        width: 100%;
        margin-top: 10px;
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 8px;
    }

    .review-page .head-actions .pill,
    .review-page .head-actions .btn,
    .lexicon-page .head-actions .btn {
        width: 100%;
        min-height: 40px;
        padding-inline: 10px;
        justify-content: center;
        font-size: 10px;
    }

    .review-page .review-progress-head {
        margin-bottom: 10px;
    }

    .review-page .review-deck {
        min-height: 0;
    }

    .review-page .review-card {
        min-height: 420px;
        padding: 22px 16px;
    }

    .review-page .review-icon {
        width: 58px;
        height: 58px;
        margin-bottom: 13px;
        border-radius: 19px;
    }

    .review-page .review-definition {
        margin-bottom: 18px;
        font-size: clamp(22px, 7vw, 27px);
    }

    .lexicon-page .lexicon-toolbar {
        margin-bottom: 11px;
        padding: 10px;
        gap: 8px;
    }

    .lexicon-page .search-input {
        height: 44px;
    }

    .lexicon-page .lexicon-count {
        padding: 7px 10px;
        font-size: 10px;
    }

    .lexicon-page .lexicon-grid {
        padding-top: 4px;
    }
}

@media (max-width: 620px) and (max-height: 700px) {

    .review-page .page-head p,
    .lexicon-page .page-head p {
        display: none;
    }

    .review-page .page-head h1,
    .lexicon-page .page-head h1 {
        font-size: 28px;
    }

    .review-page .review-card {
        min-height: 380px;
        padding-block: 17px;
    }

    .review-page .review-icon {
        width: 50px;
        height: 50px;
        margin-bottom: 9px;
    }

    .review-page .review-prompt {
        margin-bottom: 9px;
    }
}

/* Reduced-motion users should never see delayed blank card positions. */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-delay: 0ms !important;
    }

    .stagger-card,
    [data-stagger-group]>* {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* SPELL RESPONSIVE SPACING REMEDIATION: END */

/* AJAX_PUZZLE_STAGE_START */
/* The shell remains stable while Django renders each authoritative state. */
[data-puzzle-stage] {
    view-transition-name: spell-puzzle-stage;
}

[data-puzzle-stage].is-updating {
    pointer-events: none;
}

[data-puzzle-stage].is-updating .puzzle-state,
[data-puzzle-stage].is-updating .puzzle-toolbar {
    opacity: .72;
    transition: opacity 160ms ease;
}

.puzzle-guess-form {
    position: relative;
}

[data-puzzle-stage].is-updating .puzzle-guess-form::after {
    content: "Checking…";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    display: grid;
    place-items: center;
    color: var(--aqua-800);
    background: rgba(255, 255, 255, .82);
    backdrop-filter: blur(4px);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .05em;
}

.puzzle-guess-form.is-update-error {
    animation: shake .42s var(--ease);
}

::view-transition-old(spell-puzzle-stage) {
    animation: puzzle-stage-out 150ms ease both;
}

::view-transition-new(spell-puzzle-stage) {
    animation: puzzle-stage-in 360ms var(--bounce) both;
}

@keyframes puzzle-stage-out {
    to {
        opacity: 0;
        transform: scale(.992);
    }
}

@keyframes puzzle-stage-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(.994);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {

    ::view-transition-old(spell-puzzle-stage),
    ::view-transition-new(spell-puzzle-stage) {
        animation: none !important;
    }
}

/* AJAX_PUZZLE_STAGE_END */