/* Local Fonts */
@font-face {font-display: swap; font-family: 'Inter'; font-style: normal; font-weight: 400; src: url('/fonts/inter-v20-latin-regular.woff2') format('woff2');}
@font-face {font-display: swap; font-family: 'Inter'; font-style: normal; font-weight: 600; src: url('/fonts/inter-v20-latin-600.woff2') format('woff2');}
@font-face {font-display: swap; font-family: 'Inter'; font-style: normal; font-weight: 700; src: url('/fonts/inter-v20-latin-700.woff2') format('woff2');}
@font-face {font-display: swap; font-family: 'Orbitron'; font-style: normal; font-weight: 400; src: url('/fonts/orbitron-v35-latin-regular.woff2') format('woff2');}
@font-face {font-display: swap; font-family: 'Orbitron'; font-style: normal; font-weight: 600; src: url('/fonts/orbitron-v35-latin-600.woff2') format('woff2');}
@font-face {font-display: swap; font-family: 'Orbitron'; font-style: normal; font-weight: 700; src: url('/fonts/orbitron-v35-latin-700.woff2') format('woff2');}

:root { 
    --menu-width: 200px; 
    --accent-color: #0ea5e9; 
    --bg-main: #0f172a;    /* Back to dark background */
    --bg-card: #1e293b;    /* Back to dark container cards */
    --board-color: #60a5fa; /* Light blue accent for titles */
    --text-color: #f8fafc; /* Light text */
    --text-muted: #94a3b8;
    --border-color: #334155;
    --player-red: #ef4444;
    --player-yellow: #facc15;
    --board-cols: 7; 
    --board-rows: 6; 
}

html, body { height: 100%; width: 100%; overflow-x: hidden; scroll-behavior: smooth; margin: 0; padding: 0; }
body { 
    font-family: 'Inter', sans-serif; 
    background-color: var(--bg-main); 
    background-image: radial-gradient(circle at top center, rgba(14, 165, 233, 0.1) 0%, transparent 70%); 
    color: var(--text-color); 
    display: flex; flex-direction: row; 
    -webkit-tap-highlight-color: transparent; 
    min-height: 100vh;
}
body.menu-open { overflow: hidden; }
.hidden { display: none !important; }

