:root {
  --bg: #0b0f2a;  --bg-soft: #10153a;
  --surface: #151b45;  --surface-2: #1b2252;  --surface-3: #232b61;
  --text: #eef3ff;  --text-muted: #a8b6dc;
  --text-dim: #8b9bc7;  --text-faint: #7484b0;
  --line: rgba(255,255,255,.11);  --line-strong: rgba(255,255,255,.17);
  --accent: #4c7ceb;  --accent-soft: rgba(76,124,235,.16);
  --accent-line: rgba(76,124,235,.38);  --accent-text: #9dc0f5;
  --gold: #f7daa9;  --gold-line: rgba(247,218,169,.34);
  --ok: #5ee0a0;  --warn: #f7daa9;  --danger: #f98a95;
  --ink: #081026;
  --r-sm: 8px;  --r-md: 12px;  --r-lg: 16px;  --r-xl: 22px;  --r-pill: 999px;
  --ease: cubic-bezier(.19,1,.22,1);  --ease-out: cubic-bezier(.22,1,.36,1);
  --fast: 140ms;  --base: 220ms;  --slow: 420ms;
  --gutter: clamp(16px, 4vw, 28px);
  --shell: 1160px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }
svg { display: block; }

h1, h2, h3, h4 {
  margin: 0 0 .5em;
  line-height: 1.2;
  letter-spacing: -.015em;
  font-weight: 700;
}

h1 { font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3.1rem); }
h2 { font-size: clamp(1.4rem, 1.1rem + 1.1vw, 1.9rem); }
h3 { font-size: 1.1rem; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }

code, kbd, pre, samp {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: .9em;
}

code:not(pre code) {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: .12em .42em;
  color: var(--accent-text);
  overflow-wrap: anywhere;
}

/* code di dalam pre tidak ikut bodoh wrapped: ia boleh lebih lebar dari
   viewport karena pre yang menscroll, bukan halaman. */
pre code {
  overflow-wrap: normal;
  word-break: normal;
  white-space: pre;
}

