:root {
    color-scheme: light;
    --bg: #f6f8fc;
    --card: #ffffff;
    --ink: #172033;
    --muted: #627084;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --danger: #dc2626;
    --danger-dark: #b91c1c;
    --accent: #f59e0b;
    --soft-blue: #dbeafe;
    --soft-green: #dcfce7;
    --border: #e2e8f0;
    --shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 34rem),
        radial-gradient(circle at bottom right, rgba(245, 158, 11, 0.16), transparent 30rem),
        var(--bg);
}

button,
select {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
}

.auth-screen {
    display: grid;
    min-height: 100vh;
    padding: 24px;
    place-items: center;
}

.auth-card {
    width: min(420px, 100%);
    padding: 34px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: var(--shadow);
    text-align: center;
    backdrop-filter: blur(18px);
}

.auth-icon {
    display: grid;
    width: 78px;
    height: 78px;
    margin: 0 auto 18px;
    place-items: center;
    border-radius: 50%;
    background: var(--soft-blue);
    font-size: 2rem;
}

.auth-card h1 {
    margin-bottom: 12px;
    font-size: clamp(2rem, 10vw, 3.5rem);
}

.auth-copy {
    color: var(--muted);
    line-height: 1.6;
}

.passcode-input {
    width: 100%;
    margin-top: 14px;
    padding: 16px;
    border: 1px solid #cbd5e1;
    border-radius: 18px;
    color: var(--ink);
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: 0.28em;
    text-align: center;
    outline: none;
}

.passcode-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.auth-button {
    width: 100%;
    margin-top: 14px;
    padding: 15px 24px;
    border-radius: 999px;
    color: white;
    background: var(--primary);
    font-weight: 800;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.28);
}

.auth-button:hover {
    background: var(--primary-dark);
}

.passcode-error {
    min-height: 22px;
    margin: 12px 0 0;
    color: var(--danger);
    font-size: 0.92rem;
    font-weight: 700;
}

.is-locked,
.auth-screen.is-unlocked {
    display: none;
}

.app-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 40px 0;
}

.hero-card {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
    gap: 28px;
    align-items: stretch;
    padding: 32px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 32px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.hero-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    max-width: 720px;
    margin-bottom: 16px;
    font-size: clamp(2.4rem, 7vw, 5.4rem);
    line-height: 0.95;
    letter-spacing: -0.07em;
}

h2 {
    margin-bottom: 12px;
    font-size: 1.25rem;
    letter-spacing: -0.03em;
}

.hero-copy {
    max-width: 660px;
    color: var(--muted);
    font-size: 1.08rem;
    line-height: 1.7;
}

.language-panel {
    max-width: 520px;
    margin-top: 20px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: #f8fafc;
}

.language-panel label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.language-panel select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    color: var(--ink);
    background: white;
    outline: none;
}

.language-panel select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

#languageNote,
.mic-hint,
.section-copy,
.learning-focus {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

#languageNote,
.mic-hint,
.learning-focus {
    margin: 10px 0 0;
}

.session-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 380px;
    padding: 28px;
    border-radius: 28px;
    color: #0f172a;
    background:
        linear-gradient(160deg, rgba(219, 234, 254, 0.95), rgba(255, 247, 237, 0.94)),
        var(--card);
    text-align: center;
}

.avatar {
    display: grid;
    width: 92px;
    height: 92px;
    margin-bottom: 18px;
    place-items: center;
    border-radius: 50%;
    background: white;
    font-size: 2.5rem;
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.14);
}

.session-label {
    margin-bottom: 6px;
    color: var(--primary-dark);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

#sessionState {
    margin-bottom: 4px;
    font-size: 1.6rem;
}

#status {
    min-height: 24px;
    margin-bottom: 22px;
    color: var(--muted);
    font-weight: 700;
}

#status.connected {
    color: #15803d;
}

#status.connecting {
    color: var(--primary-dark);
}

#status.error {
    color: var(--danger);
}

#actionBtn {
    width: 100%;
    max-width: 280px;
    padding: 15px 24px;
    border-radius: 999px;
    color: white;
    font-size: 1rem;
    font-weight: 800;
    transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.28);
}

#actionBtn:active,
.lesson-card:active {
    transform: translateY(1px) scale(0.99);
}

.start {
    background: var(--primary);
}

.start:hover {
    background: var(--primary-dark);
}

.stop {
    background: var(--danger);
    box-shadow: 0 12px 28px rgba(220, 38, 38, 0.26);
}

.stop:hover {
    background: var(--danger-dark);
}

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

.info-card {
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
}

.info-card p,
.info-card li {
    color: var(--muted);
    line-height: 1.6;
}

.check-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.check-list li {
    position: relative;
    padding-left: 28px;
}

.check-list li::before {
    position: absolute;
    left: 0;
    content: "✓";
    color: #16a34a;
    font-weight: 900;
}

.lesson-card-wrap {
    grid-column: span 1;
}

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

.lesson-card {
    display: flex;
    min-height: 86px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 18px;
    color: var(--ink);
    background: #f8fafc;
    font-weight: 800;
    text-align: left;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.lesson-card span {
    font-size: 1.35rem;
}

.lesson-card:hover,
.lesson-card.active {
    border-color: rgba(37, 99, 235, 0.45);
    background: var(--soft-blue);
}

.safety-card {
    background: linear-gradient(180deg, rgba(220, 252, 231, 0.88), rgba(255, 255, 255, 0.9));
}

@media (max-width: 900px) {
    .hero-card,
    .content-grid {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 560px) {
    .app-shell {
        width: min(100% - 20px, 1120px);
        padding: 20px 0;
    }

    .hero-card {
        padding: 20px;
        border-radius: 24px;
    }

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