@font-face { font-family: 'Montserrat'; src: url('/assets/fonts/Montserrat-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Montserrat'; src: url('/assets/fonts/Montserrat-SemiBold.ttf') format('truetype'); font-weight: 600 700; font-display: swap; }
@font-face { font-family: 'Montserrat'; src: url('/assets/fonts/Montserrat-Black.ttf') format('truetype'); font-weight: 800 900; font-display: swap; }
@font-face { font-family: 'Protest Strike'; src: url('/assets/fonts/ProtestStrike-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Futura'; src: url('/assets/fonts/futura-bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }

:root {
  --pt-blue: #0067b1;
  --pt-green: #7ab929;
  --pt-red: #e31e24;
  --navy: #0b2a4a;
  --ink: #18324f;
  --sky-1: #d6eefb;
  --sky-2: #f3fbff;
  --paper: #fffdf8;
  --opt-a: #e8423b;
  --opt-b: #1f74c8;
  --opt-c: #34a046;
  --opt-d: #f29d12;
  --radius: 22px;
  --font: 'Montserrat', system-ui, sans-serif;
  --font-display: 'Protest Strike', 'Futura', 'Montserrat', sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); color: var(--ink); background: var(--sky-1); }
button { font-family: inherit; cursor: pointer; }
.hidden { display: none !important; }

/* ---------- Scenery (diorama kertas) ---------- */
.scenery { position: relative; overflow: hidden; background: linear-gradient(180deg, #cfe8f8 0%, #e7f5fc 55%, #f6fbf2 100%); }
.scenery::after { /* tekstur kertas cat air */
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1; opacity: .18;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .55  0 0 0 0 .6  0 0 0 0 .65  0 0 0 .35 0'/></filter><rect width='300' height='300' filter='url(%23n)'/></svg>");
}
.scn-layer { position: absolute; left: -3%; width: 106%; height: 100%; top: 0; pointer-events: none; will-change: transform; user-select: none; }
@media (prefers-reduced-motion: reduce) { .scn-layer { animation: none !important; } }
.scn-clouds-back { animation: drift 18s ease-in-out infinite alternate; }
.scn-clouds-front { animation: drift 13s ease-in-out infinite alternate-reverse; }
.scn-bush-back { animation: bob 7s ease-in-out infinite alternate; }
.scn-bush-front { animation: bob 5.5s ease-in-out infinite alternate-reverse; }
.scn-city { animation: bob 11s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translateX(-1.2%); } to { transform: translateX(1.2%); } }
@keyframes bob { from { transform: translateY(0); } to { transform: translateY(-0.8%); } }
.scene-content { position: relative; z-index: 2; }

/* ---------- Kartu "langit" seperti di video acuan ---------- */
.sky-card {
  position: relative; background: linear-gradient(180deg, #e6f4fd 0%, #f7fcff 45%, #eaf6fd 100%);
  border: 5px solid #fff; border-radius: 10px;
  box-shadow: 0 18px 40px rgba(11, 42, 74, .28), inset 0 0 40px rgba(120, 180, 230, .25);
}
.sky-card::before, .sky-card::after { content: ''; position: absolute; left: 0; right: 0; pointer-events: none; background-repeat: repeat-x; }
.sky-card::before { /* pinggiran awan atas */
  top: -2px; height: 46px; background-size: 120px 46px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 46'><path d='M0 0h120v20c-8 10-20 12-28 4-6 12-22 14-30 4-8 10-24 10-30 0-8 8-22 8-32-2z' fill='%235d97da'/><path d='M0 0h120v12c-10 6-18 6-24 0-8 8-20 8-26 0-8 8-20 6-26-2-10 6-20 6-28-2-6 4-12 4-16 0z' fill='%23a9d0f3'/></svg>");
}
.sky-card::after { /* semak bawah */
  bottom: -2px; height: 54px; background-size: 160px 54px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 54'><g stroke='%23fff' stroke-width='2'><circle cx='14' cy='44' r='20' fill='%232fa84f'/><circle cx='44' cy='40' r='18' fill='%239ed55a'/><circle cx='74' cy='46' r='22' fill='%231f9e8a'/><circle cx='106' cy='40' r='18' fill='%23d7e86a'/><circle cx='136' cy='46' r='20' fill='%232f78c4'/><circle cx='160' cy='44' r='16' fill='%232fa84f'/></g></svg>");
}

/* ---------- Avatar ---------- */
.avatar { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--av-bg, #eee); border: 3px solid #fff; box-shadow: 0 4px 10px rgba(11, 42, 74, .2); flex: none; overflow: hidden; }
.avatar .char-svg { width: 92%; height: 92%; }
.char-svg { display: block; }

/* ---------- Tombol & input ---------- */
.btn { border: 0; border-radius: 16px; padding: 16px 28px; font-weight: 800; font-size: 18px; letter-spacing: .5px; color: #fff; background: var(--pt-blue); box-shadow: 0 6px 0 #00467a, 0 10px 20px rgba(0, 0, 0, .15); transition: transform .08s, box-shadow .08s, filter .2s; text-transform: uppercase; }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #00467a; }
.btn:disabled { filter: grayscale(.8) opacity(.6); cursor: not-allowed; }
.btn.green { background: #3aa346; box-shadow: 0 6px 0 #22762e, 0 10px 20px rgba(0, 0, 0, .15); }
.btn.red { background: var(--pt-red); box-shadow: 0 6px 0 #9c1116, 0 10px 20px rgba(0, 0, 0, .15); }
.btn.ghost { background: #fff; color: var(--ink); box-shadow: 0 6px 0 #c9d8e6, 0 10px 20px rgba(0, 0, 0, .08); }
.btn.block { width: 100%; }
.input { width: 100%; border: 3px solid #cfe2f1; border-radius: 16px; padding: 16px 18px; font-size: 20px; font-family: inherit; font-weight: 700; color: var(--ink); background: #fff; outline: none; transition: border-color .2s; }
.input:focus { border-color: var(--pt-blue); }
.label { display: block; font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: 1px; margin: 0 0 8px; color: #4a6785; }

.opt-a { --opt: var(--opt-a); } .opt-b { --opt: var(--opt-b); } .opt-c { --opt: var(--opt-c); } .opt-d { --opt: var(--opt-d); }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); background: var(--navy); color: #fff; padding: 14px 22px; border-radius: 14px; font-weight: 700; z-index: 9999; transition: transform .3s; max-width: 90vw; text-align: center; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
#toast.show { transform: translate(-50%, 0); }
#toast.error { background: #b3261e; }
#toast.ok { background: #2e7d32; }

.confetti { position: absolute; top: -20px; width: 12px; height: 18px; border-radius: 2px; z-index: 50; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translate(var(--dx), 115vh) rotate(var(--rot)); } }

.timerbar { height: 18px; border-radius: 999px; background: rgba(11, 42, 74, .12); overflow: hidden; position: relative; }
.timerbar > i { position: absolute; inset: 0; transform-origin: left; background: linear-gradient(90deg, #7ab929, #b6dd3c); border-radius: inherit; }
.timerbar.warn > i { background: linear-gradient(90deg, #f29d12, #ffc52c); }
.timerbar.danger > i { background: linear-gradient(90deg, #e31e24, #ff6a4d); }

.pop-in { animation: popIn .5s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes popIn { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.avatar.photo { background: #fff; }
.avatar.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.scn-wrap { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.scn-wrap.mirror { transform: scaleX(-1); }
