:root {
    --bg-top: #eff5ff;
    --bg-bottom: #b8d2ff;
    --surface: rgba(255, 255, 255, 0.82);
    --surface-strong: rgba(255, 255, 255, 0.94);
    --surface-soft: rgba(230, 239, 255, 0.8);
    --primary: #7390f3;
    --primary-strong: #5f7fea;
    --secondary: #ff8b6d;
    --secondary-strong: #f06f54;
    --ink: #17212b;
    --muted: #5d6874;
    --line: rgba(73, 108, 179, 0.18);
    --shadow-lg: 0 28px 64px rgba(64, 93, 150, 0.16);
    --shadow-md: 0 18px 36px rgba(64, 93, 150, 0.1);
    --radius-xl: 34px;
    --radius-lg: 24px;
    --radius-md: 18px;
    --transition: 180ms ease;
}

body.session-active .app-shell,
body.result-active .app-shell {
    width: 100%;
    max-width: none;
    padding: 0;
}

body.modal-open,
body.session-active,
body.result-active {
    overflow: hidden;
}

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

.screen--home {
    position: relative;
    gap: 32px;
    padding-top: 20px;
    padding-bottom: 20px;
    min-height: calc(100vh - 36px);
    align-content: start;
}

.home-top-actions {
    position: sticky;
    top: 18px;
    z-index: 4;
    display: flex;
    justify-content: end;
    gap: 12px;
}

.ghost-button--pill {
    padding-inline: 20px;
    border-radius: 999px;
    box-shadow: 0 10px 24px rgba(78, 108, 173, 0.12);
}

.home-top-actions .ghost-button,
#sessionSoundBtn {
    width: auto;
}

.home-top-actions .ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.utility-button {
    width: 48px;
    min-width: 48px;
    min-height: 48px;
    padding: 0;
    border-radius: 999px;
    font-size: 1.15rem;
    line-height: 1;
}

.utility-button--light {
    width: 40px;
    min-width: 40px;
    min-height: 40px;
    font-size: 1rem;
}

.home-decor {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.home-decor__emoji,
.home-decor__dot {
    position: absolute;
    opacity: 0.4;
}

.home-decor__emoji {
    font-size: clamp(2rem, 4vw, 3.4rem);
    animation: floatDecor 5s ease-in-out infinite;
}

.home-decor__emoji--left {
    top: 170px;
    left: 30px;
}

.home-decor__emoji--right {
    top: 110px;
    right: 70px;
    animation-delay: 1.2s;
}

.home-decor__emoji--bottom {
    right: 120px;
    bottom: 56px;
    animation-delay: 2.1s;
}

.home-decor__dot {
    border-radius: 999px;
    animation: pulseDecor 4.4s ease-in-out infinite;
}

.home-decor__dot--yellow {
    top: 270px;
    left: 64px;
    width: 28px;
    height: 28px;
    background: #ffe47d;
}

.home-decor__dot--pink {
    top: 62%;
    right: 34px;
    width: 24px;
    height: 24px;
    background: #ffc5d5;
    animation-delay: 0.8s;
}

.home-decor__dot--blue {
    bottom: 84px;
    left: 22%;
    width: 18px;
    height: 18px;
    background: #9ec7ff;
    animation-delay: 1.6s;
}

.hero {
    display: block;
    padding: 24px 28px 18px;
    text-align: center;
}

.brand {
    display: grid;
    justify-items: center;
    gap: 18px;
}

.brand__logo {
    width: clamp(110px, 16vw, 160px);
    height: clamp(110px, 16vw, 160px);
    border-radius: 38px;
}

.brand__copy {
    max-width: 44rem;
}

.brand__copy h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
}

