@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@500;600;700;800;900&display=swap');

/* ===== Warna Aquaproof: biru PMS 2738 C, kuning PMS 803 C, putih ===== */
:root {
  --aq-blue: #06038d;
  --aq-blue-2: #1a1fb8;
  --aq-blue-3: #2f46e0;
  --aq-deep: #03025a;
  --aq-yellow: #ffe600;
  --aq-white: #ffffff;
  --ink: #0b0a3d;
  --muted: #5d6190;
  --line: #dfe2f4;
  --card: #ffffff;
  /* warna pilihan jawaban */
  --a0: #e4002b; --a1: #00a3e0; --a2: #ffe600; --a3: #00b04f;
  --ok: #00b04f; --bad: #e4002b;
  --radius: 18px;
  /* latar (bisa diganti dari menu Tampilan) */
  --bg-image: none;
  --bg-dim: 0;
  --bg-color: var(--aq-blue);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: 'Montserrat', system-ui, sans-serif;
  color: #fff;
  background-color: var(--aq-deep);
  -webkit-font-smoothing: antialiased;
}
/* Lapisan latar belakang */
.app-bg {
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(900px 600px at 85% -10%, rgba(47,70,224,.85), transparent 60%),
    radial-gradient(800px 600px at -10% 110%, rgba(26,31,184,.9), transparent 60%),
    linear-gradient(160deg, var(--aq-blue) 0%, var(--aq-deep) 100%);
}
.app-bg::before { /* motif tetes air halus */
  content: ''; position: absolute; inset: 0; opacity: .07;
  background-image: radial-gradient(circle at 20px 20px, #fff 2px, transparent 3px);
  background-size: 44px 44px;
}
body.bg-color .app-bg { background: var(--bg-color); }
body.bg-color .app-bg::before, body.bg-image .app-bg::before { display: none; }
body.bg-image .app-bg { background: #000 var(--bg-image) center / cover no-repeat; }
.app-bg::after { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,var(--bg-dim)); }

button { font: inherit; cursor: pointer; border: 0; }
input, select, textarea { font: inherit; }
.hidden { display: none !important; }

.btn {
  background: var(--aq-yellow); color: var(--aq-blue); font-weight: 800;
  padding: 14px 22px; border-radius: 12px; font-size: 17px;
  box-shadow: 0 4px 0 rgba(0,0,0,.28); transition: transform .08s, filter .15s;
}
.btn:hover { filter: brightness(1.04); }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,.28); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: rgba(255,255,255,.14); color: #fff; box-shadow: none; }
.btn.small { padding: 8px 14px; font-size: 14px; border-radius: 10px; }
.btn.light { background: #fff; color: var(--aq-blue); }
.btn.outline { background: #eef0fb; color: var(--aq-blue); box-shadow: none; }

.logo { font-weight: 900; font-size: 22px; letter-spacing: -.5px; display: block; line-height: 1; }
.logo img { display: inline-block; vertical-align: middle; height: 1.6em; width: auto; }
.logo img.aq-word { height: 1.15em; }
.logo .quiz-word { color: #fff; margin-left: .3em; vertical-align: middle; letter-spacing: 0; }
.logo span { color: var(--aq-yellow); }

.card { background: var(--card); color: var(--ink); border-radius: var(--radius); padding: 24px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.field { width: 100%; padding: 14px 16px; border-radius: 12px; border: 2px solid var(--line); font-size: 18px; color: var(--ink); background: #fff; outline: none; }
.field:focus { border-color: var(--aq-blue-3); }
.err { color: var(--bad); font-weight: 700; min-height: 22px; margin: 8px 0 0; font-size: 14px; }

/* ===== kotak jawaban ===== */
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ans {
  position: relative; display: flex; align-items: center; gap: 14px;
  padding: 16px 20px; border-radius: 14px; color: #fff; font-weight: 800;
  text-align: left; box-shadow: 0 5px 0 rgba(0,0,0,.25);
  transition: opacity .35s, transform .35s, box-shadow .35s;
}
.ans .letter { flex: none; width: 44px; height: 44px; border-radius: 10px; background: rgba(255,255,255,.25); display: grid; place-items: center; font-size: 22px; font-weight: 900; }
.ans.c0 { background: var(--a0); } .ans.c1 { background: var(--a1); }
.ans.c2 { background: var(--a2); color: var(--aq-blue); } .ans.c2 .letter { background: rgba(6,3,141,.12); }
.ans.c3 { background: var(--a3); }
.ans.dim { opacity: .28; transform: scale(.97); }
.ans.win { box-shadow: 0 0 0 5px #fff, 0 0 40px 8px rgba(255,230,0,.75); transform: scale(1.03); z-index: 1; }
.ans .tick { margin-left: auto; font-size: 30px; }
.ans .cnt { margin-left: auto; background: rgba(0,0,0,.22); border-radius: 999px; padding: 4px 12px; font-size: .8em; }
.ans .tick + .cnt { margin-left: 10px; }

/* ===== layar pemenang ===== */
.winner { position: relative; min-height: 100%; display: flex; flex-direction: column; align-items: center; padding: 10px 16px 30px; overflow: hidden; }
.winner .w-head { text-align: center; margin-top: 4px; }
.winner .w-event { display: inline-block; background: var(--aq-yellow); color: var(--aq-blue); font-weight: 900; letter-spacing: 2px; text-transform: uppercase; font-size: 15px; padding: 7px 16px; border-radius: 999px; }
.winner h1 { font-size: clamp(30px, min(5vw, 7vh), 64px); font-weight: 900; margin: 12px 0 0; letter-spacing: -1px; text-shadow: 0 6px 0 rgba(0,0,0,.2); }
.winner h1 em { font-style: normal; color: var(--aq-yellow); }
.w-drum { font-size: 22px; font-weight: 700; opacity: .85; margin-top: 6px; min-height: 30px; }

.podium { display: flex; align-items: flex-end; justify-content: center; gap: clamp(10px, 2vw, 26px); margin-top: 2vh; width: 100%; max-width: 1000px; }
.pod { flex: 1; max-width: 290px; display: flex; flex-direction: column; align-items: center; opacity: 0; transform: translateY(40px); transition: opacity .6s, transform .6s cubic-bezier(.2,1.4,.4,1); }
.pod.show { opacity: 1; transform: none; }
.pod .crown { font-size: min(46px, 5vh); height: min(54px, 6vh); line-height: min(54px, 6vh); }
.pod .avatar { width: min(92px, 10vh); height: min(92px, 10vh); border-radius: 50%; display: grid; place-items: center; font-size: 38px; font-weight: 900; color: var(--aq-blue); background: #fff; border: 6px solid var(--medal); box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.pod .who { font-size: clamp(18px, 2vw, 28px); font-weight: 900; margin-top: 12px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 6px; }
.pod .pts { font-weight: 700; opacity: .9; margin: 2px 0 12px; font-size: 18px; }
.pod .block { width: 100%; border-radius: 16px 16px 0 0; display: grid; place-items: start center; padding-top: 18px; font-size: 64px; font-weight: 900; color: var(--aq-blue); background: linear-gradient(180deg, var(--medal), var(--medal-2)); box-shadow: inset 0 -10px 0 rgba(0,0,0,.08); }
.pod.p1 { --medal: #ffe600; --medal-2: #f5c400; }
.pod.p2 { --medal: #e6e9f5; --medal-2: #bfc5dd; }
.pod.p3 { --medal: #ffb37a; --medal-2: #e98d4d; }
.pod.p1 .block { height: min(240px, 22vh); } .pod.p2 .block { height: min(175px, 15vh); } .pod.p3 .block { height: min(130px, 10vh); }
.pod .block { font-size: min(64px, 6vh); padding-top: min(18px, 1.5vh); }
.pod.p1 .avatar { width: min(116px, 13vh); height: min(116px, 13vh); font-size: min(48px, 5vh); }
.pod.p1 .who { font-size: clamp(22px, 2.6vw, 36px); color: var(--aq-yellow); }

.w-rest { width: 100%; max-width: 900px; margin-top: 0; grid-template-columns: 1fr 1fr 1fr !important; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; opacity: 0; transition: opacity .8s; }
.w-rest.show { opacity: 1; }
.w-row { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.12); border-radius: 12px; padding: 8px 14px; font-weight: 700; font-size: 16px; }
.w-row .r { width: 30px; color: var(--aq-yellow); font-weight: 900; }
.w-row .n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 16px; opacity: 0; transition: opacity .8s; }
.w-actions.show { opacity: 1; }
canvas.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }

@media (max-width: 760px) {
  .answers { grid-template-columns: 1fr; }
  .w-rest { grid-template-columns: 1fr !important; margin-top: 12px; }
  .pod .avatar { width: 64px; height: 64px; font-size: 26px; border-width: 4px; }
  .pod.p1 .avatar { width: 78px; height: 78px; font-size: 32px; }
  .pod .block { font-size: 40px; }
  .pod.p1 .block { height: 170px; } .pod.p2 .block { height: 120px; } .pod.p3 .block { height: 90px; }
}
@media (max-height: 820px) {
  .pod.p1 .block { height: 16vh; } .pod.p2 .block { height: 12vh; } .pod.p3 .block { height: 9vh; }
  .pod .block { font-size: 5vh; padding-top: 1vh; }
  .winner h1 { margin-top: 6px; }
  .w-row { padding: 6px 12px; font-size: 15px; }
}
