/* Shared look for the Halloween game collection. Each game adds its own style.css. */
:root {
  color-scheme: dark;
  --bg: #120d1c;
  --bg-2: #1d1530;
  --panel: #251b3a;
  --panel-2: #2f2448;
  --line: #44365f;
  --ink: #f6efff;
  --muted: #b8a8d4;
  --accent: #ff8a2a;
  --accent-ink: #2a1300;
  --accent-2: #a77bff;
  --good: #7ee081;
  --warn: #ffd166;
  --bad: #ff5d6c;
  --radius: 14px;
  --font: system-ui, -apple-system, "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "Consolas", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: radial-gradient(120% 90% at 50% 0%, var(--bg-2), var(--bg) 70%);
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

button { font: inherit; color: inherit; }

:focus-visible { outline: 3px solid var(--warn); outline-offset: 2px; }

/* Full-screen game pages */
body.hg-game {
  height: 100dvh;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overscroll-behavior: none;
}

.hg-topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: max(8px, env(safe-area-inset-top)) 12px 8px;
  border-bottom: 1px solid var(--line);
  background: rgba(18, 13, 28, 0.85);
}

.hg-back {
  flex: 0 0 auto;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 8px;
  border-radius: 8px;
}
.hg-back:hover { color: var(--ink); background: var(--panel); }

.hg-title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hg-icon-btn {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  cursor: pointer;
  font-size: 18px;
}
.hg-icon-btn:hover { background: var(--panel-2); }

.hg-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}

/* Overlay screens: title, result, game over */
.hg-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(10, 6, 18, 0.72);
  backdrop-filter: blur(3px);
  overflow-y: auto;
}
.hg-overlay[hidden] { display: none; }

.hg-card {
  width: min(460px, 100%);
  padding: 22px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  text-align: center;
}
.hg-card h2 { margin: 0 0 6px; font-size: 26px; line-height: 1.2; }
.hg-card .hg-sub { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.hg-card ul { text-align: left; margin: 0 0 16px; padding-left: 1.2em; font-size: 14px; }
.hg-card li { margin: 4px 0; }

.hg-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 8px; }

.hg-btn {
  min-height: 48px;
  padding: 10px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 4px 0 #b4561a;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.hg-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #b4561a; }
.hg-btn.secondary { background: var(--panel-2); color: var(--ink); box-shadow: 0 4px 0 #160f24; border: 1px solid var(--line); }

.hg-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hg-best { color: var(--warn); font-size: 13px; margin: 8px 0 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
