/* Appel Game Styles - Premium Edition v2 */
/* Mobile-first, touch-friendly design with stunning animations */
/* NO red/green color distinction - reflection-safe */

:root {
    --bg-dark: #08080e;
    --bg-surface: #111118;
    --bg-card: #181822;
    --bg-elevated: #222230;
    --text-primary: #f0f0f5;
    --text-secondary: #8888a0;
    --text-muted: #55556a;
    --accent-primary: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.4);
    --accent-secondary: #8b5cf6;
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.1);

    /* Reveal colors - very subtle, low saturation */
    /* Dark enough that reflections won't reveal the color */
    --reveal-bg: #121218;
    --reveal-glow: rgba(140, 140, 200, 0.10);

    /* Safe: very muted green, only on small elements */
    --reveal-safe-accent: #1e2e28;
    --reveal-safe-text: #6a9e84;

    /* Imposter: very muted red, only on small elements */
    --reveal-imposter-accent: #2e1e1e;
    --reveal-imposter-text: #9e6a6a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: -webkit-fill-available;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

/* ==================== */
/* SCREENS */
/* ==================== */

.screen {
    display: none;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    padding: 20px;
    padding-bottom: env(safe-area-inset-bottom, 20px);
    overflow-y: auto;
    overflow-x: hidden;
}

.screen.active {
    display: flex;
    animation: screenFadeIn 0.35s ease-out;
}

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

/* ==================== */
/* SETUP SCREEN */
/* ==================== */

#setup-screen {
    gap: 20px;
    background: var(--bg-dark);
}

.setup-header {
    text-align: center;
    padding: 16px 0 8px;
}

.setup-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #fff 0%, #a5a5ff 50%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

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

.setup-section {
    background: var(--bg-surface);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid var(--border-subtle);
}

.setup-section h2 {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 14px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.setup-section h2 .icon {
    font-size: 1.1rem;
}

/* Category Selection */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.category-option {
    background: var(--bg-card);
    border: 2px solid transparent;
    border-radius: 14px;
    padding: 14px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.category-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    opacity: 0;
    transition: opacity 0.3s;
}

.category-option:hover {
    transform: translateY(-2px);
    border-color: var(--border-light);
}

.category-option.selected {
    border-color: var(--accent-primary);
    box-shadow: 0 0 25px var(--accent-glow);
}

.category-option.selected::before {
    opacity: 0.1;
}

.category-option .name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}

.category-option .hint-badge {
    font-size: 0.65rem;
    color: var(--text-muted);
    position: relative;
    z-index: 1;
}

.category-option .hint-badge.has-hints {
    color: var(--accent-secondary);
}

/* Player Input */
.player-input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.player-input-row input {
    flex: 1;
    background: var(--bg-card);
    border: 2px solid var(--border-subtle);
    border-radius: 14px;
    padding: 14px 18px;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
    min-width: 0;
}

.player-input-row input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px var(--accent-glow);
}

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

.add-player-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    border-radius: 14px;
    padding: 14px 22px;
    color: white;
    font-size: 1.4rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px var(--accent-glow);
    flex-shrink: 0;
}

.add-player-btn:hover {
    transform: scale(1.05);
}

.add-player-btn:active {
    transform: scale(0.95);
}

/* ==================== */
/* TIMER CONTROL (Setup) */
/* ==================== */

.timer-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 14px;
    background: var(--bg-card);
    border-radius: 14px;
    border: 1px solid var(--border-subtle);
}

.timer-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timer-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--accent-primary);
}

.timer-btn:active {
    transform: scale(0.92);
}

.timer-value {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 70px;
    text-align: center;
}

/* ==================== */
/* PLAYER LIST - Premium Drag & Drop */
/* ==================== */

.player-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: 260px;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    -webkit-overflow-scrolling: touch;
}

.player-item {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border-radius: 14px;
    padding: 0;
    margin-bottom: 8px;
    gap: 0;
    cursor: grab;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.2s,
                margin 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    touch-action: none;
}

.player-item:hover {
    background: var(--bg-elevated);
}

.player-item.dragging {
    cursor: grabbing;
    z-index: 1000;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5),
                0 0 30px var(--accent-glow);
    transform: scale(1.02);
    background: var(--bg-elevated);
    border-color: var(--accent-primary);
}

.player-item.drag-placeholder {
    opacity: 0;
    pointer-events: none;
    height: 0;
    margin: 0;
    padding: 0;
    border: none;
}

.player-item .drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 52px;
    color: var(--text-muted);
    font-size: 1.1rem;
    flex-shrink: 0;
    border-right: 1px solid var(--border-subtle);
}

.player-item .drag-handle svg {
    width: 18px;
    height: 18px;
    opacity: 0.4;
}

