:root {
    --bg-dark: linear-gradient(135deg, #0a0a14 0%, #12101e 100%);
    --bg-card: #141420;
    --accent-primary: #a06cd5;
    --accent-secondary: #7b8ef8;
    --accent-warning: #f59e0b;
    --text-primary: #e2e2f0;
    --text-muted: #8888a4;
    --border-subtle: #2a2a3e;
    --glow-pink: 0 25px 50px -12px rgba(160, 108, 213, 0.25);
    --glow-green: 0 25px 50px -12px rgba(0, 229, 160, 0.25);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: #0a0a14;
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Animated background - disabled */
.bg-pattern {
    display: none;
}

.noise-overlay {
    display: none;
}

/* Secret corner trigger */
.secret-corner {
    position: fixed;
    top: 0;
    left: 0;
    width: 60px;
    height: 60px;
    cursor: pointer;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
}

.secret-corner:hover {
    opacity: 0.1;
    background: var(--accent-warning);
}

.secret-corner::after {
    content: '🔑';
    position: absolute;
    top: 5px;
    left: 5px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s;
}

.secret-corner:hover::after {
    opacity: 1;
}

/* Main container */
.game-container {
    position: relative;
    z-index: 10;
    max-width: 500px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.game-header {
    text-align: center;
    margin-bottom: 2rem;
}

.game-logo {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    animation: float 3s ease-in-out infinite;
}

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

.game-title {
    font-family: 'Space Mono', monospace;
    font-size: 2rem;
    font-weight: 700;
    color: white;
    letter-spacing: -1px;
}

.game-subtitle {
    font-size: 0.875rem;
    color: rgba(255,255,255,0.7);
    margin-top: 0.5rem;
    font-weight: 300;
}

/* Secret mode indicator */
.secret-mode-badge {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(255,170,0,0.15);
    border: 1px solid var(--accent-warning);
    color: var(--accent-warning);
    padding: 0.5rem 1rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-family: 'Space Mono', monospace;
    margin-top: 1rem;
}

.secret-mode-badge.active {
    display: inline-flex;
}

/* Screens */
.screen {
    display: none;
    animation: fadeIn 0.4s ease;
}

.screen.active {
    display: block;
}

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

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-family: 'Space Mono', monospace;
}

/* Form elements */
.input-group {
    margin-bottom: 1rem;
}

.input-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.text-input {
    width: 100%;
    background: #1a1a2e;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 0.875rem 1rem;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s;
}

.text-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(160, 108, 213, 0.2);
}

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

/* Player list */
.players-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.player-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #1a1a2e;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.player-number {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

.player-name {
    flex: 1;
    font-weight: 500;
}

.player-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.25rem;
    line-height: 1;
    transition: color 0.2s;
}

.player-remove:hover {
    color: var(--accent-primary);
}

/* Secret mode: impostor toggle */
.impostor-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.impostor-toggle.civilian {
    background: rgba(123, 142, 248, 0.15);
    color: var(--accent-secondary);
}

.impostor-toggle.impostor {
    background: rgba(160, 108, 213, 0.25);
    color: var(--accent-primary);
}

.secret-mode .impostor-toggle {
    display: block;
}

/* Categories */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.categories-grid::-webkit-scrollbar {
    width: 4px;
}

.categories-grid::-webkit-scrollbar-track {
    background: transparent;
}

.categories-grid::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 4px;
}

.category-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.875rem;
    background: #1a1a2e;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.category-chip:hover {
    background: #222238;
    transform: translateX(3px);
}

.category-chip.selected {
    background: var(--accent-secondary);
    border-color: var(--accent-secondary);
    color: white;
}

.category-checkbox {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-subtle);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.category-chip.selected .category-checkbox {
    background: rgba(255,255,255,0.9);
    border-color: rgba(255,255,255,0.9);
}

.category-checkbox::after {
    content: '✓';
    font-size: 10px;
    color: var(--accent-secondary);
    opacity: 0;
    transition: opacity 0.2s;
}

.category-chip.selected .category-checkbox::after {
    opacity: 1;
}

/* Impostor count selector */
.impostor-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.impostor-input {
    width: 80px;
    padding: 0.75rem 1rem;
    background: #1a1a2e;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
    font-family: inherit;
    transition: all 0.2s;
}

.impostor-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(160, 108, 213, 0.2);
}

.word-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #1a1a2e;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-family: inherit;
    transition: all 0.2s;
}

.word-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(160, 108, 213, 0.2);
}

.impostor-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), #ff6699);
    color: white;
    box-shadow: var(--glow-pink);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(160, 108, 213, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: #1a1a2e;
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: #222238;
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-secondary), #00cc88);
    color: var(--bg-dark);
    box-shadow: var(--glow-green);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(0,255,170,0.25);
}

/* Reveal screen */
.reveal-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
}

.reveal-player-name {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: rgba(255,255,255,0.7);
}

.reveal-player-name span {
    color: white;
}

.reveal-card {
    width: 280px;
    height: 380px;
    perspective: 1000px;
    cursor: pointer;
    margin-bottom: 2rem;
}

