@font-face {
    font-family: 'MightySouly';
    src: url('./fonts/MightySouly-lxggD.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'SuperPixel';
    src: url('./fonts/SuperPixel.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: fallback;
    unicode-range: U+0030-0039, U+0041-005A, U+0061-007A; /* Numbers, uppercase, lowercase */
}

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

body {
    font-family: 'SuperPixel', Arial, sans-serif;
    background: linear-gradient(135deg, #FFD700 0%, #FF8C00 50%, #FF6347 100%);
    color: white;
    min-height: 100vh;
    min-width: 800px;
    overflow-x: hidden;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.container {
    max-width: 1600px;
    min-width: 760px;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
}

.screen {
    display: none;
    min-height: 100vh;
    min-width: 800px;
    justify-content: center;
    align-items: center;
}

.screen.active {
    display: flex;
}

h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

h2 {
    font-size: 2rem;
    margin-bottom: 20px;
}

.input-group {
    margin: 30px 0;
}

input[type="text"] {
    padding: 15px 20px;
    font-size: 1.1rem;
    font-family: 'SuperPixel', Arial, sans-serif;
    border: none;
    border-radius: 12px;
    width: 300px;
    max-width: 90%;
    text-align: center;
    outline: none;
    background: rgba(255,255,255,0.95);
    color: #333;
    border: 3px solid #fff;
    box-shadow: 0 4px 0 #ddd, 0 6px 12px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

input[type="text"]:focus {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #ddd, 0 4px 8px rgba(0,0,0,0.3);
    border-color: #FFD700;
}

.btn {
    padding: 15px 30px;
    font-size: 1.1rem;
    font-family: 'SuperPixel', Arial, sans-serif;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin: 10px;
    transition: all 0.2s ease;
    min-width: 150px;
    border: 3px solid transparent;
    box-shadow: 0 5px 0 rgba(0,0,0,0.2), 0 7px 15px rgba(0,0,0,0.3);
    text-transform: uppercase;
    font-weight: bold;
}

.btn.primary {
    background: #4CAF50;
    color: white;
    border-color: #45a049;
}

.btn.primary:hover {
    background: #45a049;
    transform: translateY(2px);
    box-shadow: 0 3px 0 rgba(0,0,0,0.2), 0 5px 10px rgba(0,0,0,0.3);
}

.btn.primary:active {
    transform: translateY(4px);
    box-shadow: 0 1px 0 rgba(0,0,0,0.2), 0 2px 5px rgba(0,0,0,0.3);
}

.btn.secondary {
    background: #f44336;
    color: white;
    border-color: #da190b;
}

.btn.secondary:hover {
    background: #da190b;
    transform: translateY(2px);
    box-shadow: 0 3px 0 rgba(0,0,0,0.2), 0 5px 10px rgba(0,0,0,0.3);
}

.btn.secondary:active {
    transform: translateY(4px);
    box-shadow: 0 1px 0 rgba(0,0,0,0.2), 0 2px 5px rgba(0,0,0,0.3);
}

.status {
    margin-top: 30px;
}

.status.hidden {
    display: none;
}

#queue-status {
    text-align: center;
}

#queue-info {
    margin: 20px 0;
}

#queue-info p {
    font-family: Arial, sans-serif;
    font-size: 1.1rem;
    margin: 8px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

#queue-position-text {
    font-weight: bold;
    font-size: 1.2rem !important;
}

#cancel-queue-btn {
    display: block;
    margin: 20px auto 0;
}

.spinner {
    border: 4px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top: 4px solid white;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

/* Number/Score Display Font Override */
#player-match-score, #opponent-match-score,
#player-final-score, #opponent-final-score,
#final-your-score, #final-opponent-score,
.final-score-number, .score-number {
    font-family: 'MightySouly', Arial, sans-serif !important;
}

/* Player match scores inherit from parent .player-info span:last-child */

/* Final Score Display */
.final-score-container {
    background:
        repeating-linear-gradient(45deg,
            transparent, transparent 1px,
            rgba(62, 39, 35, 0.1) 1px, rgba(62, 39, 35, 0.1) 2px),
        linear-gradient(145deg, #8B4513 0%, #654321 30%, #5D4037 70%, #4A2C2A 100%);
    border: 3px solid #4A2C2A;
    border-radius: 8px;
    padding: 20px;
    margin: 20px auto;
    max-width: 300px;
    text-align: center;
    box-shadow:
        inset 2px 2px 4px rgba(139, 69, 19, 0.3),
        inset -2px -2px 4px rgba(62, 39, 35, 0.6),
        0 4px 8px rgba(0,0,0,0.3);
}

.final-score-container h3 {
    color: #FFF8DC;
    font-family: 'SuperPixel', 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 1.2rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.9);
}

.final-score-row {
    font-size: 2rem;
    font-weight: bold;
    color: #FFD700;
    font-family: 'SuperPixel', 'Consolas', 'Monaco', 'Courier New', monospace;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.9);
    margin: 15px 0;
}

.final-score-label {
    color: #F4A460;
    font-size: 0.9rem;
    font-family: 'SuperPixel', 'Consolas', 'Monaco', 'Courier New', monospace;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    margin-top: 5px;
}

#game-header {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    margin-bottom: 30px;
    background: linear-gradient(135deg, rgba(30, 30, 35, 0.95) 0%, rgba(45, 45, 55, 0.95) 50%, rgba(35, 35, 45, 0.95) 100%);
    backdrop-filter: blur(10px);
    padding: 20px 30px;
    border-radius: 16px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    min-width: 700px;
    min-height: 120px;
    gap: 20px;
}