.player-item .player-content {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 14px;
    gap: 10px;
    min-width: 0;
}

.player-item .player-number {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 20px;
}

.player-item .player-name {
    flex: 1;
    font-weight: 500;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-item .player-name-input {
    flex: 1;
    background: var(--bg-dark);
    border: 2px solid var(--accent-primary);
    border-radius: 8px;
    padding: 6px 10px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    outline: none;
    min-width: 0;
}

.player-item .remove-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 52px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    border-left: 1px solid var(--border-subtle);
}

.player-item .remove-btn:hover {
    color: #f87171;
    background: rgba(248, 113, 113, 0.1);
}

.player-item .remove-btn:active {
    transform: scale(0.9);
}

.empty-players {
    text-align: center;
    color: var(--text-muted);
    padding: 30px 20px;
    font-size: 0.9rem;
}

/* Drop indicator line */
.drop-indicator {
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    border-radius: 2px;
    margin: -5px 0;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.drop-indicator.visible {
    opacity: 1;
}

/* Start Button */
.start-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    border-radius: 18px;
    padding: 18px 28px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: auto;
    box-shadow: 0 8px 30px var(--accent-glow);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    min-height: 60px;
    line-height: 1.4;
}

.start-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.start-btn:hover::before {
    left: 100%;
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px var(--accent-glow);
}

.start-btn:active {
    transform: translateY(0) scale(0.98);
}

.start-btn:disabled {
    background: var(--bg-elevated);
    cursor: not-allowed;
    box-shadow: none;
    color: var(--text-muted);
}

.start-btn:disabled::before {
    display: none;
}

/* ==================== */
/* GAME SCREEN - Premium Reveal Experience */
/* ==================== */

#game-screen {
    padding: 0;
    justify-content: center;
    align-items: center;
    background: var(--bg-dark);
    overflow: hidden;
    position: relative;
}

/* Back button */
.game-back-btn {
    position: absolute;
    top: 20px;
    left: 16px;
    z-index: 200;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    padding: 0;
}

.game-back-btn svg {
    width: 20px;
    height: 20px;
}

.game-back-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    color: var(--text-primary);
}

.game-back-btn:active {
    transform: scale(0.9);
}

/* Ambient background */
.game-ambient {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.ambient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.2;
    animation: float 10s ease-in-out infinite;
}

.ambient-orb.orb-1 {
    width: 250px;
    height: 250px;
    background: var(--accent-primary);
    top: -80px;
    right: -80px;
    animation-delay: 0s;
}

.ambient-orb.orb-2 {
    width: 200px;
    height: 200px;
    background: var(--accent-secondary);
    bottom: -60px;
    left: -60px;
    animation-delay: -5s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(15px, -15px) scale(1.05); }
    66% { transform: translate(-10px, 10px) scale(0.95); }
}

/* Player indicator - GEEN kleuren die imposter verraden */
.game-player-indicator {
    position: absolute;
    top: 28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    text-align: center;
}

.game-player-indicator .player-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Card Container */
.card-container {
    position: relative;
    width: calc(100% - 40px);
    max-width: 360px;
    height: 68vh;
    height: 68dvh;
    margin: 0 auto;
    perspective: 1200px;
}

/* Card Wrapper */
.card-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 24px;
    overflow: hidden;
}

/* Revealed Content - neutral background, subtle color accents only */
.card-revealed {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding: 0 28px 50px 28px;
    text-align: center;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
    /* Same dark background for both - no color visible in reflections */
    background: var(--reveal-bg);
}

.card-revealed.visible {
    opacity: 1;
}

/* Reveal content wrapper */
.reveal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-height: 45%;
    animation: revealContentIn 0.5s ease-out both;
}

@keyframes revealContentIn {
    from { opacity: 0; transform: translateY(15px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Status indicator */
.reveal-status {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}

.reveal-status .status-ring {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Subtle color only on small status elements */
.safe .status-ring {
    background: var(--reveal-safe-accent);
    box-shadow: 0 0 20px var(--reveal-glow);
}

.imposter .status-ring {
    background: var(--reveal-imposter-accent);
    box-shadow: 0 0 20px var(--reveal-glow);
}

.status-ring .status-icon {
    font-size: 1.4rem;
}

.safe .status-icon {
    color: var(--reveal-safe-text);
}

.imposter .status-icon {
    color: var(--reveal-imposter-text);
}

.reveal-status .status-label {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 600;
}

.safe .status-label {
    color: var(--reveal-safe-text);
}

.imposter .status-label {
    color: var(--reveal-imposter-text);
}

/* Word Display */
.word-display-container {
    margin-bottom: 18px;
}

.word-display {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--text-primary);
    word-break: break-word;
    line-height: 1.3;
}

.imposter .word-display {
    font-size: 1.4rem;
    font-weight: 600;
}

/* Hint Section */
.hint-section {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 14px;
    padding: 16px 22px;
    border: 1px solid var(--border-subtle);
}

.hint-section .hint-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 6px;
}

.hint-section .hint-word {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--reveal-imposter-text);
}

/* Cover Card - The main interactive element */
.card-cover {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(160deg, #1e1e30 0%, #16162a 40%, #121225 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 30px;
    z-index: 10;
    cursor: grab;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease;
    will-change: transform;
    touch-action: none;
    backface-visibility: hidden;
    overflow: hidden;
}

/* Shimmer effect on card cover */
.card-cover::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(99, 102, 241, 0.03), transparent, rgba(139, 92, 246, 0.03), transparent);
    animation: shimmerRotate 8s linear infinite;
    pointer-events: none;
}

