/* ============ IMPOSTORE GAME STYLES ============ */

:root {
    --imp-red: #dc2626;
    --imp-red-dark: #991b1b;
    --imp-black: #0a0a0a;
    --imp-dark: #1a1a2e;
    --imp-darker: #0f0f1b;
    --imp-gold: #f59e0b;
    --imp-green: #22c55e;
}

/* ============ HOME PAGE ============ */

.imp-landing {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 40px 20px;
    max-width: 500px;
    margin: 0 auto;
}

.imp-logo-icon {
    font-size: 5rem;
    margin-bottom: 10px;
    display: block;
    animation: imp-float 3s ease-in-out infinite;
}

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

.imp-logo {
    font-size: 2.8rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
}

.imp-tagline {
    font-size: 1.1rem;
    color: var(--gray);
    margin-bottom: 40px;
    text-align: center;
}

.imp-back-link {
    position: absolute;
    top: 20px;
    left: 20px;
    color: var(--gray);
    text-decoration: none;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s;
}

.imp-back-link:hover {
    color: var(--light);
}

/* Setup Form */
.imp-setup {
    width: 100%;
}

.imp-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.imp-section-title {
    font-size: 1.1rem;
    color: var(--light);
    margin-bottom: 15px;
    font-weight: bold;
}

/* Categories grid */
.imp-categories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.imp-cat-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    color: var(--light);
    border: 1px solid transparent;
}

.imp-cat-label:hover {
    background: rgba(220, 38, 38, 0.15);
}

.imp-cat-label input[type="checkbox"] {
    accent-color: var(--imp-red);
    width: 18px;
    height: 18px;
}

.imp-cat-label.selected {
    border-color: var(--imp-red);
    background: rgba(220, 38, 38, 0.2);
}

/* Player count */
.imp-player-count {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.imp-count-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--imp-red);
    background: transparent;
    color: var(--light);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.imp-count-btn:hover {
    background: var(--imp-red);
}

.imp-count-display {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--light);
    min-width: 50px;
    text-align: center;
}

/* Player names */
.imp-names-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.imp-name-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--light);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.imp-name-input:focus {
    border-color: var(--imp-red);
}

.imp-name-input::placeholder {
    color: var(--gray);
}

/* Start button */
.imp-start-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--imp-red) 0%, var(--imp-red-dark) 100%);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 1.3rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 10px;
}

.imp-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(220, 38, 38, 0.4);
}

.imp-start-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ============ PLAY PAGE ============ */

.imp-game-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

/* Phase: Pass Phone */
.imp-phase {
    display: none;
    width: 100%;
    animation: imp-fadeIn 0.4s ease;
}

.imp-phase.active {
    display: flex;
    flex-direction: column;
    align-items: center;
}

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

.imp-pass-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: imp-float 2s ease-in-out infinite;
}

.imp-pass-text {
    font-size: 1.5rem;
    color: var(--gray);
    margin-bottom: 10px;
}

.imp-player-name {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--light);
    margin-bottom: 30px;
}

.imp-action-btn {
    padding: 18px 40px;
    border-radius: 14px;
    border: none;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
    width: 100%;
    max-width: 350px;
}

.imp-action-btn:hover {
    transform: translateY(-2px);
}

.imp-btn-red {
    background: linear-gradient(135deg, var(--imp-red) 0%, var(--imp-red-dark) 100%);
    color: white;
}

.imp-btn-red:hover {
    box-shadow: 0 10px 30px rgba(220, 38, 38, 0.4);
}

.imp-btn-green {
    background: linear-gradient(135deg, var(--imp-green) 0%, #16a34a 100%);
    color: white;
}

.imp-btn-green:hover {
    box-shadow: 0 10px 30px rgba(34, 197, 94, 0.4);
}

.imp-btn-gold {
    background: linear-gradient(135deg, var(--imp-gold) 0%, #d97706 100%);
    color: white;
}

.imp-btn-gold:hover {
    box-shadow: 0 10px 30px rgba(245, 158, 11, 0.4);
}

/* Phase: Reveal Role */
.imp-role-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 40px 30px;
    margin-bottom: 30px;
    width: 100%;
    border: 2px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.imp-role-card.civilian {
    border-color: rgba(34, 197, 94, 0.5);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(22, 163, 74, 0.05) 100%);
}

.imp-role-card.impostor {
    border-color: rgba(220, 38, 38, 0.5);
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.15) 0%, rgba(153, 27, 27, 0.1) 100%);
    animation: imp-pulse-border 2s ease-in-out infinite;
}

@keyframes imp-pulse-border {
    0%, 100% { border-color: rgba(220, 38, 38, 0.5); }
    50% { border-color: rgba(220, 38, 38, 1); }
}

.imp-role-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--gray);
    margin-bottom: 15px;
}

.imp-secret-word {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--imp-green);
    margin-bottom: 10px;
    word-break: break-word;
}

