/* ===== Druto Supply Design Tokens ===== */
:root {
    --pink: #E52999;
    --pink-light: #F5ADCF;
    --pink-tint: #FFDDEF;
    --pink-bg: rgba(229, 41, 153, 0.08);
    --pink-hover: rgba(229, 41, 153, 0.12);
    --pink-ring: rgba(229, 41, 153, 0.35);
    --blue: #8BC4DD;
    --bg: #F5F5F5;
    --bg-white: #FFFFFF;
    --text: #2D2D2D;
    --text-secondary: #6E6E73;
    --text-tertiary: #AEAEB2;
    --border: rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-pill: 24px;
    --font: 'Satoshi', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --font-display: 'owners-xwide', 'Satoshi', sans-serif;
    --card-width: min(360px, 86vw);
    --card-height: min(520px, 66vh);
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
}

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

body {
    font-family: var(--font);
    letter-spacing: -0.01em;
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
    height: 100dvh;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior: none;
}

button {
    font-family: var(--font);
    cursor: pointer;
    border: none;
    background: none;
}

.hidden { display: none !important; }
.text-muted { color: var(--text-tertiary); font-size: 0.85rem; }

/* ===== Screens ===== */
.screen {
    display: none;
    flex-direction: column;
    height: 100dvh;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
}
.screen.active { display: flex; }

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: calc(var(--safe-bottom) + 100px);
    left: 50%;
    transform: translateX(-50%) translateY(60px);
    background: var(--text);
    color: white;
    padding: 10px 24px;
    border-radius: var(--radius-pill);
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 200;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
    pointer-events: none;
    white-space: nowrap;
    opacity: 0;
}
.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ===== Home screen ===== */
.home-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 20px;
    padding: 24px;
}

.home-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.home-brand { text-align: center; }

.app-title {
    font-family: var(--font-display);
    font-size: clamp(2.8rem, 10vw, 4rem);
    font-weight: 700;
    color: var(--pink);
    letter-spacing: 0.01em;
    line-height: 1;
    text-transform: uppercase;
}

.app-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 8px;
    font-weight: 400;
}

/* Mode category cards */
.mode-cards {
    display: flex;
    gap: 12px;
    width: 100%;
    max-width: 400px;
}

.mode-card {
    flex: 1;
    position: relative;
    aspect-ratio: 3/4;
    border-radius: 20px;
    overflow: hidden;
    border: none;
    padding: 0;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: transform 0.2s, box-shadow 0.2s;
}
.mode-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}
.mode-card:active { transform: scale(0.97); }

.mode-card-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mode-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 30%,
        rgba(0, 0, 0, 0.2) 60%,
        rgba(0, 0, 0, 0.7) 100%
    );
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 16px;
}

.mode-card-label {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.home-logo {
    position: absolute;
    bottom: calc(var(--safe-bottom) + 16px);
    height: 28px;
    width: auto;
    opacity: 0.5;
}

.home-mascot {
    width: 110px;
    height: auto;
    animation: mascotBounce 2s ease-in-out infinite;
}

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

/* ===== Login hero ===== */
.login-hero {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    height: -webkit-fill-available;
    overflow: hidden;
}

/* picture element must fill the hero like an img */
.login-hero picture {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.login-hero-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
}

.login-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 20%,
        rgba(0, 0, 0, 0.15) 40%,
        rgba(0, 0, 0, 0.7) 65%,
        rgba(0, 0, 0, 0.92) 100%
    );
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding: 0 24px calc(var(--safe-bottom) + 24px);
}

.login-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 320px;
}

.login-content .app-title {
    color: var(--pink-light);
    text-shadow: 0 0 40px rgba(245, 173, 207, 0.6), 0 2px 12px rgba(0, 0, 0, 0.4);
}

.login-content .app-subtitle {
    color: rgba(255, 255, 255, 0.7);
    margin-top: 2px;
    margin-bottom: 16px;
    font-size: clamp(0.75rem, 2.8vw, 0.95rem);
    white-space: nowrap;
    text-align: center;
}

.login-content .name-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.login-content .name-input:focus {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
}
.login-content .name-input::placeholder {
    color: rgba(255, 255, 255, 0.25);
    font-weight: 500;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
}

