/* ===== MUTE NYT! - Stylesheet ===== */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Arial, Helvetica, sans-serif;
    background-color: #1a1a2e;
    color: #e0e0e0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* --- Game Container --- */
.game-container {
    width: 100%;
    max-width: 600px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* --- Header --- */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background-color: #16213e;
    border-bottom: 2px solid #0f3460;
}

.game-title {
    font-size: 1.5rem;
    font-weight: 900;
    color: #e94560;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.header-info {
    display: flex;
    gap: 16px;
    font-size: 0.9rem;
}

.score-display {
    color: #4ecca3;
    font-weight: bold;
}

.best-display {
    color: #a0a0a0;
}

/* --- Main Game Area --- */
.game-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
}

/* --- Video Tiles --- */
.video-tile {
    background-color: #16213e;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    border: 2px solid #0f3460;
    position: relative;
}

.teacher-tile {
    min-height: 180px;
}

.student-tile {
    min-height: 160px;
}

.avatar {
    font-size: 4rem;
    line-height: 1;
}

.tile-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
}

.dialogue-bubble {
    background-color: #0f3460;
    border-radius: 12px;
    padding: 10px 16px;
    font-style: italic;
    color: #c0c0c0;
    text-align: center;
    width: 100%;
    max-width: 320px;
    margin-top: 4px;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* --- Mic Status --- */
.mic-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    transition: background-color 0.3s, color 0.3s;
}

.mic-status.unmuted {
    background-color: rgba(233, 69, 96, 0.2);
    color: #e94560;
}

.mic-status.muted {
    background-color: rgba(78, 204, 163, 0.2);
    color: #4ecca3;
}

@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 0 0 rgba(233, 69, 96, 0.6); }
    50% { box-shadow: 0 0 0 10px rgba(233, 69, 96, 0); }
}

.mic-status.unmuted .mic-icon {
    animation: pulse-red 1.5s ease-in-out infinite;
}

/* --- Controls Section --- */
.game-controls {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    background-color: #16213e;
    border-top: 2px solid #0f3460;
}

/* --- Risk Meter --- */
.risk-meter-container {
    width: 100%;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.risk-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    white-space: nowrap;
}

.risk-meter {
    flex: 1;
    height: 12px;
    background-color: #0f3460;
    border-radius: 6px;
    overflow: hidden;
}

.risk-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4ecca3, #f0c040, #e94560);
    border-radius: 6px;
    transition: width 0.3s ease;
}

.risk-percent {
    font-size: 0.9rem;
    font-weight: bold;
    color: #e94560;
    min-width: 40px;
    text-align: right;
}

/* --- Warning Text --- */
.warning-text {
    color: #f0c040;
    font-weight: bold;
    font-size: 0.9rem;
    text-align: center;
    animation: shake 0.5s ease-in-out infinite;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* --- Countdown --- */
.countdown-display {
    text-align: center;
}

.countdown-number {
    font-size: 3rem;
    font-weight: 900;
    color: #e94560;
    font-variant-numeric: tabular-nums;
}

.countdown-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
}

/* --- Mute Button --- */
.mute-button {
    width: 100%;
    max-width: 300px;
    padding: 20px 32px;
    font-size: 1.3rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    background: linear-gradient(135deg, #e94560, #c23152);
    color: #fff;
    box-shadow: 0 4px 15px rgba(233, 69, 96, 0.4);
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.3s;
}

.mute-button:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(233, 69, 96, 0.6);
}

.mute-button:active:not(:disabled) {
    transform: scale(0.97);
}

.mute-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.mute-button.muted-state {
    background: linear-gradient(135deg, #4ecca3, #38a884);
    box-shadow: 0 4px 15px rgba(78, 204, 163, 0.4);
}

/* --- Hint Text --- */
.hint-text {
    font-size: 0.75rem;
    color: #666;
    text-align: center;
}

/* --- Overlays --- */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 10, 20, 0.92);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.overlay-content {
    text-align: center;
    padding: 40px;
    max-width: 450px;
}

.overlay-content h2 {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.overlay-content p {
    font-size: 1rem;
    line-height: 1.6;
    color: #c0c0c0;
    margin-bottom: 12px;
}

.start-button,
.restart-button,
.continue-button {
    padding: 16px 40px;
    font-size: 1.2rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    margin-top: 20px;
    transition: transform 0.15s;
}

.start-button {
    background: linear-gradient(135deg, #e94560, #c23152);
    color: #fff;
    box-shadow: 0 4px 15px rgba(233, 69, 96, 0.4);
}

.start-button:hover {
    transform: scale(1.05);
}

.restart-button {
    background: linear-gradient(135deg, #4ecca3, #38a884);
    color: #fff;
    box-shadow: 0 4px 15px rgba(78, 204, 163, 0.4);
}

.restart-button:hover {
    transform: scale(1.05);
}

.continue-button {
    background: linear-gradient(135deg, #f0c040, #d4a020);
    color: #fff;
    box-shadow: 0 4px 15px rgba(240, 192, 64, 0.4);
}

.continue-button:hover {
    transform: scale(1.05);
}

.start-hint {
    font-size: 0.8rem;
    color: #666;
    margin-top: 8px;
}

/* --- Result Screen --- */
.result-icon {
    font-size: 5rem;
    margin-bottom: 12px;
}

.result-details {
    background-color: rgba(15, 52, 96, 0.6);
    border-radius: 12px;
    padding: 16px;
    margin: 16px 0;
}

.result-details p {
    margin-bottom: 4px;
    font-size: 1rem;
}

/* --- Screen Shake (failure) --- */
@keyframes screen-shake {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-8px, -4px); }
    20% { transform: translate(8px, 4px); }
    30% { transform: translate(-6px, 6px); }
    40% { transform: translate(6px, -6px); }
    50% { transform: translate(-4px, 2px); }
    60% { transform: translate(4px, -2px); }
    70% { transform: translate(-2px, 4px); }
    80% { transform: translate(2px, -4px); }
    90% { transform: translate(-1px, 1px); }
}

.shake {
    animation: screen-shake 0.5s ease-in-out;
}

/* --- Student nervous animation --- */
@keyframes nervous {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-3deg); }
    75% { transform: rotate(3deg); }
}

.student-avatar.nervous {
    animation: nervous 0.4s ease-in-out infinite;
}

/* --- Responsive --- */
@media (max-width: 480px) {
    .game-title {
        font-size: 1.1rem;
    }

    .header-info {
        gap: 8px;
        font-size: 0.75rem;
    }

    .avatar {
        font-size: 3rem;
    }

    .countdown-number {
        font-size: 2.2rem;
    }

    .mute-button {
        font-size: 1.1rem;
        padding: 16px 24px;
    }

    .overlay-content h2 {
        font-size: 1.8rem;
    }

    .overlay-content {
        padding: 24px;
    }
}
