/* 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: 700; src: url('/fonts/orbitron-v35-latin-700.woff2') format('woff2');}

:root { 
    --menu-width: 200px; 
    --accent-color: #00C9FF; 
    --wood-color: #eab308; 
    --tile-color: #f8fafc; 
    --bg-main: #0f172a; 
    --bg-card: #1e293b; 
    --border-color: #334155; 
    --text-color: #f8fafc; 
    --text-muted: #94a3b8; 
    --error-red: #ef4444; 
    --success-green: #10b981; 
}

html, body { height: 100%; width: 100%; overflow-x: hidden; margin: 0; padding: 0; }
body { 
    font-family: 'Inter', sans-serif; 
    background-color: var(--bg-main); 
    background-image: radial-gradient(circle at top center, rgba(0, 201, 255, 0.05) 0%, transparent 70%); 
    color: var(--text-color); display: flex; flex-direction: row; 
    -webkit-tap-highlight-color: transparent;
}
body.menu-open { overflow: hidden; }

/* 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; z-index: 1001; font-family: 'Orbitron', sans-serif; display: flex; flex-direction: column; justify-content: center; }
.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; display: block; padding: 8px 0; transition: all 0.3s ease; text-shadow: 0 0 2px var(--accent-color);}
.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; }

.mobile-header, .menu-overlay { display: none; }

/* Main Layout */
.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; }
.breadcrumbs { width: 100%; max-width: 900px; margin-bottom: 1rem; } 
.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; } 
.breadcrumbs a:hover { color: var(--accent-color); }

/* CSP Helper Classes */
.share-icon-btn { font-size: 1.2rem; }
.modal-wide { max-width: 600px !important; }
.relative-wrap { position: relative; }
.text-accent { color: var(--accent-color); }
.text-wood { color: var(--wood-color); }
.status-muted { color: var(--text-muted); font-style: italic; }
.confetti-canvas { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 9999; }

/* App Container */
.app-container { background-color: var(--bg-card); border-radius: 1rem; box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), inset 0 0 15px rgba(0,201,255,0.05); border: 1px solid var(--border-color); padding: 2rem; width: 100%; max-width: 900px; display: flex; flex-direction: column; gap: 1.5rem; position: relative;}
.top-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; border-bottom: 1px solid var(--border-color); padding-bottom: 1rem;}
.game-title { font-family: 'Orbitron', sans-serif; font-size: 1.8rem; font-weight: 700; color: var(--wood-color); }
.top-bar-controls { display: flex; gap: 0.5rem; flex-wrap: wrap;}

