:root {
  --paper: #F5F1E8; --ink: #191B15; --muted: #666B5E; --line: #DCD5C5; --card: #FCFAF4;
  --go: #F06A1E; --plum: #6B3F6E; --accent: #F3C48E; --panel-mix: 62%;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #13150F; --ink: #EEEBE1; --muted: #A0A395; --line: #2D3027; --card: #1B1E17; --panel-mix: 16%;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #13150F; --ink: #EEEBE1; --muted: #A0A395; --line: #2D3027; --card: #1B1E17; --panel-mix: 16%;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box }
html { -webkit-text-size-adjust: 100% }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
body.guarding { overflow: hidden }
html.tauri-transparent, html.tauri-transparent body { background: transparent !important }
html.tauri-transparent .app, html.tauri-transparent .waitbar, html.tauri-transparent .toast { display: none !important }
h1 { font-family: "Bricolage Grotesque", "Instrument Sans", sans-serif }
button { font: inherit; color: inherit }
:focus-visible { outline: 3px solid var(--plum); outline-offset: 2px }

/* ---------- halaman pengaturan ---------- */
.app {
  max-width: 1380px; margin: 0 auto; padding: clamp(16px, 2.4vw, 32px);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "intro panel" "form panel"; grid-template-rows: auto 1fr;
  column-gap: clamp(24px, 4vw, 64px);
}
.intro { grid-area: intro; padding-top: clamp(8px, 3vw, 40px) }
.form { grid-area: form; padding-bottom: 48px }
.eyebrow { margin: 0 0 14px; color: var(--go); font-weight: 700; font-size: 13px; letter-spacing: .14em; text-transform: uppercase }
h1 { font-weight: 800; font-size: clamp(56px, 8.4vw, 128px); line-height: .84; letter-spacing: -.05em; margin: 0 0 22px }
.sub { color: var(--muted); max-width: 44ch; margin: 0 0 36px; font-size: clamp(16px, 1.4vw, 19px); line-height: 1.5 }
.group { margin-bottom: 28px }
.label { display: flex; gap: 10px; align-items: baseline; margin: 0 0 12px; font-weight: 600; font-size: 15px }
.label span { font-family: "Bricolage Grotesque", sans-serif; font-weight: 800; color: var(--go); font-size: 13px; letter-spacing: .04em }
.pick-sub { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted) }
.pets + .pick-sub { margin-top: 18px }
.pets { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px }
@media (max-width: 560px) { .pets { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px } }
.pet {
  background: var(--card); border: 1.5px solid var(--line); border-radius: 20px;
  padding: 8px 6px 10px; cursor: pointer; text-align: center;
  display: grid; gap: 2px; justify-items: center; min-width: 0;
  transition: border-color .15s, background .15s, transform .15s;
}
.pet:hover { transform: translateY(-2px) }
.pet-art { width: 100%; height: 84px; overflow: hidden }
.pet-art svg { width: 100%; height: 100%; display: block }
.pet b { font-weight: 700; font-size: 14px; line-height: 1.2; margin-top: 2px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.pet small { color: var(--muted); font-size: 12px; line-height: 1.2 }
.pet[aria-pressed="true"] { border-color: var(--go); background: color-mix(in srgb, var(--go) 9%, var(--card)) }
@media (max-width: 560px) { .pet-art { height: 68px } .pet b { font-size: 13px } .pet small { font-size: 11px } }
.parody { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); max-width: 60ch }
.chips { display: flex; flex-wrap: wrap; gap: 8px }
.chip { font-weight: 600; cursor: pointer; background: transparent; border: 1.5px solid var(--line); border-radius: 999px; padding: 9px 16px; font-size: 15px }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink) }
.pin-input {
  width: 100%; max-width: 320px; background: var(--card); color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 999px; padding: 10px 18px;
  font: inherit; font-size: 15px; outline: none;
}
.pin-input:focus { border-color: var(--go) }
.actions { display: flex; gap: 10px; align-items: stretch; margin-top: 8px }
.go {
  flex: 1; font-family: "Bricolage Grotesque", sans-serif; font-weight: 800; font-size: 22px; letter-spacing: -.02em;
  cursor: pointer; background: var(--go); color: #fff; border: none; border-radius: 18px; padding: 18px 28px;
  box-shadow: 0 12px 26px -12px color-mix(in srgb, var(--go) 80%, transparent); transition: transform .12s;
}
.go:active { transform: scale(.98) }
.toggle { cursor: pointer; background: transparent; border: 1.5px solid var(--line); border-radius: 18px; padding: 0 18px; font-weight: 600; display: flex; align-items: center; gap: 10px; white-space: nowrap }
.toggle i { width: 34px; height: 20px; border-radius: 99px; background: var(--line); position: relative; transition: background .15s; flex: none }
.toggle i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s }
.toggle[aria-pressed="true"] i { background: var(--go) }
.toggle[aria-pressed="true"] i::after { transform: translateX(14px) }
.note { color: var(--muted); font-size: 13.5px; margin: 14px 0 0; max-width: 54ch }
.does { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 28px; margin-top: 40px; padding-top: 28px; border-top: 1.5px solid var(--line) }
.does b { display: block; font-family: "Bricolage Grotesque", sans-serif; font-weight: 800; font-size: 17px; letter-spacing: -.01em }
.does p { margin: 2px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45 }
@media (max-width: 460px) { .does { grid-template-columns: 1fr } }