#game-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
    z-index: -1;
}


.player-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-family: 'SuperPixel', 'Consolas', 'Menlo', 'Monaco', 'Courier New', monospace;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
    color: #ffffff;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
    backdrop-filter: blur(8px);
    padding: 18px 24px;
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    min-width: 140px;
    min-height: 100px;
}

.player-info:hover {
    transform: translateY(-2px);
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
}

.player-info span:first-child {
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 1.2rem;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
    font-family: 'SuperPixel', Arial, sans-serif;
}

.player-info span:last-child {
    font-size: 2.5rem;
    color: #FFD700;
    font-weight: bold;
    text-shadow: 0 3px 12px rgba(0,0,0,0.8);
    font-family: 'MightySouly', Arial, sans-serif;
}


.match-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'SuperPixel', Arial, sans-serif;
    text-shadow: 2px 2px 3px rgba(0,0,0,0.8);
    min-width: 200px;
    text-align: center;
}

#game-progress {
    font-size: 1.1rem !important;
    color: #ffffff !important;
    margin-bottom: 8px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6) !important;
    font-weight: 600 !important;
    font-family: 'MightySouly', Arial, sans-serif !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%) !important;
    backdrop-filter: blur(8px) !important;
    padding: 8px 12px !important;
    border-radius: 8px !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    white-space: nowrap !important;
    overflow: visible !important;
}

#current-game {
    display: inline !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #FFD700 !important;
    font-size: 1.1rem !important;
    font-family: 'MightySouly', 'Consolas', 'Monaco', 'Courier New', monospace !important;
    font-weight: bold !important;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6) !important;
}

#game-status {
    font-size: 1rem !important;
    color: #ffffff !important;
    margin: 4px 0 !important;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6) !important;
    font-weight: 600 !important;
    font-family: 'SuperPixel', 'Consolas', 'Monaco', 'Courier New', monospace !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%) !important;
    backdrop-filter: blur(8px) !important;
    padding: 6px 10px !important;
    border-radius: 6px !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    white-space: nowrap !important;
    overflow: visible !important;
}

#game-timer {
    font-size: 2.4rem;
    font-weight: bold;
    font-family: 'MightySouly', 'Consolas', 'Menlo', 'Monaco', 'Courier New', monospace;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    backdrop-filter: blur(8px);
    color: #ffffff;
    padding: 16px 24px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
    min-width: 80px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}




