/*
 * game-base.css — Shared foundation for all Lavee game pages
 * Loaded by every game HTML file. Game-specific styles go in the
 * game's own <style> block, which cascades on top of this.
 */

@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Bebas+Neue&display=swap');
/* Material Symbols loaded via <link> in each game's <head> — see game-base note */

.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ── Design tokens ───────────────────────────────────────────── */
:root {
  --bg:      #1a1a2e;
  --surface: #16213e;
  --surface2:#0f3460;
  --border:  #1e3060;
  --accent:  #f0c040;
  --accent2: #ff6b8a;
  --accent3: #5af0d0;
  --accent4: #b45aff;
  --text:    #dce8ff;   /* was #eef2ff — softer on extended play */
  --muted:   #8fa3c8;   /* was #6b7a99 — 6.7:1 contrast, WCAG AA */
  --radius:  8px;
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Base layout ─────────────────────────────────────────────── */
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Space Mono', monospace;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 40px;
  overflow-x: hidden;
}

/* CRT scanline overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent, transparent 2px,
    rgba(0, 0, 0, 0.03) 2px, rgba(0, 0, 0, 0.03) 4px
  );
  pointer-events: none;
  z-index: 999;
}

/* ── Game header (title + subtitle) ─────────────────────────── */
header {
  text-align: center;
  margin-bottom: 24px;
}

h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(48px, 10vw, 72px);
  letter-spacing: 6px;
  color: var(--accent);
  line-height: 1;
  text-shadow: 0 0 40px rgba(240, 192, 64, 0.3);
}

.subtitle {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-top: 6px;
}

/* ── HUD strip (score / timer / level row) ───────────────────── */
.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 440px;
  margin-bottom: 16px;
  padding: 12px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ── Glass panel utility ─────────────────────────────────────── */
.glass-panel {
  background: rgba(22, 27, 34, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

/* ── Category badge (above h1) ───────────────────────────────── */
.cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-family: 'Space Mono', monospace;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 8px;
  font-weight: 700;
  border: 1px solid currentColor;
}
.cat-badge .material-symbols-outlined { font-size: 14px; }
.cat-badge.memory   { color: #5af0d0; background: rgba(90,240,208,0.10); }
.cat-badge.speed    { color: #ff6b8a; background: rgba(255,107,138,0.10); }
.cat-badge.puzzle   { color: #f0c040; background: rgba(240,192,64,0.10); }
.cat-badge.strategy { color: #b45aff; background: rgba(180,90,255,0.10); }

/* ── External Start button ───────────────────────────────────── */
.ext-start-btn {
  display: block;
  width: 100%;
  max-width: 440px;
  margin-top: 20px;
  padding: 18px 0;
  background: linear-gradient(to right, #f59e0b, #d97706);
  box-shadow: 0 0 30px rgba(251, 189, 0, 0.2);
  color: #000;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 24px;
  letter-spacing: 4px;
  text-align: center;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
}
.ext-start-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 0 40px rgba(251, 189, 0, 0.35);
}
.ext-start-btn:active { transform: scale(0.98); }
.ext-start-btn.hidden { display: none; }

/* ── Action buttons row (RANKS + CHALLENGE) ──────────────────── */
.game-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  max-width: 440px;
  margin-top: 12px;
}
.game-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 0;
  background: rgba(22, 27, 34, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--text);
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.game-action-btn .material-symbols-outlined { font-size: 16px; }
.game-action-btn:hover {
  border-color: rgba(240, 192, 64, 0.4);
  color: var(--accent);
  background: rgba(240, 192, 64, 0.05);
}
.game-action-btn:active { transform: scale(0.95); }

/* ── Info section wrapper ────────────────────────────────────── */
.game-info-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 440px;
  margin-top: 20px;
}

/* ── How to Play accordion ───────────────────────────────────── */
.how-accordion {
  width: 100%;
}
.how-accordion summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  border-radius: 12px;
}
.how-accordion[open] summary { border-radius: 12px 12px 0 0; }
.how-accordion summary::-webkit-details-marker { display: none; }
.how-summary-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.how-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(220, 231, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bcc7de;
  flex-shrink: 0;
}
.how-icon-box .material-symbols-outlined { font-size: 18px; }
.how-title {
  font-family: 'Space Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0;
}
.how-chevron {
  color: var(--muted);
  font-size: 22px !important;
  transition: transform 0.25s;
}
.how-accordion[open] .how-chevron { transform: rotate(180deg); }
.how-accordion-body {
  padding: 4px 16px 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.how-step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.how-step-num {
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  min-width: 20px;
  padding-top: 1px;
}
.how-step-text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}
.how-step-text strong { color: var(--text); }

/* ── Expert Tips panel ───────────────────────────────────────── */
.tips-card {
  width: 100%;
  padding: 14px 16px;
}
.tips-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.tips-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(67, 73, 92, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c0c6dd;
  flex-shrink: 0;
}
.tips-icon-box .material-symbols-outlined { font-size: 18px; }
.tips-title {
  font-family: 'Space Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.tips-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tip-item {
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  border-left: 4px solid var(--accent);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
}
.tip-item strong { color: var(--text); }

/* ── Skill row ───────────────────────────────────────────────── */
.skill-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 100%;
  max-width: 440px;
  padding: 16px 0;
}
.skill-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
}
.skill-badge .material-symbols-outlined {
  font-size: 24px;
  color: var(--accent);
}
.skill-badge-label {
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
  font-family: 'Space Mono', monospace;
}
.skill-divider {
  width: 1px;
  height: 32px;
  background: rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

/* ── Friend challenge banner (inbound link) ──────────────────── */
#lavee-challenge-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 440px;
  padding: 12px 14px;
  background: rgba(240, 192, 64, 0.08);
  border: 1px solid rgba(240, 192, 64, 0.28);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  margin-bottom: 14px;
  color: var(--text);
}
.lcb-icon { font-size: 22px; flex-shrink: 0; line-height: 1; }
.lcb-text {
  flex: 1;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}
.lcb-text strong { color: var(--accent); font-weight: 700; }
.lcb-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.lcb-close:hover { opacity: 1; }
.lcb-close svg { display: block; }

/* ── Social share strip (inside result overlay) ──────────────── */
#lavee-share-strip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 14px 0 6px;
  border-top: 1px solid var(--border);
  margin-top: 10px;
}
.lss-label {
  font-size: 9px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--muted);
  font-family: 'Space Mono', monospace;
}
.lss-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.lss-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 8px;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  white-space: nowrap;
}
.lss-btn svg { width: 14px; height: 14px; fill: currentColor; flex-shrink: 0; }
.lss-btn:hover {
  border-color: var(--accent);
  background: rgba(240, 192, 64, 0.08);
  color: var(--accent);
}
.lss-wa { color: #3dba73; border-color: rgba(61, 186, 115, 0.35); }
.lss-wa:hover { border-color: #3dba73; background: rgba(61, 186, 115, 0.1); color: #3dba73; }
.lss-copy { color: var(--accent); border-color: rgba(240, 192, 64, 0.35); }
.lss-copy:hover { border-color: var(--accent); background: rgba(240, 192, 64, 0.1); }