.card-cover::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.03), transparent);
    animation: shimmerSlide 4s ease-in-out infinite;
    pointer-events: none;
}

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

@keyframes shimmerSlide {
    0%, 100% { left: -100%; }
    50% { left: 150%; }
}

.card-cover.dragging {
    cursor: grabbing;
    transition: none;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5),
                0 0 40px rgba(99, 102, 241, 0.15);
}

.card-cover.returning {
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Player Name on Card */
.card-cover .player-name-display {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 40px;
    text-align: center;
    word-break: break-word;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 1;
}

/* Pull Instruction */
.pull-instruction {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    position: relative;
    z-index: 1;
}

.pull-visual {
    width: 50px;
    height: 80px;
    position: relative;
    margin-bottom: 16px;
}

.pull-line {
    position: absolute;
    left: 50%;
    width: 2.5px;
    background: linear-gradient(to bottom, var(--accent-primary), transparent);
    border-radius: 2px;
    transform: translateX(-50%);
    animation: pullPulse 2s ease-in-out infinite;
}

.pull-line:nth-child(1) {
    height: 50px;
    top: 0;
    animation-delay: 0s;
}

.pull-line:nth-child(2) {
    height: 34px;
    top: 8px;
    opacity: 0.5;
    animation-delay: 0.2s;
}

.pull-line:nth-child(3) {
    height: 18px;
    top: 16px;
    opacity: 0.3;
    animation-delay: 0.4s;
}

.pull-circle {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 14px;
    border: 2.5px solid var(--accent-primary);
    border-radius: 50%;
    animation: pullCircle 2s ease-in-out infinite;
}

@keyframes pullPulse {
    0%, 100% {
        opacity: 0.3;
        transform: translateX(-50%) translateY(0);
    }
    50% {
        opacity: 1;
        transform: translateX(-50%) translateY(-12px);
    }
}

@keyframes pullCircle {
    0%, 100% {
        transform: translateX(-50%) scale(1);
        opacity: 0.5;
    }
    50% {
        transform: translateX(-50%) scale(1.2);
        opacity: 1;
    }
}

.pull-text {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-align: center;
}

.pull-subtext {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 6px;
    opacity: 0.7;
}

/* Reveal Progress Indicator */
.reveal-progress {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 2;
}

.reveal-progress.visible {
    opacity: 1;
}

.reveal-progress-bar {
    width: 100px;
    height: 3px;
    background: var(--bg-elevated);
    border-radius: 2px;
    overflow: hidden;
}

.reveal-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s linear;
}

.reveal-progress-text {
    font-size: 0.7rem;
    color: var(--text-muted);
    min-width: 30px;
}

/* Glow effect when revealing - neutral, same for both roles */
.card-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 24px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 5;
    /* Neutral glow - no color distinction visible in reflections */
    box-shadow: inset 0 0 60px var(--reveal-glow),
                0 0 40px var(--reveal-glow);
}

.card-glow.visible {
    opacity: 1;
}

/* Particle effects container */
.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 6;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    pointer-events: none;
}

/* Next Button */
.next-player-btn {
    position: absolute;
    bottom: 30px;
    left: 20px;
    right: 20px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    border-radius: 18px;
    padding: 18px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    z-index: 100;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 8px 30px var(--accent-glow);
}

.next-player-btn.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.next-player-btn:active {
    transform: scale(0.97);
}

/* ==================== */
/* END SCREEN */
/* ==================== */

#end-screen {
    gap: 20px;
    background: var(--bg-dark);
}

.end-header {
    text-align: center;
    padding: 24px 0 8px;
}

.end-header h1 {
    font-size: 1.7rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #fff, var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.players-overview {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.player-overview-item {
    display: flex;
    align-items: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.player-overview-item:hover {
    background: var(--bg-card);
    transform: translateX(4px);
}

.player-overview-item:active {
    transform: scale(0.98);
}

.player-overview-item .player-info {
    flex: 1;
}

.player-overview-item .player-info .name {
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 3px;
}

.player-overview-item .player-info .role {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.player-overview-item .view-icon {
    color: var(--text-muted);
    font-size: 1.1rem;
    opacity: 0.5;
}

/* Starter player highlight */
.player-overview-item.starter {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.12));
    border-color: var(--accent-primary);
    box-shadow: 0 0 18px rgba(99, 102, 241, 0.15);
}