.login-content .login-btn {
    background: var(--pink-tint);
    border: none;
    color: var(--text);
    font-weight: 700;
    letter-spacing: 0.1em;
    font-size: 0.85rem;
    box-shadow: 0 4px 20px rgba(255, 221, 239, 0.3);
}
.login-content .login-btn:hover:not(:disabled) {
    background: var(--pink-light);
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(245, 173, 207, 0.4);
}

/* ===== Login screen full-bleed ===== */
#screen-login {
    padding: 0;
    background: #000;
    /* Override 100dvh to fill entire screen including behind Safari chrome */
    height: 100vh;
    height: 100dvh;
    height: -webkit-fill-available;
}

/* Black body when login is visible (prevents white bleed around edges) */
body:has(#screen-login.active) {
    background: #000;
}

/* ===== Orbiting mascots ===== */
/* Mobile (vertical hero): orbit around head */
.orbit-center {
    position: absolute;
    top: 30%;
    left: 50%;
    width: 0;
    height: 0;
    z-index: 2;
    pointer-events: none;
}

.orbit-track {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    animation: orbitSpin 12s linear infinite;
}

.orbit-track .float-bubble {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow:
        0 4px 20px rgba(229, 41, 153, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%) translateY(-120px);
    animation: counterSpinMobile 12s linear infinite;
}

.orbit-track .float-bubble img {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

/* Evenly spaced: 12s / 6 = 2s apart */
.orbit-1 { animation-delay: 0s; }
.orbit-1 .float-bubble { animation-delay: 0s; }
.orbit-2 { animation-delay: -2s; }
.orbit-2 .float-bubble { animation-delay: -2s; width: 56px; height: 56px; }
.orbit-2 .float-bubble img { width: 40px; height: 40px; }
.orbit-3 { animation-delay: -4s; }
.orbit-3 .float-bubble { animation-delay: -4s; width: 54px; height: 54px; }
.orbit-3 .float-bubble img { width: 38px; height: 38px; }
.orbit-4 { animation-delay: -6s; }
.orbit-4 .float-bubble { animation-delay: -6s; width: 64px; height: 64px; }
.orbit-4 .float-bubble img { width: 46px; height: 46px; }
.orbit-5 { animation-delay: -8s; }
.orbit-5 .float-bubble { animation-delay: -8s; width: 52px; height: 52px; }
.orbit-5 .float-bubble img { width: 36px; height: 36px; }
.orbit-6 { animation-delay: -10s; }
.orbit-6 .float-bubble { animation-delay: -10s; width: 58px; height: 58px; }
.orbit-6 .float-bubble img { width: 42px; height: 42px; }

@keyframes orbitSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Mobile orbit (120px radius — tight around head) */
@keyframes counterSpinMobile {
    from { transform: translate(-50%, -50%) translateY(-120px) rotate(0deg); }
    to   { transform: translate(-50%, -50%) translateY(-120px) rotate(-360deg); }
}

/* Desktop orbit (180px radius) */
@keyframes counterSpinDesktop {
    from { transform: translate(-50%, -50%) translateY(-180px) rotate(0deg); }
    to   { transform: translate(-50%, -50%) translateY(-180px) rotate(-360deg); }
}

/* Desktop: horizontal hero, different head position */
@media (min-width: 768px) {
    .login-hero-img {
        object-position: center center;
    }
    .orbit-center {
        top: 28%;
    }
    .orbit-track .float-bubble {
        transform: translate(-50%, -50%) translateY(-180px);
        width: 68px;
        height: 68px;
        animation-name: counterSpinDesktop;
    }
    .orbit-track .float-bubble img {
        width: 50px;
        height: 50px;
    }
}

/* ===== Swipe header ===== */
.swipe-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
}

