/* Tatort Website — Cinematic dark UI */

/* ─── Reset & Tokens ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:          #0a0a14;
    --bg-card:     rgba(255, 255, 255, 0.035);
    --bg-hover:    rgba(255, 255, 255, 0.06);
    --text:        #eeeef3;
    --text-2:      #a0a6b4;
    --text-3:      #555b6a;
    --accent:      #e94560;
    --border:      rgba(255, 255, 255, 0.055);
    --border-2:    rgba(255, 255, 255, 0.10);
    --r:           0.875rem;
    --r-sm:        0.5rem;
    --ease:        180ms ease;
    --shadow:      0 6px 40px rgba(0, 0, 0, 0.5);
}

html {
    -webkit-text-size-adjust: 100%;
    background: var(--bg);
    height: 100%;
    overflow-y: scroll;
    overscroll-behavior: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100%;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }
a   { color: inherit; text-decoration: none; }

/* ─── Layout ─── */
.page-wrapper {
    max-width: 50rem;
    margin: 0 auto;
    padding: 1.25rem 1rem 2rem;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main { flex: 1; }

/* ═══════════════════════════
   HERO
   ═══════════════════════════ */
.hero { margin-bottom: 1.25rem; }

.hero-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: var(--r);
    overflow: hidden;
    background: #12121f;
    box-shadow: var(--shadow);
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 500ms ease;
}
.hero-frame:hover .hero-img { transform: scale(1.015); }

.hero-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #14142a 0%, #12121f 100%);
    color: var(--text-3);
}

.hero-scrim {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to top, var(--bg) 0%, rgba(10,10,20,.55) 35%, transparent 60%),
        linear-gradient(to bottom, rgba(10,10,20,.35) 0%, transparent 14%);
    pointer-events: none;
}

/* Badges — top-left */
.hero-badges {
    position: absolute;
    top: 0.6rem;
    left: 0.6rem;
    z-index: 2;
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
}

/* Countdown — top-right */
.hero-countdown {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    z-index: 2;
}

/* ─── Chips ─── */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.82rem;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    letter-spacing: 0.01em;
}

.chip--live {
    background: rgba(233, 69, 96, 0.72);
    border-color: var(--accent);
    animation: pulse-glow 2s ease-in-out infinite;
}

.chip--today {
    background: rgba(74, 222, 128, 0.22);
    border-color: rgba(74, 222, 128, 0.35);
    color: #4ade80;
}

.chip--tomorrow {
    background: rgba(250, 204, 21, 0.18);
    border-color: rgba(250, 204, 21, 0.28);
    color: #fde047;
}

.chip-num {
    font-size: 1.05rem;
    font-variant-numeric: tabular-nums;
}

.chip-unit {
    font-weight: 500;
    opacity: 0.85;
    font-size: 0.78rem;
}

.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #fff;
    animation: blink 1.4s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.25; }
}

/* Hero bottom overlay */
.hero-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.1rem 1.25rem;
    z-index: 2;
}

.hero-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: var(--text-2);
    margin-bottom: 0.3rem;
}

.meta-dot {
    display: inline-block;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-3);
    opacity: 0.6;
}

.hero-team {
    font-weight: 600;
}

.hero-case {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: var(--text);
    opacity: 0.8;
}

.hero-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.12;
    margin-bottom: 0.25rem;
    text-shadow: 0 2px 16px rgba(0,0,0,.5);
}

.hero-date {
    font-size: 0.78rem;
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
}

/* ─── Station Logo (inline SVG) ─── */
.station-logo {
    display: inline-flex;
    vertical-align: middle;
    flex-shrink: 0;
}
.station-logo svg {
    display: block;
}

/* ─── Station Dot (upcoming) ─── */
.station-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--dot, #6b7280);
    flex-shrink: 0;
}

/* ═══════════════════════════
   BADGES
   ═══════════════════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1.4;
}

.badge--xs   { font-size: 0.52rem; padding: 0.08rem 0.35rem; }

.badge--polizeiruf { background: #2563eb; color: #fff; }
.badge--last       { background: linear-gradient(135deg, #7c3aed, #a78bfa); color: #fff; }
.badge--first      { background: linear-gradient(135deg, #059669, #34d399); color: #fff; }
.badge--crossover  { background: linear-gradient(135deg, #d97706, #fbbf24); color: #0a0a14; }
.badge--milestone  { background: linear-gradient(135deg, #e94560, #ff6b6b); color: #fff; }

/* ═══════════════════════════
   CARD (details)
   ═══════════════════════════ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 1.4rem;
    margin-bottom: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

/* ─── Team Strip ─── */
.team-strip {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.team-img {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-2);
    flex-shrink: 0;
    background: #181825;
}

.team-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.team-city {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-3);
}

.team-detectives {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

/* ─── Block (description, etc.) ─── */
.label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-3);
    margin-bottom: 0.4rem;
}

.body-text {
    color: var(--text-2);
    line-height: 1.72;
    font-size: 0.93rem;
}

.link-external {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.45rem;
    font-size: 0.78rem;
    color: var(--text-3);
    transition: color var(--ease);
}
.link-external:hover {
    color: var(--text);
}

/* ─── Credits ─── */
.credits {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.7rem;
}

.credit--wide { grid-column: 1 / -1; }

