/* Charades 2025 - Retrofuture Edition */

:root {
    /* Core palette */
    --color-bg: #0d0d0f;
    --color-bg-elevated: #161619;
    --color-text: #f0f0f2;
    --color-text-dim: rgba(240, 240, 242, 0.6);

    /* Team colors - warm coral vs cool teal */
    --color-team-a: #ff6b6b;
    --color-team-a-deep: #e55555;
    --color-team-b: #4ecdc4;
    --color-team-b-deep: #3db8b0;

    /* Action colors */
    --color-positive: #00f5a0;
    --color-negative: #ff006e;
    --color-warning: #ff4d00;

    /* Atmosphere */
    --glow-team-a: rgba(255, 107, 107, 0.4);
    --glow-team-b: rgba(78, 205, 196, 0.4);
    --glow-positive: rgba(0, 245, 160, 0.3);
}

* {
    box-sizing: border-box;
}

/* Base body with atmospheric gradient */
body {
    font-family: 'Exo 2', sans-serif;
    font-weight: 400;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    color: var(--color-text);
    background:
        radial-gradient(ellipse at 20% 0%, rgba(255, 107, 107, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(78, 205, 196, 0.08) 0%, transparent 50%),
        var(--color-bg);
    background-attachment: fixed;
}

/* Subtle noise texture overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
    z-index: 0;
}

/* Player View */
main {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 60px);
    padding: 1rem;
    padding-top: 60px;
    text-align: center;
}

.screen {
    width: 100%;
    max-width: 400px;
    animation: fadeIn 0.2s ease-out;
}

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

.hidden {
    display: none !important;
}

/* Timer - Dramatic presence */
.timer {
    position: fixed;
    top: 70px;
    right: 1rem;
    font-size: 2.2rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    padding: 0.6rem 1.2rem;
    background: var(--color-bg-elevated);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 100;
    transition: all 0.15s ease;
}

.timer.warning {
    color: var(--color-warning);
    border-color: var(--color-warning);
    box-shadow: 0 0 30px rgba(255, 77, 0, 0.4), 0 4px 20px rgba(0, 0, 0, 0.4);
    animation: timerPulse 0.4s ease-in-out infinite;
}

@keyframes timerPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 30px rgba(255, 77, 0, 0.4), 0 4px 20px rgba(0, 0, 0, 0.4);
    }
    50% {
        transform: scale(1.03);
        box-shadow: 0 0 40px rgba(255, 77, 0, 0.5), 0 4px 20px rgba(0, 0, 0, 0.4);
    }
}

/* Menu Screen */
.title {
    font-size: 3.5rem;
    font-weight: 100;
    font-style: italic;
    letter-spacing: -1px;
    margin: 0;
    background: linear-gradient(135deg, var(--color-text) 0%, rgba(240, 240, 242, 0.7) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1rem;
    font-weight: 300;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin: 0.5rem 0 2.5rem;
    color: var(--color-text-dim);
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    margin-bottom: 2rem;
}

.prompt-set-selector {
    margin-bottom: 1rem;
}

.prompt-set-selector label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--color-text-dim);
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.prompt-set-selector select {
    font-family: inherit;
    font-size: 1rem;
    padding: 0.75rem 1rem;
    background: var(--color-bg-elevated);
    color: var(--color-text);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.prompt-set-selector select:hover {
    border-color: rgba(255, 255, 255, 0.3);
}

/* Buttons - Refined with glow effects */
.button {
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    width: 100%;
    padding: 1rem 2rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, var(--color-positive) 0%, #00d68f 100%);
    box-shadow: 0 4px 15px rgba(0, 245, 160, 0.25);
    transition: transform 0.1s ease, box-shadow 0.1s ease, opacity 0.1s ease;
    -webkit-appearance: none;
    position: relative;
    overflow: hidden;
}

.button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 50%);
    pointer-events: none;
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 245, 160, 0.35);
}

.button:active {
    transform: translateY(0) scale(0.98);
}

