:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #151b2e;
    --bg-tertiary: #1f2937;
    --accent-primary: #00d9ff;
    --accent-secondary: #ff006e;
    --accent-success: #00ff88;
    --accent-warning: #ffaa00;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --cell-revealed: #2d3748;
    --cell-unrevealed: #374151;
    --cell-mine: #ff006e;
    --border-glow: rgba(0, 217, 255, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Exo 2', sans-serif;
    background: linear-gradient(135deg, #0a0e1a 0%, #1a0a2e 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
            radial-gradient(circle at 20% 50%, rgba(0, 217, 255, 0.1) 0%, transparent 50%),
            radial-gradient(circle at 80% 80%, rgba(255, 0, 110, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

#root {
    position: relative;
    z-index: 1;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
}

.logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 3.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    text-align: center;
    animation: glow-pulse 3s ease-in-out infinite;
    text-shadow: 0 0 30px rgba(0, 217, 255, 0.5);
}

@keyframes glow-pulse {
    0%, 100% { filter: drop-shadow(0 0 10px rgba(0, 217, 255, 0.5)); }
    50% { filter: drop-shadow(0 0 20px rgba(255, 0, 110, 0.7)); }
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    text-align: center;
    letter-spacing: 0.05em;
}

.menu-container {
    background: rgba(21, 27, 46, 0.8);
    backdrop-filter: blur(10px);
    border: 2px solid var(--border-glow);
    border-radius: 20px;
    padding: 3rem;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 0 40px rgba(0, 217, 255, 0.3);
    animation: fade-in 0.5s ease-out;
}

.menu-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 2rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.mode-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.mode-card {
    background: rgba(31, 41, 55, 0.5);
    border: 2px solid rgba(148, 163, 184, 0.3);
    border-radius: 15px;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.mode-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 217, 255, 0.3);
}

.mode-card.multiplayer {
    grid-column: 1 / -1;
    background: rgba(255, 0, 110, 0.1);
    border-color: var(--accent-secondary);
}

.mode-card.multiplayer:hover {
    border-color: var(--accent-secondary);
    box-shadow: 0 10px 30px rgba(255, 0, 110, 0.3);
}

.mode-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.mode-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.mode-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.mode-stats {
    font-size: 0.8rem;
    color: var(--accent-primary);
    font-family: 'Courier New', monospace;
}

.back-button {
    background: rgba(148, 163, 184, 0.2);
    border: 2px solid rgba(148, 163, 184, 0.5);
    color: var(--text-secondary);
    margin-top: 1rem;
}

.back-button:hover {
    background: rgba(148, 163, 184, 0.3);
    border-color: var(--text-secondary);
    box-shadow: 0 5px 15px rgba(148, 163, 184, 0.3);
}

.invite-code-container {
    background: rgba(31, 41, 55, 0.8);
    border: 2px solid var(--accent-primary);
    border-radius: 15px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: center;
}

.invite-code-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.invite-code {
    font-family: 'Orbitron', monospace;
    font-size: 2rem;
    font-weight: 900;
    color: var(--accent-primary);
    letter-spacing: 0.2em;
    margin: 0.5rem 0;
    user-select: all;
}

.copy-button {
    background: rgba(0, 217, 255, 0.2);
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.copy-button:hover {
    background: rgba(0, 217, 255, 0.3);
    transform: translateY(-2px);
}

.copy-button.copied {
    background: rgba(0, 255, 136, 0.3);
    border-color: var(--accent-success);
    color: var(--accent-success);
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.input-group {
    margin-bottom: 2rem;
}

.input-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-group input {
    width: 100%;
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'Exo 2', sans-serif;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.3);
}

.input-lobbycode { 
	textTransform: 'uppercase';
	letterSpacing: '0.2em'; 
	textAlign: 'center'; 
}

.btn {
    width: 100%;
    padding: 1.2rem;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), #0099cc);
    color: white;
    box-shadow: 0 5px 20px rgba(0, 217, 255, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 25px rgba(0, 217, 255, 0.6);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.waiting-container {
    text-align: center;
}

.waiting-text-lower { 
	color: 'var(--text-secondary)';
	fontSize: '0.9rem';
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--bg-tertiary);
    border-top: 4px solid var(--accent-primary);
    border-radius: 50%;
    margin: 2rem auto;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.waiting-text {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.game-container {
    display: flex;
    gap: 2rem;
    width: 100%;
    max-width: 1400px;
    animation: fade-in 0.5s ease-out;
}

.player-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.player-info {
    background: rgba(21, 27, 46, 0.8);
    backdrop-filter: blur(10px);
    border: 2px solid var(--border-glow);
    border-radius: 15px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.player-info.opponent {
    border-color: var(--accent-secondary);
}

.player-name {
    margin-bottom: 0.75rem;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
}

.player-score {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-success);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.flag-counter {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.flag-counter-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-success);
}

.flag-counter-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.gameover-buttons { 
	display: 'flex'; 
	gap: '1rem'; 
	marginTop: '1rem'; 
}
.mines-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.timer-display {
    position: absolute;
    top: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(21, 27, 46, 0.9);
    backdrop-filter: blur(10px);
    border: 2px solid var(--border-glow);
    border-radius: 15px;
    padding: 1rem 2rem;
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    font-weight: 900;
    color: var(--accent-primary);
    text-align: center;
    z-index: 100;
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.3);
}

.timer-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 0.25rem;
    letter-spacing: 0.1em;
}

.time-elapsed {
	fontSize: '2.5rem';
	margin: '1rem 0';
	color: 'var(--accent-primary)';
	fontFamily: 'Orbitron';
}

.rematch-notification {
	background: 'rgba(0, 255, 136, 0.2)';
	border: '1px solid var(--accent-success)';
	borderRadius: '10px';
	padding: '1rem';
	margin: '1rem 0';
	color: 'var(--accent-success)';
	fontSize: '0.9rem';
}

.rematch-buttons {
	display: 'flex'; 
	gap: '1rem'; 
	width: '100%'; 
	marginTop: '1rem';
}

.status-badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-alive {
    background: rgba(0, 255, 136, 0.2);
    color: var(--accent-success);
    border: 1px solid var(--accent-success);
}

.status-dead {
    background: rgba(255, 0, 110, 0.2);
    color: var(--accent-secondary);
    border: 1px solid var(--accent-secondary);
}

.board-container {
    background: rgba(21, 27, 46, 0.8);
    backdrop-filter: blur(10px);
    border: 2px solid var(--border-glow);
    border-radius: 15px;
    padding: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.minesweeper-board {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 3px;
    background: var(--bg-primary);
    padding: 5px;
    border-radius: 10px;
}

.cell {
    width: 40px;
    height: 40px;
    background: var(--cell-unrevealed);
    border: 2px solid rgba(148, 163, 184, 0.3);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    user-select: none;
}

.cell:hover:not(.revealed):not(.flagged) {
    background: var(--bg-tertiary);
    transform: scale(1.05);
    border-color: var(--accent-primary);
}

.cell.revealed {
    background: var(--cell-revealed);
    border-color: rgba(45, 55, 72, 0.5);
    cursor: default;
    animation: reveal 0.3s ease-out;
}

@keyframes reveal {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.cell.mine {
    background: var(--cell-mine);
    animation: explode 0.5s ease-out;
}

@keyframes explode {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.cell.flagged::before {
    content: '🚩';
    font-size: 1.5rem;
}

.cell.revealed.mine::before {
    content: '💣';
    font-size: 1.5rem;
}

.cell.num-1 { color: #3b82f6; }
.cell.num-2 { color: #10b981; }
.cell.num-3 { color: #f59e0b; }
.cell.num-4 { color: #8b5cf6; }
.cell.num-5 { color: #ef4444; }
.cell.num-6 { color: #06b6d4; }
.cell.num-7 { color: #ec4899; }
.cell.num-8 { color: #6366f1; }

.game-over-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 14, 26, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fade-in 0.3s ease-out;
}

.game-over-modal {
    background: rgba(21, 27, 46, 0.95);
    border: 3px solid var(--border-glow);
    border-radius: 20px;
    padding: 3rem;
    text-align: center;
    max-width: 500px;
    box-shadow: 0 0 60px rgba(0, 217, 255, 0.5);
}

.game-over-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.game-over-title.victory {
    background: linear-gradient(135deg, var(--accent-success), var(--accent-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-over-title.defeat {
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-warning));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-over-stats {
    font-size: 1.5rem;
    margin: 2rem 0;
    color: var(--text-secondary);
}

.opponent-board { 
	fontSize: '3rem'; 
	marginBottom: '1rem'; 
}

@media (max-width: 1024px) {
    .game-container {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .logo {
        font-size: 2.5rem;
    }

    .cell {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }

    .menu-container {
        padding: 2rem;
    }
}