/* ============================================================
   HOSHI DESIGN SYSTEM — shared across all games
   ============================================================ */

:root {
  /* Dark theme (default) */
  --bg: #0d0d14;
  --surface: #14141f;
  --surface-elevated: #1c1c2e;
  --border: #2e2e45;
  --border-hover: #4a4a6a;
  --text: #eef0f6;
  --text-dim: #9196a8;
  --text-muted: #565d72;
  --gold: #ffe066;
  --gold-dim: #c4aa40;
  --green: #4ade80;
  --yellow: #facc15;
  --red: #f87171;
  --blue: #60a5fa;
  --purple: #a78bfa;

  /* Overlay */
  --overlay-bg: rgba(13,13,20,.92);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,.5);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  /* Typography */
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

[data-theme="light"] {
  /* Dawn blue — cool pre-dawn sky, warm gold reads as luminous not muddy */
  --bg: #f0f0f8;
  --surface: #ffffff;
  --surface-elevated: #e6e6f2;
  --border: #b0b0c8;
  --border-hover: #7878a0;
  --text: #0f0f1a;
  --text-dim: #5a5a78;
  --text-muted: #7878a0;
  --gold: #a06000;
  --gold-dim: #7a4800;
  --green: #15803d;
  --yellow: #b45309;
  --red: #b91c1c;
  --blue: #1d4ed8;
  --purple: #6d28d9;
  --shadow-sm: 0 1px 3px rgba(15,15,26,.10);
  --shadow-md: 0 4px 12px rgba(15,15,26,.14);
  --overlay-bg: rgba(240,240,248,.96);
}

/* Theme toggle button — drop this anywhere */
.theme-toggle {
  position: fixed;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .2s, color .2s;
  z-index: 100;
}
.theme-toggle:hover { border-color: var(--gold); color: var(--gold); }

/* Daily Challenge banner — visibly clickable */
.daily-banner {
  background: var(--surface-elevated);
  border: 1.5px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin: 16px 0;
  cursor: pointer;
  transition: background .2s, border-color .2s, box-shadow .2s;
  position: relative;
}
.daily-banner:hover {
  background: rgba(255,224,102,0.06);
  border-color: #ffe066;
  box-shadow: 0 0 0 1px rgba(255,224,102,0.3);
}
.daily-banner-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.daily-banner-title span { color: var(--gold); margin-right: 6px; }
.daily-banner-play-cta {
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--gold);
  font-weight: 600;
  white-space: nowrap;
}
.daily-banner-desc { font-size: 12px; color: var(--text-dim); }
.daily-banner-meta { font-size: 12px; color: var(--text-dim); margin-top: 6px; }

/* ── Rating prompt (3-icon: 👎 👍 ❤️) ─────────────────────────────────────── */
.rating-prompt { margin-top: 16px; text-align: center; }
.rating-label {
  font-variant: small-caps;
  font-size: 0.7rem;
  color: var(--text-muted, var(--text-dim));
  margin-bottom: 6px;
  letter-spacing: 0.12em;
  text-align: center;
}
.rating-icons {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 4px 0;
}
.rating-icon {
  font-size: 32px;
  cursor: pointer;
  opacity: 0.4;
  display: inline-block;
  line-height: 1;
  padding: 4px;
  transition: transform 0.12s ease, opacity 0.12s ease;
  -webkit-user-select: none;
  user-select: none;
}
.rating-icon:hover {
  opacity: 0.7;
  transform: scale(1.1);
}
/* After rating: unselected icons dim, selected one glows */
.rating-icons.rated .rating-icon {
  opacity: 0.25;
}
.rating-icons.rated .rating-icon.selected {
  opacity: 1.0;
  transform: scale(1.2);
}
.rating-icon[data-rating="1"].selected {
  text-shadow: 0 0 10px #ef4444, 0 0 18px #ef444466;
}
.rating-icon[data-rating="2"].selected {
  text-shadow: 0 0 10px #eab308, 0 0 18px #eab30866;
}
.rating-icon[data-rating="3"].selected {
  text-shadow: 0 0 10px #f43f5e, 0 0 18px #f43f5e66;
}
.rating-stats { font-size: 0.72rem; color: var(--text-dim); margin-top: 8px; min-height: 1.2em; text-align: center; }

/* ov-btn icon alignment — shared across word games */
.ov-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.ov-btn svg { width: 15px; height: 15px; flex-shrink: 0; }

/* Light mode: give cards real depth + fix active nav state */
[data-theme="light"] .game {
  box-shadow: 0 1px 3px rgba(15,15,26,.08), 0 1px 2px rgba(15,15,26,.06);
}
[data-theme="light"] .game:hover {
  box-shadow: 0 4px 12px rgba(15,15,26,.12);
}
[data-theme="light"] .cat-btn.active {
  background: rgba(160, 96, 0, 0.10);
  color: #a06000;
  border-color: #a06000;
}
[data-theme="light"] .cat-btn:hover {
  background: rgba(160, 96, 0, 0.06);
  color: #5a5a78;
  border-color: #7878a0;
}

/* Light mode overlay button — stronger borders, darker text for legibility */
[data-theme="light"] .ov-btn {
  border-color: var(--gold);
  color: var(--gold);
  font-weight: 700;
}
[data-theme="light"] .ov-btn:hover {
  background: rgba(176, 120, 0, 0.08);
}
/* rating icons are emoji — no light mode override needed */

/* SEO: visually hidden but crawlable how-to-play sections */
/* ── Game page: lock to viewport, no scroll, always dark ─────────────────── */
/* Applied via JS — hub (index) is exempt */
html.game-page,
html.game-page body {
  height: 100% !important;
  overflow: hidden !important;
}
html.game-page body {
  height: 100dvh !important;
  max-height: 100dvh !important;
  min-height: 580px;
}
/* Game pages are dark-only — hide the toggle so it's not confusing */
html.game-page .theme-toggle {
  display: none !important;
}

/* SEO content: hidden from users, crawlable by Google via aria-label */
.seo-content {
  display: none !important;
}

/* ── Lucide icon system — self-contained SVG icons, no CDN dependency ────── */
/* Source: lucide.dev (MIT License) */
.hoshi-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.hoshi-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

/* ── Played-today badge (SVG circle-check) ───────────────────────────────── */
.played-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  color: #4ade80;
  line-height: 1;
}
.played-icon {
  display: block;
}