.imp-impostor-text {
    font-size: 2rem;
    font-weight: bold;
    color: var(--imp-red);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.imp-hint-text {
    font-size: 1.1rem;
    color: var(--imp-gold);
    padding: 10px 16px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 10px;
    display: inline-block;
}

.imp-category-label {
    font-size: 0.9rem;
    color: var(--gray);
    margin-top: 10px;
}

/* Phase: Discussion */
.imp-timer-container {
    margin-bottom: 30px;
    width: 100%;
}

.imp-timer-display {
    font-size: 4rem;
    font-weight: bold;
    color: var(--light);
    margin-bottom: 15px;
    font-variant-numeric: tabular-nums;
}

.imp-timer-display.warning {
    color: var(--imp-gold);
}

.imp-timer-display.danger {
    color: var(--imp-red);
    animation: imp-blink 0.5s ease-in-out infinite;
}

@keyframes imp-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.imp-timer-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.imp-timer-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--imp-green), var(--imp-gold), var(--imp-red));
    border-radius: 4px;
    transition: width 1s linear;
}

.imp-timer-options {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.imp-timer-option {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: var(--light);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.imp-timer-option:hover {
    background: rgba(220, 38, 38, 0.2);
}

.imp-timer-option.selected {
    border-color: var(--imp-red);
    background: rgba(220, 38, 38, 0.3);
}

.imp-players-order {
    width: 100%;
    margin-top: 20px;
}

.imp-players-order-title {
    font-size: 0.9rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.imp-players-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.imp-player-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    color: var(--light);
    font-size: 1rem;
}

.imp-player-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(220, 38, 38, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: bold;
    flex-shrink: 0;
}

/* Phase: Vote */
.imp-vote-for {
    font-size: 1.3rem;
    color: var(--gray);
    margin-bottom: 10px;
}

.imp-voter-name {
    font-size: 2rem;
    font-weight: bold;
    color: var(--light);
    margin-bottom: 25px;
}

.imp-vote-grid {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.imp-vote-btn {
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--light);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.imp-vote-btn:hover {
    border-color: var(--imp-red);
    background: rgba(220, 38, 38, 0.15);
}

.imp-vote-btn.selected {
    border-color: var(--imp-red);
    background: rgba(220, 38, 38, 0.3);
}

/* Phase: Result */
.imp-result-icon {
    font-size: 5rem;
    margin-bottom: 20px;
}

.imp-result-title {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 15px;
}

.imp-result-title.civilian-win {
    color: var(--imp-green);
}

.imp-result-title.impostor-win {
    color: var(--imp-red);
}

.imp-result-info {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.imp-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--light);
    font-size: 1rem;
}

.imp-result-row:last-child {
    border-bottom: none;
}

.imp-result-label {
    color: var(--gray);
}

.imp-result-value {
    font-weight: bold;
}

.imp-result-value.impostor {
    color: var(--imp-red);
}

.imp-result-value.word {
    color: var(--imp-green);
}

.imp-votes-summary {
    width: 100%;
    margin-bottom: 20px;
}

.imp-votes-title {
    font-size: 0.9rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.imp-vote-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 6px;
    color: var(--light);
}

.imp-vote-count {
    background: rgba(220, 38, 38, 0.3);
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 0.9rem;
}

/* Guess phase (impostor guesses the word) */
.imp-guess-input {
    width: 100%;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    color: var(--light);
    font-size: 1.2rem;
    text-align: center;
    outline: none;
    margin-bottom: 15px;
    box-sizing: border-box;
}

.imp-guess-input:focus {
    border-color: var(--imp-red);
}

/* Button group */
.imp-btn-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 350px;
    margin-top: 20px;
}

/* Progress indicator */
.imp-progress {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
}

.imp-progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
}

.imp-progress-dot.done {
    background: var(--imp-green);
}

.imp-progress-dot.current {
    background: var(--imp-red);
    animation: imp-pulse-dot 1s ease-in-out infinite;
}

@keyframes imp-pulse-dot {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.4); }
}

/* Anti-peek overlay */
.imp-anti-peek {
    position: fixed;
    inset: 0;
    background: var(--imp-darker);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: imp-fadeIn 0.2s ease;
}

.imp-anti-peek-text {
    font-size: 1.2rem;
    color: var(--gray);
    margin-bottom: 10px;
}

.imp-anti-peek-timer {
    font-size: 3rem;
    font-weight: bold;
    color: var(--imp-red);
}

/* ============ RESPONSIVE ============ */

@media (max-width: 600px) {
    .imp-logo {
        font-size: 2rem;
    }

    .imp-logo-icon {
        font-size: 3.5rem;
    }

    .imp-player-name {
        font-size: 2rem;
    }

    .imp-secret-word {
        font-size: 2rem;
    }

    .imp-impostor-text {
        font-size: 1.6rem;
    }

    .imp-timer-display {
        font-size: 3rem;
    }

    .imp-result-title {
        font-size: 1.6rem;
    }

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

    .imp-cat-label {
        font-size: 0.8rem;
        padding: 8px 10px;
    }
}