.hero__text,
.section-text {
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.mode-section {
    padding: 28px;
}

.section-heading.section-heading--stack {
    display: grid;
    gap: 8px;
    justify-items: center;
    text-align: center;
}

.section-heading.section-heading--stack h2 {
    font-size: clamp(2rem, 4vw, 3rem);
}

.selection-grid {
    gap: 24px;
}

.mode-card {
    position: relative;
    justify-items: center;
    min-height: 308px;
    padding: 28px 24px;
    border-radius: 34px;
    box-shadow: 0 16px 34px rgba(67, 92, 144, 0.14);
    color: #fff;
    text-align: center;
    overflow: hidden;
}

.mode-card::after {
    content: "";
    position: absolute;
    inset: auto -20% -40% auto;
    width: 140px;
    height: 140px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    filter: blur(10px);
}

.mode-card--timed-lower {
    background: linear-gradient(135deg, #4c82f3 0%, #8a38ec 100%);
}

.mode-card--timed-upper {
    background: linear-gradient(135deg, #32c56d 0%, #2c87ed 100%);
}

.mode-card--timed-cursive {
    background: linear-gradient(135deg, #a84cf3 0%, #de2f84 100%);
}

.mode-card--free-lower {
    background: linear-gradient(135deg, #ff711e 0%, #f33b42 100%);
}

.mode-card--free-upper {
    background: linear-gradient(135deg, #25bfaf 0%, #1996d7 100%);
}

.mode-card--free-cursive {
    background: linear-gradient(135deg, #ef4c9b 0%, #e33162 100%);
}

.mode-card__icon {
    position: relative;
    z-index: 1;
    width: 78px;
    height: 78px;
    border-radius: 22px;
    background: linear-gradient(180deg, #6dd3ff 0%, #4a7cff 100%);
    box-shadow: 0 10px 22px rgba(18, 42, 92, 0.24);
    font-size: 1.9rem;
    line-height: 0.95;
}

.mode-card strong,
.mode-card__subtitle,
.mode-card__preview {
    position: relative;
    z-index: 1;
}

.mode-card strong {
    font-size: 1.7rem;
    line-height: 1.08;
    color: #fff;
}

.mode-card__subtitle {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
}

.mode-card__preview {
    width: min(100%, 220px);
    margin-top: 10px;
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.18);
    font-size: 1rem;
    line-height: 1.8;
}

.mode-card__preview p {
    margin: 0;
}

.mode-card__preview--cursive {
    font-family: "Maria Lucia", "Brush Script MT", "Segoe Script", cursive;
    font-size: 1.18rem;
}

.screen--session {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    overflow: hidden;
}

.screen--session::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 16% 10%, rgba(126, 167, 255, 0.12), transparent 16%),
        radial-gradient(circle at 84% 84%, rgba(255, 185, 214, 0.14), transparent 18%);
    pointer-events: none;
}

.session-header {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 72px 1fr auto;
    gap: 18px;
    align-items: start;
    padding: 20px 24px 24px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: linear-gradient(90deg, #4b84f4 0%, #9535eb 100%);
    color: #fff;
}

.screen--session[data-mode="free"] .session-header {
    background: linear-gradient(90deg, #ff8732 0%, #e83b94 100%);
}

.icon-button--light {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    backdrop-filter: blur(10px);
}

.ghost-button--light {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    backdrop-filter: blur(10px);
}

.session-center {
    display: grid;
    justify-items: center;
    gap: 6px;
}

.session-pill {
    margin: 0;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.session-timer {
    font-family: "Archivo", sans-serif;
    font-size: clamp(2.4rem, 5vw, 4rem);
    line-height: 1;
    color: #ffe35c;
    text-shadow: 0 4px 16px rgba(75, 36, 145, 0.2);
}

.session-caption,
.session-letter-label {
    margin: 0;
}

.session-caption {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
}

.session-letter-label {
    font-size: 0.92rem;
    opacity: 0.9;
    color: #fff;
}

.session-side {
    display: grid;
    justify-items: end;
    gap: 12px;
}

.session-tool-stack {
    display: grid;
    justify-items: end;
    gap: 8px;
}

.orientation-button {
    display: none;
}

.session-scoreboard {
    text-align: right;
}

.session-scoreboard__value {
    font-family: "Archivo", sans-serif;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    line-height: 1;
    font-weight: 800;
}

.session-scoreboard__label,
.session-scoreboard__line {
    margin-top: 4px;
}

.session-scoreboard__label {
    font-size: 0.96rem;
    opacity: 0.9;
}

.session-scoreboard__line {
    font-size: 0.95rem;
    font-weight: 700;
    color: #cbd7ff;
}

.session-scoreboard__line--success {
    color: #8eff9e;
}

.screen--session[data-mode="free"] .session-scoreboard__line--success {
    display: none;
}

.word-stage {
    position: relative;
    z-index: 1;
    flex: 1;
    display: grid;
    place-items: center;
    padding: 28px 24px 160px;
    text-align: center;
    border: 0;
    box-shadow: none;
    background: transparent;
}

.word-display {
    max-width: 14ch;
    font-size: clamp(3.6rem, 10vw, 7.2rem);
    line-height: 1.02;
    color: #1d2840;
    text-shadow: 0 6px 16px rgba(30, 42, 63, 0.1);
}

.word-display.is-cursive {
    font-size: clamp(4rem, 10vw, 7.4rem);
}

.helper-text {
    margin-top: 18px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #8a92a2;
}

.session-actions {
    position: fixed;
    inset: auto 24px 24px 24px;
    z-index: 6;
    display: flex;
    justify-content: space-between;
    align-items: end;
    pointer-events: none;
}

.session-actions__right {
    display: flex;
    align-items: end;
    gap: 16px;
    pointer-events: auto;
}

.floating-button {
    pointer-events: auto;
    color: #fff;
    box-shadow: 0 18px 38px rgba(46, 69, 111, 0.25);
}

.floating-button--next {
    min-width: 128px;
    min-height: 128px;
    padding: 20px;
    border-radius: 999px;
    background: linear-gradient(135deg, #2fc86f 0%, #388cf5 100%);
    display: grid;
    place-items: center;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 800;
    text-transform: uppercase;
}

.screen--session[data-mode="free"] .floating-button--next {
    background: linear-gradient(135deg, #ff8e32 0%, #e93f94 100%);
}

.floating-button__icon {
    display: block;
    margin-bottom: 6px;
    font-size: 2rem;
    line-height: 1;
}

.floating-button--skip {
    width: 74px;
    height: 74px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff5952 0%, #ff2f57 100%);
    display: grid;
    place-items: center;
    font-size: 2rem;
    font-weight: 800;
}

.floating-button--finish {
    min-height: 56px;
    padding: 0 22px;
    border-radius: 999px;
    background: linear-gradient(135deg, #31c87e 0%, #19a8c0 100%);
    font-weight: 700;
}

.screen--session[data-mode="timed"] .floating-button--finish {
    opacity: 0;
    transform: translateY(16px);
    pointer-events: none;
}

.screen--result {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: linear-gradient(135deg, #44c77f 0%, #4d88f6 45%, #8f48ea 100%);
}

.result-card {
    width: min(100%, 720px);
    background: rgba(255, 255, 255, 0.92);
}

.result-actions {
    gap: 12px;
}

.primary-button {
    background: linear-gradient(135deg, #4c82f3 0%, #7b49ea 100%);
    color: #fff;
}

.modal__panel {
    width: min(100% - 28px, 720px);
    margin-top: 6vh;
    background: rgba(255, 255, 255, 0.96);
}

.modal__subtitle {
    margin: 0 0 12px;
    font-weight: 700;
    color: #416ddd;
}

.benchmark-row {
    background: linear-gradient(135deg, #f1f6ff 0%, #f7f0ff 100%);
}

@keyframes floatDecor {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulseDecor {
    0%,
    100% {
        transform: scale(1);
        opacity: 0.35;
    }

    50% {
        transform: scale(1.12);
        opacity: 0.56;
    }
}

@media (hover: hover) {
    .floating-button:hover,
    .mode-card:hover {
        transform: translateY(-2px) scale(1.01);
    }
}

@media (max-width: 1080px) {
    .selection-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .home-top-actions {
        position: static;
        justify-content: center;
        flex-wrap: wrap;
    }

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

    .session-header {
        grid-template-columns: 56px 1fr;
    }

    .session-side {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-items: center;
    }

    .session-scoreboard {
        text-align: center;
    }
}

@media (max-width: 720px) {
    .hero,
    .mode-section,
    .result-card,
    .modal__panel {
        border-radius: 28px;
        padding: 22px;
    }

    .brand__copy h1 {
        font-size: clamp(2.1rem, 10vw, 3rem);
    }

    .mode-card {
        min-height: 274px;
        padding: 24px 20px;
    }

    .mode-card strong {
        font-size: 1.45rem;
    }

    .session-header {
        padding: 16px 16px 20px;
    }

    .session-pill,
    .session-letter-label {
        display: none;
    }

    .session-caption {
        font-size: 0.92rem;
    }

    .session-side {
        gap: 8px;
    }

    .session-tool-stack {
        justify-items: center;
    }

    .orientation-button {
        display: inline-flex;
    }

    #sessionSoundBtn {
        min-height: 38px;
        min-width: 38px;
        padding: 0;
        font-size: 0.92rem;
    }

    .word-stage {
        padding: 20px 16px 134px;
    }

    .word-display {
        font-size: clamp(3rem, 13vw, 4.8rem);
    }

    .word-display.is-cursive {
        font-size: clamp(3.2rem, 13vw, 5.2rem);
    }

    .helper-text {
        font-size: 0.78rem;
    }

    .session-actions {
        left: 16px;
        right: 16px;
        bottom: calc(16px + env(safe-area-inset-bottom));
    }

    .session-actions__right {
        gap: 12px;
    }

    .floating-button--next {
        min-width: 108px;
        min-height: 108px;
        font-size: 1rem;
    }

    .floating-button__icon {
        font-size: 1.7rem;
    }

    .floating-button--skip {
        width: 62px;
        height: 62px;
        font-size: 1.7rem;
    }

    .floating-button--finish {
        min-height: 48px;
        padding-inline: 18px;
    }
}

@media (min-width: 900px) and (max-height: 760px) {
    .screen--home { gap: 15px; padding-top: 14px; padding-bottom: 18px; }
    .home-top-actions { top: 10px; }
    .hero { padding: 12px 24px 10px; }
    .brand__copy--home h1 { font-size: clamp(2.2rem, 4vw, 3.35rem); }
    .setup-panel { gap: 11px; padding: 15px 20px; }
    .setup-group { gap: 7px; }
    .option-card { min-height: 82px; padding: 9px 12px; gap: 5px; }
    .option-card__icon { width: 44px; height: 44px; border-radius: 14px; }
    .home-footer { padding-top: 0; }
}

@media (min-width: 900px) and (max-height: 760px) {
    .screen--home {
        gap: 15px;
        padding-top: 14px;
        padding-bottom: 18px;
    }

    .home-top-actions {
        top: 10px;
    }

    .hero {
        padding: 12px 24px 10px;
    }

    .brand__copy--home h1 {
        font-size: clamp(2.2rem, 4vw, 3.35rem);
    }

    .setup-panel {
        gap: 11px;
        padding: 15px 20px;
    }

    .setup-group {
        gap: 7px;
    }

    .option-card {
        min-height: 82px;
        padding: 9px 12px;
        gap: 5px;
    }

    .option-card__icon {
        width: 44px;
        height: 44px;
        border-radius: 14px;
    }

    .home-footer {
        padding-top: 0;
    }
}

/* Sessao 3 - entrada simplificada */
.brand-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 24px rgba(78, 108, 173, 0.12);
}

.brand-link img {
    display: block;
    width: 104px;
    height: auto;
}

.home-top-actions {
    justify-content: space-between;
    align-items: center;
}

.home-top-actions__group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand--home {
    justify-items: center;
}

.brand__copy--home {
    max-width: none;
    text-align: center;
}

.brand__copy--home h1 {
    font-size: clamp(2rem, 4vw, 3.2rem);
    color: #356fd0;
}

.hero__subheading {
    margin: 8px 0 0;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #6f86b6;
}

.hero__text {
    display: none;
}

.setup-panel {
    display: grid;
    gap: 18px;
    padding: 20px;
    border-radius: 30px;
    background:
        radial-gradient(circle at top right, rgba(255, 211, 140, 0.28), transparent 28%),
        radial-gradient(circle at bottom left, rgba(143, 195, 255, 0.22), transparent 26%),
        rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.56);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(14px);
}

.setup-group {
    display: grid;
    gap: 12px;
}

.setup-group__label {
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #4473d8;
}

.setup-options {
    display: grid;
    gap: 12px;
}

.setup-options--letters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.setup-options--mode {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.option-card {
    display: grid;
    justify-items: center;
    gap: 8px;
    min-height: 108px;
    padding: 16px 12px;
    border: 1px solid rgba(115, 144, 243, 0.18);
    border-radius: 24px;
    background: rgba(245, 249, 255, 0.82);
    color: var(--ink);
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition);
}

.option-card.is-selected {
    background: linear-gradient(135deg, rgba(76, 130, 243, 0.22), rgba(255, 140, 109, 0.2));
    border-color: rgba(76, 130, 243, 0.36);
    box-shadow: var(--shadow-md);
}

.option-card__icon {
    display: inline-grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    font-family: "Archivo", sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #3f63bc;
    box-shadow: 0 10px 20px rgba(90, 120, 185, 0.12);
}

.option-card__icon--cursive {
    font-family: "Maria Lucia", "Brush Script MT", "Segoe Script", cursive;
    font-size: 1.9rem;
}

.option-card__label {
    font-family: "Archivo", sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    text-align: center;
}

.option-card--mode .option-card__icon {
    font-size: 1.7rem;
}

.start-session-button {
    justify-self: center;
    width: min(100%, 260px);
}

.home-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding-top: 2px;
}

.home-footer p {
    margin: 0;
    color: rgba(23, 33, 43, 0.64);
    font-size: 0.84rem;
    line-height: 1.35;
}

.home-footer__logo {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 14px;
    box-shadow: 0 12px 24px rgba(73, 108, 179, 0.14);
}

body.is-fullscreen .home-top-actions,
body.is-fullscreen .home-decor,
body.is-fullscreen .home-footer {
    display: none !important;
}

body.is-fullscreen .screen--home {
    min-height: 100vh;
    padding-top: 18px;
    padding-bottom: 18px;
}

@media (hover: hover) {
    .option-card:hover {
        transform: translateY(-2px);
    }
}

@media (max-width: 860px) {
    .home-top-actions {
        justify-content: space-between;
    }

    .home-top-actions__group {
        flex-wrap: wrap;
        justify-content: end;
    }
}

@media (max-width: 720px) {
    .screen--home {
        gap: 22px;
        padding-top: 14px;
        padding-bottom: 14px;
    }

    .brand-link img {
        width: 92px;
    }

    .setup-panel {
        padding: 18px;
        border-radius: 26px;
    }

    .setup-options--letters,
    .setup-options--mode {
        grid-template-columns: 1fr;
    }

    .option-card {
        min-height: 92px;
        grid-template-columns: auto 1fr;
        justify-items: start;
        align-items: center;
        gap: 12px;
        text-align: left;
    }

    .option-card__label {
        text-align: left;
    }

    .home-footer {
        gap: 10px;
    }

    .home-footer p {
        font-size: 0.78rem;
    }

    .home-footer__logo {
        width: 36px;
        height: 36px;
    }
}

@media (orientation: landscape) and (max-width: 960px) {
    .session-header {
        grid-template-columns: 56px 1fr auto;
        align-items: center;
    }

    .session-side {
        grid-column: auto;
        grid-row: auto;
        justify-items: end;
    }

    .session-tool-stack {
        justify-items: end;
    }

    .word-stage {
        padding: 16px 18px 104px;
    }

    .word-display {
        font-size: clamp(2.4rem, 7vw, 4rem);
    }

    .floating-button--next {
        min-width: 92px;
        min-height: 92px;
    }

    .floating-button--skip {
        width: 56px;
        height: 56px;
    }
}

@font-face {
    font-family: "Maria Lucia";
    src: url("../../assets/fonts/Maria_lucia.woff2") format("woff2");
    font-weight: normal;
    font-style: normal;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: "Inter", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.96), transparent 24%),
        linear-gradient(180deg, var(--bg-top) 0%, #dce9ff 42%, var(--bg-bottom) 100%);
}

body.modal-open {
    overflow: hidden;
}

button {
    font: inherit;
}

.hidden {
    display: none !important;
}

.app-shell {
    width: min(100%, 1240px);
    min-height: 100vh;
    margin: 0 auto;
    padding: 18px;
}

.screen {
    min-height: calc(100vh - 36px);
}

.screen--home {
    display: grid;
    gap: 24px;
}

.hero,
.info-card,
.mode-section,
.session-header,
.stats-grid,
.word-stage,
.control-bar,
.result-card,
.modal__panel {
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.56);
    box-shadow: var(--shadow-lg);
    background: var(--surface);
    backdrop-filter: blur(14px);
}

.hero {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
    padding: 28px;
}

.brand {
    display: flex;
    gap: 20px;
    align-items: center;
}

.brand__logo {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 28px;
    box-shadow: var(--shadow-md);
}

.brand__copy {
    display: grid;
    gap: 10px;
    max-width: 48rem;
}

.eyebrow {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #4473d8;
}

.brand__copy h1,
.section-heading h2,
.session-meta h2,
.result-card h2,
.modal__header h2,
.info-card h2 {
    margin: 0;
    font-family: "Archivo", sans-serif;
    line-height: 1;
}

.brand__copy h1 {
    font-size: clamp(2.4rem, 5vw, 4.2rem);
}

.hero__text,
.section-text,
.helper-text,
.result-summary,
.modal__content p,
.bullet-list li {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.hero__actions,
.control-bar,
.result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.ghost-button,
.primary-button,
.secondary-button,
.mode-card,
.icon-button {
    border: 0;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition), opacity var(--transition);
}

.ghost-button,
.primary-button,
.secondary-button {
    min-height: 48px;
    padding: 0 18px;
    border-radius: 16px;
    font-weight: 700;
}

.ghost-button {
    background: var(--surface-soft);
    color: var(--ink);
}

.ghost-button--small {
    min-height: 40px;
    padding-inline: 14px;
}

.primary-button {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
    color: white;
}

.secondary-button {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-strong) 100%);
    color: white;
}

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

.info-card,
.mode-section {
    padding: 24px;
}

.info-card {
    display: grid;
    gap: 16px;
}

.bullet-list {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 8px;
}

.benchmark-grid {
    display: grid;
    gap: 10px;
}

.benchmark-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--line);
}

.benchmark-row strong {
    font-family: "Archivo", sans-serif;
    font-size: 1rem;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: end;
}

.section-heading h2 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
}

.section-text {
    max-width: 28rem;
}

.selection-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 22px;
}

.mode-card {
    display: grid;
    gap: 10px;
    justify-items: start;
    min-height: 210px;
    padding: 22px;
    border-radius: 26px;
    background: linear-gradient(180deg, rgba(119, 144, 243, 0.18), rgba(255, 255, 255, 0.9));
    border: 1px solid rgba(115, 144, 243, 0.2);
    box-shadow: var(--shadow-md);
    color: var(--ink);
    text-align: left;
}

.mode-card--warm {
    background: linear-gradient(180deg, rgba(255, 139, 109, 0.16), rgba(255, 255, 255, 0.92));
    border-color: rgba(255, 139, 109, 0.2);
}

.mode-card__icon {
    display: inline-grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
    font-family: "Archivo", sans-serif;
    font-size: 1.65rem;
    font-weight: 700;
}

.mode-card__icon--cursive {
    font-family: "Maria Lucia", "Brush Script MT", "Segoe Script", cursive;
    font-size: 2rem;
}

.mode-card strong {
    font-family: "Archivo", sans-serif;
    font-size: 1.2rem;
}

.mode-card span:last-child {
    color: var(--muted);
}

.screen--session {
    display: grid;
    gap: 20px;
    grid-template-rows: auto auto 1fr auto;
}

.session-header,
.stats-grid,
.control-bar {
    padding: 18px 20px;
}

.session-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.session-meta {
    flex: 1;
    text-align: center;
}

.session-meta h2 {
    font-size: clamp(1.2rem, 3vw, 1.9rem);
}

.icon-button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--surface-soft);
    color: var(--ink);
    font-size: 1.4rem;
}

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

.stat-card {
    padding: 18px;
    border-radius: 20px;
    background: var(--surface-strong);
    border: 1px solid var(--line);
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-size: 0.9rem;
}

.stat-card strong {
    display: block;
    margin-top: 8px;
    font-family: "Archivo", sans-serif;
    font-size: 1.4rem;
}

.word-stage {
    padding: 34px 24px;
    display: grid;
    place-items: center;
    text-align: center;
}

.word-display {
    max-width: 14ch;
    font-family: "Archivo", sans-serif;
    font-size: clamp(2.8rem, 7vw, 5.4rem);
    font-weight: 700;
    line-height: 1.04;
    text-wrap: balance;
    animation: popWord 200ms ease;
}

.word-display.is-cursive {
    font-family: "Maria Lucia", "Brush Script MT", "Segoe Script", cursive;
    font-size: clamp(3rem, 7vw, 5.9rem);
    font-weight: 500;
}

.helper-text {
    max-width: 46rem;
    margin-top: 16px;
}

.control-bar {
    justify-content: center;
}

.screen--result {
    display: grid;
    place-items: center;
}

.result-card {
    width: min(100%, 720px);
    padding: 32px;
    text-align: center;
}

.result-card h2 {
    font-size: clamp(2rem, 5vw, 3.1rem);
}

.result-score {
    display: grid;
    gap: 8px;
    justify-items: center;
    margin-top: 20px;
}

.result-score strong {
    font-family: "Archivo", sans-serif;
    font-size: clamp(4rem, 10vw, 6.2rem);
    line-height: 1;
}

.result-score span,
.result-pace {
    color: var(--muted);
}

.result-pace {
    margin: 12px 0 0;
    font-family: "Archivo", sans-serif;
    font-size: 1.5rem;
    color: #4473d8;
}

.result-summary {
    max-width: 40rem;
    margin: 18px auto 0;
}

.result-skipped {
    margin-top: 20px;
    padding: 16px 18px;
    border-radius: 20px;
    background: rgba(255, 139, 109, 0.12);
    text-align: left;
}

.result-skipped p {
    margin: 10px 0 0;
}

.result-actions {
    justify-content: center;
    margin-top: 24px;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 30;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 33, 61, 0.28);
    backdrop-filter: blur(4px);
}