.button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.button.positive {
    background: linear-gradient(135deg, var(--color-positive) 0%, #00d68f 100%);
    box-shadow: 0 4px 15px var(--glow-positive);
}

.button.negative {
    background: linear-gradient(135deg, var(--color-negative) 0%, #d4005a 100%);
    box-shadow: 0 4px 15px rgba(255, 0, 110, 0.3);
}

.button.negative:hover {
    box-shadow: 0 6px 25px rgba(255, 0, 110, 0.45);
}

.button.team-red {
    background: linear-gradient(135deg, var(--color-team-a) 0%, var(--color-team-a-deep) 100%);
    box-shadow: 0 4px 15px var(--glow-team-a);
    color: #0d0d0f;
}

.button.team-red:hover {
    box-shadow: 0 6px 25px rgba(255, 107, 107, 0.5);
}

.button.team-blue {
    background: linear-gradient(135deg, var(--color-team-b) 0%, var(--color-team-b-deep) 100%);
    box-shadow: 0 4px 15px var(--glow-team-b);
    color: #0d0d0f;
}

.button.team-blue:hover {
    box-shadow: 0 6px 25px rgba(78, 205, 196, 0.5);
}

.button.new-game {
    background: var(--color-bg-elevated);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: none;
    font-size: 1rem;
}

.button.new-game:hover {
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.button.back-button {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: none;
    font-size: 0.95rem;
    font-weight: 400;
    margin-top: 1rem;
    color: var(--color-text-dim);
}

.button.back-button:hover {
    border-color: rgba(255, 255, 255, 0.4);
    color: var(--color-text);
}

.button.small {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    width: auto;
}

.button.end-turn {
    background: var(--color-bg-elevated);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: none;
    font-size: 0.9rem;
    font-weight: 400;
    margin-top: 2rem;
    color: var(--color-text-dim);
}

.button.end-turn:hover {
    border-color: rgba(255, 255, 255, 0.25);
    color: var(--color-text);
}

/* Game Screens */
.phase-label {
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0 0 1.5rem;
    color: var(--color-text-dim);
}

.prompt {
    font-size: 2rem;
    font-weight: 200;
    font-style: italic;
    line-height: 1.35;
    margin: 0 0 1rem;
    color: var(--color-text);
}

.year {
    font-size: 4.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    margin: 0 0 1rem;
    background: linear-gradient(135deg, var(--color-positive) 0%, #00d68f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.points {
    font-size: 2rem;
    font-weight: 300;
    margin: 0 0 2rem;
}

.info {
    font-size: 0.85rem;
    color: var(--color-text-dim);
    margin: 1rem 0;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.action-buttons .button {
    flex: 1;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.15s ease-out;
}

.modal {
    background: var(--color-bg-elevated);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 16px;
    max-width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal p {
    margin: 0 0 1.5rem;
    font-size: 1.1rem;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
}

.modal-buttons .button {
    flex: 1;
}

/* Live View */
.live-view {
    min-height: 100vh;
    padding: 1rem;
    padding-top: 70px;
}

.scoreboard {
    display: flex;
    gap: 2rem;
    height: calc(100vh - 170px);
}

.team-panel {
    flex: 1;
    padding: 2rem;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.team-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, transparent 40%);
    pointer-events: none;
}

.team-panel.red {
    background: linear-gradient(145deg, var(--color-team-a) 0%, var(--color-team-a-deep) 100%);
    box-shadow: 0 10px 40px var(--glow-team-a);
}

.team-panel.blue {
    background: linear-gradient(145deg, var(--color-team-b) 0%, var(--color-team-b-deep) 100%);
    box-shadow: 0 10px 40px var(--glow-team-b);
    color: #0d0d0f;
}

.team-panel h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 1rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    white-space: nowrap;
}

.score {
    font-size: 7rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 1.5rem;
    font-variant-numeric: tabular-nums;
}

.turn-history {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.turn-entry {
    font-size: 1.1rem;
    font-weight: 500;
    padding: 0.6rem 0.8rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    backdrop-filter: blur(4px);
}

.turn-entry.current {
    background: rgba(255, 255, 255, 0.25);
    animation: entryPulse 1s ease-in-out infinite;
}

@keyframes entryPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.game-info {
    display: flex;
    justify-content: center;
    gap: 4rem;
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: var(--color-bg-elevated);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.info-item {
    text-align: center;
}

.info-item .label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--color-text-dim);
    margin-bottom: 0.25rem;
}

.info-item .value {
    font-size: 1.4rem;
    font-weight: 600;
}

.team-red {
    color: var(--color-team-a);
}

.team-blue {
    color: var(--color-team-b);
}

/* Admin View */
main.admin-view {
    min-height: 100vh;
    padding: 1rem;
    padding-top: 60px;
    max-width: 600px;
    margin: 0 auto;
    align-items: stretch;
    justify-content: flex-start;
}

.admin-view h1 {
    text-align: center;
    margin-bottom: 2rem;
    font-weight: 300;
    font-style: italic;
}

.admin-view h2 {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 2rem 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--color-text-dim);
}

.pool-section,
.used-section {
    margin-bottom: 1rem;
    width: 100%;
}

.prompt-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.prompt-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    background: var(--color-bg-elevated);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    width: 100%;
    transition: border-color 0.2s ease;
}

.prompt-item:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.prompt-item .button.small {
    min-width: 80px;
    flex-shrink: 0;
}

.prompt-text {
    flex: 1;
    font-size: 0.9rem;
    margin-right: 1rem;
    text-align: left;
    color: var(--color-text);
}

.admin-actions {
    margin-top: 2rem;
    text-align: center;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .scoreboard {
        flex-direction: column;
        height: auto;
    }

    .team-panel {
        padding: 1.5rem;
    }

    .score {
        font-size: 5rem;
    }

    .game-info {
        flex-direction: column;
        gap: 1rem;
    }

    .title {
        font-size: 2.5rem;
    }

    .prompt {
        font-size: 1.6rem;
    }

    .year {
        font-size: 3.5rem;
    }
}
