/* Self-Hosted 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: 700; src: url('/fonts/orbitron-v35-latin-700.woff2') format('woff2');}

:root { 
    --menu-width: 200px; 
    --accent-color: #00C9FF; 
    --text-muted: #94a3b8; 
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --board-green: #14532d; /* Casino Felt Green */
    --card-red: #ef4444;
    --card-black: #111827;
}

html, body { height: 100%; width: 100%; overflow-x: hidden; }
body { 
    font-family: 'Inter', sans-serif; 
    background-color: var(--bg-dark); 
    background-image: radial-gradient(circle at top center, rgba(0, 201, 255, 0.05) 0%, transparent 70%); 
    margin: 0; padding: 0; 
    color: #e2e8f0; 
    display: flex; flex-direction: row; 
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Sidebar Menu */
.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; box-sizing: border-box; z-index: 1001; font-family: 'Orbitron', sans-serif; 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: 24px; font-weight: 600; color: var(--accent-color); text-decoration: none; text-shadow: 0 0 2px var(--accent-color); 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 Layout */
.mobile-header, .menu-overlay { display: none; }
.main-content-wrapper { flex-grow: 1; padding: 40px 20px; padding-left: calc(var(--menu-width) + 40px); display: flex; flex-direction: column; align-items: center; min-height: 100vh; box-sizing: border-box; width: 100%; }

/* Breadcrumbs */
.breadcrumbs { width: 100%; max-width: 900px; 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: color 0.2s;} 
.breadcrumbs a:hover { color: var(--accent-color); }

/* Game Container & HUD */
.game-container { background-color: var(--bg-card); border-radius: 1rem; padding: 1.5rem; 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; width: 100%; max-width: 900px; box-sizing: border-box;}

.game-hud { display: flex; justify-content: space-between; align-items: center; width: 100%; padding-bottom: 15px; border-bottom: 2px solid #334155; margin-bottom: 15px; }
.hud-item { text-align: center; font-family: 'Inter', sans-serif; font-size: 0.85rem; font-weight: 700; color: var(--text-muted); letter-spacing: 1px;}
.hud-item span { display: block; font-family: 'Orbitron', sans-serif; font-size: 1.6rem; color: #fff; text-shadow: 0 0 8px var(--accent-color); margin-top: 5px; }

/* Buttons */
.action-btn { font-family: 'Orbitron', sans-serif; background: var(--accent-color); color: #000; font-weight: 700; font-size: 1rem; padding: 0.7rem 1.2rem; border: none; border-radius: 8px; cursor: pointer; transition: all 0.2s ease; box-shadow: 0 4px 15px rgba(0, 201, 255, 0.3); display: flex; align-items: center; gap: 8px;}
.action-btn:hover { background-color: #38bdf8; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 201, 255, 0.5); }
.action-btn.secondary { background: #334155; color: #fff; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4); margin-top: 15px; width: 100%; justify-content: center; padding: 1rem;}
.action-btn.secondary:hover { background: #475569; }
.hidden { display: none !important; }

/* Solitaire Board */
.solitaire-board { width: 100%; max-width: 800px; background-color: var(--board-green); border-radius: 12px; padding: 15px; box-sizing: border-box; box-shadow: inset 0 0 30px rgba(0,0,0,0.5); position: relative; overflow: hidden; min-height: 550px;}

.top-row, .bottom-row { display: flex; justify-content: space-between; width: 100%; margin-bottom: 20px;}
.spacer { width: calc(100% / 7); }
.pile { width: 13%; aspect-ratio: 2.5 / 3.5; position: relative; border-radius: 6px; box-sizing: border-box; }

/* Placeholder Styling */
.pile::before { content: ''; position: absolute; width: 100%; height: 100%; border: 2px solid rgba(255,255,255,0.15); border-radius: 6px; box-sizing: border-box; }
.foundation-pile::after { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 3vw; color: rgba(255,255,255,0.1); }
#foundation-0::after { content: '♠'; } #foundation-1::after { content: '♥'; } #foundation-2::after { content: '♣'; } #foundation-3::after { content: '♦'; }
.pile-placeholder { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: rgba(255,255,255,0.3); font-size: 2rem; z-index: 0;}

/* Card Design (Pure CSS) */
.card {
    position: absolute; width: 100%; height: 100%; background-color: #fff; border-radius: 6px;
    box-shadow: 1px 1px 4px rgba(0,0,0,0.4); box-sizing: border-box; padding: 5%; cursor: grab;
    display: flex; flex-direction: column; justify-content: space-between; transition: box-shadow 0.2s;
    user-select: none; z-index: 1;
}
.card:active { cursor: grabbing; box-shadow: 5px 5px 15px rgba(0,0,0,0.5); }
.card.red { color: var(--card-red); }
.card.black { color: var(--card-black); }

/* Face Down Pattern */
.card.face-down {
    background-color: #1e40af;
    background-image: repeating-linear-gradient(45deg, #1e3a8a 25%, transparent 25%, transparent 75%, #1e3a8a 75%, #1e3a8a), repeating-linear-gradient(45deg, #1e3a8a 25%, #1e40af 25%, #1e40af 75%, #1e3a8a 75%, #1e3a8a);
    background-position: 0 0, 10px 10px; background-size: 20px 20px;
    cursor: default; border: 2px solid #fff;
}
.card.face-down * { display: none; }

.card-top { font-size: clamp(0.8rem, 2vw, 1.2rem); font-weight: 800; line-height: 1; display: flex; flex-direction: column; align-items: flex-start;}
.card-center { font-size: clamp(1.5rem, 3.5vw, 2.5rem); text-align: center; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.card-bottom { font-size: clamp(0.8rem, 2vw, 1.2rem); font-weight: 800; line-height: 1; display: flex; flex-direction: column; align-items: flex-end; transform: rotate(180deg); }

/* Dragging State */
.card.dragging { z-index: 9999 !important; transition: none; pointer-events: none;}
.card.returning { transition: transform 0.2s ease-out, left 0.2s ease-out, top 0.2s ease-out; }

/* Win Animation Canvas */
#win-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1000; overflow: hidden;}
.win-card { position: absolute; width: 10%; aspect-ratio: 2.5/3.5; border-radius: 4px; box-shadow: 1px 1px 3px rgba(0,0,0,0.5); }

/* Instructions */
.game-instructions { background-color: var(--bg-card); border-radius: 1rem; padding: 2rem; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); border: 1px solid var(--border-color); width: 100%; max-width: 900px; box-sizing: border-box; margin-top: 20px;}
.game-instructions h2 { font-family: 'Orbitron', sans-serif; font-size: 1.5rem; color: var(--accent-color); margin-top: 0; margin-bottom: 15px; border-bottom: 1px solid var(--border-color); padding-bottom: 10px; }
.game-instructions p, .game-instructions ul { font-size: 1rem; line-height: 1.7; color: #cbd5e0; margin-bottom: 10px; }
.game-instructions ul { list-style: none; padding-left: 0; }
.game-instructions ul li { margin-bottom: 10px; position: relative; padding-left: 20px; }
.game-instructions ul li::before { content: '▸'; color: var(--accent-color); position: absolute; left: 0; font-weight: bold; }

/* Mobile Adjustments */
@media (max-width: 992px) {
    :root { --menu-width: 250px; }
    body { flex-direction: column; padding: 0; } body.menu-open { overflow: hidden; }
    .main-content-wrapper { padding: 80px 15px 20px; margin-left: 0; width: 100%; }
    .mobile-header { display: flex; align-items: center; justify-content: space-between; padding: 0 20px; height: 60px; background-color: rgba(15, 23, 42, 0.95); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border-color); position: fixed; top: 0; left: 0; width: 100%; z-index: 1000; box-sizing: border-box; }
    .hamburger-btn { background: none; border: none; padding: 10px; margin-left: -10px; cursor: pointer; z-index: 1002; } .hamburger-btn .line { display: block; width: 24px; height: 3px; background-color: #f8fafc; margin: 5px 0; border-radius: 3px; transition: transform 0.3s ease, opacity 0.3s ease; }
    .mobile-title { font-family: 'Orbitron', sans-serif; font-size: 1.3rem; font-weight: 700; color: var(--accent-color); }
    .left-menu { transform: translateX(-100%); transition: transform 0.3s ease-in-out; height: 100vh; 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); 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-container { padding: 0.8rem; }
    .solitaire-board { padding: 10px; min-height: 60vh;}
    .pile { width: 13.5%; }
    .card { padding: 2%; border-radius: 4px; }
    .hud-item { font-size: 0.65rem; } .hud-item span { font-size: 1.2rem; }
    .action-btn { font-size: 0.8rem; padding: 0.5rem 0.8rem; }
    .game-instructions { padding: 1.5rem; }
}