/* ----- Base ----- */
body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: #0a0d12;
    color: #e0e6ed;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Atmospheric background — radial glow + subtle pattern */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at top right, rgba(215, 18, 32, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at bottom left, rgba(80, 120, 255, 0.05) 0%, transparent 50%),
        linear-gradient(180deg, #0a0d12 0%, #0d1117 100%);
    z-index: -2;
    pointer-events: none;
}

.bg-pattern {
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400' viewBox='0 0 400 400'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='0.8' opacity='0.035'%3E%3Ccircle cx='200' cy='200' r='180'/%3E%3Ccircle cx='200' cy='200' r='140'/%3E%3Ccircle cx='200' cy='200' r='100'/%3E%3Ccircle cx='200' cy='200' r='60'/%3E%3Cpath d='M200 20 L200 380 M20 200 L380 200 M73 73 L327 327 M327 73 L73 327'/%3E%3Cpolygon points='200,80 290,260 110,260'/%3E%3Cpolygon points='200,320 110,140 290,140'/%3E%3C/g%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 400px 400px;
    z-index: -1;
    pointer-events: none;
}

/* ----- Top Navigation ----- */
.top-nav {
    position: sticky;
    top: 0;
    height: 60px;
    background: rgba(13, 17, 23, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid #1f242c;
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 16px;
    z-index: 200;
    box-sizing: border-box;
}
.nav-hamburger {
    display: none;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}
.nav-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #ffffff;
    border-radius: 1px;
    transition: background 0.2s;
}
.nav-hamburger:hover span { background: #d71220; }
.nav-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}
.nav-brand-logo { height: 36px; width: auto; }
.nav-links-left,
.nav-links-right {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 4px;
    align-items: center;
    flex: 1;
}
.nav-links-right { justify-content: flex-end; }
.nav-link {
    color: #8b949e;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.15s, background 0.15s;
}
.nav-link:hover { color: #ffffff; background: rgba(255,255,255,0.05); }
.nav-link-search { color: #d71220; }
.nav-link-search:hover { color: #e8192a; background: rgba(215, 18, 32,0.08); }

/* Nav drawer (mobile) */
.nav-drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 299;
    opacity: 0;
    transition: opacity 0.25s;
}
.nav-drawer-overlay.open { display: block; opacity: 1; }
.nav-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 240px;
    height: 100vh;
    background: #161b22;
    border-right: 1px solid #1f242c;
    padding: 20px 16px;
    box-sizing: border-box;
    transform: translateX(-100%);
    transition: transform 0.25s ease-out;
    z-index: 300;
}
.nav-drawer.open { transform: translateX(0); }
.nav-drawer-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
}
.nav-drawer-close:hover { color: #d71220; }
.nav-drawer-links {
    list-style: none;
    padding: 40px 0 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.nav-drawer-links .nav-link {
    font-size: 1rem;
    padding: 10px 12px;
    color: #c9d1d9;
}

/* ----- Search page ----- */
.search-page-body { flex-direction: column; }
.search-page-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 24px 40px;
    box-sizing: border-box;
    transition: padding-top 0.2s ease;
}
.search-page-main:not(.search-active) {
    padding-top: calc(40vh - 60px);
}
.search-page-main.search-active {
    padding-top: 40px;
}
.search-page-inner {
    width: 100%;
    max-width: 1200px;
    flex-shrink: 0;
}
.search-page-input-wrapper {
    max-width: 640px;
    margin: 0 auto 24px;
}
.search-page-main .site-footer {
    align-self: stretch;
}
.search-page-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: #ffffff;
    margin: 0 0 28px 0;
    letter-spacing: -0.5px;
    text-align: center;
}
@media (max-width: 900px) {
    .search-page-main { padding-left: 18px; padding-right: 18px; padding-bottom: 48px; }
    .search-page-main:not(.search-active) { padding-top: 20vh; }
    .search-page-main.search-active { padding-top: 24px; }
    .search-page-title { font-size: 1.8rem; }
}

