/* Local Fonts Initialization */
@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: 700; src: url('/fonts/orbitron-v35-latin-700.woff2') format('woff2');}
@font-face {font-display: swap; font-family: 'Roboto Mono'; font-style: normal; font-weight: 700; src: url('/fonts/roboto-mono-v31-latin-700.woff2') format('woff2');}

:root { 
    --menu-width: 200px; 
    --accent-color: #00C9FF; 
    --text-muted: #a0aec0;
    --board-bg: #0f172a;
    --cell-unrevealed: #334155;
    --cell-revealed: #1e293b;
    --cell-hover: #475569;
    --border-color: #0f172a;
}

html, body { height: 100vh; width: 100%; overflow: hidden; }
body { 
    font-family: 'Inter', sans-serif; 
    background-color: #0f172a; 
    margin: 0; padding: 0; 
    box-sizing: border-box; 
    color: #e2e8f0; 
    display: flex; flex-direction: row; 
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
body::before { content: ''; position: absolute; top:0; left:0; width:100%; height:100%; background: radial-gradient(circle at center, rgba(0,201,255,0.05) 0%, transparent 70%); z-index: -1;}

/* Menu Styling (Copied from 2048 to maintain uniformity) */
.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.9); box-shadow: 2px 0 15px rgba(0, 0, 0, 0.5); padding: 0 20px; box-sizing: border-box; z-index: 1001; font-family: 'Orbitron', sans-serif; font-weight: 600; 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-size: 26px; font-weight: normal; color: var(--accent-color); text-shadow: 0 0 2px var(--accent-color); text-decoration: none; display: block; padding: 8px 0; transition: all 0.3s ease; }
.left-menu a:hover, .left-menu a:focus { color: #fff; text-shadow: 0 0 8px #fff, 0 0 12px rgba(255, 255, 255, 0.5); outline: none; transform: translateX(5px);}
.left-menu a.active-page-link { color: #fff; text-shadow: 0 0 8px #fff, 0 0 12px rgba(255, 255, 255, 0.7); background-color: rgba(0, 190, 255, 0.15); border-radius: 8px; padding-left: 15px; padding-right: 15px; }

.main-content-wrapper { flex-grow: 1; margin-left: var(--menu-width); padding: 40px 20px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; height: 100vh; box-sizing: border-box; overflow-y: auto; }
.mobile-header, .menu-overlay { display: none; }

/* Breadcrumbs */
.breadcrumbs { width: 100%; max-width: 1200px; margin-bottom: 1rem; align-self: flex-start; } 
.breadcrumbs ol { display: flex; list-style: none; padding: 0; margin: 0; font-size: 0.9rem; color: var(--text-muted); } 
.breadcrumbs li:not(:last-child)::after { content: '>'; margin: 0 0.75rem; } 
.breadcrumbs a { color: var(--text-muted); text-decoration: none; transition: color 0.2s;} 
.breadcrumbs a:hover { color: var(--accent-color); }

.game-page-content { display: flex; flex-direction: column; align-items: center; gap: 30px; width: 100%; max-width: 800px; }
.game-container { background-color: #1e293b; border-radius: 1.5rem; padding: 2rem; box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), inset 0 0 15px rgba(0,201,255,0.05); border: 1px solid rgba(0,201,255,0.15); display: flex; flex-direction: column; align-items: center; gap: 15px; width: 100%; box-sizing: border-box; position: relative;}

.header-container h1 { font-family: 'Orbitron', sans-serif; font-size: 3rem; color: var(--accent-color); text-shadow: 0 0 10px rgba(0, 201, 255, 0.6); margin: 0; line-height: 1; text-align: center;}

/* Top Stats Bar */
.top-bar { display: flex; justify-content: space-between; align-items: center; width: 100%; background: var(--board-bg); padding: 10px 20px; border-radius: 12px; border: 2px solid #334155; box-sizing: border-box;}
.stat-box { display: flex; align-items: center; gap: 8px; font-family: 'Roboto Mono', monospace; font-size: 1.8rem; font-weight: 700; color: #f43f5e; text-shadow: 0 0 5px rgba(244,63,94,0.5); background-color: #000; padding: 5px 10px; border-radius: 6px; box-shadow: inset 0 2px 5px rgba(0,0,0,0.8); min-width: 80px; justify-content: center;}
.stat-box .icon { font-size: 1.2rem; text-shadow: none; filter: grayscale(0.2); }

.face-btn { font-size: 2.5rem; background: none; border: none; cursor: pointer; padding: 0; margin: 0; transition: transform 0.1s; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5)); box-shadow: none; }
.face-btn:hover { transform: scale(1.1); background: none; box-shadow: none; }
.face-btn:active { transform: scale(0.9); }

/* Controls */
.controls-row { display: flex; gap: 15px; width: 100%; justify-content: center; align-items: center;}
select { background: #334155; color: #fff; font-family: 'Inter', sans-serif; font-size: 1rem; font-weight: 600; padding: 0.7rem 1rem; border: 1px solid #475569; border-radius: 8px; cursor: pointer; outline: none; transition: 0.2s ease;}
select:hover { border-color: var(--accent-color); }

.action-toggle { display: flex; align-items: center; gap: 8px; padding: 0.7rem 1.2rem; font-size: 1rem; }
.action-toggle.dig-mode { background: #0284c7; }
.action-toggle.flag-mode { background: #ea580c; }
.action-toggle:hover { filter: brightness(1.1); transform: translateY(-2px); }

/* Minesweeper Grid */
.game-board-wrapper { position: relative; max-width: 100%; overflow: auto; border-radius: 8px; box-shadow: 0 10px 25px rgba(0,0,0,0.5); }
.game-board { 
    display: grid; 
    background-color: var(--board-bg); 
    border: 3px solid #334155; 
    border-radius: 8px; 
    padding: 5px;
    gap: 2px;
}
.cell { 
    width: 32px; height: 32px; 
    background-color: var(--cell-unrevealed); 
    border-radius: 4px;
    display: flex; justify-content: center; align-items: center; 
    font-family: 'Roboto Mono', monospace; font-size: 1.2rem; font-weight: 700;
    cursor: pointer;
    transition: background-color 0.1s, transform 0.1s;
    box-shadow: inset 2px 2px 4px rgba(255,255,255,0.1), inset -2px -2px 4px rgba(0,0,0,0.4);
}
.cell:hover { background-color: var(--cell-hover); }
.cell:active { transform: scale(0.95); }

/* Revealed States */
.cell.revealed { background-color: var(--cell-revealed); box-shadow: inset 1px 1px 3px rgba(0,0,0,0.5); cursor: default;}
.cell.revealed:hover { background-color: var(--cell-revealed); transform: none; }

/* Number Colors */
.cell[data-num="1"] { color: #38bdf8; } /* Cyan */
.cell[data-num="2"] { color: #4ade80; } /* Green */
.cell[data-num="3"] { color: #f87171; } /* Red */
.cell[data-num="4"] { color: #818cf8; } /* Purple */
.cell[data-num="5"] { color: #facc15; } /* Yellow */
.cell[data-num="6"] { color: #2dd4bf; } /* Teal */
.cell[data-num="7"] { color: #f472b6; } /* Pink */
.cell[data-num="8"] { color: #cbd5e1; } /* White/Gray */

/* Icons */
.cell.mine { font-size: 1.4rem; background-color: #f43f5e; box-shadow: inset 0 0 10px rgba(0,0,0,0.5); animation: pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.cell.flag { font-size: 1.2rem; }
.cell.wrong-flag { position: relative; }
.cell.wrong-flag::after { content: '❌'; position: absolute; font-size: 1.5rem; opacity: 0.8; z-index: 10;}

/* Game Overlay Message */
.game-message { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(15, 23, 42, 0.9); backdrop-filter: blur(5px); display: none; flex-direction: column; justify-content: center; align-items: center; border-radius: 8px; z-index: 50; text-align: center; padding: 20px; box-sizing: border-box; animation: fade-in 300ms ease; }
.game-message.show { display: flex; }
@keyframes fade-in { 0% { opacity: 0; } 100% { opacity: 1; } }
@keyframes pop { 0% { transform: scale(0); } 100% { transform: scale(1); } }
.game-message h2 { font-family: 'Orbitron', sans-serif; font-size: 2.5rem; color: #fff; text-shadow: 0 0 15px rgba(255,255,255,0.5); margin: 0 0 20px; }
.game-message.win h2 { color: #4ade80; text-shadow: 0 0 15px #4ade80; }
.game-message.lose h2 { color: #f43f5e; text-shadow: 0 0 15px #f43f5e; }
.msg-btn-group { display: flex; gap: 15px; }

/* Standard Buttons */
button { background: var(--accent-color); color: #0f172a; font-weight: 700; font-size: 1rem; padding: 0.8rem 1.5rem; border: none; border-radius: 8px; cursor: pointer; transition: all 0.2s ease; text-transform: uppercase; letter-spacing: 1px; box-shadow: 0 4px 15px rgba(0, 201, 255, 0.3); font-family: 'Orbitron', sans-serif; }
button:hover { background-color: #38bdf8; transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0, 201, 255, 0.5); }
button:active { transform: translateY(1px); }
.btn-secondary { background: #334155; color: #fff; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); }
.btn-secondary:hover { background: #475569; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4); }

/* Instructions */
.game-instructions { background-color: #1e293b; border-radius: 1.5rem; padding: 2rem; box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5); border: 1px solid #334155; width: 100%; box-sizing: border-box; text-align: left; margin-bottom: 40px;}
.game-instructions h2 { font-family: 'Orbitron', sans-serif; font-size: 1.8rem; color: var(--accent-color); margin: 0 0 15px; text-align: center; border-bottom: 1px solid #334155; padding-bottom: 10px; }
.game-instructions p, .game-instructions ul { font-size: 1rem; line-height: 1.7; color: #cbd5e1; margin-bottom: 10px; }
.game-instructions ul { list-style: none; margin-left: 0; padding-left: 0; } 
.game-instructions ul li { margin-bottom: 12px; position: relative; padding-left: 20px; }
.game-instructions ul li::before { content: '▸'; color: var(--accent-color); position: absolute; left: 0; font-weight: bold; }

/* Mobile View adjustments */
@media (max-width: 992px) {
    html, body { height: auto; overflow: auto; }
    body { flex-direction: column; } body.menu-open { overflow: hidden; }
    .main-content-wrapper { padding: 80px 10px 20px; margin-left: 0; height: auto; overflow: visible; align-items: center;}
    .mobile-header { display: flex; align-items: center; justify-content: center; position: fixed; top: 0; left: 0; width: 100%; height: 65px; background-color: rgba(15, 23, 42, 0.95); backdrop-filter: blur(10px); border-bottom: 1px solid #334155; z-index: 1000; box-sizing: border-box; }
    .hamburger-btn { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); background: none; border: none; padding: 10px; cursor: pointer; box-shadow: none; } .hamburger-btn .line { display: block; width: 24px; height: 3px; background-color: #e2e8f0; margin: 5px 0; border-radius: 3px;}
    .hamburger-btn:hover { transform: translateY(-50%); box-shadow: none; background: none;}
    .mobile-title { font-family: 'Orbitron', sans-serif; font-size: 1.5rem; color: var(--accent-color); font-weight: 700; text-shadow: 0 0 8px rgba(0, 201, 255, 0.5);}
    .left-menu { transform: translateX(-100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); width: 260px; } .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); backdrop-filter: blur(2px); z-index: 1000; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; } .menu-overlay.menu-open { opacity: 1; pointer-events: auto; }
    
    .game-page-content { max-width: 100%; gap: 15px; }
    .game-container { padding: 1rem; border-radius: 1rem; }
    .header-container h1 { font-size: 2.2rem; }
    .top-bar { padding: 8px 12px; }
    .stat-box { font-size: 1.4rem; min-width: 65px; padding: 4px 8px; }
    .face-btn { font-size: 2rem; }
    .cell { width: 28px; height: 28px; font-size: 1rem; }
    .action-toggle { flex: 1; justify-content: center; font-size: 0.9rem;}
    select { flex: 1; padding: 0.6rem 0.5rem; font-size: 0.9rem; }
    .game-instructions { padding: 1.5rem; }
}

@media (min-width: 1100px) {
    .game-page-content { flex-direction: row; align-items: flex-start; max-width: 1200px; gap: 40px; justify-content: center;} 
    .game-container { flex: 1.5; max-width: none;} 
    .game-instructions { flex: 1; max-width: 400px; position: sticky; top: 40px;} 
}