@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Russo+One&family=Orbitron:wght@400;700;900&display=swap');

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

:root {
    --danger-red: #dc2626;
    --danger-dark: #991b1b;
    --blood-red: #7f1d1d;
    --neon-red: #ff3333;
    --safe-green: #22c55e;
    --safe-glow: #4ade80;
    --metal-dark: #1a1a1a;
    --metal-mid: #2d2d2d;
    --metal-light: #3d3d3d;
    --gold: #f59e0b;
    --gold-bright: #fbbf24;
    --chrome: #9ca3af;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
}

body {
    font-family: 'Russo One', 'Bebas Neue', sans-serif;
    background: radial-gradient(ellipse at center, #1a1a2e 0%, #0f0f1a 50%, #000000 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    width: 100vw;
    max-width: 100vw;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.1) 2px,
            rgba(0, 0, 0, 0.1) 4px
        );
    pointer-events: none;
    z-index: 1000;
    opacity: 0.3;
}

/* Force landscape orientation for game screens */
@media screen and (orientation: portrait) {
    #gameScreen.active,
    #adScreen.active,
    #gameOverScreen.active {
        transform: rotate(90deg);
        transform-origin: center center;
        width: 100vh;
        height: 100vw;
        position: fixed;
        top: 50%;
        left: 50%;
        margin-left: -50vh;
        margin-top: -50vw;
    }
}

.screen {
    display: none;
    height: 100vh;
    max-height: 100vh;
    padding: 10px;
    animation: screenFadeIn 0.5s ease-out;
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
    overflow-y: hidden;
    box-sizing: border-box;
    position: relative;
}

#setupScreen {
    overflow-y: auto;
    min-height: 100vh;
    height: auto;
}

#setupScreen.active {
    align-items: flex-start;
    justify-content: flex-start;
}

.screen.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes screenFadeIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
}

/* Horizontal/landscape optimized containers */
#gameScreen .container,
#adScreen .container,
#gameOverScreen .container {
    max-width: calc(100vw - 20px);
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);
    max-height: calc(100vh - 20px);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 15px 10px;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
}

#gameScreen .container {
    max-width: calc(100vw - 20px);
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);
    max-height: calc(100vh - 20px);
    padding: 10px;
}

/* Typography */
h1 {
    font-family: 'Bebas Neue', 'Russo One', sans-serif;
    font-size: 3rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    background: linear-gradient(180deg, #ffffff 0%, #dc2626 50%, #7f1d1d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 4px 8px rgba(220, 38, 38, 0.4));
    position: relative;
}

h1::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--danger-red), transparent);
}

h2 {
    font-family: 'Russo One', sans-serif;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Setup Screen */
#setupScreen {
    overflow-y: auto;
    min-height: 100vh;
    height: auto;
    padding-top: 2rem;
    padding-bottom: 2rem;
    background: 
        radial-gradient(circle at 20% 20%, rgba(220, 38, 38, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(220, 38, 38, 0.1) 0%, transparent 40%),
        radial-gradient(ellipse at center, #1a1a2e 0%, #0f0f1a 50%, #000000 100%);
}

#setupScreen .container {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.setup-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Game Logo */
.game-logo {
    max-width: 100%;
    height: auto;
    max-height: 200px;
    margin-bottom: 1rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
    filter: drop-shadow(0 4px 8px rgba(220, 38, 38, 0.4));
    animation: logoGlow 3s ease-in-out infinite;
}

@keyframes logoGlow {
    0%, 100% { 
        filter: drop-shadow(0 4px 8px rgba(220, 38, 38, 0.4));
    }
    50% { 
        filter: drop-shadow(0 6px 12px rgba(220, 38, 38, 0.6));
    }
}

/* Responsive logo sizing */
@media screen and (max-width: 480px) {
    .game-logo {
        max-height: 150px;
    }
}

/* How to Play Section */
.how-to-play {
    margin-top: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(45, 45, 45, 0.8) 0%, rgba(26, 26, 26, 0.9) 100%);
    border-radius: 12px;
    border: 1px solid var(--danger-red);
    box-shadow: 
        0 0 20px rgba(220, 38, 38, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.how-to-play::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon-red), transparent);
    animation: scanLine 3s linear infinite;
}

@keyframes scanLine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.how-to-play h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

.how-to-play ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.how-to-play li {
    font-family: 'Russo One', sans-serif;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
    padding-left: 2rem;
    position: relative;
}

.how-to-play li::before {
    content: "🎯";
    position: absolute;
    left: 0;
    font-size: 1rem;
}