pre {
  margin: 0;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px;
  overflow-x: auto;
  color: var(--text);
  line-height: 1.6;
  /* Panjang blok kode lebih besar dari viewport adalah wajar, tapi halaman
     sendiri tidak boleh ikut bergeser. max-width menjaga agar pre tetap
     selebar kolomnya. */
  max-width: 100%;
  min-width: 0;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 28px 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: var(--ink);
  padding: 12px 18px;
  border-radius: 0 0 var(--r-sm) 0;
  font-weight: 700;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.skip-link:focus {
  left: 0;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

.site-shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(11, 15, 42, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header .bar {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -.01em;
  min-height: 44px;
}
.brand:hover { text-decoration: none; }
.brand svg { width: 26px; height: 26px; flex: none; }
.brand small {
  display: block;
  font-size: .68rem;
  font-weight: 600;
  color: var(--text-faint);
  letter-spacing: .06em;
  text-transform: uppercase;
  line-height: 1;
}

.nav { margin-left: auto; }
.nav-toggle {
  margin-left: auto;
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  min-width: 44px;
  padding: 8px 14px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.nav-toggle:hover { background: var(--surface-3); }
.nav-toggle .bars {
  display: grid;
  gap: 3px;
}
.nav-toggle .bars span {
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-list a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  /* Label pendek seperti "Keys" hanya jadi 29px kalau min-width tidak
     dipaksakan, jadi target sentuhnya jadi kecil dari 44px. */
  min-width: 44px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  color: var(--text-muted);
  font-size: .92rem;
  font-weight: 600;
  transition: color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.nav-list a:hover {
  color: var(--text);
  background: var(--surface-2);
  text-decoration: none;
}
.nav-list a[aria-current="page"] {
  color: var(--text);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}

/* ---------- hero ---------- */

.hero { padding: clamp(44px, 7vw, 92px) 0 clamp(28px, 4vw, 48px); }

.hero-card {
  display: grid;
  gap: clamp(24px, 3vw, 40px);
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 16px;
}

/* Link di dalam eyebrow, misalnya "← Semua game", juga harus jadi target
   sentuh 44px dan bukan setinggi teksnya saja. */
.eyebrow a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  flex: none;
}

.hero h1 { margin-bottom: .35em; }
.hero .lede {
  font-size: clamp(1rem, .96rem + .3vw, 1.14rem);
  color: var(--text-muted);
  max-width: 56ch;
}
.hero .sub {
  color: var(--text-faint);
  font-size: .95rem;
  max-width: 60ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  font: inherit;
  font-size: .92rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  text-align: center;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease),
    transform var(--fast) var(--ease), color var(--fast) var(--ease);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: var(--ink);
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-text); border-color: var(--accent-text); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line-strong);
}
.btn-ghost:hover { background: var(--surface-2); border-color: var(--accent-line); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}
.btn-danger:hover { background: rgba(249, 138, 149, .12); }

.btn-sm {
  min-height: 44px;
  padding: 8px 14px;
  font-size: .86rem;
}

/* ---------- sections ---------- */

.section { padding: clamp(36px, 5vw, 64px) 0; }
.section-tight { padding: clamp(24px, 3vw, 36px) 0; }

.section-head {
  max-width: 62ch;
  margin-bottom: clamp(20px, 3vw, 32px);
}
.section-head p {
  color: var(--text-muted);
  margin-bottom: 0;
}
.section-head .hint {
  color: var(--text-faint);
  font-size: .88rem;
  margin-top: 6px;
}

/* ---------- cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(18px, 2vw, 26px);
}

.panel-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(18px, 2vw, 24px);
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); }

/* ---------- loader code ---------- */

.loader-code {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
.loader-code pre {
  padding: 18px 20px;
  font-size: clamp(.78rem, .74rem + .18vw, .9rem);
  white-space: pre;
  border-color: var(--accent-line);
}
.loader-code .row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.loader-code .cap {
  font-size: .82rem;
  color: var(--text-dim);
}

.copy-status {
  font-size: .85rem;
  font-weight: 700;
  color: var(--ok);
  min-height: 1.4em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.copy-status[data-state="idle"] { color: var(--text-dim); }
.copy-status[data-state="error"] { color: var(--danger); }

/* ---------- badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1.4;
  white-space: nowrap;
}
.badge-premium { background: var(--gold); color: var(--ink); }
.badge-freemium { background: var(--accent); color: var(--ink); }
.badge-free { background: #ffffff; color: var(--ink); }
.badge-developer {
  background: #000000;
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

/* ---------- kv grid ---------- */

.kv-grid {
  display: grid;
  grid-template-columns: minmax(120px, max-content) minmax(0, 1fr);
  gap: 0;
  margin: 0;
}
.kv-grid dt {
  padding: 12px 18px 12px 0;
  border-top: 1px solid var(--line);
  color: var(--text-dim);
  font-size: .86rem;
  font-weight: 700;
}
.kv-grid dd {
  margin: 0;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  color: var(--text);
  font-size: .95rem;
}
.kv-grid dt:first-of-type, .kv-grid dd:first-of-type { border-top: 0; }

/* ---------- table ---------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .93rem;
  min-width: 520px;
}
caption {
  text-align: left;
  padding: 14px 18px;
  color: var(--text-dim);
  font-size: .85rem;
  border-bottom: 1px solid var(--line);
}
th, td {
  text-align: left;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  color: var(--text);
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  background: var(--surface-2);
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }
tr[tabindex] { cursor: pointer; }
tr[tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.empty-state {
  padding: 34px 20px;
  text-align: center;
  color: var(--text-dim);
}
.empty-state strong {
  display: block;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-size: .96rem;
}

/* ---------- appbar ---------- */

.appbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.appbar .title {
  font-weight: 700;
  font-size: .95rem;
  margin-right: auto;
}
.appbar .spacer { margin-left: auto; }

/* ---------- fields ---------- */

.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field > label {
  font-size: .86rem;
  font-weight: 700;
  color: var(--text-muted);
}
.field .help {
  font-size: .8rem;
  color: var(--text-dim);
  margin: 0;
}
input[type="text"], input[type="email"], select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  background: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--text);
  font: inherit;
  font-size: .95rem;
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
input::placeholder { color: var(--text-faint); opacity: 1; }
input:hover, select:hover { border-color: var(--accent-line); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input[aria-invalid="true"] { border-color: var(--danger); }

.field-error {
  font-size: .82rem;
  font-weight: 600;
  color: var(--danger);
  min-height: 1.3em;
}
.field-error:empty { min-height: 0; }

fieldset {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px;
  margin: 0 0 16px;
}
legend {
  padding: 0 8px;
  font-size: .84rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ---------- game rail ---------- */

.game-rail {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  gap: 16px;
}

.game-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: border-color var(--base) var(--ease), transform var(--base) var(--ease);
}
.game-card:hover {
  border-color: var(--accent-line);
  transform: translateY(-2px);
}
.game-card .cover {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, var(--surface-3), var(--surface-2));
  border-bottom: 1px solid var(--line);
}
.game-card .cover svg { width: 100%; height: 100%; }
.game-card .body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.game-card h3 { margin: 0; font-size: 1rem; }
.game-card .desc {
  color: var(--text-dim);
  font-size: .87rem;
  flex: 1;
  margin: 0;
}
.game-card .id {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: .76rem;
  color: var(--text-dim);
  letter-spacing: .02em;
  overflow-wrap: anywhere;
}
.game-card .foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

/* ---------- preview / ui mock ---------- */

/* minmax(0, 1fr), bukan 1fr: tanpa itu track ikut melebar mengikuti isi
   .ui-mock yang 560px, dan halaman jadi overflow di layar sempit. */
.preview-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
.mock-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: start;
  padding: 6px 12px;
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-pill);
  font-size: .8rem;
  font-weight: 700;
  color: var(--text-muted);
}
.mock-label::before { content: "◻"; color: var(--gold); }

