:root {
    --ink: #25324d;
    --muted: #6b7280;
    --paper: #fffaf0;
    --panel: #ffffff;
    --aqua: #5fc3b2;
    --sun: #f2b84b;
    --berry: #e77b93;
    --blue: #7b8fe8;
    --line: #e7e0d2;
    --danger: #c44747;
    --shadow: 0 18px 45px rgba(37, 50, 77, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    font-family: ui-rounded, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--paper);
}

body {
    margin: 0;
    min-height: 100vh;
}

.pwa-hidden body {
    display: none;
}

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

input,
button {
    font: inherit;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    font-size: 1.15rem;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--ink);
    color: white;
}

.child-screen {
    background:
        radial-gradient(circle at top left, rgba(95, 195, 178, 0.22), transparent 34rem),
        linear-gradient(145deg, #fffaf0, #f7f1ff 70%, #ecfaf7);
}

.child-top,
.watch-top,
.admin-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 18px 0;
}

.brand-child .brand-mark {
    background: var(--aqua);
}

.parent-link,
.admin-nav a,
.admin-nav button {
    color: var(--muted);
    font-weight: 700;
}

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.admin-nav form {
    margin: 0;
}

.admin-nav button {
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.child-home,
.admin-layout {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 16px 0 48px;
}

.admin-layout.narrow {
    width: min(840px, calc(100% - 32px));
}

.welcome-band,
.admin-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: var(--shadow);
}

.welcome-band h1,
.admin-hero h1 {
    margin: 4px 0 0;
    max-width: 720px;
    font-size: clamp(2rem, 6vw, 4.8rem);
    line-height: 0.95;
}

.admin-hero h1 {
    font-size: clamp(2rem, 4vw, 3.6rem);
    line-height: 1;
}

.soft-label {
    margin: 0;
    color: var(--berry);
    font-size: 0.8rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.time-pill,
.subscription-box {
    min-width: 150px;
    padding: 18px;
    border-radius: 8px;
    background: var(--ink);
    color: white;
    text-align: center;
    font-weight: 900;
}

.subscription-box {
    display: grid;
    gap: 4px;
}

.subscription-box strong {
    font-size: 1.5rem;
}

.subscription-box small {
    color: rgba(255, 255, 255, 0.75);
}

.playlist-row {
    margin-top: 34px;
}

.section-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.section-heading.between {
    justify-content: space-between;
}

.section-heading h2,
.panel h2 {
    margin: 0;
    font-size: 1.35rem;
}

.color-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.kid-card {
    display: grid;
    align-content: end;
    min-height: 190px;
    padding: 18px;
    border: 1px solid rgba(37, 50, 77, 0.08);
    border-radius: 8px;
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.35), transparent),
        linear-gradient(145deg, var(--aqua), var(--blue));
    color: white;
    box-shadow: var(--shadow);
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.kid-card:nth-child(2n) {
    background: linear-gradient(145deg, var(--sun), var(--berry));
}

.kid-card:focus-visible,
.kid-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 22px 50px rgba(37, 50, 77, 0.18);
    outline: 3px solid white;
}

.play-badge {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    margin-bottom: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
    font-weight: 900;
}

.kid-card-title {
    font-size: 1.25rem;
    font-weight: 900;
}

.kid-card-meta {
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.86);
    font-weight: 700;
}

.watch-screen {
    background: #111827;
    color: white;
}

.watch-top h1 {
    margin: 0;
    font-size: 1.1rem;
    text-align: center;
}

.round-button {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    font-size: 2rem;
}

.player-shell {
    width: min(1120px, calc(100% - 24px));
    margin: 0 auto;
    padding: 10px 0 34px;
}

.main-video,
.preview-video {
    display: block;
    width: 100%;
    max-height: 76vh;
    border-radius: 8px;
    background: black;
}

.preview-video {
    margin: 16px 0 22px;
    max-height: 420px;
}

.main-audio {
    max-height: none;
    border-radius: 0;
    background: transparent;
}

.audio-stage {
    display: grid;
    place-items: center;
    gap: 22px;
    min-height: 52vh;
    padding: 38px;
    border-radius: 8px;
    background:
        linear-gradient(145deg, rgba(95, 195, 178, 0.25), rgba(123, 143, 232, 0.28)),
        #172033;
}

.preview-audio-stage {
    min-height: 260px;
    margin: 16px 0 22px;
    background:
        linear-gradient(145deg, rgba(95, 195, 178, 0.18), rgba(123, 143, 232, 0.16)),
        #f7fbfb;
}