/* Form Controls */
.chamber-selector,
.countdown-selector {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chamber-selector label,
.countdown-selector label {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
}

.chamber-selector select,
.countdown-selector select {
    padding: 14px 16px;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    border-radius: 8px;
    border: 2px solid var(--metal-light);
    background: linear-gradient(180deg, var(--metal-mid) 0%, var(--metal-dark) 100%);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23dc2626' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
}

.chamber-selector select:hover,
.countdown-selector select:hover {
    border-color: var(--danger-red);
    box-shadow: 0 0 15px rgba(220, 38, 38, 0.3);
}

.chamber-selector select:focus,
.countdown-selector select:focus {
    outline: none;
    border-color: var(--neon-red);
    box-shadow: 0 0 20px rgba(255, 51, 51, 0.4);
}

/* Players Section */
.players-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.players-section h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--gold);
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

#playersList {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.player-input {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    animation: slideIn 0.3s ease-out;
}

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

.player-name {
    flex: 1;
    padding: 14px 16px;
    font-family: 'Russo One', sans-serif;
    font-size: 1rem;
    border-radius: 8px;
    border: 2px solid var(--metal-light);
    background: linear-gradient(180deg, var(--metal-mid) 0%, var(--metal-dark) 100%);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.player-name::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.player-name:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
}

.remove-player {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 2px solid var(--danger-red);
    background: transparent;
    color: var(--danger-red);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.remove-player:hover {
    background: var(--danger-red);
    color: var(--text-primary);
    box-shadow: 0 0 15px rgba(220, 38, 38, 0.5);
    transform: scale(1.05);
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 16px 32px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.4rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(180deg, var(--danger-red) 0%, var(--danger-dark) 50%, var(--blood-red) 100%);
    color: var(--text-primary);
    border: 2px solid var(--neon-red);
    box-shadow: 
        0 4px 15px rgba(220, 38, 38, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    background: linear-gradient(180deg, var(--neon-red) 0%, var(--danger-red) 50%, var(--danger-dark) 100%);
    box-shadow: 
        0 6px 25px rgba(255, 51, 51, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(220, 38, 38, 0.4);
}

.btn-secondary {
    background: linear-gradient(180deg, var(--metal-light) 0%, var(--metal-mid) 50%, var(--metal-dark) 100%);
    color: var(--text-primary);
    border: 2px solid var(--chrome);
    box-shadow: 
        0 4px 10px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    border-color: var(--gold);
    box-shadow: 
        0 6px 20px rgba(245, 158, 11, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

/* Game Screen */
#gameScreen {
    background: 
        radial-gradient(circle at center, rgba(220, 38, 38, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at center, #1a1a2e 0%, #0f0f1a 50%, #000000 100%);
}

.round-indicator {
    margin-bottom: 0.5rem;
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    opacity: 0.9;
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 20px;
    border-radius: 20px;
    border: 1px solid var(--chrome);
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

.player-display {
    margin-bottom: 1rem;
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.player-display h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2rem;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    color: var(--gold);
    letter-spacing: 0.1em;
}

.countdown-container {
    margin: 0;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.countdown {
    font-family: 'Orbitron', sans-serif;
    font-size: min(25vw, 30vh);
    font-weight: 900;
    color: var(--neon-red);
    text-shadow: 
        0 0 20px var(--danger-red),
        0 0 40px var(--danger-red),
        0 0 60px rgba(220, 38, 38, 0.5);
    animation: countdownPulse 1s ease-in-out infinite;
}

@keyframes countdownPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.9;
    }
}

/* Result Display */
.result-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    box-sizing: border-box;
    overflow: hidden;
}

.result-container.hidden {
    display: none;
}

.result {
    font-family: 'Bebas Neue', sans-serif;
    font-size: min(25vw, 30vh);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    max-width: 100vw;
    word-wrap: break-word;
    overflow-wrap: break-word;
    padding: 0 20px;
    box-sizing: border-box;
    animation: resultAppear 0.5s ease-out;
}

@keyframes resultAppear {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.result.alive {
    color: var(--safe-green);
    text-shadow: 
        0 0 20px var(--safe-green),
        0 0 40px var(--safe-green),
        0 0 80px rgba(34, 197, 94, 0.5);
    background: radial-gradient(circle at center, rgba(34, 197, 94, 0.2) 0%, transparent 60%);
}

.result.dead {
    color: var(--neon-red);
    text-shadow: 
        0 0 20px var(--danger-red),
        0 0 40px var(--danger-red),
        0 0 80px rgba(220, 38, 38, 0.8);
    background: radial-gradient(circle at center, rgba(220, 38, 38, 0.3) 0%, rgba(127, 29, 29, 0.2) 40%, transparent 70%);
    animation: resultAppear 0.5s ease-out, deathShake 0.5s ease-in-out;
}

@keyframes deathShake {
    0%, 100% { transform: translateX(0) rotate(0); }
    10% { transform: translateX(-15px) rotate(-2deg); }
    20% { transform: translateX(15px) rotate(2deg); }
    30% { transform: translateX(-15px) rotate(-2deg); }
    40% { transform: translateX(15px) rotate(2deg); }
    50% { transform: translateX(-10px) rotate(-1deg); }
    60% { transform: translateX(10px) rotate(1deg); }
    70% { transform: translateX(-5px) rotate(0); }
    80% { transform: translateX(5px) rotate(0); }
}

/* Next Round Screen */
#adScreen {
    background: 
        radial-gradient(circle at 50% 30%, rgba(245, 158, 11, 0.1) 0%, transparent 40%),
        radial-gradient(ellipse at center, #1a1a2e 0%, #0f0f1a 50%, #000000 100%);
}

.ad-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    height: 100%;
    justify-content: center;
    align-items: center;
}

#adScreen h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--gold);
    text-shadow: 0 0 20px rgba(245, 158, 11, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

#nextPlayerInfo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    min-height: 150px;
    justify-content: center;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    border: 2px solid var(--gold);
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.2);
}

.next-player-name {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 3rem;
    font-weight: bold;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.next-round-number {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    opacity: 0.8;
    color: var(--chrome);
    text-transform: uppercase;
    letter-spacing: 0.3em;
}

/* Game Over Screen */
#gameOverScreen {
    background: 
        radial-gradient(circle at 50% 20%, rgba(34, 197, 94, 0.15) 0%, transparent 40%),
        radial-gradient(ellipse at center, #1a1a2e 0%, #0f0f1a 50%, #000000 100%);
}

#gameOverScreen h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    margin-top: 0;
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold) 50%, #b45309 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 4px 8px rgba(245, 158, 11, 0.4));
}

#gameOverScreen h1::after {
    display: none;
}

.game-over-layout {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    width: 100%;
    max-width: 100%;
    flex: 1;
    align-items: stretch;
    justify-content: space-between;
    min-height: 0;
}

.game-over-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 16px;
    border: 1px solid var(--metal-light);
    overflow-y: auto;
}

.game-over-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    min-width: 0;
}