.player-overview-item.starter .player-info .name {
    color: var(--accent-primary);
}

.player-overview-item.starter .player-info .role {
    color: var(--accent-primary);
    font-weight: 600;
}

/* Timer Section (End Screen) */
.timer-section {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    padding: 22px;
    margin-bottom: 16px;
    text-align: center;
}

.timer-display {
    margin-bottom: 14px;
}

.timer-countdown {
    font-size: 2.6rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: 2px;
    transition: color 0.3s;
}

.timer-countdown.finished {
    color: #ef4444;
    animation: pulse-red 0.5s ease-in-out infinite;
}

@keyframes pulse-red {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.timer-start-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    border-radius: 14px;
    padding: 14px 28px;
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.timer-start-btn:hover {
    transform: scale(1.02);
}

.timer-start-btn:active {
    transform: scale(0.97);
}

.timer-start-btn.running {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.end-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 8px;
}

.restart-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    border-radius: 16px;
    padding: 16px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 6px 25px var(--accent-glow);
}

.restart-btn:active {
    transform: scale(0.97);
}

.settings-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 16px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.settings-btn:hover {
    background: var(--bg-card);
}

.settings-btn:active {
    transform: scale(0.97);
}

/* ==================== */
/* REVIEW MODAL */
/* ==================== */

.review-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 24px;
}

.review-modal.active {
    display: flex;
    animation: modalFadeIn 0.3s ease-out;
}

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

.review-card-container {
    position: relative;
    width: 100%;
    max-width: 340px;
    height: 62vh;
    height: 62dvh;
}

.review-close-btn {
    position: absolute;
    top: -50px;
    right: 0;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 42px;
    height: 42px;
    color: var(--text-primary);
    font-size: 1.4rem;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.review-close-btn:hover {
    background: rgba(255, 255, 255, 0.14);
}

.review-close-btn:active {
    transform: scale(0.9);
}

/* ==================== */
/* Responsive - Mobile optimized */
/* ==================== */

/* Small phones */
@media (max-width: 380px) {
    .setup-header h1 {
        font-size: 1.7rem;
    }

    .setup-section {
        padding: 16px;
    }

    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .category-option {
        padding: 12px 8px;
    }

    .category-option .name {
        font-size: 0.8rem;
    }

    .card-cover .player-name-display {
        font-size: 1.5rem;
    }

    .word-display {
        font-size: 1.6rem;
    }

    .card-container {
        width: calc(100% - 24px);
    }

    .player-input-row input {
        padding: 12px 14px;
        font-size: 0.9rem;
    }

    .add-player-btn {
        padding: 12px 18px;
    }

    .start-btn {
        padding: 16px 24px;
        font-size: 1rem;
        min-height: 54px;
    }

    .next-player-btn {
        padding: 16px;
        left: 14px;
        right: 14px;
        bottom: 24px;
        font-size: 0.95rem;
    }
}

/* Medium phones */
@media (max-width: 420px) and (min-width: 381px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .setup-section {
        padding: 18px;
    }
}

/* Taller screens */
@media (min-height: 800px) {
    .card-container {
        height: 64vh;
    }
}

/* Short screens (landscape or small height) */
@media (max-height: 600px) {
    .card-container {
        height: 60vh;
    }

    .setup-header {
        padding: 8px 0 4px;
    }

    .setup-header h1 {
        font-size: 1.5rem;
    }

    #setup-screen {
        gap: 12px;
    }

    .game-player-indicator {
        top: 16px;
    }

    .game-back-btn {
        top: 12px;
        left: 12px;
        width: 36px;
        height: 36px;
    }

    .game-back-btn svg {
        width: 16px;
        height: 16px;
    }

    .next-player-btn {
        bottom: 16px;
    }
}

/* Safe area support */
@supports (padding: env(safe-area-inset-top)) {
    .screen {
        padding-top: max(20px, env(safe-area-inset-top));
        padding-bottom: max(20px, env(safe-area-inset-bottom));
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }

    #game-screen {
        padding: 0;
    }

    .game-back-btn {
        top: max(20px, env(safe-area-inset-top));
        left: max(16px, env(safe-area-inset-left));
    }

    .game-player-indicator {
        top: max(28px, env(safe-area-inset-top));
    }

    .next-player-btn {
        bottom: max(30px, calc(env(safe-area-inset-bottom) + 10px));
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 3px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--bg-elevated);
    border-radius: 2px;
}
