:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --danger-color: #ef4444;
    --success-color: #22c55e;
    --warning-grad: linear-gradient(135deg, #f59e0b, #d97706);
    --primary-grad: linear-gradient(135deg, #3b82f6, #6366f1);

    --radius-lg: 16px;
    --radius-md: 12px;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    overflow-x: hidden;
}

.app-container {
    width: 100%;
    max-width: 480px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 100vh;
}

header {
    text-align: center;
    margin-bottom: 32px;
}

header h1 {
    font-weight: 700;
    font-size: 2rem;
    background: var(--primary-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

.screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.4s ease-out;
}

.screen.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    background-color: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.centered-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 24px;
}

h2 {
    font-weight: 600;
    font-size: 1.5rem;
}

p {
    color: var(--text-secondary);
    line-height: 1.5;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-group label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.player-count-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px;
    border-radius: var(--radius-md);
}

.player-count-display {
    font-size: 1.5rem;
    font-weight: 700;
}

#player-count-display {
    font-size: 1.8rem;
    font-weight: 700;
}

.icon-btn {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: transform 0.1s;
}

.icon-btn:active {
    transform: scale(0.95);
}

.btn-primary {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--primary-grad);
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    transition: opacity 0.2s, transform 0.1s;
    margin-top: auto;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.category-grid,
.voting-grid,
.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
}

.grid-btn {
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.grid-btn.selected {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--accent-color);
    color: white;
}

.role-display {
    padding: 32px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    text-align: center;
    border: 1px dashed var(--text-secondary);
}

.role-display h3 {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.role-display .secret-word {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent-color);
    text-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.role-display .imposter-text {
    font-size: 2rem;
    font-weight: 800;
    color: var(--danger-color);
    text-transform: uppercase;
}

.icon-box {
    font-size: 4rem;
    margin-bottom: 16px;
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.timer-display {
    font-size: 4rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -2px;
}

.warning-card {
    border: 1px solid var(--danger-color);
}

.result-details {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: var(--radius-md);
    width: 100%;
}

.result-details p {
    margin: 8px 0;
    display: flex;
    justify-content: space-between;
}

strong {
    color: white;
}