.credit {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
}

.credit-val {
    font-size: 0.85rem;
    color: var(--text-2);
}

/* ─── Rating ─── */
.rating {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.rating-stars {
    display: flex;
    gap: 2px;
}

.star { width: 15px; height: 15px; }
.star--full  { color: #fbbf24; }
.star--half  { color: #fbbf24; }
.star--empty { color: var(--text-3); opacity: 0.4; }

.rating-num {
    font-weight: 700;
    font-size: 0.88rem;
    font-variant-numeric: tabular-nums;
    color: #fbbf24;
}

.rating-count {
    font-size: 0.72rem;
    color: var(--text-3);
}

/* ─── Note ─── */
.note {
    padding: 0.65rem 0.9rem;
    background: rgba(250, 204, 21, 0.06);
    border-left: 3px solid #eab308;
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
    font-size: 0.83rem;
    color: #fde047;
}
.note strong {
    font-weight: 600;
    margin-right: 0.25rem;
}

/* ═══════════════════════════
   UPCOMING
   ═══════════════════════════ */
.upcoming { margin-bottom: 2rem; }

.section-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-3);
    margin-bottom: 0.65rem;
    padding-left: 0.1rem;
}

.upcoming-grid {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.up-card {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem;
    border-radius: var(--r-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: background var(--ease), border-color var(--ease), transform var(--ease);
    cursor: pointer;
}
.up-card:hover {
    background: var(--bg-hover);
    border-color: var(--border-2);
    transform: translateY(-1px);
}

.up-still {
    width: 5rem;
    aspect-ratio: 16 / 9;
    border-radius: 0.3rem;
    overflow: hidden;
    flex-shrink: 0;
    background: #12121f;
}
.up-still img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.up-body {
    flex: 1;
    min-width: 0;
}

.up-date {
    font-size: 0.68rem;
    color: var(--text-3);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-variant-numeric: tabular-nums;
}

.up-title {
    font-weight: 700;
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.up-team {
    font-size: 0.73rem;
    color: var(--text-2);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.up-tba {
    color: var(--text-3);
    font-style: italic;
}

.up-case {
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════
   EMPTY STATE
   ═══════════════════════════ */
.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    text-align: center;
    color: var(--text-3);
    gap: 0.7rem;
}

.empty-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
}

.empty-body {
    font-size: 0.92rem;
    color: var(--text-2);
    line-height: 1.6;
}

/* ═══════════════════════════
   FOOTER
   ═══════════════════════════ */
.footer {
    text-align: center;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border);
    font-size: 0.68rem;
    color: var(--text-3);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.footer-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}
.footer-row a { transition: color var(--ease); }
.footer-row a:hover { color: var(--text-2); }

.footer-tmdb { opacity: 0.5; transition: opacity var(--ease); }
.footer-tmdb:hover { opacity: 0.9; }
.tmdb-mark { height: 0.65rem; display: inline-block; }

.footer-dot { opacity: 0.3; }
.footer-cc  { opacity: 0.5; }

.footer-fine {
    font-size: 0.58rem;
    opacity: 0.35;
}

/* ═══════════════════════════
   ANIMATIONS
   ═══════════════════════════ */
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 10px rgba(233, 69, 96, 0.3); }
    50%      { box-shadow: 0 0 22px rgba(233, 69, 96, 0.5); }
}

/* ═══════════════════════════
   RESPONSIVE
   ═══════════════════════════ */
@media (max-width: 480px) {
    .page-wrapper { padding: 0.6rem 0.6rem 1.25rem; }

    .hero-title { font-size: 1.3rem; }
    .hero-meta-row { font-size: 0.72rem; }
    .hero-date { font-size: 0.68rem; }
    .hero-bottom { padding: 0.7rem; }

    .hero-badges { top: 0.4rem; left: 0.4rem; }
    .hero-countdown { top: 0.4rem; right: 0.4rem; }
    .chip { font-size: 0.72rem; padding: 0.22rem 0.5rem; }

    .badge { font-size: 0.52rem; padding: 0.12rem 0.38rem; }

    .card { padding: 0.9rem; gap: 0.9rem; }
    .body-text { font-size: 0.86rem; }

    .credits { grid-template-columns: 1fr; }

    .team-img { width: 3.5rem; height: 3.5rem; }
    .team-detectives { font-size: 0.88rem; }

    .up-still { width: 3.8rem; }
    .up-title { font-size: 0.82rem; }
}

@media (min-width: 481px) and (max-width: 767px) {
    .hero-title { font-size: 1.65rem; }
}

@media (min-width: 768px) {
    .page-wrapper { padding: 1.8rem 1.5rem 2.5rem; }
    .hero-title { font-size: 2.4rem; }
    .hero-bottom { padding: 1.4rem; }
    .hero-meta-row { font-size: 0.88rem; }

    .card { padding: 1.75rem; }

    .up-still { width: 6rem; }

    .team-img { width: 5rem; height: 5rem; }
}

@media (min-width: 1024px) {
    .page-wrapper { padding: 2.25rem 2rem 3rem; }
}

/* Safe area */
@supports (padding: env(safe-area-inset-bottom)) {
    body {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
        padding-bottom: env(safe-area-inset-bottom);
    }
}
