@font-face {
    font-family: 'Grundschrift';
    src: url('/public/assets/fonts/grundschrift-beta.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg: #f5ede3;
    --bg-soft: rgba(255, 250, 244, 0.62);
    --panel: rgba(255, 248, 240, 0.78);
    --panel-strong: rgba(255, 251, 246, 0.94);
    --text: #4a3424;
    --muted: #8a6d57;
    --line: rgba(151, 118, 88, 0.18);
    --shadow: 0 24px 70px rgba(107, 79, 53, 0.15);
    --shadow-soft: 0 14px 40px rgba(107, 79, 53, 0.11);
    --primary: #b79063;
    --primary-strong: #9d7448;
    --success: #1d9c73;
    --danger: #cf4f5f;
    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 14px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
    font-family: 'Aptos', 'Segoe UI', 'Trebuchet MS', sans-serif;
    background:
        radial-gradient(circle at top left, rgba(220, 193, 158, 0.4), transparent 28%),
        radial-gradient(circle at right, rgba(201, 170, 133, 0.22), transparent 24%),
        linear-gradient(180deg, #fbf5ee 0%, #f4eadf 48%, #ede0d2 100%);
    color: var(--text);
}

body {
    padding: 24px;
}

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

.dobble-preview-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    padding: 8px;
    border: 1px solid rgba(151, 118, 88, 0.12);
}

.dobble-widget {
    display: grid;
    gap: 18px;
}

.board-game-stage {
    display: grid;
    min-height: 100%;
    padding: 28px;
    background:
        radial-gradient(circle at top, rgba(255, 252, 246, 0.98), rgba(244, 231, 214, 0.96)),
        linear-gradient(160deg, rgba(183, 144, 99, 0.08), rgba(255, 255, 255, 0.68));
    align-items: center;
}

.board-game-stage[hidden] {
    display: none !important;
}

.board-game-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.board-game-actions-inline {
    justify-content: flex-end;
}

.board-game-actions-compact {
    justify-content: flex-end;
}

.board-game-actions-compact [data-dobble-action="toggle-reveal"] {
    min-width: 60px;
    padding-inline: 0;
    font-size: 1.35rem;
}

.dobble-head,
.dobble-statusbar,
.dobble-scoreboard,
.dobble-board {
    display: grid;
    gap: 14px;
}

.dobble-head,
.dobble-statusbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
}

.dobble-scoreboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dobble-team-score {
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    text-align: center;
}

.dobble-team-score:first-child {
    background: rgba(29, 156, 115, 0.14);
    border: 1px solid rgba(29, 156, 115, 0.2);
}

.dobble-team-score:last-child {
    background: rgba(47, 114, 230, 0.14);
    border: 1px solid rgba(47, 114, 230, 0.2);
}

.dobble-team-score span {
    display: block;
    color: var(--muted);
    font-size: .85rem;
}

.dobble-team-score strong {
    display: block;
    font-size: 1.8rem;
}

.dobble-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
}

.dobble-board-stage {
    align-items: center;
    min-height: min(70vh, 760px);
}

.dobble-card-shell {
    display: grid;
    place-items: center;
    padding: 12px;
    border-radius: 24px;
    background: transparent;
    transition: transform .2s ease, box-shadow .2s ease;
    position: relative;
}

.dobble-card-shell.is-covered .dobble-symbol {
    pointer-events: none;
}

.dobble-card-shell.is-winning {
    box-shadow: 0 0 0 3px rgba(29, 156, 115, 0.2);
    transform: translateY(-2px) scale(1.01);
}

.dobble-card-shell.is-miss {
    animation: dobble-shake .35s ease;
}

.dobble-card {
    position: relative;
    border-radius: 50%;
    aspect-ratio: 1;
    width: min(31vw, 500px);
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.96), rgba(249, 239, 226, 0.96)),
        linear-gradient(135deg, rgba(183, 144, 99, 0.12), rgba(157, 116, 72, 0.08));
    border: 3px solid rgba(183, 144, 99, 0.22);
    overflow: hidden;
}

.dobble-cover {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    width: min(31vw, 500px);
    aspect-ratio: 1;
    background: rgba(244, 231, 214, 0.995);
    box-shadow: inset 0 0 0 3px rgba(183, 144, 99, 0.22);
    transform: translate(-50%, -50%);
    transition: opacity .2s ease, transform .2s ease;
    z-index: 15;
    cursor: pointer;
}

.dobble-cover[disabled] {
    opacity: 0;
    pointer-events: none;
}

.dobble-symbol {
    position: absolute;
    display: block;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
    transition: transform .16s ease, filter .16s ease;
}

.dobble-symbol:hover,
.dobble-symbol:focus-visible {
    filter: drop-shadow(0 12px 18px rgba(107, 79, 53, 0.22));
}

.dobble-symbol img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 8px 14px rgba(107, 79, 53, 0.12));
}

.pdf-stage.is-hidden-for-game {
    display: none !important;
}

.dobble-feedback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    min-width: 110px;
    padding: 16px 18px;
    border-radius: 20px;
    text-align: center;
    font-weight: 800;
    font-size: 1.5rem;
    color: white;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}

.dobble-feedback.is-visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.dobble-feedback.is-success {
    background: rgba(29, 156, 115, 0.92);
}

.dobble-feedback.is-error {
    background: rgba(212, 80, 97, 0.92);
}

@keyframes dobble-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

@media (max-width: 900px) {
    .dobble-head,
    .dobble-statusbar,
    .dobble-board {
        grid-template-columns: 1fr;
    }

    .dobble-card {
        width: min(72vw, 360px);
    }

    .dobble-cover {
        width: min(72vw, 360px);
    }

    .board-game-actions {
        justify-content: center;
    }

    .board-game-actions-compact {
        justify-content: center;
    }

    .dobble-board-stage {
        min-height: auto;
    }
}

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

button,
input,
select,
textarea {
    font: inherit;
}

.glass-panel {
    border: 1px solid rgba(255, 255, 255, 0.42);
    background: var(--panel);
    backdrop-filter: blur(22px);
    box-shadow: 0 12px 26px rgba(107, 79, 53, 0.07);
}

.flash-stack {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 90;
    display: grid;
    gap: 12px;
}

.flash {
    min-width: 280px;
    padding: 16px 18px;
    border-radius: 18px;
    color: white;
    box-shadow: var(--shadow-soft);
    transition: opacity .35s ease, transform .35s ease;
}