.back-btn {
    color: var(--pink);
    font-size: 1.3rem;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.back-btn:hover { background: var(--pink-bg); }

/* ===== Heart (watchlist) button in swipe header ===== */
.heart-btn {
    position: relative;
    color: var(--pink);
    padding: 8px;
    border-radius: var(--radius-sm);
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.heart-btn:hover { background: var(--pink-bg); }
.heart-btn:active { transform: scale(0.9); }

.heart-count {
    position: absolute;
    top: 2px;
    right: 0;
    background: var(--pink);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ===== Swipe tutorial (first time) ===== */
.swipe-tutorial {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    pointer-events: none;
    animation: tutorialFadeIn 0.5s ease-out;
}

.tutorial-hand {
    color: var(--pink);
    animation: tutorialSwipe 2s ease-in-out infinite;
}

.tutorial-labels {
    display: flex;
    gap: 80px;
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.tutorial-left {
    color: var(--text-tertiary);
}

.tutorial-right {
    color: var(--pink);
}

@keyframes tutorialSwipe {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-40px); }
    75% { transform: translateX(40px); }
}

@keyframes tutorialFadeIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ===== Card stack ===== */
.card-stack {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 8px;
    touch-action: none;
    min-height: 0;
    overscroll-behavior: none;
}

.card-loading {
    display: flex;
    gap: 8px;
    align-items: center;
}
.loading-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--pink-light);
    animation: dotPulse 1.2s ease infinite;
}
.loading-dot:nth-child(2) { animation-delay: 0.15s; }
.loading-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes dotPulse {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

.card-empty {
    text-align: center;
    color: var(--text-secondary);
}

/* ===== Swipe card ===== */
.swipe-card {
    position: absolute;
    width: var(--card-width);
    height: var(--card-height);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-white);
    box-shadow: var(--shadow-lg);
    cursor: grab;
    user-select: none;
    will-change: transform;
}
.swipe-card:active { cursor: grabbing; }

.swipe-card[data-depth="0"] { z-index: 3; }
.swipe-card[data-depth="1"] {
    z-index: 2;
    transform: scale(0.95) translateY(10px);
    pointer-events: none;
}
.swipe-card[data-depth="2"] {
    z-index: 1;
    transform: scale(0.90) translateY(20px);
    pointer-events: none;
}

.card-front {
    overflow: hidden;
    border-radius: var(--radius);
}

.card-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
}

.card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px 16px 16px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.75) 20%, rgba(0, 0, 0, 0.92));
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: white;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.2;
}

.card-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 0.78rem;
    opacity: 0.8;
}

.card-score {
    color: var(--pink-light);
    font-weight: 700;
}

.card-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.genre-tag {
    background: rgba(255, 255, 255, 0.15);
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.8);
}

.card-synopsis {
    font-size: 0.75rem;
    opacity: 0.65;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-streaming {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 2px;
}
.card-streaming img {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    pointer-events: none;
}
.card-streaming-text {
    font-size: 0.68rem;
    opacity: 0.6;
}

/* ===== Swipe stamps ===== */
.swipe-stamp {
    position: absolute;
    top: 36px;
    padding: 6px 18px;
    border: 3px solid;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 2px;
    opacity: 0;
    pointer-events: none;
    z-index: 10;
    text-transform: uppercase;
}
.swipe-stamp--like {
    right: 16px;
    color: var(--pink);
    border-color: var(--pink);
    transform: rotate(-12deg);
}
.swipe-stamp--skip {
    left: 16px;
    color: var(--text-tertiary);
    border-color: var(--text-tertiary);
    transform: rotate(12deg);
}
/* ===== Swipe animations ===== */
.swipe-card.returning {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.swipe-card.exit-right {
    transition: transform 0.35s ease-out, opacity 0.25s;
    transform: translateX(150vw) rotate(25deg) !important;
    opacity: 0;
}
.swipe-card.exit-left {
    transition: transform 0.35s ease-out, opacity 0.25s;
    transform: translateX(-150vw) rotate(-25deg) !important;
    opacity: 0;
}
/* ===== Action buttons ===== */
.action-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 6px 16px 2px;
}

.action-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    min-width: 56px;
    min-height: 56px;
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
}
.action-btn--skip {
    border-color: var(--text-tertiary);
    color: var(--text-tertiary);
}
.action-btn--like {
    border-color: var(--pink);
    color: var(--pink);
}
.action-btn:active { transform: scale(0.88); }

.keyboard-hints {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 2px 0 6px;
    font-size: 0.68rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

/* ===== Watchlist screen ===== */
.wl-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
}
.wl-header h2 { font-size: 1rem; font-weight: 700; }

.btn-text {
    color: var(--pink);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    min-height: 44px;
    display: flex;
    align-items: center;
}
.btn-text:hover { background: var(--pink-bg); }

.btn-primary {
    padding: 14px 32px;
    background: var(--pink);
    color: white;
    border-radius: var(--radius-pill);
    font-size: 0.95rem;
    font-weight: 700;
    transition: all 0.2s;
    box-shadow: 0 4px 16px rgba(229, 41, 153, 0.25);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(229, 41, 153, 0.35); }
