:root {
    --canvas: #F7F2E8;
    --surface: #FFFDF8;
    --action: #79C8B8;
    --action-text: #17393A;
    --accent-warm: #F3C6A8;
    --accent-cool: #C2DDF5;
    --ink: #24313A;
    --check: #2E9D68;
    --radius: 22px;
    --gap: 18px;
    --padding: clamp(24px, 4vw, 32px);
    --shadow: 0 18px 40px rgba(36, 49, 58, 0.12);
    --focus: 3px solid var(--ink);
    --target: 52px;
    --title-size: clamp(36px, 4vw, 40px);
    --heading-size: clamp(24px, 3vw, 28px);
    --body-size: clamp(18px, 2vw, 20px);
    --answer-size: clamp(28px, 3vw, 32px);
    --font-family: "Trebuchet MS", "Arial Rounded MT Bold", "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: var(--font-family);
    font-size: var(--body-size);
    line-height: 1.4;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(243, 198, 168, 0.5), transparent 28%),
        radial-gradient(circle at top right, rgba(194, 221, 245, 0.45), transparent 30%),
        linear-gradient(180deg, #FFF9EF 0%, var(--canvas) 100%);
}

button,
input,
select {
    font: inherit;
    color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
label:has(input:focus-visible) {
    outline: var(--focus);
    outline-offset: 2px;
}

.app-root {
    display: flex;
    justify-content: center;
    padding: var(--padding);
}

.screen {
    width: min(100%, 980px);
}

.screen-shell {
    display: grid;
    gap: var(--gap);
}

.hero-card,
.panel,
.timer-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.hero-card,
.panel,
.timer-card,
.setup-form {
    padding: var(--padding);
}

.hero-card::after,
.panel::after,
.timer-card::after {
    content: "";
    position: absolute;
    inset: auto -30px -35px auto;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: rgba(121, 200, 184, 0.12);
}

.app-title,
.section-title {
    margin: 0;
    font-size: var(--title-size);
    line-height: 1.05;
}

.section-title-small {
    font-size: var(--heading-size);
}

.support-line,
.summary-stat,
.duration-label {
    margin: 0;
}

.setup-form {
    display: grid;
    gap: var(--gap);
    padding: 0;
}

.icon-label {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-weight: 700;
}

.label-icon {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.25;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mascot-cluster {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.mascot {
    width: 44px;
    height: 44px;
    border-radius: 16px 16px 20px 20px;
    display: inline-block;
    background: var(--action);
    box-shadow: inset 0 -8px 0 rgba(255, 255, 255, 0.25);
}

.mascot-2 {
    background: var(--accent-warm);
}

.mascot-3 {
    background: var(--accent-cool);
}

.table-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: 14px;
}

.table-chip {
    min-height: var(--target);
    border-radius: 20px;
    background: rgba(194, 221, 245, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    cursor: pointer;
    transition: background-color 140ms ease, transform 120ms ease;
}

.table-chip:hover {
    transform: translateY(-1px);
}

.table-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.table-chip:has(input:checked) {
    background: rgba(121, 200, 184, 0.35);
}

.table-chip-content {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 10px;
}

.table-chip-text {
    font-weight: 700;
    text-align: left;
}

.table-chip-check {
    color: var(--check);
    font-size: 24px;
    font-weight: 900;
    line-height: 1;
    opacity: 0;
    transform: scale(0.75);
    transition: opacity 120ms ease, transform 120ms ease;
}

.table-chip:has(input:checked) .table-chip-check {
    opacity: 1;
    transform: scale(1);
}

.duration-wrap {
    display: grid;
    gap: 12px;
}

select,
.answer-input {
    min-height: var(--target);
    border: 2px solid rgba(36, 49, 58, 0.12);
    border-radius: 20px;
    background: #FFFFFF;
    padding: 12px 16px;
}

.answer-input {
    width: 108px;
    text-align: center;
    font-size: var(--answer-size);
    font-weight: 700;
}

.primary-action {
    min-height: var(--target);
    border: 0;
    border-radius: 20px;
    background: var(--action);
    color: var(--action-text);
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 12px 20px rgba(121, 200, 184, 0.35);
    transition: transform 120ms ease, box-shadow 140ms ease;
}

.primary-action:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 16px 24px rgba(121, 200, 184, 0.4);
}

.primary-action:disabled {
    cursor: not-allowed;
    opacity: 0.45;
    box-shadow: none;
}

.practice-shell {
    gap: 16px;
}

.timer-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.timer-value {
    font-size: clamp(28px, 3vw, 32px);
}

.practice-list,
.result-list,
.summary-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.practice-list {
    display: grid;
    gap: 16px;
}

.practice-actions {
    display: flex;
    justify-content: flex-end;
}

.next-action {
    min-width: 180px;
}

.practice-row {
    min-height: var(--target);
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border-radius: 22px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.practice-prompt,
.result-prompt {
    font-size: var(--answer-size);
    font-weight: 700;
}

.result-list {
    display: grid;
    gap: 10px;
}

.result-row,
.summary-row {
    display: grid;
    gap: 10px;
    align-items: center;
    padding: 16px 18px;
    border-radius: 20px;
    background: rgba(194, 221, 245, 0.22);
}

.result-row {
    grid-template-columns: minmax(90px, 1fr) auto auto;
}

.result-answer {
    font-weight: 700;
}

.result-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--check);
    font-weight: 700;
}

.result-check svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.summary-row {
    grid-template-columns: repeat(3, minmax(0, auto));
    justify-content: space-between;
}

.time-line {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.time-line .icon-label {
    margin-bottom: 0;
}

.timeout-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(36, 49, 58, 0.38);
}

.timeout-overlay-card {
    width: min(100%, 420px);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: clamp(20px, 4vw, 30px);
    display: grid;
    gap: 14px;
    justify-items: center;
    text-align: center;
}

.timeout-overlay-text {
    margin: 0;
    font-size: var(--heading-size);
    font-weight: 800;
}

.timeout-continue {
    min-width: 170px;
}

@media (max-width: 720px) {
    .app-root {
        padding: 24px;
    }

    .practice-actions,
    .next-action {
        width: 100%;
    }
}

@media (max-width: 560px) {
    .practice-row {
        grid-template-columns: 1fr;
        justify-items: start;
    }

    .answer-input {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .result-row,
    .summary-row {
        grid-template-columns: 1fr;
        justify-items: start;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition-duration: 0ms !important;
        scroll-behavior: auto !important;
    }
}