/* ─────────────────────────────────────────────────────────────────────────
   Globals & theme
   ───────────────────────────────────────────────────────────────────────── */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #0a0a0f;
    --bg-nav: #0d0d18;
    --bg-card: #13131f;
    --bg-card-hover: #1a1a2e;
    --text: #f0f0f0;
    --text-muted: #8888aa;
    --accent: #e63946;
    --accent-hover: #ff4f5e;
    --yellow: #f4c542;
    --green: #2dc653;
    --border: #2a2a3e;
    --nav-height: 60px;
}

html, body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    min-height: 100vh;
}

a {
    color: var(--text);
    text-decoration: none;
}

a:hover {
    color: var(--accent);
}

/* ─────────────────────────────────────────────────────────────────────────
   Site nav / footer
   ───────────────────────────────────────────────────────────────────────── */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-nav);
    border-bottom: 1px solid var(--border);
    height: var(--nav-height);
}

.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    text-decoration: none;
}

.logo-jump { color: var(--text); }
.logo-the { color: var(--text-muted); font-weight: 400; font-size: 0.9em; }
.logo-scare { color: var(--accent); }

.nav-links {
    display: flex;
    gap: 1.75rem;
}

.nav-links a {
    font-size: 0.95rem;
    color: var(--text-muted);
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text);
}

main {
    min-height: calc(100vh - var(--nav-height) - 56px);
}

main.app-main {
    min-height: 100vh;
}

.site-footer {
    border-top: 1px solid var(--border);
    padding: 1rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ─────────────────────────────────────────────────────────────────────────
   ExpandableDesc
   ───────────────────────────────────────────────────────────────────────── */
.expandable-desc {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    width: 100%;
    text-align: left;
    appearance: none;
    -webkit-appearance: none;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    position: relative;
    overflow: hidden;
    max-height: calc(var(--lines, 3) * 1.6em);
    transition: max-height 0.3s ease;
}

.expandable-desc:not(.expanded)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1.5em;
    background: linear-gradient(transparent, var(--expandable-desc-fade, rgba(10, 10, 20, 0.97)));
    pointer-events: none;
}

.expandable-desc.expanded {
    max-height: 600px;
}

/* ─────────────────────────────────────────────────────────────────────────
   Home page
   ───────────────────────────────────────────────────────────────────────── */
.home {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
}

.hero {
    padding: 4rem 0 3rem;
    text-align: center;
}

.hero-title {
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text);
}

.hero-title em {
    font-style: normal;
    color: var(--accent);
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.content-section { margin-bottom: 3rem; }

.section-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 1.25rem;
}

.shows-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.show-block {
    display: grid;
    grid-template-columns: clamp(130px, 16vw, 185px) 0fr;
    grid-template-rows: auto auto;
    transition: grid-template-columns 0.35s ease, border-color 0.2s;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
}

.show-block.expanded {
    grid-template-columns: clamp(130px, 16vw, 185px) 1fr;
    column-gap: 1rem;
    border-color: rgba(230, 57, 70, 0.6);
}

.tile-col { grid-column: 1; grid-row: 1; }

.show-tile {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    text-align: left;
    color: var(--text);
    padding: 0;
    transition: border-color 0.2s, transform 0.15s;
}

.show-tile:hover {
    border-color: rgba(230, 57, 70, 0.5);
    transform: translateY(-2px);
}

.tile-poster {
    aspect-ratio: 2/3;
    background: #0a0a14;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tile-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.tile-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: var(--border);
    padding: 1rem;
}

.tile-placeholder svg { width: 36px; height: 36px; }

.tile-show-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
}