.share-message.hidden {
    display: none;
}

#gameOverContent {
    font-family: 'Russo One', sans-serif;
    font-size: 1rem;
    margin: 0.5rem 0;
    line-height: 1.6;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

#gameOverContent p {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

#gameOverContent h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    margin: 0.8rem 0 0.5rem 0;
    color: var(--chrome);
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

#gameOverContent ul {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

#gameOverContent li {
    margin: 0.6rem 0;
    font-size: 0.95rem;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    box-sizing: border-box;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 3px solid var(--chrome);
    transition: all 0.2s ease;
}

#gameOverContent li:hover {
    background: rgba(255, 255, 255, 0.1);
}

.winner {
    font-family: 'Bebas Neue', sans-serif;
    color: var(--gold-bright);
    font-size: 1.6rem;
    font-weight: bold;
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
    text-shadow: 0 0 20px rgba(245, 158, 11, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.game-stats {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    opacity: 0.9;
    margin: 0.5rem 0;
    color: var(--chrome);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.alive-status {
    color: var(--safe-green);
    font-weight: 600;
    text-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

.eliminated-status {
    color: var(--danger-red);
    font-weight: 600;
    text-shadow: 0 0 10px rgba(220, 38, 38, 0.5);
}

/* Share Button */
.btn-share {
    padding: 16px 32px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.3rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    background: linear-gradient(180deg, var(--safe-green) 0%, #16a34a 50%, #15803d 100%);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    max-width: 100%;
    margin-bottom: 1rem;
    border: 2px solid var(--safe-glow);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.btn-share:hover {
    background: linear-gradient(180deg, var(--safe-glow) 0%, var(--safe-green) 50%, #16a34a 100%);
    box-shadow: 0 6px 25px rgba(74, 222, 128, 0.5);
    transform: translateY(-2px);
}

.btn-share:active {
    transform: translateY(0);
}

.share-icon {
    font-size: 2rem;
}

.share-text {
    font-size: 1rem;
}

.share-message {
    font-family: 'Russo One', sans-serif;
    background: linear-gradient(180deg, var(--metal-mid) 0%, var(--metal-dark) 100%);
    border: 2px solid var(--metal-light);
    border-radius: 12px;
    padding: 15px;
    font-size: 0.9rem;
    line-height: 1.6;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-wrap: break-word;
    text-align: center;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive Design - Horizontal/Landscape */
@media screen and (orientation: landscape) {
    .screen {
        padding: 5px;
    }
    
    #gameScreen .container,
    #adScreen .container,
    #gameOverScreen .container {
        max-width: calc(100vw - 10px);
        width: calc(100vw - 10px);
        height: calc(100vh - 10px);
        max-height: calc(100vh - 10px);
        padding: 10px;
        box-sizing: border-box;
        justify-content: flex-start;
    }
    
    .game-over-layout {
        flex-direction: row;
        gap: 2rem;
    }
    
    .game-over-left,
    .game-over-right {
        flex: 1;
        max-width: calc(50% - 1rem);
    }
    
    .countdown {
        font-size: min(20vh, 25vw);
        max-width: 100%;
    }
    
    .result {
        font-size: min(28vh, 35vw);
        max-width: calc(100vw - 40px);
    }
    
    #gameOverContent {
        font-size: 1.4rem;
        max-width: 100%;
    }
    
    #gameOverContent p {
        font-size: 1.8rem;
        max-width: 100%;
        overflow-wrap: break-word;
        word-wrap: break-word;
    }
    
    #gameOverContent h3 {
        font-size: 1.3rem;
        max-width: 100%;
        overflow-wrap: break-word;
        word-wrap: break-word;
    }
    
    #gameOverContent li {
        font-size: 1.3rem;
        max-width: 100%;
        overflow-wrap: break-word;
        word-wrap: break-word;
    }
    
    .winner {
        font-size: 1.8rem;
        max-width: 100%;
        overflow-wrap: break-word;
        word-wrap: break-word;
    }
    
    h1 {
        max-width: 100%;
        overflow-wrap: break-word;
        word-wrap: break-word;
    }
    
    h2 {
        max-width: 100%;
        overflow-wrap: break-word;
        word-wrap: break-word;
    }
}

/* Portrait mode adjustments */
@media screen and (orientation: portrait) and (max-width: 480px) {
    h1 {
        font-size: 2.5rem;
    }
    
    .player-display h2 {
        font-size: 1.5rem;
    }
    
    .countdown {
        font-size: min(30vw, 25vh);
    }
}

/* Danger pulse animation for game screen background */
#gameScreen.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(220, 38, 38, 0.1) 0%, transparent 70%);
    animation: dangerPulse 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes dangerPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

/* Tension pulse for final countdown */
@keyframes tensionPulse {
    0% { background-color: rgba(220, 38, 38, 0.3); }
    100% { background-color: transparent; }
}

/* Counting animation */
.countdown.counting {
    animation: countdownPulse 1s ease-in-out infinite, countGlow 1s ease-in-out infinite;
}

@keyframes countGlow {
    0%, 100% { 
        filter: drop-shadow(0 0 10px var(--danger-red));
    }
    50% { 
        filter: drop-shadow(0 0 30px var(--neon-red)) drop-shadow(0 0 50px var(--danger-red));
    }
}

/* Victory confetti-like effect */
#gameOverScreen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 10% 20%, var(--gold) 2px, transparent 2px),
        radial-gradient(circle at 90% 30%, var(--safe-green) 2px, transparent 2px),
        radial-gradient(circle at 30% 80%, var(--gold-bright) 1px, transparent 1px),
        radial-gradient(circle at 70% 70%, var(--safe-glow) 1px, transparent 1px),
        radial-gradient(circle at 50% 10%, var(--gold) 1px, transparent 1px);
    animation: sparkle 3s ease-in-out infinite;
    pointer-events: none;
    opacity: 0.6;
}

@keyframes sparkle {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.02); }
}

/* Mute Toggle Button */
.mute-toggle {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 9999;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--chrome);
    background: linear-gradient(180deg, var(--metal-mid) 0%, var(--metal-dark) 100%);
    color: var(--text-primary);
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.mute-toggle:hover {
    border-color: var(--gold);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
    transform: scale(1.1);
}

.mute-toggle:active {
    transform: scale(0.95);
}

.mute-toggle.muted {
    border-color: var(--danger-red);
    opacity: 0.7;
}

.mute-toggle.muted:hover {
    border-color: var(--neon-red);
    box-shadow: 0 0 15px rgba(220, 38, 38, 0.4);
}

/* Responsive adjustments for mute button */
@media screen and (orientation: portrait) {
    #gameScreen.active .mute-toggle,
    #adScreen.active .mute-toggle,
    #gameOverScreen.active .mute-toggle {
        /* Keep button in correct position when screen is rotated */
        position: fixed;
        top: 15px;
        right: 15px;
    }
}