.flash-success { background: linear-gradient(135deg, #16a175, #3fbf98); }
.flash-error { background: linear-gradient(135deg, #d45061, #ee7a87); }
.flash.is-hidden { opacity: 0; transform: translateY(-6px); }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: .14em;
    font-size: .75rem;
    color: var(--muted);
    font-weight: 700;
}

.eyebrow::before {
    content: '';
    width: 18px;
    height: 1px;
    background: currentColor;
}

.section-heading h1,
.section-heading h2,
.hero-copy h1,
.board-canvas-header h1 {
    margin: 10px 0 12px;
    line-height: 1.05;
}

.section-heading p,
.hero-copy p,
.series-card p,
.lesson-row p,
.empty-state p,
.gadget-placeholder p {
    color: var(--muted);
    line-height: 1.65;
}

.landing-shell,
.auth-shell {
    min-height: calc(100vh - 48px);
    display: grid;
    place-items: center;
}

.hero-card,
.auth-card {
    width: min(1120px, 100%);
    border-radius: var(--radius-xl);
}

.hero-card {
    display: grid;
    grid-template-columns: 1.2fr .9fr;
    gap: 28px;
    padding: 36px;
}

.hero-card-soft {
    align-items: center;
    background:
        radial-gradient(circle at top left, rgba(255, 230, 198, 0.7), transparent 30%),
        linear-gradient(180deg, rgba(255, 251, 247, 0.98), rgba(246, 236, 224, 0.94));
}

.hero-logo {
    width: 100%;
    max-width: 460px;
    max-height: 420px;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 18px 36px rgba(107, 79, 53, 0.16));
    justify-self: start;
}

.hero-copy h1 {
    font-size: clamp(3rem, 5vw, 5.4rem);
    max-width: 10ch;
}

.hero-copy {
    display: grid;
    gap: 18px;
    align-content: center;
}

.hero-note {
    display: grid;
    gap: 8px;
    max-width: 460px;
    padding: 18px 20px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(183, 144, 99, 0.14);
}

.hero-note strong,
.hero-note p {
    margin: 0;
}

.hero-note p {
    color: var(--muted);
    line-height: 1.55;
}

.hero-actions {
    display: grid;
    gap: 18px;
    align-content: center;
    width: 100%;
}

.hero-actions-large {
    grid-template-columns: 1fr;
}

.action-tile {
    padding: 24px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.46);
    display: grid;
    gap: 8px;
    box-shadow: var(--shadow-soft);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.action-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 36px rgba(107, 79, 53, 0.14);
}

.action-tile-accent {
    background: linear-gradient(135deg, rgba(183, 144, 99, 0.96), rgba(214, 187, 150, 0.82));
    color: white;
}

.action-tile-choice {
    min-height: 168px;
    align-content: center;
}

.action-tile-choice strong {
    font-size: 1.7rem;
}

.action-tile-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: rgba(19, 32, 59, 0.08);
    font-weight: 800;
}

.action-tile-accent .action-tile-icon {
    background: rgba(255, 255, 255, 0.18);
}

.auth-card {
    max-width: 560px;
    padding: 34px;
    border-radius: var(--radius-xl);
}

.code-card {
    max-width: 620px;
}

.teacher-overview-page {
    padding: 0;
}

.teacher-overview-shell {
    min-height: 100vh;
}

.teacher-overview-fullscreen {
    display: grid;
    min-height: 100vh;
}

.teacher-overview-panel {
    padding: 28px;
    border-radius: var(--radius-xl);
    display: grid;
    gap: 24px;
}

.teacher-overview-choice {
    align-content: start;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: clamp(18px, 3vw, 36px);
}

.teacher-overview-topbar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.subject-choice-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(14px, 2vw, 24px);
    min-height: min(58vh, 560px);
}

.subject-choice-grid-home {
    align-self: stretch;
    min-height: calc(100vh - 132px);
}

.subject-choice-card {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: clamp(14px, 2vw, 22px);
    align-items: center;
    justify-items: center;
    padding: clamp(20px, 3vw, 34px);
    border: 2px solid rgba(183, 144, 99, 0.18);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.68);
    cursor: pointer;
    color: var(--text);
    text-decoration: none;
    box-shadow: 0 22px 42px rgba(107, 79, 53, 0.08);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.subject-choice-card:hover {
    transform: translateY(-3px);
    border-color: rgba(183, 144, 99, 0.34);
    box-shadow: 0 28px 54px rgba(107, 79, 53, 0.12);
}

.subject-choice-image {
    display: grid;
    place-items: center;
    width: min(100%, 260px);
    aspect-ratio: 1;
    border-radius: 28px;
    background:
        linear-gradient(180deg, rgba(255, 251, 246, 0.94), rgba(244, 235, 224, 0.86));
    border: 1px solid rgba(183, 144, 99, 0.16);
    overflow: hidden;
}

.subject-choice-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 18px;
}

.subject-choice-image span {
    font-size: clamp(4rem, 8vw, 7.5rem);
    font-weight: 900;
    color: var(--primary-strong);
}

.subject-choice-card strong {
    font-size: clamp(2rem, 4vw, 4.2rem);
    line-height: 1;
}

.subject-empty-text {
    color: var(--muted);
}

.teacher-subject-page {
    display: grid;
    gap: clamp(16px, 2vw, 24px);
}

.teacher-subject-page h1 {
    margin: 0;
    font-size: clamp(2.2rem, 5vw, 5rem);
    line-height: 1;
}

.teacher-series-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: clamp(14px, 1.8vw, 22px);
}

.teacher-series-card {
    display: grid;
    gap: 16px;
    align-content: start;
    min-height: 190px;
    padding: clamp(18px, 2vw, 24px);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(183, 144, 99, 0.16);
    box-shadow: 0 20px 40px rgba(107, 79, 53, 0.08);
}

.teacher-series-card-head {
    display: grid;
    gap: 6px;
}

.teacher-series-card-head strong {
    font-size: clamp(1.35rem, 2.2vw, 2.2rem);
    line-height: 1.1;
}

.teacher-series-card-head span {
    color: var(--muted);
    font-weight: 700;
}

.teacher-series-card .teacher-lesson-pills {
    padding: 0;
}

.teacher-series-card .lesson-pill {
    min-height: 54px;
    padding: 0 18px;
    font-size: 1.05rem;
}

.stack-form {
    display: grid;
    gap: 18px;
}

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

.form-field {
    display: grid;
    gap: 10px;
}

.form-field span,
.checkbox-field span {
    font-weight: 600;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.78);
    border-radius: 18px;
    padding: 15px 16px;
    outline: none;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    border-color: rgba(183, 144, 99, 0.52);
    box-shadow: 0 0 0 5px rgba(183, 144, 99, 0.12);
}

.code-input {
    text-align: center;
    letter-spacing: .35em;
    font-size: 2rem;
    font-weight: 800;
}

.checkbox-field {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    min-height: 50px;
    padding: 0 20px;
    border-radius: 18px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}