/* Buttons */
.control-btn { font-family: 'Orbitron', sans-serif; background-color: var(--bg-dark); color: #fff; border: 1px solid var(--border-color); padding: 0.8rem 1.2rem; border-radius: 8px; cursor: pointer; font-weight: 600; transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 0.5rem; font-size: 1rem;}
.control-btn:hover:not(:disabled) { border-color: var(--accent-color); transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0, 201, 255, 0.2); }
.control-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background-color: var(--accent-color); color: #000; border: none; }
.btn-primary:hover:not(:disabled) { background-color: #38bdf8; box-shadow: 0 5px 15px rgba(0, 201, 255, 0.5); }
.btn-danger { background-color: var(--error-red); color: white; border: none; }
.btn-danger:hover:not(:disabled) { background-color: #f87171; box-shadow: 0 5px 15px rgba(239, 68, 68, 0.5); }
.w-100 { width: 100%; }
.mt-3 { margin-top: 1.5rem; }
.center-btn { justify-content: center; margin-top: 1.5rem; }

/* Quick Actions */
.quick-action-row { display: flex; gap: 5px; margin-top: 8px; justify-content: space-between;}
.quick-btn { background: var(--bg-card); border: 1px solid var(--border-color); color: var(--text-muted); font-size: 0.75rem; padding: 4px 8px; border-radius: 4px; cursor: pointer; flex: 1; transition: 0.2s; font-family: 'Inter', sans-serif; font-weight: 600;}
.quick-btn:hover { background: var(--border-color); color: #fff; }
.quick-btn.bingo:hover { background: rgba(16, 185, 129, 0.2); color: var(--success-green); border-color: var(--success-green);}

/* Inputs */
.app-input { background-color: var(--bg-dark); color: var(--text-color); border: 2px solid var(--border-color); border-radius: 8px; padding: 1rem; font-size: 1.2rem; font-weight: 600; width: 100%; box-sizing: border-box; outline: none; transition: border-color 0.2s; font-family: 'Inter', sans-serif;}
.app-input:focus { border-color: var(--accent-color); }
.app-textarea { background-color: var(--bg-dark); color: var(--text-color); border: 1px solid var(--border-color); border-radius: 8px; padding: 1rem; font-size: 1rem; width: 100%; box-sizing: border-box; outline: none; resize: none; line-height: 1.5;}

/* Setup & Add Score Areas */
.setup-area { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.player-input-group { display: flex; flex-direction: column; position: relative;}
.player-input-group label { margin-bottom: 0.5rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; font-size: 0.85rem; letter-spacing: 0.5px;}
.remove-player-btn { position: absolute; right: 10px; top: 12px; background: rgba(239, 68, 68, 0.2); border: none; color: var(--error-red); border-radius: 5px; width: 30px; height: 30px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s; z-index: 10;}
.remove-player-btn:hover { background: var(--error-red); color: #fff;}

.add-score-area { background-color: rgba(0, 201, 255, 0.05); border: 1px solid rgba(0, 201, 255, 0.2); padding: 1.5rem; border-radius: 12px; margin-bottom: 1.5rem;}
.add-score-area h3 { margin: 0 0 1.5rem 0; font-family: 'Orbitron'; text-align: center; color: var(--accent-color); font-size: 1.5rem;}
.add-score-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1rem; align-items: flex-start; }

/* Player Columns (The Juice) */
.player-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; }
.player-col { background-color: var(--bg-dark); border-radius: 12px; text-align: center; box-shadow: inset 0 0 10px rgba(0,0,0,0.5); border: 1px solid var(--border-color); display: flex; flex-direction: column; overflow: hidden; position: relative;}

/* Sticky Header for easy scrolling */
.player-col header { position: sticky; top: 0; background: rgba(15, 23, 42, 0.95); backdrop-filter: blur(5px); z-index: 5; padding: 1.5rem 1rem 1rem; display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid var(--wood-color); box-shadow: 0 5px 10px rgba(0,0,0,0.3); }
.player-name { font-family: 'Orbitron', sans-serif; font-size: 1.3rem; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }

@keyframes crownBounce { 0%, 100% { transform: translateY(0) scale(1); filter: drop-shadow(0 0 2px var(--wood-color));} 50% { transform: translateY(-5px) scale(1.1); filter: drop-shadow(0 0 8px var(--wood-color));} }
.leader-icon { color: var(--wood-color); margin-left: 8px; animation: crownBounce 2s infinite; font-size: 1.2rem;}

.score-list { list-style: none; padding: 1rem; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; max-height: 300px; overflow-y: auto; flex-grow: 1; scrollbar-width: thin;}
.score-list::-webkit-scrollbar { width: 4px; } .score-list::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
.score-list li { background-color: var(--bg-card); color: var(--text-muted); font-weight: 600; border-radius: 6px; padding: 0.8rem; display: flex; justify-content: space-between; align-items: center; font-size: 0.95rem; border: 1px solid var(--border-color); transition: 0.2s; position: relative;}

/* Edit Indicator */
.score-list li[data-round]:hover { background-color: var(--accent-color); color: #000; cursor: pointer; transform: scale(1.02); }
.score-list li[data-round]::after { content: '\f044'; font-family: "Font Awesome 6 Free"; font-weight: 900; position: absolute; right: 10px; opacity: 0; transition: 0.2s;}
.score-list li[data-round]:hover::after { opacity: 1; color: #000; right: -15px;}

.total-score { font-family: 'Orbitron', sans-serif; font-size: 3.5rem; padding: 1rem; color: var(--accent-color); font-weight: 700; text-shadow: 0 0 15px rgba(0, 201, 255, 0.4); border-top: 1px solid var(--border-color); background: rgba(0,0,0,0.2);}

/* Stats Area */
.stats-area { background-color: rgba(0, 0, 0, 0.3); padding: 2rem; border-radius: 12px; margin-top: 2rem; border: 1px solid var(--border-color); }
.win-title { font-family: 'Orbitron', sans-serif; font-size: 2.5rem; text-align: center; color: var(--success-green); text-shadow: 0 0 15px var(--success-green); margin-top: 0;}
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1.5rem; }
.stat-item { text-align: center; background: var(--bg-dark); padding: 1rem; border-radius: 8px;} 
.stat-item h4 { margin: 0 0 0.5rem 0; color: var(--text-muted); font-size: 0.85rem; text-transform: uppercase;} 
.stat-item p { margin: 0; font-size: 1.8rem; font-weight: 700; font-family: 'Orbitron'; color: #fff; }

/* Word Checker */
.word-checker { background-color: rgba(0, 0, 0, 0.3); padding: 1.5rem; border-radius: 12px; border: 1px solid var(--border-color);}
.word-checker h3 { margin: 0 0 1rem 0; text-align: center; font-family: 'Orbitron'; color: var(--wood-color);}
.word-checker-form { display: flex; gap: 1rem; }
#wordStatus { text-align: center; margin-top: 1rem; font-weight: bold; height: 1em; font-size: 1.1rem; }
.status-valid { color: var(--success-green); text-shadow: 0 0 5px var(--success-green); }
.status-invalid { color: var(--error-red); text-shadow: 0 0 5px var(--error-red);}

/* Modals */
.hidden { display: none !important; }
.modal { position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(15, 23, 42, 0.85); backdrop-filter: blur(8px); display: flex; justify-content: center; align-items: center; opacity: 0; pointer-events: none; transition: opacity 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: 500px; box-shadow: 0 15px 35px rgba(0,0,0,0.6); transform: scale(0.95); transition: transform 0.3s ease; position: relative; border: 1px solid var(--border-color);}
.modal.visible .modal-content { transform: scale(1); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.modal-title { font-family: 'Orbitron', sans-serif; font-size: 1.6rem; margin: 0; color: #fff; }
.close-btn { background: none; border: none; color: var(--text-muted); font-size: 2rem; cursor: pointer; padding: 0; transition: color 0.2s; }
.close-btn:hover { color: #fff; }
.modal-desc { color: var(--text-muted); line-height: 1.6; margin-top: -10px; margin-bottom: 20px;}
.modal-inputs { display: flex; flex-direction: column; gap: 15px; }
.modal-player-row { display: flex; flex-direction: column; gap: 5px; }

/* Cheat Sheet Grid */
.cheat-sheet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 8px; text-align: center; max-height: 60vh; overflow-y: auto;}
.cheat-word { background: var(--bg-dark); color: var(--accent-color); padding: 5px; border-radius: 4px; font-weight: bold; border: 1px solid var(--border-color); font-family: 'Orbitron', sans-serif;}

/* Social Grid */
.share-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 1rem; }
.share-item { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; color: var(--text-muted); text-decoration: none; padding: 1rem; background: var(--bg-dark); border-radius: 8px; transition: all 0.2s; border: none; cursor: pointer;}
.share-item:hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.3); color: #fff;}
.share-item i { font-size: 2rem; } 
.share-item span { font-size: 0.85rem; font-weight: 700; font-family: 'Inter', sans-serif;}
.share-item.facebook:hover i { color: #1877F2; } .share-item.twitter:hover i { color: #1DA1F2; } .share-item.reddit:hover i { color: #FF4500; }

/* Article Section */
.content-section { margin-top: 2rem; padding: 2rem; background-color: var(--bg-card); border-radius: 1rem; max-width: 900px; line-height: 1.8; border: 1px solid var(--border-color); }
.content-section h2 { font-family: 'Orbitron', sans-serif; color: var(--accent-color); font-size: 1.8rem; margin-top: 0;}
.content-section ul { padding-left: 20px; color: var(--text-muted);}
.content-section p { color: var(--text-muted); }
.content-section strong { color: #fff; }

/* Mobile View Adjustments */
@media (max-width: 900px) {
    :root { --menu-width: 250px; }
    body { flex-direction: column; } body.menu-open { overflow: hidden; }
    
    .mobile-header { display: flex; align-items: center; justify-content: space-between; padding: 0 20px; height: 65px; 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; cursor: pointer; color: var(--text-color); font-size: 1.5rem; margin-left: -10px; }
    .mobile-title { font-family: 'Orbitron', sans-serif; font-size: 1.3rem; color: #fff; 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: 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; }
    
    .main-content-wrapper { padding: 85px 15px 40px; margin-left: 0; }
    
    .app-container { padding: 1.2rem; gap: 1.5rem;}
    .game-title { display: none; }
    .top-bar { justify-content: center; border-bottom: none; padding-bottom: 0;}
    .top-bar-controls { justify-content: center; width: 100%; }
    .control-btn { flex: 1; padding: 0.8rem 0.5rem; font-size: 0.85rem; justify-content: center; }
    #share-btn-desktop { display: none; } 
    
    /* Thumb-friendly inputs */
    .app-input, .player-input-group input { padding: 1.2rem; font-size: 1.4rem; border-width: 2px;}
    .add-score-area { padding: 1.2rem; background: var(--bg-main); border: 2px solid var(--accent-color);}
    .add-score-area h3 { font-size: 1.2rem; }
    .add-score-grid { grid-template-columns: repeat(2, 1fr); gap: 15px;}
    #submitRoundBtn { padding: 1.2rem; font-size: 1.2rem; box-shadow: 0 5px 15px rgba(0, 201, 255, 0.4);}
    
    .player-columns { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .player-col { padding: 0; } 
    .player-col header { padding: 1rem; margin-bottom: 0;}
    .total-score { font-size: 2.5rem; padding: 0.5rem;}
    .score-list { max-height: 200px; padding: 0.5rem;}
    
    .content-section { padding: 1.5rem; }
}