/* 01. Base */
:root {
    --bg: #11100e;
    --panel: #201d18;
    --text: #f8f1e6;
    --muted: #c5b9a6;
    --dark-text: #1a1712;
    --line: rgba(255, 255, 255, .14);
    --gold: #f4bf45;
    --teal: #3ec7b3;
    --red: #e6533f;
    --shadow: 0 24px 60px rgba(0, 0, 0, .34);
    --radius: 8px;
    --max: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

img {
    display: block;
    max-width: 100%;
}

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

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

.hero-inner,
.section-inner {
    width: min(var(--max), calc(100% - 32px));
    margin: 0 auto;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 18px;
    color: var(--gold);
    font-size: .86rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.eyebrow::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--red);
    box-shadow: 0 0 0 6px rgba(230, 83, 63, .18);
}

.button {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 18px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-weight: 800;
    line-height: 1;
    transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.button:hover,
.button:focus-visible {
    transform: translateY(-2px);
    outline: none;
}

.button-primary {
    background: var(--gold);
    color: #1c1307;
    box-shadow: 0 16px 32px rgba(244, 191, 69, .22);
}

.button-secondary {
    border-color: rgba(255, 255, 255, .28);
    color: var(--text);
    background: rgba(255, 255, 255, .08);
}

.button-secondary:hover,
.button-secondary:focus-visible {
    border-color: rgba(62, 199, 179, .7);
}

.play-dot {
    width: 13px;
    height: 13px;
    display: inline-block;
    clip-path: polygon(0 0, 100% 50%, 0 100%);
    background: currentColor;
}

/* 02. Header */
.site-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 20;
    background: rgba(17, 16, 14, .86);
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    backdrop-filter: blur(14px);
}

.nav {
    width: min(var(--max), calc(100% - 32px));
    min-height: 72px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0;
    white-space: nowrap;
}

.brand-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(244, 191, 69, .6);
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(244, 191, 69, .24), rgba(62, 199, 179, .18));
    color: var(--gold);
    font-weight: 900;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-links a {
    padding: 10px 12px;
    color: var(--muted);
    font-size: .93rem;
    border-radius: var(--radius);
}

.nav-links a:hover,
.nav-links a:focus-visible {
    color: var(--text);
    background: rgba(255, 255, 255, .08);
    outline: none;
}

/* 03. Hero */
.hero {
    min-height: 86svh;
    padding: 118px 0 58px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(17, 16, 14, .96) 0%, rgba(17, 16, 14, .82) 44%, rgba(17, 16, 14, .26) 100%),
        linear-gradient(0deg, rgba(17, 16, 14, .45), rgba(17, 16, 14, .12)),
        url('../img/fafaobanner.png') center right / cover no-repeat;
}

.hero-content {
    width: min(680px, 100%);
}

h1 {
    margin-bottom: 18px;
    font-size: 4.35rem;
    line-height: .96;
    letter-spacing: 0;
    text-wrap: balance;
}

.hero-text {
    max-width: 600px;
    margin-bottom: 28px;
    color: #efe4d4;
    font-size: 1.17rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 34px;
}

.hero-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    max-width: 620px;
}

.hero-meta div {
    min-height: 86px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: var(--radius);
    background: rgba(17, 16, 14, .6);
}

.hero-meta strong {
    display: block;
    color: var(--gold);
    font-size: 1.5rem;
    line-height: 1.1;
}

.hero-meta span {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: .86rem;
}

/* 04. Sections */
section {
    padding: 76px 0;
}

.section-dark {
    background: var(--bg);
}

.section-warm {
    background: #f4efe4;
    color: var(--dark-text);
}

.section-rust {
    background: #241510;
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 30px;
}

.section-head h2 {
    margin-bottom: 0;
    font-size: 2.35rem;
    line-height: 1.05;
    letter-spacing: 0;
}

.section-head p {
    max-width: 520px;
    margin-bottom: 0;
    color: var(--muted);
}