/* Sidebar Menu (Kept Dark to match portal consistency) */
.left-menu { width: var(--menu-width); min-width: var(--menu-width); height: 100vh; position: fixed; top: 0; left: 0; background: rgba(10, 10, 10, 0.95); box-shadow: 2px 0 15px rgba(0, 0, 0, 0.5); padding: 0 20px; z-index: 1001; display: flex; flex-direction: column; justify-content: center; overflow-y: auto;}
.left-menu ul { list-style: none; padding: 0; margin: 0; } .left-menu li { margin-bottom: 20px; }
.left-menu a { font-family: 'Orbitron', sans-serif; font-size: 24px; font-weight: 600; color: #00C9FF; text-decoration: none; display: block; padding: 8px 0; transition: all 0.3s ease; text-shadow: 0 0 2px #00C9FF;}
.left-menu a:hover, .left-menu a:focus { color: #fff; text-shadow: 0 0 8px #fff; transform: translateX(5px); }
.left-menu a.active-page-link { color: #fff; background-color: rgba(0, 190, 255, 0.15); border-radius: 8px; padding-left: 15px; padding-right: 15px; }

/* Main Layout */
.mobile-header, .menu-overlay { display: none; }
.main-content-wrapper { flex-grow: 1; padding: 40px 20px; margin-left: var(--menu-width); display: flex; flex-direction: column; align-items: center; min-height: 100vh; box-sizing: border-box; }
.page-content { display: flex; flex-direction: column; align-items: center; gap: 30px; width: 100%; max-width: 900px; }

/* Breadcrumbs */
.breadcrumbs { width: 100%; max-width: 700px; margin-bottom: 10px; } 
.breadcrumbs ol { display: flex; list-style: none; padding: 0; margin: 0; font-size: 0.9rem; color: var(--text-muted); font-weight: 600;} 
.breadcrumbs li:not(:last-child)::after { content: '>'; margin: 0 0.75rem; } 
.breadcrumbs a { color: var(--text-muted); text-decoration: none; transition: 0.2s;} 
.breadcrumbs a:hover { color: var(--accent-color); }

/* Game Container */
.game-container { background-color: var(--bg-card); border-radius: 1.5rem; padding: 2.5rem; box-shadow: 0 20px 40px rgba(0,0,0,0.1), inset 0 0 0 1px rgba(255,255,255,0.5); display: flex; flex-direction: column; align-items: center; gap: 20px; width: 100%; max-width: 700px; box-sizing: border-box; position: relative;}

.game-title { 
    font-family: 'Orbitron', sans-serif; font-size: 2.8rem; color: var(--board-color); 
    margin: 0; text-align: center; font-weight: 700; letter-spacing: 1px;
    text-shadow: 0 0 15px rgba(14, 165, 233, 0.4);
}

/* Scoreboard */
.scoreboard { 
    display: flex; justify-content: space-between; width: 100%; max-width: 500px; 
    background: rgba(0, 0, 0, 0.3); /* Dark translucent background */
    padding: 15px; border-radius: 12px; border: 1px solid var(--border-color); 
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}
.score-card { display: flex; flex-direction: column; align-items: center; flex: 1;}
.score-label { font-family: 'Orbitron', sans-serif; font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase;}
.score-value { font-family: 'Orbitron', sans-serif; font-size: 2rem; font-weight: 700; }
.text-red { color: var(--player-red); } .text-yellow { color: #d97706; } .text-muted { color: var(--text-muted); }

/* Status Banner */
.status-banner { background: var(--bg-main); width: 100%; max-width: 500px; text-align: center; padding: 10px; border-radius: 8px; font-weight: 700; color: var(--board-color); font-size: 1.1rem; border: 1px solid var(--border-color);}

/* The Board Engine */
.game-board-wrapper { position: relative; width: 100%; max-width: 630px; aspect-ratio: var(--board-cols) / var(--board-rows); filter: drop-shadow(0 15px 25px rgba(0,0,0,0.2)); }

.game-board { width: 100%; height: 100%; background: linear-gradient(to bottom, #3b82f6, #1d4ed8); border-radius: 16px; display: grid; grid-template-columns: repeat(var(--board-cols), 1fr); grid-template-rows: repeat(var(--board-rows), 1fr); padding: 2%; gap: 2%; box-sizing: border-box; position: relative; box-shadow: inset 0 5px 15px rgba(255,255,255,0.3), inset 0 -5px 15px rgba(0,0,0,0.3); border: 2px solid #60a5fa;}

.column-selectors { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 10; display: grid; grid-template-columns: repeat(var(--board-cols), 1fr); cursor: pointer; padding: 2%; gap: 2%; box-sizing: border-box; }
.column-selector { transition: background-color 0.2s; border-radius: 50px; }
.column-selector:hover { background-color: rgba(255,255,255,0.2); }

/* Holes and Discs */
.cell { background-color: var(--bg-main); border-radius: 50%; box-shadow: inset 0 5px 10px rgba(0,0,0,0.4); position: relative; width: 100%; height: 100%; }

.disc { width: 100%; height: 100%; border-radius: 50%; position: absolute; top: 0; left: 0; animation: dropBounce 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }
.player1 { background: radial-gradient(circle at 30% 30%, #fca5a5, var(--player-red)); box-shadow: 0 4px 8px rgba(0,0,0,0.4), inset -3px -3px 8px rgba(0,0,0,0.3); }
.player2 { background: radial-gradient(circle at 30% 30%, #fef08a, var(--player-yellow)); box-shadow: 0 4px 8px rgba(0,0,0,0.4), inset -3px -3px 8px rgba(0,0,0,0.3); }

/* Win Pulse */
.winning-disc { animation: winPulse 1s infinite alternate, dropBounce 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; z-index: 5;}
@keyframes winPulse { 
    from { transform: scale(1); filter: brightness(1); box-shadow: 0 0 10px #fff;} 
    to { transform: scale(1.1); filter: brightness(1.2); box-shadow: 0 0 30px #fff, 0 0 15px #fff inset;} 
}

/* Physics Drop Animation */
@keyframes dropBounce { 
    0% { transform: translateY(-300px); } 
    60% { transform: translateY(0); } 
    80% { transform: translateY(-15px); } 
    100% { transform: translateY(0); } 
}

.board-disabled { pointer-events: none; opacity: 0.9; }

/* Buttons */
.controls-row { display: flex; gap: 15px; width: 100%; justify-content: center; margin-top: 10px;}
.action-btn { font-family: 'Orbitron', sans-serif; font-weight: 700; font-size: 1rem; padding: 0.8rem 1.5rem; border-radius: 8px; border: none; cursor: pointer; transition: all 0.2s; display: inline-flex; align-items: center; justify-content: center; gap: 8px;}
.btn-primary { background: var(--board-color); color: #fff; box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);}
.btn-primary:hover { background: #1d4ed8; transform: translateY(-2px); box-shadow: 0 6px 15px rgba(37, 99, 235, 0.4);}
.btn-secondary { background: #e2e8f0; color: #475569; }
.btn-secondary:hover { background: #cbd5e1; color: #0f172a;}
.w-100 { width: 100%; }

/* Instructions */
.game-instructions { background-color: var(--bg-card); border-radius: 1.5rem; padding: 2.5rem; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); border: 1px solid var(--border-color); width: 100%; max-width: 700px; box-sizing: border-box; line-height: 1.8; color: var(--text-color); }
.game-instructions h2 { font-family: 'Orbitron', sans-serif; color: var(--board-color); border-bottom: 1px solid var(--border-color); padding-bottom: 0.5rem; font-size: 1.8rem; margin-top: 0;}
.game-instructions h3 { font-family: 'Orbitron', sans-serif; color: var(--text-color); margin-top: 1.5rem;}
.game-instructions p { color: var(--text-muted); }
.game-instructions ul { padding-left: 20px; color: var(--text-muted); }
.game-instructions li { margin-bottom: 8px; }

/* Modals */
.modal { position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.7); backdrop-filter: blur(5px); display: flex; justify-content: center; align-items: center; opacity: 0; pointer-events: none; transition: 0.3s ease; }
.modal.visible { opacity: 1; pointer-events: auto; }
.modal-content { background: var(--bg-card); border-radius: 1rem; padding: 2.5rem; width: 90%; max-width: 400px; box-shadow: 0 20px 40px rgba(0,0,0,0.3); text-align: center; transform: scale(0.9); transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);}
.modal.visible .modal-content { transform: scale(1); }
.modal-title { font-family: 'Orbitron', sans-serif; font-size: 2.2rem; margin: 0 0 10px; color: var(--board-color); }
.modal-desc { color: #475569; font-size: 1.2rem; margin-bottom: 25px; font-weight: 600;}
.btn-group { display: flex; flex-direction: column; gap: 10px; }

.confetti-canvas { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 9999; }

/* Mobile View Adjustments */
@media (max-width: 900px) {
    :root { --menu-width: 250px; }
    body { flex-direction: column; padding: 0; } body.menu-open { overflow: hidden; }
    .mobile-header { display: flex; align-items: center; justify-content: space-between; padding: 0 20px; height: 60px; background: rgba(15, 23, 42, 0.95); border-bottom: 1px solid #334155; position: fixed; top: 0; left: 0; width: 100%; z-index: 1000; box-sizing: border-box;}
    .hamburger-btn { background: none; border: none; padding: 10px; cursor: pointer; color: #fff; font-size: 1.5rem; margin-left:-10px;}
    .mobile-title { font-family: 'Orbitron', sans-serif; font-size: 1.3rem; color: var(--accent-color); font-weight: 700;}
    .left-menu { transform: translateX(-100%); transition: 0.3s; width: var(--menu-width); min-width: var(--menu-width); } .left-menu.menu-open { transform: translateX(0); }
    .menu-overlay { display: block; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 1000; opacity: 0; pointer-events: none; transition: 0.3s; } .menu-overlay.menu-open { opacity: 1; pointer-events: auto; }
    
    .main-content-wrapper { padding: 80px 15px 20px; margin-left: 0; }
    .game-container { padding: 1.2rem; gap: 15px; border-radius: 1rem;}
    .game-title { font-size: 2rem; }
    
    .scoreboard { padding: 10px; }
    .score-label { font-size: 0.6rem; }
    .score-value { font-size: 1.5rem; }
    
    .game-instructions { padding: 1.5rem; }
    .game-instructions h2 { font-size: 1.5rem; }
    .controls-row { flex-direction: column; }
}