.countdown {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    background: linear-gradient(135deg, rgba(20, 20, 25, 0.95) 0%, rgba(30, 30, 40, 0.95) 100%);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 32px 48px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    box-shadow:
        0 16px 64px rgba(0, 0, 0, 0.4),
        0 0 32px rgba(255, 215, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.countdown-number {
    font-size: 3.5rem;
    font-weight: bold;
    font-family: 'MightySouly', 'Consolas', 'Menlo', 'Monaco', 'Courier New', monospace;
    color: #FFD700;
    text-shadow:
        0 0 24px rgba(255, 215, 0, 0.6),
        0 2px 8px rgba(0,0,0,0.8);
    animation: countdown-pulse 1s ease-in-out;
    text-align: center;
    min-width: 80px;
    display: block;
    letter-spacing: 2px;
}

@keyframes countdown-pulse {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

#game-area {
    background: linear-gradient(135deg, rgba(40, 40, 50, 0.8) 0%, rgba(30, 30, 40, 0.9) 100%);
    backdrop-filter: blur(12px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 40px;
    min-height: 400px;
    min-width: 600px;
    width: 90%;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    box-shadow:
        0 16px 64px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.game-type.hidden {
    display: none;
}

.reaction-zone {
    text-align: center;
    cursor: pointer;
    padding: 20px;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    background: transparent;
}

.signal-light {
    width: 200px;
    height: 200px;
    margin: 0 auto 20px;
    transition: all 0.3s ease;
}

.signal-light.red {
    background-image: url('images/red.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 0 30px rgba(244, 67, 54, 0.5);
}

.signal-light.green {
    background-image: url('images/green.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 0 30px rgba(76, 175, 80, 0.5);
}

#reaction-instruction {
    font-size: 1.5rem;
    font-weight: bold;
    font-family: Arial, sans-serif;
}

.reaction-counter {
    font-family: 'MightySouly', Arial, sans-serif;
    font-size: 2.5rem;
    font-weight: bold;
    color: #00FF88;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    margin-top: 20px;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    border: 2px solid #00FF88;
    display: inline-block;
    animation: counter-pulse 0.5s infinite alternate;
}

@keyframes counter-pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.05); }
}

.reaction-counter.hidden {
    display: none;
}

.tic-tac-toe-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    width: 100%;
    height: 100%;
    justify-content: center;
}

.tic-tac-toe-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 0px;
    width: 350px;
    height: 350px;
    background-image: url('images/board.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    padding: 15px;
    border: none;
    box-shadow: none;
    position: relative;
    margin: 0 auto;
}


.cell {
    background: transparent;
    border: none;
    border-radius: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'SuperPixel', Arial, sans-serif;
    box-shadow: none;
    position: relative;
    background-size: 70% 70%;
    background-repeat: no-repeat;
    background-position: center;
    width: 100%;
    height: 100%;
    aspect-ratio: 1;
}

.cell.x {
    background-image: url('images/x.png') !important;
    background-size: 65% 65% !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
}

.cell.o {
    background-image: url('images/y.png') !important;
    background-size: 65% 65% !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
}

.cell:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
    box-shadow: none;
}

.cell.disabled {
    cursor: not-allowed;
    opacity: 1;
    background: transparent;
    box-shadow: none;
}

#ttt-status {
    font-size: 1.1rem;
    font-weight: bold;
    font-family: Arial, sans-serif;
    margin-top: 10px;
}

.rps-choices {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.rps-choice {
    padding: 20px;
    font-weight: bold;
    font-family: 'SuperPixel', Arial, sans-serif;
    background: transparent;
    color: #5D4037;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 150px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    background-size: 85% 85%;
    background-repeat: no-repeat;
    background-position: center;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.rps-choice[data-choice="rock"] {
    background-image: url('images/rock.png');
}

.rps-choice[data-choice="paper"] {
    background-image: url('images/paper.png');
}

.rps-choice[data-choice="scissors"] {
    background-image: url('images/scissors.png');
}

.rps-choice:hover:not(:disabled) {
    transform: scale(1.15);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4);
    border-color: rgba(255, 215, 0, 0.6);
    background-size: 90% 90%;
}

.rps-choice:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: transparent;
    box-shadow: none;
    filter: grayscale(0.5);
}