.reveal-card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.reveal-card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.reveal-card-front {
    background: linear-gradient(135deg, #1e1e3a 0%, #2a1a3e 100%);
    border: 2px solid rgba(123, 142, 248, 0.3);
}

.reveal-card-front::before {
    content: '?';
    font-size: 8rem;
    font-weight: 800;
    color: white;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

.reveal-card-front::after {
    content: 'Toca para revelar';
    position: absolute;
    bottom: 2rem;
    font-size: 0.875rem;
    color: rgba(255,255,255,0.7);
}

.reveal-card-back {
    background: #141420;
    border: 2px solid var(--accent-secondary);
    transform: rotateY(180deg);
}

.reveal-card-back.impostor {
    border-color: var(--accent-primary);
    box-shadow: var(--glow-pink);
}

.reveal-role {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 1rem;
    font-family: 'Space Mono', monospace;
}

.reveal-role.civilian {
    color: var(--accent-secondary);
}

.reveal-role.impostor {
    color: var(--accent-primary);
}

.reveal-word {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    word-break: break-word;
}

.reveal-word.impostor {
    color: var(--accent-primary);
}

.reveal-theme {
    font-size: 0.875rem;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    background: #1a1a2e;
    border-radius: 100px;
}

.reveal-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* Progress indicator */
.progress-bar {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
}

.progress-dot {
    flex: 1;
    height: 4px;
    background: var(--border-subtle);
    border-radius: 2px;
    transition: background 0.3s;
}

.progress-dot.done {
    background: var(--accent-secondary);
}

.progress-dot.current {
    background: var(--accent-primary);
}

/* Summary screen */
.summary-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
    color: white;
}

.summary-subtitle {
    text-align: center;
    color: rgba(255,255,255,0.7);
    margin-bottom: 2rem;
}

.summary-word-display {
    perspective: 800px;
    cursor: pointer;
    margin-bottom: 1.5rem;
}

.summary-word-card-inner {
    position: relative;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}

.summary-word-display.flipped .summary-word-card-inner {
    transform: rotateX(180deg);
}

.summary-word-front,
.summary-word-back {
    backface-visibility: hidden;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
}

.summary-word-front {
    background: linear-gradient(135deg, #1e1e3a 0%, #2a1a3e 100%);
    color: white;
}

.summary-word-front-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.summary-word-front-text {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.summary-word-front-hint {
    font-size: 0.875rem;
    opacity: 0.7;
}

.summary-word-back {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    transform: rotateX(180deg);
    background: #141420;
    border: 1px solid var(--accent-secondary);
}

.summary-word-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-secondary);
    margin-bottom: 0.5rem;
    font-family: 'Space Mono', monospace;
}

.summary-word {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.summary-theme {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.summary-word {
    font-size: 2.5rem;
    font-weight: 800;
}

.summary-theme {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.summary-players {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.summary-player-card {
    perspective: 800px;
    cursor: pointer;
}

.summary-player-card-inner {
    position: relative;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}

.summary-player-card.flipped .summary-player-card-inner {
    transform: rotateX(180deg);
}

.summary-player-front,
.summary-player-back {
    backface-visibility: hidden;
    border-radius: 10px;
    padding: 0.875rem 1rem;
}

.summary-player-front {
    background: linear-gradient(135deg, #1e1e3a 0%, #2a1a3e 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
}

.summary-player-front-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.summary-player-front-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.summary-player-front-name {
    font-weight: 500;
}

.summary-player-front-hint {
    font-size: 0.75rem;
    opacity: 0.7;
}

.summary-player-back {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    transform: rotateX(180deg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1a1a2e;
    border: 1px solid var(--border-subtle);
}

.summary-player {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.summary-player-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.summary-player-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.summary-player-avatar.civilian {
    background: rgba(123, 142, 248, 0.2);
}

.summary-player-avatar.impostor {
    background: rgba(160, 108, 213, 0.2);
}

.summary-player-name {
    font-weight: 500;
}

.summary-player-role {
    font-size: 0.75rem;
    font-family: 'Space Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
}

.summary-player-role.civilian {
    background: rgba(123, 142, 248, 0.15);
    color: var(--accent-secondary);
}

.summary-player-role.impostor {
    background: rgba(160, 108, 213, 0.2);
    color: var(--accent-primary);
}

/* Loading */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #2a2a3e;
    border-top-color: var(--accent-secondary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    margin-top: 1rem;
    color: var(--text-muted);
}

/* Messages */
.error-message {
    background: rgba(255,51,102,0.15);
    border: 1px solid #ff4466;
    color: #ff6680;
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 1rem;
}

/* Footer */
.footer {
    margin-top: auto;
    padding-top: 2rem;
    text-align: center;
    color: rgba(255,255,255,0.7);
    font-size: 0.75rem;
}

/* Responsive */
@media (max-width: 400px) {
    .game-title {
        font-size: 1.5rem;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .reveal-card {
        width: 240px;
        height: 320px;
    }
}