.section-warm .section-head p {
    color: #665c4c;
}

/* 05. Live and community */
.feature-grid {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    gap: 18px;
    align-items: stretch;
}

.live-panel,
.community-panel {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.live-panel {
    min-height: 390px;
    display: grid;
    align-content: end;
    padding: 26px;
    position: relative;
    background:
        linear-gradient(0deg, rgba(0, 0, 0, .92), rgba(0, 0, 0, .14)),
        url('https://images.unsplash.com/photo-1511882150382-421056c89033?auto=format&fit=crop&w=1300&q=80') center / cover no-repeat;
}

.live-status {
    width: fit-content;
    margin-bottom: 14px;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(230, 83, 63, .95);
    color: #fff;
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.live-panel h2 {
    max-width: 560px;
    margin-bottom: 10px;
    font-size: 2.2rem;
    line-height: 1.08;
}

.live-panel p {
    max-width: 600px;
    margin-bottom: 18px;
    color: #eadfce;
}

.live-carousel {
    padding: 0;
    align-content: stretch;
    background: #15130f;
}

.live-carousel-state {
    min-height: 390px;
    display: grid;
    align-content: end;
    padding: 26px;
    background:
        linear-gradient(0deg, rgba(0, 0, 0, .92), rgba(0, 0, 0, .14)),
        url('https://images.unsplash.com/photo-1511882150382-421056c89033?auto=format&fit=crop&w=1300&q=80') center / cover no-repeat;
}

.live-status-offline {
    background: rgba(99, 91, 79, .94);
}

.live-carousel-viewport,
.live-carousel-track {
    min-height: 390px;
    height: 100%;
}

.live-slide {
    min-height: 390px;
    display: none;
    align-content: end;
    position: relative;
    overflow: hidden;
    padding: 26px;
}

.live-slide.is-active {
    display: grid;
}

.live-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(0deg, rgba(0, 0, 0, .94), rgba(0, 0, 0, .16));
}

.live-slide img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.live-slide-content {
    position: relative;
    z-index: 2;
}

.live-carousel-controls {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: var(--radius);
    background: rgba(17, 16, 14, .72);
    backdrop-filter: blur(10px);
}

.live-carousel-controls[hidden] {
    display: none;
}

.live-carousel-button,
.live-carousel-dots button {
    border: 0;
    color: var(--text);
    background: transparent;
    cursor: pointer;
}

.live-carousel-button {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: var(--radius);
    font-size: 1.5rem;
    line-height: 1;
}

.live-carousel-button:hover,
.live-carousel-button:focus-visible {
    background: rgba(255, 255, 255, .12);
    outline: none;
}

.live-carousel-dots {
    display: flex;
    gap: 6px;
}

.live-carousel-dots button {
    width: 9px;
    height: 9px;
    padding: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .34);
}

.live-carousel-dots button.is-active {
    background: var(--gold);
}

.community-panel {
    display: grid;
    align-content: space-between;
    gap: 24px;
    padding: 24px;
    background: var(--panel);
    border: 1px solid var(--line);
}

.community-panel h3 {
    margin-bottom: 10px;
    font-size: 1.6rem;
}

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

.community-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--muted);
}

.check {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(62, 199, 179, .14);
    color: var(--teal);
    font-weight: 900;
}

/* 06. Tutorials */
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.tutorial-card {
    overflow: hidden;
    border-radius: var(--radius);
    background: #fffaf1;
    border: 1px solid #e3d7c3;
    box-shadow: 0 16px 34px rgba(39, 28, 12, .08);
}