#rps-status {
    font-size: 1.8rem;
    margin-bottom: 20px;
    font-family: 'MightySouly', Arial, sans-serif;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* Battle Arena Styles */
.rps-battle-arena {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px;
    margin: 20px 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.1) 100%);
    border-radius: 20px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.battle-choice {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.choice-label {
    font-family: 'MightySouly', Arial, sans-serif;
    font-size: 1.4rem;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.choice-image {
    width: 120px;
    height: 120px;
    background-size: 90% 90%;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 15px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.choice-image.rock {
    background-image: url('images/rock.png');
}

.choice-image.paper {
    background-image: url('images/paper.png');
}

.choice-image.scissors {
    background-image: url('images/scissors.png');
}

.battle-vs {
    font-family: 'MightySouly', Arial, sans-serif;
    font-size: 2.5rem;
    font-weight: bold;
    color: #FF6B6B;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    animation: vs-pulse 2s infinite;
}

@keyframes vs-pulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
}

/* Battle Animations */
.battle-enter-left {
    animation: slide-in-left 0.8s ease-out;
}

.battle-enter-right {
    animation: slide-in-right 0.8s ease-out;
}

.battle-winner {
    animation: winner-celebration 1.5s ease-in-out infinite;
    border-color: #FFD700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

.battle-loser {
    animation: loser-shake 0.5s ease-in-out;
    opacity: 0.6;
    filter: grayscale(0.5);
}

.battle-clash {
    animation: clash-bounce 1s ease-in-out infinite;
}

@keyframes slide-in-left {
    0% { transform: translateX(-200px) scale(0.5); opacity: 0; }
    100% { transform: translateX(0) scale(1); opacity: 1; }
}

@keyframes slide-in-right {
    0% { transform: translateX(200px) scale(0.5); opacity: 0; }
    100% { transform: translateX(0) scale(1); opacity: 1; }
}

@keyframes winner-celebration {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(-5deg); }
    75% { transform: scale(1.1) rotate(5deg); }
}

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

@keyframes clash-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

#battle-result-text {
    font-family: 'MightySouly', Arial, sans-serif;
    font-size: 1.6rem;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.mole-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    width: 350px;
    height: 350px;
    margin: 0 auto;
    background: transparent;
    padding: 20px;
    border: none;
    border-radius: 0;
    box-shadow: none;
    cursor: url('images/hammer.png') 16 32, auto;
}

.mole-hole {
    background-image: url('images/hole.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    background-color: transparent;
    position: relative;
    cursor: url('images/hammer.png') 16 32, pointer;
    transition: all 0.2s ease;
    border: none;
    border-radius: 0;
    box-shadow: none;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mole-hole:hover {
    transform: scale(1.05);
    box-shadow: none;
}

.mole-hole.active::after {
    content: '';
    position: absolute;
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
    width: 85%;
    height: 85%;
    background-image: url('images/mole.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center bottom;
    animation: mole-emerge 0.4s ease-out;
    z-index: 2;
}

@keyframes mole-emerge {
    0% {
        transform: translateX(-50%) translateY(100%);
        opacity: 0;
    }
    100% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* Match Found Screen Styles */
.match-found-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    text-align: center;
}

.match-found-title {
    font-size: 4rem;
    color: #FFD700;
    text-shadow:
        0 0 20px rgba(255, 215, 0, 0.8),
        0 4px 8px rgba(0, 0, 0, 0.8);
    animation: match-found-pulse 2s ease-in-out infinite;
    margin-bottom: 40px;
    font-family: 'MightySouly', 'SuperPixel', Arial, sans-serif;
}

@keyframes match-found-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.9; }
}

.vs-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    margin: 20px 0;
}

.player-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 30px 40px;
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    animation: player-card-entrance 1s ease-out;
    min-width: 200px;
}