.ui-mock {
  width: 560px;
  max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
}

.ui-mock-header {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 68px;
  padding: 0 8px;
}
.ui-mock-logo {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--accent), #6d4ce0);
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--ink);
  font-size: 1.05rem;
  letter-spacing: -.02em;
}
.ui-mock-header .titles { margin-right: auto; min-width: 0; }
.ui-mock-header .titles strong {
  display: block;
  font-size: 1.02rem;
  line-height: 1.25;
  letter-spacing: -.01em;
}
.ui-mock-header .titles span {
  display: block;
  font-size: .78rem;
  color: var(--text-dim);
  line-height: 1.3;
}
.ui-mock-close {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.ui-mock-close:hover { background: var(--surface-3); color: var(--text); }

.ui-mock-body { position: relative; height: 303px; }

.ui-mock-side {
  position: absolute;
  left: 12px;
  top: 0;
  width: 130px;
  height: calc(100% - 12px);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}
.ui-mock-side .nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 9px;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
}
.ui-mock-side .nav-item.is-active {
  background: var(--accent-soft);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}
.ui-mock-side .spacer { margin-top: auto; }
.ui-mock-side .ver {
  font-size: .7rem;
  color: var(--text-dim);
  padding: 6px 9px 2px;
  letter-spacing: .03em;
}

.ui-mock-main {
  position: absolute;
  left: 164px;
  right: 12px;
  top: 0;
  height: calc(100% - 12px);
  overflow: hidden;
  border-radius: 10px;
}

.ui-mock .inner {
  padding: 4px;
  display: grid;
  gap: 10px;
  height: 100%;
}

.ui-mock-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
}
.ui-mock-card h4 {
  margin: 0 0 4px;
  font-size: .95rem;
}
.ui-mock-card p {
  margin: 0;
  font-size: .82rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.ui-mock-list { display: grid; gap: 8px; }
.ui-mock-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.ui-mock-row .ico {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 8px;
  background: var(--surface-3);
  display: grid;
  place-items: center;
  font-size: .78rem;
  font-weight: 800;
  color: var(--accent-text);
}
.ui-mock-row .txt { min-width: 0; flex: 1; }
.ui-mock-row .txt strong {
  display: block;
  font-size: .85rem;
  line-height: 1.3;
}
.ui-mock-row .txt span {
  display: block;
  font-size: .72rem;
  color: var(--text-dim);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

.ui-mock .minput,
input.minput {
  width: 100%;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--ink);
  color: var(--gold);
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: .8rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ui-mock .minput::placeholder { color: var(--text-faint); }
.ui-mock .minput.is-filled { color: var(--gold); }

.ui-mock .mbtn {
  min-height: 44px;
  border-radius: 7px;
  border: 0;
  font-family: inherit;
  font-size: .84rem;
  font-weight: 700;
  cursor: pointer;
  padding: 8px 14px;
  background: var(--accent);
  color: var(--ink);
  transition: background var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.ui-mock .mbtn:hover { background: var(--accent-text); }
.ui-mock .mbtn:active { transform: translateY(1px); }
.ui-mock .mbtn.is-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--line-strong);
}
.ui-mock .mbtn.is-ghost:hover { background: var(--surface-3); color: var(--text); }

.ui-mock-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.ui-mock-actions .mbtn { flex: 1 1 auto; }

.ui-mock-msg {
  display: none;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  font-weight: 700;
  padding: 10px 12px;
  border-radius: 8px;
  line-height: 1.4;
}
.ui-mock-msg.is-on { display: flex; }
.ui-mock-msg[data-kind="ok"] {
  background: rgba(94, 224, 160, .13);
  color: var(--ok);
  box-shadow: inset 0 0 0 1px rgba(94, 224, 160, .32);
}
.ui-mock-msg[data-kind="bad"] {
  background: rgba(249, 138, 149, .13);
  color: var(--danger);
  box-shadow: inset 0 0 0 1px rgba(249, 138, 149, .32);
}

.ui-mock .pane { display: none; }
.ui-mock .pane.is-on { display: block; }

.ui-mock.is-closed .ui-mock-body { display: none; }
.ui-mock.is-closed .ui-mock-header {
  border-bottom: 1px solid var(--line);
}

/* ---------- toast ---------- */

.toast-host {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  width: min(420px, calc(100% - 2 * var(--gutter)));
  pointer-events: none;
}
.toast {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: .9rem;
  font-weight: 600;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .5);
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--base) var(--ease-out), transform var(--base) var(--ease-out);
}
.toast.is-on { opacity: 1; transform: translateY(0); }
.toast::before {
  content: "●";
  color: var(--accent-text);
  flex: none;
  font-size: .8rem;
}
.toast[data-kind="ok"]::before { content: "✓"; color: var(--ok); }
.toast[data-kind="bad"]::before { content: "!"; color: var(--danger); }
.toast[data-kind="warn"]::before { content: "▲"; color: var(--warn); }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  padding: 34px 0;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr));
  gap: 26px;
}
.site-footer h4 {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-faint);
  margin-bottom: 10px;
}
.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.site-footer a {
  color: var(--text-muted);
  font-size: .9rem;
  display: inline-flex;
  align-items: center;
  /* min-width ikut dipaksakan: "Keys" saja lebarnya cuma 29px kalau tidak. */
  min-height: 44px;
  min-width: 44px;
}
.site-footer a:hover { color: var(--text); }
.footer-note {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--text-faint);
  font-size: .84rem;
  max-width: 70ch;
}

