/* Host page of the FredyGames port of the Santa Tracker mini-games. Original work, Apache-2.0. */
:root {
  --bg: #0d2238;
  --bar: #12304f;
  --fg: #f4f8fc;
  --muted: #a8bdd3;
  --accent: #e8453c;
  --accent-2: #2f9e6b;
  --card: #fff;
  --card-fg: #1b2a3a;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); font-family: Roboto, system-ui, sans-serif; overflow: hidden; }
#app { display: flex; flex-direction: column; height: 100%; }
#bar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 10px; height: 44px; background: var(--bar); }
#stats { display: flex; gap: 14px; font-weight: 600; font-size: 15px; min-width: 0; overflow: hidden; white-space: nowrap; }
.stat b { font-weight: 300; color: var(--muted); margin-right: 5px; }
#btns { display: flex; gap: 6px; }
#btns button { height: 32px; min-width: 32px; padding: 0 12px; border: 0; border-radius: 16px; background: rgba(255,255,255,.14); color: var(--fg); font: inherit; font-size: 14px; cursor: pointer; }
#btns button:hover { background: rgba(255,255,255,.26); }
#btns button:focus-visible, .primary:focus-visible, #tut-close:focus-visible { outline: 3px solid #ffd35c; outline-offset: 2px; }
#stage { position: relative; flex: 1; min-height: 0; }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; visibility: hidden; }
body.ready #scene { visibility: visible; }
#loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: var(--bg); }
body.ready #loading { display: none; }
.spin { width: 38px; height: 38px; border-radius: 50%; border: 4px solid rgba(255,255,255,.2); border-top-color: #fff; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(8, 20, 34, .62); }
#overlay[hidden], #tutorial[hidden] { display: none; }
.card { background: var(--card); color: var(--card-fg); border-radius: 14px; padding: 22px 26px; text-align: center; max-width: min(420px, 90%); box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.card h2 { margin: 0 0 6px; font-size: 26px; }
.card p { margin: 0 0 16px; color: #4b5d70; white-space: pre-line; }
.row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.primary { border: 0; border-radius: 22px; padding: 11px 22px; font: inherit; font-weight: 600; font-size: 16px; color: #fff; background: var(--accent); cursor: pointer; }
.primary:hover { filter: brightness(1.1); }
#ov-resume { background: var(--accent-2); }
#tutorial { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); background: #fff; color: var(--card-fg); border-radius: 14px; padding: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.35); max-width: 90%; pointer-events: auto; }
#tut-body img, #tut-body video { display: block; max-width: 270px; max-height: 200px; }
#tut-close { position: absolute; top: -10px; right: -10px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; font-size: 15px; line-height: 26px; padding: 0; cursor: pointer; }
@media (max-width: 520px) {
  #stats { font-size: 13px; gap: 9px; }
  #btns button { padding: 0 9px; font-size: 13px; }
}
