/* Reset & Theme Variables */
:root {
    --bg-base: #0a0c10;
    --bg-surface: rgba(18, 22, 33, 0.75);
    --bg-surface-solid: #121621;
    --bg-card: rgba(26, 31, 46, 0.65);
    --bg-card-solid: #1a1f2e;
    
    --border-color: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(255, 255, 255, 0.15);
    
    --accent: #8b5cf6; /* Violet */
    --accent-glow: rgba(139, 92, 246, 0.45);
    --accent-gradient: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
    --accent-hover: #7c3aed;
    
    --secondary-accent: #06b6d4; /* Cyan */
    --secondary-gradient: linear-gradient(135deg, #22d3ee 0%, #06b6d4 100%);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --input-bg: rgba(255, 255, 255, 0.03);
    --range-track: rgba(255, 255, 255, 0.2);
    
    /* Ratings Colors */
    --imdb-color: #f5c518;
    --rt-color: #f9312b;
    --mc-color: #66cc33;
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 25px rgba(139, 92, 246, 0.15);
    --hero-bg-filter: blur(40px) brightness(0.25);
    --hero-bg-opacity: 0.4;

    --showdown-scale: 1;
}

:root.light-theme {
    --bg-base: #f5f6fa;
    --bg-surface: rgba(255, 255, 255, 0.85);
    --bg-surface-solid: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.7);
    --bg-card-solid: #ffffff;
    
    --border-color: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.15);
    
    --accent: #6d28d9; /* Richer Violet for readability */
    --accent-glow: rgba(109, 40, 217, 0.15);
    --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    --accent-hover: #5b21b6;
    
    --secondary-accent: #0891b2; /* Darker Cyan */
    --secondary-gradient: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    --input-bg: #f8fafc;
    --range-track: rgba(71, 85, 105, 0.28);
    
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.04), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.05), 0 4px 12px -2px rgba(0, 0, 0, 0.03);
    --shadow-glow: 0 0 25px rgba(109, 40, 217, 0.04);
    --hero-bg-filter: blur(40px) brightness(1.6) saturate(1.3);
    --hero-bg-opacity: 0.15;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(139, 92, 246, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.05) 0%, transparent 40%);
    background-attachment: fixed;
}

/* App Container */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-icon {
    width: 2.25rem;
    height: 2.25rem;
    color: var(--accent);
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.brand h1 {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text-primary) 35%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.65rem 1.25rem;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition-smooth);
    color: #fff;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-gradient);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.btn-primary:hover {
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.35), 0 0 10px rgba(139, 92, 246, 0.2);
    transform: translateY(-1px);
}

.btn-accent {
    background: var(--secondary-gradient);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.2);
}

.btn-accent:hover {
    box-shadow: 0 6px 16px rgba(6, 182, 212, 0.35);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-hover);
}

.btn-roulette {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

.btn-roulette:hover {
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
    transform: translateY(-1px);
}

.btn-large {
    padding: 0.85rem 2rem;
    font-size: 1.1rem;
    border-radius: 12px;
}

/* Spin Animation for Sync */
.icon-spin-hover:hover, .btn-primary:hover .icon-spin-hover {
    animation: spin 1s linear infinite;
}

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

/* Sync Banner */
.sync-banner {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    animation: fadeIn 0.4s ease;
}

.sync-banner-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.spinner,
.toast-spinner {
    width: 1.5rem;
    height: 1.5rem;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.letterboxd-sync-toast {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 1200;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: min(340px, calc(100vw - 2rem));
    padding: 0.85rem 1rem;
    color: var(--text-primary);
    background: rgba(17, 24, 39, 0.9);
    border: 1px solid rgba(139, 92, 246, 0.35);
    border-radius: 12px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(14px);
    animation: toastSlideIn 0.24s ease;
}

.light-theme .letterboxd-sync-toast {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(124, 58, 237, 0.24);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
}

.letterboxd-sync-toast .toast-spinner {
    flex: 0 0 auto;
    width: 1.15rem;
    height: 1.15rem;
    border-width: 2px;
}

.letterboxd-sync-toast-copy {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
}

.letterboxd-sync-toast-copy strong {
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0;
}

.letterboxd-sync-toast-copy span {
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.35;
}

.not-interested-toast {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 1300;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: min(430px, calc(100vw - 2rem));
    padding: 0.8rem 0.85rem 0.8rem 1rem;
    color: var(--text-primary);
    background: rgba(17, 24, 39, 0.94);
    border: 1px solid rgba(6, 182, 212, 0.38);
    border-radius: 12px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(14px);
    animation: toastSlideIn 0.24s ease;
}

.light-theme .not-interested-toast {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(8, 145, 178, 0.28);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
}

.not-interested-toast-copy {
    display: grid;
    flex: 1;
    gap: 0.12rem;
    min-width: 0;
}

.not-interested-toast-copy strong {
    font-size: 0.86rem;
    font-weight: 750;
}

.not-interested-toast-copy span {
    overflow: hidden;
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.not-interested-toast-undo,
.not-interested-toast-close {
    flex: 0 0 auto;
    border: 0;
    color: var(--text-primary);
    background: transparent;
}

.not-interested-toast-undo {
    padding: 0.4rem 0.55rem;
    color: var(--accent);
    font-weight: 800;
}

.not-interested-toast-undo:hover {
    color: #67e8f9;
}

.not-interested-toast-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 999px;
}

.not-interested-toast-close:hover {
    background: rgba(255, 255, 255, 0.08);
}

.not-interested-toast-close svg {
    width: 1rem;
    height: 1rem;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 640px) {
    .letterboxd-sync-toast,
    .not-interested-toast {
        right: 1rem;
        bottom: 1rem;
        left: 1rem;
        width: auto;
    }

    /* Both can be on screen at once — a Letterboxd sync runs in the
       background while you dismiss a recommendation — so stack them
       instead of letting the second land on top of the first. */
    .letterboxd-sync-toast:not(.hidden) ~ .not-interested-toast {
        bottom: calc(1rem + 4.5rem);
    }
}

.hidden {
    display: none !important;
}

/* Stats Bar */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
}

.stat-icon-wrapper {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 0.15rem;
}

/* Featured Hero Section */
.hero-section {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 3rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    background-color: var(--bg-surface-solid);
}

.hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center 20%;
    filter: var(--hero-bg-filter, blur(40px) brightness(0.25));
    opacity: var(--hero-bg-opacity, 0.4);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 3rem;
    display: flex;
    gap: 3rem;
    align-items: center;
}

.hero-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.featured-badge {
    align-self: flex-start;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #a78bfa;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    letter-spacing: 1px;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.5px;
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.meta-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: var(--text-muted);
}

.hero-ratings {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0.5rem 0;
}

.rating-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    color: #fff;
    text-decoration: none;
    transition: var(--transition-smooth);
}

.rating-badge:hover {
    transform: translateY(-2px);
    filter: brightness(1.25);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.05);
}

.rating-badge svg {
    width: 0.95rem;
    height: 0.95rem;
    fill: currentColor;
}

.rating-badge.imdb {
    background: rgba(245, 197, 24, 0.15);
    border: 1px solid rgba(245, 197, 24, 0.3);
    color: var(--imdb-color);
}

.rating-badge.rt {
    background: rgba(249, 49, 43, 0.15);
    border: 1px solid rgba(249, 49, 43, 0.3);
    color: var(--rt-color);
}

.rating-badge.mc {
    background: rgba(102, 204, 51, 0.15);
    border: 1px solid rgba(102, 204, 51, 0.3);
    color: var(--mc-color);
}

.hero-plot {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-secondary);
    max-width: 650px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.hero-poster-wrapper {
    width: 180px;
    height: 270px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg), 0 0 20px rgba(0,0,0,0.5);
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.hero-poster-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Toolbar & Filters */
.toolbar-section {
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    box-shadow: var(--shadow-sm);
    position: relative;
    z-index: 10;
}

.search-box {
    position: relative;
    width: 100%;
}

.search-box svg {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 1rem 1rem 1rem 3.25rem;
    background: var(--input-bg, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1.05rem;
    font-family: var(--font-body);
    transition: var(--transition-smooth);
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.01);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.filters-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-width: 200px;
}

.filter-group.slider-group {
    flex: 1.2;
}

.filter-group.compact-filter {
    flex: 0 1 150px;
    min-width: 150px;
}

.filter-group label {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.filter-group label svg {
    width: 0.9rem;
    height: 0.9rem;
}

.filter-group select {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    color: #fff;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-family: var(--font-body);
}

.filter-group select:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.05);
}

/* Custom Styled Dropdowns */
.custom-dropdown {
    position: relative;
    width: 100%;
}

.custom-dropdown.open {
    z-index: 110;
}

.dropdown-trigger {
    background: var(--input-bg, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-family: var(--font-body);
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    text-align: left;
    outline: none;
}

.dropdown-trigger:focus,
.custom-dropdown.open .dropdown-trigger {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.01);
    box-shadow: 0 0 12px var(--accent-glow);
}

.dropdown-trigger span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-trigger svg {
    width: 1rem;
    height: 1rem;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.custom-dropdown.open .dropdown-trigger svg {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    z-index: 100;
    box-shadow: var(--shadow-lg);
    display: none;
    flex-direction: column;
    padding: 0.35rem;
    backdrop-filter: blur(20px);
}

.custom-dropdown.open .dropdown-menu {
    display: flex;
}

.dropdown-item {
    padding: 0.65rem 0.85rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition-fast);
    font-weight: 500;
}

.dropdown-item:hover {
    background: rgba(139, 92, 246, 0.05);
    color: var(--text-primary);
}

.dropdown-item.selected {
    background: rgba(139, 92, 246, 0.12);
    color: var(--accent);
    font-weight: 600;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.slider-header span {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
}

/* Custom Range Input */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: var(--range-track);
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid var(--accent);
    cursor: pointer;
    margin-top: -5px; /* Centers the 16px thumb on the 6px track: (6px - 16px) / 2 = -5px */
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow), 0 2px 6px rgba(0, 0, 0, 0.4);
}

.range-slider {
    --range-start: 0%;
    --range-end: 100%;
    position: relative;
    height: 24px;
}

.range-slider-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 6px;
    border-radius: 999px;
    transform: translateY(-50%);
    background: linear-gradient(
        to right,
        var(--range-track) 0%,
        var(--range-track) var(--range-start),
        var(--accent) var(--range-start),
        var(--accent) var(--range-end),
        var(--range-track) var(--range-end),
        var(--range-track) 100%
    );
}

.range-slider input[type="range"] {
    position: absolute;
    inset: 0;
    height: 24px;
    margin: 0;
    background: transparent;
    pointer-events: none;
    z-index: 2;
}

.range-slider input[type="range"]::-webkit-slider-runnable-track {
    height: 6px;
    background: transparent;
    border: none;
}

.range-slider input[type="range"]::-webkit-slider-thumb {
    pointer-events: auto;
    position: relative;
}

.range-slider input[type="range"]::-moz-range-track {
    height: 6px;
    background: transparent;
    border: none;
}

.range-slider input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    pointer-events: auto;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.range-slider input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.15);
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow), 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Genre Pills */
.genre-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.genre-pill {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.4rem 0.85rem;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.genre-pill:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: var(--border-hover);
}

.genre-pill.active {
    background: var(--accent-gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.25);
}

/* Section Header */
.library-tabs {
    width: fit-content;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, auto));
    gap: 0.3rem;
    margin: 0 0.5rem 1.15rem;
    padding: 0.3rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.library-tab {
    min-height: 2.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.55rem 0.8rem;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: var(--transition-fast);
}

.library-tab:hover {
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.07);
}

.library-tab.active {
    color: #fff;
    background: var(--accent-gradient);
    border-color: transparent;
    box-shadow: 0 5px 14px rgba(139, 92, 246, 0.22);
}

.library-tab:focus-visible {
    outline: 2px solid var(--secondary-accent);
    outline-offset: 3px;
}

.library-tab svg {
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
}

.library-tab-count {
    min-width: 1.45rem;
    height: 1.45rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.38rem;
    color: var(--text-muted);
    background: rgba(148, 163, 184, 0.12);
    border-radius: 999px;
    font-family: var(--font-body);
    font-size: 0.69rem;
    font-weight: 700;
}

.library-tab.active .library-tab-count {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0 0.5rem;
}

.section-header h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
}

.results-count {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Movie Grid */
.movies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

/* Movie Card */
.movie-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
    content-visibility: auto;
    contain-intrinsic-size: 380px;
    will-change: transform, opacity;
}

.movie-card.is-seen {
    border-color: rgba(52, 211, 153, 0.45);
}

.movie-card-placeholder {
    cursor: default;
    pointer-events: none;
}

.movie-card-placeholder:hover {
    transform: none;
    border-color: var(--border-color);
    box-shadow: none;
}

.movie-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg), 0 10px 20px rgba(0, 0, 0, 0.4), 0 0 15px rgba(255, 255, 255, 0.03);
}

.card-seen-toggle {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 5;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.68);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-smooth);
    backdrop-filter: blur(8px);
}

.card-seen-toggle svg {
    width: 1rem;
    height: 1rem;
}

.card-seen-toggle:hover,
.card-seen-toggle.active {
    color: #34d399;
    border-color: rgba(52, 211, 153, 0.65);
    background: rgba(6, 78, 59, 0.78);
}

.seen-ribbon {
    position: absolute;
    right: 0.75rem;
    bottom: 0.75rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    background: rgba(6, 78, 59, 0.82);
    border: 1px solid rgba(52, 211, 153, 0.55);
    color: #a7f3d0;
    font-size: 0.75rem;
    font-weight: 800;
    backdrop-filter: blur(6px);
}

.seen-ribbon svg {
    width: 0.85rem;
    height: 0.85rem;
}

.card-poster {
    aspect-ratio: 2/3;
    width: 100%;
    position: relative;
    overflow: hidden;
    background-color: var(--bg-surface-solid);
}

.card-poster-placeholder {
    background-color: var(--bg-surface-solid);
}

.poster-skeleton {
    display: block;
    border-radius: 6px;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.04),
        rgba(255, 255, 255, 0.09),
        rgba(255, 255, 255, 0.04)
    );
    background-size: 220% 100%;
    animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

.poster-skeleton-poster {
    width: 100%;
    height: 100%;
    border-radius: 0;
}

.poster-skeleton-title {
    width: 78%;
    height: 1.1875rem;
}

.poster-skeleton-meta {
    width: 34%;
    height: 0.9375rem;
}

.poster-skeleton-meta.short {
    width: 24%;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: -100% 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .poster-skeleton {
        animation: none;
    }
}

.card-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.movie-card:hover .card-poster img {
    transform: scale(1.05);
}

/* Poster placeholder */
.poster-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted);
}

.poster-placeholder svg {
    width: 3rem;
    height: 3rem;
}

.poster-placeholder span {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Card badges */
.card-badges {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    z-index: 4; /* Keep badges on top of hover overlay (z-index 3) so they are clickable */
}

.card-badge {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.card-badge.imdb {
    color: var(--imdb-color);
}

.card-badge.rt {
    color: var(--rt-color);
}

.card-badge.mc {
    color: var(--mc-color);
}

.card-badge.duration {
    color: #38bdf8; /* Light blue */
}

/* Card details overlay on hover */
.card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 12, 16, 0.95) 0%, rgba(10, 12, 16, 0.6) 60%, transparent 100%);
    opacity: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.25rem;
    transition: var(--transition-smooth);
    z-index: 3;
}

.movie-card:hover .card-overlay {
    opacity: 1;
}

.overlay-plot {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

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

/* Card info footer (always visible) */
.card-info {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex-grow: 1;
    background: var(--bg-card-solid);
}

.card-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-sub {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 2rem;
    text-align: center;
    background: var(--bg-surface);
    border: 1px dashed var(--border-color);
    border-radius: 16px;
    gap: 1rem;
}

.empty-state svg {
    width: 4rem;
    height: 4rem;
    color: var(--text-muted);
}

.empty-state h4 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
}

.empty-state p {
    color: var(--text-secondary);
    max-width: 450px;
    font-size: 0.95rem;
}

.sync-status {
    min-height: 1.1rem;
    margin-top: 0.35rem;
}

.sync-status[data-state="active"] {
    color: #93c5fd;
}

.sync-status[data-state="success"] {
    color: #86efac;
}

.sync-status[data-state="error"] {
    color: #fca5a5;
}

.setup-notice {
    margin-top: 1rem;
    padding: 0.75rem 1.25rem;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.85rem;
}

/* Modals */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: fadeIn 0.25s ease;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(5, 6, 8, 0.85);
    backdrop-filter: blur(12px);
}

.modal-container {
    position: relative;
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1001;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), var(--shadow-glow);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-smooth);
    z-index: 10;
}

.modal-close:hover {
    background: var(--border-hover);
    color: var(--text-primary);
    transform: scale(1.05);
}

/* Modal Content Details */
.movie-details-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2.5rem;
    padding: 2.5rem;
}

@media (max-width: 768px) {
    .movie-details-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.5rem;
    }
    .hero-content {
        flex-direction: column-reverse;
        padding: 1.5rem;
        gap: 1.5rem;
    }
    .hero-poster-wrapper {
        align-self: center;
    }
}

.modal-poster {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    aspect-ratio: 2/3;
}

.modal-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-info {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.2;
}

.modal-meta-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.meta-pill {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    color: var(--text-secondary);
}

.meta-pill.genre {
    border-color: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

.modal-plot-section h5, .modal-cast-section h5 {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.modal-plot {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.cast-row {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.cast-row strong {
    color: #fff;
}

.modal-actions {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
}

.modal-actions .btn {
    flex: 1;
}

.modal-seen-toggle.active {
    border-color: rgba(52, 211, 153, 0.65);
    color: #a7f3d0;
    background: rgba(6, 78, 59, 0.32);
}

/* Roulette Specifics */
.roulette-container {
    max-width: 780px !important;
    --text-primary: #f3f4f6;
    --text-secondary: #a9afbd;
    --text-muted: #747c8d;
    --border-color: rgba(255, 255, 255, 0.09);
    --bg-card-solid: #161b29;
    background:
        radial-gradient(circle at 12% 0%, rgba(34, 211, 238, 0.13), transparent 32%),
        radial-gradient(circle at 88% 100%, rgba(139, 92, 246, 0.2), transparent 36%),
        #0b0e17;
    border-color: rgba(167, 139, 250, 0.24);
    box-shadow: 0 32px 80px -26px rgba(0, 0, 0, 0.9), 0 0 60px rgba(139, 92, 246, 0.13);
    isolation: isolate;
}

.roulette-ambient,
.roulette-orbit,
.roulette-scanlines {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.roulette-ambient {
    z-index: -1;
    overflow: hidden;
}

.roulette-orbit {
    width: 380px;
    height: 380px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    opacity: 0.65;
    animation: rouletteOrbit 22000ms linear infinite;
}

.roulette-orbit::before,
.roulette-orbit::after {
    content: "";
    position: absolute;
    inset: 16%;
    border: 1px dashed rgba(167, 139, 250, 0.14);
    border-radius: inherit;
}

.roulette-orbit::after {
    inset: 36%;
    border-style: solid;
}

.roulette-orbit-one {
    top: -235px;
    left: -140px;
    box-shadow: 0 0 70px rgba(34, 211, 238, 0.12);
}

.roulette-orbit-two {
    right: -170px;
    bottom: -255px;
    left: auto;
    box-shadow: 0 0 75px rgba(139, 92, 246, 0.18);
    animation-direction: reverse;
}

.roulette-scanlines {
    background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 6px);
    mix-blend-mode: screen;
    opacity: 0.45;
}

.roulette-content {
    position: relative;
    z-index: 1;
    padding: 2.1rem 2.35rem 2.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
}

.roulette-heading {
    max-width: 590px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
}

.roulette-kicker,
.roulette-result-kicker,
.roulette-winner-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-heading);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.roulette-kicker {
    color: #67e8f9;
    font-size: 0.7rem;
}

.roulette-kicker svg {
    width: 0.9rem;
    height: 0.9rem;
}

.roulette-content h3 {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 0.95;
    font-weight: 900;
    letter-spacing: -0.045em;
    background: linear-gradient(135deg, #fff 30%, #c4b5fd 74%, #67e8f9 110%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.roulette-heading p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.45;
}

.roulette-wheel-container {
    position: relative;
    width: 100%;
    height: 190px;
    margin: 0.55rem 0 0.2rem;
    background:
        linear-gradient(90deg, rgba(5, 7, 13, 0.98), transparent 18% 82%, rgba(5, 7, 13, 0.98)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015));
    border: 1px solid rgba(167, 139, 250, 0.28);
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: inset 0 0 35px rgba(0, 0, 0, 0.72), 0 12px 34px rgba(0, 0, 0, 0.24);
}

.roulette-wheel-container::before,
.roulette-wheel-container::after {
    content: "";
    position: absolute;
    z-index: 7;
    top: 0;
    bottom: 0;
    width: 16%;
    pointer-events: none;
}

.roulette-wheel-container::before {
    left: 0;
    background: linear-gradient(90deg, #080a11, transparent);
}

.roulette-wheel-container::after {
    right: 0;
    background: linear-gradient(-90deg, #080a11, transparent);
}

.roulette-lights {
    position: absolute;
    z-index: 12;
    left: 1.15rem;
    right: 1.15rem;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.roulette-lights-top {
    top: 0.55rem;
}

.roulette-lights-bottom {
    bottom: 0.55rem;
}

.roulette-lights span {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(196, 181, 253, 0.28);
    box-shadow: 0 0 0 rgba(167, 139, 250, 0);
}

.roulette-wheel-container[data-state="spinning"] .roulette-lights span {
    animation: rouletteLampChase 900ms ease-in-out infinite;
    animation-delay: calc(var(--lamp-index, 0) * 90ms);
}

.roulette-lights span:nth-child(2) { animation-delay: 90ms !important; }
.roulette-lights span:nth-child(3) { animation-delay: 180ms !important; }
.roulette-lights span:nth-child(4) { animation-delay: 270ms !important; }
.roulette-lights span:nth-child(5) { animation-delay: 360ms !important; }
.roulette-lights span:nth-child(6) { animation-delay: 450ms !important; }
.roulette-lights span:nth-child(7) { animation-delay: 540ms !important; }
.roulette-lights span:nth-child(8) { animation-delay: 630ms !important; }
.roulette-lights span:nth-child(9) { animation-delay: 720ms !important; }

.roulette-wheel-container[data-state="resolved"] .roulette-lights span {
    background: #fbbf24;
    box-shadow: 0 0 9px rgba(251, 191, 36, 0.9);
}

.roulette-selector {
    position: absolute;
    inset: 0 auto;
    z-index: 14;
    left: 50%;
    width: 28px;
    transform: translateX(-50%);
    pointer-events: none;
}

.roulette-selector-beam {
    position: absolute;
    top: 15px;
    bottom: 15px;
    left: 50%;
    width: 2px;
    background: linear-gradient(transparent, #fbbf24 16% 84%, transparent);
    box-shadow: 0 0 14px rgba(251, 191, 36, 0.82), 0 0 4px #fbbf24;
    transform: translateX(-50%);
}

.roulette-selector-caret {
    position: absolute;
    z-index: 1;
    left: 50%;
    width: 0;
    height: 0;
    filter: drop-shadow(0 0 7px rgba(251, 191, 36, 0.8));
    transform: translateX(-50%);
}

.roulette-selector-caret-top {
    top: 0;
    border-left: 11px solid transparent;
    border-right: 11px solid transparent;
    border-top: 15px solid #fbbf24;
}

.roulette-selector-caret-bottom {
    bottom: 0;
    border-left: 11px solid transparent;
    border-right: 11px solid transparent;
    border-bottom: 15px solid #fbbf24;
}

.roulette-wheel-container[data-state="spinning"] .roulette-selector {
    animation: rouletteSelectorPulse 520ms ease-in-out infinite alternate;
}

.roulette-display {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    justify-content: center;
    position: relative;
    padding: 18px 0;
}

.roulette-item-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    color: var(--text-muted);
}

.roulette-item-placeholder strong {
    font-family: var(--font-heading);
    color: var(--text-primary);
    font-size: 0.95rem;
}

.roulette-item-placeholder > span:last-child {
    font-size: 0.72rem;
}

.roulette-placeholder-icon {
    width: 2.6rem;
    height: 2.6rem;
    margin-bottom: 0.2rem;
    border: 1px solid rgba(167, 139, 250, 0.32);
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #c4b5fd;
    background: rgba(139, 92, 246, 0.12);
    box-shadow: 0 0 24px rgba(139, 92, 246, 0.13);
    animation: rouletteIdleFloat 2400ms ease-in-out infinite;
}

.roulette-placeholder-icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.roulette-spinner-track {
    display: flex;
    position: absolute;
    left: 50%;
    gap: 12px;
    will-change: transform;
}

.spinner-card {
    width: 104px;
    height: 156px;
    border-radius: 11px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    background-color: var(--bg-card-solid);
    box-shadow: 0 9px 20px rgba(0, 0, 0, 0.42);
    transform: translateZ(0);
    transition: filter 220ms ease, opacity 220ms ease, transform 420ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 420ms ease;
}

.spinner-card img,
.spinner-card > .poster-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.roulette-wheel-container[data-state="spinning"] .spinner-card {
    filter: saturate(0.86) brightness(0.88);
}

.roulette-wheel-container[data-state="resolved"] .spinner-card:not(.is-winning-card) {
    opacity: 0.36;
    filter: grayscale(0.45) brightness(0.58);
}

.roulette-wheel-container[data-state="resolved"] .spinner-card.is-winning-card {
    z-index: 3;
    border-color: #fbbf24;
    box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.24), 0 0 32px rgba(251, 191, 36, 0.45), 0 12px 28px rgba(0, 0, 0, 0.5);
    animation: rouletteWinnerSnap 620ms cubic-bezier(0.16, 1.2, 0.3, 1) both;
}

.spinner-card-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.94) 48%);
    color: #fff;
    font-size: 0.68rem;
    padding: 1.25rem 0.4rem 0.4rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--font-heading);
}

.roulette-actions {
    width: 100%;
}

.roulette-actions .btn {
    width: 100%;
    min-height: 3.25rem;
    border-radius: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    box-shadow: 0 12px 30px rgba(124, 58, 237, 0.24);
}

.roulette-actions .btn:disabled {
    opacity: 0.88;
}

.roulette-button-spinner {
    animation: spin 850ms linear infinite;
}

.roulette-result {
    width: 100%;
    margin-top: 0.35rem;
}

.roulette-result-stage {
    position: relative;
    padding: 1.15rem;
    border: 1px solid rgba(251, 191, 36, 0.24);
    border-radius: 18px;
    background:
        radial-gradient(circle at 14% 50%, rgba(251, 191, 36, 0.11), transparent 32%),
        linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(255, 255, 255, 0.035));
    overflow: hidden;
    animation: rouletteResultReveal 680ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.roulette-winner-burst {
    position: absolute;
    top: 50%;
    left: 12%;
    width: 260px;
    height: 260px;
    background: repeating-conic-gradient(from 0deg, rgba(251, 191, 36, 0.12) 0 4deg, transparent 4deg 13deg);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    mask-image: radial-gradient(circle, transparent 0 18%, black 50%, transparent 72%);
    -webkit-mask-image: radial-gradient(circle, transparent 0 18%, black 50%, transparent 72%);
    animation: rouletteBurstSpin 11000ms linear infinite;
    pointer-events: none;
}

.roulette-result-kicker {
    position: relative;
    z-index: 1;
    width: fit-content;
    margin: 0 auto 0.7rem;
    padding: 0.3rem 0.72rem;
    border: 1px solid rgba(251, 191, 36, 0.42);
    border-radius: 999px;
    color: #fde68a;
    background: rgba(113, 63, 18, 0.42);
    font-size: 0.64rem;
    box-shadow: 0 0 18px rgba(251, 191, 36, 0.13);
}

.roulette-result-kicker svg {
    width: 0.85rem;
    height: 0.85rem;
}

.roulette-winner-card {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
    color: inherit;
    background: rgba(5, 7, 13, 0.66);
    text-align: left;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.24);
    transition: transform 200ms ease, border-color 200ms ease, background 200ms ease, box-shadow 200ms ease;
}

.roulette-winner-card:hover,
.roulette-winner-card:focus-visible {
    transform: translateY(-3px);
    border-color: rgba(167, 139, 250, 0.72);
    background: rgba(16, 13, 30, 0.86);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.34), 0 0 28px rgba(139, 92, 246, 0.13);
    outline: none;
}

.roulette-winner-card:focus-visible {
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.3), 0 16px 40px rgba(0, 0, 0, 0.34);
}

.roulette-winner-poster {
    position: relative;
    width: 112px;
    aspect-ratio: 2 / 3;
    border: 1px solid rgba(251, 191, 36, 0.34);
    border-radius: 9px;
    overflow: hidden;
    background: var(--bg-card-solid);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.44), 0 0 24px rgba(251, 191, 36, 0.1);
}

.roulette-winner-poster img,
.roulette-winner-poster > .poster-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.roulette-poster-sweep {
    position: absolute;
    inset: -45% 0 auto;
    height: 42%;
    background: linear-gradient(transparent, rgba(255, 255, 255, 0.32), transparent);
    transform: skewY(-10deg);
    animation: roulettePosterSweep 1800ms ease-out 220ms both;
}

.roulette-winner-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.42rem;
}

.roulette-winner-label {
    color: #c4b5fd;
    font-size: 0.61rem;
}

.roulette-winner-info > strong {
    max-width: 100%;
    color: #fff;
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 4vw, 2.15rem);
    line-height: 1.02;
    font-weight: 900;
    letter-spacing: -0.035em;
    overflow-wrap: anywhere;
}

.roulette-winner-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.7rem;
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.roulette-winner-meta > span {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.roulette-winner-meta svg,
.roulette-details-hint svg {
    width: 0.82rem;
    height: 0.82rem;
}

.roulette-score {
    font-weight: 800;
}

.roulette-score.is-great { color: #6ee7b7; }
.roulette-score.is-good { color: #fde68a; }
.roulette-score.is-low { color: #fca5a5; }
.roulette-score.is-imdb { color: var(--imdb-color); }

.roulette-winner-director {
    color: var(--text-secondary);
    font-size: 0.76rem;
}

.roulette-winner-plot {
    max-width: 54ch;
    display: -webkit-box;
    overflow: hidden;
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.42;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.roulette-details-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.15rem;
    color: #c4b5fd;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
}

.roulette-result-actions {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: flex-end;
    margin-top: 0.65rem;
}

@keyframes rouletteOrbit {
    to { transform: rotate(360deg); }
}

@keyframes rouletteIdleFloat {
    0%, 100% { transform: translateY(0) rotate(-4deg); }
    50% { transform: translateY(-5px) rotate(4deg); }
}

@keyframes rouletteLampChase {
    0%, 100% { background: rgba(196, 181, 253, 0.25); box-shadow: 0 0 0 transparent; }
    45% { background: #67e8f9; box-shadow: 0 0 11px rgba(103, 232, 249, 0.95); }
}

@keyframes rouletteSelectorPulse {
    from { filter: brightness(0.88); }
    to { filter: brightness(1.28); }
}

@keyframes rouletteWinnerSnap {
    from { transform: scale(0.94); }
    65% { transform: scale(1.06); }
    to { transform: scale(1.025); }
}

@keyframes rouletteResultReveal {
    from { opacity: 0; transform: translateY(18px) scale(0.975); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes rouletteBurstSpin {
    from { transform: translate(-50%, -50%) rotate(0); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes roulettePosterSweep {
    from { transform: translateY(0) skewY(-10deg); }
    to { transform: translateY(520%) skewY(-10deg); }
}

@media (prefers-reduced-motion: reduce) {
    .roulette-orbit,
    .roulette-placeholder-icon,
    .roulette-wheel-container[data-state="spinning"] .roulette-lights span,
    .roulette-wheel-container[data-state="spinning"] .roulette-selector,
    .roulette-wheel-container[data-state="resolved"] .spinner-card.is-winning-card,
    .roulette-result-stage,
    .roulette-winner-burst,
    .roulette-poster-sweep {
        animation: none !important;
    }

    .roulette-spinner-track {
        transition-duration: 120ms !important;
    }
}

/* Direct friends */
.settings-nav-count {
    min-width: 1.3rem;
    height: 1.3rem;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.32rem;
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.16);
    color: #c4b5fd;
    font-size: 0.65rem;
    font-weight: 800;
}

.settings-nav-count.has-requests {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.13);
}

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.friends-settings-tab { gap: 1.15rem; }

.settings-title-row,
.friend-section-heading,
.friend-directory-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.settings-title-row .tab-subtitle { margin: 0.2rem 0 0; }

.friend-total-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    flex: 0 0 auto;
    padding: 0.42rem 0.66rem;
    border: 1px solid rgba(139, 92, 246, 0.22);
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.08);
    color: #c4b5fd;
    font-size: 0.72rem;
    font-weight: 700;
}

.friend-total-pill svg { width: 0.9rem; height: 0.9rem; }

.friend-code-card,
.friend-add-card {
    position: relative;
    z-index: 1;
    min-width: 0;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: color-mix(in srgb, var(--bg-surface-solid) 86%, transparent);
}

.friend-code-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem;
}

.friend-card-icon {
    width: 2.3rem;
    height: 2.3rem;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: linear-gradient(145deg, rgba(139, 92, 246, 0.24), rgba(59, 130, 246, 0.12));
    color: #c4b5fd;
}

.friend-card-icon svg { width: 1.05rem; height: 1.05rem; }

.friend-code-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.06rem;
}

.friend-section-kicker {
    color: var(--accent);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.friend-code-copy strong {
    overflow: hidden;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 1.15rem;
    letter-spacing: 0.13em;
    line-height: 1.2;
    text-overflow: ellipsis;
}

.friend-code-copy small {
    overflow: hidden;
    color: var(--text-muted);
    font-size: 0.62rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.friend-copy-code,
.friend-icon-button {
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.friend-copy-code {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.48rem 0.56rem;
    border-radius: 8px;
    font: inherit;
    font-size: 0.7rem;
    font-weight: 700;
}

.friend-copy-code svg,
.friend-icon-button svg { width: 0.9rem; height: 0.9rem; }

.friend-copy-code:hover,
.friend-copy-code:focus-visible,
.friend-icon-button:hover,
.friend-icon-button:focus-visible {
    border-color: rgba(139, 92, 246, 0.45);
    background: rgba(139, 92, 246, 0.12);
    color: var(--text-primary);
    outline: none;
}

.friend-copy-code.is-copied {
    border-color: rgba(34, 197, 94, 0.42);
    background: rgba(34, 197, 94, 0.11);
    color: #4ade80;
}

.friend-add-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.42rem;
    padding: 0.7rem 0.75rem;
}

.friend-add-card > label {
    color: var(--text-primary);
    font-size: 0.74rem;
    font-weight: 750;
}

.friend-add-control {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 0.45rem;
}

.friend-add-control > svg {
    position: absolute;
    z-index: 1;
    left: 0.68rem;
    top: 50%;
    width: 0.88rem;
    height: 0.88rem;
    color: var(--text-muted);
    transform: translateY(-50%);
    pointer-events: none;
}

.friend-add-control input {
    min-width: 0;
    flex: 1;
    padding: 0.58rem 0.65rem 0.58rem 2rem;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    background: var(--input-bg);
    color: var(--text-primary);
    font: inherit;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.friend-add-control input:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

.friend-add-control .btn {
    flex: 0 0 auto;
    padding: 0.52rem 0.75rem;
    font-size: 0.68rem;
    white-space: nowrap;
}

.friend-add-status {
    min-height: 0.8rem;
    margin: 0;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 0.61rem;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.friend-add-status.is-error { color: #f87171; }
.friend-add-status.is-success { color: #4ade80; }

.friend-requests-section,
.friend-directory {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.friend-section-heading h4,
.friend-directory-toolbar h4 {
    margin: 0.06rem 0 0;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 0.96rem;
}

.friend-request-count {
    min-width: 1.45rem;
    height: 1.45rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.13);
    color: #c4b5fd;
    font-size: 0.68rem;
    font-weight: 800;
}

.friend-request-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.friend-request-card {
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.58rem;
    padding: 0.58rem;
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 11px;
    background: rgba(139, 92, 246, 0.055);
}

.friend-request-card > img {
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 50%;
    object-fit: cover;
    background: var(--input-bg);
}

.friend-request-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.08rem;
}

.friend-request-copy strong,
.friend-request-copy span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.friend-request-copy strong {
    color: var(--text-primary);
    font-size: 0.74rem;
}

.friend-request-copy span {
    color: var(--text-muted);
    font-size: 0.61rem;
}

.friend-request-actions,
.friend-card-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.friend-request-actions .btn {
    padding: 0.36rem 0.58rem;
    font-size: 0.64rem;
}

.friend-icon-button {
    width: 2rem;
    height: 2rem;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    padding: 0;
    border-radius: 8px;
}

.friend-directory-toolbar { align-items: flex-end; }

.friend-search {
    position: relative;
    width: min(180px, 42%);
}

.friend-search > svg {
    position: absolute;
    left: 0.62rem;
    top: 50%;
    width: 0.8rem;
    height: 0.8rem;
    color: var(--text-muted);
    transform: translateY(-50%);
    pointer-events: none;
}

.friend-search input {
    width: 100%;
    padding: 0.48rem 0.65rem 0.48rem 1.85rem;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    background: var(--input-bg);
    color: var(--text-primary);
    font: inherit;
    font-size: 0.69rem;
}

.friend-search input:focus {
    border-color: rgba(139, 92, 246, 0.5);
    outline: none;
}

.friend-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.58rem;
}

.friend-card {
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.65rem;
    padding: 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.018);
    transition: var(--transition-smooth);
}

.friend-card:hover {
    border-color: rgba(139, 92, 246, 0.3);
    background: rgba(139, 92, 246, 0.04);
    transform: translateY(-1px);
}

.friend-avatar-button {
    position: relative;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    cursor: pointer;
}

.friend-avatar-button img {
    width: 100%;
    height: 100%;
    display: block;
    border: 2px solid color-mix(in srgb, var(--accent) 32%, var(--border-color));
    border-radius: 50%;
    object-fit: cover;
    background: var(--input-bg);
}

.friend-status-dot {
    position: absolute;
    right: 0;
    bottom: 0.08rem;
    width: 0.62rem;
    height: 0.62rem;
    border: 2px solid var(--bg-surface-solid);
    border-radius: 50%;
    background: #8b5cf6;
}

.friend-card-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
}

.friend-name-button {
    align-self: flex-start;
    max-width: 100%;
    overflow: hidden;
    padding: 0;
    border: 0;
    background: none;
    color: var(--text-primary);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.friend-name-button:hover { color: #c4b5fd; }

.friend-card-copy > span {
    color: var(--text-muted);
    font-size: 0.6rem;
}

.friend-connections {
    min-width: 0;
    display: flex;
    gap: 0.25rem;
    margin-top: 0.18rem;
    overflow: hidden;
}

.friend-connections span {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    overflow: hidden;
    padding: 0.2rem 0.34rem;
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.08);
    color: var(--text-secondary);
    font-size: 0.56rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.friend-connections span.is-direct { background: rgba(59, 130, 246, 0.08); }

.friend-connections svg {
    width: 0.65rem;
    height: 0.65rem;
    flex: 0 0 auto;
    color: var(--accent);
}

.friend-card-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
    padding-top: 0.48rem;
    border-top: 1px solid color-mix(in srgb, var(--border-color) 65%, transparent);
}

.friend-card-actions .btn {
    margin-right: auto;
    padding: 0.36rem 0.55rem;
    font-size: 0.62rem;
}

.friend-card-actions .btn svg { width: 0.78rem; height: 0.78rem; }

.friend-remove:hover,
.friend-remove:focus-visible {
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

.friend-panel-loading {
    grid-column: 1 / -1;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    color: var(--text-muted);
    font-size: 0.76rem;
}

.friend-empty-state {
    grid-column: 1 / -1;
    min-height: 148px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 1.1rem;
    border: 1px dashed color-mix(in srgb, var(--accent) 26%, var(--border-color));
    border-radius: 14px;
    background: rgba(139, 92, 246, 0.025);
    text-align: center;
}

.friend-empty-state.is-compact { min-height: 100px; }

.friend-empty-state strong {
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 0.88rem;
}

.friend-empty-state p {
    max-width: 46ch;
    margin: 0;
    color: var(--text-muted);
    font-size: 0.67rem;
    line-height: 1.45;
}

.friend-empty-illustration {
    display: flex;
    align-items: center;
    margin-bottom: 0.16rem;
}

.friend-empty-illustration span {
    width: 2.25rem;
    height: 2.25rem;
    display: grid;
    place-items: center;
    margin: 0 -0.12rem;
    border: 2px solid var(--bg-surface-solid);
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
}

.friend-empty-illustration span:nth-child(2) {
    z-index: 1;
    width: 1.65rem;
    height: 1.65rem;
    background: var(--accent);
    color: #fff;
}

.friend-empty-illustration svg,
.friend-empty-search svg { width: 0.95rem; height: 0.95rem; }

.friend-empty-search {
    width: 2rem;
    height: 2rem;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent);
}

:root.light-theme .friend-code-card,
:root.light-theme .friend-add-card,
:root.light-theme .friend-card {
    background: rgba(255, 255, 255, 0.74);
}

:root.light-theme .friend-total-pill,
:root.light-theme .friend-request-count,
:root.light-theme .settings-nav-count {
    color: var(--accent);
}

:root.light-theme .settings-nav-count.has-requests { color: #fff; }

:root.light-theme .friend-add-status.is-success { color: #15803d; }

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

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* CineScore Blended Rating Styles */
.card-badge.cinescore {
    font-weight: 800;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    gap: 0.3rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    background: rgba(0, 0, 0, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.cinescore-green {
    color: #34d399 !important;
    background: rgba(6, 78, 59, 0.85) !important;
    border: 1px solid rgba(52, 211, 153, 0.45) !important;
}

.cinescore-yellow {
    color: #fbbf24 !important;
    background: rgba(120, 81, 8, 0.85) !important;
    border: 1px solid rgba(251, 191, 36, 0.45) !important;
}

.cinescore-red {
    color: #f87171 !important;
    background: rgba(127, 29, 29, 0.85) !important;
    border: 1px solid rgba(248, 113, 113, 0.45) !important;
}

.cinescore-muted {
    color: var(--text-muted) !important;
    background: rgba(31, 41, 55, 0.85) !important;
    border: 1px solid var(--border-color) !important;
}

/* Hover Rating Expand Transition */
.individual-ratings {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 0;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease-out, margin 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0;
}

.movie-card:hover .individual-ratings,
.card-badges:hover .individual-ratings {
    max-height: 160px; /* enough space for up to 4 ratings */
    opacity: 1;
    pointer-events: auto;
    margin-top: 0.15rem;
    margin-bottom: 0.15rem;
}

/* Deleted Movies Styling */
.movie-card.is-deleted {
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.movie-card.is-deleted:hover {
    opacity: 0.95;
}

.movie-card.is-watchlist-only {
    border-color: rgba(148, 163, 184, 0.34);
}

.movie-card.is-not-interested {
    cursor: default;
    border-color: rgba(6, 182, 212, 0.32);
}

.movie-card.is-not-interested:hover {
    border-color: rgba(6, 182, 212, 0.55);
}

.deleted-ribbon {
    position: absolute;
    right: 0.75rem;
    bottom: 0.75rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    background: rgba(127, 29, 29, 0.85);
    border: 1px solid rgba(248, 113, 113, 0.55);
    color: #fca5a5;
    font-size: 0.75rem;
    font-weight: 800;
    backdrop-filter: blur(6px);
}

.deleted-ribbon svg {
    width: 0.85rem;
    height: 0.85rem;
}

.not-interested-ribbon {
    position: absolute;
    right: 0.75rem;
    bottom: 0.75rem;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.55rem;
    color: #a5f3fc;
    font-size: 0.72rem;
    font-weight: 800;
    background: rgba(8, 47, 73, 0.88);
    border: 1px solid rgba(34, 211, 238, 0.48);
    border-radius: 999px;
    box-shadow: 0 0 0 1px rgba(8, 47, 73, 0.35);
    backdrop-filter: blur(6px);
}

.not-interested-ribbon svg {
    width: 0.85rem;
    height: 0.85rem;
}

.not-interested-undo {
    justify-content: center;
    width: 100%;
    margin-top: 0.6rem;
    padding: 0.55rem 0.7rem;
    font-size: 0.78rem;
}

.not-interested-undo svg {
    width: 0.95rem;
    height: 0.95rem;
}

.watchlist-only-ribbon {
    position: absolute;
    right: 0.75rem;
    bottom: 0.75rem;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.78);
    border: 1px solid rgba(148, 163, 184, 0.5);
    color: #cbd5e1;
    font-size: 0.72rem;
    font-weight: 800;
    backdrop-filter: blur(6px);
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.35);
}

.watchlist-only-ribbon svg {
    width: 0.85rem;
    height: 0.85rem;
}

/* Google Login Overlay */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 50%, rgba(20, 24, 38, 0.96), rgba(10, 12, 16, 0.99));
    backdrop-filter: blur(15px);
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.login-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.login-card {
    background: rgba(26, 31, 46, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 440px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 50px rgba(139, 92, 246, 0.08);
    backdrop-filter: blur(10px);
}

.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.login-brand .brand-icon {
    width: 3.5rem;
    height: 3.5rem;
    color: var(--accent);
    filter: drop-shadow(0 0 12px var(--accent-glow));
    margin-bottom: 0.25rem;
}

.login-brand h2 {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 35%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
    margin: 0;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 2.5rem;
}

.login-button-container {
    display: flex;
    justify-content: center;
    min-height: 44px;
}

/* User account trigger and full-height Spotlight drawer */
.user-profile-menu {
    position: relative;
    display: inline-block;
}

.profile-trigger-btn {
    background: none;
    border: 2px solid var(--border-color);
    padding: 2px;
    border-radius: 50%;
    cursor: pointer;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.profile-trigger-btn:hover {
    border-color: var(--accent);
    transform: scale(1.05);
}

.profile-trigger-btn[aria-expanded="true"] {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.14), 0 0 20px var(--accent-glow);
}

.profile-trigger-btn:focus-visible,
.profile-drawer button:focus-visible {
    outline: 2px solid var(--secondary-accent);
    outline-offset: 3px;
}

#user-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

body.profile-drawer-open {
    overflow: hidden;
}

.profile-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 6100;
    background: rgba(3, 5, 10, 0.66);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 220ms ease;
}

.profile-drawer-backdrop.is-open {
    opacity: 1;
}

.profile-drawer {
    --drawer-card: rgba(255, 255, 255, 0.035);
    --drawer-card-strong: rgba(255, 255, 255, 0.065);
    --drawer-cutout-fill: var(--bg-surface-solid);
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 6200;
    width: min(470px, 100vw);
    height: 100dvh;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    color: var(--text-primary);
    background:
        radial-gradient(circle at 100% 0%, rgba(139, 92, 246, 0.13), transparent 32%),
        var(--bg-surface-solid);
    border-left: 1px solid var(--border-color);
    box-shadow: -28px 0 80px rgba(0, 0, 0, 0.42);
    text-align: left;
    transform: translateX(102%);
    transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.profile-drawer.is-open {
    transform: translateX(0);
}

.profile-drawer-topbar {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 1.25rem 0.95rem;
    border-bottom: 1px solid var(--border-color);
}

.profile-drawer-kicker,
.drawer-concept-label,
.drawer-section-eyebrow {
    display: block;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    line-height: 1.2;
    text-transform: uppercase;
}

.profile-drawer-topbar h2 {
    margin-top: 0.15rem;
    font-family: var(--font-heading);
    font-size: 1.15rem;
    letter-spacing: -0.02em;
}

.profile-drawer-close,
.profile-drawer-logout,
.drawer-section-action,
.drawer-icon-action,
.drawer-person-card,
.drawer-crew-card {
    font: inherit;
}

.profile-drawer-close {
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: var(--text-secondary);
    background: var(--drawer-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-fast);
}

.profile-drawer-close:hover {
    color: var(--text-primary);
    background: var(--drawer-card-strong);
    transform: rotate(4deg);
}

.profile-drawer-close svg,
.profile-drawer-logout svg {
    width: 1.05rem;
    height: 1.05rem;
}

.profile-drawer-variant-picker {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.45rem;
    padding: 0 1.25rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.profile-drawer-variant {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.58rem 0.65rem;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.profile-drawer-variant > span {
    color: inherit;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.profile-drawer-variant strong {
    min-width: 0;
    overflow: hidden;
    font-size: 0.72rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-drawer-variant:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: var(--drawer-card);
}

.profile-drawer-variant.active {
    color: #fff;
    border-color: rgba(139, 92, 246, 0.7);
    background: rgba(139, 92, 246, 0.16);
    box-shadow: inset 0 0 18px rgba(139, 92, 246, 0.08);
}

.profile-drawer-scroll {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--border-hover) transparent;
}

#profile-drawer-content {
    min-height: 100%;
    padding: 1.2rem 1.25rem 1.8rem;
}

.drawer-concept-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.drawer-concept-intro p {
    max-width: 270px;
    color: var(--text-muted);
    font-size: 0.72rem;
    line-height: 1.4;
    text-align: right;
}

.drawer-profile-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.drawer-profile-main {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.drawer-profile-avatar-wrap {
    position: relative;
    flex: 0 0 auto;
}

.drawer-profile-avatar {
    width: 4.15rem;
    height: 4.15rem;
    display: block;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.76);
    border-radius: 50%;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

.drawer-profile-status {
    position: absolute;
    right: 1px;
    bottom: 2px;
    width: 0.85rem;
    height: 0.85rem;
    background: #22c55e;
    border: 3px solid var(--bg-surface-solid);
    border-radius: 50%;
}

.drawer-profile-copy {
    min-width: 0;
    flex: 1;
}

.drawer-profile-copy h3 {
    overflow: hidden;
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.35rem;
    line-height: 1.05;
    letter-spacing: -0.035em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drawer-profile-handle {
    display: block;
    overflow: hidden;
    margin-top: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drawer-profile-email {
    display: block;
    overflow: hidden;
    margin-top: 0.15rem;
    color: var(--text-muted);
    font-size: 0.7rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drawer-profile-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.55rem;
}

.drawer-profile-stat {
    display: flex;
    flex-direction: column;
    gap: 0.08rem;
}

.drawer-profile-stat strong {
    font-family: var(--font-heading);
    font-size: 1rem;
}

.drawer-profile-stat span {
    color: var(--text-muted);
    font-size: 0.64rem;
}

.drawer-profile-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
}

.drawer-profile-action {
    min-height: 2.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.68rem 0.7rem;
    color: var(--text-primary);
    background: var(--drawer-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
}

.drawer-profile-action.primary {
    color: #fff;
    background: var(--accent-gradient);
    border-color: transparent;
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.18);
}

.drawer-profile-action:hover {
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.drawer-profile-action svg,
.drawer-section-action svg,
.drawer-person-chevron,
.drawer-empty-state svg,
.drawer-request-banner svg {
    width: 0.95rem;
    height: 0.95rem;
}

.drawer-section {
    margin-top: 1.35rem;
}

.drawer-section-heading {
    min-height: 2.3rem;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.65rem;
}

.drawer-section-heading h3 {
    margin-top: 0.1rem;
    font-family: var(--font-heading);
    font-size: 1rem;
    letter-spacing: -0.015em;
}

.drawer-section-action {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0;
    color: var(--secondary-accent);
    background: transparent;
    border: 0;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
}

.drawer-section-action:hover {
    color: var(--text-primary);
}

.drawer-quick-search {
    position: relative;
    width: 100%;
    min-height: 2.55rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.6rem;
    padding: 0 0.7rem;
    color: var(--text-muted);
    background: var(--drawer-card);
    border: 1px solid var(--border-color);
    border-radius: 11px;
    transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.drawer-quick-search:focus-within {
    color: var(--secondary-accent);
    background: var(--drawer-card-strong);
    border-color: rgba(6, 182, 212, 0.48);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.08);
}

.drawer-quick-search > svg {
    width: 0.95rem;
    height: 0.95rem;
    flex: 0 0 auto;
}

.drawer-quick-search input {
    min-width: 0;
    height: 2.45rem;
    flex: 1;
    color: var(--text-primary);
    background: transparent;
    border: 0;
    outline: 0;
    font: inherit;
    font-size: 0.73rem;
}

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

.drawer-quick-search input::-webkit-search-cancel-button {
    display: none;
}

.drawer-search-clear {
    width: 1.65rem;
    height: 1.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: var(--text-muted);
    background: transparent;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}

.drawer-search-clear:hover {
    color: var(--text-primary);
    background: var(--drawer-card-strong);
}

.drawer-search-clear svg,
.drawer-search-feedback svg,
.drawer-person-add svg,
.drawer-person-state svg {
    width: 0.85rem;
    height: 0.85rem;
}

.drawer-request-banner {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.6rem;
    padding: 0.7rem 0.75rem;
    color: #e9d5ff;
    background: rgba(139, 92, 246, 0.13);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 11px;
    font-size: 0.73rem;
    line-height: 1.35;
    font-family: var(--font-body);
    text-align: left;
    cursor: pointer;
}

.drawer-request-banner strong {
    color: #fff;
}

.drawer-request-banner > span:not(.drawer-request-count) {
    flex: 1;
}

.drawer-request-count {
    min-width: 1.35rem;
    height: 1.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--accent);
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 800;
}

.drawer-person-list,
.drawer-crew-list {
    display: grid;
    gap: 0.5rem;
}

.drawer-person-card,
.drawer-crew-card {
    width: 100%;
    color: var(--text-primary);
    background: var(--drawer-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.drawer-person-card {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.62rem 0.7rem;
    text-align: left;
}

.drawer-person-card:hover,
.drawer-crew-card:hover {
    background: var(--drawer-card-strong);
    border-color: var(--border-hover);
    transform: translateX(-2px);
}

.drawer-person-card img {
    width: 2.35rem;
    height: 2.35rem;
    flex: 0 0 auto;
    object-fit: cover;
    border: 1px solid var(--border-hover);
    border-radius: 50%;
}

.drawer-person-copy {
    min-width: 0;
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.13rem;
}

.drawer-person-copy strong,
.drawer-crew-copy strong {
    overflow: hidden;
    font-size: 0.79rem;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drawer-person-copy span,
.drawer-crew-copy span {
    overflow: hidden;
    color: var(--text-muted);
    font-size: 0.65rem;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drawer-person-chevron {
    flex: 0 0 auto;
    color: var(--text-muted);
}

.drawer-directory-results {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.drawer-directory-label {
    color: var(--text-muted);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.drawer-person-result {
    cursor: default;
}

.drawer-person-result:hover {
    transform: none;
}

.drawer-person-add,
.drawer-person-state {
    min-height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    flex: 0 0 auto;
    padding: 0.4rem 0.55rem;
    color: #fff;
    background: var(--accent-gradient);
    border: 1px solid transparent;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-size: 0.64rem;
    font-weight: 700;
    cursor: pointer;
}

.drawer-person-add.secondary,
.drawer-person-state {
    color: var(--text-secondary);
    background: var(--drawer-card-strong);
    border-color: var(--border-color);
}

.drawer-person-add:hover {
    transform: translateY(-1px);
}

.drawer-person-state {
    cursor: default;
    opacity: 0.8;
}

.drawer-search-feedback,
.drawer-search-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.55rem;
    padding: 0.6rem 0.7rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.015);
    border-radius: 9px;
    font-size: 0.66rem;
    line-height: 1.4;
}

.drawer-search-feedback.is-error {
    color: #f87171;
}

.drawer-search-hint {
    display: block;
    margin-bottom: 0;
}

.drawer-crew-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.8rem;
    padding: 0.78rem;
    text-align: left;
}

.drawer-crew-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
}

.drawer-avatar-stack {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-left: 0.45rem;
}

.drawer-avatar-stack img,
.drawer-avatar-overflow {
    width: 1.75rem;
    height: 1.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: -0.45rem;
    object-fit: cover;
    color: var(--text-secondary);
    background: var(--bg-card-solid);
    border: 2px solid var(--bg-surface-solid);
    border-radius: 50%;
    font-size: 0.58rem;
    font-weight: 800;
}

.drawer-empty-state {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.8rem;
    color: var(--text-muted);
    background: var(--drawer-card);
    border: 1px dashed var(--border-hover);
    border-radius: 12px;
    font-size: 0.7rem;
    line-height: 1.45;
}

.drawer-more-note {
    display: block;
    margin-top: 0.55rem;
    color: var(--text-muted);
    font-size: 0.64rem;
    text-align: center;
}

.profile-drawer-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    background: rgba(0, 0, 0, 0.13);
    border-top: 1px solid var(--border-color);
}

.profile-drawer-footer > span {
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.profile-drawer-logout {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.6rem;
    color: var(--text-muted);
    background: transparent;
    border: 0;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
}

.profile-drawer-logout:hover {
    color: #f87171;
    background: rgba(239, 68, 68, 0.08);
}

/* Spotlight profile summary: a warm art-house admission ticket. */
.profile-drawer[data-variant="spotlight"] .drawer-profile-card {
    --ticket-paper: #eee1c7;
    --ticket-ink: #24201e;
    --ticket-muted: rgba(36, 32, 30, 0.6);
    --ticket-notch-radius: 0.7rem;
    --ticket-notch-y: 7.35rem;
    padding: 1.15rem 1rem 0;
    color: var(--ticket-ink);
    background:
        radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.32), transparent 28%),
        var(--ticket-paper);
    border-color: rgba(36, 32, 30, 0.12);
    border-radius: 12px;
    box-shadow: none;
}

@supports not ((mask-composite: intersect) or (-webkit-mask-composite: source-in)) {
    .profile-drawer[data-variant="spotlight"] {
        background: var(--drawer-cutout-fill);
    }

    .profile-drawer[data-variant="spotlight"] .drawer-profile-card {
        filter: none;
        box-shadow: none;
    }
}

@supports ((mask-composite: intersect) or (-webkit-mask-composite: source-in)) {
    .profile-drawer[data-variant="spotlight"] .drawer-profile-card {
        -webkit-mask-image:
            radial-gradient(circle at 0 var(--ticket-notch-y), transparent 0 var(--ticket-notch-radius), #000 calc(var(--ticket-notch-radius) + 1px)),
            radial-gradient(circle at 100% var(--ticket-notch-y), transparent 0 var(--ticket-notch-radius), #000 calc(var(--ticket-notch-radius) + 1px));
        -webkit-mask-composite: source-in;
        -webkit-mask-repeat: no-repeat;
        mask-image:
            radial-gradient(circle at 0 var(--ticket-notch-y), transparent 0 var(--ticket-notch-radius), #000 calc(var(--ticket-notch-radius) + 1px)),
            radial-gradient(circle at 100% var(--ticket-notch-y), transparent 0 var(--ticket-notch-radius), #000 calc(var(--ticket-notch-radius) + 1px));
        mask-composite: intersect;
        mask-repeat: no-repeat;
        filter:
            drop-shadow(0 0 0.7px rgba(36, 32, 30, 0.24))
            drop-shadow(0 14px 18px rgba(0, 0, 0, 0.18));
        box-shadow: none;
    }

    .profile-drawer[data-variant="spotlight"] .drawer-profile-stats::before,
    .profile-drawer[data-variant="spotlight"] .drawer-profile-stats::after {
        display: none;
    }
}

.profile-drawer[data-variant="spotlight"] .drawer-ticket-serial {
    position: absolute;
    top: 0.75rem;
    right: 0.85rem;
    z-index: 2;
    color: rgba(36, 32, 30, 0.5);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.52rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.profile-drawer[data-variant="spotlight"] .drawer-profile-main {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) 3.1rem;
    gap: 0.75rem;
    min-height: 5.7rem;
    padding-top: 0.35rem;
}

.profile-drawer[data-variant="spotlight"] .drawer-profile-avatar {
    width: 3.8rem;
    height: 3.8rem;
    border-color: rgba(36, 32, 30, 0.28);
    box-shadow: 0 8px 18px rgba(36, 32, 30, 0.18);
}

.profile-drawer[data-variant="spotlight"] .drawer-profile-status {
    border-color: var(--ticket-paper);
}

.profile-drawer[data-variant="spotlight"] .drawer-ticket-presents {
    display: block;
    overflow: hidden;
    margin-bottom: 0.25rem;
    color: rgba(36, 32, 30, 0.54);
    font-size: 0.5rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.profile-drawer[data-variant="spotlight"] .drawer-profile-copy h3 {
    color: var(--ticket-ink);
    font-size: 1.25rem;
}

.profile-drawer[data-variant="spotlight"] .drawer-profile-handle {
    color: var(--ticket-muted);
}

.profile-drawer[data-variant="spotlight"] .drawer-ticket-stamp {
    align-self: center;
    justify-self: end;
    width: 2.9rem;
    padding: 0.43rem 0.2rem;
    color: rgba(148, 57, 78, 0.76);
    border: 2px solid rgba(148, 57, 78, 0.58);
    border-radius: 50%;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.52rem;
    font-weight: 800;
    line-height: 1;
    text-align: center;
    text-transform: uppercase;
    transform: rotate(-7deg);
}

.profile-drawer[data-variant="spotlight"] .drawer-profile-stats {
    position: relative;
    z-index: 1;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    margin: 0.45rem -1rem 0;
    padding: 0.9rem 0 0.85rem;
    border-top: 1px dashed rgba(36, 32, 30, 0.32);
}

.profile-drawer[data-variant="spotlight"] .drawer-profile-stats::before,
.profile-drawer[data-variant="spotlight"] .drawer-profile-stats::after {
    content: "";
    position: absolute;
    top: calc(var(--ticket-notch-radius) * -1);
    width: calc(var(--ticket-notch-radius) * 2);
    height: calc(var(--ticket-notch-radius) * 2);
    background: var(--drawer-cutout-fill);
    border: 0;
    border-radius: 50%;
    box-shadow: none;
}

.profile-drawer[data-variant="spotlight"] .drawer-profile-stats::before {
    left: calc(var(--ticket-notch-radius) * -1);
}

.profile-drawer[data-variant="spotlight"] .drawer-profile-stats::after {
    right: calc(var(--ticket-notch-radius) * -1);
}

.profile-drawer[data-variant="spotlight"] .drawer-profile-stat {
    align-items: center;
    justify-content: center;
    flex-direction: row;
    gap: 0.35rem;
    color: var(--ticket-muted);
}

.profile-drawer[data-variant="spotlight"] .drawer-profile-stat + .drawer-profile-stat {
    border-left: 1px solid rgba(36, 32, 30, 0.12);
}

.profile-drawer[data-variant="spotlight"] .drawer-profile-stat strong {
    color: var(--ticket-ink);
    font-size: 1.05rem;
}

.profile-drawer[data-variant="spotlight"] .drawer-profile-stat span {
    color: inherit;
    font-size: 0.58rem;
}

.profile-drawer[data-variant="spotlight"] .drawer-profile-ticket + .drawer-profile-actions {
    margin-top: 0.65rem;
}

.profile-drawer[data-variant="spotlight"] .drawer-profile-action.primary {
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.12);
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: none;
}

/* Prototype 02: a bolder cinema-membership pass with social tiles. */
.profile-drawer[data-variant="reel-pass"] {
    background:
        radial-gradient(circle at 80% 8%, rgba(6, 182, 212, 0.14), transparent 24%),
        radial-gradient(circle at 10% 35%, rgba(139, 92, 246, 0.12), transparent 28%),
        var(--bg-surface-solid);
}

.profile-drawer[data-variant="reel-pass"] .drawer-profile-card {
    padding: 1.15rem 1.15rem 1rem 1.35rem;
    background: linear-gradient(120deg, #6d28d9 0%, #7c3aed 58%, #0891b2 145%);
    border-color: rgba(255, 255, 255, 0.15);
    border-radius: 18px;
    box-shadow: 0 18px 38px rgba(76, 29, 149, 0.25);
}

.profile-drawer[data-variant="reel-pass"] .drawer-profile-card::before {
    content: "MEMBER\A PASS";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 3.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 0.25rem;
    color: rgba(255, 255, 255, 0.48);
    border-left: 1px dashed rgba(255, 255, 255, 0.28);
    font-family: var(--font-heading);
    font-size: 0.57rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    line-height: 1.5;
    text-align: center;
    white-space: pre;
}

.profile-drawer[data-variant="reel-pass"] .drawer-profile-card::after {
    content: "";
    position: absolute;
    right: 2.65rem;
    bottom: -0.6rem;
    width: 1.2rem;
    height: 1.2rem;
    background: var(--bg-surface-solid);
    border-radius: 50%;
    box-shadow: 0 -150px 0 var(--bg-surface-solid);
}

.profile-drawer[data-variant="reel-pass"] .drawer-profile-main,
.profile-drawer[data-variant="reel-pass"] .drawer-profile-stats,
.profile-drawer[data-variant="reel-pass"] .drawer-profile-actions {
    width: calc(100% - 3.2rem);
}

.profile-drawer[data-variant="reel-pass"] .drawer-profile-copy h3,
.profile-drawer[data-variant="reel-pass"] .drawer-profile-handle,
.profile-drawer[data-variant="reel-pass"] .drawer-profile-email,
.profile-drawer[data-variant="reel-pass"] .drawer-profile-stat span {
    color: #fff;
}

.profile-drawer[data-variant="reel-pass"] .drawer-profile-handle,
.profile-drawer[data-variant="reel-pass"] .drawer-profile-email,
.profile-drawer[data-variant="reel-pass"] .drawer-profile-stat span {
    opacity: 0.7;
}

.profile-drawer[data-variant="reel-pass"] .drawer-profile-stats {
    grid-template-columns: repeat(2, auto);
    justify-content: start;
    gap: 1.4rem;
    margin: 0.8rem 0 0.7rem;
}

.profile-drawer[data-variant="reel-pass"] .drawer-profile-action {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.17);
    backdrop-filter: blur(8px);
}

.profile-drawer[data-variant="reel-pass"] .drawer-profile-action.primary {
    color: #4c1d95;
    background: #fff;
}

.profile-drawer[data-variant="reel-pass"] .drawer-person-list {
    grid-template-columns: repeat(3, 1fr);
}

.profile-drawer[data-variant="reel-pass"] .drawer-person-card {
    min-width: 0;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.8rem 0.45rem 0.65rem;
    text-align: center;
}

.profile-drawer[data-variant="reel-pass"] .drawer-person-card img {
    width: 2.9rem;
    height: 2.9rem;
}

.profile-drawer[data-variant="reel-pass"] .drawer-person-copy {
    width: 100%;
}

.profile-drawer[data-variant="reel-pass"] .drawer-person-chevron,
.profile-drawer[data-variant="reel-pass"] .drawer-person-copy span {
    display: none;
}

.profile-drawer[data-variant="reel-pass"] .drawer-crew-list {
    grid-template-columns: 1fr 1fr;
}

.profile-drawer[data-variant="reel-pass"] .drawer-crew-card {
    min-height: 6.4rem;
    align-content: space-between;
    background:
        linear-gradient(145deg, rgba(6, 182, 212, 0.1), transparent 62%),
        var(--drawer-card);
}

.profile-drawer[data-variant="reel-pass"] .drawer-avatar-stack {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding: 0.4rem 0 0 0.4rem;
}

/* Prototype 03: a compact account control centre for frequent management. */
.profile-drawer[data-variant="control-room"] {
    width: min(500px, 100vw);
}

.profile-drawer[data-variant="control-room"] #profile-drawer-content {
    padding-top: 0.85rem;
}

.profile-drawer[data-variant="control-room"] .drawer-concept-intro {
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--border-color);
}

.profile-drawer[data-variant="control-room"] .drawer-profile-card {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(138px, 0.65fr);
    gap: 0.7rem;
    padding: 0.75rem;
    background: var(--drawer-card);
    border-radius: 12px;
}

.profile-drawer[data-variant="control-room"] .drawer-profile-avatar {
    width: 3.25rem;
    height: 3.25rem;
}

.profile-drawer[data-variant="control-room"] .drawer-profile-copy h3 {
    font-size: 1.05rem;
}

.profile-drawer[data-variant="control-room"] .drawer-profile-email {
    display: none;
}

.profile-drawer[data-variant="control-room"] .drawer-profile-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.35rem;
}

.profile-drawer[data-variant="control-room"] .drawer-profile-stat {
    justify-content: center;
    padding: 0.45rem;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.13);
    border-radius: 8px;
    text-align: center;
}

.profile-drawer[data-variant="control-room"] .drawer-profile-actions {
    grid-column: 1 / -1;
}

.profile-drawer[data-variant="control-room"] .drawer-profile-action {
    justify-content: space-between;
    min-height: 2.35rem;
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
}

.profile-drawer[data-variant="control-room"] .drawer-section {
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.profile-drawer[data-variant="control-room"] .drawer-section-heading {
    min-height: 1.8rem;
    margin-bottom: 0.5rem;
}

.profile-drawer[data-variant="control-room"] .drawer-section-heading h3 {
    font-size: 0.88rem;
}

.profile-drawer[data-variant="control-room"] .drawer-person-list,
.profile-drawer[data-variant="control-room"] .drawer-crew-list {
    gap: 0;
}

.profile-drawer[data-variant="control-room"] .drawer-person-card,
.profile-drawer[data-variant="control-room"] .drawer-crew-card {
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
}

.profile-drawer[data-variant="control-room"] .drawer-person-card:last-child,
.profile-drawer[data-variant="control-room"] .drawer-crew-card:last-child {
    border-bottom: 0;
}

.profile-drawer[data-variant="control-room"] .drawer-person-card:hover,
.profile-drawer[data-variant="control-room"] .drawer-crew-card:hover {
    background: var(--drawer-card);
    transform: none;
}

.profile-drawer[data-variant="control-room"] .drawer-person-card {
    padding: 0.48rem 0.25rem;
}

.profile-drawer[data-variant="control-room"] .drawer-person-card img {
    width: 2rem;
    height: 2rem;
}

.profile-drawer[data-variant="control-room"] .drawer-crew-card {
    padding: 0.58rem 0.25rem;
}

:root.light-theme .profile-drawer {
    --drawer-card: rgba(15, 23, 42, 0.035);
    --drawer-card-strong: rgba(15, 23, 42, 0.065);
    box-shadow: -24px 0 70px rgba(15, 23, 42, 0.16);
}

:root.light-theme .profile-drawer-backdrop {
    background: rgba(30, 41, 59, 0.36);
}

:root.light-theme .profile-drawer-variant.active {
    color: var(--accent);
    background: rgba(109, 40, 217, 0.08);
}

:root.light-theme .drawer-request-banner {
    color: #5b21b6;
    background: rgba(109, 40, 217, 0.07);
}

:root.light-theme .drawer-request-banner strong {
    color: #4c1d95;
}

:root.light-theme .profile-drawer[data-variant="reel-pass"] .drawer-profile-card {
    color: #fff;
}

:root.light-theme .profile-drawer-footer,
:root.light-theme .profile-drawer[data-variant="control-room"] .drawer-section {
    background: rgba(15, 23, 42, 0.025);
}

@media (max-width: 540px) {
    .profile-drawer {
        width: 100vw !important;
        border-left: 0;
    }

    .profile-drawer-topbar {
        min-height: 70px;
        padding: 0.9rem 1rem 0.75rem;
    }

    .profile-drawer-variant-picker {
        padding: 0 1rem 0.8rem;
    }

    .profile-drawer-variant {
        justify-content: center;
        padding: 0.55rem 0.4rem;
    }

    .profile-drawer-variant > span {
        display: none;
    }

    #profile-drawer-content {
        padding: 1rem 1rem 1.5rem;
    }

    .drawer-concept-intro p {
        display: none;
    }

    .profile-drawer[data-variant="reel-pass"] .drawer-profile-card {
        padding-left: 1rem;
    }

    .profile-drawer[data-variant="control-room"] .drawer-profile-card {
        grid-template-columns: 1fr;
    }

    .profile-drawer[data-variant="control-room"] .drawer-profile-stats {
        grid-template-columns: 1fr 1fr;
    }

    .profile-drawer-footer {
        padding: 0.75rem 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .profile-drawer,
    .profile-drawer-backdrop {
        transition: none;
    }
}

.dropdown-item {
    background: none;
    border: none;
    padding: 0.65rem 1.25rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: var(--transition-fast);
    font-family: var(--font-body);
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.dropdown-item svg {
    width: 1rem;
    height: 1rem;
    color: var(--text-muted);
}

.dropdown-item:hover svg {
    color: var(--text-primary);
}

/* Letterboxd Brand Badges */
.card-badge.letterboxd {
    background: rgba(0, 224, 84, 0.85) !important;
    color: #ffffff !important;
    border-color: rgba(0, 224, 84, 0.45) !important;
}

.card-badge.letterboxd:hover {
    background: #00e054 !important;
    transform: scale(1.05);
}

.rating-badge.letterboxd {
    background: rgba(0, 224, 84, 0.85) !important;
    color: #ffffff !important;
    border: 1px solid rgba(0, 224, 84, 0.45) !important;
}

.rating-badge.letterboxd:hover {
    background: #00e054 !important;
    transform: scale(1.05);
}

.rating-badge.letterboxd svg {
    color: #ffffff;
}

/* Settings Form elements */
/* Settings Container Layout */
.settings-container {
    max-width: 920px !important;
    width: 100% !important;
    height: 640px;
    max-height: 90vh !important;
    display: flex;
    flex-direction: column;
    overflow: hidden !important; /* Prevent double scrollbar */
    padding: 0 !important; /* Eliminate internal padding to push layout to edges */
}

.settings-layout {
    display: flex;
    height: 100%;
    overflow: hidden;
    background: var(--bg-surface-solid);
}

/* Sidebar */
.settings-sidebar {
    width: 205px;
    background: rgba(255, 255, 255, 0.01);
    border-right: 1px solid var(--border-color);
    padding: 2.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    flex-shrink: 0;
}

.settings-sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    padding-left: 0.5rem;
}

.settings-sidebar-header svg {
    width: 1.35rem;
    height: 1.35rem;
    color: var(--accent);
}

.settings-nav {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.settings-nav-item {
    background: none;
    border: 1px solid transparent;
    outline: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    transition: var(--transition-smooth);
    width: 100%;
}

.settings-nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.settings-nav-item.active {
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.25);
    color: #c084fc;
}

.settings-nav-item svg {
    width: 1rem;
    height: 1rem;
}

.settings-nav-item.hidden {
    display: none !important;
}

/* Main Content Pane */
.settings-main {
    flex: 1;
    padding: 2.5rem 3rem;
    overflow-y: auto;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.settings-tab-content {
    display: none;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeIn 0.2s ease;
}

.settings-tab-content.active {
    display: flex;
}

.settings-tab-content h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.tab-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: -0.75rem 0 0.5rem 0;
    line-height: 1.4;
}

/* Forms inside settings */
.settings-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    align-items: flex-start; /* Do not stretch submit button */
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: left;
    width: 100%;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

.form-group label svg {
    width: 1rem;
    height: 1rem;
    color: var(--accent);
}

.field-help {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin: 0;
}

.form-group input {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: var(--transition-smooth);
    width: 100%;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.15);
}

.form-actions-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-top: 0.5rem;
    width: 100%;
}

.form-actions-row button {
    padding: 0.65rem 1.5rem;
    font-size: 0.9rem;
    border-radius: 8px;
    font-weight: 600;
    height: 38px;
}

/* Admin Panel Lists and Elements */
.admin-invite-form {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
}

.form-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    width: 100%;
}

.flex-1 {
    flex: 1;
}

.btn-invite {
    height: 42px;
    padding: 0 1.5rem;
}

.admin-lists {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-height: 250px; /* Limit height of lists to avoid overall scrollbar */
    overflow-y: auto;
    padding-right: 0.25rem;
}

.admin-list-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.admin-list-container h4 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.table-responsive {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

.admin-table th, 
.admin-table td {
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.admin-table th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.user-row-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-row-avatar {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-surface-solid);
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 6px;
    gap: 0.35rem;
}

.admin-invite-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.resend-invite-btn.is-success {
    border-color: rgba(34, 197, 94, 0.5);
    color: #4ade80;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #f87171;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.6);
    color: #ff8787;
    transform: translateY(-1px);
}

.btn-warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fbbf24;
}

.btn-warning:hover {
    background: rgba(245, 158, 11, 0.3);
    border-color: rgba(245, 158, 11, 0.6);
    color: #fcd34d;
    transform: translateY(-1px);
}

.badge-admin {
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.4);
    color: #c084fc;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-user {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Custom Scrollbars for Settings Content */
.settings-main::-webkit-scrollbar,
.admin-lists::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.settings-main::-webkit-scrollbar-track,
.admin-lists::-webkit-scrollbar-track,
.table-responsive::-webkit-scrollbar-track {
    background: transparent;
}

.settings-main::-webkit-scrollbar-thumb,
.admin-lists::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
}

.settings-main::-webkit-scrollbar-thumb:hover,
.admin-lists::-webkit-scrollbar-thumb:hover,
.table-responsive::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Settings Appearance Theme Cards */
.theme-radio-card:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: var(--border-hover) !important;
}

.theme-radio-card.active {
    border-color: var(--accent) !important;
    background: rgba(139, 92, 246, 0.08) !important;
    box-shadow: 0 0 15px var(--accent-glow);
}

.theme-radio-card.active i {
    color: var(--accent) !important;
}

/* Light Theme Element Custom Adjustments */
:root.light-theme .theme-radio-card {
    background: var(--input-bg) !important;
}

:root.light-theme .settings-layout {
    background: var(--bg-surface-solid);
}

:root.light-theme .settings-sidebar {
    background: rgba(0, 0, 0, 0.01);
}

:root.light-theme .settings-nav-item.active {
    background: rgba(109, 40, 217, 0.08);
    border: 1px solid rgba(109, 40, 217, 0.2);
    color: var(--accent);
}

:root.light-theme .btn-secondary {
    background: rgba(0, 0, 0, 0.04) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

:root.light-theme .btn-secondary:hover {
    background: rgba(0, 0, 0, 0.07) !important;
    border-color: var(--border-hover) !important;
}

:root.light-theme .genre-pill {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-secondary);
}

:root.light-theme .genre-pill:hover {
    background: rgba(0, 0, 0, 0.07);
    color: var(--text-primary);
}

:root.light-theme .login-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05), 0 0 50px rgba(109, 40, 217, 0.05);
}

:root.light-theme .settings-main::-webkit-scrollbar-thumb,
:root.light-theme .admin-lists::-webkit-scrollbar-thumb,
:root.light-theme .table-responsive::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
}

:root.light-theme .settings-main::-webkit-scrollbar-thumb:hover,
:root.light-theme .admin-lists::-webkit-scrollbar-thumb:hover,
:root.light-theme .table-responsive::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

:root.light-theme .user-rating-item {
    background: rgba(0, 0, 0, 0.03) !important;
}

:root.light-theme .modal-letterboxd-row {
    background: rgba(0, 224, 84, 0.06) !important;
}

:root.light-theme .modal-cinescore-container {
    background: rgba(0, 0, 0, 0.02) !important;
}

/* Modal Scrollbar Prevention and Width Optimizations */
.modal-container {
    max-width: 960px !important; /* Wider modal to make space for ratings in one row and text */
    max-height: 94vh !important; /* Allow slightly more screen space to avoid scrollbars */
}

.movie-details-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem !important; /* Tighter gap */
    padding: 1.5rem 2rem !important; /* Tighter padding to save vertical space */
}

.modal-info {
    gap: 0.65rem !important; /* Tighter spacing */
}

.modal-title {
    font-size: 1.75rem !important; /* Tighter font size */
    margin: 0;
}

.hero-ratings {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important; /* FORCE NO WRAP on one row */
    gap: 0.5rem !important;
    margin: 0.2rem 0 !important;
    overflow-x: auto; /* Just in case screen size is super small, allow horizontal scroll instead of breaking vertical layout */
}

/* Hide scrollbar on hero ratings for clean look */
.hero-ratings::-webkit-scrollbar {
    display: none;
}

.modal-plot-section h5, 
.modal-cast-section h5 {
    font-size: 0.85rem !important;
    margin-bottom: 0.2rem !important;
}

.modal-plot {
    font-size: 0.9rem !important;
    line-height: 1.45 !important;
}

.cast-row {
    font-size: 0.85rem !important;
    line-height: 1.35 !important;
    margin-bottom: 0.2rem !important;
}

.cast-row strong {
    color: var(--text-primary) !important;
}

.modal-actions {
    margin-top: 0.5rem !important;
    gap: 0.75rem !important;
}

/* Rating Badges Uniform Sizing */
.hero-ratings .rating-badge {
    flex: 1;
    justify-content: center;
    font-size: 0.8rem !important;
    padding: 0.35rem 0.5rem !important;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

/* Custom Themed Tooltips */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.15s ease, visibility 0.15s ease;
    box-shadow: var(--shadow-lg);
    z-index: 1010;
}
[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}


/* Cooperative Game UI Styles */
.coop-game-container {
    max-width: 960px;
    width: 90%;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-xl), 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 2.5rem;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.coop-game-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
}

.coop-header {
    margin-bottom: 2rem;
}

.coop-header h3 {
    font-family: var(--font-heading);
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text-primary) 35%, var(--accent-color, #a78bfa) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.coop-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.coop-connection-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.65rem;
    margin-bottom: 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.coop-connection-pill i {
    width: 0.85rem;
    height: 0.85rem;
}

.coop-connection-pill.is-live {
    background: rgba(52, 211, 153, 0.1);
    border-color: rgba(52, 211, 153, 0.28);
    color: #34d399;
}

.coop-connection-pill.is-connecting,
.coop-connection-pill.is-reconnecting,
.coop-connection-pill.is-polling {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.28);
    color: #fbbf24;
}

.coop-connection-pill.is-offline {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

/* 1. Choice Screen */
.coop-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    width: 100%;
    margin-top: 1rem;
}

.coop-choice-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.coop-choice-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg), 0 10px 20px rgba(0, 0, 0, 0.3);
}

.coop-choice-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.1);
    color: #a78bfa;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
}

.light-theme .coop-choice-icon {
    background: rgba(109, 40, 217, 0.08);
    color: #6d28d9;
}

.coop-choice-card h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.coop-choice-card p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.4;
    margin-bottom: 2rem;
    text-align: center;
}

.coop-room-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    margin-bottom: 1.5rem;
}

.coop-room-input {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    font-size: 1.25rem;
    letter-spacing: 0.25em;
    text-align: center;
    text-transform: uppercase;
    font-weight: 700;
    width: 100%;
    transition: var(--transition-smooth);
}

.coop-room-input:focus {
    border-color: var(--accent-color, #8b5cf6);
    outline: none;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

/* 2. Lobby Screen */
.coop-lobby {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.coop-room-code-display {
    background: rgba(139, 92, 246, 0.08);
    border: 1px dashed rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    padding: 1rem 2.5rem;
    margin-bottom: 2rem;
}

.coop-room-code-number {
    font-family: monospace;
    font-size: 2.5rem;
    font-weight: 800;
    color: #a78bfa;
    letter-spacing: 0.1em;
}

.light-theme .coop-room-code-number {
    color: #6d28d9;
}

.coop-players-grid {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 2.5rem;
    width: 100%;
}

.coop-player-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    width: 150px;
}

.coop-player-avatar-wrapper {
    position: relative;
}

.coop-player-avatar {
    width: 5.5rem;
    height: 5.5rem;
    border-radius: 999px;
    object-fit: cover;
    border: 3px solid var(--border-color);
    box-shadow: var(--shadow-md);
    background: var(--bg-card);
}

.coop-player-card.active-player .coop-player-avatar {
    border-color: #34d399;
}

.coop-player-card.ready-player .coop-player-avatar {
    border-color: #34d399;
    box-shadow: 0 0 15px rgba(52, 211, 153, 0.3);
}

.coop-player-card.ready-player .coop-player-avatar-wrapper::after {
    content: "READY";
    position: absolute;
    bottom: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: #34d399;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    letter-spacing: 0.05em;
    box-shadow: var(--shadow-sm);
    z-index: 2;
}

.coop-player-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
}

.coop-player-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* 3. Slot-Machine Spinner */
.coop-spinner-container {
    width: 100%;
    margin-bottom: 1.5rem;
}

.coop-spinner-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    width: 100%;
    margin: 1.5rem 0;
}

.coop-spinner-col {
    height: 380px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.light-theme .coop-spinner-col {
    background: rgba(0, 0, 0, 0.04);
}

.coop-spinner-track {
    display: flex;
    flex-direction: column;
    transform: translateY(0);
}

.coop-spinner-track.animating {
    animation: coop-spin-keyframes var(--coop-spin-duration, 4s) cubic-bezier(0.1, 1, 0.1, 1) forwards;
}

.coop-spinner-item {
    height: 380px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    padding: 1rem;
}

.coop-spinner-item img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    border-radius: 8px;
    pointer-events: none;
}

.coop-spinner-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    box-shadow: inset 0 25px 25px -15px rgba(0,0,0,0.8), 
                inset 0 -25px 25px -15px rgba(0,0,0,0.8);
    pointer-events: none;
    border-radius: 12px;
}

/* 4. Voting Screen */
.coop-vote-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    width: 100%;
    margin: 1.5rem 0;
}

.coop-vote-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    user-select: none;
}

.coop-vote-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.coop-vote-card.is-voted {
    border-color: #34d399;
    box-shadow: 0 0 15px rgba(52, 211, 153, 0.25);
}

.coop-vote-card.is-locked {
    cursor: default;
}

.coop-vote-card.is-locked:hover {
    transform: none;
    border-color: var(--border-color);
    box-shadow: none;
}

.coop-vote-card.is-locked.is-voted {
    border-color: #34d399;
    box-shadow: 0 0 15px rgba(52, 211, 153, 0.18);
}

.coop-vote-card-poster {
    aspect-ratio: 2 / 3;
    overflow: hidden;
    position: relative;
    background: rgba(0, 0, 0, 0.15);
}

.coop-vote-card-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.coop-vote-card:hover .coop-vote-card-poster img {
    transform: scale(1.05);
}

.coop-vote-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 5;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.18);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.coop-vote-card.is-voted .coop-vote-badge {
    background: #34d399;
    border-color: #34d399;
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.coop-vote-card-info {
    padding: 1rem;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex-grow: 1;
}

.coop-vote-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.coop-vote-card-sub {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 5. RPS Screen */
.coop-rps-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.coop-rps-choices {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
    width: 100%;
}

.coop-rps-button {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 1.75rem;
    font-size: 3rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    width: 130px;
}

.coop-rps-button:hover {
    transform: scale(1.1);
    border-color: var(--accent-color, #8b5cf6);
    box-shadow: 0 10px 20px rgba(139, 92, 246, 0.15);
}

.coop-rps-button.selected {
    background: rgba(139, 92, 246, 0.08);
    border-color: var(--accent-color, #8b5cf6);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.25);
    transform: scale(1.05);
}

.coop-rps-emoji {
    font-size: 3rem;
    line-height: 1;
}

.coop-rps-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.coop-rps-reveal-grid {
    display: grid;
    grid-template-columns: minmax(130px, 1fr) auto minmax(130px, 1fr);
    gap: 1rem;
    align-items: center;
    width: 100%;
    max-width: 560px;
    margin: 1.5rem auto;
}

.coop-rps-reveal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    min-height: 170px;
    justify-content: center;
}

.coop-rps-player-name {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.coop-rps-versus {
    color: var(--accent-color, #8b5cf6);
    font-weight: 900;
    font-size: 0.8rem;
    letter-spacing: 0.12em;
}

.coop-rps-indicator {
    margin-top: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* 6. Finished Screen */
.coop-winner-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    gap: 2rem;
    width: 100%;
    max-width: 650px;
    text-align: left;
    margin: 1.5rem 0 2.5rem 0;
    box-shadow: var(--shadow-lg);
}

@media (max-width: 600px) {
    .coop-winner-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .coop-rps-choices {
        gap: 0.75rem;
    }

    .coop-rps-button {
        width: 100px;
        padding: 1.2rem 0.75rem;
    }

    .coop-rps-reveal-grid {
        grid-template-columns: 1fr;
    }

    .coop-rps-versus {
        transform: none;
    }
}

.coop-winner-poster {
    width: 140px;
    height: 210px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.coop-winner-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.coop-winner-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
}

.coop-winner-info h4 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
}

.coop-winner-meta {
    font-size: 0.88rem;
    color: var(--text-secondary);
    display: flex;
    gap: 1rem;
    align-items: center;
}

.coop-winner-plot {
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Keyframes */
@keyframes coop-spin-keyframes {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(var(--coop-spin-target));
    }
}


/* Showdown Mode Overhaul */
.coop-game-container {
    max-width: 1120px;
    padding: 0;
    border-radius: 20px;
    background: #080b14;
    border-color: rgba(167, 139, 250, 0.22);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.62), 0 0 60px rgba(139, 92, 246, 0.13);
}

.coop-game-content {
    min-height: min(720px, 88vh);
}

.showdown-shell {
    --showdown-purple: #9f7aea;
    --showdown-pink: #fb7185;
    --showdown-gold: #fbbf24;
    --showdown-green: #34d399;
    --showdown-cyan: #22d3ee;
    position: relative;
    isolation: isolate;
    width: 100%;
    min-height: min(720px, 88vh);
    padding: 1.25rem;
    overflow: hidden;
    color: var(--text-primary);
    background:
        radial-gradient(circle at 50% -10%, rgba(167, 139, 250, 0.24), transparent 34%),
        radial-gradient(circle at 15% 20%, rgba(34, 211, 238, 0.14), transparent 28%),
        radial-gradient(circle at 88% 34%, rgba(251, 113, 133, 0.16), transparent 32%),
        linear-gradient(145deg, #090b15 0%, #101320 48%, #070a12 100%);
}

.showdown-backdrop,
.showdown-scanlines,
.showdown-orbit {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: -1;
}

.showdown-backdrop {
    background:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: radial-gradient(circle at center, black, transparent 76%);
}

.showdown-scanlines {
    background: repeating-linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.035) 0,
        rgba(255, 255, 255, 0.035) 1px,
        transparent 1px,
        transparent 7px
    );
    opacity: 0.16;
    mix-blend-mode: screen;
}

.showdown-orbit {
    width: 460px;
    height: 460px;
    border: 1px solid rgba(167, 139, 250, 0.12);
    border-radius: 50%;
    inset: auto;
    filter: blur(0.2px);
}

.showdown-orbit-one {
    top: -180px;
    left: -120px;
    box-shadow: 0 0 80px rgba(34, 211, 238, 0.12);
}

.showdown-orbit-two {
    right: -160px;
    bottom: -220px;
    box-shadow: 0 0 100px rgba(251, 113, 133, 0.13);
}

.showdown-topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    min-height: 2.1rem;
    margin-bottom: 0.6rem;
}

.showdown-room-badge,
.showdown-card-label,
.showdown-kicker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.7rem;
    font-weight: 900;
}

.showdown-room-badge {
    padding: 0.35rem 0.7rem;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.11);
    color: var(--text-secondary);
}

.showdown-banner {
    position: relative;
    text-align: center;
    margin: 0 auto 1.1rem;
    max-width: 720px;
}

.showdown-kicker {
    padding: 0.35rem 0.75rem;
    color: #c4b5fd;
    background: rgba(139, 92, 246, 0.14);
    border: 1px solid rgba(167, 139, 250, 0.24);
    margin-bottom: 0.7rem;
}

.showdown-banner h3 {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 3.9rem);
    line-height: 0.92;
    letter-spacing: 0;
    margin: 0 0 0.55rem;
    color: #fff;
    text-shadow: 0 0 24px rgba(167, 139, 250, 0.35), 0 8px 30px rgba(0, 0, 0, 0.55);
}

.showdown-banner p {
    color: rgba(226, 232, 240, 0.78);
    font-size: 0.98rem;
    margin: 0;
}

.showdown-match-row {
    display: grid;
    grid-template-columns: 145px minmax(0, 1fr) 145px;
    gap: 1rem;
    align-items: stretch;
    width: 100%;
}

.showdown-stage {
    position: relative;
    min-height: 390px;
    border-radius: 18px;
    padding: 1.2rem;
    background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.035));
    border: 1px solid rgba(255,255,255,0.11);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 20px 50px rgba(0,0,0,0.24);
    overflow: hidden;
}

.showdown-stage::before {
    content: "";
    position: absolute;
    inset: -30% 18%;
    background: radial-gradient(circle, rgba(167, 139, 250, 0.26), transparent 60%);
    opacity: 0.55;
    pointer-events: none;
}

.showdown-actions {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: 1.15rem;
}

.showdown-primary-action {
    box-shadow: 0 0 28px rgba(139, 92, 246, 0.34);
}

.showdown-player-panel {
    position: relative;
    min-height: 390px;
    padding: 1.05rem 0.9rem;
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.09), rgba(255,255,255,0.035)),
        rgba(12, 14, 26, 0.78);
    border: 1px solid rgba(255,255,255,0.11);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    box-shadow: 0 18px 38px rgba(0,0,0,0.24);
}

.showdown-player-panel.is-host {
    --player-glow: rgba(34, 211, 238, 0.36);
}

.showdown-player-panel.is-guest {
    --player-glow: rgba(251, 113, 133, 0.34);
}

.showdown-player-panel.is-me {
    border-color: rgba(251, 191, 36, 0.34);
}

.showdown-player-panel.is-locked {
    box-shadow: 0 18px 38px rgba(0,0,0,0.24), 0 0 26px rgba(52, 211, 153, 0.16);
}

.showdown-player-panel.is-winner {
    border-color: rgba(251, 191, 36, 0.55);
    box-shadow: 0 18px 38px rgba(0,0,0,0.24), 0 0 36px rgba(251, 191, 36, 0.24);
}

.showdown-player-panel.is-empty {
    filter: grayscale(0.85);
    opacity: 0.72;
}

.showdown-player-glow {
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: var(--player-glow, rgba(167,139,250,0.25));
    filter: blur(36px);
    opacity: 0.65;
}

.showdown-player-avatar-wrap {
    position: relative;
    z-index: 1;
    width: 5.4rem;
    height: 5.4rem;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg, rgba(255,255,255,0.55), rgba(167,139,250,0.25));
}

.showdown-player-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    background: var(--bg-card);
}

.showdown-player-meta {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    min-width: 0;
    max-width: 100%;
}

.showdown-player-role,
.showdown-player-status,
.showdown-player-hand small {
    color: rgba(226, 232, 240, 0.66);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.showdown-player-name {
    color: #fff;
    font-size: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 145px;
}

.showdown-player-hand {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    align-items: center;
    padding: 0.65rem 0.85rem;
    border-radius: 14px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.11);
}

.showdown-player-hand span {
    font-size: 2rem;
    line-height: 1;
}

.showdown-choice-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(240px, 1fr));
    gap: 1rem;
    max-width: 720px;
    margin: 1.5rem auto 0;
}

.showdown-choice-card {
    min-height: 260px;
    border: 1px solid rgba(255,255,255,0.11);
    border-radius: 18px;
    padding: 1.4rem;
    background: linear-gradient(180deg, rgba(255,255,255,0.09), rgba(255,255,255,0.04));
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    cursor: pointer;
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.showdown-choice-card:hover {
    transform: translateY(-6px);
    border-color: rgba(167, 139, 250, 0.46);
    box-shadow: 0 20px 45px rgba(0,0,0,0.32), 0 0 34px rgba(139, 92, 246, 0.2);
}

.showdown-join-card {
    cursor: default;
}

.showdown-choice-icon {
    width: 4.2rem;
    height: 4.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    color: #c4b5fd;
    background: rgba(139, 92, 246, 0.16);
    border: 1px solid rgba(167, 139, 250, 0.22);
}

.showdown-choice-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 900;
}

.showdown-choice-copy {
    color: rgba(226, 232, 240, 0.72);
    font-weight: 600;
}

.showdown-code-input {
    max-width: 170px;
    margin: 0.25rem 0;
}

.showdown-code-input.is-invalid {
    border-color: rgba(251, 113, 133, 0.9);
    box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.18), 0 0 24px rgba(244, 63, 94, 0.18);
    animation: showdownInputShake 260ms ease;
}

.showdown-join-button {
    position: relative;
    min-width: 170px;
    overflow: hidden;
    isolation: isolate;
    color: #08111f;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: linear-gradient(135deg, #fef08a 0%, #6ee7b7 48%, #22d3ee 100%);
    box-shadow: 0 16px 34px rgba(34, 211, 238, 0.22), 0 0 28px rgba(250, 204, 21, 0.18);
}

.showdown-join-button::after {
    content: "";
    position: absolute;
    inset: 50%;
    z-index: -1;
    width: 1rem;
    height: 1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.74);
    opacity: 0;
    transform: translate(-50%, -50%) scale(1);
}

.showdown-join-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 20px 42px rgba(34, 211, 238, 0.3), 0 0 38px rgba(250, 204, 21, 0.28);
}

.showdown-join-button:active:not(:disabled),
.showdown-join-button.is-clicked {
    transform: translateY(1px) scale(0.98);
}

.showdown-join-button.is-clicked::after {
    animation: showdownJoinRipple 420ms ease-out;
}

.showdown-join-button:disabled {
    cursor: wait;
    opacity: 0.9;
}

.showdown-join-button.is-joining {
    animation: showdownJoinGlow 1.1s ease-in-out infinite;
}

.showdown-join-feedback {
    min-height: 1rem;
    color: rgba(226, 232, 240, 0.72);
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-align: center;
    text-transform: uppercase;
}

.showdown-join-feedback.is-info {
    color: #67e8f9;
}

.showdown-join-feedback.is-success {
    color: #86efac;
}

.showdown-join-feedback.is-error {
    color: #fda4af;
}

@keyframes showdownJoinRipple {
    0% {
        opacity: 0.55;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(18);
    }
}

@keyframes showdownJoinGlow {
    0%, 100% {
        box-shadow: 0 16px 34px rgba(34, 211, 238, 0.22), 0 0 28px rgba(250, 204, 21, 0.18);
    }
    50% {
        box-shadow: 0 18px 42px rgba(34, 211, 238, 0.34), 0 0 42px rgba(250, 204, 21, 0.34);
    }
}

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

.showdown-room-code-card {
    position: relative;
    z-index: 1;
    min-height: 100%;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
}

.showdown-room-code-card strong {
    font-family: monospace;
    color: #fff;
    font-size: clamp(3rem, 9vw, 6.5rem);
    line-height: 0.9;
    letter-spacing: 0.08em;
    text-shadow: 0 0 34px rgba(167, 139, 250, 0.4);
}

.showdown-card-label {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.11);
    border: 1px solid rgba(251, 191, 36, 0.23);
    padding: 0.32rem 0.7rem;
}

.showdown-room-code-card small {
    color: rgba(226, 232, 240, 0.74);
    font-weight: 700;
}

.showdown-draw-board,
.showdown-vote-board,
.showdown-duel-board,
.showdown-reveal-board,
.showdown-finale-board {
    position: relative;
    z-index: 1;
    height: 100%;
}

.showdown-speed-field {
    position: absolute;
    inset: -1rem;
    background:
        linear-gradient(100deg, transparent 0 22%, rgba(255,255,255,0.16) 23%, transparent 25% 100%),
        linear-gradient(80deg, transparent 0 56%, rgba(34,211,238,0.14) 58%, transparent 60% 100%);
    background-size: 220px 100%, 340px 100%;
    animation: showdownSpeed 700ms linear infinite;
    opacity: 0.55;
}

.showdown-round-stamp {
    position: relative;
    z-index: 2;
    display: inline-flex;
    margin-bottom: 1rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    color: #0b1020;
    background: linear-gradient(135deg, #fbbf24, #fb7185);
    font-size: 0.75rem;
    font-weight: 1000;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    box-shadow: 0 0 30px rgba(251, 191, 36, 0.24);
}

.showdown-contender-grid,
.showdown-vote-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    align-items: stretch;
}

.showdown-poster-card {
    position: relative;
    min-width: 0;
    border-radius: 16px;
    padding: 0.55rem;
    background: linear-gradient(180deg, rgba(255,255,255,0.1), rgba(255,255,255,0.035));
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 16px 38px rgba(0,0,0,0.28);
    overflow: hidden;
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.showdown-poster-card.is-entering {
    opacity: 0;
    transform: translateY(-40px) scale(0.9) rotate(calc((var(--slot-index) - 1) * 4deg));
    animation: showdownContenderEnter 760ms cubic-bezier(0.17, 1.24, 0.32, 1) forwards;
    animation-delay: calc(var(--slot-index) * 160ms);
}

.showdown-poster-card.is-selectable {
    cursor: pointer;
}

.showdown-poster-card.is-selectable:hover {
    transform: translateY(-8px) scale(1.015);
    border-color: rgba(167, 139, 250, 0.5);
    box-shadow: 0 24px 48px rgba(0,0,0,0.34), 0 0 34px rgba(139, 92, 246, 0.22);
}

.showdown-poster-card.is-selected {
    border-color: rgba(52, 211, 153, 0.7);
    box-shadow: 0 24px 48px rgba(0,0,0,0.34), 0 0 34px rgba(52, 211, 153, 0.26);
    animation: showdownVotePulse 360ms ease;
}

.showdown-poster-card.is-locked {
    cursor: default;
}

.showdown-poster-card.is-winner {
    max-width: 240px;
    width: min(42vw, 240px);
    margin: 0 auto;
    border-color: rgba(251, 191, 36, 0.68);
    box-shadow: 0 28px 70px rgba(0,0,0,0.42), 0 0 54px rgba(251, 191, 36, 0.24);
    animation: showdownFinalPoster 900ms cubic-bezier(0.17, 1.14, 0.28, 1) both;
}

.showdown-poster-frame {
    position: relative;
    aspect-ratio: 2 / 3;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(0,0,0,0.25);
}

.showdown-poster-frame img,
.showdown-poster-frame .poster-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.showdown-poster-sweep {
    position: absolute;
    inset: 0;
    transform: translateX(-140%) skewX(-18deg);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.38), transparent);
    animation: showdownSweep 2600ms ease infinite;
    animation-delay: calc(var(--slot-index) * 240ms);
}

.showdown-vote-badge {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: rgba(0,0,0,0.52);
    border: 1px solid rgba(255,255,255,0.18);
    transition: transform 160ms ease, background 160ms ease;
}

.showdown-poster-card.is-selected .showdown-vote-badge {
    background: #34d399;
    transform: scale(1.08);
    box-shadow: 0 0 20px rgba(52, 211, 153, 0.5);
}

.showdown-poster-info {
    padding: 0.75rem 0.35rem 0.2rem;
    text-align: left;
}

.showdown-poster-info h4,
.showdown-finale-info h4 {
    color: #fff;
    font-size: 0.98rem;
    font-weight: 900;
    margin: 0 0 0.45rem;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-clamp: 3;
    overflow: hidden;
    text-overflow: ellipsis;
}

.showdown-poster-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    color: rgba(226,232,240,0.7);
    font-size: 0.78rem;
    font-weight: 700;
}

.showdown-score {
    display: inline-flex;
    gap: 0.18rem;
    align-items: center;
    color: #fbbf24;
}

.showdown-score i {
    width: 0.82rem;
    height: 0.82rem;
    fill: currentColor;
}

.showdown-lock-panel {
    margin-top: 1rem;
}

.showdown-lock-message,
.showdown-duel-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.6rem;
    border-radius: 999px;
    padding: 0.55rem 0.9rem;
    color: rgba(226,232,240,0.8);
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.11);
    font-weight: 800;
}

.showdown-lock-message.is-locked {
    color: #34d399;
    background: rgba(52, 211, 153, 0.1);
    border-color: rgba(52, 211, 153, 0.22);
}

.showdown-duel-board {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
}

.showdown-vs-core,
.showdown-impact-flash {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 6rem;
    height: 6rem;
    border-radius: 50%;
    color: #0b1020;
    background: linear-gradient(135deg, #fbbf24, #fb7185 55%, #a78bfa);
    font-family: var(--font-heading);
    font-size: 1.7rem;
    font-weight: 1000;
    box-shadow: 0 0 42px rgba(251, 113, 133, 0.3);
}

.showdown-vs-core {
    animation: showdownVsPulse 1500ms ease-in-out infinite;
}

.showdown-hand-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.85rem;
}

.showdown-hand-button {
    width: 128px;
    min-height: 132px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.13);
    color: #fff;
    background: linear-gradient(180deg, rgba(255,255,255,0.11), rgba(255,255,255,0.04));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    cursor: pointer;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: transform 170ms ease, border-color 170ms ease, box-shadow 170ms ease;
}

.showdown-hand-button:hover:not(:disabled) {
    transform: translateY(-6px) rotate(-1deg);
    border-color: rgba(167, 139, 250, 0.52);
    box-shadow: 0 22px 42px rgba(0,0,0,0.32), 0 0 30px rgba(167,139,250,0.2);
}

.showdown-hand-button.selected {
    border-color: rgba(52, 211, 153, 0.68);
    box-shadow: 0 0 34px rgba(52, 211, 153, 0.24);
}

.showdown-hand-button:disabled {
    cursor: default;
    opacity: 0.76;
}

.showdown-hand-emoji {
    font-size: 3.15rem;
    line-height: 1;
    filter: drop-shadow(0 10px 18px rgba(0,0,0,0.35));
}

.showdown-reveal-board {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.showdown-countdown {
    position: relative;
    width: 6.4rem;
    height: 4.2rem;
}

.showdown-countdown span {
    position: absolute;
    inset: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 1000;
    color: #fff;
    opacity: 0;
    transform: scale(0.5);
    text-shadow: 0 0 30px rgba(251, 191, 36, 0.45);
    animation: showdownCountdown 900ms ease forwards;
}

.showdown-countdown span:nth-child(2) {
    animation-delay: 820ms;
}

.showdown-countdown span:nth-child(3) {
    animation-delay: 1640ms;
}

.showdown-clash-zone {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    width: min(100%, 560px);
}

.showdown-shake-token {
    min-height: 150px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, rgba(255,255,255,0.1), rgba(255,255,255,0.035));
    border: 1px solid rgba(255,255,255,0.12);
    animation: showdownHandShake 2400ms ease-in-out forwards;
}

.showdown-shake-token.is-right {
    animation-name: showdownHandShakeRight;
}

.showdown-impact-flash {
    opacity: 0;
    transform: scale(0.45);
    animation: showdownImpact 850ms cubic-bezier(0.17, 1.18, 0.26, 1) forwards;
    animation-delay: 2450ms;
}

.showdown-revealed-hands {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    width: min(100%, 520px);
    opacity: 0;
    transform: translateY(16px);
}

.showdown-rps-reveal-stage .showdown-revealed-hands,
.showdown-rps-duel-board.is-revealing .showdown-revealed-hands {
    animation: showdownRevealIn 650ms ease forwards;
    animation-delay: 2850ms;
}

.showdown-rps-duel-board.is-revealed .showdown-revealed-hands {
    opacity: 1;
    transform: translateY(0);
    animation: none;
}


.showdown-revealed-hands div {
    border-radius: 14px;
    padding: 0.8rem;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.11);
}

.showdown-revealed-hands strong,
.showdown-revealed-hands span {
    display: block;
}

.showdown-revealed-hands strong {
    color: #fff;
    margin-bottom: 0.2rem;
}

.showdown-revealed-hands span {
    color: #c4b5fd;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.72rem;
}

.showdown-rps-reveal.has-winner .showdown-stage {
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 20px 50px rgba(0,0,0,0.24), 0 0 34px rgba(251,191,36,0.14);
}

.showdown-rps-reveal.is-tie .showdown-stage {
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 20px 50px rgba(0,0,0,0.24), 0 0 34px rgba(34,211,238,0.12);
}

.showdown-finale-board {
    display: grid;
    grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
    gap: 1.2rem;
    align-items: center;
    text-align: left;
    min-height: 100%;
}

.showdown-finale-info {
    position: relative;
    z-index: 1;
    opacity: 0;
    transform: translateX(18px);
    animation: showdownFinalText 720ms ease forwards;
    animation-delay: 420ms;
}

.showdown-finale-info h4 {
    white-space: normal;
    font-size: clamp(1.7rem, 4vw, 3.3rem);
    line-height: 0.98;
    margin: 0.7rem 0 0.7rem;
    text-shadow: 0 0 30px rgba(251, 191, 36, 0.22);
}

.showdown-director,
.showdown-finale-plot {
    color: rgba(226,232,240,0.78);
}

.showdown-director {
    margin: 0.7rem 0 0;
    font-weight: 800;
}

.showdown-finale-plot {
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0.75rem 0 0;
}

.showdown-particle-burst {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 4;
    overflow: hidden;
}

.showdown-particle-burst span {
    position: absolute;
    left: 50%;
    top: 52%;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #fbbf24;
    box-shadow: 0 0 18px currentColor;
    color: #fbbf24;
    transform: translate(-50%, -50%);
    animation: showdownParticle 950ms ease-out forwards;
    animation-delay: var(--delay);
}

.showdown-particle-burst span:nth-child(3n) {
    color: #22d3ee;
    background: #22d3ee;
}

.showdown-particle-burst span:nth-child(3n + 1) {
    color: #fb7185;
    background: #fb7185;
}

@keyframes showdownSpeed {
    to { background-position: -220px 0, -340px 0; }
}

@keyframes showdownContenderEnter {
    0% {
        opacity: 0;
        transform: translateY(-54px) scale(0.88) rotate(calc((var(--slot-index) - 1) * 5deg));
        filter: blur(8px);
    }
    62% {
        opacity: 1;
        transform: translateY(10px) scale(1.03) rotate(calc((var(--slot-index) - 1) * -1deg));
        filter: blur(0);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1) rotate(0);
        filter: blur(0);
    }
}

@keyframes showdownVotePulse {
    0% { transform: scale(1); }
    45% { transform: scale(1.035); }
    100% { transform: scale(1); }
}

@keyframes showdownSweep {
    0%, 42% { transform: translateX(-145%) skewX(-18deg); }
    70%, 100% { transform: translateX(145%) skewX(-18deg); }
}

@keyframes showdownVsPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 42px rgba(251, 113, 133, 0.3); }
    50% { transform: scale(1.06); box-shadow: 0 0 58px rgba(251, 191, 36, 0.42); }
}

@keyframes showdownCountdown {
    0% { opacity: 0; transform: scale(0.45) rotate(-6deg); }
    20%, 68% { opacity: 1; transform: scale(1.06) rotate(0); }
    100% { opacity: 0; transform: scale(1.45) rotate(5deg); }
}

@keyframes showdownHandShake {
    0%, 15% { transform: translateX(-8px) rotate(-5deg); }
    20%, 36% { transform: translateX(14px) rotate(6deg); }
    42%, 58% { transform: translateX(-14px) rotate(-6deg); }
    64%, 80% { transform: translateX(10px) rotate(5deg); }
    100% { transform: translateX(0) rotate(0); }
}

@keyframes showdownHandShakeRight {
    0%, 15% { transform: translateX(8px) rotate(5deg); }
    20%, 36% { transform: translateX(-14px) rotate(-6deg); }
    42%, 58% { transform: translateX(14px) rotate(6deg); }
    64%, 80% { transform: translateX(-10px) rotate(-5deg); }
    100% { transform: translateX(0) rotate(0); }
}

@keyframes showdownImpact {
    0% { opacity: 0; transform: scale(0.45); filter: blur(4px); }
    45% { opacity: 1; transform: scale(1.22); filter: blur(0); }
    100% { opacity: 1; transform: scale(1); filter: blur(0); }
}

@keyframes showdownRevealIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes showdownFinalPoster {
    0% {
        opacity: 0;
        transform: perspective(900px) rotateY(-26deg) scale(0.72);
        filter: blur(8px);
    }
    68% {
        opacity: 1;
        transform: perspective(900px) rotateY(4deg) scale(1.05);
        filter: blur(0);
    }
    100% {
        opacity: 1;
        transform: perspective(900px) rotateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes showdownFinalText {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes showdownParticle {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.4);
    }
    18% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform:
            translate(-50%, -50%)
            rotate(var(--angle))
            translateX(var(--distance))
            scale(0.1);
    }
}

@media (max-width: 860px) {
    .coop-game-container {
        width: 96%;
    }

    .showdown-shell {
        padding: 0.9rem;
        min-height: 86vh;
    }

    .showdown-match-row {
        grid-template-columns: 1fr 1fr;
    }

    .showdown-stage {
        grid-column: 1 / -1;
        grid-row: 2;
        min-height: 360px;
    }

    .showdown-player-panel {
        min-height: 150px;
        padding: 0.8rem;
    }

    .showdown-player-avatar-wrap {
        width: 4rem;
        height: 4rem;
    }

    .showdown-choice-grid,
    .showdown-finale-board {
        grid-template-columns: 1fr;
    }

    .showdown-contender-grid,
    .showdown-vote-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.45rem;
        max-width: 100%;
    }

    .showdown-poster-card.is-winner {
        width: min(68vw, 230px);
    }

    .showdown-clash-zone {
        grid-template-columns: 1fr;
    }

    .showdown-impact-flash {
        margin: -0.4rem auto;
    }
}

@media (max-width: 560px) {
    .showdown-topbar {
        flex-direction: column;
        align-items: center;
    }

    .showdown-banner h3 {
        font-size: 2rem;
    }

    .showdown-match-row {
        gap: 0.65rem;
    }

    .showdown-player-name {
        max-width: 120px;
    }

    .showdown-hand-button {
        width: 100px;
        min-height: 110px;
    }

    .showdown-hand-emoji {
        font-size: 2.45rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .showdown-shell *,
    .showdown-shell *::before,
    .showdown-shell *::after {
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 1ms !important;
        scroll-behavior: auto !important;
    }

    .showdown-particle-burst,
    .showdown-speed-field,
    .showdown-scanlines,
    .showdown-orbit {
        display: none !important;
    }
}

/* Showdown Mode: high-energy visual pass */
.coop-game-container {
    width: min(1260px, 96vw);
    max-width: min(1260px, 96vw);
    max-height: calc(100vh - 28px);
    border-radius: 10px;
    background: #05070d;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow:
        0 28px 90px rgba(0, 0, 0, 0.72),
        0 0 0 1px rgba(34, 211, 238, 0.12),
        0 0 72px rgba(251, 191, 36, 0.08);
    overflow: hidden;
}

.coop-game-content {
    min-height: min(760px, calc(100vh - 86px));
    zoom: var(--showdown-scale);
}

.showdown-shell {
    --showdown-purple: #a78bfa;
    --showdown-pink: #ff4d7d;
    --showdown-gold: #ffd166;
    --showdown-green: #35f0a4;
    --showdown-cyan: #20e7ff;
    --showdown-blue: #3b82f6;
    --showdown-red: #ff3d57;
    min-height: min(760px, calc(100vh - 86px));
    padding: 1rem;
    border-radius: 10px;
    color: #f8fafc;
    background:
        linear-gradient(90deg, rgba(32, 231, 255, 0.08), transparent 22%, transparent 78%, rgba(255, 77, 125, 0.08)),
        radial-gradient(circle at 50% 18%, rgba(255, 209, 102, 0.13), transparent 28%),
        linear-gradient(160deg, #090b14 0%, #0e111c 45%, #05070d 100%);
    animation: showdownBoot 560ms ease both;
}

.showdown-shell,
.showdown-shell * {
    letter-spacing: 0;
}

.showdown-shell::before,
.showdown-shell::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: -1;
}

.showdown-shell::before {
    background:
        linear-gradient(120deg, transparent 0 44%, rgba(255, 255, 255, 0.09) 45%, transparent 47% 100%),
        linear-gradient(60deg, transparent 0 62%, rgba(32, 231, 255, 0.08) 63%, transparent 65% 100%);
    background-size: 520px 100%, 380px 100%;
    opacity: 0.5;
    animation: showdownLightSweep 7200ms linear infinite;
}

.showdown-shell::after {
    inset: auto 3.5rem 0;
    height: 44%;
    background:
        linear-gradient(to top, rgba(32, 231, 255, 0.12), transparent),
        repeating-linear-gradient(90deg, transparent 0 28px, rgba(255, 255, 255, 0.07) 29px, transparent 31px);
    transform: perspective(540px) rotateX(58deg);
    transform-origin: bottom center;
    opacity: 0.34;
}

.showdown-backdrop,
.showdown-arena-grid,
.showdown-scanlines,
.showdown-orbit,
.showdown-energy-ribbon,
.showdown-spark-field {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: -1;
}

.showdown-backdrop {
    background:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(circle at 50% 45%, black 0 48%, transparent 82%);
    animation: showdownGridDrift 9000ms linear infinite;
}

.showdown-arena-grid {
    background:
        linear-gradient(90deg, transparent 0 10%, rgba(32, 231, 255, 0.16) 10.4%, transparent 10.8% 89.2%, rgba(255, 77, 125, 0.16) 89.6%, transparent 90%),
        linear-gradient(180deg, transparent 0 18%, rgba(255, 209, 102, 0.09) 18.4%, transparent 18.8% 81.2%, rgba(255, 209, 102, 0.08) 81.6%, transparent 82%);
    opacity: 0.48;
}

.showdown-scanlines {
    background: repeating-linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.055) 0,
        rgba(255, 255, 255, 0.055) 1px,
        transparent 1px,
        transparent 6px
    );
    opacity: 0.13;
    mix-blend-mode: screen;
    animation: showdownScanlineDrift 1400ms linear infinite;
}

.showdown-energy-ribbon {
    width: 30%;
    opacity: 0.52;
    filter: blur(0.2px);
}

.showdown-energy-ribbon-left {
    right: auto;
    background:
        linear-gradient(135deg, transparent 0 38%, rgba(32, 231, 255, 0.28) 39%, transparent 43%),
        linear-gradient(155deg, transparent 0 52%, rgba(53, 240, 164, 0.18) 53%, transparent 57%);
    animation: showdownRibbonLeft 3800ms ease-in-out infinite;
}

.showdown-energy-ribbon-right {
    left: auto;
    background:
        linear-gradient(45deg, transparent 0 38%, rgba(255, 77, 125, 0.26) 39%, transparent 43%),
        linear-gradient(25deg, transparent 0 52%, rgba(255, 209, 102, 0.18) 53%, transparent 57%);
    animation: showdownRibbonRight 4200ms ease-in-out infinite;
}

.showdown-orbit {
    width: 560px;
    height: 560px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    opacity: 0.7;
    animation: showdownOrbitSpin 24000ms linear infinite;
}

.showdown-orbit::before,
.showdown-orbit::after {
    content: "";
    position: absolute;
    inset: 12%;
    border: 1px dashed rgba(255, 255, 255, 0.09);
    border-radius: inherit;
}

.showdown-orbit::after {
    inset: 28%;
    border-style: solid;
    opacity: 0.8;
}

.showdown-orbit-one {
    top: -260px;
    left: -180px;
    box-shadow: 0 0 72px rgba(32, 231, 255, 0.14);
}

.showdown-orbit-two {
    right: -210px;
    bottom: -300px;
    box-shadow: 0 0 86px rgba(255, 77, 125, 0.14);
    animation-direction: reverse;
}

.showdown-spark-field {
    overflow: hidden;
}

.showdown-spark-field span {
    position: absolute;
    left: calc(2% + (var(--spark-index) * 5.7%));
    top: calc(8% + (var(--spark-index) * 4.9%));
    width: 3px;
    height: 18px;
    border-radius: 999px;
    background: currentColor;
    color: var(--showdown-cyan);
    box-shadow: 0 0 14px currentColor;
    opacity: 0;
    transform: translate3d(0, 34px, 0) rotate(26deg);
    animation: showdownSpark 3600ms ease-in-out infinite;
    animation-delay: calc(var(--spark-index) * 170ms);
}

.showdown-spark-field span:nth-child(3n) {
    color: var(--showdown-gold);
}

.showdown-spark-field span:nth-child(3n + 1) {
    color: var(--showdown-pink);
}

.showdown-entry {
    display: grid;
    grid-template-rows: auto 1fr;
    align-items: center;
    gap: 1.25rem;
    padding: 1.4rem;
}

.showdown-entry-hero {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 210px;
    align-items: center;
    gap: 1.5rem;
    width: min(880px, 100%);
    margin: 0 auto;
}

.showdown-entry .showdown-banner {
    text-align: left;
    margin: 0;
    max-width: 620px;
}

.showdown-entry .showdown-banner h3 {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-bottom: 0.75rem;
}

.showdown-entry .showdown-banner h3 strong {
    color: transparent;
    background: linear-gradient(90deg, var(--showdown-gold), var(--showdown-pink), var(--showdown-cyan));
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow: none;
}

.showdown-entry-emblem {
    position: relative;
    width: 190px;
    height: 190px;
    display: grid;
    place-items: center;
    color: #05070d;
    background:
        linear-gradient(135deg, var(--showdown-gold), var(--showdown-pink) 52%, var(--showdown-cyan));
    border: 1px solid rgba(255, 255, 255, 0.4);
    clip-path: polygon(50% 0, 96% 26%, 96% 74%, 50% 100%, 4% 74%, 4% 26%);
    box-shadow:
        0 28px 80px rgba(0, 0, 0, 0.42),
        0 0 48px rgba(255, 209, 102, 0.18);
    animation: showdownEmblemFloat 3000ms ease-in-out infinite;
}

.showdown-entry-emblem strong {
    position: relative;
    z-index: 2;
    font-family: var(--font-heading);
    font-size: 3.4rem;
    line-height: 1;
    font-weight: 1000;
}

.showdown-emblem-ring {
    position: absolute;
    inset: 18px;
    border: 2px solid rgba(5, 7, 13, 0.24);
    clip-path: inherit;
}

.showdown-emblem-ring:nth-child(2) {
    inset: 38px;
    opacity: 0.6;
}

.showdown-topbar {
    position: relative;
    z-index: 3;
    align-items: center;
    min-height: 2.4rem;
    margin-bottom: 0.5rem;
}

.showdown-room-badge,
.showdown-card-label,
.showdown-kicker {
    border-radius: 999px;
    letter-spacing: 0;
    font-weight: 1000;
}

.showdown-room-badge {
    color: #f8fafc;
    background: linear-gradient(90deg, rgba(255, 209, 102, 0.18), rgba(255, 255, 255, 0.08));
    border-color: rgba(255, 209, 102, 0.3);
    box-shadow: 0 0 28px rgba(255, 209, 102, 0.1);
}

.showdown-banner {
    z-index: 2;
    margin-bottom: 1rem;
}

.showdown-kicker {
    color: #05070d;
    background: linear-gradient(90deg, var(--showdown-gold), #ffe8a3);
    border: 0;
    box-shadow: 0 0 28px rgba(255, 209, 102, 0.2);
}

.showdown-banner h3 {
    font-size: 3.45rem;
    line-height: 0.92;
    margin-bottom: 0.55rem;
    text-transform: uppercase;
    text-shadow:
        0 2px 0 rgba(255, 255, 255, 0.12),
        0 14px 40px rgba(0, 0, 0, 0.62),
        0 0 38px rgba(32, 231, 255, 0.16);
}

.showdown-banner p {
    max-width: 640px;
    margin: 0 auto;
    color: rgba(226, 232, 240, 0.82);
    font-weight: 650;
}

.showdown-match-row {
    position: relative;
    z-index: 2;
    grid-template-columns: 145px minmax(0, 1fr) 145px;
    gap: 0.9rem;
}

.showdown-match-row::before {
    content: "VS";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 84px;
    height: 84px;
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, 0.1);
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 1000;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transform: translate(-50%, -50%) rotate(-8deg);
    z-index: 0;
}

.showdown-stage {
    z-index: 1;
    min-height: 380px;
    border-radius: 8px;
    padding: 1.15rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.035)),
        linear-gradient(120deg, rgba(32, 231, 255, 0.08), transparent 32%, transparent 68%, rgba(255, 77, 125, 0.08)),
        rgba(8, 11, 22, 0.78);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(255, 255, 255, 0.04),
        0 22px 56px rgba(0, 0, 0, 0.34),
        0 0 0 1px rgba(32, 231, 255, 0.08);
}

.showdown-stage::before {
    inset: 0;
    background:
        radial-gradient(circle at 50% 42%, rgba(255, 209, 102, 0.18), transparent 32%),
        linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    opacity: 0.72;
    animation: showdownStagePulse 2600ms ease-in-out infinite;
}

.showdown-stage::after {
    content: "";
    position: absolute;
    inset: 14px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(32, 231, 255, 0.06);
}

.showdown-player-panel {
    min-height: 380px;
    border-radius: 8px;
    justify-content: space-between;
    padding: 1.1rem 0.95rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.035)),
        rgba(6, 9, 18, 0.86);
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 20px 48px rgba(0, 0, 0, 0.32);
}

.showdown-player-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, var(--player-glow, rgba(167, 139, 250, 0.25)), transparent 34%),
        repeating-linear-gradient(135deg, transparent 0 10px, rgba(255, 255, 255, 0.035) 11px, transparent 12px);
    opacity: 0.62;
}

.showdown-player-panel::after {
    display: none;
}

.showdown-player-panel.is-me {
    border-color: rgba(255, 209, 102, 0.46);
}

.showdown-player-panel.is-locked {
    border-color: rgba(53, 240, 164, 0.34);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 20px 48px rgba(0, 0, 0, 0.32),
        0 0 34px rgba(53, 240, 164, 0.15);
}

.showdown-player-panel.is-winner {
    border-color: rgba(255, 209, 102, 0.7);
    animation: showdownWinnerPanel 1300ms ease-in-out infinite;
}

.showdown-player-glow {
    inset: -20%;
    width: auto;
    height: auto;
    border-radius: 0;
    background: radial-gradient(circle at 50% 16%, var(--player-glow, rgba(167, 139, 250, 0.25)), transparent 44%);
    filter: blur(10px);
    opacity: 0.62;
}

.showdown-player-avatar-wrap {
    width: 6.25rem;
    height: 6.25rem;
    border-radius: 8px;
    padding: 4px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.75), var(--player-glow, rgba(167, 139, 250, 0.55))),
        #0b1020;
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.32);
    transform: rotate(-2deg);
}

.showdown-player-panel.is-guest .showdown-player-avatar-wrap {
    transform: rotate(2deg);
}

.showdown-player-avatar {
    border-radius: 6px;
}

.showdown-player-meta {
    align-items: center;
    text-align: center;
}

.showdown-player-role,
.showdown-player-status,
.showdown-player-hand small {
    color: rgba(226, 232, 240, 0.72);
    letter-spacing: 0;
}

.showdown-player-name {
    max-width: 160px;
    font-family: var(--font-heading);
    font-size: 1.18rem;
}

.showdown-player-status {
    color: var(--showdown-gold);
}

.showdown-player-hand {
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.showdown-choice-grid {
    max-width: 900px;
    gap: 1rem;
    margin-top: 0;
}

.showdown-choice-card {
    position: relative;
    min-height: 300px;
    border-radius: 8px;
    padding: 1.2rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.035)),
        rgba(8, 11, 22, 0.82);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 18px 42px rgba(0, 0, 0, 0.32);
    overflow: hidden;
}

.showdown-choice-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, transparent 0 48%, rgba(255, 255, 255, 0.14) 49%, transparent 51%),
        radial-gradient(circle at 50% 0, rgba(32, 231, 255, 0.14), transparent 34%);
    opacity: 0.72;
    transition: transform 180ms ease, opacity 180ms ease;
}

.showdown-choice-card:hover {
    transform: translateY(-8px) scale(1.01);
    border-color: rgba(255, 209, 102, 0.45);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 28px 70px rgba(0, 0, 0, 0.44),
        0 0 42px rgba(255, 209, 102, 0.15);
}

.showdown-choice-card:hover::before {
    transform: translateX(14px);
    opacity: 1;
}

.showdown-choice-icon,
.showdown-choice-title,
.showdown-choice-copy,
.showdown-code-input,
.showdown-choice-card .btn {
    position: relative;
    z-index: 1;
}

.showdown-choice-icon {
    width: 5rem;
    height: 5rem;
    border-radius: 8px;
    color: #05070d;
    background: linear-gradient(135deg, var(--showdown-gold), var(--showdown-cyan));
    border: 0;
    box-shadow: 0 0 30px rgba(32, 231, 255, 0.18);
}

.showdown-choice-title {
    font-size: 1.55rem;
    text-transform: uppercase;
}

.showdown-choice-copy {
    max-width: 250px;
    color: rgba(226, 232, 240, 0.74);
    text-align: center;
}

.showdown-code-input {
    border-radius: 8px;
    border-color: rgba(255, 209, 102, 0.32);
    text-align: center;
    font-size: 1.35rem;
    font-weight: 1000;
}

.showdown-room-code-card {
    min-height: 100%;
    isolation: isolate;
}

.showdown-stage-halo {
    position: absolute;
    inset: 12%;
    border: 1px solid rgba(255, 209, 102, 0.2);
    border-radius: 50%;
    box-shadow:
        inset 0 0 50px rgba(255, 209, 102, 0.08),
        0 0 70px rgba(32, 231, 255, 0.12);
    animation: showdownHalo 3300ms ease-in-out infinite;
}

.showdown-room-code-card strong {
    position: relative;
    z-index: 1;
    font-size: 6.2rem;
    color: #fff;
    letter-spacing: 0;
    text-shadow:
        0 4px 0 rgba(32, 231, 255, 0.22),
        0 0 42px rgba(255, 209, 102, 0.36);
}

.showdown-card-label {
    color: #05070d;
    background: linear-gradient(90deg, var(--showdown-gold), #fff1bf);
    border: 0;
}

.showdown-draw-board,
.showdown-vote-board,
.showdown-duel-board,
.showdown-reveal-board,
.showdown-finale-board {
    display: grid;
    place-items: center;
    min-height: 100%;
}

.showdown-draw-board,
.showdown-vote-board {
    gap: 1rem;
}

.showdown-speed-field {
    inset: -1.3rem;
    background:
        linear-gradient(100deg, transparent 0 20%, rgba(255, 255, 255, 0.18) 21%, transparent 24%),
        linear-gradient(80deg, transparent 0 58%, rgba(32, 231, 255, 0.16) 59%, transparent 62%),
        linear-gradient(115deg, transparent 0 78%, rgba(255, 77, 125, 0.14) 79%, transparent 82%);
    background-size: 220px 100%, 360px 100%, 460px 100%;
    opacity: 0.78;
    animation: showdownSpeed 560ms linear infinite;
}

.showdown-stage-burst,
.showdown-winner-burst {
    position: absolute;
    inset: 16%;
    border-radius: 50%;
    background:
        conic-gradient(from 0deg, transparent, rgba(255, 209, 102, 0.32), transparent, rgba(32, 231, 255, 0.24), transparent);
    filter: blur(10px);
    opacity: 0.7;
    animation: showdownBurstSpin 2400ms linear infinite;
}

.showdown-round-stamp {
    border-radius: 8px;
    color: #05070d;
    background: linear-gradient(135deg, var(--showdown-gold), var(--showdown-pink));
    letter-spacing: 0;
    box-shadow: 0 0 34px rgba(255, 209, 102, 0.2);
}

.showdown-vote-header {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.6rem;
    color: rgba(226, 232, 240, 0.72);
    font-weight: 900;
    text-transform: uppercase;
}

.showdown-vote-header strong {
    color: var(--showdown-gold);
}

.showdown-contender-grid,
.showdown-vote-grid {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 620px;
    gap: 0.85rem;
}

.showdown-poster-card {
    border-radius: 8px;
    padding: 0.45rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.045)),
        rgba(6, 9, 18, 0.82);
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 20px 44px rgba(0, 0, 0, 0.34);
    transform-style: preserve-3d;
}

.showdown-poster-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        linear-gradient(135deg, rgba(32, 231, 255, 0.16), transparent 28%, transparent 72%, rgba(255, 77, 125, 0.16)),
        repeating-linear-gradient(90deg, transparent 0 20px, rgba(255, 255, 255, 0.035) 21px, transparent 22px);
    opacity: 0.65;
    pointer-events: none;
}

.showdown-card-aura {
    position: absolute;
    inset: -16%;
    background: radial-gradient(circle at 50% 12%, rgba(255, 209, 102, 0.2), transparent 48%);
    opacity: 0;
    transition: opacity 180ms ease;
    pointer-events: none;
}

.showdown-card-rank {
    position: absolute;
    z-index: 3;
    left: 0.65rem;
    top: 0.65rem;
    border-radius: 999px;
    padding: 0.22rem 0.45rem;
    color: #05070d;
    background: rgba(255, 209, 102, 0.92);
    font-size: 0.66rem;
    font-weight: 1000;
    text-transform: uppercase;
}

.showdown-poster-card.is-entering {
    transform-origin: 50% 110%;
    animation: showdownContenderSlam 980ms cubic-bezier(0.16, 1.26, 0.3, 1) forwards;
    animation-delay: calc(var(--slot-index) * 180ms);
}

.showdown-poster-card.is-selectable:hover {
    transform: translateY(-12px) rotateX(3deg) rotateZ(calc((var(--slot-index) - 1) * 1.2deg)) scale(1.025);
    border-color: rgba(255, 209, 102, 0.52);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 30px 70px rgba(0, 0, 0, 0.44),
        0 0 42px rgba(255, 209, 102, 0.17);
}

.showdown-poster-card.is-selectable:hover .showdown-card-aura,
.showdown-poster-card.is-selected .showdown-card-aura,
.showdown-poster-card.is-winner .showdown-card-aura {
    opacity: 1;
}

.showdown-poster-card.is-selected {
    border-color: rgba(53, 240, 164, 0.78);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 26px 60px rgba(0, 0, 0, 0.42),
        0 0 48px rgba(53, 240, 164, 0.22);
    animation: showdownVoteLock 440ms cubic-bezier(0.16, 1.28, 0.34, 1);
}

.showdown-poster-card.is-locked:not(.is-selected) {
    opacity: 0.62;
    filter: saturate(0.75);
}

.showdown-poster-card.is-winner {
    width: 260px;
    max-width: 260px;
    border-color: rgba(255, 209, 102, 0.82);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 34px 82px rgba(0, 0, 0, 0.52),
        0 0 70px rgba(255, 209, 102, 0.22);
    animation: showdownFinalPosterBig 1100ms cubic-bezier(0.12, 1.15, 0.22, 1) both;
}

.showdown-poster-frame {
    border-radius: 6px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.showdown-poster-frame img,
.showdown-poster-frame .poster-placeholder {
    transform: scale(1.001);
}

.showdown-poster-sweep {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.46), transparent);
    mix-blend-mode: screen;
}

.showdown-vote-badge {
    border-radius: 8px;
    background: rgba(5, 7, 13, 0.68);
    backdrop-filter: blur(8px);
}

.showdown-poster-info {
    position: relative;
    z-index: 2;
}

.showdown-poster-info h4,
.showdown-finale-info h4 {
    font-family: var(--font-heading);
    font-size: 1rem;
}

.showdown-poster-meta {
    color: rgba(226, 232, 240, 0.74);
}

.showdown-lock-panel {
    position: relative;
    z-index: 2;
}

.showdown-lock-message,
.showdown-duel-status {
    border-radius: 8px;
    color: rgba(248, 250, 252, 0.86);
    background: rgba(5, 7, 13, 0.58);
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.showdown-lock-message.is-locked {
    color: var(--showdown-green);
    background: rgba(53, 240, 164, 0.09);
}

.showdown-duel-board {
    gap: 1.1rem;
    isolation: isolate;
}

.showdown-duel-rings {
    position: absolute;
    inset: 10%;
    z-index: -1;
    display: grid;
    place-items: center;
}

.showdown-duel-rings span {
    grid-area: 1 / 1;
    width: 230px;
    height: 230px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 40px rgba(32, 231, 255, 0.1);
    animation: showdownDuelRing 2200ms ease-in-out infinite;
}

.showdown-duel-rings span:nth-child(2) {
    width: 310px;
    height: 310px;
    animation-delay: 220ms;
    border-color: rgba(255, 209, 102, 0.16);
}

.showdown-duel-rings span:nth-child(3) {
    width: 390px;
    height: 390px;
    animation-delay: 440ms;
    border-color: rgba(255, 77, 125, 0.13);
}

.showdown-vs-core,
.showdown-impact-flash {
    width: 7.4rem;
    height: 7.4rem;
    border-radius: 8px;
    color: #05070d;
    background:
        linear-gradient(135deg, var(--showdown-gold), var(--showdown-pink) 48%, var(--showdown-cyan));
    transform: none;
    box-shadow:
        0 0 0 6px rgba(255, 255, 255, 0.06),
        0 22px 64px rgba(0, 0, 0, 0.42),
        0 0 52px rgba(255, 209, 102, 0.2);
}

.showdown-vs-core span {
    display: block;
    font-size: 2.35rem;
    transform: rotate(8deg);
}

.showdown-vs-core {
    animation: showdownVsKnock 1500ms ease-in-out infinite;
}

.showdown-hand-grid {
    gap: 0.7rem;
}

.showdown-hand-button {
    position: relative;
    width: 136px;
    min-height: 144px;
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.04)),
        rgba(5, 7, 13, 0.72);
    border-color: rgba(255, 255, 255, 0.17);
    overflow: hidden;
}

.showdown-hand-button::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.13), transparent);
    transform: translateX(-120%);
    transition: transform 220ms ease;
}

.showdown-hand-button:hover:not(:disabled) {
    transform: translateY(-9px) rotate(-2deg);
    border-color: rgba(255, 209, 102, 0.56);
    box-shadow:
        0 26px 54px rgba(0, 0, 0, 0.38),
        0 0 34px rgba(255, 209, 102, 0.16);
}

.showdown-hand-button:hover:not(:disabled)::before {
    transform: translateX(120%);
}

.showdown-hand-button.selected {
    background:
        linear-gradient(180deg, rgba(53, 240, 164, 0.16), rgba(255, 255, 255, 0.04)),
        rgba(5, 7, 13, 0.76);
    border-color: rgba(53, 240, 164, 0.72);
}

.showdown-hand-emoji {
    position: relative;
    z-index: 1;
    font-size: 3.4rem;
    filter:
        drop-shadow(0 12px 18px rgba(0, 0, 0, 0.42))
        drop-shadow(0 0 12px rgba(255, 209, 102, 0.18));
}

.showdown-reveal-board {
    gap: 0.9rem;
}

.showdown-reveal-streaks {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, transparent 0 18%, rgba(32, 231, 255, 0.18) 19%, transparent 22%),
        linear-gradient(90deg, transparent 0 78%, rgba(255, 77, 125, 0.18) 79%, transparent 82%);
    background-size: 260px 100%, 300px 100%;
    opacity: 0.8;
    animation: showdownRevealStreaks 640ms linear infinite;
}

.showdown-countdown {
    width: 8rem;
    height: 5rem;
}

.showdown-countdown span {
    font-size: 5rem;
    text-shadow:
        0 4px 0 rgba(255, 77, 125, 0.4),
        0 0 40px rgba(255, 209, 102, 0.54);
}

.showdown-clash-zone {
    width: min(100%, 680px);
    gap: 1rem;
}

.showdown-shake-token {
    min-height: 176px;
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.045)),
        rgba(5, 7, 13, 0.72);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.38);
}

.showdown-shake-token .showdown-hand-emoji {
    font-size: 5rem;
}

.showdown-impact-flash {
    animation: showdownImpactBoom 940ms cubic-bezier(0.12, 1.18, 0.22, 1) forwards;
    animation-delay: 2450ms;
}

.showdown-revealed-hands {
    width: min(100%, 600px);
}

.showdown-revealed-hands div {
    border-radius: 8px;
    background: rgba(5, 7, 13, 0.62);
    border-color: rgba(255, 255, 255, 0.16);
}

.showdown-revealed-hands span {
    color: var(--showdown-gold);
    letter-spacing: 0;
}

.showdown-rps-reveal.has-winner .showdown-stage {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 22px 56px rgba(0, 0, 0, 0.34),
        0 0 52px rgba(255, 209, 102, 0.18);
}

.showdown-rps-reveal.is-tie .showdown-stage {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 22px 56px rgba(0, 0, 0, 0.34),
        0 0 52px rgba(32, 231, 255, 0.16);
}

.showdown-rps-duel-stage {
    overflow: visible;
    min-height: 430px;
}

.showdown-rps-duel-board {
    position: relative;
    width: 100%;
    min-height: 410px;
    display: grid;
    grid-template-rows: 1fr auto auto;
    align-items: center;
    justify-items: center;
    gap: 0.85rem;
    isolation: isolate;
}

.showdown-rps-duel-board .showdown-duel-rings {
    inset: 3%;
}

.showdown-rps-duel-board .showdown-reveal-streaks {
    opacity: 0;
    transition: opacity 240ms ease;
}

.showdown-rps-duel-board.is-revealing .showdown-reveal-streaks,
.showdown-rps-duel-board.is-revealed .showdown-reveal-streaks {
    opacity: 0.72;
}

.showdown-rps-countdown {
    position: absolute;
    top: 0.15rem;
    left: 50%;
    z-index: 7;
    width: 9rem;
    height: 6rem;
    transform: translateX(-50%);
    opacity: 0;
    pointer-events: none;
}

.showdown-rps-countdown span {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-family: var(--font-heading);
    font-size: 5.4rem;
    font-weight: 1000;
    color: #ffffff;
    opacity: 0;
    transform: scale(0.42) rotate(-7deg);
    text-shadow:
        0 5px 0 rgba(255, 77, 125, 0.38),
        0 0 42px rgba(255, 209, 102, 0.55),
        0 0 74px rgba(32, 231, 255, 0.24);
    animation: none;
}

.showdown-rps-duel-board.is-revealing .showdown-rps-countdown {
    opacity: 1;
}

.showdown-rps-duel-board.is-revealing .showdown-rps-countdown span {
    animation: showdownRpsCountdown 940ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.showdown-rps-duel-board.is-revealing .showdown-rps-countdown span:nth-child(2) {
    animation-delay: 1000ms;
}

.showdown-rps-duel-board.is-revealing .showdown-rps-countdown span:nth-child(3) {
    animation-delay: 2000ms;
}

.showdown-rps-duel-board.is-revealed .showdown-rps-countdown {
    opacity: 0;
}

.showdown-fist-arena {
    position: relative;
    z-index: 2;
    width: min(100%, 720px);
    min-height: 286px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    justify-items: center;
    align-items: center;
    gap: clamp(0.6rem, 2vw, 1.35rem);
}

.showdown-fist-zone {
    --duel-color: var(--showdown-cyan);
    position: relative;
    min-height: 270px;
    display: grid;
    place-items: center;
}

.showdown-fist-zone.is-guest {
    --duel-color: var(--showdown-pink);
}

.showdown-fist-label {
    position: absolute;
    top: 0.15rem;
    left: 50%;
    z-index: 5;
    min-width: 7rem;
    transform: translateX(-50%);
    display: grid;
    gap: 0.1rem;
    justify-items: center;
    padding: 0.42rem 0.7rem;
    border: 1px solid color-mix(in srgb, var(--duel-color) 38%, transparent);
    border-radius: 8px;
    background: rgba(5, 7, 13, 0.68);
    box-shadow: 0 0 24px color-mix(in srgb, var(--duel-color) 20%, transparent);
}

.showdown-fist-label span,
.showdown-fist-label strong {
    font-family: var(--font-heading);
    text-transform: uppercase;
}

.showdown-fist-label span {
    color: rgba(226, 232, 240, 0.74);
    font-size: 0.62rem;
}

.showdown-fist-label strong {
    color: var(--duel-color);
    font-size: 0.72rem;
    letter-spacing: 0;
}

.showdown-fist-token {
    position: relative;
    z-index: 3;
    width: clamp(7.6rem, 14vw, 10.2rem);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--duel-color) 38%, rgba(255, 255, 255, 0.12));
    border-radius: 8px;
    background:
        radial-gradient(circle at 35% 25%, color-mix(in srgb, var(--duel-color) 28%, transparent), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.035)),
        rgba(5, 7, 13, 0.72);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 24px 70px rgba(0, 0, 0, 0.45),
        0 0 48px color-mix(in srgb, var(--duel-color) 20%, transparent);
    transform: rotate(-4deg);
    transition:
        box-shadow 260ms ease,
        border-color 260ms ease,
        transform 260ms ease;
}

.showdown-fist-token.is-right {
    transform: rotate(4deg);
}

.showdown-fist-zone.is-local .showdown-fist-token {
    border-color: color-mix(in srgb, var(--duel-color) 64%, rgba(255, 255, 255, 0.12));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.14),
        0 26px 76px rgba(0, 0, 0, 0.48),
        0 0 62px color-mix(in srgb, var(--duel-color) 30%, transparent);
}

.showdown-fist-zone.is-locked .showdown-fist-token {
    border-color: color-mix(in srgb, var(--showdown-green) 56%, rgba(255, 255, 255, 0.12));
}

.showdown-fist-mystery,
.showdown-fist-reveal {
    grid-area: 1 / 1;
    font-size: clamp(4.25rem, 7.4vw, 6.35rem);
    line-height: 1;
    filter:
        drop-shadow(0 14px 22px rgba(0, 0, 0, 0.48))
        drop-shadow(0 0 18px color-mix(in srgb, var(--duel-color) 28%, transparent));
    transition:
        opacity 220ms ease,
        transform 320ms cubic-bezier(0.16, 1.25, 0.3, 1),
        filter 220ms ease;
}

.showdown-fist-reveal {
    opacity: 0;
    transform: scale(0.55) rotate(-14deg);
}

.showdown-rps-duel-board.is-revealing .showdown-fist-token.is-left {
    animation: showdownFistShakeLeft 3000ms cubic-bezier(0.36, 0, 0.66, -0.56) forwards;
}

.showdown-rps-duel-board.is-revealing .showdown-fist-token.is-right {
    animation: showdownFistShakeRight 3000ms cubic-bezier(0.36, 0, 0.66, -0.56) forwards;
}

.showdown-rps-duel-board.is-revealed .showdown-fist-token {
    border-color: rgba(255, 209, 102, 0.7);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 28px 82px rgba(0, 0, 0, 0.5),
        0 0 72px rgba(255, 209, 102, 0.28);
}

.showdown-rps-duel-board.is-revealed .showdown-fist-mystery {
    opacity: 0;
    transform: scale(0.62) rotate(18deg);
    filter: blur(3px);
}

.showdown-rps-duel-board.is-revealed .showdown-fist-reveal {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.showdown-choice-orbit {
    position: absolute;
    inset: 0;
    z-index: 6;
    pointer-events: none;
    transform: scale(1);
    opacity: 1;
    transition:
        opacity 360ms ease,
        transform 480ms cubic-bezier(0.16, 1, 0.3, 1);
}

.showdown-choice-orbit .showdown-hand-button {
    position: absolute;
    width: 4.85rem;
    min-height: 4.85rem;
    padding: 0.45rem 0.36rem;
    pointer-events: auto;
    backdrop-filter: blur(16px);
}

.showdown-choice-orbit .showdown-hand-button.is-rock {
    top: 2.25rem;
    left: 50%;
    transform: translateX(-50%) rotate(-3deg);
}

.showdown-choice-orbit .showdown-hand-button.is-paper {
    left: 0.8rem;
    bottom: 2.3rem;
    transform: rotate(4deg);
}

.showdown-choice-orbit .showdown-hand-button.is-scissors {
    right: 0.8rem;
    bottom: 2.3rem;
    transform: rotate(-4deg);
}

.showdown-choice-orbit .showdown-hand-button:hover:not(:disabled) {
    transform: translateY(-8px) rotate(0deg) scale(1.04);
}

.showdown-choice-orbit .showdown-hand-button.selected {
    animation: showdownChoiceLocked 940ms cubic-bezier(0.16, 1, 0.3, 1) both;
    box-shadow:
        0 22px 48px rgba(0, 0, 0, 0.42),
        0 0 42px rgba(53, 240, 164, 0.22);
}

.showdown-choice-orbit.is-locked .showdown-hand-button:not(.selected) {
    opacity: 0.34;
    transform: scale(0.88);
}

.showdown-rps-duel-board.is-revealing .showdown-choice-orbit,
.showdown-rps-duel-board.is-revealed .showdown-choice-orbit,
.showdown-choice-orbit.is-collapsed {
    opacity: 0;
    transform: scale(0.66);
    pointer-events: none;
}

.showdown-rps-duel-board .showdown-impact-flash {
    z-index: 4;
    opacity: 0.92;
    transform: scale(0.82);
    animation: none;
    transition:
        opacity 220ms ease,
        transform 320ms ease,
        box-shadow 220ms ease;
}

.showdown-rps-duel-board.is-revealing .showdown-impact-flash {
    animation: showdownRpsImpact 620ms cubic-bezier(0.12, 1.18, 0.22, 1) forwards;
    animation-delay: 2750ms;
}

.showdown-rps-duel-board.is-revealed .showdown-impact-flash {
    opacity: 1;
    transform: rotate(-6deg) scale(1.04);
    box-shadow:
        0 0 0 8px rgba(255, 255, 255, 0.08),
        0 24px 70px rgba(0, 0, 0, 0.48),
        0 0 68px rgba(255, 209, 102, 0.34);
}

.showdown-rps-duel-board .showdown-revealed-hands {
    position: relative;
    z-index: 5;
    width: min(100%, 610px);
    opacity: 0;
    transform: translateY(18px);
    transition:
        opacity 340ms ease,
        transform 420ms cubic-bezier(0.16, 1, 0.3, 1);
}

.showdown-rps-duel-board.is-revealed .showdown-revealed-hands {
    opacity: 1;
    transform: translateY(0);
}

.showdown-rps-duel-board .showdown-duel-status {
    position: relative;
    z-index: 5;
    min-width: min(100%, 440px);
    min-height: 3.4rem; /* Safe height for wrapped text */
    display: flex;
    align-items: center;
    justify-content: center;
}

.showdown-status-pending,
.showdown-status-final {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    height: 100%;
    transition:
        opacity 220ms ease,
        transform 280ms ease;
}

.showdown-status-final {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: translateY(12px);
}


.showdown-rps-duel-board.is-revealed .showdown-status-pending {
    opacity: 0;
    transform: translateY(-12px);
}

.showdown-rps-duel-board.is-revealed .showdown-status-final {
    opacity: 1;
    transform: translateY(0);
}

@keyframes showdownRpsCountdown {
    0% {
        opacity: 0;
        transform: scale(0.42) rotate(-7deg);
        filter: blur(5px);
    }
    18%,
    58% {
        opacity: 1;
        transform: scale(1.06) rotate(2deg);
        filter: blur(0);
    }
    100% {
        opacity: 0;
        transform: scale(1.42) rotate(8deg);
        filter: blur(5px);
    }
}

@keyframes showdownFistShakeLeft {
    0%,
    100% {
        transform: translateX(0) rotate(-4deg);
    }
    9% {
        transform: translateX(18px) translateY(-6px) rotate(3deg);
    }
    18% {
        transform: translateX(-8px) translateY(5px) rotate(-8deg);
    }
    27% {
        transform: translateX(22px) translateY(-4px) rotate(5deg);
    }
    36% {
        transform: translateX(-10px) translateY(6px) rotate(-7deg);
    }
    48% {
        transform: translateX(28px) translateY(-7px) rotate(6deg);
    }
    62% {
        transform: translateX(-6px) translateY(4px) rotate(-5deg);
    }
    78% {
        transform: translateX(34px) translateY(-8px) rotate(8deg);
    }
    90% {
        transform: translateX(64px) translateY(-2px) rotate(2deg);
    }
}

@keyframes showdownFistShakeRight {
    0%,
    100% {
        transform: translateX(0) rotate(4deg);
    }
    9% {
        transform: translateX(-18px) translateY(-6px) rotate(-3deg);
    }
    18% {
        transform: translateX(8px) translateY(5px) rotate(8deg);
    }
    27% {
        transform: translateX(-22px) translateY(-4px) rotate(-5deg);
    }
    36% {
        transform: translateX(10px) translateY(6px) rotate(7deg);
    }
    48% {
        transform: translateX(-28px) translateY(-7px) rotate(-6deg);
    }
    62% {
        transform: translateX(6px) translateY(4px) rotate(5deg);
    }
    78% {
        transform: translateX(-34px) translateY(-8px) rotate(-8deg);
    }
    90% {
        transform: translateX(-64px) translateY(-2px) rotate(-2deg);
    }
}

@keyframes showdownChoiceLocked {
    0% {
        transform: scale(1);
    }
    42% {
        transform: translateY(-6px) scale(1.08) rotate(1deg);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes showdownRpsImpact {
    0% {
        opacity: 0.65;
        transform: scale(0.78);
        filter: blur(4px);
    }
    55% {
        opacity: 1;
        transform: scale(1.34);
        filter: blur(0);
    }
    100% {
        opacity: 1;
        transform: scale(1.04);
        filter: blur(0);
    }
}

.showdown-finale-board {
    grid-template-columns: minmax(210px, 300px) minmax(0, 1fr);
    gap: 1.45rem;
    width: min(780px, 100%);
    margin: 0 auto;
}

.showdown-finale-info {
    padding: 1rem;
    border-left: 3px solid var(--showdown-gold);
    background:
        linear-gradient(90deg, rgba(255, 209, 102, 0.12), transparent),
        rgba(5, 7, 13, 0.34);
    border-radius: 8px;
    animation: showdownFinalTextBig 780ms ease forwards;
    animation-delay: 520ms;
}

.showdown-finale-info h4 {
    font-size: 3rem;
    line-height: 0.96;
    text-transform: uppercase;
    text-shadow:
        0 4px 0 rgba(255, 77, 125, 0.24),
        0 0 42px rgba(255, 209, 102, 0.24);
}

.showdown-director,
.showdown-finale-plot {
    color: rgba(226, 232, 240, 0.82);
}

.showdown-particle-burst span {
    width: 9px;
    height: 9px;
    border-radius: 2px;
    box-shadow: 0 0 22px currentColor;
    animation: showdownParticleBig 1150ms ease-out forwards;
}

.showdown-particle-burst span:nth-child(4n) {
    width: 16px;
    height: 4px;
}

.showdown-actions {
    margin-top: 1rem;
}

.showdown-actions .btn {
    border-radius: 8px;
}

.showdown-primary-action {
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.1),
        0 0 34px rgba(139, 92, 246, 0.32),
        0 14px 34px rgba(0, 0, 0, 0.28);
}

.showdown-primary-action.is-vote-locked {
    color: var(--showdown-green);
    background: rgba(53, 240, 164, 0.1);
    border-color: rgba(53, 240, 164, 0.26);
    box-shadow:
        0 0 0 1px rgba(53, 240, 164, 0.08),
        0 0 24px rgba(53, 240, 164, 0.16);
}

.showdown-reroll-action.is-pending {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.3);
    background: rgba(251, 191, 36, 0.08);
}

.showdown-reroll-action.is-declined {
    color: rgba(226, 232, 240, 0.62);
}

.showdown-lock-message {
    transition:
        color 180ms ease,
        background 180ms ease,
        border-color 180ms ease,
        transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.showdown-lock-message.is-locked {
    transform: translateY(-1px);
}

@keyframes showdownBoot {
    from { opacity: 0; transform: scale(0.985); filter: saturate(0.8); }
    to { opacity: 1; transform: scale(1); filter: saturate(1); }
}

@keyframes showdownLightSweep {
    to { background-position: -520px 0, -380px 0; }
}

@keyframes showdownGridDrift {
    to { background-position: 44px 44px, 44px 44px; }
}

@keyframes showdownScanlineDrift {
    to { background-position: 0 6px; }
}

@keyframes showdownRibbonLeft {
    0%, 100% { transform: translateX(-14px); opacity: 0.42; }
    50% { transform: translateX(10px); opacity: 0.72; }
}

@keyframes showdownRibbonRight {
    0%, 100% { transform: translateX(14px); opacity: 0.42; }
    50% { transform: translateX(-10px); opacity: 0.72; }
}

@keyframes showdownOrbitSpin {
    to { transform: rotate(360deg); }
}

@keyframes showdownSpark {
    0%, 70%, 100% { opacity: 0; transform: translate3d(0, 34px, 0) rotate(26deg) scaleY(0.5); }
    8%, 28% { opacity: 0.85; transform: translate3d(38px, -54px, 0) rotate(26deg) scaleY(1); }
}

@keyframes showdownEmblemFloat {
    0%, 100% { transform: translateY(0) rotate(0); }
    50% { transform: translateY(-8px) rotate(2deg); }
}

@keyframes showdownStagePulse {
    0%, 100% { opacity: 0.48; transform: scale(1); }
    50% { opacity: 0.82; transform: scale(1.04); }
}

@keyframes showdownWinnerPanel {
    0%, 100% { box-shadow: 0 20px 48px rgba(0, 0, 0, 0.32), 0 0 30px rgba(255, 209, 102, 0.18); }
    50% { box-shadow: 0 20px 48px rgba(0, 0, 0, 0.32), 0 0 54px rgba(255, 209, 102, 0.36); }
}

@keyframes showdownHalo {
    0%, 100% { transform: scale(0.96); opacity: 0.56; }
    50% { transform: scale(1.08); opacity: 0.9; }
}

@keyframes showdownBurstSpin {
    to { transform: rotate(360deg); }
}

@keyframes showdownContenderSlam {
    0% {
        opacity: 0;
        transform: translateY(-90px) translateX(calc((var(--slot-index) - 1) * 80px)) rotate(calc((var(--slot-index) - 1) * 11deg)) scale(0.72);
        filter: blur(10px);
    }
    58% {
        opacity: 1;
        transform: translateY(12px) translateX(0) rotate(calc((var(--slot-index) - 1) * -2deg)) scale(1.06);
        filter: blur(0);
    }
    74% {
        transform: translateY(-6px) rotate(calc((var(--slot-index) - 1) * 1deg)) scale(0.99);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotate(0) scale(1);
        filter: blur(0);
    }
}

@keyframes showdownVoteLock {
    0% { transform: scale(1); }
    36% { transform: scale(1.06) rotate(-1deg); }
    100% { transform: scale(1); }
}

@keyframes showdownDuelRing {
    0%, 100% { transform: scale(0.95); opacity: 0.35; }
    50% { transform: scale(1.08); opacity: 0.82; }
}

@keyframes showdownVsKnock {
    0%, 100% { transform: rotate(-8deg) scale(1); }
    48% { transform: rotate(-4deg) scale(1.08); }
    54% { transform: rotate(-10deg) scale(0.98); }
}

@keyframes showdownRevealStreaks {
    to { background-position: -260px 0, 300px 0; }
}

@keyframes showdownImpactBoom {
    0% { opacity: 0; transform: rotate(-8deg) scale(0.35); filter: blur(8px); }
    38% { opacity: 1; transform: rotate(4deg) scale(1.42); filter: blur(0); }
    100% { opacity: 1; transform: rotate(-8deg) scale(1); filter: blur(0); }
}

@keyframes showdownFinalPosterBig {
    0% {
        opacity: 0;
        transform: perspective(900px) rotateY(-42deg) rotateZ(-5deg) translateX(-42px) scale(0.68);
        filter: blur(10px) saturate(0.75);
    }
    64% {
        opacity: 1;
        transform: perspective(900px) rotateY(8deg) rotateZ(2deg) translateX(0) scale(1.08);
        filter: blur(0) saturate(1.15);
    }
    100% {
        opacity: 1;
        transform: perspective(900px) rotateY(0) rotateZ(0) translateX(0) scale(1);
        filter: blur(0) saturate(1);
    }
}

@keyframes showdownFinalTextBig {
    from {
        opacity: 0;
        transform: translateX(26px);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
        filter: blur(0);
    }
}

@keyframes showdownParticleBig {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.4) rotate(0);
    }
    16% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform:
            translate(-50%, -50%)
            rotate(var(--angle))
            translateX(var(--distance))
            scale(0.16)
            rotate(260deg);
    }
}

@media (max-width: 980px) {
    .showdown-entry-hero {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .showdown-entry .showdown-banner {
        text-align: center;
        margin: 0 auto;
    }

    .showdown-entry-emblem {
        width: 150px;
        height: 150px;
        margin: 0 auto;
    }

    .showdown-match-row {
        grid-template-columns: 1fr 1fr;
    }

    .showdown-stage {
        grid-column: 1 / -1;
        grid-row: 2;
        min-height: 390px;
    }

    .showdown-player-panel {
        min-height: 150px;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        justify-content: initial;
        text-align: left;
    }

    .showdown-player-meta {
        align-items: flex-start;
        text-align: left;
    }

    .showdown-player-avatar-wrap {
        width: 4.5rem;
        height: 4.5rem;
    }
}

@media (max-width: 720px) {
    .coop-game-container {
        width: 98vw;
        max-height: calc(100vh - 14px);
    }

    .showdown-shell {
        min-height: calc(100vh - 72px);
        padding: 0.75rem;
    }

    .showdown-banner h3 {
        font-size: 2.25rem;
    }

    .showdown-banner p {
        font-size: 0.9rem;
    }

    .showdown-choice-grid,
    .showdown-finale-board {
        grid-template-columns: 1fr;
    }

    .showdown-contender-grid,
    .showdown-vote-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.45rem;
        max-width: 100%;
    }

    .showdown-match-row {
        gap: 0.65rem;
    }

    .showdown-stage {
        min-height: 320px;
        padding: 0.85rem;
    }

    .showdown-poster-card {
        padding: 0.28rem;
    }

    .showdown-card-rank {
        top: 0.42rem;
        left: 0.42rem;
        padding: 0.16rem 0.32rem;
        font-size: 0.52rem;
    }

    .showdown-poster-info {
        padding: 0.48rem 0.14rem 0.08rem;
    }

    .showdown-poster-info h4 {
        font-size: 0.74rem;
        margin-bottom: 0.32rem;
    }

    .showdown-poster-meta {
        gap: 0.24rem;
        font-size: 0.6rem;
    }

    .showdown-player-panel {
        grid-template-columns: auto minmax(0, 1fr);
        min-height: 128px;
        padding: 0.8rem;
    }

    .showdown-player-hand {
        grid-column: 1 / -1;
        justify-self: stretch;
    }

    .showdown-player-name {
        max-width: 120px;
    }

    .showdown-room-code-card strong {
        font-size: 4rem;
    }

    .showdown-hand-button {
        width: 104px;
        min-height: 116px;
    }

    .showdown-hand-emoji {
        font-size: 2.65rem;
    }

    .showdown-clash-zone {
        grid-template-columns: 1fr;
    }

    .showdown-impact-flash {
        margin: -0.3rem auto;
    }

    .showdown-finale-info h4 {
        font-size: 2rem;
    }
}

@media (max-width: 460px) {
    .showdown-topbar {
        align-items: stretch;
    }

    .showdown-entry {
        padding: 0.9rem;
    }

    .showdown-choice-card {
        min-height: 250px;
    }

    .showdown-stage {
        min-height: 350px;
    }

    .showdown-player-avatar-wrap {
        width: 3.8rem;
        height: 3.8rem;
    }

    .showdown-vs-core,
    .showdown-impact-flash {
        width: 5.8rem;
        height: 5.8rem;
    }

    .showdown-vs-core span {
        font-size: 1.8rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .showdown-shell,
    .showdown-shell *,
    .showdown-shell *::before,
    .showdown-shell *::after {
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 1ms !important;
        scroll-behavior: auto !important;
    }

    .showdown-arena-grid,
    .showdown-energy-ribbon,
    .showdown-spark-field,
    .showdown-stage-burst,
    .showdown-winner-burst,
    .showdown-reveal-streaks,
    .showdown-duel-rings {
        display: none !important;
    }
}

/* Seamless draw-to-vote transition */
.showdown-draw .showdown-banner h3,
.showdown-draw .showdown-banner p,
.showdown-draw .showdown-kicker,
.showdown-draw .showdown-player-status {
    transition:
        color 280ms ease,
        text-shadow 280ms ease,
        transform 360ms ease,
        opacity 280ms ease;
}

.showdown-draw-board {
    align-content: center;
    justify-items: center;
    gap: 0.85rem;
}

.showdown-draw .showdown-contender-grid {
    transition: transform 620ms cubic-bezier(0.16, 1, 0.3, 1);
}

.showdown-draw:not(.is-vote-live) .showdown-poster-card {
    pointer-events: none;
    cursor: default;
}

.showdown-draw:not(.is-vote-live) .showdown-vote-badge {
    opacity: 0;
    transform: translateY(-8px) scale(0.86);
}

.showdown-draw .showdown-vote-badge {
    transition:
        opacity 280ms ease,
        transform 280ms cubic-bezier(0.16, 1.2, 0.3, 1),
        background 160ms ease;
}

.showdown-info-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.55rem;
    font-size: 0.88rem;
    font-weight: 800;
    color: #ffd166;
    background: rgba(255, 209, 102, 0.08);
    border: 1px solid rgba(255, 209, 102, 0.22);
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: 
        opacity 320ms ease, 
        transform 200ms cubic-bezier(0.16, 1, 0.3, 1), 
        background-color 200ms ease, 
        border-color 200ms ease,
        box-shadow 200ms ease,
        color 200ms ease;
}

.showdown-info-btn:hover {
    color: #05070d;
    background: linear-gradient(135deg, #ffd166, #ffbe2e);
    border-color: transparent;
    box-shadow: 0 6px 16px rgba(255, 209, 102, 0.35), 0 0 14px rgba(255, 209, 102, 0.18);
    transform: translateY(-2px);
}

.showdown-info-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(255, 209, 102, 0.2);
}

.showdown-draw:not(.is-vote-live) .showdown-info-btn {
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
}

/* Equal heights and metadata bottom-alignment for cards on the select screen */
.showdown-movie-card-wrapper .showdown-poster-card {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.showdown-movie-card-wrapper .showdown-poster-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.showdown-movie-card-wrapper .showdown-poster-meta {
    margin-top: auto;
}

.showdown-card-actions {
    display: grid;
    grid-template-columns: 2rem repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
}

.showdown-card-actions .showdown-info-btn {
    min-width: 0;
    padding: 0.5rem 0.35rem;
    font-size: 0.72rem;
    line-height: 1;
}

.showdown-card-actions .showdown-info-btn i {
    width: 0.9rem;
    height: 0.9rem;
    flex: 0 0 auto;
}

.showdown-card-actions .showdown-info-btn span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.showdown-card-actions .showdown-info-btn:first-child span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.showdown-card-actions .showdown-info-btn.is-seen {
    color: #20e7ff;
    border-color: rgba(32, 231, 255, 0.26);
    background: rgba(32, 231, 255, 0.08);
}

.showdown-card-actions .showdown-info-btn.is-seen:hover:not(:disabled) {
    color: #05070d;
    border-color: transparent;
    background: linear-gradient(135deg, #20e7ff, #35f0a4);
    box-shadow: 0 6px 16px rgba(32, 231, 255, 0.3), 0 0 14px rgba(53, 240, 164, 0.16);
}

.showdown-card-actions .showdown-info-btn.is-veto {
    color: #ff759a;
    border-color: rgba(255, 77, 125, 0.3);
    background: rgba(255, 77, 125, 0.09);
}

.showdown-card-actions .showdown-info-btn.is-veto:hover:not(:disabled) {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, #ff4d7d, #8b5cf6);
    box-shadow: 0 6px 16px rgba(255, 77, 125, 0.3), 0 0 14px rgba(139, 92, 246, 0.18);
}

.showdown-card-actions .showdown-info-btn:disabled,
.showdown-card-actions .showdown-info-btn:disabled:hover {
    color: rgba(148, 163, 184, 0.5);
    border-color: rgba(148, 163, 184, 0.16);
    background: rgba(148, 163, 184, 0.05);
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.58;
    transform: none;
}

.showdown-draw-to-vote {
    position: relative;
    z-index: 3;
    display: grid;
    gap: 0.7rem;
    justify-items: center;
    max-width: min(100%, 620px);
    opacity: 0;
    transform: translateY(28px) scale(0.98);
    transition:
        opacity 520ms ease,
        transform 620ms cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.showdown-draw:not(.is-vote-live) .showdown-actions {
    opacity: 0;
    transform: translateY(22px);
    pointer-events: none;
}

.showdown-draw .showdown-actions {
    transition:
        opacity 520ms ease,
        transform 620ms cubic-bezier(0.16, 1, 0.3, 1);
}

.showdown-draw .showdown-round-stamp,
.showdown-draw .showdown-speed-field,
.showdown-draw .showdown-stage-burst {
    transition:
        opacity 520ms ease,
        transform 620ms cubic-bezier(0.16, 1, 0.3, 1),
        filter 520ms ease;
}

.showdown-draw.is-vote-live .showdown-contender-grid {
    transform: translateY(-6px);
}

.showdown-draw.is-vote-live .showdown-draw-to-vote,
.showdown-draw.is-vote-live .showdown-actions {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.showdown-draw.is-vote-live .showdown-round-stamp {
    opacity: 0;
    transform: translateY(-18px) scale(0.84);
    pointer-events: none;
}

.showdown-draw.is-vote-live .showdown-speed-field {
    opacity: 0.16;
    transform: scaleX(0.98);
    filter: blur(2px);
}

.showdown-draw.is-vote-live .showdown-stage-burst {
    opacity: 0.34;
    transform: scale(0.92);
}

.showdown-draw.is-vote-live .showdown-poster-card {
    cursor: pointer;
}

.showdown-draw.is-vote-live .showdown-vote-badge {
    opacity: 1;
    transform: translateY(0) scale(1);
}

@media (max-width: 720px) {
    .showdown-draw-board {
        gap: 0.55rem;
    }

    .showdown-draw-to-vote {
        gap: 0.5rem;
    }

    .showdown-draw-to-vote .showdown-lock-message {
        border-radius: 8px;
        padding: 0.5rem 0.65rem;
        font-size: 0.72rem;
        line-height: 1.25;
    }
}

@media (max-width: 720px) {
    .showdown-rps-duel-stage {
        min-height: 440px;
    }

    .showdown-rps-duel-board {
        min-height: 420px;
        gap: 0.55rem;
    }

    .showdown-fist-arena {
        min-height: 275px;
        grid-template-columns: minmax(92px, 1fr) 4.6rem minmax(92px, 1fr);
        gap: 0.4rem;
    }

    .showdown-fist-zone {
        min-height: 260px;
    }

    .showdown-fist-token {
        width: clamp(6.4rem, 24vw, 8.4rem);
    }

    .showdown-fist-label {
        min-width: 5.8rem;
        padding: 0.34rem 0.48rem;
    }

    .showdown-choice-orbit .showdown-hand-button {
        width: 4.25rem;
        min-height: 4rem;
        padding: 0.34rem 0.25rem;
    }

    .showdown-choice-orbit .showdown-hand-button .showdown-hand-emoji {
        font-size: 2.15rem;
    }

    .showdown-choice-orbit .showdown-hand-button span:last-child {
        font-size: 0.58rem;
    }

    .showdown-choice-orbit .showdown-hand-button.is-rock {
        top: 2.7rem;
    }

    .showdown-choice-orbit .showdown-hand-button.is-paper {
        left: -0.1rem;
        bottom: 2.55rem;
    }

    .showdown-choice-orbit .showdown-hand-button.is-scissors {
        right: -0.1rem;
        bottom: 2.55rem;
    }

    .showdown-rps-countdown {
        top: 0;
        width: 6.6rem;
        height: 4.8rem;
    }

    .showdown-rps-countdown span {
        font-size: 4.15rem;
    }

    .showdown-rps-duel-board .showdown-duel-status {
        min-width: 0;
        max-width: 100%;
        font-size: 0.72rem;
        line-height: 1.2;
    }
}

@media (max-width: 460px) {
    .showdown-rps-duel-stage {
        min-height: 410px;
        padding: 0.55rem;
    }

    .showdown-fist-arena {
        min-height: 250px;
        grid-template-columns: minmax(82px, 1fr) 3.6rem minmax(82px, 1fr);
    }

    .showdown-fist-token {
        width: 5.7rem;
    }

    .showdown-fist-mystery,
    .showdown-fist-reveal {
        font-size: 4.2rem;
    }

    .showdown-fist-label span {
        font-size: 0.54rem;
    }

    .showdown-fist-label strong {
        font-size: 0.62rem;
    }

    .showdown-choice-orbit .showdown-hand-button {
        width: 3.7rem;
        min-height: 3.62rem;
    }

    .showdown-choice-orbit .showdown-hand-button.is-paper {
        left: -0.35rem;
    }

    .showdown-choice-orbit .showdown-hand-button.is-scissors {
        right: -0.35rem;
    }

    .showdown-rps-duel-board .showdown-impact-flash {
        width: 3.8rem;
        height: 3.8rem;
        font-size: 1.18rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .showdown-rps-duel-board.is-revealing .showdown-fist-token,
    .showdown-rps-duel-board.is-revealing .showdown-rps-countdown span,
    .showdown-rps-duel-board.is-revealing .showdown-impact-flash,
    .showdown-choice-orbit .showdown-hand-button.selected {
        animation: none !important;
    }

    .showdown-rps-countdown,
    .showdown-rps-duel-board .showdown-reveal-streaks {
        display: none;
    }

    .showdown-rps-duel-board.is-revealing .showdown-choice-orbit,
    .showdown-rps-duel-board.is-revealed .showdown-choice-orbit {
        transition: none;
    }
}

/* Root-level RPS duel overrides */
.showdown-shell.showdown-rps .showdown-rps-duel-stage {
    overflow: visible;
    min-height: 430px;
}

.showdown-shell.showdown-rps .showdown-rps-duel-board {
    position: relative;
    width: 100%;
    min-height: 410px;
    display: grid;
    grid-template-rows: 1fr auto auto;
    align-items: center;
    justify-items: center;
    gap: 0.85rem;
    isolation: isolate;
}

.showdown-shell.showdown-rps .showdown-fist-arena {
    position: relative;
    z-index: 2;
    width: min(100%, 720px);
    min-height: 286px;
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
    align-items: center;
    gap: clamp(0.6rem, 2vw, 1.35rem);
}

.showdown-shell.showdown-rps .showdown-fist-zone {
    position: relative;
    min-height: 270px;
    display: grid;
    place-items: center;
}

.showdown-shell.showdown-rps .showdown-fist-zone.is-host {
    --duel-color-solid: rgba(32, 231, 255, 0.9);
    --duel-glow-solid: rgba(32, 231, 255, 0.28);
}

.showdown-shell.showdown-rps .showdown-fist-zone.is-guest {
    --duel-color-solid: rgba(255, 77, 125, 0.9);
    --duel-glow-solid: rgba(255, 77, 125, 0.28);
}

.showdown-shell.showdown-rps .showdown-fist-label {
    position: absolute;
    top: 0.15rem;
    left: 50%;
    z-index: 5;
    min-width: 7rem;
    transform: translateX(-50%);
    display: grid;
    gap: 0.1rem;
    justify-items: center;
    padding: 0.42rem 0.7rem;
    border: 1px solid var(--duel-glow-solid);
    border-radius: 8px;
    background: rgba(5, 7, 13, 0.74);
    box-shadow: 0 0 24px var(--duel-glow-solid);
}

.showdown-shell.showdown-rps .showdown-fist-label span,
.showdown-shell.showdown-rps .showdown-fist-label strong {
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0;
}

.showdown-shell.showdown-rps .showdown-fist-label span {
    color: rgba(226, 232, 240, 0.74);
    font-size: 0.62rem;
}

.showdown-shell.showdown-rps .showdown-fist-label strong {
    color: var(--duel-color-solid);
    font-size: 0.72rem;
}

.showdown-shell.showdown-rps .showdown-fist-token {
    position: relative;
    z-index: 3;
    width: clamp(7.6rem, 14vw, 10.2rem);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    background:
        radial-gradient(circle at 35% 25%, var(--duel-glow-solid), transparent 36%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.035)),
        rgba(5, 7, 13, 0.72);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 24px 70px rgba(0, 0, 0, 0.45),
        0 0 48px var(--duel-glow-solid);
    transform: rotate(-4deg);
    transition: box-shadow 260ms ease, border-color 260ms ease, transform 260ms ease;
}

.showdown-shell.showdown-rps .showdown-fist-token.is-right {
    transform: rotate(4deg);
}

.showdown-shell.showdown-rps .showdown-fist-zone.is-local .showdown-fist-token {
    border-color: var(--duel-color-solid);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.14),
        0 26px 76px rgba(0, 0, 0, 0.48),
        0 0 62px var(--duel-glow-solid);
}

.showdown-shell.showdown-rps .showdown-fist-zone.is-locked .showdown-fist-token {
    border-color: rgba(53, 240, 164, 0.62);
}

.showdown-shell.showdown-rps .showdown-fist-mystery,
.showdown-shell.showdown-rps .showdown-fist-reveal {
    grid-area: 1 / 1;
    font-size: clamp(4.25rem, 7.4vw, 6.35rem);
    line-height: 1;
    filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.48)) drop-shadow(0 0 18px var(--duel-glow-solid));
    transition: opacity 220ms ease, transform 320ms cubic-bezier(0.16, 1.25, 0.3, 1), filter 220ms ease;
}

.showdown-shell.showdown-rps .showdown-fist-reveal {
    opacity: 0;
    transform: scale(0.55) rotate(-14deg);
}

.showdown-shell.showdown-rps .showdown-rps-duel-board.is-revealed .showdown-fist-mystery {
    opacity: 0 !important;
    transform: scale(0.62) rotate(18deg);
    filter: blur(3px);
}

.showdown-shell.showdown-rps .showdown-rps-duel-board.is-revealed .showdown-fist-reveal {
    opacity: 1 !important;
    transform: scale(1) rotate(0deg);
}

.showdown-shell.showdown-rps .showdown-rps-duel-board.is-revealing .showdown-fist-token.is-left {
    animation: showdownFistShakeLeft 3000ms cubic-bezier(0.36, 0, 0.66, -0.56) forwards;
}

.showdown-shell.showdown-rps .showdown-rps-duel-board.is-revealing .showdown-fist-token.is-right {
    animation: showdownFistShakeRight 3000ms cubic-bezier(0.36, 0, 0.66, -0.56) forwards;
}

.showdown-shell.showdown-rps .showdown-choice-orbit {
    position: absolute;
    bottom: -3.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    max-width: 280px;
    z-index: 6;
    pointer-events: none;
    opacity: 1;
    transition: opacity 360ms ease, transform 480ms cubic-bezier(0.16, 1, 0.3, 1);
}

.showdown-shell.showdown-rps .showdown-choice-orbit .showdown-hand-button,
.showdown-shell.showdown-rps .showdown-choice-orbit .showdown-hand-button.is-rock,
.showdown-shell.showdown-rps .showdown-choice-orbit .showdown-hand-button.is-paper,
.showdown-shell.showdown-rps .showdown-choice-orbit .showdown-hand-button.is-scissors {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    width: 4.85rem;
    min-height: 4.85rem;
    padding: 0.45rem 0.36rem;
    pointer-events: auto;
    backdrop-filter: blur(16px);
    transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 260ms ease, opacity 260ms ease, border-color 260ms ease;
}

.showdown-shell.showdown-rps .showdown-choice-orbit.is-locked .showdown-hand-button:not(.selected) {
    opacity: 0.34;
    transform: scale(0.88) !important;
}

.showdown-shell.showdown-rps .showdown-rps-duel-board.is-revealing .showdown-choice-orbit,
.showdown-shell.showdown-rps .showdown-rps-duel-board.is-revealed .showdown-choice-orbit,
.showdown-shell.showdown-rps .showdown-choice-orbit.is-collapsed {
    opacity: 0 !important;
    transform: scale(0.66);
    pointer-events: none;
}

.showdown-shell.showdown-rps .showdown-rps-countdown {
    position: absolute;
    top: 0.15rem;
    left: 50%;
    z-index: 7;
    width: 9rem;
    height: 6rem;
    transform: translateX(-50%);
    opacity: 0;
    pointer-events: none;
}

.showdown-shell.showdown-rps .showdown-rps-countdown span {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-family: var(--font-heading);
    font-size: 5.4rem;
    font-weight: 1000;
    color: #ffffff;
    opacity: 0;
    transform: scale(0.42) rotate(-7deg);
    text-shadow: 0 5px 0 rgba(255, 77, 125, 0.38), 0 0 42px rgba(255, 209, 102, 0.55);
}

.showdown-shell.showdown-rps .showdown-rps-duel-board.is-revealing .showdown-rps-countdown {
    opacity: 1;
}

.showdown-shell.showdown-rps .showdown-rps-duel-board.is-revealing .showdown-rps-countdown span {
    animation: showdownRpsCountdown 940ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.showdown-shell.showdown-rps .showdown-rps-duel-board.is-revealing .showdown-rps-countdown span:nth-child(2) {
    animation-delay: 1000ms;
}

.showdown-shell.showdown-rps .showdown-rps-duel-board.is-revealing .showdown-rps-countdown span:nth-child(3) {
    animation-delay: 2000ms;
}

.showdown-shell.showdown-rps .showdown-rps-duel-board .showdown-impact-flash {
    z-index: 4;
    opacity: 0.92;
    transform: scale(0.82);
    animation: none;
}

.showdown-shell.showdown-rps .showdown-rps-duel-board.is-revealing .showdown-impact-flash {
    animation: showdownRpsImpact 620ms cubic-bezier(0.12, 1.18, 0.22, 1) forwards;
    animation-delay: 2750ms;
}

.showdown-shell.showdown-rps .showdown-rps-duel-board .showdown-revealed-hands {
    position: relative;
    z-index: 5;
    width: min(100%, 610px);
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 340ms ease, transform 420ms cubic-bezier(0.16, 1, 0.3, 1);
}

.showdown-shell.showdown-rps .showdown-rps-duel-board.is-revealed .showdown-revealed-hands {
    opacity: 1;
    transform: translateY(0);
}

.showdown-shell.showdown-rps .showdown-rps-duel-board .showdown-duel-status {
    position: relative;
    z-index: 5;
    min-width: min(100%, 440px);
    min-height: 3.4rem; /* Safe height for wrapped text */
    display: flex;
    align-items: center;
    justify-content: center;
}

.showdown-shell.showdown-rps .showdown-status-pending,
.showdown-shell.showdown-rps .showdown-status-final {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    height: 100%;
    transition: opacity 220ms ease, transform 280ms ease;
}

.showdown-shell.showdown-rps .showdown-status-final {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: translateY(12px);
}


.showdown-shell.showdown-rps .showdown-rps-duel-board.is-revealed .showdown-status-pending {
    opacity: 0;
    transform: translateY(-12px);
}

.showdown-shell.showdown-rps .showdown-rps-duel-board.is-revealed .showdown-status-final {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 720px) {
    .showdown-shell.showdown-rps .showdown-rps-duel-stage {
        min-height: 410px;
    }

    .showdown-shell.showdown-rps .showdown-rps-duel-board {
        min-height: 390px;
    }

    .showdown-shell.showdown-rps .showdown-fist-arena {
        min-height: 252px;
        grid-template-columns: 1fr auto 1fr;
        justify-items: center;
        gap: 0.4rem;
    }

    .showdown-shell.showdown-rps .showdown-fist-zone {
        min-height: 240px;
    }

    .showdown-shell.showdown-rps .showdown-fist-token {
        width: clamp(6.1rem, 24vw, 8.2rem);
    }

    .showdown-shell.showdown-rps .showdown-choice-orbit {
        bottom: -1.2rem !important;
        gap: 6px !important;
        width: max-content !important;
        max-width: 100vw !important;
    }

    .showdown-shell.showdown-rps .showdown-choice-orbit .showdown-hand-button {
        width: 88px !important;
        min-height: 76px !important;
        padding: 6px 2px !important;
        flex-shrink: 0 !important;
    }
}

/* RPS composition polish */
.showdown-shell.showdown-rps .showdown-match-row {
    grid-template-columns: minmax(130px, 0.5fr) minmax(580px, 2.7fr) minmax(130px, 0.5fr);
    gap: 0.7rem;
}

.showdown-shell.showdown-rps .showdown-stage {
    padding: 0.95rem;
}

.showdown-shell.showdown-rps .showdown-player-panel.has-vote-picks {
    min-height: 390px;
    justify-content: flex-start;
    padding: 0.85rem;
}

.showdown-shell.showdown-rps .showdown-player-panel.has-vote-picks .showdown-player-avatar-wrap,
.showdown-shell.showdown-rps .showdown-player-panel.has-vote-picks .showdown-player-meta {
    display: none;
}

.showdown-shell.showdown-rps .showdown-player-picks {
    gap: 0.65rem;
}

.showdown-shell.showdown-rps .showdown-picks-label {
    color: rgba(248, 250, 252, 0.72);
    font-size: 0.66rem;
}

.showdown-shell.showdown-rps .showdown-player-panel.has-vote-picks .showdown-pick-list {
    gap: 0.55rem;
}

.showdown-shell.showdown-rps .showdown-player-panel.has-vote-picks .showdown-pick-chip {
    min-height: 5.4rem;
    grid-template-columns: 3.45rem minmax(0, 1fr);
    gap: 0.58rem;
    padding: 0.55rem;
    border-color: var(--chip-border);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.04)),
        rgba(5, 7, 13, 0.62);
}

.showdown-shell.showdown-rps .showdown-player-panel.has-vote-picks .showdown-pick-thumb {
    width: 3.45rem;
}

.showdown-shell.showdown-rps .showdown-player-panel.has-vote-picks .showdown-pick-title {
    font-size: 0.83rem;
    line-height: 1.08;
    white-space: normal;
    overflow-wrap: anywhere;
}

.showdown-shell.showdown-rps .showdown-rps-duel-stage {
    min-height: 455px;
}

.showdown-shell.showdown-rps .showdown-rps-duel-board {
    min-height: 430px;
    grid-template-rows: minmax(325px, 1fr) auto auto;
    gap: 0.7rem;
}

.showdown-shell.showdown-rps .showdown-fist-arena {
    width: min(100%, 780px);
    min-height: 325px;
    grid-template-columns: 1fr auto 1fr;
    justify-items: center;
    gap: clamp(0.5rem, 1.5vw, 0.95rem);
}

.showdown-shell.showdown-rps .showdown-fist-zone {
    min-height: 315px;
    padding: 0.3rem;
}

.showdown-shell.showdown-rps .showdown-fist-label {
    display: none;
}

.showdown-shell.showdown-rps .showdown-fist-token {
    width: clamp(8.4rem, 14vw, 10.8rem);
}

.showdown-shell.showdown-rps .showdown-fist-token.is-left {
    --winner-tilt: -4deg;
    --loser-tilt: -4deg;
}

.showdown-shell.showdown-rps .showdown-fist-token.is-right {
    --winner-tilt: 4deg;
    --loser-tilt: 4deg;
}

#details-modal {
    z-index: 2000 !important;
}

.showdown-shell.showdown-rps .showdown-choice-orbit {
    top: auto !important;
    height: auto !important;
    bottom: -1.2rem !important;
    left: 50%;
    transform: translateX(-50%);
    z-index: 6;
    width: max-content !important;
    max-width: 100vw !important;
}

.showdown-shell.showdown-rps .showdown-choice-orbit .showdown-hand-button,
.showdown-shell.showdown-rps .showdown-choice-orbit .showdown-hand-button.is-rock,
.showdown-shell.showdown-rps .showdown-choice-orbit .showdown-hand-button.is-paper,
.showdown-shell.showdown-rps .showdown-choice-orbit .showdown-hand-button.is-scissors {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    width: 116px !important;
    min-height: 92px !important;
    padding: 10px 4px !important;
    transform-origin: center;
    flex-shrink: 0 !important;
}

.showdown-shell.showdown-rps .showdown-choice-orbit .showdown-hand-button span:last-child {
    font-size: 0.78rem !important;
    letter-spacing: 0 !important;
}

.showdown-shell.showdown-rps .showdown-choice-orbit .showdown-hand-button:hover:not(:disabled) {
    transform: translateY(-10px) scale(1.06) !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.42), 0 0 18px var(--duel-glow-solid);
}

.showdown-shell.showdown-rps .showdown-choice-orbit.is-locked .showdown-hand-button:not(.selected) {
    opacity: 0.22;
    transform: scale(0.85) !important;
}

.showdown-shell.showdown-rps .showdown-rps-duel-board.is-revealed.has-winner .showdown-fist-zone.is-rps-winner .showdown-fist-token {
    border-color: rgba(255, 209, 102, 0.92);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        0 32px 88px rgba(0, 0, 0, 0.54),
        0 0 36px rgba(53, 240, 164, 0.26),
        0 0 86px rgba(255, 209, 102, 0.38);
    animation: showdownRpsWinnerLift 760ms cubic-bezier(0.16, 1.18, 0.3, 1) both;
}

.showdown-shell.showdown-rps .showdown-rps-duel-board.is-revealed.has-winner .showdown-fist-zone.is-rps-winner .showdown-fist-reveal {
    filter:
        drop-shadow(0 16px 22px rgba(0, 0, 0, 0.48))
        drop-shadow(0 0 26px rgba(255, 209, 102, 0.62))
        drop-shadow(0 0 42px rgba(53, 240, 164, 0.32));
}

.showdown-shell.showdown-rps .showdown-rps-duel-board.is-revealed.has-winner .showdown-fist-zone.is-rps-loser .showdown-fist-token {
    border-color: rgba(148, 163, 184, 0.25);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 18px 48px rgba(0, 0, 0, 0.42);
    animation: showdownRpsLoserPowerDown 880ms cubic-bezier(0.2, 0.8, 0.22, 1) both;
    animation-delay: 800ms !important;
}

.showdown-shell.showdown-rps .showdown-rps-duel-board.is-revealed.has-winner .showdown-fist-zone.is-rps-loser .showdown-fist-reveal {
    filter: grayscale(0.75) brightness(0.62) drop-shadow(0 12px 18px rgba(0, 0, 0, 0.42));
    animation: showdownRpsLoserGestureFlicker 880ms steps(2, end) both;
    animation-delay: 800ms !important;
}

@media (max-width: 980px) {
    .showdown-shell.showdown-rps .showdown-match-row {
        grid-template-columns: minmax(115px, 0.45fr) minmax(460px, 2.3fr) minmax(115px, 0.45fr);
    }

    .showdown-shell.showdown-rps .showdown-player-panel.has-vote-picks .showdown-pick-chip {
        grid-template-columns: 3rem minmax(0, 1fr);
        min-height: 4.9rem;
        padding: 0.48rem;
    }

    .showdown-shell.showdown-rps .showdown-player-panel.has-vote-picks .showdown-pick-thumb {
        width: 3rem;
    }

    .showdown-shell.showdown-rps .showdown-player-panel.has-vote-picks .showdown-pick-title {
        font-size: 0.76rem;
    }

    .showdown-shell.showdown-rps .showdown-choice-orbit {
        bottom: -1.2rem !important;
        width: max-content !important;
        max-width: 100vw !important;
    }

    .showdown-shell.showdown-rps .showdown-choice-orbit .showdown-hand-button {
        width: 102px !important;
        min-height: 84px !important;
        padding: 8px 3px !important;
        flex-shrink: 0 !important;
    }

    .showdown-shell.showdown-rps .showdown-choice-orbit .showdown-hand-button span:last-child {
        font-size: 0.72rem !important;
        letter-spacing: 0 !important;
    }
}

@media (max-width: 720px) {
    .showdown-card-actions .showdown-info-btn {
        padding-inline: 0.28rem;
    }

    .showdown-card-actions .showdown-info-btn span {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .showdown-shell.showdown-rps .showdown-match-row {
        grid-template-columns: 1fr;
    }

    .showdown-shell.showdown-rps .showdown-player-panel.has-vote-picks {
        min-height: auto;
    }

    .showdown-shell.showdown-rps .showdown-rps-duel-board {
        min-height: 430px;
        grid-template-rows: minmax(300px, 1fr) auto auto;
    }

    .showdown-shell.showdown-rps .showdown-fist-arena {
        min-height: 300px;
        grid-template-columns: 1fr auto 1fr;
        justify-items: center;
    }

    .showdown-shell.showdown-rps .showdown-fist-zone {
        min-height: 275px;
    }

    .showdown-shell.showdown-rps .showdown-choice-orbit {
        bottom: -1.2rem !important;
        gap: 6px !important;
        width: max-content !important;
        max-width: 100vw !important;
    }

    .showdown-shell.showdown-rps .showdown-choice-orbit .showdown-hand-button {
        width: 88px !important;
        min-height: 76px !important;
        padding: 6px 2px !important;
        flex-shrink: 0 !important;
    }

    .showdown-shell.showdown-rps .showdown-choice-orbit .showdown-hand-button span:last-child {
        font-size: 0.66rem !important;
        letter-spacing: 0 !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .showdown-shell.showdown-rps .showdown-rps-duel-board.is-revealed.has-winner .showdown-fist-zone.is-rps-winner .showdown-fist-token,
    .showdown-shell.showdown-rps .showdown-rps-duel-board.is-revealed.has-winner .showdown-fist-zone.is-rps-loser .showdown-fist-token,
    .showdown-shell.showdown-rps .showdown-rps-duel-board.is-revealed.has-winner .showdown-fist-zone.is-rps-loser .showdown-fist-reveal,
    .showdown-shell.showdown-rps .showdown-rps-duel-board.is-selecting .showdown-fist-token {
        animation: none !important;
    }
}

@keyframes showdownRpsWinnerLift {
    0% { transform: translateY(0) rotate(var(--winner-tilt, -4deg)) scale(1); }
    48% { transform: translateY(-16px) rotate(0deg) scale(1.1); }
    100% { transform: translateY(-10px) rotate(0deg) scale(1.055); }
}

@keyframes showdownRpsLoserPowerDown {
    0% { opacity: 1; transform: translateY(0) rotate(var(--loser-tilt, 4deg)) scale(1); filter: saturate(1) blur(0); }
    34% { opacity: 0.78; transform: translateY(10px) rotate(9deg) scale(0.94); filter: saturate(0.55) blur(0); }
    62% { opacity: 0.22; transform: translateY(19px) rotate(-6deg) scale(0.88); filter: saturate(0.28) blur(2px); }
    100% { opacity: 0; transform: translateY(32px) rotate(-10deg) scale(0.8); filter: saturate(0) blur(6px); }
}

@keyframes showdownRpsLoserGestureFlicker {
    0%, 22% { opacity: 1; transform: scale(1) rotate(0deg); }
    36% { opacity: 0.48; transform: scale(0.92) rotate(-7deg); }
    52% { opacity: 0.72; transform: scale(0.88) rotate(5deg); }
    100% { opacity: 0.56; transform: scale(0.82) rotate(-9deg); }
}

@keyframes showdownRpsCountdown {
    0% { opacity: 0; transform: scale(0.42) rotate(-7deg); filter: blur(5px); }
    18%, 58% { opacity: 1; transform: scale(1.06) rotate(2deg); filter: blur(0); }
    100% { opacity: 0; transform: scale(1.42) rotate(8deg); filter: blur(5px); }
}

@keyframes showdownFistShakeLeft {
    0%, 100% { transform: translateX(0) rotate(-4deg); }
    9% { transform: translateX(18px) translateY(-6px) rotate(3deg); }
    18% { transform: translateX(-8px) translateY(5px) rotate(-8deg); }
    27% { transform: translateX(22px) translateY(-4px) rotate(5deg); }
    36% { transform: translateX(-10px) translateY(6px) rotate(-7deg); }
    48% { transform: translateX(28px) translateY(-7px) rotate(6deg); }
    62% { transform: translateX(-6px) translateY(4px) rotate(-5deg); }
    78% { transform: translateX(34px) translateY(-8px) rotate(8deg); }
    90% { transform: translateX(64px) translateY(-2px) rotate(2deg); }
}

@keyframes showdownFistShakeRight {
    0%, 100% { transform: translateX(0) rotate(4deg); }
    9% { transform: translateX(-18px) translateY(-6px) rotate(-3deg); }
    18% { transform: translateX(8px) translateY(5px) rotate(8deg); }
    27% { transform: translateX(-22px) translateY(-4px) rotate(-5deg); }
    36% { transform: translateX(10px) translateY(6px) rotate(7deg); }
    48% { transform: translateX(-28px) translateY(-7px) rotate(-6deg); }
    62% { transform: translateX(6px) translateY(4px) rotate(5deg); }
    78% { transform: translateX(-34px) translateY(-8px) rotate(-8deg); }
    90% { transform: translateX(-64px) translateY(-2px) rotate(-2deg); }
}

@keyframes showdownRpsImpact {
    0% { opacity: 0.65; transform: scale(0.78); filter: blur(4px); }
    55% { opacity: 1; transform: scale(1.34); filter: blur(0); }
    100% { opacity: 1; transform: scale(1.04); filter: blur(0); }
}

.showdown-shell.showdown-rps .showdown-rps-duel-board.is-selecting .showdown-fist-token.is-left {
    animation: showdownFistIdleShakeLeft 1.4s ease-in-out infinite;
}

.showdown-shell.showdown-rps .showdown-rps-duel-board.is-selecting .showdown-fist-token.is-right {
    animation: showdownFistIdleShakeRight 1.4s ease-in-out infinite;
}

@keyframes showdownFistIdleShakeLeft {
    0%, 100% {
        transform: translateY(0) translateX(0) rotate(-4deg);
    }
    30% {
        transform: translateY(-12px) translateX(-2px) rotate(-1deg);
    }
    70% {
        transform: translateY(4px) translateX(6px) rotate(-6deg);
    }
}

@keyframes showdownFistIdleShakeRight {
    0%, 100% {
        transform: translateY(0) translateX(0) rotate(4deg);
    }
    30% {
        transform: translateY(-12px) translateX(2px) rotate(1deg);
    }
    70% {
        transform: translateY(4px) translateX(-6px) rotate(6deg);
    }
}

/* Root-level lobby intro and slot draw overrides */
.showdown-shell.showdown-lobby .showdown-lobby-stage,
.showdown-shell.showdown-slot-draw .showdown-draw-stage {
    overflow: visible;
}

.showdown-shell.showdown-lobby .showdown-lobby-board {
    position: relative;
    z-index: 1;
    min-height: 390px;
    display: grid;
    place-items: center;
    gap: 1rem;
    isolation: isolate;
}

.showdown-shell.showdown-lobby .showdown-lobby-spotlights {
    position: absolute;
    inset: -1.2rem;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.showdown-shell.showdown-lobby .showdown-lobby-spotlights span {
    position: absolute;
    top: -18%;
    width: 44%;
    height: 136%;
    opacity: 0.7;
    filter: blur(1px);
    transform-origin: top center;
    mix-blend-mode: screen;
}

.showdown-shell.showdown-lobby .showdown-lobby-spotlights span:first-child {
    left: -8%;
    background: linear-gradient(102deg, transparent, rgba(32, 231, 255, 0.28), transparent 72%);
    transform: rotate(18deg);
    animation: showdownLobbySpotlightLeft 2200ms ease-in-out both;
}

.showdown-shell.showdown-lobby .showdown-lobby-spotlights span:last-child {
    right: -8%;
    background: linear-gradient(78deg, transparent, rgba(255, 77, 125, 0.28), transparent 72%);
    transform: rotate(-18deg);
    animation: showdownLobbySpotlightRight 2200ms ease-in-out both;
}

.showdown-shell.showdown-lobby .showdown-lobby-match-card {
    position: relative;
    z-index: 2;
    width: min(100%, 680px);
    min-height: 315px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: clamp(0.7rem, 2vw, 1.15rem);
    padding: clamp(0.9rem, 2vw, 1.25rem);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 18px;
    background:
        linear-gradient(90deg, rgba(32, 231, 255, 0.12), transparent 36%, transparent 64%, rgba(255, 77, 125, 0.12)),
        radial-gradient(circle at 50% 12%, rgba(255, 255, 255, 0.14), transparent 34%),
        rgba(5, 7, 16, 0.74);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.11),
        0 28px 70px rgba(0, 0, 0, 0.42),
        0 0 54px rgba(139, 92, 246, 0.14);
    overflow: hidden;
}

.showdown-shell.showdown-lobby .showdown-lobby-match-card::before,
.showdown-shell.showdown-lobby .showdown-lobby-match-card::after {
    content: "";
    position: absolute;
    inset: -40%;
    pointer-events: none;
}

.showdown-shell.showdown-lobby .showdown-lobby-match-card::before {
    background: conic-gradient(from 70deg, transparent, rgba(255, 255, 255, 0.16), transparent 18%);
    animation: showdownLobbyCardSweep 2200ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.showdown-shell.showdown-lobby .showdown-lobby-match-card::after {
    inset: 0;
    border-radius: inherit;
    background:
        linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 28px 28px;
    opacity: 0.38;
    mask-image: radial-gradient(circle at center, black, transparent 74%);
}

.showdown-shell.showdown-lobby .showdown-lobby-player {
    position: relative;
    z-index: 2;
    min-width: 0;
    min-height: 250px;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 0.48rem;
    padding: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.035)),
        rgba(7, 10, 19, 0.68);
    overflow: hidden;
    box-shadow: 0 22px 52px rgba(0, 0, 0, 0.34);
}

.showdown-shell.showdown-lobby .showdown-lobby-player.is-host {
    --lobby-player-color: #20e7ff;
    --lobby-player-glow: rgba(32, 231, 255, 0.32);
    animation: showdownLobbyHostIn 900ms cubic-bezier(0.16, 1.18, 0.3, 1) both;
}

.showdown-shell.showdown-lobby .showdown-lobby-player.is-guest {
    --lobby-player-color: #ff4d7d;
    --lobby-player-glow: rgba(255, 77, 125, 0.32);
    animation: showdownLobbyGuestIn 900ms cubic-bezier(0.16, 1.18, 0.3, 1) both;
}

.showdown-shell.showdown-lobby .showdown-lobby-player.is-ready {
    border-color: rgba(53, 240, 164, 0.42);
}

.showdown-shell.showdown-lobby .showdown-lobby-player-beam {
    position: absolute;
    inset: auto auto -28% 50%;
    width: 180px;
    height: 220px;
    transform: translateX(-50%);
    background: radial-gradient(ellipse at center, var(--lobby-player-glow), transparent 68%);
    filter: blur(14px);
    opacity: 0.9;
}

.showdown-shell.showdown-lobby .showdown-lobby-avatar-ring {
    position: relative;
    width: clamp(6.9rem, 12vw, 8.4rem);
    aspect-ratio: 1;
    padding: 4px;
    border-radius: 50%;
    background:
        conic-gradient(from 160deg, var(--lobby-player-color), rgba(255, 255, 255, 0.9), var(--lobby-player-color));
    box-shadow:
        0 0 36px var(--lobby-player-glow),
        0 18px 44px rgba(0, 0, 0, 0.35);
    animation: showdownLobbyAvatarPulse 1600ms ease-in-out 500ms infinite;
}

.showdown-shell.showdown-lobby .showdown-lobby-avatar {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.08);
    border: 3px solid rgba(6, 8, 16, 0.88);
}

.showdown-shell.showdown-lobby .showdown-lobby-player span,
.showdown-shell.showdown-lobby .showdown-lobby-player small {
    color: rgba(226, 232, 240, 0.72);
    font-size: 0.68rem;
    font-weight: 1000;
    line-height: 1.1;
    text-align: center;
    text-transform: uppercase;
}

.showdown-shell.showdown-lobby .showdown-lobby-player strong {
    max-width: 100%;
    color: #fff;
    font-family: var(--font-heading);
    font-size: clamp(1rem, 2vw, 1.25rem);
    line-height: 1.05;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 0 22px var(--lobby-player-glow);
}

.showdown-shell.showdown-lobby .showdown-lobby-player small {
    color: var(--lobby-player-color);
}

.showdown-shell.showdown-lobby .showdown-lobby-vs {
    position: relative;
    z-index: 3;
    width: clamp(4.8rem, 10vw, 6.8rem);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(255, 209, 102, 0.95), rgba(255, 77, 125, 0.75) 48%, rgba(32, 231, 255, 0.24) 75%, transparent 76%);
    box-shadow:
        0 0 42px rgba(255, 209, 102, 0.36),
        0 0 80px rgba(139, 92, 246, 0.22);
    animation: showdownLobbyVsPop 980ms cubic-bezier(0.16, 1.3, 0.28, 1) both;
}

.showdown-shell.showdown-lobby .showdown-lobby-vs span {
    color: #05070d;
    font-family: var(--font-heading);
    font-size: clamp(1.45rem, 3vw, 2.15rem);
    font-weight: 1000;
    letter-spacing: 0;
    transform: rotate(-8deg);
}

.showdown-shell.showdown-lobby .showdown-lobby-ready-card {
    position: relative;
    z-index: 3;
    transition:
        opacity 520ms ease,
        transform 620ms cubic-bezier(0.16, 1, 0.3, 1),
        filter 520ms ease;
}

.showdown-shell.showdown-lobby.has-guest.is-intro .showdown-lobby-ready-card,
.showdown-shell.showdown-lobby.has-guest.is-intro .showdown-actions {
    opacity: 0;
    transform: translateY(26px) scale(0.98);
    pointer-events: none;
    filter: blur(3px);
}

.showdown-shell.showdown-lobby.has-guest.is-intro .showdown-player-panel {
    opacity: 0.42;
    transform: scale(0.96);
    transition: opacity 520ms ease, transform 620ms cubic-bezier(0.16, 1, 0.3, 1);
}

.showdown-shell.showdown-lobby.has-guest.is-ready .showdown-lobby-ready-card,
.showdown-shell.showdown-lobby.has-guest.is-ready .showdown-actions {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    filter: blur(0);
}

.showdown-shell.showdown-lobby.has-guest.is-ready .showdown-player-panel {
    opacity: 1;
    transform: scale(1);
}

.showdown-shell.showdown-lobby.is-waiting .showdown-lobby-ready-card {
    margin: auto;
}

.showdown-shell.showdown-slot-draw .showdown-slot-draw-board {
    position: relative;
    min-height: 390px;
    display: grid;
    grid-template-areas:
        "stamp"
        "reels"
        "copy";
    grid-template-rows: auto minmax(0, 1fr) auto;
    align-items: center;
    justify-items: center;
    gap: 0.9rem;
}

.showdown-shell.showdown-slot-draw .showdown-round-stamp {
    grid-area: stamp;
    margin: 0;
}

.showdown-shell.showdown-slot-draw .showdown-slot-machine,
.showdown-shell.showdown-slot-draw .showdown-slot-final-grid {
    grid-area: reels;
}

.showdown-shell.showdown-slot-draw .showdown-slot-machine {
    position: relative;
    z-index: 3;
    width: min(100%, 700px);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(0.55rem, 1.5vw, 0.9rem);
    padding: clamp(0.55rem, 1.4vw, 0.85rem);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.035)),
        rgba(4, 6, 13, 0.84);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 30px 80px rgba(0, 0, 0, 0.45),
        0 0 54px rgba(139, 92, 246, 0.16);
    overflow: hidden;
    transition:
        opacity 560ms ease,
        transform 680ms cubic-bezier(0.16, 1, 0.3, 1),
        filter 560ms ease;
}

.showdown-shell.showdown-slot-draw .showdown-slot-glow {
    position: absolute;
    inset: -40%;
    z-index: 0;
    background: conic-gradient(from 20deg, rgba(32, 231, 255, 0.18), rgba(255, 209, 102, 0.2), rgba(255, 77, 125, 0.18), rgba(32, 231, 255, 0.18));
    filter: blur(30px);
    opacity: 0.72;
    animation: showdownSlotGlow 2400ms linear infinite;
}

.showdown-shell.showdown-slot-draw .showdown-slot-reel {
    --slot-item-height: clamp(235px, 31vw, 305px);
    position: relative;
    z-index: 1;
    min-width: 0;
    height: var(--slot-item-height);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.035)),
        rgba(7, 10, 18, 0.92);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 -18px 36px rgba(0, 0, 0, 0.28),
        0 18px 38px rgba(0, 0, 0, 0.32);
    overflow: hidden;
    animation: showdownSlotReelStop 420ms cubic-bezier(0.16, 1.35, 0.28, 1) both;
    animation-delay: var(--slot-duration);
}

.showdown-shell.showdown-slot-draw .showdown-slot-chrome {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    border-radius: inherit;
    box-shadow:
        inset 0 18px 32px rgba(255, 255, 255, 0.08),
        inset 0 -30px 34px rgba(0, 0, 0, 0.48);
}

.showdown-shell.showdown-slot-draw .showdown-slot-window {
    position: relative;
    height: 100%;
    overflow: hidden;
    border-radius: inherit;
    mask-image: linear-gradient(to bottom, transparent, black 14%, black 86%, transparent);
}

.showdown-shell.showdown-slot-draw .showdown-slot-track {
    display: flex;
    flex-direction: column;
    will-change: transform, filter;
    animation: showdownSlotTrackSpin var(--slot-duration) cubic-bezier(0.08, 0.68, 0.12, 1) forwards;
}

.showdown-shell.showdown-slot-draw .showdown-slot-item {
    flex: 0 0 var(--slot-item-height);
    height: var(--slot-item-height);
    min-width: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto auto;
    align-items: end;
    gap: 0.28rem;
    padding: 0.62rem;
}

.showdown-shell.showdown-slot-draw .showdown-slot-poster {
    width: min(100%, 126px);
    aspect-ratio: 2 / 3;
    justify-self: center;
    align-self: center;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.42);
}

.showdown-shell.showdown-slot-draw .showdown-slot-poster img,
.showdown-shell.showdown-slot-draw .showdown-slot-poster .poster-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.showdown-shell.showdown-slot-draw .showdown-slot-item span,
.showdown-shell.showdown-slot-draw .showdown-slot-item small {
    min-width: 0;
    max-width: 100%;
    color: #fff;
    font-family: var(--font-heading);
    font-weight: 1000;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.showdown-shell.showdown-slot-draw .showdown-slot-item span {
    font-size: 0.82rem;
}

.showdown-shell.showdown-slot-draw .showdown-slot-item small {
    color: rgba(226, 232, 240, 0.62);
    font-size: 0.68rem;
}

.showdown-shell.showdown-slot-draw .showdown-slot-payline {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    z-index: 4;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 209, 102, 0.9), transparent);
    box-shadow: 0 0 20px rgba(255, 209, 102, 0.5);
    opacity: 0.92;
}

.showdown-shell.showdown-slot-draw .showdown-slot-lamps {
    position: absolute;
    left: 50%;
    bottom: 0.48rem;
    z-index: 5;
    display: inline-flex;
    gap: 0.25rem;
    transform: translateX(-50%);
}

.showdown-shell.showdown-slot-draw .showdown-slot-lamps span {
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 50%;
    background: #ffd166;
    box-shadow: 0 0 14px rgba(255, 209, 102, 0.75);
    animation: showdownSlotLamp 520ms ease-in-out infinite;
    animation-delay: calc(var(--slot-index) * 120ms);
}

.showdown-shell.showdown-slot-draw .showdown-slot-final-grid {
    position: relative;
    z-index: 4;
    width: min(100%, 700px);
    max-width: 700px; /* Override contender-grid max-width */
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(0.55rem, 1.5vw, 0.9rem); /* Match slot machine gap */
    padding: clamp(0.55rem, 1.4vw, 0.85rem); /* Match slot machine padding */
    border: 1px solid transparent; /* Match slot machine box model */
    opacity: 0;
    transform: translateY(28px) scale(0.92);
    filter: blur(7px);
    pointer-events: none;
    transition:
        opacity 520ms ease,
        transform 680ms cubic-bezier(0.16, 1.18, 0.28, 1),
        filter 560ms ease;
}

.showdown-shell.showdown-slot-draw:not(.is-vote-live) .showdown-slot-final-grid .showdown-poster-card {
    pointer-events: none;
}

/* Align final grid poster sizes with slot reels to eliminate jump on resolution */
.showdown-shell.showdown-slot-draw .showdown-slot-final-grid .showdown-poster-card .showdown-poster-frame {
    width: min(100%, 126px);
    margin: 0 auto;
}
@media (max-width: 920px) {
    .showdown-shell.showdown-slot-draw .showdown-slot-final-grid .showdown-poster-card .showdown-poster-frame {
        width: min(100%, 98px);
    }
}
@media (max-width: 720px) {
    .showdown-shell.showdown-slot-draw .showdown-slot-final-grid .showdown-poster-card .showdown-poster-frame {
        width: min(100%, 70px);
    }
}


.showdown-shell.showdown-slot-draw.is-slot-resolved .showdown-slot-machine {
    opacity: 0;
    transform: translateY(-28px) scale(0.92);
    filter: blur(8px);
    pointer-events: none;
}

.showdown-shell.showdown-slot-draw.is-slot-resolved .showdown-slot-final-grid {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

.showdown-shell.showdown-slot-draw.is-slot-resolved .showdown-slot-final-grid .showdown-poster-card {
    animation-delay: calc(var(--slot-index) * 120ms);
}

.showdown-shell.showdown-slot-draw .showdown-draw-to-vote {
    grid-area: copy;
}

.showdown-shell.showdown-slot-draw.is-vote-live .showdown-slot-final-grid {
    transform: translateY(-4px) scale(1);
    pointer-events: auto;
}

@media (max-width: 920px) {
    .showdown-shell.showdown-lobby .showdown-lobby-match-card {
        min-height: 280px;
    }

    .showdown-shell.showdown-lobby .showdown-lobby-player {
        min-height: 220px;
    }

    .showdown-shell.showdown-slot-draw .showdown-slot-reel {
        --slot-item-height: clamp(190px, 34vw, 250px);
    }

    .showdown-shell.showdown-slot-draw .showdown-slot-poster {
        width: min(100%, 98px);
    }
}

@media (max-width: 720px) {
    .coop-game-container {
        width: min(100%, calc(100vw - 12px));
        max-width: calc(100vw - 12px);
    }

    .showdown-shell .showdown-orbit,
    .showdown-shell.showdown-lobby .showdown-lobby-spotlights,
    .showdown-match-row::before {
        display: none;
    }

    .showdown-shell {
        max-width: 100%;
        overflow-x: hidden;
    }

    .showdown-shell.showdown-lobby .showdown-lobby-board,
    .showdown-shell.showdown-slot-draw .showdown-slot-draw-board {
        min-height: 410px;
    }

    .showdown-shell.showdown-lobby .showdown-lobby-match-card {
        width: min(100%, 360px);
        min-height: 0;
        grid-template-columns: 1fr;
        gap: 0.6rem;
        padding: 0.72rem;
    }

    .showdown-shell.showdown-lobby .showdown-lobby-vs {
        width: 4.1rem;
    }

    .showdown-shell.showdown-lobby .showdown-lobby-player {
        min-height: 145px;
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas:
            "avatar role"
            "avatar name"
            "avatar status";
        justify-items: start;
        align-content: center;
        column-gap: 0.75rem;
        padding: 0.65rem;
    }

    .showdown-shell.showdown-lobby .showdown-lobby-avatar-ring {
        grid-area: avatar;
        width: 5.2rem;
    }

    .showdown-shell.showdown-lobby .showdown-lobby-player span,
    .showdown-shell.showdown-lobby .showdown-lobby-player strong,
    .showdown-shell.showdown-lobby .showdown-lobby-player small {
        text-align: left;
    }

    .showdown-shell.showdown-lobby .showdown-lobby-player span {
        grid-area: role;
    }

    .showdown-shell.showdown-lobby .showdown-lobby-player strong {
        grid-area: name;
    }

    .showdown-shell.showdown-lobby .showdown-lobby-player small {
        grid-area: status;
    }

    .showdown-shell.showdown-slot-draw .showdown-slot-machine,
    .showdown-shell.showdown-slot-draw .showdown-slot-final-grid {
        width: min(100%, 360px);
        max-width: 360px;
    }

    .showdown-shell.showdown-slot-draw .showdown-slot-final-grid {
        gap: 0.38rem;
        padding: 0.42rem;
        border-radius: 12px;
        border: 1px solid transparent;
    }


    .showdown-shell.showdown-slot-draw .showdown-slot-machine {
        gap: 0.38rem;
        padding: 0.42rem;
        border-radius: 12px;
    }

    .showdown-shell.showdown-slot-draw .showdown-slot-reel {
        --slot-item-height: clamp(150px, 40vw, 190px);
        border-radius: 10px;
    }

    .showdown-shell.showdown-slot-draw .showdown-slot-item {
        padding: 0.38rem;
    }

    .showdown-shell.showdown-slot-draw .showdown-slot-poster {
        width: min(100%, 70px);
        border-radius: 8px;
    }

    .showdown-shell.showdown-slot-draw .showdown-slot-item span {
        font-size: 0.64rem;
    }

    .showdown-shell.showdown-slot-draw .showdown-slot-item small,
    .showdown-shell.showdown-slot-draw .showdown-slot-lamps {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .showdown-shell.showdown-lobby *,
    .showdown-shell.showdown-slot-draw * {
        animation: none !important;
        transition: none !important;
    }

    .showdown-shell.showdown-lobby.has-guest.is-intro .showdown-lobby-ready-card,
    .showdown-shell.showdown-lobby.has-guest.is-intro .showdown-actions,
    .showdown-shell.showdown-lobby.has-guest.is-intro .showdown-player-panel {
        opacity: 1;
        transform: none;
        filter: none;
        pointer-events: auto;
    }

    .showdown-shell.showdown-slot-draw .showdown-slot-machine {
        display: none;
    }

    .showdown-shell.showdown-slot-draw .showdown-slot-final-grid,
    .showdown-shell.showdown-slot-draw .showdown-draw-to-vote,
    .showdown-shell.showdown-slot-draw .showdown-actions {
        opacity: 1;
        transform: none;
        filter: none;
        pointer-events: auto;
    }
}

@keyframes showdownLobbyHostIn {
    0% { opacity: 0; transform: translateX(-70px) scale(0.84) rotate(-7deg); filter: blur(8px); }
    70% { opacity: 1; transform: translateX(8px) scale(1.05) rotate(2deg); filter: blur(0); }
    100% { opacity: 1; transform: translateX(0) scale(1) rotate(0); filter: blur(0); }
}

@keyframes showdownLobbyGuestIn {
    0% { opacity: 0; transform: translateX(70px) scale(0.84) rotate(7deg); filter: blur(8px); }
    70% { opacity: 1; transform: translateX(-8px) scale(1.05) rotate(-2deg); filter: blur(0); }
    100% { opacity: 1; transform: translateX(0) scale(1) rotate(0); filter: blur(0); }
}

@keyframes showdownLobbyVsPop {
    0% { opacity: 0; transform: scale(0.28) rotate(-22deg); filter: blur(8px); }
    68% { opacity: 1; transform: scale(1.18) rotate(8deg); filter: blur(0); }
    100% { opacity: 1; transform: scale(1) rotate(0); filter: blur(0); }
}

@keyframes showdownLobbyAvatarPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 34px var(--lobby-player-glow), 0 18px 44px rgba(0, 0, 0, 0.35); }
    50% { transform: scale(1.035); box-shadow: 0 0 52px var(--lobby-player-glow), 0 20px 48px rgba(0, 0, 0, 0.42); }
}

@keyframes showdownLobbySpotlightLeft {
    0% { opacity: 0; transform: rotate(32deg) translateX(-30%); }
    46% { opacity: 0.82; transform: rotate(12deg) translateX(4%); }
    100% { opacity: 0.44; transform: rotate(18deg) translateX(0); }
}

@keyframes showdownLobbySpotlightRight {
    0% { opacity: 0; transform: rotate(-32deg) translateX(30%); }
    46% { opacity: 0.82; transform: rotate(-12deg) translateX(-4%); }
    100% { opacity: 0.44; transform: rotate(-18deg) translateX(0); }
}

@keyframes showdownLobbyCardSweep {
    0% { opacity: 0; transform: rotate(0deg) scale(0.5); }
    34% { opacity: 0.82; }
    100% { opacity: 0.1; transform: rotate(135deg) scale(1.15); }
}

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

@keyframes showdownSlotTrackSpin {
    0% { transform: translateY(0); filter: blur(0); }
    16% { filter: blur(2px); }
    52% { transform: translateY(-54%); filter: blur(3px); }
    84% { transform: translateY(calc(var(--slot-target) - 2.6%)); filter: blur(1px); }
    100% { transform: translateY(var(--slot-target)); filter: blur(0); }
}

@keyframes showdownSlotReelStop {
    0% { transform: translateY(0) scale(1); border-color: rgba(255, 255, 255, 0.18); }
    42% { transform: translateY(-8px) scale(1.018); border-color: rgba(255, 209, 102, 0.52); }
    100% { transform: translateY(0) scale(1); border-color: rgba(255, 255, 255, 0.2); }
}

@keyframes showdownSlotLamp {
    0%, 100% { opacity: 0.42; transform: scale(0.74); }
    50% { opacity: 1; transform: scale(1.12); }
}

/* Seamless lobby column and reel-smoothing fixes */
.showdown-shell.showdown-lobby .showdown-match-row-full {
    grid-template-columns: minmax(0, 1fr) !important;
}

.showdown-shell.showdown-lobby .showdown-match-row-full::before {
    display: none;
}

.showdown-shell.showdown-lobby .showdown-match-row-full .showdown-stage {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
}

.showdown-shell.showdown-lobby .showdown-lobby-stage {
    min-height: clamp(430px, 58vh, 570px);
}

.showdown-shell.showdown-lobby .showdown-lobby-board {
    min-height: 100%;
}

.showdown-shell.showdown-lobby .showdown-lobby-match-card {
    width: min(100%, 920px);
    min-height: clamp(350px, 46vh, 470px);
    grid-template-columns: minmax(180px, 1fr) minmax(160px, 0.62fr) minmax(180px, 1fr);
    align-items: stretch;
    gap: clamp(0.75rem, 2vw, 1.25rem);
    overflow: visible;
}

.showdown-shell.showdown-lobby .showdown-lobby-center-stack {
    position: relative;
    z-index: 5;
    min-width: 0;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: clamp(0.85rem, 2vw, 1.2rem);
}

.showdown-shell.showdown-lobby .showdown-lobby-player {
    width: 100%;
    min-height: 100%;
    align-content: center;
    justify-content: center;
}

.showdown-shell.showdown-lobby .showdown-lobby-player.is-host,
.showdown-shell.showdown-lobby .showdown-lobby-player.is-guest {
    animation: none;
}

.showdown-shell.showdown-lobby .showdown-lobby-avatar-ring {
    width: clamp(6.8rem, 10vw, 8.7rem);
}

.showdown-shell.showdown-lobby .showdown-lobby-player strong {
    width: 100%;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.showdown-shell.showdown-lobby.has-guest.is-intro .showdown-lobby-player.is-host {
    animation: showdownLobbyHostMeetColumn 2200ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.showdown-shell.showdown-lobby.has-guest.is-intro .showdown-lobby-player.is-guest {
    animation: showdownLobbyGuestMeetColumn 2200ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.showdown-shell.showdown-lobby.has-guest.is-intro .showdown-lobby-vs {
    animation: showdownLobbyVsCharge 2200ms cubic-bezier(0.16, 1.2, 0.3, 1) both;
}

.showdown-shell.showdown-lobby.has-guest.is-ready .showdown-lobby-player {
    transform: translateX(0) scale(1);
}

.showdown-shell.showdown-lobby.has-guest.is-ready .showdown-lobby-vs {
    transform: scale(1) rotate(0);
}

.showdown-shell.showdown-lobby .showdown-lobby-ready-card {
    width: min(100%, 210px);
}

.showdown-shell.showdown-lobby .showdown-lobby-status-card {
    width: min(100%, 190px);
    padding-inline: 0.8rem;
}

.showdown-shell.showdown-lobby .showdown-lobby-status-card small {
    display: block;
    margin-top: 0.25rem;
}

.showdown-shell.showdown-lobby .showdown-lobby-ready-card strong {
    font-size: clamp(2.8rem, 6vw, 4.9rem);
}

.showdown-shell.showdown-slot-draw .showdown-slot-track {
    animation-timing-function: linear;
}

.showdown-shell.showdown-slot-draw .showdown-slot-reel {
    animation-duration: 360ms;
}

.showdown-shell.showdown-slot-draw.is-slot-resolved .showdown-slot-final-grid .showdown-poster-card.is-entering {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
}

.showdown-shell.showdown-slot-draw.is-slot-resolved .showdown-slot-final-grid .showdown-poster-card.is-entering.is-selected {
    opacity: 1;
    transform: translateY(-6px) scale(1.015) rotate(0deg);
}

@media (max-width: 720px) {
    .showdown-shell.showdown-lobby .showdown-lobby-stage {
        min-height: 520px;
    }

    .showdown-shell.showdown-lobby .showdown-lobby-match-card {
        width: min(100%, 360px);
        min-height: 0;
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 0.65rem;
    }

    .showdown-shell.showdown-lobby .showdown-lobby-center-stack {
        order: 2;
        gap: 0.65rem;
    }

    .showdown-shell.showdown-lobby .showdown-lobby-player {
        min-height: 132px;
        grid-template-columns: auto minmax(0, 1fr);
    }

    .showdown-shell.showdown-lobby .showdown-lobby-player.is-host {
        order: 1;
    }

    .showdown-shell.showdown-lobby .showdown-lobby-player.is-guest {
        order: 3;
    }

    .showdown-shell.showdown-lobby .showdown-lobby-vs {
        width: 4rem;
    }

    .showdown-shell.showdown-lobby .showdown-lobby-ready-card strong {
        font-size: 3.2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .showdown-shell.showdown-lobby.has-guest.is-intro .showdown-lobby-player.is-host,
    .showdown-shell.showdown-lobby.has-guest.is-intro .showdown-lobby-player.is-guest,
    .showdown-shell.showdown-lobby.has-guest.is-intro .showdown-lobby-vs {
        animation: none !important;
        transform: none !important;
    }

    .showdown-join-button.is-clicked::after,
    .showdown-join-button.is-joining,
    .showdown-code-input.is-invalid {
        animation: none !important;
    }
}

@keyframes showdownLobbyHostMeetColumn {
    0% { opacity: 0; transform: translateX(52%) scale(0.62); filter: blur(8px); }
    24% { opacity: 1; transform: translateX(52%) scale(0.62); filter: blur(0); }
    50% { opacity: 1; transform: translateX(38%) scale(0.78); box-shadow: 0 22px 52px rgba(0, 0, 0, 0.34), 0 0 52px rgba(32, 231, 255, 0.26); }
    72% { opacity: 1; transform: translateX(-4%) scale(1.03); }
    100% { opacity: 1; transform: translateX(0) scale(1); filter: blur(0); }
}

@keyframes showdownLobbyGuestMeetColumn {
    0% { opacity: 0; transform: translateX(-52%) scale(0.62); filter: blur(8px); }
    24% { opacity: 1; transform: translateX(-52%) scale(0.62); filter: blur(0); }
    50% { opacity: 1; transform: translateX(-38%) scale(0.78); box-shadow: 0 22px 52px rgba(0, 0, 0, 0.34), 0 0 52px rgba(255, 77, 125, 0.26); }
    72% { opacity: 1; transform: translateX(4%) scale(1.03); }
    100% { opacity: 1; transform: translateX(0) scale(1); filter: blur(0); }
}

@keyframes showdownLobbyVsCharge {
    0% { opacity: 0; transform: scale(0.58) rotate(-12deg); filter: blur(8px); }
    32% { opacity: 1; transform: scale(1.16) rotate(8deg); filter: blur(0); }
    54% { opacity: 1; transform: scale(1.32) rotate(-6deg); box-shadow: 0 0 54px rgba(255, 209, 102, 0.5), 0 0 90px rgba(139, 92, 246, 0.26); }
    100% { opacity: 1; transform: scale(1) rotate(0); filter: blur(0); }
}

@keyframes showdownSlotTrackSpin {
    0% { transform: translateY(0); filter: blur(0); }
    14% { transform: translateY(-18%); filter: blur(3px); }
    48% { transform: translateY(-50%); filter: blur(3px); }
    76% { transform: translateY(-72%); filter: blur(2px); }
    94% { transform: translateY(calc(var(--slot-target) - 0.5%)); filter: blur(0.5px); }
    100% { transform: translateY(var(--slot-target)); filter: blur(0); }
}

@keyframes showdownSlotReelStop {
    0% { transform: translateY(0) scale(1); border-color: rgba(255, 255, 255, 0.18); }
    45% { transform: translateY(-6px) scale(1.012); border-color: rgba(255, 209, 102, 0.58); }
    100% { transform: translateY(0) scale(1); border-color: rgba(255, 255, 255, 0.22); }
}

/* Split-decision bridge and RPS vote context */
.showdown-player-panel.has-vote-picks {
    justify-content: flex-start;
    padding-top: 1.1rem;
}

.showdown-player-picks {
    position: relative;
    z-index: 2;
    width: 100%;
    display: grid;
    gap: 0.42rem;
    animation: showdownPickStripIn 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.showdown-picks-label,
.showdown-no-match-role {
    font-family: var(--font-heading);
    color: rgba(226, 232, 240, 0.58);
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.showdown-pick-list,
.showdown-no-match-picks {
    display: grid;
    gap: 0.38rem;
}

.showdown-pick-chip {
    --chip-border: rgba(255, 255, 255, 0.12);
    position: relative;
    min-width: 0;
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr);
    align-items: center;
    gap: 0.48rem;
    padding: 0.34rem 0.45rem;
    border: 1px solid var(--chip-border);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    overflow: hidden;
    animation: showdownPickChipIn 460ms cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: calc(var(--pick-index, 0) * 70ms);
}

.showdown-player-panel.is-host .showdown-pick-chip,
.showdown-no-match-lane.is-host .showdown-pick-chip {
    --chip-border: rgba(32, 231, 255, 0.26);
}

.showdown-player-panel.is-guest .showdown-pick-chip,
.showdown-no-match-lane.is-guest .showdown-pick-chip {
    --chip-border: rgba(255, 77, 125, 0.28);
}

.showdown-pick-chip.is-empty {
    grid-template-columns: 1fr;
    opacity: 0.62;
}

.showdown-pick-thumb {
    width: 2rem;
    aspect-ratio: 2 / 3;
    border-radius: 5px;
    overflow: hidden;
    background: rgba(2, 6, 23, 0.74);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.showdown-pick-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.showdown-pick-thumb .poster-placeholder {
    gap: 0;
    padding: 0.1rem;
    font-size: 0;
}

.showdown-pick-thumb .poster-placeholder i {
    width: 1rem;
    height: 1rem;
}

.showdown-pick-title {
    min-width: 0;
    color: rgba(248, 250, 252, 0.92);
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1.12;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.showdown-no-match-stage {
    overflow: visible;
    min-height: 430px;
}

.showdown-no-match-board {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 1rem 0 2rem;
    isolation: isolate;
}

.showdown-no-match-arena {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px minmax(0, 1fr);
    align-items: center;
    gap: clamp(0.7rem, 2vw, 1.2rem);
}

.showdown-no-match-lane .showdown-pick-chip {
    max-width: 100%;
    box-sizing: border-box;
}


.showdown-no-match-board::before {
    content: "";
    position: absolute;
    inset: 8% 4%;
    z-index: -1;
    border-radius: 22px;
    background:
        radial-gradient(circle at 50% 48%, rgba(255, 209, 102, 0.24), transparent 28%),
        linear-gradient(90deg, rgba(32, 231, 255, 0.12), transparent 44%, transparent 56%, rgba(255, 77, 125, 0.14));
    filter: blur(8px);
    animation: showdownNoMatchPulse 1150ms ease-in-out infinite alternate;
}

.showdown-no-match-lane {
    min-width: 0;
    display: grid;
    gap: 0.55rem;
    padding: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: rgba(5, 7, 13, 0.62);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.28);
    animation: showdownNoMatchLaneIn 720ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.showdown-no-match-lane.is-host {
    border-color: rgba(32, 231, 255, 0.28);
    transform-origin: right center;
}

.showdown-no-match-lane.is-guest {
    border-color: rgba(255, 77, 125, 0.28);
    transform-origin: left center;
    animation-name: showdownNoMatchLaneInRight;
}

.showdown-no-match-lane strong {
    min-width: 0;
    color: #fff;
    font-family: var(--font-heading);
    font-size: 1rem;
    line-height: 1.05;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.showdown-no-match-core {
    position: relative;
    min-height: 260px;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 0.7rem;
    text-align: center;
    animation: showdownNoMatchCoreIn 820ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.showdown-no-match-badge,
.showdown-transition-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.38rem 0.68rem;
    border-radius: 999px;
    color: #101827;
    background: linear-gradient(135deg, #fde68a, #67e8f9);
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 1000;
    text-transform: uppercase;
    box-shadow: 0 0 30px rgba(103, 232, 249, 0.24);
}

.showdown-no-match-impact {
    position: relative;
    width: 8.5rem;
    height: 8.5rem;
    display: grid;
    place-items: center;
}

.showdown-no-match-impact span {
    position: absolute;
    width: 4.6rem;
    height: 4.6rem;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(32, 231, 255, 0.9), rgba(139, 92, 246, 0.66));
    box-shadow: 0 0 42px rgba(32, 231, 255, 0.32);
    animation: showdownNoMatchImpactLeft 960ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.showdown-no-match-impact span:last-child {
    background: linear-gradient(135deg, rgba(255, 77, 125, 0.9), rgba(251, 191, 36, 0.7));
    box-shadow: 0 0 42px rgba(255, 77, 125, 0.32);
    animation-name: showdownNoMatchImpactRight;
}

.showdown-no-match-impact strong {
    position: relative;
    z-index: 2;
    color: #050711;
    width: 4.2rem;
    height: 4.2rem;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: radial-gradient(circle, #ffffff 0 12%, #fde68a 38%, #fb7185 70%, #22d3ee 100%);
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 1000;
    box-shadow: 0 0 46px rgba(253, 230, 138, 0.46);
    animation: showdownNoMatchVsPop 960ms cubic-bezier(0.16, 1.25, 0.3, 1) both;
}

.showdown-no-match-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
    animation: showdownNoMatchCoreIn 820ms cubic-bezier(0.16, 1, 0.3, 1) both 200ms;
}

.showdown-no-match-text h4 {
    margin: 0;
    color: #fff;
    font-family: var(--font-heading);
    font-size: clamp(2.2rem, 5vw, 4rem);
    font-weight: 1000;
    line-height: 0.95;
    text-transform: uppercase;
    text-shadow: 0 0 34px rgba(251, 191, 36, 0.28);
}

.showdown-no-match-text p {
    max-width: 28rem;
    margin: 0;
    color: rgba(226, 232, 240, 0.74);
    font-weight: 800;
    font-size: 1.1rem;
    line-height: 1.4;
}

.is-no-match-pulsing .showdown-no-match-text h4 {
    animation: showdownNoMatchTextPulse 2400ms ease-in-out forwards;
}

@keyframes showdownNoMatchTextPulse {
    0% { transform: scale(1); text-shadow: 0 0 34px rgba(251, 191, 36, 0.28); color: #fff; }
    50% { transform: scale(1.08); text-shadow: 0 0 64px rgba(251, 77, 125, 0.85), 0 0 25px rgba(255, 255, 255, 0.8); color: #fff; }
    100% { transform: scale(1); text-shadow: 0 0 34px rgba(251, 191, 36, 0.28); color: #fff; }
}

.showdown-no-match-sparks {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.showdown-no-match-sparks span {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0.2rem;
    height: 4.8rem;
    border-radius: 999px;
    background: linear-gradient(to bottom, transparent, rgba(253, 230, 138, 0.95), transparent);
    transform-origin: center;
    animation: showdownNoMatchSpark 900ms ease-out both;
}

.showdown-no-match-sparks span:nth-child(1) { transform: translate(-50%, -50%) rotate(35deg); }
.showdown-no-match-sparks span:nth-child(2) { transform: translate(-50%, -50%) rotate(105deg); animation-delay: 80ms; }
.showdown-no-match-sparks span:nth-child(3) { transform: translate(-50%, -50%) rotate(155deg); animation-delay: 140ms; }
.showdown-no-match-sparks span:nth-child(4) { transform: translate(-50%, -50%) rotate(225deg); animation-delay: 200ms; }

.showdown-actions-transition {
    min-height: 3.1rem;
}

.showdown-shell.showdown-no-match.is-arming-rps .showdown-no-match-board {
    opacity: 0.2;
    transform: translateY(-14px) scale(0.96);
    filter: blur(5px);
    transition: opacity 420ms ease, transform 420ms cubic-bezier(0.16, 1, 0.3, 1), filter 420ms ease;
}

.showdown-shell.showdown-rps.is-rps-arriving .showdown-rps-duel-board {
    animation: showdownRpsStageArrive 720ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@media (max-width: 760px) {
    .showdown-player-panel.has-vote-picks {
        min-height: auto;
    }

    .showdown-no-match-board {
        min-height: auto;
        grid-template-columns: 1fr;
    }

    .showdown-no-match-core {
        min-height: 220px;
        order: -1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .showdown-player-picks,
    .showdown-pick-chip,
    .showdown-no-match-board::before,
    .showdown-no-match-lane,
    .showdown-no-match-core,
    .showdown-no-match-impact span,
    .showdown-no-match-impact strong,
    .showdown-no-match-sparks span,
    .showdown-shell.showdown-rps.is-rps-arriving .showdown-rps-duel-board {
        animation: none !important;
    }
}

/* Finale readability pass */
.showdown-finale .showdown-banner {
    margin-bottom: 0.65rem;
}

.showdown-finale .showdown-banner h3 {
    font-size: clamp(2.2rem, 4.2vw, 3.15rem);
    line-height: 0.96;
}

.showdown-finale .showdown-banner p {
    font-size: 0.95rem;
}

.showdown-finale .showdown-match-row {
    grid-template-columns: minmax(130px, 0.5fr) minmax(540px, 2.3fr) minmax(130px, 0.5fr);
    gap: 0.85rem;
}

.showdown-finale .showdown-stage {
    min-height: 360px;
    padding: 1rem;
}

/* Cinematic Transitions */
.showdown-finale.winner-is-host .showdown-player-panel.is-guest {
    animation: pushOutRight 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.showdown-finale.winner-is-guest .showdown-player-panel.is-host {
    animation: pushOutLeft 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.showdown-finale.winner-is-host .showdown-stage {
    animation: slideInFromLeft 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.showdown-finale.winner-is-guest .showdown-stage {
    animation: slideInFromRight 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@media (min-width: 761px) {
    .showdown-finale .showdown-player-panel.is-host {
        grid-row: 1;
        grid-column: 1;
    }
    .showdown-finale .showdown-player-panel.is-guest {
        grid-row: 1;
        grid-column: 3;
    }
    .showdown-finale .showdown-stage {
        grid-row: 1;
        grid-column: 2;
    }
    .showdown-finale.winner-is-host .showdown-stage {
        grid-column: 2 / span 2;
    }
    .showdown-finale.winner-is-guest .showdown-stage {
        grid-column: 1 / span 2;
    }
}

.showdown-finale .showdown-player-panel {
    min-height: 330px;
    padding-inline: 0.8rem;
}

.showdown-finale .showdown-player-avatar-wrap {
    width: clamp(4.7rem, 8vw, 5.8rem);
    height: clamp(4.7rem, 8vw, 5.8rem);
}

.showdown-finale .showdown-finale-board {
    width: min(100%, 650px);
    grid-template-columns: minmax(160px, 205px) minmax(0, 1fr);
    align-items: stretch;
    gap: 0.95rem;
}

.showdown-finale .showdown-final-poster.showdown-poster-card.is-winner {
    width: min(100%, 205px);
    max-width: 205px;
    align-self: center;
}

.showdown-shell.showdown-slot-draw .showdown-slot-reel.is-static {
    opacity: 0.52;
    animation: none;
    filter: saturate(0.62);
}

.showdown-shell.showdown-slot-draw .showdown-slot-reel.is-static .showdown-slot-track {
    animation: none;
    transform: translateY(0);
    filter: none;
}

.showdown-shell.showdown-slot-draw .showdown-slot-reel.is-static .showdown-slot-lamps span {
    animation: none;
    opacity: 0.28;
}

.showdown-shell.showdown-slot-draw.is-single-redraw .showdown-slot-reel.is-redrawing {
    border-color: rgba(255, 209, 102, 0.6);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.14),
        inset 0 -18px 36px rgba(0, 0, 0, 0.28),
        0 18px 38px rgba(0, 0, 0, 0.32),
        0 0 32px rgba(255, 209, 102, 0.28);
}

.showdown-ready-options {
    position: relative;
    z-index: 4;
    width: min(100%, 680px);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.showdown-ready-option {
    min-width: 0;
    min-height: 76px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    background:
        linear-gradient(135deg, rgba(32, 231, 255, 0.07), rgba(139, 92, 246, 0.08)),
        rgba(5, 7, 16, 0.82);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 14px 32px rgba(0, 0, 0, 0.26);
    transition: border-color 180ms ease, opacity 180ms ease, transform 180ms ease;
}

.showdown-ready-option:focus-within {
    border-color: rgba(32, 231, 255, 0.5);
}

.showdown-ready-options.is-locked .showdown-ready-option {
    border-color: rgba(53, 240, 164, 0.22);
    opacity: 0.78;
}

.showdown-option-icon {
    width: 2.2rem;
    height: 2.2rem;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: #ffd166;
    background: rgba(255, 209, 102, 0.1);
    box-shadow: inset 0 0 0 1px rgba(255, 209, 102, 0.18);
}

.showdown-option-icon i {
    width: 1.05rem;
    height: 1.05rem;
}

.showdown-option-copy {
    min-width: 0;
    display: grid;
    gap: 0.18rem;
}

.showdown-option-copy strong {
    color: #fff;
    font-family: var(--font-heading);
    font-size: 0.78rem;
    line-height: 1.05;
}

.showdown-option-copy small {
    color: rgba(226, 232, 240, 0.62);
    font-size: 0.66rem;
    line-height: 1.25;
}

.showdown-switch {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 0.22rem;
    cursor: pointer;
}

.showdown-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.showdown-switch > span {
    width: 2.65rem;
    height: 1.42rem;
    display: block;
    padding: 0.18rem;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.14);
    transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.showdown-switch > span::after {
    content: "";
    width: 0.94rem;
    height: 0.94rem;
    display: block;
    border-radius: 50%;
    background: #94a3b8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.34);
    transition: transform 220ms cubic-bezier(0.16, 1.2, 0.3, 1), background 180ms ease;
}

.showdown-switch input:checked + span {
    border-color: rgba(53, 240, 164, 0.55);
    background: rgba(53, 240, 164, 0.2);
    box-shadow: 0 0 16px rgba(53, 240, 164, 0.12);
}

.showdown-switch input:checked + span::after {
    transform: translateX(1.2rem);
    background: #35f0a4;
}

.showdown-switch input:focus-visible + span {
    outline: 2px solid #20e7ff;
    outline-offset: 3px;
}

.showdown-switch em,
.showdown-veto-select span,
.showdown-option-value {
    color: rgba(226, 232, 240, 0.66);
    font-size: 0.6rem;
    font-style: normal;
    font-weight: 900;
    text-transform: uppercase;
    white-space: nowrap;
}

.showdown-veto-select {
    display: grid;
    justify-items: center;
    gap: 0.18rem;
}

.showdown-veto-select select {
    min-width: 3.25rem;
    padding: 0.42rem 1.25rem 0.42rem 0.55rem;
    color: #fff;
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 900;
    border: 1px solid rgba(255, 209, 102, 0.3);
    border-radius: 9px;
    background: rgba(255, 209, 102, 0.09);
    cursor: pointer;
}

.showdown-option-value {
    padding: 0.48rem 0.62rem;
    color: #ffd166;
    border: 1px solid rgba(255, 209, 102, 0.22);
    border-radius: 9px;
    background: rgba(255, 209, 102, 0.08);
}

.showdown-shell.showdown-lobby.has-guest.is-intro .showdown-ready-options {
    opacity: 0;
    transform: translateY(26px) scale(0.98);
    pointer-events: none;
    filter: blur(3px);
}

.showdown-shell.showdown-lobby.has-guest.is-ready .showdown-ready-options {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    filter: blur(0);
    transition: opacity 520ms ease, transform 620ms cubic-bezier(0.16, 1, 0.3, 1), filter 520ms ease;
}

@media (max-width: 720px) {
    .showdown-ready-options {
        grid-template-columns: 1fr;
    }

    .showdown-ready-option {
        min-height: 68px;
    }
}

.showdown-finale .showdown-final-poster.is-details-link {
    cursor: pointer;
    transition: transform 180ms ease, filter 180ms ease, box-shadow 180ms ease;
}

.showdown-finale .showdown-final-poster.is-details-link:hover,
.showdown-finale .showdown-final-poster.is-details-link:focus-visible {
    transform: translateY(-4px) scale(1.015);
    filter: brightness(1.08);
    outline: 2px solid rgba(167, 139, 250, 0.9);
    outline-offset: 4px;
}

.showdown-finale .showdown-finale-info {
    min-width: 0;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 0.9rem;
    overflow: hidden;
}

.showdown-finale .showdown-finale-info .showdown-card-label {
    align-self: flex-start;
}

.showdown-finale .showdown-finale-info h4 {
    margin: 0.1rem 0 0;
    font-size: clamp(1.8rem, 3.4vw, 2.45rem);
    line-height: 1.02;
    text-transform: none;
    white-space: normal;
    overflow-wrap: anywhere;
}

.showdown-finale .showdown-finale-info .showdown-poster-meta {
    flex-wrap: wrap;
}

.showdown-finale .showdown-director {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.2;
}

.showdown-finale .showdown-finale-plot {
    margin: 0;
    max-height: 8.6rem;
    overflow: auto;
    padding-right: 0.2rem;
    font-size: 0.92rem;
    line-height: 1.42;
}

@media (max-width: 980px) {
    .showdown-finale .showdown-match-row {
        grid-template-columns: minmax(115px, 0.45fr) minmax(440px, 2.1fr) minmax(115px, 0.45fr);
        gap: 0.65rem;
    }

    .showdown-finale .showdown-player-panel {
        min-height: 300px;
    }

    .showdown-finale .showdown-finale-board {
        grid-template-columns: minmax(140px, 185px) minmax(0, 1fr);
        gap: 0.75rem;
    }

    .showdown-finale .showdown-final-poster.showdown-poster-card.is-winner {
        max-width: 185px;
    }
}

@media (max-width: 760px) {
    .showdown-finale .showdown-match-row {
        grid-template-columns: 1fr;
    }

    .showdown-finale .showdown-stage {
        grid-column: auto;
        grid-row: auto;
        min-height: auto;
    }

    .showdown-finale .showdown-player-panel {
        min-height: 128px;
    }

    .showdown-finale .showdown-finale-board {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }

    .showdown-finale .showdown-finale-info {
        align-items: center;
        width: 100%;
    }

    .showdown-finale .showdown-finale-info .showdown-card-label {
        align-self: center;
    }
}

@keyframes showdownPickStripIn {
    0% { opacity: 0; transform: translateY(12px) scale(0.96); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes showdownPickChipIn {
    0% { opacity: 0; transform: translateX(-12px) scale(0.96); }
    100% { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes showdownNoMatchPulse {
    0% { opacity: 0.58; transform: scale(0.98); }
    100% { opacity: 0.92; transform: scale(1.02); }
}

@keyframes showdownNoMatchLaneIn {
    0% { opacity: 0; transform: translateX(-28px) rotate(-3deg) scale(0.94); }
    70% { opacity: 1; transform: translateX(4px) rotate(1deg) scale(1.02); }
    100% { opacity: 1; transform: translateX(0) rotate(0) scale(1); }
}

@keyframes showdownNoMatchLaneInRight {
    0% { opacity: 0; transform: translateX(28px) rotate(3deg) scale(0.94); }
    70% { opacity: 1; transform: translateX(-4px) rotate(-1deg) scale(1.02); }
    100% { opacity: 1; transform: translateX(0) rotate(0) scale(1); }
}

@keyframes showdownNoMatchCoreIn {
    0% { opacity: 0; transform: scale(0.78); filter: blur(7px); }
    64% { opacity: 1; transform: scale(1.08); filter: blur(0); }
    100% { opacity: 1; transform: scale(1); filter: blur(0); }
}

@keyframes showdownNoMatchImpactLeft {
    0% { opacity: 0; transform: translateX(-72px) rotate(-18deg) scale(0.76); }
    58% { opacity: 1; transform: translateX(-6px) rotate(-7deg) scale(1.06); }
    100% { opacity: 1; transform: translateX(-20px) rotate(-10deg) scale(1); }
}

@keyframes showdownNoMatchImpactRight {
    0% { opacity: 0; transform: translateX(72px) rotate(18deg) scale(0.76); }
    58% { opacity: 1; transform: translateX(6px) rotate(7deg) scale(1.06); }
    100% { opacity: 1; transform: translateX(20px) rotate(10deg) scale(1); }
}

@keyframes showdownNoMatchVsPop {
    0% { opacity: 0; transform: scale(0.42) rotate(-18deg); }
    52% { opacity: 1; transform: scale(1.24) rotate(8deg); }
    100% { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes showdownNoMatchSpark {
    0% { opacity: 0; height: 0; }
    36% { opacity: 1; height: 5rem; }
    100% { opacity: 0; height: 7.5rem; }
}

@keyframes showdownRpsStageArrive {
    0% { opacity: 0; transform: translateY(18px) scale(0.96); filter: blur(8px); }
    64% { opacity: 1; transform: translateY(-3px) scale(1.015); filter: blur(0); }
    100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes pushOutRight {
    0% { transform: translateX(0); opacity: 1; }
    100% { transform: translateX(150%); opacity: 0; visibility: hidden; }
}

@keyframes pushOutLeft {
    0% { transform: translateX(0); opacity: 1; }
    100% { transform: translateX(-150%); opacity: 0; visibility: hidden; }
}

@keyframes slideInFromLeft {
    0% { transform: translateX(-100%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes slideInFromRight {
    0% { transform: translateX(100%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

/* Vertical pick chips for side panels */
.showdown-player-panel .showdown-pick-chip {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    text-align: center !important;
    min-height: auto !important;
    padding: 0.5rem !important;
    gap: 0.45rem !important;
}

.showdown-player-panel .showdown-pick-thumb {
    width: 68px !important;
    height: 102px !important;
    margin: 0 auto !important;
    aspect-ratio: 2 / 3 !important;
    flex-shrink: 0 !important;
}

.showdown-player-panel .showdown-pick-title {
    white-space: normal !important;
    text-align: center !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    line-clamp: 2 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 0.74rem !important;
    word-break: break-word !important;
}

/* Quick Actions Section (Decision Helpers Frame) */
.quick-actions-section {
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: var(--shadow-lg), 0 0 35px rgba(139, 92, 246, 0.05);
    position: relative;
    overflow: hidden;
}

/* Subtle top gradient accent highlight */
.quick-actions-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--secondary-accent) 100%);
}

.quick-actions-title {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.15rem;
}

.quick-actions-buttons {
    display: flex;
    gap: 1.25rem;
    width: 100%;
    flex-wrap: wrap;
}

.quick-actions-buttons .btn {
    flex: 1;
    min-width: 250px;
    height: 3.75rem; /* slightly taller for prominence */
    font-size: 1.1rem;
    font-weight: 800;
    border-radius: 14px;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
}

.quick-actions-buttons .btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
}

.quick-actions-buttons .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.05);
}

.quick-actions-buttons .btn-roulette:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.4);
}

/* Custom Dropdown Multi-select Checkbox Styles */
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.dropdown-item .checkbox-box {
    width: 15px;
    height: 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    background: rgba(255, 255, 255, 0.02);
    flex-shrink: 0;
}

.dropdown-item.selected .checkbox-box {
    background: var(--accent);
    border-color: var(--accent);
}

.dropdown-item .checkbox-box::after {
    content: '';
    width: 4px;
    height: 8px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translate(-0.5px, -1px);
    display: none;
}

.dropdown-item.selected .checkbox-box::after {
    display: block;
}

/* Repositioned Sort Dropdown Styles */
.header-left {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
}

.header-sort-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-sort-container .sort-label {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.compact-sort-dropdown {
    width: 220px;
}

.compact-sort-dropdown .dropdown-trigger {
    height: 2.25rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    border-radius: 8px;
    background: var(--input-bg, rgba(255, 255, 255, 0.03));
}

.compact-sort-dropdown .dropdown-menu {
    font-size: 0.85rem;
    border-radius: 8px;
    z-index: 120; /* elevate higher than movie cards */
}

.compact-sort-dropdown .dropdown-item {
    padding: 0.5rem 0.75rem;
}

/* Dashboard composition and responsive cleanup */
.discovery-layout {
    display: grid;
    grid-template-columns: minmax(0, 2.15fr) minmax(300px, 0.85fr);
    gap: 1.25rem;
    align-items: stretch;
    margin-bottom: 2rem;
}

.discovery-layout .hero-section,
.discovery-layout .quick-actions-section {
    margin-bottom: 0;
}

.discovery-layout .hero-content {
    min-height: 100%;
    padding: 2rem;
    gap: 1.75rem;
}

.discovery-layout .hero-details {
    min-width: 0;
    gap: 0.75rem;
}

.discovery-layout .hero-title {
    font-size: clamp(2rem, 3vw, 2.4rem);
}

.discovery-layout .hero-plot {
    max-width: 58ch;
    font-size: 0.98rem;
    line-height: 1.55;
    -webkit-line-clamp: 2;
}

.discovery-layout .hero-buttons {
    margin-top: 0.65rem;
}

.discovery-layout .hero-poster-wrapper {
    width: 150px;
    height: 225px;
}

.quick-actions-section {
    padding: 1.25rem;
    gap: 0.85rem;
    border-radius: 16px;
}

.quick-actions-title {
    margin-bottom: 0;
}

.quick-actions-title svg {
    width: 0.9rem;
    height: 0.9rem;
    color: var(--accent);
}

.quick-actions-buttons {
    flex: 1;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0.75rem;
}

.quick-actions-buttons .btn {
    min-width: 0;
    min-height: 0;
    height: auto;
    padding: 1rem 1.1rem;
    justify-content: flex-start;
    text-align: left;
    border-radius: 12px;
}

.quick-actions-buttons .btn > svg {
    width: 1.4rem;
    height: 1.4rem;
    flex: 0 0 auto;
}

.quick-action-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    line-height: 1.15;
}

.quick-action-copy strong {
    font-size: 1rem;
}

.quick-action-copy small {
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.3;
    opacity: 0.76;
}

.hero-section.hidden + .quick-actions-section {
    grid-column: 1 / -1;
}

.hero-section.hidden + .quick-actions-section .quick-actions-buttons {
    flex-direction: row;
}

.toolbar-search-row {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

.toolbar-search-row .search-box {
    flex: 1;
    min-width: 0;
}

.toolbar-search-row #add-movie-btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.mobile-filters-toggle {
    display: none;
}

@media (max-width: 1040px) {
    .discovery-layout {
        grid-template-columns: 1fr;
    }

    .quick-actions-buttons {
        flex-direction: row;
    }

    .quick-actions-buttons .btn {
        min-height: 4.5rem;
    }
}

@media (max-width: 720px) {
    body {
        background-attachment: scroll;
    }

    .app-container {
        padding: 1rem 0.875rem 2rem;
    }

    .app-header {
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }

    .brand {
        gap: 0.55rem;
    }

    .brand-icon {
        width: 1.9rem;
        height: 1.9rem;
    }

    .brand h1 {
        font-size: 1.45rem;
    }

    .profile-trigger-btn {
        width: 2.25rem;
        height: 2.25rem;
    }

    .discovery-layout {
        gap: 0.875rem;
        margin-bottom: 1.25rem;
    }

    .discovery-layout .hero-content {
        flex-direction: row;
        align-items: center;
        padding: 1.25rem;
        gap: 1rem;
    }

    .discovery-layout .hero-title {
        font-size: 1.8rem;
    }

    .discovery-layout .hero-poster-wrapper {
        width: 112px;
        height: 168px;
        align-self: center;
    }

    .discovery-layout .hero-plot {
        font-size: 0.9rem;
    }

    .quick-actions-section {
        padding: 1rem;
        gap: 0.75rem;
    }

    .quick-actions-buttons,
    .hero-section.hidden + .quick-actions-section .quick-actions-buttons {
        flex-direction: column;
        gap: 0.6rem;
    }

    .quick-actions-buttons .btn {
        min-height: 3.75rem;
        padding: 0.75rem 0.9rem;
    }

    .toolbar-section {
        padding: 1rem;
        margin-bottom: 1.25rem;
        gap: 0.85rem;
        border-radius: 14px;
    }

    .toolbar-search-row {
        gap: 0.6rem;
    }

    .search-box input {
        min-height: 3rem;
        padding: 0.8rem 0.85rem 0.8rem 2.75rem;
        font-size: 0.9rem;
    }

    .search-box svg {
        left: 0.95rem;
        width: 1rem;
        height: 1rem;
    }

    .toolbar-search-row #add-movie-btn {
        min-height: 3rem;
        padding: 0.7rem 0.95rem;
    }

    .mobile-filters-toggle {
        width: 100%;
        min-height: 2.75rem;
        padding: 0.65rem 0.8rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        border: 1px solid var(--border-color);
        border-radius: 10px;
        background: var(--input-bg);
        color: var(--text-primary);
        font-family: var(--font-heading);
        font-size: 0.88rem;
        font-weight: 700;
        cursor: pointer;
    }

    .mobile-filters-toggle > span {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
    }

    .mobile-filters-toggle svg {
        width: 1rem;
        height: 1rem;
    }

    .mobile-filters-chevron {
        transition: transform 0.2s ease;
    }

    .mobile-filters-toggle[aria-expanded="true"] .mobile-filters-chevron {
        transform: rotate(180deg);
    }

    .filters-container {
        display: none;
    }

    .filters-container.mobile-open {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.85rem 0.75rem;
        align-items: end;
        padding-top: 0.15rem;
    }

    .filters-container .filter-group,
    .filters-container .filter-group.compact-filter {
        width: 100%;
        min-width: 0;
        gap: 0.4rem;
    }

    .filters-container .filter-group.slider-group {
        grid-column: 1 / -1;
        min-width: 0;
        padding-top: 0.2rem;
    }

    .filters-container .filter-group.compact-filter:nth-child(5) {
        grid-column: 1 / -1;
    }

    .filter-group label,
    .slider-header span {
        font-size: 0.76rem;
    }

    .dropdown-trigger {
        min-height: 2.55rem;
        padding: 0.62rem 0.7rem;
        font-size: 0.82rem;
    }

    .section-header {
        align-items: stretch;
        gap: 0.8rem;
        margin-bottom: 1rem;
        padding: 0;
    }

    .library-tabs {
        width: 100%;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        margin: 0 0 1rem;
    }

    .library-tab {
        min-width: 0;
        padding-inline: 0.55rem;
    }

    .header-left {
        min-width: 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.15rem;
    }

    .section-header h3 {
        font-size: 1.25rem;
    }

    .results-count {
        font-size: 0.78rem;
    }

    .header-sort-container {
        min-width: 0;
        justify-content: flex-end;
    }

    .header-sort-container .sort-label {
        flex: 0 0 auto;
    }

    .compact-sort-dropdown {
        width: min(210px, 58vw);
    }

    .movies-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.8rem;
    }

    .movie-card {
        border-radius: 10px;
    }

    .card-info {
        padding: 0.72rem;
    }

    .card-title {
        font-size: 0.84rem;
    }

    .card-sub {
        font-size: 0.72rem;
    }

    .card-badges {
        top: 0.5rem;
        left: 0.5rem;
    }

    .card-badge {
        padding: 0.2rem 0.4rem;
        font-size: 0.68rem;
    }

    .card-seen-toggle {
        top: 0.5rem;
        right: 0.5rem;
        width: 2rem;
        height: 2rem;
    }

    .seen-ribbon,
    .deleted-ribbon,
    .watchlist-only-ribbon {
        right: 0.5rem;
        bottom: 0.5rem;
        padding: 0.25rem;
    }

    .seen-ribbon span,
    .deleted-ribbon span,
    .watchlist-only-ribbon span {
        display: none;
    }

    .modal {
        align-items: flex-end;
        padding: 0.5rem 0.5rem 0;
    }

    .modal-container {
        max-height: calc(100dvh - 0.5rem) !important;
        border-radius: 18px 18px 0 0;
    }

    #details-modal {
        align-items: stretch;
        padding: 0;
    }

    #details-modal .modal-container {
        height: 100dvh;
        max-height: 100dvh !important;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    #details-modal .modal-close {
        top: max(0.75rem, env(safe-area-inset-top));
        right: max(0.75rem, env(safe-area-inset-right));
    }

    .modal-close {
        top: 0.75rem;
        right: 0.75rem;
        width: 2.25rem;
        height: 2.25rem;
    }

    .movie-details-grid {
        grid-template-columns: 1fr !important;
        gap: 1.1rem !important;
        padding: 1rem !important;
    }

    .modal-poster {
        width: min(180px, 52vw);
        justify-self: center;
    }

    .modal-info {
        gap: 0.6rem !important;
    }

    .modal-title {
        padding-right: 2.4rem;
        font-size: 1.45rem !important;
    }

    .modal-actions {
        flex-direction: column;
        gap: 0.6rem !important;
    }

    .roulette-content {
        padding: 1.15rem 0.85rem 1.25rem;
        gap: 0.7rem;
    }

    .roulette-content h3 {
        padding: 0 2.4rem;
        font-size: 1.9rem;
    }

    .roulette-heading {
        gap: 0.3rem;
    }

    .roulette-heading p {
        max-width: 34ch;
        font-size: 0.78rem;
    }

    .roulette-wheel-container {
        height: 160px;
        margin: 0.35rem 0 0.1rem;
        border-radius: 17px;
    }

    .spinner-card {
        width: 88px;
        height: 132px;
        border-radius: 9px;
    }

    .roulette-spinner-track {
        gap: 9px;
    }

    .roulette-lights {
        left: 0.75rem;
        right: 0.75rem;
    }

    .roulette-result-stage {
        padding: 0.8rem;
        border-radius: 15px;
    }

    .roulette-result-kicker {
        margin-bottom: 0.55rem;
    }

    .roulette-winner-card {
        grid-template-columns: 82px minmax(0, 1fr);
        gap: 0.75rem;
        padding: 0.65rem;
    }

    .roulette-winner-poster {
        width: 82px;
    }

    .roulette-winner-info {
        gap: 0.3rem;
    }

    .roulette-winner-info > strong {
        font-size: 1.35rem;
    }

    .roulette-winner-plot {
        font-size: 0.72rem;
        -webkit-line-clamp: 2;
    }

    .roulette-details-hint,
    .roulette-winner-director {
        font-size: 0.69rem;
    }

    .roulette-result-actions .btn {
        width: 100%;
    }

    #add-movie-modal .modal-container > div {
        max-height: calc(100dvh - 0.5rem) !important;
        padding: 1rem !important;
    }
}

@media (max-width: 560px) {
    .library-tabs {
        gap: 0.2rem;
        padding: 0.25rem;
        border-radius: 10px;
    }

    .library-tab {
        gap: 0.3rem;
        padding-inline: 0.4rem;
        font-size: 0.76rem;
    }

    .library-tab svg {
        display: none;
    }

    .library-tab-count {
        min-width: 1.3rem;
        height: 1.3rem;
        padding-inline: 0.3rem;
        font-size: 0.63rem;
    }

    .discovery-layout .hero-content {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 96px;
        grid-template-rows: auto auto auto auto auto auto;
        align-items: start;
        column-gap: 0.8rem;
        row-gap: 0.55rem;
        padding: 1rem;
    }

    .discovery-layout .hero-details {
        display: contents;
    }

    .discovery-layout .featured-badge {
        grid-column: 1;
        grid-row: 1;
        max-width: 100%;
        padding: 0.25rem 0.45rem;
        font-size: 0.58rem;
        letter-spacing: 0.045em;
        white-space: nowrap;
    }

    .discovery-layout .hero-title {
        grid-column: 1;
        grid-row: 2;
        min-width: 0;
        font-size: 1.55rem;
        overflow-wrap: anywhere;
    }

    .discovery-layout .hero-meta {
        grid-column: 1;
        grid-row: 3;
        flex-wrap: wrap;
        gap: 0.35rem 0.5rem;
        font-size: 0.78rem;
        line-height: 1.25;
    }

    .discovery-layout .hero-ratings {
        grid-column: 1;
        grid-row: 4;
        width: 100%;
        min-width: 0;
        margin: 0 !important;
    }

    .discovery-layout .hero-poster-wrapper {
        grid-column: 2;
        grid-row: 1 / span 4;
        width: 96px;
        height: 144px;
        align-self: start;
        border-radius: 9px;
    }

    .discovery-layout .hero-plot {
        grid-column: 1 / -1;
        grid-row: 5;
        font-size: 0.86rem;
        line-height: 1.45;
        -webkit-line-clamp: 2;
    }

    .discovery-layout .hero-buttons {
        grid-column: 1 / -1;
        grid-row: 6;
        margin-top: 0.1rem;
    }

    .discovery-layout .hero-buttons .btn {
        width: 100%;
        min-height: 2.8rem;
    }

    .toolbar-search-row #add-movie-btn {
        width: 3rem;
        padding: 0;
    }

    .add-movie-label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .section-header {
        flex-direction: column;
    }

    .header-sort-container {
        width: 100%;
        justify-content: flex-start;
    }

    .compact-sort-dropdown {
        flex: 1;
        width: auto;
    }
}

@media (hover: none) and (pointer: coarse) {
    .movie-card:hover {
        transform: none;
    }

    .movie-card:hover .card-poster img {
        transform: none;
    }

    .movie-card:hover .card-overlay {
        opacity: 0;
    }

    .movie-card:hover .individual-ratings,
    .card-badges:hover .individual-ratings {
        max-height: 0;
        opacity: 0;
        pointer-events: none;
        margin: 0;
    }
}


/* ================================================================
   Height-aware scaling for short / low-DPI screens (e.g. MacBook Air)
   Gated behind min-width: 861px so these don't conflict with the
   existing phone breakpoints (max-width: 860px / 560px).
   zoom on .coop-game-content shrinks the entire Showdown subtree
   proportionally; structural trims reduce how much zoom is needed
   so text stays crisp on low-DPI displays.
   ================================================================ */

@media (max-height: 920px) and (min-width: 861px) {
    :root { --showdown-scale: 0.94; }
    .coop-game-content,
    .showdown-shell { min-height: min(720px, calc(100vh - 80px)); }
    .showdown-banner { margin-bottom: 0.7rem; }
}

@media (max-height: 820px) and (min-width: 861px) {
    :root { --showdown-scale: 0.90; }
    .coop-game-content,
    .showdown-shell { min-height: min(660px, calc(100vh - 74px)); }
    .showdown-shell { padding: 0.9rem; }
    .showdown-banner { margin-bottom: 0.5rem; }
    .showdown-topbar { margin-bottom: 0.3rem; }
    .showdown-actions { margin-top: 0.65rem; }
}

@media (max-height: 740px) and (min-width: 861px) {
    :root { --showdown-scale: 0.83; }
    .coop-game-content,
    .showdown-shell { min-height: min(580px, calc(100vh - 68px)); }
    .showdown-shell { padding: 0.75rem; }
    .showdown-banner { margin-bottom: 0.3rem; }
    .showdown-topbar { margin-bottom: 0.15rem; }
    .showdown-actions { margin-top: 0.45rem; }
    .modal { padding: 1rem; }
    .coop-game-container { max-height: calc(100vh - 20px); }
}

@media (max-height: 660px) and (min-width: 861px) {
    :root { --showdown-scale: 0.76; }
    .coop-game-content,
    .showdown-shell { min-height: min(500px, calc(100vh - 60px)); }
    .showdown-shell { padding: 0.65rem; }
    .showdown-banner { margin-bottom: 0.2rem; }
    .showdown-topbar { margin-bottom: 0.1rem; }
    .showdown-actions { margin-top: 0.3rem; }
    .modal { padding: 0.75rem; }
    .coop-game-container { max-height: calc(100vh - 16px); }
}

/* Watch tips */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.watch-tips-trigger-btn {
    position: relative;
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.watch-tips-trigger-btn:hover {
    color: var(--text-primary);
    border-color: var(--accent);
    background: rgba(139, 92, 246, 0.12);
    transform: translateY(-1px);
}

.watch-tips-trigger-btn svg {
    width: 1.15rem;
    height: 1.15rem;
}

.watch-tips-badge {
    position: absolute;
    top: -0.35rem;
    right: -0.35rem;
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 0.28rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-base);
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1;
}

.watch-tips-container {
    width: min(760px, 94vw) !important;
    max-width: 760px !important;
}

.send-tip-container {
    width: min(620px, 94vw) !important;
    max-width: 620px !important;
}

#send-tip-modal {
    z-index: 2100;
}

.watch-tips-shell,
.send-tip-form {
    max-height: min(82vh, 760px);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    overflow-y: auto;
}

.watch-tips-heading {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding-right: 2.5rem;
}

.watch-tips-heading-icon {
    width: 2.65rem;
    height: 2.65rem;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(139, 92, 246, 0.14);
    color: var(--accent);
}

.watch-tips-heading-icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.watch-tips-heading h3 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.35rem;
}

.watch-tips-heading p {
    margin: 0.2rem 0 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.watch-tips-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.watch-tips-empty {
    min-height: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
}

.watch-tips-empty > svg {
    width: 2.25rem;
    height: 2.25rem;
    color: var(--accent);
}

.watch-tips-empty h4,
.watch-tips-empty p {
    margin: 0;
}

.watch-tips-empty h4 {
    color: var(--text-primary);
    font-family: var(--font-heading);
}

.watch-tip-card {
    position: relative;
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 1rem;
    padding: 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.025);
}

.watch-tip-card.is-unread {
    border-color: rgba(139, 92, 246, 0.42);
    background: rgba(139, 92, 246, 0.07);
}

.watch-tip-card.is-unread::before {
    content: "";
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

.watch-tip-poster {
    width: 88px;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border-radius: 9px;
    background: var(--bg-elevated);
}

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

.watch-tip-poster-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.watch-tip-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.watch-tip-sender-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding-right: 0.8rem;
}

.watch-tip-sender-row img {
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 50%;
    object-fit: cover;
}

.watch-tip-sender-row div {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.watch-tip-sender-row strong {
    color: var(--text-primary);
    font-size: 0.78rem;
}

.watch-tip-sender-row span {
    color: var(--text-muted);
    font-size: 0.68rem;
}

.watch-tip-movie-copy h4 {
    margin: 0;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 1.05rem;
}

.watch-tip-movie-copy h4 span {
    color: var(--text-muted);
    font-weight: 500;
}

.watch-tip-movie-copy blockquote {
    margin: 0.4rem 0 0;
    padding-left: 0.65rem;
    border-left: 2px solid rgba(139, 92, 246, 0.45);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-style: italic;
    line-height: 1.45;
}

.watch-tip-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
}

.watch-tip-actions .btn {
    min-height: 2.25rem;
    padding: 0.4rem 0.7rem;
    font-size: 0.75rem;
}

.watch-tip-actions .btn:disabled {
    opacity: 0.7;
    cursor: default;
    transform: none;
}

.watch-tip-dismiss {
    width: 2.25rem;
    height: 2.25rem;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

.watch-tip-dismiss:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

.watch-tip-dismiss svg {
    width: 1rem;
    height: 1rem;
}

.send-tip-fieldset {
    margin: 0;
    padding: 0;
    border: 0;
}

.send-tip-fieldset legend,
.send-tip-message-label {
    margin-bottom: 0.55rem;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 700;
}

.send-tip-message-label span {
    margin-left: 0.3rem;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 500;
}

.send-tip-recipients {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
}

.send-tip-recipient {
    position: relative;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem;
    border: 1px solid var(--border-color);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.025);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.send-tip-recipient:hover,
.send-tip-recipient[aria-checked="true"] {
    border-color: rgba(139, 92, 246, 0.55);
    background: rgba(139, 92, 246, 0.09);
}

.send-tip-recipient:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.send-tip-recipient img {
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 auto;
    border-radius: 50%;
    object-fit: cover;
}

.send-tip-recipient > span {
    min-width: 0;
    display: flex;
    flex: 1;
    flex-direction: column;
}

.send-tip-recipient strong,
.send-tip-recipient small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.send-tip-recipient strong {
    color: var(--text-primary);
    font-size: 0.82rem;
}

.send-tip-recipient small {
    color: var(--text-muted);
    font-size: 0.68rem;
}

.send-tip-recipient > svg {
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
    padding: 0.15rem;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: transparent;
}

.send-tip-recipient[aria-checked="true"] > svg {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

#send-tip-message {
    width: 100%;
    min-height: 92px;
    resize: vertical;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    outline: none;
    background: var(--input-bg);
    color: var(--text-primary);
    font: inherit;
    line-height: 1.45;
}

#send-tip-message:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

.send-tip-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.send-tip-status {
    min-height: 1.2rem;
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.send-tip-status.is-error {
    color: #f87171;
}

.send-tip-status.is-success {
    color: #34d399;
}

@media (max-width: 720px) {
    .watch-tips-trigger-btn {
        width: 2.25rem;
        height: 2.25rem;
    }

    .watch-tips-shell,
    .send-tip-form {
        max-height: calc(100dvh - 0.5rem);
        padding: 1rem;
        gap: 1rem;
    }

    .watch-tip-card {
        grid-template-columns: 70px minmax(0, 1fr);
        gap: 0.75rem;
        padding: 0.7rem;
    }

    .watch-tip-poster {
        width: 70px;
    }

    .watch-tip-actions {
        flex-wrap: wrap;
    }

    .watch-tip-actions .watch-tip-save {
        order: -1;
        flex: 1 1 100%;
    }

    .send-tip-recipients {
        grid-template-columns: 1fr;
    }

    .send-tip-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .send-tip-footer .btn {
        width: 100%;
    }
}

/* ================================================================
   Progressive filter system
   ================================================================ */
.filter-context-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.viewing-context {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex: 0 0 auto;
}

.viewing-context-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}

.viewing-context-label svg {
    width: 0.95rem;
    height: 0.95rem;
    color: var(--accent);
}

.scope-dropdown { width: 155px; }
.scope-dropdown .dropdown-trigger {
    min-height: 2.55rem;
    padding: 0.62rem 0.75rem;
}

.filter-action-bar,
.quick-filter-list {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.filter-action-bar {
    flex: 1;
    justify-content: flex-end;
}

.filter-chip {
    min-height: 2.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.58rem 0.78rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--input-bg);
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 650;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.filter-chip:hover {
    border-color: color-mix(in srgb, var(--accent) 55%, var(--border-color));
    color: var(--text-primary);
    transform: translateY(-1px);
}

.filter-chip.active,
.all-filters-toggle[aria-expanded="true"] {
    border-color: color-mix(in srgb, var(--accent) 72%, transparent);
    background: color-mix(in srgb, var(--accent) 15%, var(--input-bg));
    color: var(--text-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 9%, transparent);
}

.filter-chip svg {
    width: 0.95rem;
    height: 0.95rem;
    flex: 0 0 auto;
}

.filter-chip-chevron {
    width: 0.8rem !important;
    height: 0.8rem !important;
    opacity: 0.7;
}

.filter-count-badge {
    min-width: 1.25rem;
    height: 1.25rem;
    display: inline-grid;
    place-items: center;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
}

.clear-filters-button,
.provider-filter-settings {
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 0.76rem;
    font-weight: 650;
    cursor: pointer;
    white-space: nowrap;
}

.clear-filters-button:hover,
.provider-filter-settings:hover { color: var(--accent); }

.active-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    padding-top: 0.1rem;
}

.active-filter-chip {
    min-height: 1.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.34rem 0.55rem 0.34rem 0.65rem;
    border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--border-color));
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 8%, transparent);
    color: var(--text-secondary);
    font: inherit;
    font-size: 0.72rem;
    font-weight: 650;
    cursor: pointer;
}

.active-filter-chip:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.active-filter-chip svg { width: 0.78rem; height: 0.78rem; }
.filter-panel-backdrop { display: none; }

.filter-panel {
    display: none;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: color-mix(in srgb, var(--bg-surface-solid) 94%, transparent);
    box-shadow: var(--shadow-md);
    overflow: visible;
}

.filter-panel.open {
    display: block;
    animation: filterPanelIn 180ms ease-out;
}

@keyframes filterPanelIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.filter-panel-header,
.filter-panel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
}

.filter-panel-header { border-bottom: 1px solid var(--border-color); }
.filter-panel-header h3 {
    margin: 0.08rem 0 0;
    font-family: var(--font-heading);
    font-size: 1.15rem;
}

.filter-panel-eyebrow {
    color: var(--accent);
    font-family: var(--font-heading);
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.filter-panel-close {
    width: 2.25rem;
    height: 2.25rem;
    display: grid;
    place-items: center;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    background: var(--input-bg);
    color: var(--text-secondary);
    cursor: pointer;
}
.filter-panel-close svg { width: 1rem; height: 1rem; }

.filter-sections {
    display: grid;
    grid-template-columns: minmax(210px, 0.82fr) minmax(360px, 1.35fr) minmax(270px, 1fr);
    gap: 0.85rem;
    padding: 0.9rem;
}

.filter-section {
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: color-mix(in srgb, var(--input-bg) 78%, transparent);
}

.filter-section-heading {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-bottom: 0.9rem;
    outline: none;
}

.filter-section-heading > svg {
    width: 1rem;
    height: 1rem;
    margin-top: 0.15rem;
    color: var(--accent);
    flex: 0 0 auto;
}

.filter-section-heading h4,
.provider-filter-heading h5 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 0.88rem;
}

.filter-section-heading p,
.provider-filter-heading p {
    margin: 0.16rem 0 0;
    color: var(--text-muted);
    font-size: 0.69rem;
    line-height: 1.35;
}

.filter-section-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.8rem;
}

.filter-panel .filter-group,
.filter-panel .filter-group.compact-filter,
.filter-panel .filter-group.slider-group {
    width: 100%;
    min-width: 0;
    flex: none;
}

.filter-panel .dropdown-trigger {
    min-height: 2.45rem;
    padding: 0.58rem 0.68rem;
    font-size: 0.79rem;
}

.filter-panel .dropdown-menu {
    max-height: 230px;
    overflow-y: auto;
}

.filter-details-grid { gap: 1rem; }
.filter-details-grid .slider-group { padding-top: 0.1rem; }

.streaming-mode-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
}

.streaming-mode-option {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    padding: 0.65rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
    text-align: left;
    cursor: pointer;
}

.streaming-mode-option:hover,
.streaming-mode-option.selected {
    border-color: color-mix(in srgb, var(--accent) 65%, var(--border-color));
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    color: var(--text-primary);
}

.streaming-mode-option > svg {
    width: 0.95rem;
    height: 0.95rem;
    margin-top: 0.04rem;
    color: var(--accent);
    flex: 0 0 auto;
}

.streaming-mode-option span {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.streaming-mode-option strong { font-size: 0.72rem; }
.streaming-mode-option small {
    color: var(--text-muted);
    font-size: 0.61rem;
    line-height: 1.3;
}

.provider-filter-block {
    margin-top: 0.9rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border-color);
}

.provider-filter-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}

.provider-filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
    max-height: 190px;
    overflow-y: auto;
    padding-right: 0.2rem;
}

.provider-filter-option {
    min-width: 0;
    min-height: 2.45rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 0.68rem;
    font-weight: 650;
    text-align: left;
    cursor: pointer;
}

.provider-filter-option:hover,
.provider-filter-option.selected {
    border-color: color-mix(in srgb, var(--accent) 68%, var(--border-color));
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--text-primary);
}
.provider-filter-option.saved:not(.selected) {
    border-color: color-mix(in srgb, var(--accent) 26%, var(--border-color));
}

.provider-filter-option img,
.provider-filter-fallback {
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 6px;
    object-fit: cover;
    flex: 0 0 auto;
}

.provider-filter-fallback {
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--accent) 22%, var(--input-bg));
    color: var(--text-primary);
    font-size: 0.7rem;
}

.provider-filter-option > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.provider-filter-empty {
    margin: 0;
    padding: 0.8rem;
    border: 1px dashed var(--border-color);
    border-radius: 9px;
    color: var(--text-muted);
    font-size: 0.72rem;
    text-align: center;
}

.filter-panel-footer {
    justify-content: flex-end;
    border-top: 1px solid var(--border-color);
}
.filter-panel-footer .btn {
    min-height: 2.45rem;
    padding: 0.58rem 0.9rem;
}

@media (max-width: 1120px) {
    .filter-context-row {
        align-items: flex-start;
        flex-direction: column;
    }
    .filter-action-bar {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    .filter-sections { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filter-section[data-filter-section="availability"] {
        grid-column: 1 / -1;
        grid-row: 1;
    }
}

@media (max-width: 720px) {
    .filter-context-row { gap: 0.75rem; }
    .viewing-context {
        width: 100%;
        justify-content: space-between;
    }
    .scope-dropdown { width: min(180px, 52vw); }
    .filter-action-bar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.55rem;
    }
    .quick-filter-list { display: none; }
    .all-filters-toggle {
        width: 100%;
        border-radius: 10px;
    }
    .clear-filters-button {
        min-height: 2.55rem;
        padding: 0 0.45rem;
    }
    .active-filter-chips {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.2rem;
        scrollbar-width: none;
    }
    .active-filter-chips::-webkit-scrollbar { display: none; }
    .active-filter-chip { flex: 0 0 auto; }
    .filter-panel { border-radius: 12px; }
    .filter-panel-header,
    .filter-panel-footer { padding: 0.9rem; }
    .filter-sections {
        grid-template-columns: 1fr;
        padding: 0.7rem;
    }
    .filter-section[data-filter-section="availability"] {
        grid-column: auto;
        grid-row: auto;
    }
    .streaming-mode-options { grid-template-columns: 1fr; }
    .streaming-mode-option { align-items: center; }
    .provider-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: 240px;
    }
    .filter-panel-footer {
        position: sticky;
        bottom: 0;
        z-index: 3;
        background: var(--bg-surface-solid);
    }
    .filter-panel-footer .btn { flex: 1; }
}

@media (max-width: 420px) {
    .provider-filter-heading { flex-direction: column; }
    .provider-filter-settings { padding: 0; }
}

/* Crew profiles */
.crew-panel-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    flex-wrap: wrap;
}

.crew-member-profile-list {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.crew-member-profile-btn {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.55rem 0.25rem 0.25rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--input-bg);
    color: var(--text-secondary);
    font: inherit;
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.crew-member-profile-btn:hover,
.crew-member-profile-btn:focus-visible {
    border-color: var(--accent);
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.12);
    outline: none;
    transform: translateY(-1px);
}

.crew-member-profile-btn img {
    width: 1.65rem;
    height: 1.65rem;
    flex: 0 0 auto;
    border-radius: 50%;
    object-fit: cover;
}

.crew-member-profile-btn span {
    max-width: 7.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#user-profile-modal {
    z-index: 2150;
}

.user-profile-container {
    width: min(900px, 95vw) !important;
    max-width: 900px !important;
    max-height: min(92vh, 900px) !important;
}

.user-profile-content {
    min-height: 360px;
    padding-bottom: 1.75rem;
}

.user-profile-hero {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1.15rem;
    padding: 2rem 4rem 1.75rem 2rem;
    overflow: hidden;
    border-bottom: 1px solid var(--border-color);
    background:
        radial-gradient(circle at 12% 20%, rgba(139, 92, 246, 0.24), transparent 40%),
        linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(59, 130, 246, 0.04));
}

.user-profile-avatar {
    width: 5.25rem;
    height: 5.25rem;
    flex: 0 0 auto;
    border: 3px solid rgba(255, 255, 255, 0.72);
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.32);
}

.user-profile-heading-copy {
    min-width: 0;
}

.user-profile-eyebrow,
.user-profile-section-heading span {
    display: block;
    margin-bottom: 0.22rem;
    color: var(--accent);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.user-profile-heading-copy h2 {
    margin: 0;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: clamp(1.6rem, 4vw, 2.35rem);
    line-height: 1.08;
}

.user-profile-heading-copy p {
    margin: 0.45rem 0 0;
    color: var(--text-secondary);
    font-size: 0.86rem;
}

.user-profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.7rem;
    margin: 1.25rem 1.75rem 0;
}

.user-profile-stats > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.12rem;
    min-height: 76px;
    padding: 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.025);
}

.user-profile-stats strong {
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 1.4rem;
}

.user-profile-stats span {
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.user-profile-crews {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0.85rem 1.75rem 0;
}

.user-profile-crews span {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    padding: 0.38rem 0.62rem;
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.1);
    color: var(--text-secondary);
    font-size: 0.74rem;
}

.user-profile-crews svg {
    width: 0.85rem;
    height: 0.85rem;
    color: var(--accent);
}

.user-profile-section {
    margin: 1.55rem 1.75rem 0;
}

.user-profile-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.7rem;
}

.user-profile-section-heading h3 {
    margin: 0;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 1.18rem;
}

.user-profile-section-heading > strong {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.user-profile-movie-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.62rem;
}

.user-profile-movie-card {
    position: relative;
    min-width: 0;
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.7rem;
    min-height: 78px;
    padding: 0.55rem 0.65rem 0.55rem 0.55rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
}

.user-profile-movie-poster {
    width: 54px;
    height: 72px;
    overflow: hidden;
    border-radius: 7px;
    background: var(--input-bg);
}

.user-profile-movie-poster > img,
.user-profile-movie-poster > .poster-placeholder {
    width: 100%;
    height: 100%;
}

.user-profile-movie-poster > img {
    display: block;
    object-fit: cover;
}

.user-profile-movie-poster .poster-placeholder svg {
    width: 1.1rem;
    height: 1.1rem;
}

.user-profile-movie-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.user-profile-movie-copy strong {
    overflow: hidden;
    color: var(--text-primary);
    font-size: 0.83rem;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-profile-movie-copy span {
    overflow: hidden;
    color: var(--text-muted);
    font-size: 0.68rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-profile-rating {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    color: #fbbf24;
    font-size: 0.72rem;
    font-weight: 700;
}

.user-profile-rating svg {
    width: 0.8rem;
    height: 0.8rem;
    fill: currentColor;
}

.user-profile-empty {
    min-height: 92px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 1rem;
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.user-profile-empty svg {
    width: 1rem;
    height: 1rem;
}

.user-profile-loading,
.user-profile-error {
    min-height: 360px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    color: var(--text-secondary);
    text-align: center;
}

.user-profile-error > svg {
    width: 2.4rem;
    height: 2.4rem;
    color: var(--accent);
}

.user-profile-error h2,
.user-profile-error p {
    margin: 0;
}

.user-profile-error h2 {
    color: var(--text-primary);
    font-family: var(--font-heading);
}

@media (max-width: 680px) {
    .crew-panel-card {
        align-items: flex-start;
    }

    .crew-member-profile-list {
        width: 100%;
        order: 3;
    }

    .user-profile-container {
        max-height: calc(100vh - 1rem) !important;
        border-radius: 16px;
    }

    .user-profile-hero {
        align-items: flex-start;
        gap: 0.85rem;
        padding: 1.35rem 3.2rem 1.25rem 1rem;
    }

    .user-profile-avatar {
        width: 4rem;
        height: 4rem;
    }

    .user-profile-stats {
        gap: 0.4rem;
        margin: 0.85rem 0.85rem 0;
    }

    .user-profile-stats > div {
        min-height: 65px;
        padding: 0.45rem;
    }

    .user-profile-crews,
    .user-profile-section {
        margin-left: 0.85rem;
        margin-right: 0.85rem;
    }

    .user-profile-movie-grid {
        grid-template-columns: 1fr;
    }
}
/* Personal WTW ratings and Letterboxd conflict resolution */
.settings-select {
    width: 100%;
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-bg, rgba(255, 255, 255, 0.04));
    color: var(--text-primary);
    font: inherit;
}

.settings-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.rating-preference-help {
    margin-top: 0.45rem;
}

.card-badge.wtw {
    border-color: rgba(139, 92, 246, 0.45);
    background: rgba(139, 92, 246, 0.16);
    color: #c4b5fd;
}

.personal-rating-panel,
.crew-ratings-row {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
}

.personal-rating-heading,
.rating-conflict-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.personal-rating-heading > div,
.rating-conflict-notice > div:first-child {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
}

.personal-rating-heading strong,
.rating-conflict-notice strong,
.crew-ratings-label {
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 800;
}

.personal-rating-heading span,
.rating-conflict-notice span,
.rating-empty-copy {
    color: var(--text-muted);
    font-size: 0.74rem;
}

.personal-rating-link {
    flex-shrink: 0;
    margin: 0;
    text-decoration: none;
}

.personal-rating-form,
.personal-rating-sources,
.rating-conflict-actions,
.crew-ratings-list {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.star-rating-control {
    --star-size: 1.55rem;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.star-rating-hit-area {
    --star-hit-padding: 0.35rem;
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    padding: var(--star-hit-padding) 0;
}

.star-rating-stars {
    position: relative;
    display: inline-flex;
    gap: 0.08em;
    color: rgba(148, 163, 184, 0.4);
    font-size: var(--star-size);
    white-space: nowrap;
    user-select: none;
}

.star-rating-star {
    position: relative;
    display: block;
    width: var(--star-size);
    height: var(--star-size);
    flex: 0 0 auto;
}

.star-rating-base {
    display: block;
    width: 100%;
    height: 100%;
}

.star-rating-icon {
    display: block;
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.star-rating-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0;
    overflow: hidden;
    color: #fbbf24;
    transition: width 100ms ease-out;
}

.star-rating-fill .star-rating-icon {
    width: var(--star-size);
    max-width: none;
}

.star-rating-option {
    position: absolute;
    z-index: 1;
    top: calc(0px - var(--star-hit-padding));
    bottom: calc(0px - var(--star-hit-padding));
    left: calc(var(--star-half) * 50%);
    width: 50%;
    height: auto;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.star-rating-hit-area:has(.star-rating-option:focus-visible) .star-rating-stars {
    border-radius: 4px;
    outline: 3px solid var(--accent-glow);
    outline-offset: 3px;
}

.star-rating-option:disabled {
    cursor: wait;
}

.star-rating-clear {
    display: inline-grid;
    width: 1.35rem;
    height: 1.35rem;
    flex: 0 0 auto;
    place-items: center;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font: inherit;
    font-size: 1rem;
    line-height: 1;
}

.star-rating-clear:hover,
.star-rating-clear:focus-visible {
    border-color: var(--border-color);
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-primary);
    outline: none;
}

.star-rating-clear[hidden] {
    display: inline-grid;
    visibility: hidden;
    pointer-events: none;
}

.star-rating-value {
    min-width: 4.4rem;
    color: var(--text-secondary);
    font-size: 0.74rem;
    font-weight: 700;
    white-space: nowrap;
}

.star-rating-control[data-value=""] .star-rating-value {
    color: var(--text-muted);
    font-weight: 600;
}

.personal-rating-form .star-rating-control {
    flex: 1;
}

:root.light-theme .star-rating-stars {
    color: rgba(100, 116, 139, 0.42);
}

.personal-rating-source {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.55rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--text-secondary);
    font-size: 0.72rem;
}

.personal-rating-source.wtw {
    border-color: rgba(139, 92, 246, 0.35);
    background: rgba(139, 92, 246, 0.08);
}

.personal-rating-source.letterboxd {
    border-color: rgba(0, 224, 84, 0.3);
    background: rgba(0, 224, 84, 0.06);
}

.rating-conflict-notice {
    padding: 0.55rem 0.65rem;
    border: 1px solid rgba(245, 158, 11, 0.32);
    border-radius: 9px;
    background: rgba(245, 158, 11, 0.07);
}

.rating-conflict-actions .is-active {
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.personal-rating-status {
    display: none;
    margin: 0;
    color: #34d399;
    font-size: 0.74rem;
    font-weight: 600;
}

.personal-rating-status.is-visible {
    display: block;
}

.personal-rating-status.is-error {
    color: #f87171;
}

.crew-ratings-row {
    margin-top: 0.5rem;
}

.crew-ratings-list .user-rating-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.55rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 600;
}

.crew-ratings-list .user-rating-item img {
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 50%;
    object-fit: cover;
}

.user-rating-stars {
    color: #00e054;
    font-weight: 700;
}

.user-rating-source-label {
    color: var(--text-muted);
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
}

:root.light-theme .personal-rating-panel,
:root.light-theme .crew-ratings-row,
:root.light-theme .crew-ratings-list .user-rating-item {
    background: rgba(0, 0, 0, 0.02);
}

@media (max-width: 620px) {
    .personal-rating-heading,
    .rating-conflict-notice {
        align-items: flex-start;
        flex-direction: column;
    }

    .personal-rating-form,
    .personal-rating-form .star-rating-control {
        width: 100%;
    }
}

/* --- Discover (Recommendations) --- */
.btn-discover {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-discover:hover {
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

#discover-modal .discover-container {
    width: 100vw;
    max-width: none !important;
    height: 100dvh;
    min-height: 100dvh;
    max-height: none !important;
    overflow: hidden !important;
    border: 0;
    border-radius: 0;
    background: var(--bg-surface-solid);
    box-shadow: none;
    display: flex;
    animation: discoverWorkspaceIn 0.2s ease-out;
}

body.discover-open {
    overflow: hidden;
}

#discover-modal {
    align-items: stretch;
    padding: 0;
    background: var(--bg-surface-solid);
}

#discover-modal .modal-overlay {
    display: none;
}

#discover-modal .modal-close {
    position: fixed;
    top: max(1.25rem, env(safe-area-inset-top));
    right: max(1.5rem, env(safe-area-inset-right));
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
}

.discover-content {
    width: 100%;
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.discover-header {
    flex: 0 0 auto;
    padding: max(0.9rem, env(safe-area-inset-top)) max(5rem, calc((100vw - 1760px) / 2)) 0.85rem max(1.25rem, calc((100vw - 1760px) / 2));
    border-bottom: 1px solid var(--border-color);
    background: rgba(18, 20, 25, 0.92);
    backdrop-filter: blur(18px);
    z-index: 2;
}

.light-theme .discover-header {
    background: rgba(255, 255, 255, 0.94);
}

.discover-header-inner {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    max-width: 1760px;
    margin: 0 auto;
}

.discover-heading {
    min-width: 0;
}

.discover-heading h3 {
    margin: 0.2rem 0 0.15rem;
    font-family: var(--font-heading);
    font-size: clamp(1.55rem, 2.4vw, 1.95rem);
    line-height: 1;
}

.discover-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #34d399;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.discover-eyebrow svg {
    width: 0.85rem;
    height: 0.85rem;
}

.discover-subtitle {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.45;
}

.discover-scope-control {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

#discover-scope-select {
    min-width: 155px;
    padding: 0.58rem 2.1rem 0.58rem 0.75rem;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 9px;
    color: var(--text-primary);
    font: inherit;
    font-size: 0.86rem;
    cursor: pointer;
}

#discover-scope-select:focus-visible,
.discover-shelf-tab:focus-visible,
.discover-dismiss-btn:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.discover-shelf-tabs {
    display: none;
}

.discover-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    overscroll-behavior: contain;
    padding: 0.85rem max(1.25rem, calc((100vw - 1760px) / 2)) max(0.9rem, env(safe-area-inset-bottom));
}

.discover-message {
    min-height: 50vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 3rem 1rem;
    color: var(--text-secondary);
    text-align: center;
}

.discover-fallback {
    width: 100%;
    max-width: 1760px;
    margin: 0 auto 0.75rem;
    padding: 0.65rem 0.85rem;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.discover-shelves {
    width: 100%;
    max-width: 1760px;
    min-height: 0;
    flex: 1 1 auto;
    margin: 0 auto;
    display: grid;
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.discover-shelves[data-shelf-count="1"] {
    grid-template-rows: minmax(0, 1fr);
}

.discover-shelf {
    width: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.discover-shelf-header {
    min-height: 2rem;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.4rem;
}

.discover-shelf-heading {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
}

.discover-shelf-title-line {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.discover-shelf-header h4 {
    font-family: var(--font-heading);
    font-size: 1.02rem;
    line-height: 1.1;
}

.discover-shelf-subtitle {
    min-width: 0;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 0.74rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.discover-shelf-count {
    min-width: 1.45rem;
    padding: 0.1rem 0.38rem;
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.1);
    color: var(--text-secondary);
    font-size: 0.64rem;
    font-weight: 800;
    line-height: 1.15;
    text-align: center;
}

.discover-shelf-nav {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.discover-shelf-scroll {
    width: 1.85rem;
    height: 1.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.discover-shelf-scroll:hover:not(:disabled),
.discover-shelf-scroll:focus-visible {
    border-color: rgba(139, 92, 246, 0.55);
    background: rgba(139, 92, 246, 0.12);
    color: var(--text-primary);
}

.discover-shelf-scroll:disabled {
    opacity: 0.3;
    cursor: default;
}

.discover-shelf-scroll svg {
    width: 0.95rem;
    height: 0.95rem;
}

.discover-shelf-row {
    min-height: 0;
    flex: 1 1 auto;
    display: flex;
    align-items: stretch;
    gap: 0.8rem;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.1rem 0.15rem 0.65rem;
    scroll-padding-inline: 0.15rem;
    scroll-snap-type: x proximity;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.72) rgba(255, 255, 255, 0.06);
}

.discover-shelf-row:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: -2px;
    border-radius: 10px;
}

.discover-shelf-row::-webkit-scrollbar {
    height: 10px;
}

.discover-shelf-row::-webkit-scrollbar-track {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
}

.discover-shelf-row::-webkit-scrollbar-thumb {
    min-width: 44px;
    border: 2px solid var(--bg-surface-solid);
    border-radius: 999px;
    background: linear-gradient(90deg, #8b5cf6, #06b6d4);
}

.discover-shelf-row::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, #a78bfa, #22d3ee);
}

:root.light-theme .discover-shelf-row {
    scrollbar-color: rgba(109, 40, 217, 0.72) rgba(15, 23, 42, 0.08);
}

:root.light-theme .discover-shelf-row::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.08);
}

:root.light-theme .discover-shelf-row::-webkit-scrollbar-thumb {
    border-color: var(--bg-surface-solid);
    background: linear-gradient(90deg, #7c3aed, #0891b2);
}

.discover-card {
    width: clamp(154px, 10vw, 188px);
    min-width: clamp(154px, 10vw, 188px);
    height: 100%;
    min-height: 0;
    flex: 0 0 clamp(154px, 10vw, 188px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--border-color);
    border-radius: 13px;
    scroll-snap-align: start;
    transition: var(--transition-smooth);
}

.discover-card:hover {
    transform: translateY(-2px);
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
}

.discover-poster {
    position: relative;
    height: auto;
    min-height: 0;
    flex: 0 0 58%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
    transition: flex-basis 0.2s ease;
}

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

.discover-poster-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.discover-library-badge {
    position: absolute;
    bottom: 0.45rem;
    left: 0.45rem;
    padding: 0.18rem 0.42rem;
    border-radius: 5px;
    background: rgba(16, 185, 129, 0.92);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.discover-dismiss-btn {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    width: 1.8rem;
    height: 1.8rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.66);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.82;
    transition: var(--transition-smooth);
}

.discover-dismiss-btn:hover,
.discover-dismiss-btn:focus-visible {
    opacity: 1;
    background: rgba(0, 0, 0, 0.85);
    transform: scale(1.06);
}

.discover-dismiss-btn svg {
    width: 0.9rem;
    height: 0.9rem;
}

.discover-card-body {
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden;
    padding: 0.5rem 0.58rem 0.55rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.discover-title {
    min-width: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 0.8rem;
    line-height: 1.22;
}

.discover-title span {
    color: var(--text-muted);
    font-weight: 400;
}

.discover-meta {
    overflow: hidden;
    color: var(--text-secondary);
    font-size: 0.66rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.discover-because {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    color: var(--text-muted);
    font-size: 0.64rem;
    line-height: 1.28;
}

.discover-because strong {
    color: var(--text-secondary);
}

.discover-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.32rem;
    margin-top: auto;
    padding-top: 0.3rem;
}

.discover-card-actions .btn {
    min-width: 0;
    padding: 0.36rem 0.28rem;
    gap: 0.25rem;
    font-size: 0.66rem;
}

.discover-card-actions svg {
    width: 0.82rem;
    height: 0.82rem;
    flex: 0 0 auto;
}

.discover-seen-panel {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    margin-top: auto;
    padding-top: 0.35rem;
    border-top: 1px solid var(--border-color);
}

.discover-seen-panel > strong {
    color: var(--text-primary);
    font-size: 0.69rem;
}

.discover-seen-help {
    color: var(--text-muted);
    display: none;
    font-size: 0.62rem;
    line-height: 1.25;
}

.discover-sentiment-options,
.discover-seen-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.3rem;
}

.discover-sentiment-btn {
    padding: 0.32rem 0.25rem;
    border: 1px solid var(--border-color);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    cursor: pointer;
    font: inherit;
    font-size: 0.65rem;
    font-weight: 700;
}

.discover-sentiment-btn[data-sentiment="up"].is-selected {
    border-color: rgba(16, 185, 129, 0.65);
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
}

.discover-sentiment-btn[data-sentiment="down"].is-selected {
    border-color: rgba(248, 113, 113, 0.65);
    background: rgba(248, 113, 113, 0.12);
    color: #fca5a5;
}

.discover-seen-panel .star-rating-control {
    --star-size: 1.05rem;
    width: 100%;
    min-width: 0;
    justify-content: space-between;
    gap: 0.3rem;
}

.discover-seen-panel .star-rating-hit-area {
    padding: 0.26rem 0;
}

.discover-seen-panel .star-rating-value {
    min-width: 2.7rem;
    font-size: 0.6rem;
    text-align: right;
}

.discover-seen-actions .btn {
    padding: 0.32rem 0.3rem;
    font-size: 0.64rem;
}

.discover-seen-status {
    min-height: 0.55rem;
    margin: 0;
    color: #6ee7b7;
    font-size: 0.6rem;
}

.discover-card.is-seen-editing .discover-poster {
    flex-basis: 42%;
}

.discover-card.is-seen-editing .discover-meta,
.discover-card.is-seen-editing .discover-because {
    display: none;
}

.discover-seen-status.is-error {
    color: #fca5a5;
}

@keyframes discoverWorkspaceIn {
    from { opacity: 0; transform: scale(0.995); }
    to { opacity: 1; transform: scale(1); }
}

@media (max-width: 780px) {
    #discover-modal .modal-close {
        top: max(0.8rem, env(safe-area-inset-top));
        right: max(0.8rem, env(safe-area-inset-right));
        width: 2.3rem;
        height: 2.3rem;
    }

    .discover-header {
        padding: max(0.85rem, env(safe-area-inset-top)) 3.75rem 0.85rem 1rem;
    }

    .discover-header-inner {
        display: grid;
        gap: 0.75rem;
    }

    .discover-heading h3 {
        font-size: 1.55rem;
    }

    .discover-eyebrow {
        font-size: 0.64rem;
    }

    .discover-subtitle {
        font-size: 0.78rem;
    }

    .discover-scope-control {
        justify-content: space-between;
        gap: 0.5rem;
    }

    #discover-scope-select {
        min-width: 0;
        max-width: 62vw;
        padding-block: 0.48rem;
    }

    .discover-shelf-tabs {
        flex: 0 0 auto;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.4rem;
        padding: 0.55rem 1rem;
        border-bottom: 1px solid var(--border-color);
        background: var(--bg-surface-solid);
    }

    .discover-shelf-tabs.hidden {
        display: none;
    }

    .discover-shelf-tab {
        min-width: 0;
        padding: 0.58rem 0.65rem;
        border: 1px solid transparent;
        border-radius: 9px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.38rem;
        background: transparent;
        color: var(--text-muted);
        cursor: pointer;
        font: inherit;
        font-size: 0.76rem;
        font-weight: 750;
    }

    .discover-shelf-tab svg {
        width: 0.9rem;
        height: 0.9rem;
    }

    .discover-shelf-tab.is-active {
        border-color: rgba(139, 92, 246, 0.28);
        background: rgba(139, 92, 246, 0.12);
        color: var(--text-primary);
    }

    .discover-tab-count {
        min-width: 1.25rem;
        padding: 0.06rem 0.3rem;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.07);
        color: var(--text-secondary);
        font-size: 0.65rem;
        text-align: center;
    }

    .discover-body {
        display: block;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 1rem max(0.8rem, env(safe-area-inset-right)) max(1.5rem, env(safe-area-inset-bottom)) max(0.8rem, env(safe-area-inset-left));
        scrollbar-gutter: auto;
        scrollbar-width: thin;
        scrollbar-color: rgba(139, 92, 246, 0.72) rgba(255, 255, 255, 0.06);
    }

    .discover-body::-webkit-scrollbar {
        width: 8px;
    }

    .discover-body::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.05);
    }

    .discover-body::-webkit-scrollbar-thumb {
        border: 2px solid var(--bg-surface-solid);
        border-radius: 999px;
        background: linear-gradient(180deg, #8b5cf6, #06b6d4);
    }

    :root.light-theme .discover-body {
        scrollbar-color: rgba(109, 40, 217, 0.72) rgba(15, 23, 42, 0.08);
    }

    :root.light-theme .discover-body::-webkit-scrollbar-track {
        background: rgba(15, 23, 42, 0.08);
    }

    .discover-shelves {
        min-height: auto;
        display: block;
    }

    .discover-shelf {
        min-height: auto;
        display: block;
        overflow: visible;
    }

    .discover-shelf.is-mobile-hidden {
        display: none;
    }

    .discover-shelf-header {
        min-height: 0;
        display: block;
        margin-bottom: 0.7rem;
    }

    .discover-shelf-heading {
        display: block;
    }

    .discover-shelf-title-line {
        margin-bottom: 0.25rem;
    }

    .discover-shelf-nav {
        display: none;
    }

    .discover-shelf-header h4 {
        font-size: 1rem;
    }

    .discover-shelf-subtitle {
        display: block;
        width: 100%;
        font-size: 0.72rem;
        white-space: normal;
    }

    .discover-shelf-row {
        min-height: auto;
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.75rem;
        overflow: visible;
        padding: 0;
        scroll-snap-type: none;
        scrollbar-width: none;
    }

    .discover-shelf-row:focus-visible {
        outline-offset: 2px;
    }

    .discover-card {
        width: 100%;
        min-width: 0;
        height: auto;
        min-height: 0;
        flex: none;
        display: grid;
        grid-template-columns: 108px minmax(0, 1fr);
        align-items: start;
    }

    .discover-card:hover {
        transform: none;
        box-shadow: none;
    }

    .discover-poster {
        width: 108px;
        height: auto;
        min-height: 0;
        aspect-ratio: 2 / 3;
        flex: none;
        align-self: start;
    }

    .discover-card-body {
        min-height: 162px;
        overflow: visible;
        padding: 0.65rem;
        gap: 0.38rem;
    }

    .discover-title {
        font-size: 0.84rem;
    }

    .discover-meta {
        font-size: 0.71rem;
    }

    .discover-because {
        -webkit-line-clamp: 2;
        font-size: 0.7rem;
        line-height: 1.35;
    }

    .discover-card-actions {
        gap: 0.4rem;
    }

    .discover-card-actions .btn {
        padding: 0.44rem 0.35rem;
        font-size: 0.71rem;
    }

    .discover-card.is-seen-editing .discover-poster {
        flex: none;
    }

    .discover-seen-panel {
        gap: 0.5rem;
        padding-top: 0.6rem;
    }

    .discover-seen-panel > strong {
        font-size: 0.76rem;
    }

    .discover-seen-help {
        display: block;
        font-size: 0.65rem;
        line-height: 1.35;
    }

    .discover-sentiment-options,
    .discover-seen-actions {
        gap: 0.4rem;
    }

    .discover-sentiment-btn {
        padding: 0.42rem 0.3rem;
        font-size: 0.7rem;
    }

    .discover-seen-panel .star-rating-control {
        --star-size: 1.2rem;
    }

    .discover-seen-panel .star-rating-hit-area {
        padding: 0.36rem 0;
    }

    .discover-seen-panel .star-rating-value {
        font-size: 0.65rem;
    }

    .discover-seen-actions .btn {
        padding: 0.42rem 0.35rem;
        font-size: 0.68rem;
    }

    .discover-seen-status {
        min-height: 0.8rem;
        font-size: 0.65rem;
    }

    .discover-dismiss-btn {
        opacity: 1;
    }
}

@media (min-width: 781px) and (max-height: 800px) {
    .discover-header {
        padding-top: max(0.65rem, env(safe-area-inset-top));
        padding-bottom: 0.65rem;
    }

    .discover-heading h3 {
        font-size: 1.6rem;
    }

    .discover-body {
        padding-top: 0.6rem;
        padding-bottom: max(0.65rem, env(safe-area-inset-bottom));
    }

    .discover-shelves {
        gap: 0.65rem;
    }

    .discover-shelf-header {
        min-height: 1.75rem;
        margin-bottom: 0.25rem;
    }

    .discover-card {
        width: clamp(146px, 9.5vw, 174px);
        min-width: clamp(146px, 9.5vw, 174px);
        flex-basis: clamp(146px, 9.5vw, 174px);
    }

    .discover-because {
        -webkit-line-clamp: 1;
    }

    .discover-card.is-seen-editing .discover-poster {
        flex-basis: 38%;
    }
}

@media (min-width: 781px) and (max-height: 700px) {
    .discover-header-inner {
        align-items: center;
    }

    .discover-eyebrow,
    .discover-subtitle {
        display: none;
    }

    .discover-heading h3 {
        margin: 0;
        font-size: 1.45rem;
    }

    .discover-header {
        padding-top: max(0.5rem, env(safe-area-inset-top));
        padding-bottom: 0.5rem;
    }

    .discover-body {
        padding-top: 0.45rem;
        padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
    }

    .discover-shelves {
        gap: 0.45rem;
    }

    .discover-shelf-header {
        min-height: 1.55rem;
        margin-bottom: 0.2rem;
    }

    .discover-shelf-header h4 {
        font-size: 0.9rem;
    }

    .discover-shelf-subtitle {
        font-size: 0.66rem;
    }

    .discover-shelf-scroll {
        width: 1.55rem;
        height: 1.55rem;
    }

    .discover-because {
        display: none;
    }
}

@media (max-width: 380px) {
    .discover-scope-control > span {
        font-size: 0;
    }

    .discover-scope-control > span::after {
        content: "For";
        font-size: 0.72rem;
    }

    .discover-card {
        grid-template-columns: 96px minmax(0, 1fr);
    }

    .discover-poster {
        width: 96px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .discover-container,
    .discover-card,
    .discover-poster,
    .discover-shelf-scroll {
        animation: none;
        transition: none;
    }
}

/* Searchable friend discovery and profile privacy */
.handle-input-wrap {
    position: relative;
    width: 100%;
}

.handle-input-wrap > span {
    position: absolute;
    z-index: 1;
    left: 0.9rem;
    top: 50%;
    color: var(--text-muted);
    font-size: 0.85rem;
    transform: translateY(-50%);
    pointer-events: none;
}

.form-group .handle-input-wrap input { padding-left: 1.75rem; }

.friend-visibility-setting {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
}

.friend-visibility-copy {
    min-width: 0;
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.12rem;
}

.friend-visibility-copy strong {
    color: var(--text-primary);
    font-size: 0.78rem;
}

.friend-visibility-copy small {
    color: var(--text-muted);
    font-size: 0.65rem;
    line-height: 1.35;
}

.friend-visibility-setting > input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.friend-visibility-switch {
    position: relative;
    width: 2.35rem;
    height: 1.3rem;
    flex: 0 0 auto;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--input-bg);
    transition: var(--transition-smooth);
}

.friend-visibility-switch::after {
    content: "";
    position: absolute;
    left: 0.17rem;
    top: 0.16rem;
    width: 0.84rem;
    height: 0.84rem;
    border-radius: 50%;
    background: var(--text-muted);
    transition: var(--transition-smooth);
}

.friend-visibility-setting > input:checked + .friend-visibility-switch {
    border-color: rgba(139, 92, 246, 0.55);
    background: var(--accent);
}

.friend-visibility-setting > input:checked + .friend-visibility-switch::after {
    left: 1.18rem;
    background: #fff;
}

.friend-visibility-setting:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.11);
}

.friend-discovery-panel {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.85rem;
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 16px;
    background:
        radial-gradient(circle at 5% 10%, rgba(139, 92, 246, 0.14), transparent 36%),
        linear-gradient(135deg, rgba(139, 92, 246, 0.045), rgba(59, 130, 246, 0.025));
}

.settings-tab-content.friends-settings-tab { gap: 0.9rem; }

.friend-discovery-heading {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.friend-discovery-heading > div:last-child { min-width: 0; }

.friend-discovery-heading h4 {
    margin: 0.06rem 0 0;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 0.92rem;
}

.friend-discovery-heading p {
    margin: 0.15rem 0 0;
    color: var(--text-muted);
    font-size: 0.63rem;
}

.friend-global-search {
    position: relative;
    display: flex;
    align-items: center;
}

.friend-global-search > svg {
    position: absolute;
    z-index: 1;
    left: 0.8rem;
    width: 1rem;
    height: 1rem;
    color: var(--text-muted);
    pointer-events: none;
}

.friend-global-search input {
    width: 100%;
    min-height: 2.65rem;
    padding: 0.65rem 2.5rem 0.65rem 2.35rem;
    border: 1px solid var(--border-color);
    border-radius: 11px;
    background: color-mix(in srgb, var(--input-bg) 92%, transparent);
    color: var(--text-primary);
    font: inherit;
    font-size: 0.78rem;
}

.friend-global-search input:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

.friend-global-search input::-webkit-search-cancel-button { appearance: none; }

.friend-search-clear {
    position: absolute;
    right: 0.55rem;
    width: 1.8rem;
    height: 1.8rem;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

.friend-search-clear:hover { background: rgba(255, 255, 255, 0.05); color: var(--text-primary); }
.friend-search-clear svg { width: 0.85rem; height: 0.85rem; }

.friend-search-status {
    min-height: 0.85rem;
    margin: 0;
    color: var(--text-muted);
    font-size: 0.61rem;
    line-height: 1.35;
}

.friend-search-status.is-error { color: #f87171; }
.friend-search-status.is-success { color: #4ade80; }

.friend-search-results {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 205px;
    overflow-y: auto;
    padding-right: 0.18rem;
}

.friend-search-result {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.62rem;
    padding: 0.55rem 0.62rem;
    border: 1px solid var(--border-color);
    border-radius: 11px;
    background: color-mix(in srgb, var(--bg-surface-solid) 82%, transparent);
}

.friend-search-result > img {
    width: 2.15rem;
    height: 2.15rem;
    border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border-color));
    border-radius: 50%;
    object-fit: cover;
    background: var(--input-bg);
}

.friend-search-result-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.08rem;
}

.friend-search-result-copy strong,
.friend-search-result-copy span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.friend-search-result-copy strong { color: var(--text-primary); font-size: 0.75rem; }
.friend-search-result-copy span { color: var(--text-muted); font-size: 0.62rem; }

.friend-search-result .btn {
    padding: 0.4rem 0.58rem;
    font-size: 0.64rem;
    white-space: nowrap;
}

.friend-search-result .btn svg { width: 0.78rem; height: 0.78rem; }

.friend-search-empty,
.friend-search-loading {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.62rem;
    padding: 0.65rem;
    border: 1px dashed var(--border-color);
    border-radius: 11px;
    color: var(--text-muted);
}

.friend-search-empty > svg { width: 1.1rem; height: 1.1rem; color: var(--accent); }
.friend-search-empty > div { display: flex; flex-direction: column; gap: 0.08rem; }
.friend-search-empty strong { color: var(--text-secondary); font-size: 0.69rem; }
.friend-search-empty span,
.friend-search-loading { font-size: 0.61rem; }

.mini-spinner {
    width: 0.8rem;
    height: 0.8rem;
    display: inline-block;
    flex: 0 0 auto;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.friend-code-disclosure {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.012);
}

.friend-code-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 0.68rem;
    cursor: pointer;
}

.friend-code-toggle > span {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.friend-code-toggle strong { color: var(--text-secondary); }
.friend-code-toggle svg { width: 0.85rem; height: 0.85rem; }
.friend-code-toggle > span > svg { color: var(--accent); }

.friend-code-chevron { transition: transform 180ms ease; }
.friend-code-toggle[aria-expanded="true"] .friend-code-chevron { transform: rotate(180deg); }

.friend-code-drawer {
    display: grid;
    grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
    gap: 0.65rem;
    padding: 0 0.65rem 0.65rem;
}

:root.light-theme .friend-discovery-panel,
:root.light-theme .friend-search-result,
:root.light-theme .friend-code-disclosure,
:root.light-theme .friend-visibility-setting {
    background-color: rgba(255, 255, 255, 0.72);
}

/* Settings becomes a compact top-tab sheet on phones. Kept at the end so it
   wins over the desktop settings rules defined earlier in this stylesheet. */
@media (max-width: 720px) {
    .settings-container {
        width: calc(100vw - 1rem) !important;
        height: calc(100vh - 1rem);
        max-height: calc(100vh - 1rem) !important;
        border-radius: 16px !important;
    }

    .settings-layout { flex-direction: column; }

    .settings-sidebar {
        width: 100%;
        padding: 0.85rem 2.8rem 0.7rem 0.8rem;
        gap: 0.65rem;
        border-right: 0;
        border-bottom: 1px solid var(--border-color);
    }

    .settings-sidebar-header { display: none; }

    .settings-nav {
        flex-direction: row;
        gap: 0.25rem;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .settings-nav::-webkit-scrollbar { display: none; }

    .settings-nav-item {
        width: auto;
        flex: 0 0 auto;
        padding: 0.55rem 0.7rem;
        font-size: 0.76rem;
    }

    .settings-nav-item svg { display: none; }

    .settings-main { padding: 1.25rem 1rem 1.5rem; }

    .friend-code-drawer,
    .friend-request-list,
    .friend-list { grid-template-columns: 1fr; }

    .friend-code-drawer { padding: 0 0.65rem 0.65rem; }
    .friend-total-pill { font-size: 0.65rem; }
}

@media (max-width: 480px) {
    .friend-code-card { grid-template-columns: auto minmax(0, 1fr); }

    .friend-copy-code {
        grid-column: 1 / -1;
        justify-content: center;
    }

    .friend-add-control { flex-wrap: wrap; }
    .friend-add-control > svg { top: 1.18rem; }
    .friend-add-control input { min-height: 2.35rem; }
    .friend-add-control .btn { width: 100%; }
    .friend-add-status { white-space: normal; }
    .friend-directory-toolbar { align-items: flex-end; }
    .friend-search { width: 46%; }
    .friend-request-card { grid-template-columns: auto minmax(0, 1fr); }

    .friend-search-result {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .friend-search-result .btn {
        grid-column: 1 / -1;
        justify-content: center;
    }

    .friend-request-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
}

/* --- Taste profiler ---
   Full-screen wizard that turns a dozen one-tap reactions into a watchlist. */
#taste-profiler-modal .taste-container {
    width: 100vw;
    max-width: none !important;
    height: 100dvh;
    min-height: 100dvh;
    max-height: none !important;
    overflow: hidden !important;
    border: 0;
    border-radius: 0;
    background: var(--bg-surface-solid);
    box-shadow: none;
    display: flex;
}

.taste-host {
    width: 100%;
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.taste-screen {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: max(1.5rem, env(safe-area-inset-top)) 1.5rem max(1.25rem, env(safe-area-inset-bottom));
    overflow: hidden;
}

.taste-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.taste-eyebrow svg {
    width: 0.85rem;
    height: 0.85rem;
}

.taste-screen h3 {
    margin: 0.3rem 0 0.2rem;
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 2.6vw, 2rem);
    line-height: 1.1;
}

.taste-lead {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    max-width: 62ch;
}

.taste-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
}

/* Intro and message screens centre themselves; the round screens do not. */
.taste-intro,
.taste-screen-message {
    align-items: flex-start;
    justify-content: center;
    max-width: 640px;
}

.taste-screen-message {
    align-items: center;
    text-align: center;
    gap: 0.85rem;
    color: var(--text-secondary);
}

.taste-screen-message > svg {
    width: 2.25rem;
    height: 2.25rem;
    color: var(--text-muted);
}

.taste-facts {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0.35rem 0 0.5rem;
    padding: 0;
    color: var(--text-secondary);
    font-size: 0.86rem;
}

.taste-facts li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.taste-facts svg {
    width: 1rem;
    height: 1rem;
    color: var(--accent);
    flex: 0 0 auto;
}

.taste-round-header {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
}

.taste-round-heading {
    min-width: 0;
}

.taste-progress {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.4rem;
    min-width: 160px;
}

.taste-progress-count {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
}

.taste-progress-bar {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.taste-progress-bar > span {
    display: block;
    height: 100%;
    background: var(--accent-gradient);
    transition: width 0.3s ease;
}

.taste-grid {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    padding: 0.25rem 0.25rem 0.5rem;
}

/* Only opacity and transform are animated anywhere in this component. A
   blanket `transition: all` also covers the colours, and a transitioned
   colour does not pick up a new value when the theme variables change
   underneath it — the buttons would keep the previous theme's palette until
   the next re-render. */
.taste-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border-radius: 12px;
    transition: opacity 0.15s ease;
}

/* Titles run to one or two lines, so the star rows would otherwise sit at
   different heights across a row. The body absorbs the slack and the rating
   is pinned to the bottom, keeping every control on a shared baseline. */
.taste-card-body {
    flex: 1 1 auto;
}

.taste-card-rating {
    margin-top: auto;
}

.taste-card.is-rated .taste-card-poster {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent-glow);
}

.taste-card-poster {
    position: relative;
    aspect-ratio: 2 / 3;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
}

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

.taste-poster-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.taste-poster-placeholder svg {
    width: 1.75rem;
    height: 1.75rem;
}

.taste-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.taste-card-body h4 {
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.taste-card-year {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* The shared star widget is built for a roomier row; inside a poster card it
   needs to sit tight and centred. */
.taste-card-rating .star-rating-control {
    width: 100%;
    justify-content: center;
    gap: 0.3rem;
}

.taste-card-rating .star-rating-value {
    font-size: 0.68rem;
    color: var(--text-muted);
}

/* Desktop rating rounds always contain twelve films. Use factors of twelve
   instead of auto-fill so a round cannot land in an uneven 7 + 5 layout. The
   wide layout also owns both row heights, allowing the artwork to absorb
   shorter viewports without introducing nested scrollbars. */
@media (min-width: 721px) {
    .taste-grid:not(.taste-grid-picks) {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .taste-grid:not(.taste-grid-picks) .taste-card {
        min-width: 0;
        min-height: 0;
    }

    /* The shared control includes a text value and is too wide to remain on
       one line inside a poster card. Keep the stars and clear action together,
       then give the value its own quiet line underneath. */
    .taste-card-rating .star-rating-control {
        --star-size: 1.35rem;
        display: grid;
        grid-template-columns: minmax(0, max-content) 1.35rem;
        grid-template-areas:
            "stars clear"
            "value value";
        justify-content: start;
        align-items: center;
        gap: 0.05rem 0.25rem;
    }

    .taste-card-rating .star-rating-hit-area {
        --star-hit-padding: 0.2rem;
        grid-area: stars;
        min-width: 0;
        padding: var(--star-hit-padding) 0;
    }

    .taste-card-rating .star-rating-clear {
        grid-area: clear;
    }

    .taste-card-rating .star-rating-value {
        grid-area: value;
        min-width: 0;
        line-height: 1.15;
    }
}

@media (min-width: 960px) {
    .taste-grid:not(.taste-grid-picks) {
        width: 100%;
        max-width: 1000px;
        align-self: center;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        grid-template-rows: repeat(2, minmax(0, 1fr));
        overflow: hidden;
    }

    .taste-grid:not(.taste-grid-picks) .taste-card {
        gap: 0.4rem;
    }

    .taste-grid:not(.taste-grid-picks) .taste-card-poster {
        flex: 1 1 0;
        min-height: 0;
        aspect-ratio: auto;
    }

    .taste-grid:not(.taste-grid-picks) .taste-card-body {
        flex: 0 0 2.8rem;
    }

    .taste-grid:not(.taste-grid-picks) .taste-card-body h4 {
        min-height: 2.4em;
        line-height: 1.2;
    }

    .taste-grid:not(.taste-grid-picks) .taste-card-year {
        line-height: 1.15;
    }
}

.taste-round-footer {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--border-color);
}

.taste-round-status {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin: 0;
}

.taste-grid-picks {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    align-items: start;
}

.taste-pick {
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    color: inherit;
    text-align: left;
    border-radius: 12px;
    opacity: 0.62;
    transition: opacity 0.15s ease;
}

.taste-pick:hover,
.taste-pick:focus-within {
    opacity: 0.85;
}

.taste-pick.is-selected,
.taste-pick.is-seen {
    opacity: 1;
}

.taste-pick.is-selected .taste-card-poster {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.taste-pick.is-seen .taste-card-poster {
    border-color: rgba(251, 191, 36, 0.85);
    box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.2);
}

.taste-pick.is-popover-open {
    z-index: 5;
}

.taste-pick-details {
    width: 100%;
    display: grid;
    grid-template-rows: auto 2.5em 0.9rem 1rem;
    gap: 0.35rem;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.taste-pick-details:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.taste-pick-details:disabled {
    cursor: wait;
}

.taste-pick-check {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    width: 2.75rem;
    height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
    background: rgba(10, 12, 16, 0.7);
    border: 1px solid var(--border-color);
    color: transparent;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.taste-pick.is-selected .taste-pick-check {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.taste-pick-check svg {
    width: 1rem;
    height: 1rem;
}

.taste-pick-check:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.taste-pick-title {
    height: 2.5em;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.taste-pick .taste-card-year {
    min-height: 0.9rem;
    line-height: 0.9rem;
}

.taste-pick-more {
    display: inline-flex;
    min-height: 1rem;
    align-items: center;
    gap: 0.3rem;
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 700;
}

.taste-pick-more svg {
    width: 0.8rem;
    height: 0.8rem;
}

.taste-pick-action-slot {
    position: relative;
    width: 100%;
    height: 2rem;
    min-height: 2rem;
    margin-top: 0.5rem;
}

.taste-pick-seen {
    width: 100%;
    height: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    background: var(--input-bg);
    color: var(--text-secondary);
    cursor: pointer;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 700;
}

.taste-pick-seen:hover,
.taste-pick-seen:focus-visible {
    border-color: var(--border-hover);
    color: var(--text-primary);
    outline: none;
}

.taste-pick-seen svg {
    width: 0.85rem;
    height: 0.85rem;
}

.taste-pick-rating-summary {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: stretch;
    gap: 0.3rem;
}

.taste-pick-rating-display {
    min-width: 0;
    flex: 1 1 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.3rem 0.4rem;
    border: 1px solid rgba(251, 191, 36, 0.5);
    border-radius: 9px;
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
    cursor: pointer;
    font: inherit;
}

.taste-pick-rating-display:hover,
.taste-pick-rating-display:focus-visible {
    border-color: #fbbf24;
    background: rgba(251, 191, 36, 0.16);
    outline: none;
}

.taste-pick-rating-stars {
    overflow: hidden;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1;
    white-space: nowrap;
}

.taste-pick-rating-number {
    color: var(--text-secondary);
    font-size: 0.64rem;
    font-weight: 800;
}

.taste-pick-rating-clear {
    width: 2rem;
    min-width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    background: var(--input-bg);
    color: var(--text-muted);
    cursor: pointer;
}

.taste-pick-rating-clear:hover,
.taste-pick-rating-clear:focus-visible {
    border-color: rgba(248, 113, 113, 0.65);
    background: rgba(248, 113, 113, 0.1);
    color: #f87171;
    outline: none;
}

.taste-pick-rating-clear svg {
    width: 0.85rem;
    height: 0.85rem;
}

.taste-pick-rating-popover {
    position: absolute;
    right: 0;
    bottom: calc(100% + 0.45rem);
    left: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    padding: 0.5rem;
    border: 1px solid rgba(251, 191, 36, 0.55);
    border-radius: 11px;
    background: var(--bg-card-solid);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.38);
}

.taste-pick-rating-label {
    color: var(--text-muted);
    font-size: 0.64rem;
    font-weight: 700;
    text-align: center;
}

.taste-pick-rating-row {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.taste-pick-rating-popover .star-rating-control {
    --star-size: 0.95rem;
    min-width: 0;
    flex: 1 1 auto;
    justify-content: center;
    gap: 0;
}

.taste-pick-rating-popover .star-rating-hit-area {
    --star-hit-padding: 0.25rem;
    padding: var(--star-hit-padding) 0;
}

.taste-pick-rating-popover .star-rating-value {
    display: none;
}

.discover-fallback {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.discover-fallback .btn {
    flex: 0 0 auto;
}

@media (max-width: 720px) {
    .taste-screen {
        padding-left: 1rem;
        padding-right: 1rem;
        gap: 1rem;
    }

    .taste-round-header {
        flex-direction: row;
        align-items: flex-start;
        gap: 0.6rem;
    }

    .taste-progress {
        align-items: flex-end;
        min-width: 0;
        flex: 1 1 auto;
    }

    /* Rows are sized by JS so exactly `density` cards fill the scroll area;
       snapping then lands the next set flush against the top. */
    .taste-grid {
        grid-template-columns: repeat(var(--taste-cols, 1), minmax(0, 1fr));
        grid-auto-rows: var(--taste-row-h, 200px);
        gap: 0.75rem;
        scroll-snap-type: y proximity;
    }

    .taste-grid.taste-grid-picks {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: auto;
        align-items: start;
        scroll-snap-type: none;
    }

    .taste-card {
        scroll-snap-align: start;
    }

    .taste-card-rating .star-rating-control {
        gap: 0;
    }

    .taste-card-rating .star-rating-value {
        display: none;
    }

    /* --- poster fills the card, caption and stars laid over it (1 and 2 up).
       The stars get the whole card width here rather than what a text column
       leaves them, which is most of the reason to show fewer films. --- */
    .taste-card[data-card-mode="cover"] {
        position: relative;
        gap: 0;
    }

    .taste-card[data-card-mode="cover"] .taste-card-poster {
        position: absolute;
        inset: 0;
        aspect-ratio: auto;
        border: 0;
        border-radius: 12px;
    }

    .taste-card[data-card-mode="cover"] .taste-card-overlay {
        position: relative;
        margin-top: auto;
        display: flex;
        flex-direction: column;
        gap: 0.45rem;
        padding: 3rem 0.7rem 0.7rem;
        border-radius: 0 0 12px 12px;
        background: linear-gradient(to top, rgba(4, 5, 8, 0.94) 30%, rgba(4, 5, 8, 0.65) 62%, transparent);
    }

    .taste-card[data-card-mode="cover"] .taste-card-body {
        flex: 0 0 auto;
        color: #fff;
        text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
    }

    .taste-card[data-card-mode="cover"] .taste-card-body h4 {
        -webkit-line-clamp: 1;
        line-clamp: 1;
    }

    .taste-card[data-card-mode="cover"] .taste-card-year {
        color: rgba(255, 255, 255, 0.72);
    }

    /* A framed plate so the stars stay legible over any artwork. */
    .taste-card[data-card-mode="cover"] .taste-card-rating {
        margin-top: 0;
        padding: 0.35rem 0.5rem;
        border-radius: 12px;
        border: 1px solid rgba(255, 255, 255, 0.22);
        background: rgba(8, 10, 14, 0.55);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .taste-card[data-card-mode="cover"] .star-rating-stars {
        filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.85));
    }

    .taste-card[data-card-mode="cover"] .star-rating-control {
        justify-content: center;
    }

    .taste-round[data-density="1"] .taste-card-rating .star-rating-control { --star-size: 3.7rem; }
    .taste-round[data-density="2"] .taste-card-rating .star-rating-control { --star-size: 3.2rem; }

    /* --- poster beside the text (3 up) --- */
    .taste-card[data-card-mode="row"] {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr);
        gap: 0.1rem 0.75rem;
        padding: 0.5rem;
    }

    .taste-card[data-card-mode="row"] .taste-card-poster {
        grid-row: 1 / span 2;
        height: 100%;
        width: auto;
        aspect-ratio: 2 / 3;
    }

    .taste-card[data-card-mode="row"] .taste-card-body {
        grid-column: 2;
        align-self: start;
        flex: 0 0 auto;
    }

    .taste-card[data-card-mode="row"] .taste-card-rating {
        grid-column: 2;
        align-self: end;
        margin-top: 0;
    }

    .taste-round[data-density="3"] .taste-card-rating .star-rating-control { --star-size: 2.35rem; }

    /* --- 4 up keeps the poster-above-text grid --- */
    .taste-round[data-density="4"] .taste-card-rating .star-rating-control { --star-size: 1.85rem; }

    /* --- the films-per-screen control --- */
    .taste-density-btn {
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
        gap: 0.3rem;
        min-height: 40px;
        padding: 0.4rem 0.65rem;
        border-radius: 999px;
        border: 1px solid var(--border-hover);
        background: var(--input-bg);
        color: var(--text-secondary);
        font-family: inherit;
        font-size: 0.8rem;
        font-weight: 700;
        font-variant-numeric: tabular-nums;
        cursor: pointer;
    }

    .taste-density-btn svg {
        width: 0.9rem;
        height: 0.9rem;
    }

    .taste-density-btn:hover {
        color: var(--text-primary);
        border-color: var(--accent);
    }
}

/* Desktop already fits a whole round without scrolling, so the control would
   only be one more thing to read. */
.taste-density-btn {
    display: none;
}

.taste-density-chooser {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.taste-density-screen {
    justify-content: center;
    max-width: 620px;
}

.taste-density-chooser h3 {
    margin: 0.2rem 0 0;
    font-family: var(--font-heading);
    font-size: clamp(1.3rem, 2.4vw, 1.7rem);
    line-height: 1.1;
}

.taste-density-chooser.is-sheet {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 4;
    padding: 1rem;
    border-radius: 18px 18px 0 0;
    border-top: 1px solid var(--border-hover);
    background: var(--bg-surface-solid);
    box-shadow: 0 -18px 44px rgba(0, 0, 0, 0.45);
}

.taste-density-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.taste-density-option {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.6rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.taste-density-option:hover {
    border-color: var(--border-hover);
}

.taste-density-option[aria-pressed="true"] {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent-glow);
}

/* A miniature of the layout each option produces: the choice is about shape,
   so showing the shape beats describing it. */
.taste-density-mini {
    display: grid;
    gap: 3px;
    height: 46px;
    padding: 3px;
    border-radius: 6px;
    background: var(--bg-base);
    border: 1px solid var(--border-color);
}

.taste-density-mini[data-rows="1"] { grid-template-rows: 1fr; }
.taste-density-mini[data-rows="2"] { grid-template-rows: repeat(2, 1fr); }
.taste-density-mini[data-rows="3"] { grid-template-rows: repeat(3, 1fr); }
.taste-density-mini[data-rows="4"] { grid-template: repeat(2, 1fr) / repeat(2, 1fr); }

.taste-density-mini i {
    display: block;
    border-radius: 2px;
    background: var(--accent);
    opacity: 0.45;
}

.taste-density-option[aria-pressed="true"] .taste-density-mini i {
    opacity: 1;
}

.taste-density-name {
    font-size: 0.82rem;
    font-weight: 700;
}

.taste-density-note {
    font-size: 0.68rem;
    line-height: 1.3;
    color: var(--text-muted);
}

@media (max-width: 720px) {

    .taste-round-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .taste-round-footer .taste-actions {
        justify-content: stretch;
    }

    .taste-round-footer .taste-actions .btn {
        flex: 1 1 auto;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .taste-progress-bar > span,
    .taste-card,
    .taste-pick {
        transition: none;
    }
}

/* --- Onboarding wizard ---
   Shares the taste profiler's full-screen shell; these are the step-specific
   controls layered on top. */
#onboarding-modal .taste-container {
    width: 100vw;
    max-width: none !important;
    height: 100dvh;
    min-height: 100dvh;
    max-height: none !important;
    overflow: hidden !important;
    border: 0;
    border-radius: 0;
    background: var(--bg-surface-solid);
    box-shadow: none;
    display: flex;
}

.onboarding-screen {
    max-width: 680px;
}

.onboarding-screen-taste {
    max-width: 1180px;
}

.onboarding-progress {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.onboarding-dots {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.onboarding-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-color);
    border: 1px solid var(--border-hover);
}

.onboarding-dot.is-done {
    background: var(--accent);
    border-color: var(--accent);
    opacity: 0.55;
}

.onboarding-dot.is-current {
    width: 22px;
    border-radius: 999px;
    background: var(--accent);
    border-color: var(--accent);
    opacity: 1;
}

.onboarding-skip {
    background: none;
    border: 0;
    /* Padded to a thumb-sized target rather than the height of its text. The
       negative inline margin keeps it optically flush with the progress row. */
    padding: 0.6rem 0.5rem;
    margin-right: -0.5rem;
    min-height: 40px;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

.onboarding-skip:hover {
    color: var(--text-primary);
}

.onboarding-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding-bottom: 0.5rem;
}

.onboarding-taste-host {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* The profiler supplies its own padded screen; inside the wizard the shell
   has already paid for that space. */
.onboarding-taste-host .taste-screen {
    padding: 0;
    max-width: none;
}

.onboarding-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.onboarding-field input[type="text"] {
    width: 100%;
    padding: 0.65rem 0.8rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 500;
}

.onboarding-field input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
}

.onboarding-field small {
    font-weight: 500;
    font-size: 0.74rem;
    color: var(--text-muted);
}

.onboarding-choices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.onboarding-choice,
.onboarding-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
}

.onboarding-choice:hover,
.onboarding-toggle:hover {
    border-color: var(--border-hover);
}

.onboarding-choice.is-selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent-glow);
}

.onboarding-choice > svg {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--accent);
    flex: 0 0 auto;
}

.onboarding-choice-copy {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.onboarding-choice-copy small {
    color: var(--text-muted);
    font-size: 0.76rem;
}

.onboarding-toggle-track {
    flex: 0 0 auto;
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: var(--range-track);
    padding: 3px;
    display: flex;
    justify-content: flex-start;
}

.onboarding-toggle.is-on .onboarding-toggle-track {
    background: var(--accent);
    justify-content: flex-end;
}

.onboarding-toggle-knob {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
}

.onboarding-person {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
}

.onboarding-person-avatar {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
}

.onboarding-person-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.onboarding-person-initial {
    font-weight: 800;
    color: #fff;
}

.onboarding-person-copy {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.onboarding-person-copy small {
    color: var(--text-muted);
    font-size: 0.76rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.onboarding-results {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

.onboarding-error {
    color: var(--rt-color);
    font-weight: 600;
}

@media (max-width: 720px) {
    .onboarding-body {
        gap: 0.75rem;
    }

    .onboarding-person {
        flex-wrap: wrap;
    }

    .onboarding-person .btn {
        flex: 1 1 100%;
        justify-content: center;
    }
}

/* --- Top three favourites step --- */
.onboarding-screen-favorites .onboarding-body {
    gap: 1rem;
}

.favorite-slots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.favorite-slot {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.6rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    min-width: 0;
}

.favorite-slot.is-empty {
    border-style: dashed;
    background: none;
}

.favorite-slot.is-empty.is-active {
    border: 2px solid var(--accent);
    background: color-mix(in srgb, var(--accent) 8%, var(--bg-card));
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.favorite-slot-rank {
    position: absolute;
    top: -0.5rem;
    left: -0.5rem;
    width: 1.6rem;
    height: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: #fff;
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 800;
    box-shadow: var(--shadow-sm);
}

.favorite-slot.is-empty .favorite-slot-rank {
    background: var(--input-bg);
    border: 1px dashed var(--border-hover);
    color: var(--text-muted);
    box-shadow: none;
}

.favorite-slot.is-active .favorite-slot-rank {
    background: var(--accent-gradient);
    border: 1px solid var(--accent);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.favorite-slot-poster {
    aspect-ratio: 2 / 3;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-card-solid);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.favorite-slot-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.favorite-slot-poster svg {
    width: 1.5rem;
    height: 1.5rem;
}

.favorite-slot-title {
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.favorite-slot.is-empty .favorite-slot-title {
    color: var(--text-muted);
    font-weight: 500;
}

.favorite-slot.is-active .favorite-slot-title,
.favorite-slot.is-active .favorite-slot-poster {
    color: var(--accent);
}

.favorite-slot.is-active .favorite-slot-title {
    font-weight: 800;
}

.favorite-slot.is-active .favorite-slot-poster {
    background: color-mix(in srgb, var(--accent) 9%, var(--bg-card-solid));
}

.favorite-slot-year {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.favorite-slot-remove {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: rgba(10, 12, 16, 0.75);
    color: var(--text-primary);
    cursor: pointer;
}

.favorite-slot-remove svg {
    width: 0.8rem;
    height: 0.8rem;
}

.favorite-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.favorite-search-wrap > svg {
    position: absolute;
    left: 0.7rem;
    width: 1rem;
    height: 1rem;
    color: var(--text-muted);
    pointer-events: none;
}

.favorite-search-wrap input[type="text"] {
    width: 100%;
    padding: 0.65rem 0.8rem 0.65rem 2.2rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 500;
}

.favorite-search-wrap input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
}

.favorite-results {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-height: 0;
}

.favorite-result {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.45rem 0.6rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    width: 100%;
}

.favorite-result:hover:not(:disabled) {
    border-color: var(--accent);
}

.favorite-result:disabled {
    opacity: 0.5;
    cursor: default;
}

.favorite-result-poster {
    flex: 0 0 auto;
    width: 34px;
    aspect-ratio: 2 / 3;
    border-radius: 5px;
    overflow: hidden;
    background: var(--bg-card-solid);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.favorite-result-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.favorite-result-poster svg {
    width: 0.9rem;
    height: 0.9rem;
}

.favorite-result-copy {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.favorite-result-copy strong {
    font-size: 0.86rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.favorite-result-copy small {
    font-size: 0.74rem;
    color: var(--text-muted);
}

.favorite-result > svg {
    flex: 0 0 auto;
    width: 1rem;
    height: 1rem;
    color: var(--accent);
}

@media (max-width: 720px) {
    .favorite-slots {
        gap: 0.5rem;
    }

    .favorite-slot {
        padding: 0.45rem;
    }

    .favorite-slot-title {
        font-size: 0.72rem;
    }
}

/* ===================================================================
   Mobile touch targets
   -------------------------------------------------------------------
   A mobile audit found ~25 controls under a comfortable finger size at
   375px, and in most cases the phone breakpoint was the cause: rules
   that shrink a control from 2.5rem to 2.25rem, or strip a button back
   to its text line box. That is backwards - a phone needs the larger
   target, not the smaller one.

   This block sits last so it wins the cascade, and sets 2.5rem (40px)
   as the floor. Square icon-only controls get it on both axes; text
   controls get it as a minimum height only, so their labels still set
   the width.
   =================================================================== */
@media (max-width: 720px) {
    .modal-close,
    .watch-tips-trigger-btn,
    .profile-trigger-btn,
    .card-seen-toggle,
    .watch-tip-dismiss,
    .not-interested-toast-close,
    .friend-icon-button,
    .friend-search-clear-btn,
    .drawer-search-clear {
        width: 2.5rem;
        height: 2.5rem;
        min-width: 2.5rem;
        min-height: 2.5rem;
    }

    .btn,
    .btn-small,
    .dropdown-item,
    .settings-nav-item,
    .active-filter-chip,
    .sort-option,
    .discover-shelf-tab,
    .watch-tip-actions .btn,
    .friend-request-actions .btn,
    .friend-search-result .btn,
    .discover-seen-actions .btn,
    .modal-actions .btn,
    .personal-rating-actions .btn-small,
    .settings-title-row .btn,
    .drawer-logout,
    .friend-code-toggle,
    #friend-directory-search-input,
    #friend-user-search-input,
    #friend-code-input,
    .drawer-search input,
    .settings-tab-content input[type="text"],
    .settings-tab-content select {
        min-height: 2.5rem;
    }

    /* Buttons stripped back to bare text by a shared rule: give them a
       real box, pulled flush again with a matching negative margin. */
    .clear-filters-button,
    .provider-filter-settings {
        display: inline-flex;
        align-items: center;
        min-height: 2.5rem;
        padding: 0 0.45rem;
        margin-right: -0.45rem;
    }

    /* Bare checkboxes render ~13px. Scoped to the ones that are actually
       shown — several elsewhere are opacity:0 stand-ins behind a custom
       switch, and resizing those would be pointless at best. */
    .feature-toggle-input {
        width: 1.15rem;
        height: 1.15rem;
    }
}

/* --- Details modal: the ratings row was forcing the whole info column
   wider than the screen. `flex-wrap: nowrap` made its min-content width the
   sum of all four badges (~378px at 375px wide), so every row in the modal
   was clipped on the right. Wrapping fixes the overflow; the flex-basis
   change is what stops the badges ellipsizing instead of wrapping. --- */
@media (max-width: 720px) {
    .hero-ratings {
        flex-wrap: wrap !important;
        overflow-x: visible;
    }

    .hero-ratings .rating-badge {
        flex: 0 1 auto;
    }
}

/* --- Half-star targets. Both of these rating controls sized their glyphs
   for a desktop row, leaving each of the ten half-star strips 9-11px wide on
   a phone. Let the value label wrap to its own line and scale the glyphs to
   the width that frees up. --- */
@media (max-width: 720px) {
    .personal-rating-form .star-rating-control,
    .discover-seen-panel .star-rating-control {
        width: 100%;
        flex-wrap: wrap;
        --star-size: min(3rem, calc((100vw - 6rem) / 5.5));
    }

    .personal-rating-form .star-rating-hit-area,
    .discover-seen-panel .star-rating-hit-area {
        flex: 0 0 auto;
        min-height: 44px;
        align-items: center;
    }

    .personal-rating-form .star-rating-value,
    .discover-seen-panel .star-rating-value {
        flex: 1 0 100%;
        min-width: 0;
    }
}

/* --- Sheets sized in vh sit under the browser chrome on a phone, so the
   last row of content is unreachable. dvh tracks the visible viewport. --- */
@media (max-width: 720px) {
    .settings-container {
        height: calc(100dvh - 1rem) !important;
        max-height: calc(100dvh - 1rem) !important;
    }
}

@media (max-width: 680px) {
    .user-profile-container {
        max-height: calc(100dvh - 1rem) !important;
    }
}

/* --- Showdown: a fixed 220px centre column plus two lanes cannot fit a
   ~306px stage, and the round buttons were being pushed off the edge where
   they could not be tapped at all. --- */
@media (max-width: 720px) {
    .showdown-no-match-board {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.6rem;
    }

    .showdown-shell.showdown-rps .showdown-choice-orbit {
        position: static;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        width: 100%;
        transform: none;
    }

    .showdown-shell.showdown-rps .showdown-choice-orbit .showdown-hand-button {
        width: auto !important;
        min-width: 5.2rem;
        flex: 0 1 auto !important;
    }
}
