:root {
    --cream: #fff6ea;
    --muted: #e4d0bc;
    --orange: #ff8a2a;
    --gold: #ffb347;
    --line: rgba(255, 160, 70, 0.34);
    --panel: rgba(10, 7, 16, 0.86);
    --danger: #ffb4b4;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--cream);
    font-family: Outfit, "Segoe UI", sans-serif;
    font-weight: 400;
    background: #07060c url("../../gb-mobile.jpg") center top / cover no-repeat fixed;
}

@media (min-width: 900px) {
    body {
        background-image: url("../../bg-desktop.jpg");
        background-position: center center;
    }
}

.fog {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(1000px 620px at 50% 18%, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.48)),
        linear-gradient(180deg, rgba(12, 6, 20, 0.12), rgba(5, 3, 10, 0.38));
}

.wrap {
    position: relative;
    z-index: 1;
    width: min(1080px, calc(100% - 28px));
    margin: 0 auto;
    padding: 28px 0 56px;
}

body.admin .wrap { width: min(1180px, calc(100% - 24px)); }

img { max-width: 100%; }

a { color: var(--gold); }

h1, h2, h3 { font-weight: 700; line-height: 1.15; }

h1 {
    margin: 8px 0 12px;
    font-size: clamp(34px, 6vw, 64px);
}

h1 span {
    display: block;
    margin-top: 4px;
    font-family: Creepster, fantasy;
    font-weight: 400;
    color: var(--gold);
    text-shadow: 0 0 18px rgba(255, 120, 20, 0.45);
    letter-spacing: 0.02em;
}

h2 { margin: 0 0 8px; font-size: 26px; }

h2 i, h3 i { color: var(--orange); margin-right: 6px; }

.hero { position: relative; text-align: center; padding: 8px 0 18px; }