.btn-block { width: 100%; }
.btn-primary { background: linear-gradient(135deg, var(--primary), #d5b28b); color: white; }
.btn-secondary { background: rgba(19, 32, 59, 0.08); color: var(--text); }
.btn-ghost { background: rgba(255, 255, 255, 0.44); border: 1px solid var(--line); }
.btn-danger { background: linear-gradient(135deg, #d45061, #f1898f); color: white; }

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(107, 79, 53, 0.12);
}

small {
    color: var(--muted);
    line-height: 1.5;
}

.back-link {
    color: var(--muted);
    font-weight: 600;
}

.admin-shell {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 22px;
    min-height: calc(100vh - 48px);
}

.admin-shell-single {
    grid-template-columns: minmax(0, 1fr);
}

.admin-shell-dashboard {
    grid-template-columns: 360px minmax(0, 1fr);
}

.admin-sidebar,
.admin-content,
.lessons-panel {
    border-radius: var(--radius-xl);
}

.admin-sidebar {
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.admin-sidebar-rich {
    background:
        linear-gradient(180deg, rgba(71, 44, 29, 0.92), rgba(110, 72, 47, 0.88)),
        linear-gradient(135deg, rgba(197, 123, 87, 0.2), rgba(244, 209, 168, 0.04));
    color: #fff6ef;
    box-shadow: 0 28px 72px rgba(71, 44, 29, 0.28);
}

.admin-sidebar-rich .eyebrow,
.admin-sidebar-rich p,
.admin-sidebar-rich small,
.admin-sidebar-rich .back-link {
    color: rgba(255, 246, 239, 0.82);
}

.admin-sidebar-top,
.sidebar-stack {
    display: grid;
    gap: 22px;
}

.sidebar-helper-card {
    display: grid;
    gap: 14px;
    padding: 20px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.sidebar-helper-card strong,
.sidebar-helper-card p {
    margin: 0;
}

.sidebar-actions {
    display: grid;
    gap: 12px;
}

.account-panel {
    padding: 24px;
    border-radius: var(--radius-xl);
}

.dashboard-hero,
.team-panel {
    padding: 26px;
    border-radius: var(--radius-xl);
}

.dashboard-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
    gap: 22px;
    align-items: center;
}

.dashboard-hero-soft,
.project-shelf {
    background:
        radial-gradient(circle at top left, rgba(255, 228, 196, 0.42), transparent 26%),
        linear-gradient(180deg, rgba(255, 251, 247, 0.96), rgba(246, 238, 229, 0.9));
}

.dashboard-hero-copy {
    display: grid;
    gap: 16px;
}

.dashboard-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.dashboard-hero-stats,
.dashboard-grid,
.team-list,
.series-wizard-hero,
.wizard-summary-grid {
    display: grid;
    gap: 16px;
}

.dashboard-hero-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.project-shelf {
    padding: 26px;
    border-radius: var(--radius-xl);
}

.project-empty-state {
    min-height: 240px;
    place-content: center;
    text-align: left;
}

.project-empty-state h3 {
    margin: 0;
}

.stat-tile,
.team-member-card,
.summary-tile,
.inline-note-card {
    padding: 18px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(183, 144, 99, 0.14);
    box-shadow: 0 10px 22px rgba(107, 79, 53, 0.04);
}

.stat-tile span,
.summary-tile span {
    display: block;
    color: var(--muted);
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.stat-tile strong,
.summary-tile strong {
    display: block;
    margin-top: 8px;
    font-size: clamp(1.35rem, 2vw, 2rem);
}

.team-list {
    margin-top: 18px;
}

.team-member-card {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.team-member-card p,
.inline-note-card p {
    margin: 6px 0 0;
    color: var(--muted);
}

.admin-content {
    display: grid;
    gap: 22px;
}

.section-heading-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.subject-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    align-items: start;
}

.subject-column {
    display: grid;
    gap: 16px;
    align-content: start;
}

.subject-column-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.subject-board-link {
    white-space: nowrap;
    text-decoration: none;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.subject-board-link:hover {
    transform: translateY(-1px);
    background: rgba(19, 32, 59, 0.12);
    box-shadow: 0 10px 18px rgba(107, 79, 53, 0.08);
}

.series-card,
.detail-main,
.detail-side,
.lessons-panel {
    padding: 24px;
    border-radius: var(--radius-xl);
}

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

.series-card-soft {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(248, 241, 233, 0.86));
    box-shadow: 0 18px 34px rgba(107, 79, 53, 0.08);
}

.series-card h3 {
    margin: 0;
    font-size: 1.45rem;
}

.series-card-top,
.meta-row,
.lesson-row-meta,
.panel-head {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.color-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: var(--series-accent, var(--primary));
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(19, 32, 59, 0.08);
    color: var(--text);
    font-size: .85rem;
    font-weight: 700;
}

.badge-success { background: rgba(29, 156, 115, 0.16); color: #147655; }
.badge-danger { background: rgba(212, 80, 97, 0.16); color: #b33347; }
.badge-muted { background: rgba(99, 113, 140, 0.12); color: #51607c; }
.badge-soft-light { background: rgba(255, 255, 255, 0.18); color: #fff6ef; }

.soft-heading p {
    max-width: 60ch;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 22px;
}

.compact-heading {
    margin-bottom: 18px;
}

.detail-side {
    display: grid;
    gap: 16px;
    align-content: start;
}

.code-pill {
    display: inline-flex;
    justify-content: center;
    width: 100%;
    padding: 18px 20px;
    border-radius: 22px;
    background: linear-gradient(135deg, var(--series-accent, var(--primary)), #dabb96);
    color: white;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: .25em;
    text-indent: .25em;
}

.side-card,
.upload-preview {
    display: grid;
    gap: 14px;
}

.side-card-highlight {
    padding: 18px;
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(255, 248, 239, 0.96), rgba(248, 235, 220, 0.9));
    border: 1px solid rgba(183, 144, 99, 0.16);
}

.side-card-muted {
    padding: 18px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(183, 144, 99, 0.12);
}

.lesson-wizard-shell {
    display: grid;
    gap: 18px;
}

.lesson-editor-shell {
    display: grid;
    gap: 22px;
}

.lesson-editor-hero {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    align-items: flex-start;
    padding: 20px 22px;
    border-radius: 26px;
    background: linear-gradient(180deg, rgba(255, 249, 242, 0.96), rgba(247, 238, 228, 0.86));
    border: 1px solid rgba(183, 144, 99, 0.14);
}

.lesson-editor-hero h2 {
    margin: 8px 0 0;
}

.lesson-editor-hero p {
    margin: 10px 0 0;
    max-width: 58ch;
    color: var(--muted);
}

.lesson-editor-actions {
    display: grid;
    gap: 10px;
    justify-items: end;
}

.lesson-editor-form {
    display: grid;
    gap: 18px;
}

.editor-block {
    display: grid;
    gap: 18px;
    padding: 24px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.52);
    border: 1px solid rgba(183, 144, 99, 0.12);
}

.lesson-editor-submit {
    justify-content: flex-end;
}

.simple-tools-panel {
    display: grid;
    gap: 18px;
}

.simple-settings-stack {
    display: grid;
    gap: 14px;
}

.simple-settings-card {
    border-radius: 24px;
    border: 1px solid rgba(183, 144, 99, 0.16);
    background: rgba(255, 255, 255, 0.52);
    overflow: hidden;
}

.simple-settings-card summary {
    padding: 18px 20px;
    cursor: pointer;
    font-weight: 700;
    list-style: none;
}

.simple-settings-card summary::-webkit-details-marker {
    display: none;
}

.simple-settings-card[open] summary {
    border-bottom: 1px solid rgba(183, 144, 99, 0.12);
    background: rgba(255, 248, 240, 0.72);
}

.details-form,
.simple-settings-card .team-list {
    padding: 18px 20px 20px;
}

.lesson-status-overview {
    place-items: start;
    text-align: left;
}

.series-wizard-shell {
    display: grid;
    gap: 22px;
    padding: 32px;
    border-radius: 34px;
    background:
        radial-gradient(circle at top left, rgba(255, 227, 192, 0.64), transparent 30%),
        linear-gradient(180deg, rgba(255, 250, 244, 0.98), rgba(247, 239, 229, 0.92));
    box-shadow: 0 30px 60px rgba(107, 79, 53, 0.08);
}

.series-wizard-hero {
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.85fr);
    align-items: stretch;
}

.series-wizard-copy {
    display: grid;
    gap: 12px;
}

.series-wizard-copy h2,
.series-preview-card strong {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 3rem);
    line-height: 1.05;
}

.series-wizard-copy p,
.series-preview-card p,
.journey-card-copy small {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.series-wizard-preview {
    display: grid;
}

.series-preview-card {
    min-height: 100%;
    display: grid;
    gap: 14px;
    padding: 24px;
    border-radius: 28px;
    background:
        linear-gradient(160deg, rgba(197, 123, 87, 0.94), rgba(128, 88, 66, 0.92)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.12));
    color: #fffaf5;
    box-shadow: 0 22px 54px rgba(128, 88, 66, 0.24);
}

.series-preview-kicker {
    color: rgba(255, 250, 245, 0.78);
    text-transform: uppercase;
    letter-spacing: .16em;
    font-size: .8rem;
}

.series-preview-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.series-preview-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    font-size: .9rem;
}

.series-wizard-progress {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.series-step-pill {
    min-height: 48px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid rgba(197, 123, 87, 0.18);
    background: rgba(255, 255, 255, 0.68);
    font-weight: 700;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.series-step-pill.is-active,
.series-step-pill.is-complete {
    background: rgba(197, 123, 87, 0.14);
    border-color: rgba(197, 123, 87, 0.34);
}

.series-step-pill:hover {
    transform: translateY(-1px);
}

.series-wizard-form,
.series-wizard-step,
.subject-chip-grid {
    display: grid;
    gap: 18px;
}

.series-wizard-step {
    display: none;
}

.series-wizard-step.is-active {
    display: grid;
}

.subject-chip-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.subject-chip,
.journey-card {
    position: relative;
    display: flex;
    align-items: stretch;
    min-height: 102px;
    padding: 22px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(183, 144, 99, 0.14);
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.subject-chip input,
.journey-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.subject-chip span,
.journey-card-copy {
    display: grid;
    gap: 6px;
    align-content: center;
}

.subject-chip span {
    font-size: 1.05rem;
    font-weight: 700;
}

.subject-chip.is-selected,
.journey-card.is-selected,
.subject-chip:has(input:checked),
.journey-card:has(input:checked) {
    border-color: rgba(197, 123, 87, 0.4);
    box-shadow: 0 14px 36px rgba(197, 123, 87, 0.14);
    transform: translateY(-2px);
}

.option-grid-tight {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.journey-card-copy strong {
    display: block;
}

.inline-note-card {
    align-content: start;
}

.inline-note-card strong {
    display: block;
}

.wizard-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.lesson-wizard-progress {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.lesson-step-pill {
    min-height: 46px;
    padding: 0 18px;
    border: 1px solid rgba(183, 144, 99, 0.2);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.66);
    font-weight: 700;
    cursor: pointer;
}

.lesson-step-pill.is-active,
.lesson-step-pill.is-complete {
    background: rgba(183, 144, 99, 0.16);
    border-color: rgba(183, 144, 99, 0.32);
}

.lesson-wizard-form {
    gap: 20px;
}

.lesson-wizard-step {
    display: none;
    gap: 18px;
}

.lesson-wizard-step.is-active {
    display: grid;
}

.wizard-copy {
    display: grid;
    gap: 8px;
}

.wizard-copy h2,
.upload-card-head strong {
    margin: 0;
}

.wizard-copy p,
.upload-card-head p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.checkbox-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 18px 20px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(183, 144, 99, 0.16);
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.checkbox-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(107, 79, 53, 0.08);
}

.checkbox-card span {
    display: grid;
    gap: 4px;
}

.checkbox-card input {
    margin-top: 4px;
}

.toggle-block {
    display: none;
}

.toggle-block.is-visible {
    display: grid;
    gap: 14px;
}

.upload-card,
.option-card {
    display: grid;
    gap: 14px;
    padding: 20px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.56);
    border: 1px solid rgba(183, 144, 99, 0.14);
}

.upload-card.compact {
    padding: 14px;
}

.upload-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.upload-status-stack {
    display: grid;
    justify-items: end;
    gap: 6px;
}

.upload-status-stack small {
    color: var(--muted);
    font-weight: 700;
}

.upload-dropzone {
    display: grid;
    gap: 10px;
    place-items: center;
    text-align: center;
    min-height: 160px;
    padding: 18px;
    border-radius: 22px;
    border: 2px dashed rgba(183, 144, 99, 0.28);
    background: linear-gradient(180deg, rgba(252, 248, 243, 0.92), rgba(248, 240, 231, 0.7));
    cursor: pointer;
    transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.upload-dropzone:hover {
    transform: translateY(-1px);
    border-color: rgba(183, 144, 99, 0.42);
    box-shadow: 0 16px 30px rgba(107, 79, 53, 0.06);
}

.upload-dropzone input {
    display: none;
}

.option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.wizard-actions {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    flex-wrap: wrap;
}

.wizard-autorefresh-note {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 20px;
    background: rgba(255, 240, 242, 0.72);
    border: 1px solid rgba(212, 80, 97, 0.18);
}

.wizard-autorefresh-note p {
    margin: 0;
    color: #9f3043;
}

.lesson-list {
    display: grid;
    gap: 12px;
}

.lesson-list-rich {
    gap: 14px;
}

.lesson-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.lesson-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(183, 144, 99, 0.14);
    border: 1px solid rgba(183, 144, 99, 0.22);
    font-weight: 700;
}

.lesson-pill-muted {
    background: rgba(99, 113, 140, 0.08);
    border-color: rgba(99, 113, 140, 0.14);
    color: var(--muted);
}

.lesson-row {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 18px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.56);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.lesson-row-rich {
    align-items: center;
}

.lesson-row-copy {
    display: grid;
    gap: 10px;
}

.lesson-row-copy p {
    margin: 0;
    color: var(--muted);
}

.lesson-row-topline {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.empty-state {
    min-height: 180px;
    padding: 18px;
    border-radius: 22px;
    border: 1px dashed rgba(84, 110, 168, 0.32);
    display: grid;
    place-items: center;
    text-align: center;
}

.empty-state.small {
    min-height: 120px;
}

.board-empty-card {
    width: 100%;
    height: 100%;
}

.board-status-card {
    min-height: 0;
    height: 100%;
    padding: 18px;
}

.board-status-card.is-danger {
    border-color: rgba(212, 80, 97, 0.32);
    color: #b33347;
    background: rgba(255, 240, 242, 0.74);
}

.board-status-card.is-success {
    border-color: rgba(29, 156, 115, 0.28);
    color: #147655;
}

.board-status-card.is-muted {
    border-color: rgba(99, 113, 140, 0.18);
    color: var(--muted);
}

.board-page {
    height: 100dvh;
    padding: clamp(8px, 1.2vw, 14px);
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(214, 187, 150, 0.2), transparent 20%),
        linear-gradient(160deg, #f7efe6 0%, #fbf6ef 30%, #f1e6d9 100%);
}

.board-shell {
    height: calc(100dvh - (clamp(8px, 1.2vw, 14px) * 2));
    max-height: calc(100dvh - (clamp(8px, 1.2vw, 14px) * 2));
    overflow: hidden;
}

.board-topbar,
.board-canvas,
.goal-panel,
.gadget-panel {
    border-radius: 26px;
    box-shadow: 0 10px 20px rgba(107, 79, 53, 0.07);
}

.board-topbar-main {
    display: grid;
    grid-template-columns: minmax(160px, 210px) minmax(0, 1fr);
    align-items: center;
    gap: clamp(14px, 2vw, 28px);
    min-width: 0;
    width: 100%;
}

.board-topbar,
.board-canvas,
.goal-panel,
.gadget-panel,
.board-lesson-headline h1,
.board-lesson-headline .eyebrow,
.clock-time,
.clock-date {
    font-family: 'Grundschrift', 'Aptos', 'Segoe UI', 'Trebuchet MS', sans-serif;
}

.board-clock-block {
    display: grid;
    place-items: center;
    text-align: center;
    min-width: 0;
    width: 100%;
}

.board-lesson-headline {
    min-width: 0;
    display: grid;
    gap: 2px;
    align-content: center;
}

.board-lesson-headline h1 {
    margin: 0;
    font-size: clamp(1.18rem, 1.9vw, 1.95rem);
    line-height: 1.05;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clock-time {
    font-size: clamp(1.15rem, 1.9vw, 1.95rem);
    font-weight: 800;
}

.clock-date {
    color: var(--muted);
}

.board-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 25vw);
    gap: clamp(8px, 1vw, 14px);
    min-height: 0;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
}

.board-main-emergency {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 24vw);
}

.board-stage {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: clamp(4px, 0.55vw, 8px);
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.board-topbar {
    display: grid;
    align-items: center;
    gap: 12px;
    padding: clamp(8px, 0.9vw, 11px) clamp(12px, 1.5vw, 16px);
    min-height: 0;
    overflow: hidden;
}

.board-canvas {
    padding: clamp(8px, 1vw, 12px);
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.board-sidebar {
    display: grid;
    grid-template-rows: minmax(208px, 0.74fr) minmax(360px, 1.16fr);
    gap: clamp(4px, 0.55vw, 8px);
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.board-sidebar-emergency {
    grid-template-rows: minmax(0, 1fr);
}

.goal-panel,
.gadget-panel {
    padding: clamp(8px, 0.95vw, 12px);
    min-height: 0;
    overflow: hidden;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}

.goal-panel {
    align-self: stretch;
}

.gadget-panel {
    min-height: 320px;
    position: relative;
}

.pdf-stage,
.goal-stage {
    position: relative;
    min-height: 0;
    height: 100%;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 251, 246, 0.96), rgba(248, 240, 231, 0.88));
    border: 1px solid rgba(183, 144, 99, 0.1);
    overflow: hidden;
}

.pdf-stage {
    min-height: 0;
    display: grid;
    place-items: center;
    padding: clamp(8px, 1vw, 14px);
}

.pdf-stage-whiteboard {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 247, 242, 0.98));
    padding: clamp(6px, 0.8vw, 10px);
}

.goal-stage {
    min-height: 0;
    display: grid;
    place-items: center;
    max-height: 100%;
}

.board-page-image {
    display: none;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    min-width: 0;
    min-height: 0;
    object-fit: contain;
    object-position: center;
    place-self: center;
    border-radius: 18px;
    box-shadow: 0 8px 18px rgba(107, 79, 53, 0.08);
}

.pdf-placeholder {
    display: grid;
    place-items: center;
    text-align: center;
    gap: 10px;
    padding: clamp(14px, 1.6vw, 26px);
    color: var(--muted);
}

.blank-board-sheet {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 20px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(252, 250, 246, 0.98));
    box-shadow: inset 0 0 0 1px rgba(183, 144, 99, 0.12), 0 12px 24px rgba(107, 79, 53, 0.06);
    place-self: center;
}

.board-lesson-headline-emergency .eyebrow {
    color: var(--primary);
}

.board-canvas-emergency {
    padding: clamp(10px, 1vw, 14px);
}

.board-emergency-hint {
    position: absolute;
    left: 20px;
    bottom: 18px;
    z-index: 5;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 251, 246, 0.94);
    box-shadow: 0 10px 20px rgba(107, 79, 53, 0.08);
    color: var(--muted);
    font-size: .88rem;
}

.timer-widget {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto auto;
    gap: 12px;
    padding: 14px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 250, 245, 0.78), rgba(246, 237, 226, 0.62));
    min-height: 100%;
    justify-items: center;
    align-content: center;
    text-align: center;
    width: min(100%, 360px);
    margin-inline: auto;
    align-self: center;
}

.timer-stepper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin-inline: auto;
}