.modal__panel {
    position: relative;
    width: min(100% - 28px, 680px);
    margin: 8vh auto 0;
    padding: 24px;
    background: var(--surface-strong);
}

.modal__header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
}

.modal__content {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

@keyframes popWord {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }

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

@media (hover: hover) {
    .ghost-button:hover,
    .primary-button:hover,
    .secondary-button:hover,
    .mode-card:hover,
    .icon-button:hover {
        transform: translateY(-1px);
    }
}

@media (max-width: 980px) {
    .hero,
    .section-heading,
    .session-header {
        flex-direction: column;
        align-items: start;
    }

    .overview-grid,
    .selection-grid,
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 720px) {
    .app-shell {
        padding: 12px;
    }

    .screen {
        min-height: calc(100vh - 24px);
    }

    .hero,
    .info-card,
    .mode-section,
    .session-header,
    .stats-grid,
    .word-stage,
    .control-bar,
    .result-card,
    .modal__panel {
        border-radius: 26px;
    }

    .hero,
    .info-card,
    .mode-section,
    .result-card {
        padding: 20px;
    }

    .brand {
        flex-direction: column;
        align-items: start;
    }

    .brand__logo {
        width: 88px;
        height: 88px;
    }

    .overview-grid,
    .selection-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .control-bar,
    .result-actions {
        flex-direction: column;
    }

    .ghost-button,
    .primary-button,
    .secondary-button {
        width: 100%;
        justify-content: center;
    }

    .word-stage {
        padding: 28px 18px;
    }

    .modal__panel {
        width: min(100% - 16px, 680px);
        margin-top: 16px;
        padding: 20px;
    }
}

/* Final overrides for the JOJO standalone version */
body.session-active .app-shell,
body.result-active .app-shell {
    width: 100%;
    max-width: none;
    padding: 0;
}

.screen--home {
    position: relative;
    gap: 32px;
    padding-top: 32px;
    padding-bottom: 44px;
}

.home-top-actions {
    position: sticky;
    top: 18px;
    z-index: 4;
    display: flex;
    justify-content: end;
    gap: 12px;
}

.home-top-actions .ghost-button,
#sessionSoundBtn {
    width: auto;
}