.audio-art {
    display: grid;
    place-items: center;
    width: min(190px, 45vw);
    aspect-ratio: 1;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.94);
    color: var(--ink);
    font-size: 5rem;
    font-weight: 900;
    box-shadow: var(--shadow);
}

.calm-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: rgba(255, 255, 255, 0.72);
}

.parent-screen {
    background: #f6f8f5;
}

.site-page {
    background:
        linear-gradient(180deg, rgba(95, 195, 178, 0.16), transparent 360px),
        #f6f8f5;
}

.site-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 18px 0;
}

.site-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    font-weight: 800;
}

.site-main {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 22px 0 56px;
}

.site-main.narrow {
    width: min(820px, calc(100% - 32px));
}

.site-hero {
    display: grid;
    gap: 18px;
    padding: clamp(28px, 6vw, 72px) 0 36px;
}

.site-hero h1 {
    max-width: 820px;
    margin: 0;
    font-size: clamp(2.4rem, 7vw, 5.6rem);
    line-height: 0.96;
}

.site-hero p:not(.soft-label) {
    max-width: 680px;
    margin: 0;
    color: var(--muted);
    font-size: 1.16rem;
    line-height: 1.65;
}

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

.site-feature-grid article {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    box-shadow: 0 10px 28px rgba(37, 50, 77, 0.06);
}

.site-feature-grid h2 {
    margin: 0 0 8px;
}

.site-feature-grid p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.auth-page {
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-box,
.panel,
.empty-state,
.danger-zone {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 10px 28px rgba(37, 50, 77, 0.08);
}

.auth-box {
    width: min(420px, 100%);
}

.child-lock {
    background: rgba(255, 255, 255, 0.86);
}

.auth-box h1,
.panel h1 {
    margin: 18px 0;
}

.panel-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    margin: 18px 0;
}

.upload-panel .form-stack {
    max-width: 680px;
}

.settings-panel {
    max-width: 760px;
}

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

label,
fieldset {
    display: grid;
    gap: 7px;
    margin: 0;
    color: var(--ink);
    font-weight: 800;
}

fieldset {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
}

legend {
    padding: 0 6px;
    font-weight: 900;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="time"],
input:not([type]) {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid #d7dce3;
    border-radius: 8px;
    background: white;
}

input[type="file"] {
    padding: 12px;
    border: 1px dashed #bdc7d3;
    border-radius: 8px;
    background: #fbfcfd;
}

.drop-zone {
    display: grid;
    place-items: center;
    min-height: 170px;
    padding: 22px;
    border: 2px dashed #9fb5c6;
    border-radius: 8px;
    background: #fbfcfd;
    text-align: center;
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.drop-zone input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.drop-zone-title {
    font-size: 1.08rem;
    font-weight: 900;
}

.drop-zone-meta {
    color: var(--muted);
    font-weight: 700;
}

.drop-zone.is-dragging {
    border-color: var(--aqua);
    background: #eefbf8;
    transform: translateY(-2px);
}

.check-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.check-list label,
.toggle-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.two-cols,
.three-cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.three-cols {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.button-row,
.item-actions,
.danger-zone {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 16px;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 900;
}

.button-primary {
    background: var(--aqua);
    color: #10231f;
}

.button-secondary {
    background: var(--ink);
    color: white;
}

.button-soft {
    background: #eef6f4;
    color: var(--ink);
}

.button-danger {
    background: var(--danger);
    color: white;
}

.notice {
    margin: 16px 0;
    padding: 14px 16px;
    border-radius: 8px;
    font-weight: 800;
}

.notice-ok {
    background: #e5f7ed;
    color: #1b6f42;
}

.notice-error {
    background: #ffe8e8;
    color: #8b2525;
}

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

.admin-video-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfd;
}

.admin-video-item h3,
.admin-video-item p {
    margin: 0;
}

.admin-video-item p,
.muted,
.hint {
    color: var(--muted);
}

.hint {
    margin: 0;
}

.danger-zone {
    margin-top: 16px;
    justify-content: space-between;
    background: #fff8f8;
}

.guide h2 {
    margin: 26px 0 8px;
}

.guide p,
.guide li {
    line-height: 1.65;
}

@media (max-width: 760px) {
    .welcome-band,
    .admin-hero,
    .admin-video-item,
    .calm-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .panel-grid,
    .two-cols,
    .three-cols {
        grid-template-columns: 1fr;
    }

    .child-top,
    .admin-top,
    .site-top {
        align-items: flex-start;
        flex-direction: column;
    }

    .site-feature-grid {
        grid-template-columns: 1fr;
    }

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

    .kid-card {
        min-height: 150px;
    }
}

@media (max-width: 420px) {
    .video-grid {
        grid-template-columns: 1fr;
    }
}