.timer-ring-shell {
    position: relative;
    width: min(100%, 268px);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    margin-inline: auto;
}

.timer-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer-ring-track,
.timer-ring-progress {
    fill: none;
    stroke-width: 8;
}

.timer-ring-track {
    stroke: rgba(183, 144, 99, 0.14);
}

.timer-ring-progress {
    stroke: var(--primary);
    stroke-linecap: round;
    transition: stroke-dashoffset 0.8s linear;
}

.timer-ring-progress.is-warning {
    stroke: #cf7a4b;
}

.timer-ring-progress.is-finished {
    stroke: #1d9c73;
}

.timer-adjust {
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: rgba(255, 251, 246, 0.92);
    color: var(--text);
    box-shadow: 0 10px 20px rgba(107, 79, 53, 0.08);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
}

.timer-display {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: clamp(2.3rem, 3.6vw, 3.8rem);
    font-weight: 800;
    transition: transform 0.18s ease, color 0.18s ease;
}

.timer-display.is-warning {
    color: #b85f34;
    animation: timerPulse 0.95s ease-in-out infinite;
}

.timer-display.is-finished {
    color: #1d9c73;
}

.timer-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
    margin-inline: auto;
}

.panel-head {
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 4px;
}

.panel-head strong,
.gadget-placeholder,
.goal-panel .empty-state {
    min-width: 0;
}