@keyframes player-card-entrance {
    0% { transform: scale(0.5) rotate(-10deg); opacity: 0; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.player-name {
    font-size: 1.8rem;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    font-family: 'SuperPixel', Arial, sans-serif;
}

.vs-text {
    font-size: 3rem;
    font-weight: bold;
    color: #ff6b6b;
    text-shadow:
        0 0 15px rgba(255, 107, 107, 0.6),
        0 4px 8px rgba(0, 0, 0, 0.8);
    animation: vs-glow 1.5s ease-in-out infinite alternate;
    font-family: 'MightySouly', 'SuperPixel', Arial, sans-serif;
}

@keyframes vs-glow {
    0% { text-shadow: 0 0 15px rgba(255, 107, 107, 0.6), 0 4px 8px rgba(0, 0, 0, 0.8); }
    100% { text-shadow: 0 0 25px rgba(255, 107, 107, 0.9), 0 4px 8px rgba(0, 0, 0, 0.8); }
}

/* Game Description Screen Styles */
.game-description-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    text-align: center;
    animation: description-fade-in 1s ease-out;
}

@keyframes description-fade-in {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

#game-name-display {
    font-size: 3.5rem;
    color: #4CAF50;
    text-shadow:
        0 0 20px rgba(76, 175, 80, 0.6),
        0 4px 8px rgba(0, 0, 0, 0.8);
    margin-bottom: 30px;
    font-family: 'MightySouly', 'SuperPixel', Arial, sans-serif;
}

.game-icon {
    font-size: 5rem;
    margin: 20px 0;
    animation: icon-bounce 2s ease-in-out infinite;
}

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

#game-description-text {
    font-size: 1.4rem;
    color: #ffffff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
    max-width: 600px;
    line-height: 1.6;
    margin: 30px 0;
    font-family: 'SuperPixel', Arial, sans-serif;
}

.get-ready-text {
    font-size: 2rem;
    color: #FFD700;
    text-shadow:
        0 0 15px rgba(255, 215, 0, 0.6),
        0 4px 8px rgba(0, 0, 0, 0.8);
    animation: get-ready-pulse 1s ease-in-out infinite;
    margin-top: 40px;
    font-family: 'SuperPixel', Arial, sans-serif;
    font-weight: bold;
}

@keyframes get-ready-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.05); }
}

/* SUDDEN DEATH Animation Styles */
.sudden-death-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: sudden-death-sequence 4s ease-out forwards;
}

.sudden-death-image {
    width: 400px;
    height: auto;
    max-width: 80vw;
    transform: translateY(-100vh);
    animation: sudden-death-slide 2s ease-out 0.5s forwards;
    filter: drop-shadow(0 20px 40px rgba(255, 0, 0, 0.5));
}

@keyframes sudden-death-sequence {
    0% { opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes sudden-death-slide {
    0% {
        transform: translateY(-100vh) scale(0.5);
        opacity: 0;
    }
    50% {
        transform: translateY(0) scale(1.1);
        opacity: 1;
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Mobile responsive sudden death */
@media (max-width: 768px) {
    .sudden-death-image {
        width: 300px;
        max-width: 90vw;
    }
}

.final-scores {
    font-size: 2.2rem;
    margin: 30px 0;
}

.final-scores div {
    margin: 10px 0;
}

.result-actions {
    margin-top: 40px;
}

#result-title {
    color: #4CAF50;
    margin-bottom: 20px;
}

#result-title.lose {
    color: #f44336;
}

#result-title.draw {
    color: #FFC107;
}

#result-title.victory {
    color: #4CAF50;
    text-shadow: 0 0 25px rgba(76, 175, 80, 0.8);
    animation: victory-pulse 2s ease-in-out infinite;
}

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

.ready-indicators {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
    padding: 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
}

.ready-indicator {
    text-align: center;
    font-size: 1.1rem;
    font-weight: bold;
}