.home-decor {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.home-decor__emoji,
.home-decor__dot {
    position: absolute;
    opacity: 0.4;
}

.home-decor__emoji {
    font-size: clamp(2rem, 4vw, 3.4rem);
    animation: floatDecor 5s ease-in-out infinite;
}

.home-decor__emoji--left {
    top: 170px;
    left: 30px;
}

.home-decor__emoji--right {
    top: 110px;
    right: 70px;
    animation-delay: 1.2s;
}

.home-decor__emoji--bottom {
    right: 120px;
    bottom: 56px;
    animation-delay: 2.1s;
}

.home-decor__dot {
    border-radius: 999px;
    animation: pulseDecor 4.4s ease-in-out infinite;
}

.home-decor__dot--yellow {
    top: 270px;
    left: 64px;
    width: 28px;
    height: 28px;
    background: #ffe47d;
}

.home-decor__dot--pink {
    top: 62%;
    right: 34px;
    width: 24px;
    height: 24px;
    background: #ffc5d5;
    animation-delay: 0.8s;
}

.home-decor__dot--blue {
    bottom: 84px;
    left: 22%;
    width: 18px;
    height: 18px;
    background: #9ec7ff;
    animation-delay: 1.6s;
}

.hero {
    display: block;
    padding: 24px 28px 18px;
    text-align: center;
}

.brand {
    display: grid;
    justify-items: center;
    gap: 18px;
}

.brand__logo {
    width: clamp(110px, 16vw, 160px);
    height: clamp(110px, 16vw, 160px);
    border-radius: 38px;
}

.brand__copy {
    max-width: 44rem;
}

.brand__copy h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
}