.btn-primary:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-primary:active:not(:disabled) { transform: translateY(0); }

.btn-secondary {
    padding: 10px 20px;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.15s;
}
.btn-secondary:hover { border-color: var(--pink-ring); }

/* ===== Insights ===== */
.insights-section { padding: 0 16px 8px; }

.insights-cards {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
}
.insights-cards::-webkit-scrollbar { display: none; }

.insight-card {
    flex-shrink: 0;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    min-width: 140px;
    box-shadow: var(--shadow-sm);
}
.insight-card .insight-text {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--pink);
}
.insight-card .insight-detail {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ===== Stats bar ===== */
.stats-bar {
    display: flex;
    gap: 16px;
    padding: 6px 16px 10px;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

/* ===== Watchlist grid ===== */
.watchlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    padding: 8px 16px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.wl-card {
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
    aspect-ratio: 2/3;
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s;
}
.wl-card:active { transform: scale(0.96); }

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

.wl-card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 8px 8px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    color: white;
}
.wl-card-title {
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.3;
}
.wl-card-streaming {
    display: flex;
    gap: 3px;
    margin-top: 3px;
}
.wl-card-streaming img {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

.wl-card-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 0.85rem;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.wl-card:hover .wl-card-remove { display: flex; }

.watchlist-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-secondary);
}

/* ===== Pick section ===== */
.pick-section {
    display: flex;
    justify-content: center;
    padding: 12px 16px;
}
.pick-btn { width: 100%; max-width: 320px; }

/* ===== Reveal overlay ===== */
.reveal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    padding-top: calc(var(--safe-top) + 20px);
    padding-bottom: calc(var(--safe-bottom) + 20px);
    animation: fadeIn 0.2s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.reveal-card {
    max-width: 380px;
    width: 100%;
    background: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
    max-height: 88dvh;
    overflow-y: auto;
    animation: revealIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    box-shadow: var(--shadow-lg);
    -webkit-overflow-scrolling: touch;
}

@keyframes revealIn {
    from { transform: scale(0.85) translateY(40px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.reveal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    color: white;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.reveal-card > img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
}

.reveal-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reveal-info h1 {
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text);
}

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

.reveal-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.reveal-genres .genre-tag {
    background: var(--pink-bg);
    color: var(--pink);
}

.reveal-streaming {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.streaming-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    transition: all 0.15s;
    min-height: 36px;
}
.streaming-pill:hover { border-color: var(--pink-ring); background: var(--pink-bg); }
.streaming-pill img {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.reveal-synopsis {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.reveal-link-btn {
    display: inline-block;
    color: var(--pink);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 8px 0;
}
.reveal-link-btn:hover { text-decoration: underline; }

.reveal-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

/* ===== Login screen ===== */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 280px;
}

.name-input {
    font-family: var(--font);
    font-size: 1.1rem;
    font-weight: 500;
    text-align: center;
    padding: 16px 20px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-white);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s;
}
.name-input:focus {
    border-color: var(--pink);
}
.name-input::placeholder {
    color: var(--text-tertiary);
    font-weight: 400;
}

.login-btn { width: 100%; }

/* ===== Card flip (Where to Watch) ===== */
.swipe-card {
    perspective: 1000px;
}

.swipe-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.swipe-card.flipped .swipe-card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.card-back {
    transform: rotateY(180deg);
    background: var(--bg-white);
    display: flex;
    flex-direction: column;
    padding: 24px 20px;
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    touch-action: none;
}

.card-back-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 4px;
}

.card-back-subtitle {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.card-back-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 10px;
}

.card-back-synopsis {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 14px;
    overflow-y: auto;
    max-height: 80px;
    -webkit-overflow-scrolling: touch;
}

.card-back-label {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--pink);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 10px;
}

.streaming-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.streaming-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text);
    transition: all 0.15s;
}
.streaming-item:hover {
    border-color: var(--pink-ring);
    background: var(--pink-bg);
}

.streaming-item img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    flex-shrink: 0;
}

.streaming-item-name {
    font-size: 0.88rem;
    font-weight: 600;
}

.streaming-item-type {
    font-size: 0.72rem;
    color: var(--text-tertiary);
}

.streaming-none {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

.card-back-tap {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-tertiary);
    padding-top: 12px;
    margin-top: auto;
}

