:root {
    --bg-color: #0c121e;
    --card-bg: rgba(30, 41, 59, 0.7);
    --primary-glow: #38bdf8;
    --secondary-glow: #818cf8;
    --text-color: #f8fafc;
    --accent-red: #f43f5e;
    --accent-blue: #0ea5e9;
    --accent-green: #10b981;
    --accent-yellow: #f59e0b;
    --accent-purple: #8b5cf6;
    --accent-orange: #f97316;
    --accent-cyan: #06b6d4;
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Noto Sans KR', sans-serif;
    user-select: none;
}

body {
    background: #0c121e;
    color: var(--text-color);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: url('bg.png');
    background-size: cover;
    background-position: center;
    backdrop-filter: brightness(0.5);
}

#app-container {
    width: 100%;
    height: 100%;
    max-width: 1400px;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

/* Screens Common Styling */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(12, 18, 30, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

/* Menu Screen */
.game-title {
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: 0.5rem;
    margin-bottom: 2rem;
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.5);
    animation: pulse 2s infinite ease-in-out;
}

.game-title span {
    background: linear-gradient(135deg, var(--primary-glow), var(--secondary-glow));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.menu-options {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 300px;
}

.premium-btn {
    padding: 1rem 2rem;
    border: 1px solid var(--glass-border);
    background: var(--card-bg);
    color: var(--text-color);
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.premium-btn:hover {
    transform: translateY(-5px);
    background: rgba(56, 189, 248, 0.1);
    border-color: var(--primary-glow);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.3);
}

.premium-btn.secondary {
    border-color: var(--secondary-glow);
}

.premium-btn.secondary:hover {
    background: rgba(129, 140, 248, 0.1);
    box-shadow: 0 0 15px rgba(129, 140, 248, 0.3);
}

.keyboard-guide {
    margin-top: 3rem;
    font-size: 0.9rem;
    color: #94a3b8;
    text-align: center;
}

.contact-info {
    margin-top: 1.5rem;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary-glow);
    letter-spacing: 2px;
}

.guide-item {
    margin: 0.5rem 0;
}

/* Game Interface */
#game-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 2rem;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.back-to-menu {
    cursor: pointer;
    font-weight: 600;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.back-to-menu:hover {
    opacity: 1;
}

#mode-indicator {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    font-size: 0.8rem;
    letter-spacing: 2px;
}

.header-contact {
    font-size: 1rem;
    font-weight: 700;
    color: var(--secondary-glow);
    opacity: 0.8;
}

#game-arena {
    display: flex;
    justify-content: center;
    gap: 4rem;
    flex: 1;
}

.player-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.player-label {
    margin-bottom: 1rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.game-layout {
    display: flex;
    gap: 2rem;
}

.stats-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.glass {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
}

.stat-box {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 120px;
}

.stat-box label {
    font-size: 0.7rem;
    letter-spacing: 1px;
    opacity: 0.5;
}

.stat-box .stat-value {
    font-size: 1.5rem;
    font-weight: 800;
}

.next-box {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 120px;
    height: 120px;
}

.next-box label, .control-guide-box label {
    font-size: 0.7rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.control-guide-box {
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 120px;
    gap: 1rem;
    height: fit-content;
}

.control-text {
    font-size: 0.7rem;
    font-weight: 400;
    text-align: left;
    width: 100%;
    line-height: 1.4;
    color: rgba(255,255,255,0.8);
}

.control-text strong {
    color: var(--primary-glow);
    font-size: 0.8rem;
}

.canvas-container {
    padding: 10px;
}

#p1-board, #p2-board {
    background: rgba(0,0,0,0.3);
}

/* Result Screen */
.result-content {
    padding: 4rem;
    text-align: center;
    min-width: 400px;
}

#winner-text {
    font-size: 3rem;
    margin-bottom: 2rem;
    font-weight: 900;
}

.final-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 3rem;
}

.final-stats .label {
    font-size: 0.9rem;
    opacity: 0.6;
}

.final-stats .value {
    font-size: 2rem;
    font-weight: 800;
}

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

/* Desktop sizing adjustments */
@media (max-height: 800px) {
    #p1-board, #p2-board {
        height: 500px;
        width: 250px;
    }
}