#your-ready-status,
#opponent-ready-status {
    display: block;
    margin-top: 5px;
    font-size: 1rem;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    h1 {
        font-size: 2rem;
    }

    input[type="text"] {
        width: 100%;
    }

    #game-area {
        padding: 20px;
        min-height: 300px;
        width: 95%;
    }

    #game-header {
        flex-direction: column;
        min-width: auto;
        min-height: auto;
        gap: 15px;
        padding: 16px 20px;
    }

    .player-info {
        min-width: 120px;
        min-height: 80px;
        padding: 12px 18px;
    }

    .player-info span:first-child {
        font-size: 1rem;
    }

    .player-info span:last-child {
        font-size: 2rem;
    }

    .match-info {
        min-width: auto;
        order: -1;
    }


    .tic-tac-toe-board {
        width: 280px;
        height: 280px;
        padding: 12px;
    }


    .cell {
        font-size: 1.5rem;
    }

    /* Match Found Screen Mobile */
    .match-found-title {
        font-size: 2.5rem;
    }

    .vs-container {
        flex-direction: column;
        gap: 20px;
    }

    .player-card {
        min-width: 150px;
        padding: 20px 30px;
    }

    .player-name {
        font-size: 1.4rem;
    }

    .vs-text {
        font-size: 2rem;
        margin: 10px 0;
    }

    /* Game Description Screen Mobile */
    #game-name-display {
        font-size: 2.5rem;
    }

    .game-icon {
        font-size: 3.5rem;
    }

    #game-description-text {
        font-size: 1.1rem;
        padding: 0 20px;
    }

    .get-ready-text {
        font-size: 1.5rem;
    }

    .signal-light {
        width: 150px;
        height: 150px;
    }

    .reaction-zone {
        padding: 15px;
    }

    .rps-choices {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .rps-choice {
        padding: 12px 20px;
        font-size: 1rem;
        min-width: 80px;
    }

    .choice-display {
        flex-direction: column;
        gap: 10px;
    }

    .mole-grid {
        width: 250px;
        height: 250px;
        gap: 10px;
    }
}

/* ===== REACTION TIME RESULTS DISPLAY ===== */
.reaction-results-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    gap: 30px;
    min-height: 400px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    margin: 20px auto;
    max-width: 600px;
}

.reaction-results-title {
    font-family: 'MightySouly', Arial, sans-serif;
    font-size: 2.5rem;
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    margin-bottom: 10px;
}

.reaction-times-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 500px;
    gap: 20px;
}

.reaction-time-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    padding: 25px 20px;
    border-radius: 15px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.player-label {
    font-family: 'MightySouly', Arial, sans-serif;
    font-size: 1.3rem;
    color: #FFF8DC;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
    font-weight: bold;
}

.reaction-time-number {
    font-family: 'MightySouly', Arial, sans-serif; /* Using non-pixel font as requested */
    font-size: 3.5rem;
    font-weight: bold;
    color: #00FF88;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.8);
    line-height: 1;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    border: 2px solid #00FF88;
    min-width: 140px;
    text-align: center;
}

.vs-divider {
    font-family: 'MightySouly', Arial, sans-serif;
    font-size: 2rem;
    color: #FF6B6B;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    font-weight: bold;
    animation: pulse-vs 2s infinite;
}

@keyframes pulse-vs {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
}

.fastest-indicator {
    font-family: 'MightySouly', Arial, sans-serif;
    font-size: 1rem;
    color: #FFD700;
    background: rgba(255, 215, 0, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid #FFD700;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    animation: fastest-glow 1.5s infinite;
}

@keyframes fastest-glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
        transform: scale(1.05);
    }
}

.winning-time-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    background: rgba(255, 215, 0, 0.1);
    padding: 25px;
    border-radius: 15px;
    border: 3px solid #FFD700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.winning-time-label {
    font-family: 'MightySouly', Arial, sans-serif;
    font-size: 1.5rem;
    color: #FFD700;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

.winning-time-number {
    font-family: 'MightySouly', Arial, sans-serif; /* Using non-pixel font as requested */
    font-size: 4rem;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
    animation: victory-pulse 2s infinite;
}

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

.time-difference {
    font-family: 'MightySouly', Arial, sans-serif;
    font-size: 1.2rem;
    color: #FFF8DC;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px 20px;
    border-radius: 10px;
    margin-top: 10px;
}

.no-clicks-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 40px;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 15px;
    border: 2px solid #FF6B6B;
}

.no-clicks-text {
    font-family: 'MightySouly', Arial, sans-serif;
    font-size: 2rem;
    color: #FF6B6B;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    text-align: center;
}