/* ===== Year timeline selector ===== */
.year-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.year-all {
    padding: 5px 14px;
    border-radius: var(--radius-pill);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--border);
    transition: all 0.15s;
    min-height: 30px;
    flex-shrink: 0;
    letter-spacing: 0.03em;
}
.year-all.active {
    background: var(--pink);
    color: white;
    border-color: var(--pink);
}
.year-all:not(.active):hover {
    background: var(--pink-bg);
    border-color: var(--pink-ring);
}

.year-track {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    position: relative;
    -webkit-mask-image: linear-gradient(to right, black 0%, black 60%, transparent 100%);
    mask-image: linear-gradient(to right, black 0%, black 60%, transparent 100%);
}

.year-track-inner {
    display: flex;
    gap: 2px;
    align-items: center;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 2px 28px 2px 0;
}
.year-track-inner::-webkit-scrollbar { display: none; }

.year-btn {
    position: relative;
    padding: 4px 10px 10px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-tertiary);
    background: none;
    border: none;
    flex-shrink: 0;
    white-space: nowrap;
    transition: all 0.2s;
}
.year-btn::after {
    content: '';
    display: block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--text-tertiary);
    margin: 3px auto 0;
    transition: all 0.2s;
}
.year-btn.active {
    color: var(--pink);
    font-weight: 800;
    font-size: 0.75rem;
}
.year-btn.active::after {
    background: var(--pink);
    width: 6px;
    height: 6px;
    box-shadow: 0 0 8px rgba(229, 41, 153, 0.4);
}
.year-btn:not(.active):hover {
    color: var(--text-secondary);
}

/* ===== Card hint ===== */
.card-hint {
    text-align: center;
    font-size: 0.82rem;
    color: var(--pink);
    padding: 6px 0 0;
    font-weight: 700;
    letter-spacing: 0.03em;
}

/* ===== Decision timer ===== */
.card-timer {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 10px 20px 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.timer-text {
    font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 2.4rem;
    color: var(--pink);
    font-weight: 900;
    text-align: center;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 24px rgba(229, 41, 153, 0.5), 0 0 48px rgba(229, 41, 153, 0.2);
    line-height: 1;
}
.timer-text.urgent {
    color: #FF3B30;
    text-shadow: 0 0 24px rgba(255, 59, 48, 0.6), 0 0 48px rgba(255, 59, 48, 0.3);
    animation: timerPulse 0.5s ease-in-out infinite;
}

.timer-label {
    font-family: var(--font-display);
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--pink-light);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.timer-bar {
    width: min(120px, 28vw);
    height: 3px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 4px;
}

.timer-fill {
    height: 100%;
    background: var(--pink);
    border-radius: 2px;
    transition: width 1s linear;
    box-shadow: 0 0 6px rgba(229, 41, 153, 0.4);
}

.timer-fill.urgent {
    background: #FF3B30;
    box-shadow: 0 0 10px rgba(255, 59, 48, 0.6);
}

@keyframes timerPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.15); }
}

/* ===== Frosted glass swipe screen ===== */
#screen-swipe {
    background: linear-gradient(135deg, var(--bg) 0%, var(--pink-tint) 50%, var(--bg) 100%);
}

.swipe-header {
    background: rgba(245, 245, 245, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.action-buttons {
    background: rgba(245, 245, 245, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
}

.action-btn {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.swipe-card {
    box-shadow: 0 8px 40px rgba(229, 41, 153, 0.08), var(--shadow-lg);
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
    :root {
        --card-height: min(420px, 54vh);
    }
    .keyboard-hints { display: none; }
    .wl-card-remove { display: flex; }
    .year-btn {
        padding: 3px 8px 9px;
        font-size: 0.62rem;
    }
}

@media (min-width: 768px) {
    :root {
        --card-width: min(400px, 86vw);
        --card-height: min(560px, 70vh);
    }
    .swipe-header {
        justify-content: center;
        gap: 12px;
    }
    .year-selector {
        max-width: 400px;
    }
    .home-mascot {
        width: 140px;
    }
    .mode-cards {
        max-width: 560px;
        gap: 16px;
    }
    .mode-card-label {
        font-size: 1.6rem;
    }
}

/* ===== Mobile Safari: prevent overscroll on card area ===== */
@supports (-webkit-touch-callout: none) {
    .card-stack { -webkit-user-select: none; }
}
