/* @font-face Fredoka ada di fonts.css (data URI agar jalan dari file://) */
:root {
  /* Warna identitas Festival Bilangan (GDD 5.2) */
  --navy-900: #1c2b4b;
  --navy-700: #34466f;
  --navy-500: #5d6b8a;
  --cream-50: #fffbf3;
  --cream-100: #fff4e1;
  --cream-200: #f4e4c6;
  --cream-300: #e6d0a8;
  --gold-300: #ffd76a;
  --gold-400: #ffc53d;
  --gold-600: #d99a0b;
  --teal-500: #129d94;
  --teal-700: #0b6f69;
  --coral-500: #f0674a;
  --coral-700: #b9432b;
  --leaf-500: #3f9d4a;
  --leaf-700: #2b7535;
  --sky-300: #8fd0f5;
  --ocean-500: #2f93d8;

  --text: var(--navy-900);
  --text-2: var(--navy-700);
  --text-3: var(--navy-500);
  --line: rgb(28 43 75 / 0.12);
  --surface: var(--cream-50);
  --surface-2: var(--cream-100);

  --font-display: "Fredoka", ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, sans-serif;
  --font-body: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, sans-serif;

  /* Skala tipe pada layout referensi 1920×1080 (1rem = 16px) */
  --fs-meta: 1.25rem;    /* 20px */
  --fs-body: 1.75rem;    /* 28px, teks instruksi */
  --fs-lead: 2rem;       /* 32px */
  --fs-title: 2.75rem;   /* 44px, judul wilayah */
  --fs-display: 3.5rem;

  --r-control: 1rem;
  --r-card: 1.5rem;
  --r-panel: 2rem;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --t-fast: 140ms;
  --t-base: 240ms;
  --t-enter: 360ms;

  --shadow-soft: 0 0.25rem 1rem rgb(28 43 75 / 0.14);
  --shadow-panel: 0 0.75rem 2.5rem rgb(28 43 75 / 0.22);

  --touch: 4.5rem; /* 72px area sentuh utama */
  --safe: 2rem;
}

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

html {
  /* Semua ukuran memakai rem: 16px pada 1920×1080, diskalakan proporsional ke layar lain */
  font-size: min(calc(100vw / 120), calc(100vh / 67.5)); /* fallback Chromium lama di IFP tanpa dvh */
  font-size: min(calc(100vw / 120), calc(100dvh / 67.5));
  -webkit-text-size-adjust: 100%;
}

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--navy-900);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 600;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.1; }

button { font: inherit; color: inherit; }
button, [role="button"] { -webkit-user-select: none; user-select: none; cursor: pointer; touch-action: manipulation; }
/* Tekan lama di layar sentuh tidak memblok teks atau memunculkan menu */
#app { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
img { display: block; max-width: 100%; -webkit-user-drag: none; user-select: none; }

:focus { outline: none; }
:focus-visible {
  outline: 0.25rem solid var(--navy-900);
  outline-offset: 0.25rem;
  box-shadow: 0 0 0 0.5rem rgb(255 255 255 / 0.85);
}

/* Judul yang difokuskan lewat skrip (pembaca layar) bukan kontrol, jadi tidak perlu bingkai fokus */
[tabindex="-1"]:focus-visible { outline: none; box-shadow: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.num { font-variant-numeric: tabular-nums; }