.site-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 32px; padding-top: 22px; border-top: 1.5px solid var(--line);
}
.built-by { margin: 0; font-size: 14px; color: var(--muted); font-weight: 500 }
.built-by a { color: var(--ink); font-weight: 700; text-decoration: underline; text-underline-offset: 3px }
.built-by a:hover { color: var(--go) }
.jajan-btn {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  background: var(--card); color: var(--ink); border: 1.5px solid var(--line);
  border-radius: 999px; padding: 9px 18px; font-weight: 700; font-size: 14px;
  transition: transform .12s, border-color .15s, background .15s;
}
.jajan-btn:hover { border-color: var(--go); background: color-mix(in srgb, var(--go) 12%, var(--card)); transform: translateY(-1px) }

/* ---------- panel pratinjau ---------- */
.panel {
  grid-area: panel; position: sticky; top: clamp(16px, 2.4vw, 32px); align-self: start;
  height: calc(100svh - 2 * clamp(16px, 2.4vw, 32px)); min-height: 540px; max-height: 920px;
  border-radius: 32px; overflow: hidden; isolation: isolate; container-type: size;
  background: color-mix(in srgb, var(--accent) var(--panel-mix), var(--paper)); transition: background .5s;
}
.wm {
  position: absolute; left: -.04em; bottom: 44%; margin: 0; z-index: 0; pointer-events: none; white-space: nowrap;
  font-family: "Bricolage Grotesque", sans-serif; font-weight: 800; font-size: clamp(100px, 24cqw, 250px);
  line-height: .8; letter-spacing: -.06em; color: color-mix(in srgb, var(--ink) 8%, transparent);
}
.panel-meta { position: absolute; top: 24px; left: 26px; right: 26px; z-index: 2; display: flex; justify-content: space-between; gap: 16px; align-items: flex-start }
.species { margin: 0; font-weight: 700; font-size: 13px; letter-spacing: .1em; text-transform: uppercase }
.ptag { margin: 2px 0 0; color: var(--muted); font-size: 15px; max-width: 26ch; line-height: 1.35 }
.hint { margin: 0; font-size: 13px; color: var(--muted); text-align: right; max-width: 17ch; line-height: 1.35 }
@media (max-width: 420px) { .hint { display: none } }
.panel-stage { position: absolute; left: 50%; bottom: 0; translate: -50% 0; width: 90%; width: min(100cqw, 80cqh); aspect-ratio: 1; z-index: 1 }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; grid-template-areas: "intro" "panel" "form"; grid-template-rows: auto }
  .panel { position: relative; top: 0; height: 440px; min-height: 0; margin: 0 0 32px }
  .intro { padding-top: 8px }
}

/* ---------- jadwal & toast ---------- */
.waitbar {
  position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); translate: -50% 0; z-index: 40;
  display: flex; align-items: center; gap: 12px; background: var(--ink); color: var(--paper);
  border-radius: 999px; padding: 8px 8px 8px 22px; box-shadow: 0 14px 40px -12px rgba(0, 0, 0, .45);
  max-width: calc(100vw - 32px); white-space: nowrap;
}
.waitbar[hidden] { display: none }
.waitbar b { font-family: "Bricolage Grotesque", sans-serif; font-size: 22px; font-variant-numeric: tabular-nums; letter-spacing: -.02em }
.waitbar button { cursor: pointer; border: none; border-radius: 999px; padding: 10px 16px; font-weight: 600; background: color-mix(in srgb, var(--paper) 16%, transparent); color: var(--paper) }
.waitbar button.primary { background: var(--go); color: #fff }
@media (max-width: 480px) { .wb-text { display: none } .waitbar { padding-left: 16px } }
.toast {
  position: fixed; left: 50%; top: 16px; translate: -50% -160%; z-index: 60; max-width: calc(100vw - 32px);
  background: var(--ink); color: var(--paper); padding: 12px 20px; border-radius: 16px; font-weight: 600; text-align: center;
  transition: translate .4s cubic-bezier(.3, 1.4, .5, 1); box-shadow: 0 14px 40px -12px rgba(0, 0, 0, .4);
}
.toast.show { translate: -50% 0 }

@media (prefers-reduced-motion: reduce) {
  .pet:hover { transform: none }
}