/* ---------- misc ---------- */

/* Utility spacing.
   Aturan CSP melarang style-src 'unsafe-inline', jadi tidak ada atribut
   style= di HTML. Semua jarak yang sebelumnya inline dipindah ke sini. */

.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.mt-18 { margin-top: 18px; }
.mt-20 { margin-top: 20px; }
.mt-22 { margin-top: 22px; }
.mt-24 { margin-top: 24px; }
.mt-28 { margin-top: 28px; }

.fs-86 { font-size: .86rem; }
.fs-95 { font-size: .95rem; }

/* Label yang hanya dibaca screen reader. Dipakai di preview BigUI, di mana
   kotak isian tidak boleh menampilkan label visual karena meniru tampilan
   dalam game. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.heading-reset { margin: 0; }
.heading-lg { font-size: 1.1rem; }
.heading-md { font-size: 1rem; }

.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.stack-sm { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.stack-lg { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }

.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.mono { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; }
.nowrap { white-space: nowrap; }
/* Link yang berdiri sendiri di dalam paragraf, misalnya "Lihat di shop",
   bukan link di dalam kalimat. Keduanya tetap boleh kecil hanya kalau yang
   pertama inline dengan teks lain; yang ini jadi target sentuh penuh. */
p > a:only-child {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
}

.center { text-align: center; }

.note {
  padding: 14px 18px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  font-size: .9rem;
  color: var(--text-muted);
}
.note[data-kind="ok"] { border-left-color: var(--ok); }
.note[data-kind="warn"] { border-left-color: var(--warn); }
.note[data-kind="info"] { border-left-color: var(--accent); }
.note strong { color: var(--text); }

.price {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.1;
}
.price small {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0;
}

.tier-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
  background: var(--ok);
}
.status-dot[data-state="off"] { background: var(--text-faint); }
.status-dot[data-state="warn"] { background: var(--warn); }
.status-dot[data-state="bad"] { background: var(--danger); }

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }

  .nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    display: none;
  }
  .nav.is-open { display: block; }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 8px 0 14px;
    border-top: 1px solid var(--line);
    margin-top: 4px;
  }
  .nav-list a {
    min-height: 44px;
    border-radius: var(--r-md);
    padding: 10px 14px;
  }
}

@media (max-width: 640px) {
  body { font-size: 15.5px; }

  .hero-card { grid-template-columns: minmax(0, 1fr); }

  .game-rail { grid-template-columns: minmax(0, 1fr); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }

  .kv-grid { grid-template-columns: minmax(0, 1fr); }
  .kv-grid dt {
    padding-bottom: 0;
    border-top: 0;
  }
  .kv-grid dt + dd { padding-top: 2px; }

  .loader-code pre {
    padding: 14px;
    font-size: .76rem;
  }

  .ui-mock { padding: 10px; }
  .ui-mock-body { height: auto; }
  .ui-mock-side {
    position: static;
    width: auto;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    margin-bottom: 10px;
  }
  .ui-mock-side .nav-item { flex: 1 1 auto; justify-content: center; }
  .ui-mock-side .spacer { display: none; }
  .ui-mock-side .ver { width: 100%; }
  .ui-mock-main {
    position: static;
    height: auto;
    min-height: 210px;
  }

  .hero-actions .btn { width: 100%; }
}

@media (max-width: 380px) {
  .ui-mock-logo { width: 34px; height: 34px; font-size: .9rem; }
  .ui-mock-header .titles strong { font-size: .92rem; }
  .brand small { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .game-card:hover { transform: none; }
}