.no-clicks-subtext {
    font-family: 'MightySouly', Arial, sans-serif;
    font-size: 1.3rem;
    color: #FFF8DC;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

/* Enhanced competition styling */
.competition-message {
    font-family: 'MightySouly', Arial, sans-serif;
    font-size: 1.8rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 15px;
    animation: competition-glow 2s infinite;
}

.competition-message.ultra-close {
    color: #FF0080;
    background: rgba(255, 0, 128, 0.1);
    border: 2px solid #FF0080;
}

.competition-message.very-close {
    color: #FF6B00;
    background: rgba(255, 107, 0, 0.1);
    border: 2px solid #FF6B00;
}

.competition-message.close {
    color: #FFD700;
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid #FFD700;
}

.competition-message.good {
    color: #00FF88;
    background: rgba(0, 255, 136, 0.1);
    border: 2px solid #00FF88;
}

.competition-message.wide {
    color: #888;
    background: rgba(136, 136, 136, 0.1);
    border: 2px solid #888;
}

@keyframes competition-glow {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.reaction-time-player.winner {
    border: 3px solid #FFD700;
    background: rgba(255, 215, 0, 0.1);
    transform: scale(1.05);
}

.reaction-time-player.loser {
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

.performance-rating {
    font-family: 'MightySouly', Arial, sans-serif;
    font-size: 1rem;
    margin-top: 10px;
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    font-weight: bold;
}

.margin-display {
    font-family: 'MightySouly', Arial, sans-serif;
    font-size: 1.2rem;
    color: #FF6B6B;
    background: rgba(255, 107, 107, 0.2);
    padding: 5px 10px;
    border-radius: 10px;
    margin-bottom: 10px;
    border: 1px solid #FF6B6B;
}

.victory-stats {
    background: rgba(255, 215, 0, 0.1);
    border: 3px solid #FFD700;
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
    text-align: center;
}

.margin-of-victory {
    font-family: 'MightySouly', Arial, sans-serif;
    font-size: 1.5rem;
    color: #FF6B6B;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    margin-top: 10px;
}

/* Mobile responsiveness for reaction time results */
@media (max-width: 768px) {
    .reaction-results-container {
        padding: 20px;
        margin: 10px;
    }

    .reaction-results-title {
        font-size: 2rem;
    }

    .reaction-times-display {
        flex-direction: column;
        gap: 15px;
    }

    .reaction-time-number {
        font-size: 2.5rem;
        min-width: 120px;
    }

    .winning-time-number {
        font-size: 3rem;
    }

    .no-clicks-text {
        font-size: 1.5rem;
    }

    .competition-message {
        font-size: 1.4rem;
    }
}

/* Reaction Time Results Display */
.reaction-time-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    animation: reaction-results-fade-in 1s ease-out;
}

.reaction-stats {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
}

.time-display {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.your-time, .opponent-time {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.label {
    font-family: 'MightySouly', Arial, sans-serif;
    font-size: 1.2rem;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.time-value {
    font-family: 'MightySouly', Arial, sans-serif;
    font-size: 2.5rem;
    font-weight: bold;
    color: #00FF88;
    text-shadow:
        0 0 10px rgba(0, 255, 136, 0.6),
        0 2px 4px rgba(0, 0, 0, 0.8);
    padding: 15px 25px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    border: 2px solid rgba(0, 255, 136, 0.3);
    min-width: 120px;
}

.vs {
    font-family: 'MightySouly', Arial, sans-serif;
    font-size: 2rem;
    font-weight: bold;
    color: #ff6b6b;
    text-shadow: 0 0 15px rgba(255, 107, 107, 0.6);
}

.analysis {
    font-family: 'MightySouly', Arial, sans-serif;
    font-size: 1.6rem;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

@keyframes reaction-results-fade-in {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Responsive design for reaction time results */
@media (max-width: 768px) {
    .time-display {
        flex-direction: column;
        gap: 30px;
    }

    .vs {
        font-size: 1.5rem;
    }

    .time-value {
        font-size: 2rem;
        min-width: 100px;
    }

    .analysis {
        font-size: 1.3rem;
    }
}