.logo {
    width: min(280px, 72vw);
    filter: drop-shadow(0 16px 28px rgba(0, 0, 0, 0.6));
    animation: float 4.8s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.kicker {
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #f0c14a;
    font-size: 13px;
    font-weight: 700;
}

.lead {
    max-width: 680px;
    margin: 0 auto;
    color: var(--muted);
    font-size: 18px;
}

.lead-left { color: var(--muted); font-size: 17px; }

.deadline {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    text-align: left;
    max-width: 640px;
    margin: 18px auto 0;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 138, 42, 0.16);
    border: 1px solid rgba(255, 176, 70, 0.55);
    box-shadow: 0 0 24px rgba(255, 120, 20, 0.18);
}
.deadline i { color: var(--gold); font-size: 22px; margin-top: 2px; }
.deadline strong { display: block; font-size: 16px; }
.deadline span { display: block; color: var(--muted); font-size: 14px; margin-top: 4px; }
.deadline.is-closed {
    background: rgba(159, 36, 52, 0.28);
    border-color: rgba(255, 90, 90, 0.45);
}
.deadline.is-closed i { color: #ffb4b4; }

.mail-card { max-width: 640px; }
.mail-box {
    margin: 16px 0;
    padding: 16px;
    border-radius: 16px;
    background: rgba(255, 138, 42, 0.12);
    border: 1px solid var(--line);
    text-align: center;
}
.mail-address {
    font-size: 22px;
    font-weight: 700;
    color: var(--gold);
    word-break: break-all;
    margin: 6px 0 10px;
}
.mail-steps { color: var(--muted); padding-left: 20px; }
.mail-steps li { margin: 10px 0; }

.floaters { position: absolute; inset: 0; pointer-events: none; }
.floaters i { position: absolute; color: rgba(255, 196, 130, 0.55); animation: drift 7s ease-in-out infinite; }
.floaters i:nth-child(1) { top: 12px; left: 4%; font-size: 24px; }
.floaters i:nth-child(2) { top: 46px; right: 6%; font-size: 20px; animation-delay: -2s; }
.floaters i:nth-child(3) { bottom: 8px; left: 16%; font-size: 16px; animation-delay: -3.4s; }

@keyframes drift {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@media (max-width: 700px) {
    .floaters { display: none; }
    body { background-attachment: scroll; }
}

@media (prefers-reduced-motion: reduce) {
    .logo, .floaters i { animation: none; }
}

.steps, .grid-2, .stats { display: grid; gap: 14px; }
.steps, .grid-2 { margin: 18px 0; }

@media (min-width: 760px) {
    .steps { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 900px) {
    .grid-2 { grid-template-columns: 1fr 1fr; }
}

.step, .panel, .stat {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(7px);
}

.step { padding: 16px; }
.step b {
    display: block;
    font-family: Creepster, fantasy;
    font-size: 30px;
    font-weight: 400;
    color: var(--gold);
}
.step p { margin: 6px 0 0; color: var(--muted); }

.panel { padding: 22px; }
.panel + .panel { margin-top: 16px; }

.rules { margin-bottom: 18px; }
.rules li { margin: 8px 0; color: var(--muted); }
.rules i { width: 1.2em; color: var(--orange); }

.field { margin: 0 0 14px; }
.field label, .check { display: block; font-weight: 600; margin-bottom: 6px; }
.req { color: #ffb25a; }

input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="search"], textarea, select {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 176, 90, 0.28);
    color: var(--cream);
    border-radius: 14px;
    padding: 12px 14px;
    font: inherit;
}

textarea { min-height: 170px; resize: vertical; line-height: 1.45; }

input[type="search"]::-webkit-search-cancel-button { filter: invert(1); }
input:focus, textarea:focus, select:focus {
    outline: 2px solid rgba(255, 140, 40, 0.75);
    border-color: transparent;
}

.help, .muted { color: var(--muted); font-size: 14px; }
.help { margin: 6px 0 0; }

.counter { margin: 6px 0 0; font-size: 13px; color: #ffb089; font-weight: 700; }
.counter.is-ok { color: #9dffc4; }

.note {
    color: #f3dcc6;
    background: rgba(255, 138, 42, 0.1);
    border-left: 3px solid var(--orange);
    padding: 10px 12px;
    border-radius: 0 12px 12px 0;
    margin: 0 0 14px;
}

.check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-weight: 400;
    color: var(--muted);
}
.check input { margin-top: 4px; }

.passline { display: flex; gap: 8px; }
.passline input { flex: 1; }

.btn, button.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    cursor: pointer;
    border-radius: 999px;
    padding: 12px 18px;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    color: #1a0d08;
    background: linear-gradient(180deg, #ffb25a, #ff7a18);
    box-shadow: 0 8px 22px rgba(255, 110, 20, 0.28);
}

.btn:hover { transform: translateY(-1px); }
.btn-ghost, .peek {
    background: transparent;
    color: #ffd7ad;
    border: 1px solid rgba(255, 170, 80, 0.45);
    box-shadow: none;
}
.peek {
    border-radius: 14px;
    padding: 0 12px;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
}
.btn-listen { background: #3d6ea8; color: #fff; box-shadow: none; }
.btn-red { background: #9f2434; color: #fff; box-shadow: none; }
.btn-yellow { background: #e0b12e; color: #2a2108; box-shadow: none; }
.btn-green { background: #1e8f4e; color: #fff; box-shadow: none; }
.btn-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid rgba(255, 90, 90, 0.5);
    box-shadow: none;
}
.btn-small { padding: 8px 12px; font-size: 14px; }
.btn.is-current { outline: 2px solid #fff; outline-offset: 2px; }
.btn[disabled] { opacity: 0.65; cursor: wait; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.wide { width: 100%; }

.alert {
    border-radius: 16px;
    padding: 12px 14px;
    margin: 0 0 16px;
    background: rgba(10, 7, 16, 0.9);
    border: 1px solid var(--line);
}
.alert-ok { border-color: rgba(80, 200, 120, 0.6); color: #d9ffe6; }
.alert-err { border-color: rgba(255, 90, 90, 0.55); color: #ffd0d0; }
.alert-info { border-color: rgba(240, 193, 74, 0.55); }
.alert ul { margin: 0; padding-left: 18px; }

.filebox {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 14px;
    border-radius: 16px;
    border: 1px dashed rgba(255, 160, 70, 0.55);
    background: rgba(255, 120, 20, 0.06);
    cursor: pointer;
}
.filebox input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.filebox i { font-size: 28px; color: var(--gold); }
.filebox small { display: block; color: var(--muted); }

.pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.pill-on { background: #1e8f4e; color: #fff; }
.pill-rev { background: #e0b12e; color: #2a2108; }
.pill-no { background: #9f2434; color: #fff; }
.pill-listen { background: #3d6ea8; color: #fff; }
.pill-wait { background: rgba(255, 255, 255, 0.08); color: #f0d2b0; }
.pill-ok { background: rgba(40, 160, 90, 0.25); color: #b6ffd0; }

.stats { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); margin: 16px 0; }
.stat {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 12px 14px;
}
.stat strong { display: block; font-size: 28px; color: var(--gold); }
.stat span { color: var(--muted); font-size: 13px; }
.stat.active { outline: 2px solid var(--gold); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filters input, .filters select { width: auto; flex: 1 1 180px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 860px; }
th, td { text-align: left; padding: 12px 8px; vertical-align: top; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
th { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: #e7c59a; }
tr.row-on { box-shadow: inset 4px 0 0 #3dd68c; }
tr.row-rev { box-shadow: inset 4px 0 0 #f5c542; }
tr.row-no { box-shadow: inset 4px 0 0 #e23b4a; }
tr.row-listen { box-shadow: inset 4px 0 0 #5d8fd4; }
audio { width: min(100%, 240px); height: 36px; }
.song-box audio { width: 100%; height: 42px; }
.play-cell { margin-top: 8px; }
.play-dot {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #1a0d08;
    background: #ffb25a;
    font-size: 11px;
}
.play-dot i { margin-left: 1px; }
tr.is-playing .play-dot { background: #fff; }
.list-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.list-head h2 { margin: 0; }
.status-form { margin: 0; }
.status-select {
    min-width: 168px;
    font-weight: 700;
    cursor: pointer;
}
.status-select.is-listen { border-color: #5d8fd4; background: rgba(61, 110, 168, 0.35); }
.status-select.is-rev { border-color: #e0b12e; background: rgba(224, 177, 46, 0.28); color: #fff6ea; }
.status-select.is-no { border-color: #e23b4a; background: rgba(159, 36, 52, 0.45); }
.status-select.is-on { border-color: #3dd68c; background: rgba(30, 143, 78, 0.4); }
.status-select.is-saving { opacity: 0.6; }

.story {
    white-space: pre-wrap;
    color: var(--muted);
    max-height: 280px;
    overflow: auto;
    padding-right: 6px;
}

.danger-zone {
    margin-top: 18px;
    padding: 16px;
    border-radius: 16px;
    border: 1px dashed rgba(255, 90, 90, 0.5);
}
.danger-zone h3 { margin-top: 0; }

.split { display: grid; gap: 16px; }
@media (min-width: 900px) {
    .split { grid-template-columns: 0.9fr 1.1fr; align-items: start; }
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 18px;
}
.brand { display: flex; gap: 10px; align-items: center; text-decoration: none; color: var(--cream); font-weight: 700; }
.brand img { width: 64px; height: auto; }
.nav { display: flex; gap: 8px; flex-wrap: wrap; }
.nav a {
    color: #ffd7ad;
    text-decoration: none;
    border: 1px solid rgba(255, 170, 80, 0.35);
    border-radius: 999px;
    padding: 8px 12px;
}

.footer { text-align: center; margin-top: 28px; color: var(--muted); }
.footer a { color: #c8b39a; }

.pager { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.center-card { max-width: 560px; margin: 24px auto; }

.dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    background: rgba(10, 7, 16, 0.96);
    border-top: 1px solid var(--line);
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
    padding: 10px 14px 12px;
}
.dock[hidden] { display: none; }
.dock-top {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.dock-meta { min-width: 140px; max-width: 280px; flex: 1; }
.dock-meta strong, .dock-meta span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-meta span { color: var(--muted); font-size: 13px; }
.dock .status-select { width: auto; min-width: 150px; flex: 0 0 auto; }
.dock-audio {
    position: absolute;
    width: 280px;
    height: 40px;
    opacity: 0;
    pointer-events: none;
}
.dock-seek {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}
.dock-play { width: 36px; height: 36px; font-size: 13px; }
.dock-seek span {
    min-width: 42px;
    font-variant-numeric: tabular-nums;
    font-size: 13px;
    color: #ffd7ad;
}
#studio-left { text-align: right; }
.seek-wrap {
    position: relative;
    flex: 1;
    height: 28px;
    min-width: 120px;
    cursor: pointer;
}
.seek-track {
    position: absolute;
    left: 0;
    right: 0;
    top: 11px;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    overflow: hidden;
}
.seek-fill {
    width: 0;
    height: 100%;
    background: #ff8a2a;
}
.seek-thumb {
    position: absolute;
    top: 6px;
    left: 0;
    width: 16px;
    height: 16px;
    margin-left: -8px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #ff8a2a;
    box-shadow: 0 0 0 4px rgba(255, 138, 42, 0.28);
    pointer-events: none;
}
.seek {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 28px;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}
.dock-list {
    display: flex;
    gap: 8px;
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    overflow-x: auto;
}
.dock-list li { margin: 0; flex: 0 0 auto; }
.dock-list button {
    border: 1px solid rgba(255, 176, 90, 0.25);
    background: transparent;
    color: inherit;
    border-radius: 999px;
    padding: 6px 10px;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    max-width: 240px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dock-list button.is-current {
    background: rgba(255, 138, 42, 0.22);
    border-color: rgba(255, 176, 70, 0.7);
}
body.dock-open { padding-bottom: 196px; }
tr.is-playing { background: rgba(255, 138, 42, 0.12); }