/* ----- Sidebar ----- */
.sidebar {
    position: fixed;
    left: 0;
    top: 60px;
    width: 320px;
    height: calc(100vh - 60px);
    background:
        linear-gradient(0deg, rgba(215, 18, 32, 0.08) 0%, transparent 40%),
        linear-gradient(180deg, #161b22 0%, #0d1117 100%);
    border-right: 1px solid #1f242c;
    padding: 30px 24px;
    box-sizing: border-box;
    z-index: 10;
}
.sidebar h2 {
    font-size: 0.85rem;
    color: #8b949e;
    margin: 0 0 24px 0;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
}
.input-group { margin-bottom: 20px; }
.input-group label {
    display: block;
    font-size: 0.75rem;
    color: #8b949e;
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.input-clear-wrap {
    position: relative;
}
.input-clear-wrap input {
    padding-right: 32px;
}
.input-clear-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #8b949e;
    font-size: 0.95rem;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    transition: color 0.15s;
}
.input-clear-btn:hover { color: #ffffff; }
.input-group input {
    width: 100%;
    padding: 11px 12px;
    background: #0a0d12;
    border: 1px solid #2a3038;
    color: #ffffff;
    border-radius: 8px;
    box-sizing: border-box;
    font-family: 'Inter';
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.input-group input:focus {
    outline: none;
    border-color: #d71220;
    box-shadow: 0 0 0 3px rgba(215, 18, 32, 0.15);
}
#generate-btn {
    width: 100%;
    padding: 13px;
    background: #d71220;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    letter-spacing: 0.3px;
    transition: background 0.2s, transform 0.1s;
}
#generate-btn:hover { background: #e8192a; }
#generate-btn:active { transform: translateY(1px); }
#generate-btn:disabled { background: #444; cursor: not-allowed; }

/* ----- Main content ----- */
.main-content {
    /* max(320px, calc(50vw - 640px)): below 1920px wide = 320px sidebar offset;
       above 1920px it grows so the 1600px content box centers in the post-sidebar space */
    margin-left: max(320px, calc(50vw - 640px));
    padding: 40px 80px 80px;
    flex-grow: 1;
    max-width: 1600px;
    width: 100%;
    margin-right: auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ----- Header ----- */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 1px solid #1f242c;
    padding-bottom: 24px;
    margin-bottom: 36px;
}
.brand-logo-container { display: flex; align-items: center; }
.brand-logo {
    height: 130px;
    width: auto;
    display: block;
    border: none;
    outline: none;
}
/* Loading chibi */
.status-icon {
    display: none;
    pointer-events: none;
}
/* Desktop: fixed overlay centered in the main content area */
.status-icon.visible {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 200;
}
.status-icon img {
    width: 180px;
    height: 180px;
    object-fit: contain;
    filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.5));
}
/* Mobile: inline below Generate button in sidebar */
@media (max-width: 900px) {
    .status-icon.visible {
        position: static;
        transform: none;
        display: flex;
        width: 100%;
        margin-top: 16px;
    }
}

/* ----- Content ----- */
.hidden { display: none; }
.section-title {
    font-size: 1.75rem;
    color: #ffffff;
    margin: 0 0 16px 0;
    font-weight: 800;
    letter-spacing: -0.3px;
}
.story-text {
    font-size: 1.05rem;
    line-height: 1.75;
    color: #c9d1d9;
    margin-bottom: 20px;
}
.story-text p {
    margin: 0 0 18px 0;
}
.story-text p:last-child {
    margin-bottom: 0;
}
.story-text p strong {
    color: #ffffff;
}
.hook-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 48px;
    line-height: 1.5;
}

