:root {
    /* Colors */
    --bg-dark: #0f172a;
    --bg-gradient: radial-gradient(circle at 50% 50%, #1e293b 0%, #0f172a 100%);
    --accent-primary: #3b82f6;
    --accent-secondary: #8b5cf6;
    --accent-danger: #ef4444;
    --accent-success: #10b981;

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --glass-blur: 12px;

    /* Text */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Animation Timings */
    --anim-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --anim-medium: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --anim-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-dark);
    background-image: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* Prevent scrolling during gameplay */
}

/* Background Ambient Orbs */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.6;
    animation: float 10s infinite ease-in-out alternate;
}

.orb-1 {
    width: 300px;
    height: 300px;
    background: var(--accent-primary);
    top: -50px;
    left: -50px;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: var(--accent-secondary);
    bottom: -100px;
    right: -100px;
    animation-delay: -5s;
}

@keyframes float {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(30px, 50px);
    }
}

/* Main App Container */
#app {
    width: 100%;
    max-width: 480px;
    /* Mobile optimal */
    height: 100vh;
    /* Full viewport on mobile */
    max-height: 900px;
    position: relative;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Glass Panels */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 24px;
    padding: 2rem;
    text-align: center;
    transition: transform var(--anim-fast);
}

.glass-panel:active {
    transform: scale(0.98);
}

/* Typography */
h1,
h2,
h3 {
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 1.1;
    margin-bottom: 1rem;
}

h1 {
    font-size: 3rem;
    background: linear-gradient(to right, #fff, #cbd5e1);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

h2 {
    font-size: 2rem;
}

p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* Buttons */
.btn {
    background: var(--text-primary);
    color: var(--bg-dark);
    border: none;
    padding: 1rem 2rem;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    width: 100%;
    cursor: pointer;
    transition: all var(--anim-fast);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

.btn:active {
    transform: scale(0.95);
    background: #e2e8f0;
}

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

.btn-danger {
    background: var(--accent-danger);
    color: white;
}

/* Inputs */
.input-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

input,
select {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    padding: 1rem;
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    transition: border-color var(--anim-fast);
    outline: none;
}

input:focus,
select:focus {
    border-color: var(--accent-primary);
    background: rgba(0, 0, 0, 0.3);
}

/* Utilities */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn var(--anim-medium) forwards;
}

.slide-up {
    animation: slideUp var(--anim-medium) forwards;
}

.pulse {
    animation: pulse 2s infinite;
}

.pulse-slow {
    animation: pulse 3s infinite;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(59, 130, 246, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

/* Role Cards */
.role-card {
    border-radius: 20px;
    padding: 3rem 1rem;
    margin: 2rem 0;
    border: 2px solid transparent;
}

.role-crew {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--accent-success);
    color: var(--accent-success);
}

.role-imposter {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--accent-danger);
    color: var(--accent-danger);
}

/* Player List UI */
#player-list-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.player-input-row {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 0.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.player-input-row.dragging {
    opacity: 0.8;
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--accent-primary);
    z-index: 10;
}

.drag-handle {
    cursor: grab;
    padding: 0.5rem;
    color: var(--text-muted);
    font-size: 1.5rem;
    user-select: none;
    touch-action: none;
}

.player-input-row input {
    border: none;
    background: transparent;
    padding: 0.5rem;
}

.btn-remove-player {
    background: transparent;
    border: none;
    color: var(--accent-danger);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 0.5rem;
}

/* Category Pills */
.pill-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cat-pill {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 999px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.cat-pill.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}