.gadget-placeholder {
    display: grid;
    gap: 8px;
    align-content: center;
    min-height: 100%;
    text-align: center;
}

.gadget-placeholder p {
    margin: 0;
    line-height: 1.45;
    font-size: .92rem;
}

.music-widget {
    width: min(100%, 360px);
    display: grid;
    gap: 18px;
    justify-items: center;
    align-content: center;
    text-align: center;
    margin-inline: auto;
}

.music-widget strong {
    font-size: 1.25rem;
}

.music-widget.is-playing .music-copy strong {
    color: #8d5f39;
}

.music-copy {
    display: grid;
    gap: 8px;
}

.music-copy p {
    margin: 0;
    color: var(--muted);
    line-height: 1.4;
}

.music-turntable {
    position: relative;
    display: grid;
    place-items: center;
    width: min(100%, 220px);
    padding: 14px;
}

.music-progress-ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    overflow: visible;
}

.music-progress-track,
.music-progress-value {
    fill: none;
    stroke-width: 6;
}

.music-progress-track {
    stroke: rgba(160, 126, 94, 0.18);
}

.music-progress-value {
    stroke: #b79063;
    stroke-linecap: round;
    transition: stroke-dashoffset .2s linear, stroke .2s ease;
    filter: drop-shadow(0 0 8px rgba(183, 144, 99, 0.22));
}

