/* ===== Games Common Styles ===== */
:root { --primary: #3b82f6; --primary-light: #eff6ff; --bg: #0f172a; --card-bg: #1e293b; --text: #e2e8f0; --text-secondary: #94a3b8; --border: #334155; --shadow: 0 1px 3px rgba(0,0,0,0.3); --shadow-lg: 0 4px 12px rgba(0,0,0,0.4); --radius: 12px; --accent: #22c55e; --danger: #ef4444; --warning: #f59e0b; }
[data-theme="light"] { --bg: #f8fafc; --card-bg: #ffffff; --text: #1e293b; --text-secondary: #64748b; --border: #e2e8f0; --shadow: 0 1px 3px rgba(0,0,0,0.1); --shadow-lg: 0 4px 12px rgba(0,0,0,0.1); }
* { margin:0; padding:0; box-sizing:border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }
.container { max-width: 900px; margin: 0 auto; padding: 20px; }
.container-wide { max-width: 1200px; margin: 0 auto; padding: 20px; }

/* Header */
.header { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.header h1 { font-size: 1.5em; }
.header-center { text-align: center; padding: 40px 0 30px; }
.header-center h1 { font-size: 2em; margin-bottom: 8px; }
.header-center p { color: var(--text-secondary); font-size: 1.05em; }

/* Links */
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); text-decoration: none; font-size: 14px; }
.back-link:hover { text-decoration: underline; }

/* Buttons */
.btn { padding: 8px 18px; border: none; border-radius: 8px; cursor: pointer; font-size: 14px; transition: all 0.15s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }

/* Theme toggle */
.theme-toggle { position: fixed; top: 20px; right: 20px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: var(--card-bg); color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 100; }
.theme-toggle svg { width: 18px; height: 18px; }

/* Toast */
.toast { position: fixed; top: 20px; right: 20px; padding: 10px 20px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 14px; z-index: 999; animation: fadeInOut 2s; }
@keyframes fadeInOut { 0%{opacity:0;transform:translateY(-10px)} 10%{opacity:1;transform:translateY(0)} 80%{opacity:1} 100%{opacity:0} }

/* Score bar */
.score-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; padding: 12px 16px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; }
.score-item { text-align: center; }
.score-label { font-size: 12px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px; }
.score-value { font-size: 24px; font-weight: 700; font-family: 'SF Mono', monospace; color: var(--primary); }

/* Game area */
.game-area { display: flex; justify-content: center; margin: 16px 0; }
.game-area canvas { border-radius: 8px; border: 1px solid var(--border); touch-action: none; }

/* Game over overlay */
.overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.7); display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 8px; z-index: 10; }
.overlay h2 { font-size: 2em; margin-bottom: 8px; }
.overlay p { color: var(--text-secondary); margin-bottom: 16px; }

/* Footer */
.footer { text-align: center; padding: 40px 0; color: var(--text-secondary); font-size: 13px; }
.footer a { color: var(--primary); text-decoration: none; }

/* Responsive */
@media (max-width: 640px) {
  .container, .container-wide { padding: 12px; }
  .header-center h1 { font-size: 1.5em; }
  .score-value { font-size: 20px; }
}