.tile-info {
    padding: 0.6rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.tile-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tile-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.episode-badge {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.15rem 0.5rem;
    white-space: nowrap;
}

.chevron {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.chevron.open { transform: rotate(180deg); }

.details-col {
    grid-column: 2;
    grid-row: 1;
    overflow: hidden;
    min-width: 0;
    min-height: 0;
}

.details-inset {
    --expandable-desc-fade: color-mix(in srgb, var(--bg) 55%, var(--bg-card) 45%);
    background: color-mix(in srgb, var(--bg) 55%, var(--bg-card) 45%);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4), inset 0 1px 2px rgba(0, 0, 0, 0.3);
    padding: 1.25rem 1.5rem;
    min-height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.details-inset .expandable-desc {
    flex: 1 1 0;
    min-height: 0;
}

.details-inset .expandable-desc:not(.expanded) {
    max-height: none;
}

.show-year {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0;
}

.episodes-col {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.35s ease;
}

.show-block.expanded .episodes-col {
    grid-template-rows: 1fr;
}

.episodes-inset {
    overflow: hidden;
    min-height: 0;
}

.episodes-body {
    background: color-mix(in srgb, var(--bg) 55%, var(--bg-card) 45%);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4), inset 0 1px 2px rgba(0, 0, 0, 0.3);
    padding: 1.25rem;
    margin-top: 1rem;
}

@media (max-width: 640px) {
    .show-block,
    .show-block.expanded {
        grid-template-columns: 1fr;
        column-gap: 0;
    }

    .tile-col { grid-column: 1; grid-row: 1; }
    .details-col {
        display: none;
        grid-column: 1;
        grid-row: 2;
    }
    .episodes-col { grid-column: 1; grid-row: 3; }

    .show-block.expanded .details-col { display: block; }
    .details-inset { min-height: unset; }
    .details-inset .expandable-desc {
        flex: 0 1 auto;
        min-height: auto;
    }
    .coming-group { display: none; }
}

.coming-group {
    position: relative;
    isolation: isolate;
    margin-bottom: 3rem;
    overflow: hidden;
}

.coming-group .coming-section {
    filter: grayscale(1);
    opacity: 0.34;
}

.coming-watermark {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    user-select: none;
    color: rgba(240, 240, 240, 0.2);
    font-size: clamp(3rem, 10vw, 8rem);
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1;
    text-transform: uppercase;
    text-align: center;
    white-space: nowrap;
    transform: rotate(14deg);
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}

.section-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.coming-section .section-title { margin-bottom: 0; }

.coming-body {
    pointer-events: none;
    user-select: none;
}

.search-wrap {
    position: relative;
    max-width: 680px;
}

.search-icon {
    position: absolute;
    left: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.2rem;
    height: 1.2rem;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 1rem 1.25rem 1rem 3rem;
    font-size: 1.05rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    outline: none;
    -webkit-appearance: none;
}

.search-input::placeholder { color: var(--text-muted); }

.ghost-card { pointer-events: none; }
.ghost-header { background: var(--bg-card) !important; }

.ghost-line {
    height: 11px;
    background: var(--border);
    border-radius: 6px;
    margin-bottom: 0.55rem;
}

.ghost-footer {
    margin-top: auto;
    padding-top: 0.75rem;
}

.loading-text {
    color: var(--text-muted);
    padding: 2rem 0;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(230, 57, 70, 0.4);
    transform: translateY(-2px);
}

.card-header {
    background: #0d0d18;
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--border);
}

.card-thumb-placeholder svg { width: 36px; height: 36px; }

.card-body {
    padding: 0.85rem 1rem 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
    margin: 0;
}

.card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

.card-footer {
    margin-top: auto;
    padding-top: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

/* ─────────────────────────────────────────────────────────────────────────
   About / Help (shared)
   ───────────────────────────────────────────────────────────────────────── */
.page {
    padding: 3rem 1.5rem 5rem;
}

.page-inner {
    max-width: 720px;
    margin: 0 auto;
}

.page h1 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--text);
}

.page h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.about-section,
.help-section {
    margin-bottom: 2.5rem;
}

.help-section { margin-bottom: 3rem; }

.help-section h2 { font-size: 1.15rem; margin-bottom: 0.9rem; }

.lead {
    font-size: 1.2rem;
    line-height: 1.7;
    color: var(--text);
}