.music-widget.is-playing .music-progress-value {
    stroke: #8d5f39;
}

.music-disc {
    position: relative;
    width: 148px;
    aspect-ratio: 1;
    border-radius: 999px;
    background:
        radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.2), transparent 18%),
        radial-gradient(circle at center, #e8d3bc 0 11%, #926f51 11.5% 16%, #261a13 16.5% 57%, #3b2a1f 57.5% 61.5%, #201712 62% 68%, #6a4d38 68.5% 74%, #e7d7c3 74.5% 100%);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.12),
        inset 0 -10px 20px rgba(0,0,0,0.22),
        0 16px 34px rgba(78, 55, 34, 0.18);
    transform-origin: center;
    will-change: transform;
}

.music-disc-label {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    position: relative;
    overflow: hidden;
}

.music-disc::before {
    content: '';
    position: absolute;
    inset: 11%;
    border-radius: 999px;
    background:
        repeating-radial-gradient(
            circle at center,
            rgba(255,255,255,0.05) 0 2px,
            rgba(255,255,255,0.01) 2px 6px,
            rgba(0,0,0,0.06) 6px 7px
        );
    opacity: .42;
    pointer-events: none;
}

.music-disc::after {
    content: '';
    position: absolute;
    inset: 9%;
    border-radius: 999px;
    background: linear-gradient(130deg, rgba(255,255,255,0.18), transparent 32%, transparent 68%, rgba(255,255,255,0.08));
    mix-blend-mode: screen;
    opacity: .5;
    pointer-events: none;
}

.music-disc-label::after {
    content: '';
    position: absolute;
    inset: 42%;
    border-radius: 999px;
    background: #f6ecdf;
    box-shadow: inset 0 0 0 3px rgba(120, 86, 58, 0.12);
}

.music-disc.is-spinning {
    animation: musicSpin 2.35s linear infinite;
}

.music-arm {
    position: absolute;
    width: 72px;
    height: 10px;
    top: 24px;
    right: 18px;
    border-radius: 999px;
    background: linear-gradient(180deg, #d7c0a8, #a48261);
    transform-origin: 92% 50%;
    transform: rotate(-28deg);
    box-shadow: 0 6px 14px rgba(78, 55, 34, 0.12);
    z-index: 2;
}

.music-arm::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    right: -4px;
    top: -3px;
    border-radius: 999px;
    background: #efe4d6;
    box-shadow: inset 0 0 0 3px rgba(129, 94, 65, 0.18);
}

.music-arm::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 6px;
    left: -8px;
    top: 2px;
    border-radius: 999px;
    background: #7c5d45;
}

.music-widget.is-playing .music-arm {
    animation: musicArmGroove 3.2s ease-in-out infinite;
}

.music-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.board-animal-overlay {
    position: absolute;
    right: 12px;
    bottom: 32px;
    width: clamp(62px, 7.4vw, 110px);
    z-index: 2;
    pointer-events: none;
}

.board-animal {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 12px 18px rgba(91, 62, 37, 0.16));
    transform-origin: center bottom;
}

.board-animal.is-dancing {
    animation: quokkaDance 1.9s ease-in-out infinite;
}

.music-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 115;
    opacity: 0;
    transition: opacity .3s ease;
}

.music-overlay.is-active {
    opacity: 1;
}

.music-overlay-glow {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 25%, rgba(255, 224, 174, 0.26), transparent 28%),
        radial-gradient(circle at 78% 30%, rgba(255, 195, 142, 0.22), transparent 26%),
        radial-gradient(circle at 50% 78%, rgba(202, 155, 102, 0.18), transparent 30%);
    animation: musicGlowDrift 7s ease-in-out infinite alternate;
}

.music-overlay-waves {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
}

.music-wave {
    position: absolute;
    width: min(78vw, 860px);
    aspect-ratio: 1;
    border-radius: 999px;
    border: 2px solid rgba(183, 144, 99, 0.16);
    opacity: 0;
    animation: musicWavePulse 4.8s ease-out infinite;
}

.music-wave:nth-child(2) {
    animation-delay: 1.2s;
}

.music-wave:nth-child(3) {
    animation-delay: 2.4s;
}

.music-overlay-notes {
    position: absolute;
    inset: 0;
}

.music-note {
    position: absolute;
    font-size: clamp(2rem, 4vw, 4rem);
    color: rgba(123, 90, 63, 0.34);
    animation: noteFloat 5s ease-in-out infinite;
}

.music-note:nth-child(1) { left: 10%; bottom: 12%; animation-delay: 0s; }
.music-note:nth-child(2) { left: 24%; bottom: 22%; animation-delay: .6s; }
.music-note:nth-child(3) { left: 42%; bottom: 10%; animation-delay: 1.1s; }
.music-note:nth-child(4) { right: 28%; bottom: 18%; animation-delay: .9s; }
.music-note:nth-child(5) { right: 14%; bottom: 14%; animation-delay: 1.5s; }
.music-note:nth-child(6) { right: 38%; bottom: 28%; animation-delay: 2s; }
.music-note:nth-child(7) { left: 58%; bottom: 20%; animation-delay: 2.6s; }
.music-note:nth-child(8) { left: 74%; bottom: 8%; animation-delay: 3.1s; }

.traffic-widget {
    width: min(100%, 360px);
    display: grid;
    gap: 14px;
    justify-items: center;
    align-content: center;
    margin-inline: auto;
}

.traffic-stack {
    width: min(100%, 150px);
    display: grid;
    gap: 12px;
    padding: 18px 14px;
    border-radius: 36px;
    background:
        linear-gradient(180deg, rgba(113, 87, 63, 0.98), rgba(84, 62, 44, 0.98)),
        repeating-linear-gradient(180deg, rgba(255,255,255,0.02) 0 6px, rgba(0,0,0,0.01) 6px 12px);
    box-shadow:
        inset 0 2px 0 rgba(255,255,255,0.08),
        inset 0 -10px 20px rgba(38, 24, 15, 0.18),
        0 10px 20px rgba(78, 55, 34, 0.12);
    border: 1px solid rgba(255, 243, 229, 0.08);
}