.mode-section {
    padding: 28px;
}

.section-heading.section-heading--stack {
    display: grid;
    gap: 8px;
    justify-items: center;
    text-align: center;
}

.section-heading.section-heading--stack h2 {
    font-size: clamp(2rem, 4vw, 3rem);
}

.selection-grid {
    gap: 24px;
}

.mode-card {
    position: relative;
    justify-items: center;
    min-height: 308px;
    padding: 28px 24px;
    border-radius: 34px;
    box-shadow: 0 16px 34px rgba(67, 92, 144, 0.14);
    color: #fff;
    text-align: center;
    overflow: hidden;
}

.mode-card::after {
    content: "";
    position: absolute;
    inset: auto -20% -40% auto;
    width: 140px;
    height: 140px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    filter: blur(10px);
}

.mode-card--timed-lower {
    background: linear-gradient(135deg, #4c82f3 0%, #8a38ec 100%);
}

.mode-card--timed-upper {
    background: linear-gradient(135deg, #32c56d 0%, #2c87ed 100%);
}

.mode-card--timed-cursive {
    background: linear-gradient(135deg, #a84cf3 0%, #de2f84 100%);
}

.mode-card--free-lower {
    background: linear-gradient(135deg, #ff711e 0%, #f33b42 100%);
}

.mode-card--free-upper {
    background: linear-gradient(135deg, #25bfaf 0%, #1996d7 100%);
}

.mode-card--free-cursive {
    background: linear-gradient(135deg, #ef4c9b 0%, #e33162 100%);
}

.mode-card strong,
.mode-card__subtitle,
.mode-card__preview {
    position: relative;
    z-index: 1;
    color: #fff;
}

.mode-card strong {
    font-size: 1.7rem;
    line-height: 1.08;
}

.mode-card__subtitle {
    font-size: 1.05rem;
    font-weight: 700;
}

.mode-card__preview {
    width: min(100%, 220px);
    margin-top: 10px;
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.18);
    font-size: 1rem;
    line-height: 1.8;
}

.mode-card__preview p {
    margin: 0;
}

.mode-card__preview--cursive {
    font-family: "Maria Lucia", "Brush Script MT", "Segoe Script", cursive;
    font-size: 1.18rem;
}

.screen--session {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    overflow: hidden;
}

.screen--session::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 16% 10%, rgba(126, 167, 255, 0.12), transparent 16%),
        radial-gradient(circle at 84% 84%, rgba(255, 185, 214, 0.14), transparent 18%);
    pointer-events: none;
}

.session-header {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 72px 1fr auto;
    gap: 18px;
    align-items: start;
    padding: 20px 24px 24px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: linear-gradient(90deg, #4b84f4 0%, #9535eb 100%);
    color: #fff;
}

.screen--session[data-mode="free"] .session-header {
    background: linear-gradient(90deg, #ff8732 0%, #e83b94 100%);
}

.icon-button--light,
.ghost-button--light {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    backdrop-filter: blur(10px);
}

.session-center {
    display: grid;
    justify-items: center;
    gap: 6px;
}

.session-pill {
    margin: 0;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.session-timer {
    font-family: "Archivo", sans-serif;
    font-size: clamp(2.4rem, 5vw, 4rem);
    line-height: 1;
    color: #ffe35c;
    text-shadow: 0 4px 16px rgba(75, 36, 145, 0.2);
}

.session-caption,
.session-letter-label {
    margin: 0;
    color: #fff;
}

.session-letter-label {
    font-size: 0.92rem;
    opacity: 0.9;
}

.session-side {
    display: grid;
    justify-items: end;
    gap: 12px;
}

.session-scoreboard {
    text-align: right;
}

.session-scoreboard__value {
    font-family: "Archivo", sans-serif;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    line-height: 1;
    font-weight: 800;
}

.session-scoreboard__label,
.session-scoreboard__line {
    margin-top: 4px;
}

.session-scoreboard__label {
    font-size: 0.96rem;
    opacity: 0.9;
}

.session-scoreboard__line {
    font-size: 0.95rem;
    font-weight: 700;
    color: #cbd7ff;
}

.session-scoreboard__line--success {
    color: #8eff9e;
}

.word-stage {
    position: relative;
    z-index: 1;
    flex: 1;
    display: grid;
    place-items: center;
    padding: 28px 24px 160px;
    text-align: center;
    border: 0;
    box-shadow: none;
    background: transparent;
}

.word-display {
    max-width: 14ch;
    font-size: clamp(3.6rem, 10vw, 7.2rem);
    line-height: 1.02;
    color: #1d2840;
    text-shadow: 0 6px 16px rgba(30, 42, 63, 0.1);
}

.word-display.is-cursive {
    font-size: clamp(4rem, 10vw, 7.4rem);
}

.helper-text {
    margin-top: 18px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #8a92a2;
}

.session-actions {
    position: fixed;
    inset: auto 24px 24px 24px;
    z-index: 6;
    display: flex;
    justify-content: space-between;
    align-items: end;
    pointer-events: none;
}

.session-actions__right {
    display: flex;
    align-items: end;
    gap: 16px;
    pointer-events: auto;
}

.floating-button {
    pointer-events: auto;
    color: #fff;
    box-shadow: 0 18px 38px rgba(46, 69, 111, 0.25);
}

.floating-button--next {
    min-width: 128px;
    min-height: 128px;
    padding: 20px;
    border-radius: 999px;
    background: linear-gradient(135deg, #2fc86f 0%, #388cf5 100%);
    display: grid;
    place-items: center;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 800;
    text-transform: uppercase;
}

.screen--session[data-mode="free"] .floating-button--next {
    background: linear-gradient(135deg, #ff8e32 0%, #e93f94 100%);
}

.floating-button__icon {
    display: block;
    margin-bottom: 6px;
    font-size: 2rem;
    line-height: 1;
}

.floating-button--skip {
    width: 74px;
    height: 74px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff5952 0%, #ff2f57 100%);
    display: grid;
    place-items: center;
    font-size: 2rem;
    font-weight: 800;
}

.floating-button--finish {
    min-height: 56px;
    padding: 0 22px;
    border-radius: 999px;
    background: linear-gradient(135deg, #31c87e 0%, #19a8c0 100%);
    font-weight: 700;
}

.screen--session[data-mode="timed"] .floating-button--finish {
    opacity: 0;
    transform: translateY(16px);
    pointer-events: none;
}

.screen--result {
    min-height: 100vh;
    padding: 24px;
    background: linear-gradient(135deg, #44c77f 0%, #4d88f6 45%, #8f48ea 100%);
}

.result-card {
    width: min(100%, 720px);
    background: rgba(255, 255, 255, 0.92);
}

.modal__panel {
    width: min(100% - 28px, 720px);
    margin-top: 6vh;
    background: rgba(255, 255, 255, 0.96);
}

.modal__subtitle {
    margin: 0 0 12px;
    font-weight: 700;
    color: #416ddd;
}

@media (hover: hover) {
    .floating-button:hover,
    .mode-card:hover {
        transform: translateY(-2px) scale(1.01);
    }
}

@media (max-width: 1080px) {
    .selection-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .home-top-actions {
        position: static;
        justify-content: center;
        flex-wrap: wrap;
    }

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

    .session-header {
        grid-template-columns: 56px 1fr;
    }

    .session-side {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-items: center;
    }

    .session-scoreboard {
        text-align: center;
    }
}

@media (max-width: 720px) {
    .hero,
    .mode-section,
    .result-card,
    .modal__panel {
        border-radius: 28px;
        padding: 22px;
    }

    .brand__copy h1 {
        font-size: clamp(2.1rem, 10vw, 3rem);
    }

    .mode-card {
        min-height: 274px;
        padding: 24px 20px;
    }

    .mode-card strong {
        font-size: 1.45rem;
    }

    .session-header {
        padding: 16px 16px 20px;
    }

    .session-pill,
    .session-letter-label {
        display: none;
    }

    .session-caption {
        font-size: 0.92rem;
    }

    #sessionSoundBtn {
        min-height: 38px;
        padding-inline: 12px;
        font-size: 0.86rem;
    }

    .word-stage {
        padding: 20px 16px 134px;
    }

    .word-display {
        font-size: clamp(3rem, 13vw, 4.8rem);
    }

    .word-display.is-cursive {
        font-size: clamp(3.2rem, 13vw, 5.2rem);
    }

    .helper-text {
        font-size: 0.78rem;
    }

    .session-actions {
        left: 16px;
        right: 16px;
        bottom: calc(16px + env(safe-area-inset-bottom));
    }

    .session-actions__right {
        gap: 12px;
    }

    .floating-button--next {
        min-width: 108px;
        min-height: 108px;
        font-size: 1rem;
    }

    .floating-button__icon {
        font-size: 1.7rem;
    }

    .floating-button--skip {
        width: 62px;
        height: 62px;
        font-size: 1.7rem;
    }

    .floating-button--finish {
        min-height: 48px;
        padding-inline: 18px;
    }
}