/* ----- Character grid (3 columns) ----- */
.char-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 60px;
}
.char-card {
    display: flex;
    align-items: center;
    background: rgba(22, 27, 34, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 10px;
    padding: 18px;
    border: 1px solid #1f242c;
    transition: border-color 0.2s, transform 0.15s;
}
.char-card:hover {
    border-color: #2a3038;
    transform: translateY(-2px);
}
.char-card img {
    width: 110px;
    height: 110px;
    border-radius: 8px;
    object-fit: cover;
    margin-right: 14px;
    flex-shrink: 0;
    background: #161b22;
    border: 1px solid #2a3038;
}
.char-info { flex-grow: 1; min-width: 0; }
.char-info h3 {
    margin: 0 0 4px 0;
    color: #ffffff;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.2px;
}
.char-info p {
    margin: 0;
    color: #8b949e;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ----- TTS Button ----- */
.tts-container {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}
.tts-button {
    background: transparent;
    color: #ffffff;
    border: 1px solid #d71220;
    border-radius: 8px;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.tts-button:hover {
    background: rgba(215, 18, 32, 0.1);
    box-shadow: 0 0 20px rgba(215, 18, 32, 0.25);
}
.spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ----- Responsive: 2 cols on smaller screens, 1 col on mobile ----- */
@media (max-width: 1400px) {
    .char-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1100px) {
    .char-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ----- Footer ----- */
.site-footer {
    margin-top: auto;
    padding: 24px 0 16px;
    border-top: 1px solid #1f242c;
    text-align: center;
}
.site-footer p {
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.6;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}
.tmdb-logo {
    height: 18px;
    width: auto;
    vertical-align: middle;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.tmdb-logo:hover {
    opacity: 1;
}

/* ----- Two-step sidebar ----- */
.sidebar-section { margin-bottom: 28px; }
.sidebar-section.hidden { display: none; }

.step-label {
    display: block;
    font-size: 0.7rem;
    color: #6b7280;
    margin-bottom: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.search-input-wrapper {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    width: 100%;
    box-sizing: border-box;
}
.search-input-wrapper .input-clear-wrap {
    flex: 1;
}
.search-input-wrapper input {
    width: 100%;
    padding: 11px 12px;
    background: #0a0d12;
    border: 1px solid #2a3038;
    color: #ffffff;
    border-radius: 8px;
    font-family: 'Inter';
    font-size: 0.95rem;
    box-sizing: border-box;
    min-width: 0;
}
.search-input-wrapper input:focus {
    outline: none;
    border-color: #d71220;
    box-shadow: 0 0 0 3px rgba(215, 18, 32, 0.15);
}
.helper-text {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0;
    text-align: center;
}
#episode-helper {
    font-size: 0.85rem;
    text-align: center;
    margin: -4px 0 0 0;
    color: #6b7280;
}

.selected-show-card {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #2a3038;
    border-radius: 8px;
}
#selected-show-poster {
    width: 56px;
    height: 84px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}
.selected-show-info { flex: 1; min-width: 0; }
.selected-show-name {
    color: #ffffff;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.3;
    margin-bottom: 4px;
}
.selected-show-meta {
    color: #8b949e;
    font-size: 0.8rem;
    margin-bottom: 6px;
}
.change-link {
    background: none;
    border: none;
    color: #d71220;
    font-size: 0.8rem;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
}

#season-episode-section input {
    width: 100%;
    padding: 11px 12px;
    background: #0a0d12;
    border: 1px solid #2a3038;
    color: #ffffff;
    border-radius: 8px;
    font-family: 'Inter';
    font-size: 0.95rem;
    box-sizing: border-box;
    margin-bottom: 12px;
}
#season-episode-section #generate-btn {
    width: 100%;
    padding: 13px;
    margin-top: 20px;
    background: #d71220;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    letter-spacing: 0.3px;
    transition: background 0.2s, transform 0.1s;
}
#season-episode-section #generate-btn:hover { background: #e8192a; }
#season-episode-section #generate-btn:active { transform: translateY(1px); }
#season-episode-section #generate-btn:disabled { background: #444; cursor: not-allowed; }

.season-dropdown {
    width: 100%;
    padding: 11px 12px;
    background: #0a0d12;
    border: 1px solid #2a3038;
    color: #ffffff;
    border-radius: 8px;
    font-family: 'Inter';
    font-size: 0.95rem;
    box-sizing: border-box;
    margin-bottom: 12px;
    appearance: none;
    cursor: pointer;
}
.season-dropdown:focus {
    outline: none;
    border-color: #d71220;
    box-shadow: 0 0 0 3px rgba(215, 18, 32, 0.15);
}

/* ----- Search results panel ----- */
.search-results-panel {
    padding: 0 0 40px;
}
.search-results-panel.hidden { display: none; }
.results-title {
    font-size: 1.6rem;
    color: #ffffff;
    margin: 0 0 8px 0;
    font-weight: 800;
}
.fallback-warning {
    padding: 10px 14px;
    background: rgba(215, 18, 32, 0.06);
    border-left: 3px solid #d71220;
    color: #c9d1d9;
    font-size: 0.9rem;
    margin: 12px 0 20px;
    border-radius: 4px;
}
.fallback-warning.hidden { display: none; }
.results-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin: 20px 0;
}
.results-list.single-result {
    grid-template-columns: minmax(140px, 260px);
    justify-content: center;
}
/* Single result on /app left-aligns under the heading (matches how
   multi-result grids fill left-to-right). /search stays centered. */
.main-content .results-list.single-result {
    justify-content: start;
}
.result-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    background: rgba(22, 27, 34, 0.7);
    border: 1px solid #1f242c;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s;
}
.result-card:hover { border-color: #d71220; }
.result-card.highlighted {
    border-color: #d71220;
    box-shadow: 0 0 0 1px #d71220 inset;
}
.result-card img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-radius: 6px;
}
.result-info { flex: 1; display: flex; flex-direction: column; }
.result-name {
    color: #ffffff;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}
.result-meta {
    color: #8b949e;
    font-size: 0.8rem;
    margin-bottom: 10px;
}
.result-use-btn {
    display: block;
    width: 100%;
    box-sizing: border-box;
    background: transparent;
    color: #ffffff;
    border: 1px solid #d71220;
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    margin-top: auto;
}
.result-card.highlighted .result-use-btn { background: #d71220; }
.cancel-search {
    background: #d71220;
    color: #ffffff;
    border: 1px solid #d71220;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
}
.cancel-search:hover { background: #e8192a; border-color: #e8192a; }

/* ----- Mobile breakpoint: under 900px ----- */
@media (max-width: 900px) {
    body { flex-direction: column; }

    .nav-hamburger { display: flex; }
    .nav-links-left, .nav-links-right { display: none; }
    .nav-brand { margin: 0 auto; }

    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #1f242c;
        padding: 20px 18px;
    }

    .main-content {
        margin-left: 0;
        padding: 16px 18px 32px;
        min-height: auto;
    }

    .top-header {
        display: flex;
        align-items: center;
        gap: 12px;
        padding-bottom: 16px;
        margin-bottom: 20px;
    }
    .brand-logo { height: 70px; }
    .brand-logo-container {
        flex: 1;
        display: flex;
        justify-content: center;
    }

    .section-title { font-size: 1.35rem; }
    .story-text { font-size: 0.95rem; }
    .hook-text { font-size: 1.05rem; margin-bottom: 32px; }

    .char-grid { grid-template-columns: 1fr; gap: 12px; }
    .char-card { padding: 14px; }
    .char-card img { width: 72px; height: 72px; margin-right: 12px; }
    .char-info h3 { font-size: 1.05rem; }
    .char-info p { font-size: 0.88rem; }

    .tts-button { width: 100%; justify-content: center; }

    .site-footer { margin-top: auto; }
    .site-footer p { font-size: 0.7rem; }
}

@media (max-width: 600px) {
    .results-list, .results-list.single-result { grid-template-columns: 1fr; justify-content: unset; }
    .result-card { flex-direction: row; gap: 12px; }
    .result-card img { width: 72px; height: 108px; aspect-ratio: unset; flex-shrink: 0; }
    .result-use-btn { width: auto; display: inline-block; }
}

/* ----- Smaller phones (under 400px) ----- */
@media (max-width: 400px) {
    .main-content { padding: 12px 14px 24px; }
    .brand-logo { height: 60px; }
    .char-card img { width: 64px; height: 64px; }
    .section-title { font-size: 1.2rem; }
}

/* ----- Feedback nudge links (recap result + search no-results) ----- */
.recap-feedback-nudge {
    font-size: 0.78rem;
    color: #6b7280;
    margin-top: 12px;
    text-align: center;
}
.search-feedback-nudge {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 8px;
}
.feedback-nudge-link {
    color: #6b7280;
    text-decoration: none;
    border-bottom: 1px solid #30363d;
    transition: color 0.15s, border-color 0.15s;
}
.feedback-nudge-link:hover { color: #8b949e; border-color: #8b949e; }

/* ----- Sign-in toast ----- */
.signin-toast {
    position: fixed;
    top: 72px;
    left: 50%;
    transform: translateX(-50%) translateY(-12px);
    background: #161b22;
    border: 1px solid #d71220;
    color: #c9d1d9;
    font-size: 0.95rem;
    padding: 12px 28px;
    border-radius: 20px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 600;
    white-space: nowrap;
}
.signin-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ----- Feedback FAB + Modal ----- */
.feedback-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #d71220;
    color: #fff;
    border: none;
    border-radius: 24px;
    padding: 10px 18px;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(215, 18, 32, 0.35);
    z-index: 500;
    transition: opacity 0.15s, transform 0.15s, box-shadow 0.15s;
    letter-spacing: 0.2px;
}
.feedback-fab:hover {
    opacity: 0.88;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(215, 18, 32, 0.45);
}
.feedback-fab:active { transform: none; }

@media (max-width: 600px) {
    .feedback-fab {
        width: 54px;
        height: 54px;
        border-radius: 50%;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.3rem;
        letter-spacing: 0;
        bottom: 20px;
        right: 16px;
    }
    .feedback-fab-text { display: none; }
}

.feedback-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 510;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.feedback-overlay.open { display: block; }

.feedback-modal {
    display: none;
    position: fixed;
    bottom: 76px;
    right: 24px;
    width: 360px;
    max-width: calc(100vw - 32px);
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
    z-index: 520;
    overflow: hidden;
}
.feedback-modal.open { display: block; }

.feedback-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #30363d;
}
.feedback-modal-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #f0f6fc;
    margin: 0;
}
.feedback-modal-close {
    background: none;
    border: none;
    color: #8b949e;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.15s;
}
.feedback-modal-close:hover { color: #f0f6fc; }

.feedback-form {
    padding: 14px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 11px;
}
.feedback-field { display: flex; flex-direction: column; gap: 4px; }
.feedback-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.feedback-required { color: #d71220; }
.feedback-optional { font-weight: 400; text-transform: none; font-size: 0.72rem; color: #6b7280; }

.feedback-select,
.feedback-input,
.feedback-textarea {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 7px;
    color: #e6edf3;
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    padding: 8px 11px;
    transition: border-color 0.15s;
    width: 100%;
    box-sizing: border-box;
}
.feedback-select:focus,
.feedback-input:focus,
.feedback-textarea:focus { outline: none; border-color: #d71220; }
.feedback-textarea { resize: vertical; min-height: 88px; line-height: 1.5; }

.feedback-err {
    background: rgba(215, 18, 32, 0.1);
    border: 1px solid rgba(215, 18, 32, 0.3);
    color: #e87a81;
    border-radius: 6px;
    padding: 7px 11px;
    font-size: 0.8rem;
}
.feedback-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding-top: 2px;
}
.feedback-btn-cancel {
    background: transparent;
    border: 1px solid #30363d;
    color: #8b949e;
    border-radius: 7px;
    padding: 8px 14px;
    font-family: 'Inter', sans-serif;
    font-size: 0.84rem;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}
.feedback-btn-cancel:hover { border-color: #8b949e; color: #c9d1d9; }

.feedback-btn-submit {
    background: #d71220;
    border: none;
    color: #fff;
    border-radius: 7px;
    padding: 8px 18px;
    font-family: 'Inter', sans-serif;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s;
}
.feedback-btn-submit:hover { opacity: 0.88; }
.feedback-btn-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.feedback-success {
    padding: 28px 18px;
    text-align: center;
}
.feedback-success-icon { font-size: 1.8rem; margin-bottom: 6px; }
.feedback-success p { font-weight: 700; font-size: 0.95rem; color: #f0f6fc; margin: 0; }

/* ----- Monogram fallback for failed character images ----- */
.char-monogram {
    width: 110px;
    height: 110px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 14px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #d71220 0%, #a50e18 100%);
    color: #ffffff;
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: -1px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
@media (max-width: 900px) {
    .char-monogram { width: 72px; height: 72px; font-size: 1.6rem; margin-right: 12px; }
}
@media (max-width: 400px) {
    .char-monogram { width: 64px; height: 64px; font-size: 1.4rem; }
}

.char-monogram.m1 { background: linear-gradient(135deg, #d71220 0%, #a50e18 100%); }
.char-monogram.m2 { background: linear-gradient(135deg, #4b6cff 0%, #2030c9 100%); }
.char-monogram.m3 { background: linear-gradient(135deg, #4bff7c 0%, #20a04b 100%); color: #0d1117; }
.char-monogram.m4 { background: linear-gradient(135deg, #ff8b4b 0%, #c95a30 100%); }
.char-monogram.m5 { background: linear-gradient(135deg, #b14bff 0%, #6020c9 100%); }
.char-monogram.m6 { background: linear-gradient(135deg, #4bcbff 0%, #2080c9 100%); }

/* ── Home / Splash page ─────────────────────────────────────────── */
.home-body { flex-direction: column; }

.home-hero {
    position: relative;
    min-height: calc(100vh - 56px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Poster mosaic — sits behind everything */
.home-poster-grid {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-auto-rows: 1fr;
    gap: 3px;
    opacity: 0.45;
    pointer-events: none;
}

.home-poster-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Gradient scrim — posters fade to dark in the lower half */
.home-poster-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at center top, rgba(13,17,23,0.3) 0%, rgba(13,17,23,0.7) 60%),
        linear-gradient(to bottom, rgba(13,17,23,0.4) 0%, rgba(13,17,23,0.6) 50%, rgba(13,17,23,0.97) 85%);
    pointer-events: none;
}

/* Hero content — floats above mosaic */
.home-hero-inner {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
    max-width: 560px;
    padding: 48px 24px;
}

.home-logo {
    height: 160px;
    max-width: 520px;
    width: auto;
    margin-bottom: 8px;
    /* White glow makes black letters pop against dark poster background */
    filter: drop-shadow(0 0 12px rgba(255,255,255,0.25)) drop-shadow(0 4px 24px rgba(0,0,0,0.5));
}

.home-tagline {
    font-size: 1.35rem;
    font-weight: 700;
    color: #f0f6fc;
    letter-spacing: 0.2px;
    margin: 0;
    line-height: 1.3;
    text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}

.home-subline {
    font-size: 1.05rem;
    color: #c9d1d9;
    margin: 0;
    line-height: 1.5;
    text-shadow: 0 1px 6px rgba(0,0,0,0.5);
}

.home-cta-btn {
    display: inline-block;
    margin-top: 12px;
    padding: 14px 36px;
    background: #d71220;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 8px;
    text-decoration: none;
    letter-spacing: 0.3px;
    transition: opacity 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: none;
}

.home-cta-btn:hover {
    opacity: 0.92;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(215, 18, 32, 0.3);
}

@media (max-width: 900px) {
    .home-poster-grid { grid-template-columns: repeat(3, 1fr); }
    .home-tagline { font-size: 1.15rem; }
    .home-logo { height: 110px; max-width: 90vw; }
}

@media (max-width: 480px) {
    .home-poster-grid { grid-template-columns: repeat(2, 1fr); }
    .home-tagline { font-size: 1rem; }
}

/* Long-running show warning */
.long-show-warning {
    margin-top: 8px;
    color: #8b949e;
    font-size: 0.78rem;
    line-height: 1.4;
}

/* =====================================================================
   ABOUT PAGE
   ===================================================================== */

.about-main {
    min-height: calc(100vh - 56px);
    padding: 64px 24px 80px;
}

.about-inner {
    max-width: 780px;
    margin: 0 auto;
}

/* Header */
.about-header {
    text-align: center;
    margin-bottom: 64px;
}

.about-logo {
    height: 80px;
    max-width: 360px;
    width: auto;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.15));
    margin-bottom: 16px;
}

.about-tagline {
    font-size: 1.2rem;
    color: #8b949e;
    margin: 0;
    letter-spacing: 0.5px;
}

/* Sections */
.about-section {
    margin-bottom: 56px;
}

.about-section p {
    color: #c9d1d9;
    font-size: 1.05rem;
    line-height: 1.75;
    margin: 0 0 16px;
}

.about-section-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #f0f6fc;
    margin: 0 0 20px;
    letter-spacing: -0.3px;
}

/* Callout quote */
.about-callout {
    font-size: 1.2rem !important;
    font-weight: 700;
    color: #f0f6fc !important;
    border-left: 3px solid #d71220;
    padding-left: 20px;
    margin-top: 24px !important;
}

/* Highlight section (spoiler-free promise) */
.about-section-highlight {
    background: rgba(215, 18, 32, 0.06);
    border: 1px solid rgba(215, 18, 32, 0.18);
    border-radius: 12px;
    padding: 32px 36px;
}

.about-section-highlight .about-section-title {
    color: #e87a81;
}

/* Accuracy disclaimer — muted, not competing with the red promise box */
.about-section-note {
    background: rgba(255,255,255,0.02);
    border: 1px solid #21262d;
    border-radius: 10px;
    padding: 20px 26px;
}
.about-section-note .about-section-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.about-section-note p {
    font-size: 0.88rem !important;
    color: #6b7280 !important;
    line-height: 1.65;
    margin: 0 !important;
}

/* How-it-works steps */
.about-steps {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 28px;
}

.about-step {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    background: rgba(255,255,255,0.03);
    border: 1px solid #30363d;
    border-radius: 10px;
    padding: 20px 24px;
}

.about-step-num {
    font-size: 1.6rem;
    font-weight: 900;
    color: #d71220;
    line-height: 1;
    min-width: 40px;
    letter-spacing: -1px;
    padding-top: 2px;
}

.about-step-body h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #f0f6fc;
    margin: 0 0 6px;
}

.about-step-body p {
    font-size: 0.95rem !important;
    color: #8b949e !important;
    margin: 0 !important;
    line-height: 1.6 !important;
}

/* What's coming list */
.about-list {
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.about-list li {
    color: #c9d1d9;
    font-size: 1rem;
    line-height: 1.6;
    padding-left: 20px;
    position: relative;
}

.about-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: #d71220;
    font-weight: 700;
}

.about-list li strong {
    color: #f0f6fc;
}

/* Built with */
.about-section-built .about-section-title {
    margin-bottom: 20px;
}

.about-tech-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 28px;
}

.about-tech-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.about-tech-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #f0f6fc;
}

.about-tech-desc {
    font-size: 0.82rem;
    color: #8b949e;
}

.about-tmdb-note {
    font-size: 0.82rem;
    color: #8b949e;
    margin: 0 !important;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* CTA */
.about-cta {
    text-align: center;
    margin-top: 64px;
}

/* Responsive */
@media (max-width: 600px) {
    .about-main { padding: 40px 20px 60px; }
    .about-section-highlight { padding: 24px 20px; }
    .about-tech-row { grid-template-columns: 1fr; }
    .about-step { flex-direction: column; gap: 12px; }
    .about-step-num { font-size: 1.2rem; }
    .about-logo { height: 56px; }
}

/* =====================================================================
   LOGO LOCKUP (homepage + about)
   ===================================================================== */

.home-logo-lockup {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    filter: drop-shadow(0 2px 20px rgba(0,0,0,0.55));
}

/* Full Recap wordmark — white, single asset */
.logo-wordmark {
    height: 100px;
    width: auto;
    max-width: 480px;
    object-fit: contain;
}

/* "Stay in the Story" tagline PNG */
.logo-tagline-img {
    height: 28px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    opacity: 0.82;
}

/* =====================================================================
   HOMEPAGE — UPDATED HERO COPY & BUTTONS
   ===================================================================== */

/* Remove the old .home-logo usage on the new homepage
   (kept in CSS in case other templates still use it) */

.home-hero-hook {
    font-size: 1.6rem;
    font-weight: 800;
    color: #f0f6fc;
    margin: 0;
    line-height: 1.25;
    text-align: center;
    text-shadow: 0 2px 12px rgba(0,0,0,0.6);
    letter-spacing: -0.3px;
}

/* Button row: primary + ghost side by side */
.home-btn-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 4px;
}

/* Ghost / outline variant */
.home-cta-ghost {
    background: transparent;
    border: 2px solid rgba(255,255,255,0.35);
    color: #f0f6fc;
}

.home-cta-ghost:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.65);
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: none;
}

/* =====================================================================
   ABOUT PAGE — HEADER (composed lockup, no duplicate tagline)
   ===================================================================== */

/* Override the about-header to use the lockup sizing */
.about-header .home-logo-lockup {
    margin-bottom: 0;
}

.about-header .logo-r-icon {
    height: 64px;
    width: 64px;
}

.about-header .logo-ecap-text {
    height: 64px;
}

.about-header .logo-tagline-img {
    height: 26px;
    opacity: 0.75;
}

/* =====================================================================
   RESPONSIVE ADJUSTMENTS
   ===================================================================== */

@media (max-width: 600px) {
    .logo-r-icon  { height: 56px; width: 56px; }
    .logo-ecap-text { height: 56px; }
    .logo-tagline-img { height: 22px; }
    .home-hero-hook { font-size: 1.25rem; }
    .home-btn-row { flex-direction: column; gap: 8px; }
}