.traffic-light {
    display: grid;
    place-items: center;
    min-height: 90px;
    padding: 10px;
    border: 0;
    border-radius: 26px;
    background: rgba(255, 244, 232, 0.05);
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.traffic-bulb {
    width: 58px;
    height: 58px;
    border-radius: 999px;
    display: block;
    box-shadow:
        inset 0 4px 8px rgba(255,255,255,0.14),
        inset 0 -8px 12px rgba(0,0,0,0.16),
        0 0 0 4px rgba(43, 28, 18, 0.26);
    opacity: .38;
    filter: saturate(.9) brightness(.92);
    transition: opacity 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.traffic-bulb-red {
    background: radial-gradient(circle at 35% 35%, #f6b09b, #c45b44 56%, #7a3023 100%);
}

.traffic-bulb-yellow {
    background: radial-gradient(circle at 35% 35%, #f2dd9d, #c39a3c 56%, #7a5b1c 100%);
}

.traffic-bulb-green {
    background: radial-gradient(circle at 35% 35%, #b8e5bf, #4b9361 56%, #2d5d3f 100%);
}

.traffic-light.is-active {
    background: rgba(255, 246, 236, 0.1);
    transform: scale(1.015);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.traffic-light.is-active .traffic-bulb {
    opacity: 1;
    transform: scale(1.03);
    filter: saturate(1.08) brightness(1.02);
}

.traffic-light[data-traffic-state="red"].is-active .traffic-bulb {
    box-shadow:
        inset 0 4px 8px rgba(255,255,255,0.15),
        inset 0 -8px 12px rgba(0,0,0,0.14),
        0 0 0 4px rgba(43, 28, 18, 0.26),
        0 0 18px rgba(196, 91, 68, 0.24);
}

.traffic-light[data-traffic-state="yellow"].is-active .traffic-bulb {
    box-shadow:
        inset 0 4px 8px rgba(255,255,255,0.15),
        inset 0 -8px 12px rgba(0,0,0,0.14),
        0 0 0 4px rgba(43, 28, 18, 0.26),
        0 0 18px rgba(195, 154, 60, 0.22);
}

.traffic-light[data-traffic-state="green"].is-active .traffic-bulb {
    box-shadow:
        inset 0 4px 8px rgba(255,255,255,0.15),
        inset 0 -8px 12px rgba(0,0,0,0.14),
        0 0 0 4px rgba(43, 28, 18, 0.26),
        0 0 18px rgba(75, 147, 97, 0.2);
}

.traffic-caption {
    display: grid;
    gap: 8px;
    justify-items: center;
    text-align: center;
}

.traffic-caption p {
    margin: 0;
    color: var(--muted);
    line-height: 1.4;
}

.gadget-carousel {
    position: relative;
    min-height: 0;
    height: 100%;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.gadget-page {
    display: none;
    height: 100%;
    width: 100%;
    position: relative;
}

.gadget-page.is-active {
    display: grid;
    place-items: center;
    align-content: center;
}

.gadget-pdf-widget {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px;
    width: min(calc(100% - 80px), 316px);
    height: 100%;
    margin-inline: auto;
}

.gadget-pdf-head {
    margin-bottom: 0;
}

.gadget-pdf-stage {
    min-height: 100%;
    border-radius: 20px;
}

.gadget-timer-indicator {
    position: absolute;
    top: 4px;
    right: 8px;
    z-index: 5;
    width: 110px;
    height: 110px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: rgba(255, 251, 246, 0.94);
    box-shadow: 0 10px 20px rgba(107, 79, 53, 0.12);
    backdrop-filter: blur(14px);
    opacity: 0;
    transform: scale(0.88);
    transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.gadget-timer-indicator.is-visible {
    opacity: 1;
    transform: scale(1);
}

.gadget-timer-indicator.is-warning {
    box-shadow: 0 10px 22px rgba(184, 95, 52, 0.2);
}

.gadget-timer-indicator.is-finished {
    box-shadow: 0 10px 22px rgba(29, 156, 115, 0.24);
}

.gadget-timer-indicator-ring {
    width: 84px;
    height: 84px;
    transform: rotate(-90deg);
}

.gadget-timer-indicator-track,
.gadget-timer-indicator-progress {
    fill: none;
    stroke-width: 4;
}

.gadget-timer-indicator-track {
    stroke: rgba(183, 144, 99, 0.18);
}

.gadget-timer-indicator-progress {
    stroke: var(--primary);
    stroke-linecap: round;
    transition: stroke-dashoffset 0.8s linear;
}

.gadget-timer-indicator-progress.is-warning {
    stroke: #cf7a4b;
}

.gadget-timer-indicator-progress.is-finished {
    stroke: #1d9c73;
}

.gadget-timer-indicator-label {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 1.08rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--text);
}

.gadget-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 18px rgba(107, 79, 53, 0.12);
    color: var(--text);
    cursor: pointer;
    font-size: 1.55rem;
    line-height: 1;
}

.gadget-nav-left {
    left: 8px;
}

.gadget-nav-right {
    right: 8px;
}

.gadget-nav:hover {
    background: rgba(255, 255, 255, 0.98);
}

.gadget-pager {
    display: none;
}

.gadget-page-dot {
    width: 12px;
    height: 12px;
    border: 0;
    border-radius: 999px;
    background: rgba(151, 118, 88, 0.22);
    cursor: pointer;
}

.gadget-page-dot.is-active {
    background: var(--primary);
    transform: scale(1.08);
}

.confetti-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 120;
}

.confetti-piece {
    position: absolute;
    top: -12vh;
    width: 12px;
    height: 22px;
    border-radius: 4px;
    opacity: 0;
}

.confetti-layer.is-active .confetti-piece {
    opacity: 1;
    animation-name: confettiFall;
    animation-timing-function: cubic-bezier(.18,.69,.32,1);
    animation-fill-mode: forwards;
}

.goal-panel .empty-state,
.goal-stage .empty-state {
    min-height: 0;
    height: 100%;
    padding: 8px;
}

.panel-head strong {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: .96rem;
}

.slide-nav {
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(18px);
    box-shadow: 0 10px 22px rgba(107, 79, 53, 0.1);
    color: var(--text);
    cursor: pointer;
    font-size: 2rem;
    line-height: 1;
}

.slide-nav-overlay {
    position: absolute;
    bottom: 16px;
    z-index: 3;
}

.slide-nav-overlay-left {
    left: 16px;
}

.slide-nav-overlay-right {
    right: 16px;
}

.slide-nav:hover {
    background: rgba(255, 255, 255, 0.98);
}

.timer-actions .btn {
    min-height: 44px;
}

@keyframes timerPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.12);
    }
}

@keyframes confettiFall {
    0% {
        transform: translateY(-12vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    100% {
        transform: translateY(115vh) rotate(680deg);
        opacity: 0;
    }
}

@keyframes musicSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes musicArmGroove {
    0%, 100% {
        transform: rotate(-28deg);
    }
    50% {
        transform: rotate(-24deg);
    }
}

@keyframes musicGlowDrift {
    0% {
        transform: scale(1) translate3d(0, 0, 0);
        opacity: .88;
    }
    100% {
        transform: scale(1.06) translate3d(0, -1.2%, 0);
        opacity: 1;
    }
}

@keyframes musicWavePulse {
    0% {
        transform: scale(0.58);
        opacity: 0;
    }
    20% {
        opacity: .52;
    }
    100% {
        transform: scale(1.18);
        opacity: 0;
    }
}

@keyframes noteFloat {
    0%, 100% {
        transform: translateY(0) rotate(-4deg);
        opacity: .18;
    }
    50% {
        transform: translateY(-18px) rotate(4deg);
        opacity: .42;
    }
}

@keyframes quokkaDance {
    0%, 100% {
        transform: translate3d(0, 0, 0) rotate(-4deg) scale(1);
    }
    20% {
        transform: translate3d(10px, -14px, 0) rotate(3deg) scale(1.02);
    }
    45% {
        transform: translate3d(0, -22px, 0) rotate(-2deg) scale(1.04);
    }
    70% {
        transform: translate3d(-10px, -10px, 0) rotate(4deg) scale(1.01);
    }
}

@media (max-height: 860px) {
    .board-topbar {
        padding: 7px 11px;
    }

    .clock-time {
        font-size: clamp(1rem, 1.55vw, 1.45rem);
    }

    .clock-date,
    .gadget-placeholder p {
        font-size: .78rem;
    }

    .goal-panel,
    .gadget-panel,
    .board-canvas {
        padding: 7px;
    }

    .timer-widget {
        gap: 10px;
        padding: 10px;
    }

    .traffic-stack {
        width: min(100%, 138px);
        padding: 12px;
        gap: 10px;
    }

    .traffic-light {
        min-height: 78px;
        padding: 8px;
    }

    .traffic-bulb {
        width: 42px;
        height: 42px;
    }

    .timer-stepper {
        gap: 8px;
    }

    .timer-display {
        font-size: clamp(1.8rem, 2.8vw, 2.6rem);
    }

    .timer-actions .btn {
        min-height: 34px;
        padding: 0 10px;
        font-size: .8rem;
    }

    .timer-adjust {
        width: 36px;
        height: 36px;
        font-size: 1.45rem;
    }

    .slide-nav {
        width: 40px;
        height: 40px;
        font-size: 1.45rem;
    }
}

@media (max-width: 1100px) {
    .hero-card,
    .admin-shell,
    .detail-layout {
        grid-template-columns: 1fr;
    }

    .dashboard-hero,
    .dashboard-grid,
    .series-wizard-hero {
        grid-template-columns: 1fr;
    }

    .board-main {
        grid-template-columns: minmax(0, 1fr) 300px;
    }

    .board-topbar-main {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
        gap: 10px;
    }

    .board-lesson-headline {
        justify-items: center;
    }

    .board-lesson-headline h1 {
        white-space: normal;
        text-align: center;
        text-wrap: balance;
    }
}

@media (max-width: 920px) {
    .board-main {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr) minmax(180px, 28dvh);
    }

    .board-sidebar {
        grid-template-columns: 1.05fr .95fr;
        grid-template-rows: minmax(0, 1fr);
    }
}

@media (max-width: 720px) {
    body {
        padding: 14px;
    }

    .series-wizard-shell,
    .dashboard-hero,
    .project-shelf,
    .team-panel,
    .account-panel,
    .series-card,
    .detail-main,
    .detail-side,
    .lessons-panel {
        padding: 18px;
    }

    .dashboard-hero-stats,
    .wizard-summary-grid {
        grid-template-columns: 1fr 1fr;
    }

    .lesson-editor-hero,
    .editor-block,
    .simple-settings-card summary,
    .details-form,
    .simple-settings-card .team-list {
        padding: 16px;
    }

    .section-heading-inline {
        align-items: flex-start;
        flex-direction: column;
    }

    .team-member-card,
    .lesson-row,
    .lesson-row-rich {
        flex-direction: column;
        align-items: stretch;
    }

    .board-page {
        padding: 8px;
    }

    .board-shell {
        gap: 8px;
        height: calc(100dvh - 16px);
    }

    .board-topbar,
    .board-canvas,
    .goal-panel,
    .gadget-panel {
        padding: 8px;
    }

    .board-topbar {
        align-items: start;
    }

    .board-topbar-main {
        display: grid;
        gap: 8px;
        justify-items: center;
        text-align: center;
    }

    .board-main {
        grid-template-rows: minmax(0, 1fr) minmax(170px, 25dvh);
    }

    .board-sidebar {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .panel-head {
        margin-bottom: 6px;
    }

    .panel-head .eyebrow,
    .clock-date,
    .gadget-placeholder p {
        font-size: .74rem;
    }

    .board-lesson-headline h1 {
        font-size: clamp(1rem, 3vw, 1.28rem);
    }

    .traffic-stack {
        width: min(100%, 124px);
        padding: 10px;
    }

    .traffic-light {
        min-height: 68px;
        padding: 6px;
    }

    .traffic-bulb {
        width: 34px;
        height: 34px;
    }

    .slide-nav {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
    }

    .slide-nav-overlay {
        bottom: 10px;
    }

    .slide-nav-overlay-left {
        left: 10px;
    }

    .slide-nav-overlay-right {
        right: 10px;
    }

    .timer-display {
        font-size: 1.9rem;
    }

    .timer-actions .btn {
        min-height: 32px;
        padding: 0 8px;
        font-size: .75rem;
    }

    .timer-adjust {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
    }

    .gadget-pager {
        padding-top: 6px;
    }
}

@media (max-width: 720px) {
    body {
        padding: 16px;
    }

    .hero-card,
    .auth-card,
    .admin-sidebar,
    .series-card,
    .detail-main,
    .detail-side,
    .lessons-panel {
        padding: 18px;
    }

    .hero-card {
        gap: 18px;
    }

    .form-grid,
    .section-heading-inline,
    .lesson-row,
    .board-canvas-header {
        grid-template-columns: 1fr;
        display: grid;
    }

    .teacher-overview-page {
        padding: 0;
    }

    .teacher-overview-choice {
        padding: 14px;
    }

    .teacher-overview-topbar {
        align-items: stretch;
        flex-direction: column;
    }

    .subject-choice-grid {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .subject-choice-card {
        grid-template-columns: 120px minmax(0, 1fr);
        grid-template-rows: 1fr;
        justify-items: start;
        min-height: 150px;
    }

    .subject-choice-image {
        width: 120px;
        border-radius: 22px;
    }

    .subject-choice-card strong {
        font-size: 2.4rem;
    }

    .teacher-series-grid {
        grid-template-columns: 1fr;
    }

    .lesson-row-meta {
        justify-content: flex-start;
    }

    .lesson-editor-actions {
        justify-items: stretch;
        width: 100%;
    }
}