.tutorial-card img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.tutorial-body {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.tag {
    width: fit-content;
    margin-bottom: 14px;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(230, 83, 63, .12);
    color: #a33627;
    font-size: .78rem;
    font-weight: 800;
}

.tutorial-card h3 {
    margin-bottom: 10px;
    color: var(--dark-text);
    font-size: 1.34rem;
    line-height: 1.15;
}

.tutorial-card p {
    color: #5f5649;
}

.tutorial-card a {
    width: fit-content;
    margin-top: auto;
    color: #126b60;
    font-weight: 800;
}

/* 07. Schedule */
.schedule-grid {
    display: grid;
    grid-template-columns: .8fr 1.2fr;
    gap: 28px;
    align-items: start;
}

.schedule-copy h2 {
    margin-bottom: 12px;
    font-size: 2.2rem;
    line-height: 1.08;
}

.schedule-copy p {
    color: var(--muted);
}

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

.schedule-list li {
    display: grid;
    grid-template-columns: 120px 88px 1fr;
    gap: 14px;
    align-items: center;
    min-height: 72px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .06);
}

.schedule-list strong {
    color: var(--gold);
}

.schedule-list span {
    color: var(--muted);
}

/* 08. Videos */
.video-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.video-card {
    min-height: 222px;
    display: grid;
    align-content: end;
    overflow: hidden;
    position: relative;
    padding: 16px;
    border-radius: var(--radius);
    background:
        linear-gradient(0deg, rgba(17, 16, 14, .92), rgba(17, 16, 14, .22)),
        url('https://images.unsplash.com/photo-1511512578047-dfb367046420?auto=format&fit=crop&w=700&q=80') center / cover no-repeat;
}

.video-card:nth-child(2) {
    background-image:
        linear-gradient(0deg, rgba(17, 16, 14, .92), rgba(17, 16, 14, .22)),
        url('https://images.unsplash.com/photo-1542751371-adc38448a05e?auto=format&fit=crop&w=700&q=80');
}

.video-card:nth-child(3) {
    background-image:
        linear-gradient(0deg, rgba(17, 16, 14, .92), rgba(17, 16, 14, .22)),
        url('https://images.unsplash.com/photo-1511882150382-421056c89033?auto=format&fit=crop&w=700&q=80');
}

.video-card:nth-child(4) {
    background-image:
        linear-gradient(0deg, rgba(17, 16, 14, .92), rgba(17, 16, 14, .22)),
        url('https://images.unsplash.com/photo-1511512578047-dfb367046420?auto=format&fit=crop&w=700&q=80');
}

.video-play {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    margin-bottom: 52px;
    border-radius: 50%;
    background: var(--gold);
    color: #1c1307;
}

.video-card h3 {
    margin-bottom: 4px;
    font-size: 1.08rem;
    line-height: 1.15;
}

.video-card p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: .9rem;
}

/* 09. CTA and footer */
.cta {
    padding: 64px 0;
    background:
        linear-gradient(90deg, rgba(230, 83, 63, .18), rgba(62, 199, 179, .16)),
        #17130f;
}

.cta-inner {
    width: min(var(--max), calc(100% - 32px));
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.cta h2 {
    max-width: 700px;
    margin-bottom: 8px;
    font-size: 2rem;
    line-height: 1.12;
}

.cta p {
    margin-bottom: 0;
    color: var(--muted);
}

.site-footer {
    padding: 28px 0;
    border-top: 1px solid rgba(255, 255, 255, .1);
    color: var(--muted);
    background: #0d0c0a;
}

.footer-inner {
    width: min(var(--max), calc(100% - 32px));
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    font-size: .9rem;
}

.footer-links {
    display: flex;
    gap: 14px;
}

/* 10. Auth and admin */
.auth-page,
.admin-page {
    min-height: 100vh;
    padding: 32px 16px;
    background:
        linear-gradient(90deg, rgba(17, 16, 14, .96), rgba(17, 16, 14, .84)),
        url('../img/fafaobanner.png') center / cover no-repeat;
}

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

.auth-card,
.admin-panel {
    width: min(760px, 100%);
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(32, 29, 24, .94);
    box-shadow: var(--shadow);
}

.auth-card h1,
.admin-panel h1 {
    margin: 22px 0 10px;
    font-size: 2.2rem;
    line-height: 1.05;
}

.auth-card p,
.admin-panel p {
    color: var(--muted);
}

.is-disabled {
    opacity: .62;
    pointer-events: none;
}

.notice {
    margin: 18px 0;
    padding: 12px 14px;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, .16);
}

