:root {
    --ink: #101820;
    --muted: #67717f;
    --line: #dde3ea;
    --paper: #ffffff;
    --soft: #f4f7f8;
    --teal: #0f766e;
    --coral: #e55b3c;
    --amber: #e7a83e;
    --shadow: 0 18px 50px rgba(16, 24, 32, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: #dfe7ea;
    font-family: Inter, Arial, sans-serif;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.app-shell {
    width: min(100%, 440px);
    min-height: 100vh;
    margin: 0 auto;
    padding: 18px 16px 92px;
    background: var(--soft);
}

.app-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 10px 0 18px;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-logo {
    width: 72px;
    height: 72px;
    flex: 0 0 auto;
    object-fit: cover;
    padding: 0;
    background: var(--paper);
    border: 2px solid var(--paper);
    border-radius: 50%;
    box-shadow: 0 10px 26px rgba(16, 24, 32, 0.14);
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--teal);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

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

h1 {
    margin-bottom: 0;
    font-size: clamp(1.65rem, 8vw, 2.25rem);
    line-height: 1;
}

h2 {
    margin-bottom: 0;
    font-size: 1.45rem;
    line-height: 1.08;
}

h3 {
    margin-bottom: 10px;
}

.icon-button {
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    color: var(--paper);
    background: var(--ink);
    border: 0;
    border-radius: 50%;
    font-weight: 800;
}

.hero-card {
    min-height: 210px;
    display: grid;
    align-content: end;
    gap: 20px;
    padding: 22px;
    color: var(--paper);
    background:
        linear-gradient(180deg, rgba(16, 24, 32, 0.08), rgba(16, 24, 32, 0.86)),
        url("https://images.unsplash.com/photo-1516321318423-f06f85e504b3?auto=format&fit=crop&w=900&q=80") center/cover;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.hero-card h2 {
    max-width: 270px;
    font-size: 1.75rem;
}

.hero-card p {
    margin-bottom: 0;
}

.hero-label {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
}

.button {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border: 0;
    border-radius: 6px;
    font-weight: 800;
    text-decoration: none;
}

.button.light {
    width: fit-content;
    color: var(--ink);
    background: var(--paper);
}

.button.dark {
    color: var(--paper);
    background: var(--ink);
}

.button.buy {
    color: var(--paper);
    background: var(--teal);
}

.button.watch {
    color: #ffffff;
    background: #15803d;
}

.button.details {
    color: #ffffff;
    background: #673ee5;
}

.button.join {
    color: var(--paper);
    background: #15803d;
}

#joinLiveHero,
.live-actions .button.join,
.modal .button.join {
    color: #ffffff;
    background: #15803d;
}

.tabs {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin: 20px 0;
    padding: 5px;
    background: #e7ecef;
    border-radius: 8px;
}

.tab {
    min-height: 42px;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 800;
}

.tab.active {
    color: var(--ink);
    background: var(--paper);
    box-shadow: 0 8px 20px rgba(16, 24, 32, 0.08);
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

.auth-panel {
    display: grid;
    gap: 12px;
    margin: 0 0 18px;
    padding: 14px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.auth-panel.signed-in {
    grid-template-columns: 1fr auto;
    align-items: center;
}

.auth-status {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.auth-status strong {
    display: block;
    color: var(--ink);
    font-size: 1rem;
}

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

.auth-form h3 {
    margin-bottom: 0;
}

.auth-form.hidden,
.auth-panel.signed-in .auth-form {
    display: none;
}

.hidden {
    display: none !important;
}

.link-button {
    width: fit-content;
    min-height: 36px;
    padding: 0;
    color: var(--teal);
    background: transparent;
    border: 0;
    font-weight: 800;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

select,
input {
    width: 100%;
    min-height: 44px;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0 12px;
}

select {
    width: auto;
}

.course-list,
.live-list,
.test-list,
.admin-grid {
    display: grid;
    gap: 14px;
}

.course-card,
.live-card,
.test-card,
.stat-card,
.player-card,
.admin-form,
.notice {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.course-card {
    overflow: hidden;
}

.course-image {
    aspect-ratio: 16 / 9;
    display: grid;
    align-content: space-between;
    padding: 16px;
    color: var(--paper);
    background: linear-gradient(135deg, #0f766e, #17202a);
    background-position: center;
    background-size: cover;
}

.course-image.theme-red {
    background: linear-gradient(135deg, #d9482e, #17202a);
}

.course-image.theme-amber {
    background: linear-gradient(135deg, #d99a2b, #17202a);
}

.course-image.theme-blue {
    background: linear-gradient(135deg, #2563eb, #17202a);
}

.course-image.theme-purple {
    background: linear-gradient(135deg, #7c3aed, #17202a);
}

.course-image.theme-green {
    background: linear-gradient(135deg, #15803d, #17202a);
}

.formula {
    font-size: 1.65rem;
    font-weight: 900;
}

.course-tag {
    width: fit-content;
    padding: 7px 10px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
}

.course-body,
.live-card,
.test-card,
.stat-card,
.player-card,
.admin-form,
.notice {
    padding: 16px;
}

.course-meta,
.live-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
    color: var(--muted);
    font-size: 0.86rem;
}

.pill {
    padding: 6px 9px;
    background: var(--soft);
    border-radius: 999px;
    font-weight: 700;
}

.course-actions,
.live-actions,
.test-actions {
    display: flex;
    gap: 10px;
}

.course-actions .button,
.live-actions .button,
.test-actions .button {
    flex: 1;
}

.button.danger {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0 12px;
    color: var(--paper);
    background: var(--coral);
}

.price {
    color: var(--teal);
    font-weight: 900;
}

.locked {
    color: var(--coral);
}

.empty-state {
    padding: 24px;
    color: var(--muted);
    background: var(--paper);
    border: 1px dashed var(--line);
    border-radius: 8px;
    line-height: 1.55;
}

.admin-grid {
    grid-template-columns: repeat(2, 1fr);
    margin-bottom: 14px;
}

.stat-card strong {
    display: block;
    font-size: 1.7rem;
}

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

.admin-form {
    display: grid;
    gap: 12px;
    margin-bottom: 14px;
}

.admin-form label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 700;
}

.admin-lecture-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.admin-lecture-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    padding: 10px;
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.admin-lecture-row span {
    font-size: 0.86rem;
    font-weight: 800;
}

.small-note {
    color: var(--muted);
    font-size: 0.86rem;
}

.notice {
    margin-top: 14px;
    color: var(--muted);
    line-height: 1.55;
}

.notice.hidden {
    display: none;
}

.bottom-nav {
    width: min(100%, 440px);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    margin: 0 auto;
    padding: 10px 16px 16px;
    background: rgba(255, 255, 255, 0.92);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(12px);
}

.bottom-nav button {
    min-height: 42px;
    color: var(--muted);
    background: var(--soft);
    border: 0;
    border-radius: 6px;
    font-weight: 800;
}

.bottom-nav button.active {
    color: var(--paper);
    background: var(--ink);
}

.modal {
    width: min(92vw, 400px);
    padding: 0;
    border: 0;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.modal::backdrop {
    background: rgba(16, 24, 32, 0.55);
}

.modal-content {
    padding: 18px;
}

.video-frame {
    aspect-ratio: 16 / 9;
    display: grid;
    place-items: center;
    margin-bottom: 14px;
    color: var(--paper);
    background:
        linear-gradient(rgba(16, 24, 32, 0.18), rgba(16, 24, 32, 0.74)),
        url("https://images.unsplash.com/photo-1522202176988-66273c2fd55f?auto=format&fit=crop&w=900&q=80") center/cover;
    border-radius: 8px;
    font-weight: 900;
}

.lecture-list {
    display: grid;
    gap: 8px;
    margin: 14px 0;
}

.lecture-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.lecture-row strong {
    font-size: 0.9rem;
}

.lecture-row span {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.dummy-video {
    aspect-ratio: 16 / 9;
    display: grid;
    align-content: space-between;
    position: relative;
    overflow: hidden;
    margin-bottom: 14px;
    padding: 14px;
    color: var(--paper);
    background:
        linear-gradient(135deg, rgba(15, 118, 110, 0.88), rgba(16, 24, 32, 0.92)),
        radial-gradient(circle at 70% 20%, rgba(231, 168, 62, 0.38), transparent 34%);
    border-radius: 8px;
}

.drive-video {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    margin-bottom: 14px;
    background: var(--ink);
    border-radius: 8px;
}

.drive-video iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.video-glow {
    width: 86px;
    height: 86px;
    position: absolute;
    top: 34%;
    left: 50%;
    border: 2px solid rgba(255, 255, 255, 0.24);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.dummy-video.playing .video-glow {
    animation: pulse 1.6s linear infinite;
}

.video-status {
    width: fit-content;
    padding: 6px 9px;
    background: rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
}

.play-button {
    width: 74px;
    height: 74px;
    place-self: center;
    color: var(--ink);
    background: var(--paper);
    border: 0;
    border-radius: 50%;
    font-weight: 900;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.24);
}

.video-controls {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
    font-size: 0.78rem;
    font-weight: 800;
}

.progress-track {
    height: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 999px;
}

.progress-bar {
    width: 0;
    height: 100%;
    background: var(--paper);
    border-radius: inherit;
}

.sample-videos {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 14px 0;
}

.sample-video {
    min-height: 40px;
    padding: 0 8px;
    color: var(--muted);
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 800;
}

.sample-video.active {
    color: var(--paper);
    background: var(--teal);
    border-color: var(--teal);
}

@keyframes pulse {
    0% {
        opacity: 0.95;
        transform: translate(-50%, -50%) scale(0.85);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.8);
    }
}

@media (min-width: 720px) {
    .app-shell,
    .bottom-nav {
        border-right: 1px solid var(--line);
        border-left: 1px solid var(--line);
    }
}