.page p {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.page p em {
    color: var(--text);
    font-style: normal;
}

.color-legend {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 0.5rem;
}

.color-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.color-dot {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-top: 0.35rem;
}

.color-dot.yellow { background: var(--yellow); }
.color-dot.red { background: var(--accent); }
.color-dot.green { background: var(--green); }

.color-item strong {
    display: block;
    color: var(--text);
    margin-bottom: 0.2rem;
}

.color-item p {
    margin: 0;
    font-size: 0.9rem;
}

/* Help steps */
.steps {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.steps li {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.step-num {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(230, 57, 70, 0.15);
    border: 1px solid rgba(230, 57, 70, 0.3);
    color: var(--accent);
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.1rem;
}

.steps strong {
    display: block;
    color: var(--text);
    margin-bottom: 0.25rem;
    font-size: 0.98rem;
}

.steps p {
    margin: 0;
    font-size: 0.9rem;
}

.color-table {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.color-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.color-chip {
    flex-shrink: 0;
    min-width: 70px;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    text-align: center;
}

.color-chip.black { background: #111; color: #888; border: 1px solid #333; }
.color-chip.yellow { background: var(--yellow); color: #000; }
.color-chip.red { background: var(--accent); color: #fff; }
.color-chip.green { background: var(--green); color: #000; }

.key-table {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.key-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}

kbd {
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    font-size: 0.8rem;
    padding: 0.25rem 0.55rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text);
    min-width: 70px;
    text-align: center;
    flex-shrink: 0;
}

.settings-list,
.tips-list {
    padding-left: 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.settings-list li,
.tips-list li {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.settings-list strong {
    color: var(--text);
}

/* ─────────────────────────────────────────────────────────────────────────
   Episode modal
   ───────────────────────────────────────────────────────────────────────── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 200;
}

.modal-wrap {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    z-index: 201;
}

.modal-card {
    width: min(520px, calc(100vw - 5rem));
    max-height: min(88dvh, 680px);
    background: var(--bg-card, #12121f);
    border: 1px solid var(--border);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.ep-arrow {
    flex: none;
    width: 40px;
    height: 80px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, background 0.15s, color 0.15s;
}
.ep-arrow svg { width: 18px; height: 18px; }
.ep-arrow:hover:not(:disabled) { background: rgba(255,255,255,0.15); color: var(--text); }
.ep-arrow:disabled { cursor: default; opacity: 0 !important; }
.ep-arrow.visible:not(:disabled) { opacity: 1; }

.ep-arrow-prev { border-radius: 40px 0 0 40px; padding-right: 4px; }
.ep-arrow-next { border-radius: 0 40px 40px 0; padding-left: 4px; }

.modal-header {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1rem 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.modal-header-text { min-width: 0; }

.ep-show {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ep-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-close {
    flex: none;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    transition: color 0.15s;
}
.modal-close:hover { color: var(--text); }
.modal-close svg { width: 1.1rem; height: 1.1rem; }

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 1.25rem 0;
}

.status-text {
    color: var(--text-muted);
    text-align: center;
    padding: 2rem 0;
}

.meta-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.thumb-wrap {
    flex: none;
    width: 120px;
    aspect-ratio: 16/9;
    border-radius: 8px;
    overflow: hidden;
    background: #0d0d18;
}

.thumb { width: 100%; height: 100%; object-fit: cover; }

.thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--border);
}
.thumb-placeholder svg { width: 32px; height: 32px; }

.meta-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.3rem;
}

.meta-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
}

.skull-icon { width: 14px; height: 14px; }

.desc-section {
    --expandable-desc-fade: var(--bg-card, #12121f);
    margin-bottom: 1.5rem;
}

.settings-section { margin-bottom: 1.5rem; }

.section-heading {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin: 0 0 0.75rem;
}

.modal-card .setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    gap: 1rem;
}

.setting-label { font-size: 0.9rem; color: var(--text); }

.number-input {
    width: 72px;
    padding: 0.3rem 0.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.9rem;
    text-align: right;
}
.number-input:focus { outline: none; border-color: var(--accent); }
.number-input.is-default { color: var(--text-muted); }

.scares-section { margin-bottom: 1.5rem; }

.scares-heading {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border);
    padding: 0 0 0.6rem;
    cursor: pointer;
    gap: 0.75rem;
    margin-bottom: 0;
}

.scares-summary {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    min-width: 0;
}

.scares-badge {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.scares-chevron {
    flex: none;
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    transition: transform 0.25s ease;
}
.scares-chevron.open { transform: rotate(180deg); }

.scares-drawer {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s ease;
}
.scares-drawer.open { grid-template-rows: 1fr; }

.scares-drawer-inner { overflow: hidden; }

.no-scares { font-size: 0.88rem; color: var(--text-muted); padding-top: 0.75rem; }
.scares-list { list-style: none; margin: 0; padding: 0; }

.scare-row {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 0.5rem;
    background: none;
    border-bottom: 1px solid var(--border);
    border-top: none;
    border-left: none;
    border-right: none;
    cursor: pointer;
    border-radius: 6px;
    color: inherit;
    text-align: left;
    font: inherit;
    transition: background 0.15s;
}
.scare-row:hover { background: var(--bg-card-hover, rgba(255,255,255,0.04)); }

.scare-num { flex: none; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); width: 1.2rem; text-align: right; }
.scare-desc { flex: 1; font-size: 0.88rem; color: var(--text); line-height: 1.4; }
.scare-icons { display: flex; gap: 0.35rem; color: var(--text-muted); }
.icon { width: 15px; height: 15px; }
.scare-dur { flex: none; font-size: 0.78rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.chevron-right { flex: none; width: 16px; height: 16px; color: var(--text-muted); }

.body-spacer { height: 1.25rem; }

.modal-footer { flex: none; }

.start-btn {
    display: block;
    width: 100%;
    padding: 1.1rem;
    background: var(--green, #2d9e5f);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: background 0.15s;
}
.start-btn:hover { background: #27885a; }

.scare-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10;
    border-radius: 16px;
}

.scare-card {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 3rem);
    max-height: calc(100% - 3rem);
    background: var(--bg-card, #12121f);
    border: 1px solid var(--border);
    border-radius: 16px;
    z-index: 11;
    overflow: visible;
    display: flex;
    align-items: stretch;
}

.scare-inner {
    flex: 1;
    padding: 1.25rem 1.5rem 1.5rem;
    overflow-y: auto;
    border-radius: 16px;
}

.scare-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.scare-counter {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.close-btn {
    background: none;
    border: none;
    padding: 0.25rem;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    border-radius: 6px;
    transition: color 0.15s;
}
.close-btn:hover { color: var(--text); }
.close-btn svg { width: 18px; height: 18px; }

.scare-meta { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.scare-dur-badge { font-size: 0.82rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.scare-icon-wrap { color: var(--text-muted); display: flex; }
.scare-desc-text { font-size: 0.92rem; line-height: 1.55; color: var(--text); margin: 0 0 1.25rem; }

.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 80px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, background 0.15s, color 0.15s;
    z-index: 12;
}
.nav-arrow svg { width: 18px; height: 18px; }
.nav-arrow:hover:not(:disabled) { background: rgba(255,255,255,0.15); color: var(--text); }
.nav-arrow:disabled { cursor: default; opacity: 0 !important; }
.nav-arrow.visible:not(:disabled) { opacity: 1; }

.nav-prev { left: -20px; border-radius: 40px 0 0 40px; padding-right: 4px; }
.nav-next { right: -20px; border-radius: 0 40px 40px 0; padding-left: 4px; }

.reveal-btn {
    display: block;
    width: 100%;
    padding: 0.65rem 1rem;
    background: var(--bg-card-hover, rgba(255,255,255,0.06));
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.88rem;
    cursor: pointer;
    text-align: center;
    margin-bottom: 0.75rem;
    transition: background 0.15s;
}
.reveal-btn:hover { background: rgba(255,255,255,0.1); }
.reveal-btn.secondary { color: var(--text-muted); }

.reveal-box {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}

.reveal-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin: 0 0 0.4rem;
}

.reveal-text { font-size: 0.88rem; line-height: 1.55; color: var(--text); margin: 0; }

/* ─────────────────────────────────────────────────────────────────────────
   App player
   ───────────────────────────────────────────────────────────────────────── */
.app-screen {
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --timecode-bottom: calc(var(--safe-bottom) + 2rem);
    --timecode-height: clamp(60px, 15vw, 180px);
    --badge-bottom: calc(var(--timecode-bottom) + var(--timecode-height) + 0.75rem);
    --badge-reserved-height: 2.75rem;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --top-control-size: 44px;
    --top-control-margin: 1.25rem;
    --top-control-gap: 0.75rem;
    --top-control-top: calc(var(--safe-top) + var(--top-control-margin));
    --scene-card-top: calc(var(--top-control-top) + var(--top-control-size) + var(--top-control-gap));
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    transition: background-color 0.4s ease;
    user-select: none;
    -webkit-user-select: none;
}

.center-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 1rem;
}

.app-screen .loading-text,
.error-text {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.error-text { color: var(--accent); }

.sync-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
    background: var(--bg);
    overflow-y: auto;
}

.sync-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    max-width: 540px;
    width: 100%;
    overflow: hidden;
}

.sync-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.sync-back {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-decoration: none;
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.sync-back:hover { color: var(--text); }

.sync-show-info { flex: 1; }

.sync-show-name {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}

.sync-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.2rem;
}

.sync-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.sync-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sync-section-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.sync-screenshot {
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.sync-description-box {
    background: rgba(255, 255, 255, 0.04);
    border-left: 3px solid var(--accent);
    padding: 0.75rem 1rem;
    border-radius: 0 8px 8px 0;
}

.sync-description {
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.55;
    margin: 0;
}

.sync-label {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.sync-input-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.sync-input {
    flex: 1 1 12rem;
    min-width: 0;
    padding: 0.75rem 1rem;
    font-size: 1.1rem;
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    outline: none;
}

.sync-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.15);
}

.sync-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

.sync-hint code {
    background: var(--bg);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85em;
}

.btn-primary {
    flex: 0 0 auto;
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.btn-primary:hover { background: var(--accent-hover); }

@media (max-width: 420px) {
    .sync-input-row { flex-direction: column; }
    .sync-input-row .sync-input { flex: 0 0 auto; width: 100%; }
    .sync-input-row .btn-primary { width: 100%; }
}

.btn-secondary {
    display: inline-block;
    padding: 0.65rem 1.25rem;
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
}

.btn-secondary:hover { background: var(--bg-card-hover); color: var(--text); }

.btn-danger {
    padding: 0.65rem 1.25rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-danger:hover { background: var(--accent-hover); }

.warning-overlay {
    position: absolute;
    inset: 0;
    --leader-light: #f8e7a3;
    --leader-dark: #efc13d;
    --leader-angle: 0deg;
    --leader-ring-stroke: clamp(6px, 1.05vmin, 9px);
    --leader-ring-gap: calc(var(--leader-ring-stroke) * 4);
    background: var(--leader-light);
    padding: 2rem;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.warning-overlay.leader-active {
    background:
        conic-gradient(
            from 0deg at 50% 50%,
            var(--leader-dark) 0deg,
            var(--leader-dark) var(--leader-angle),
            var(--leader-light) var(--leader-angle),
            var(--leader-light) 360deg
        );
}

.leader-rings,
.leader-rings::before,
.leader-rings::after {
    content: '';
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
}

.leader-rings {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(48vmin, 360px);
    aspect-ratio: 1;
    z-index: 0;
}

.leader-rings::before {
    inset: var(--leader-ring-gap);
    border: var(--leader-ring-stroke) solid rgba(255, 255, 255, 0.86);
}

.leader-rings::after {
    inset: 0;
    border: var(--leader-ring-stroke) solid rgba(255, 255, 255, 0.86);
}

.leader-lines {
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: 0;
    pointer-events: none;
    background:
        linear-gradient(to right, transparent calc(50% - 1px), rgba(0, 0, 0, 0.4) calc(50% - 1px), rgba(0, 0, 0, 0.4) calc(50% + 1px), transparent calc(50% + 1px)),
        linear-gradient(to bottom, transparent calc(50% - 1px), rgba(0, 0, 0, 0.4) calc(50% - 1px), rgba(0, 0, 0, 0.4) calc(50% + 1px), transparent calc(50% + 1px));
}

.warning-overlay.leader-active .leader-lines { opacity: 1; }

.leader-hand {
    position: absolute;
    left: 50%;
    bottom: 50%;
    width: 2px;
    height: 80vmax;
    background: rgba(0, 0, 0, 0.52);
    transform: translateX(-50%) rotate(var(--leader-angle));
    transform-origin: 50% 100%;
    opacity: 0;
    z-index: 1;
}

.warning-overlay.leader-active .leader-hand { opacity: 1; }

.countdown-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.55) 100%);
    pointer-events: none;
}

.countdown-number {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scaleX(0.78);
    font-size: clamp(120px, 25vw, 300px);
    font-family: 'Arial Narrow', 'Helvetica Neue Condensed', 'Avenir Next Condensed', sans-serif;
    font-weight: 300;
    font-variant-numeric: lining-nums tabular-nums;
    font-feature-settings: 'lnum' 1, 'tnum' 1;
    color: rgba(0, 0, 0, 0.68);
    line-height: 1;
    letter-spacing: -0.06em;
    text-shadow:
        1px 1px 0 rgba(0,0,0,0.12),
        -1px -1px 0 rgba(255,255,255,0.1);
    z-index: 2;
}

.scare-badges {
    position: absolute;
    left: 50%;
    bottom: var(--badge-bottom);
    transform: translateX(-50%);
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
    width: min(520px, calc(100vw - 4rem));
    pointer-events: auto;
    z-index: 2;
}

.badge {
    padding: 0.4rem 0.9rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    font-size: 0.9rem;
    color: rgba(0, 0, 0, 0.75);
}

.spoiler-btn {
    font-family: inherit;
    cursor: pointer;
}

.spoiler-btn:hover { background: rgba(0, 0, 0, 0.34); }

.spoiler-btn.selected {
    background: rgba(0, 0, 0, 0.42);
    border-color: rgba(0, 0, 0, 0.38);
}

.scare-pulse {
    position: absolute;
    inset: 0;
    border-radius: 0;
    animation: pulse 1.2s ease-in-out infinite;
    pointer-events: none;
    z-index: 2;
}

@keyframes pulse {
    0%, 100% { box-shadow: inset 0 0 80px rgba(0,0,0,0.0); }
    50% { box-shadow: inset 0 0 80px rgba(0,0,0,0.35); }
}

.text-overlay {
    position: absolute;
    top: var(--scene-card-top);
    left: 50%;
    transform: translateX(-50%);
    width: min(760px, calc(100vw - 2rem));
    max-height: calc(100vh - var(--scene-card-top) - var(--badge-bottom) - var(--badge-reserved-height) - 0.75rem);
    overflow-y: auto;
    z-index: 3;
    border-radius: 14px;
    background: rgba(15, 15, 22, 0.1);
    border: 1px solid var(--border);
}

.text-overlay.spoiler-text-card {
    z-index: 4;
    background: rgba(15, 15, 22, 0.4);
}

.text-card {
    padding: 1rem 1.25rem 1.25rem;
    position: relative;
}

.text-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: rgba(240, 240, 240, 0.55);
    font-size: 1rem;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    transition: color 0.2s;
    pointer-events: auto;
}

.text-close:hover { color: rgba(240, 240, 240, 0.75); }

.text-heading {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgb(136, 136, 170);
    margin-bottom: 0.5rem;
    padding-right: 1.5rem;
}

.text-body p {
    font-size: clamp(1.25rem, 2.1vw, 1.65rem);
    line-height: 1.55;
    color: rgba(240, 240, 240, 0.55);
    margin: 0;
}

.controls {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1s ease;
    z-index: 5;
}

.controls.visible { opacity: 1; }

.controls > * { pointer-events: auto; }

.controls.timecode-only > :not(.tc-area) {
    opacity: 0;
    pointer-events: none;
}

.tc-area {
    pointer-events: none;
    transition: opacity 1s ease;
}

.controls .timecode { pointer-events: none; }
.controls .timecode-editable { pointer-events: auto; }
.tc-input, .tc-set-btn { pointer-events: auto; }

.btn-icon {
    position: absolute;
    top: var(--top-control-top);
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text);
    width: var(--top-control-size);
    height: var(--top-control-size);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, opacity 1s ease;
}

.btn-icon:hover { background: rgba(0, 0, 0, 0.65); }

.btn-icon svg { width: 22px; height: 22px; }

.back-btn { left: calc(var(--safe-left) + 1.25rem); }
.settings-btn { right: calc(var(--safe-right) + 1.25rem); }

.play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: clamp(70px, 14vw, 110px);
    height: clamp(70px, 14vw, 110px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, opacity 1s ease;
    color: white;
}

.play-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: translate(-50%, -50%) scale(1.05);
}

.play-btn.transparent {
    background: rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.1);
}

.play-icon,
.pause-icon {
    width: clamp(28px, 6vw, 44px);
    height: clamp(28px, 6vw, 44px);
}

.unpause-countdown {
    font-size: clamp(28px, 6vw, 44px);
    font-weight: 700;
    color: white;
    line-height: 1;
}

.tc-area {
    position: absolute;
    bottom: var(--timecode-bottom);
    left: 0;
    right: 0;
    height: var(--timecode-height);
    pointer-events: none;
}

.controls.timecode-dimmed .tc-area { opacity: 0.3; }

.timecode {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(60px, 15vw, 180px);
    font-family: ui-monospace, 'SF Mono', Menlo, 'Courier New', monospace;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1;
    letter-spacing: -0.03em;
    transition: opacity 0.6s ease;
    cursor: default;
    background: none;
    border: none;
    outline: none;
    padding: 0;
}

.timecode-editable { cursor: text; }
.timecode-editable:hover { color: rgba(255, 255, 255, 0.95); }

.tc-input {
    position: absolute;
    inset: 0;
    font-size: clamp(60px, 15vw, 180px);
    font-family: ui-monospace, 'SF Mono', Menlo, 'Courier New', monospace;
    font-weight: 300;
    color: rgba(255, 255, 255, 1.0);
    letter-spacing: -0.03em;
    line-height: 1;
    text-align: center;
    background: none;
    border: none;
    padding: 0;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    caret-color: rgba(255, 255, 255, 0.7);
    user-select: text;
    -webkit-user-select: text;
}

.tc-set-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 1.5rem;
    width: 56px;
    height: 56px;
    background: var(--green);
    border: none;
    border-radius: 14px;
    color: #000;
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    animation: fadeInSet 0.15s ease 0.05s forwards;
    transition: background 0.15s;
}

.tc-set-btn:hover { background: #3ae660; }

@keyframes fadeInSet { to { opacity: 1; } }

.dialog-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 20;
}

.dialog {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.75rem;
    max-width: 380px;
    width: 100%;
    text-align: center;
}

.dialog-message {
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.dialog-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.settings-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 15;
}

.settings-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(380px, 100vw);
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(var(--safe-top) + 1.25rem) 1.5rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.settings-header h2 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
}

.settings-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.25rem 0.4rem;
    border-radius: 4px;
    transition: color 0.2s;
}

.settings-close:hover { color: var(--text); }

.settings-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.settings-panel .setting-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0;
    cursor: pointer;
    color: var(--text);
    font-size: 0.93rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.settings-panel .setting-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: var(--accent);
    cursor: pointer;
}

.setting-with-input {
    cursor: default;
    justify-content: space-between;
}

.setting-with-input label {
    color: var(--text);
    font-size: 0.93rem;
    cursor: default;
}

.input-unit {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.input-unit input[type="number"] {
    width: 60px;
    padding: 0.3rem 0.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.9rem;
    text-align: center;
    outline: none;
}

.input-unit input[type="number"]:focus { border-color: var(--accent); }

.input-unit span {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.sub-setting {
    padding-left: 1.75rem;
    border-bottom: none;
    opacity: 0.9;
}

.settings-divider {
    margin: 0.5rem 0;
    border-top: 1px solid var(--border);
}

.offset-section { padding-top: 0.25rem; }

.offset-warning {
    font-size: 0.8rem;
    color: var(--yellow);
    line-height: 1.5;
    padding: 0.5rem 0 0.25rem;
    margin: 0;
}