.notice-error {
    background: rgba(230, 83, 63, .12);
    color: #ffd9d4;
}

.notice-success {
    background: rgba(62, 199, 179, .12);
    color: #d7fff7;
}

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

.admin-header {
    width: min(var(--max), 100%);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(17, 16, 14, .82);
}

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

.admin-nav a {
    color: var(--muted);
    font-weight: 800;
}

.admin-nav a:hover,
.admin-nav a:focus-visible {
    color: var(--text);
    outline: none;
}

.admin-panel {
    width: min(var(--max), 100%);
    margin: 0 auto;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 26px;
}

.admin-card {
    min-height: 138px;
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .06);
}

.admin-card strong {
    color: var(--gold);
    font-size: 1.1rem;
}

.admin-card span {
    color: var(--muted);
}

.user-table-wrap {
    margin-top: 24px;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.user-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 780px;
}

.user-table th,
.user-table td {
    padding: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    text-align: left;
    vertical-align: middle;
}

.user-table th {
    color: var(--gold);
    font-size: .84rem;
    text-transform: uppercase;
}

.user-table td {
    color: var(--muted);
}

.user-table tr:last-child td {
    border-bottom: 0;
}

.user-table strong,
.user-table code {
    color: var(--text);
}

.user-table span {
    display: block;
}

.role-badge {
    width: fit-content;
    padding: 5px 9px;
    border-radius: 999px;
    color: var(--text);
    background: rgba(62, 199, 179, .14);
}

.inline-form {
    margin: 0;
}

.button-small {
    min-height: 36px;
    padding: 9px 12px;
    font-size: .86rem;
}

.table-muted {
    color: #81786b;
}

.settings-form {
    display: grid;
    gap: 18px;
    margin-top: 22px;
}

.settings-form fieldset {
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.settings-form legend {
    padding: 0 8px;
    color: var(--gold);
    font-weight: 900;
}

.settings-form label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-weight: 800;
}

.settings-form input,
.settings-form textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: var(--radius);
    color: var(--text);
    background: rgba(0, 0, 0, .22);
    font: inherit;
}

.settings-form textarea {
    min-height: 96px;
    resize: vertical;
}

.settings-form input:focus,
.settings-form textarea:focus {
    border-color: rgba(62, 199, 179, .7);
    outline: none;
}

.checkbox-row {
    display: flex !important;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 10px !important;
}

.checkbox-row input {
    width: 18px;
    min-height: 18px;
}

.form-hint {
    margin-bottom: 0;
    overflow-wrap: anywhere;
}

.form-hint code {
    color: var(--text);
}

/* 11. Responsive */
@media (max-width: 980px) {
    h1 {
        font-size: 3.25rem;
    }

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

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

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

@media (max-width: 720px) {
    .site-header {
        position: sticky;
    }

    .nav {
        min-height: auto;
        padding: 12px 0;
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .nav-links {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .nav-links a {
        flex: 0 0 auto;
    }

    .hero {
        min-height: 84svh;
        padding: 58px 0 42px;
        background-position: center;
    }

    h1 {
        font-size: 2.55rem;
    }

    .hero-text {
        font-size: 1rem;
    }

    .hero-meta,
    .card-grid,
    .video-grid {
        grid-template-columns: 1fr;
    }

    .hero-meta div {
        min-height: 72px;
    }

    section {
        padding: 54px 0;
    }

    .section-head,
    .cta-inner,
    .footer-inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .section-head h2,
    .live-panel h2,
    .schedule-copy h2 {
        font-size: 1.85rem;
    }

    .schedule-list li {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .tutorial-body {
        min-height: auto;
    }

    .admin-header,
    .admin-grid {
        grid-template-columns: 1fr;
    }

    .admin-header {
        align-items: flex-start;
        flex-direction: column;
    }
}
