/* Kazoot !! — gaya tampilan */
:root {
  --merah: #e53935;
  --biru: #1e88e5;
  --hijau: #2e9e48;
  --kuning: #fbc02d;
  --ungu: #46178f;
  --ungu-terang: #7b3fe4;
  --ink: #1f1235;
  --font: "Fredoka", "Baloo 2", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }

body {
  font-family: var(--font);
  color: #fff;
  background: radial-gradient(circle at 20% 10%, var(--ungu-terang), var(--ungu) 55%, #2a0b5e);
  background-attachment: fixed;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; border: 0; }
a { color: inherit; }

/* ---------- latar belakang bentuk-bentuk melayang ---------- */
.bg { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.bg span {
  position: absolute;
  bottom: -120px;
  width: 80px; height: 80px;
  border-radius: 22px;
  opacity: .13;
  animation: floatUp 18s linear infinite;
}
.bg span:nth-child(1) { left: 6%;  background: var(--merah);  animation-delay: 0s; }
.bg span:nth-child(2) { left: 28%; background: var(--biru);   animation-delay: -5s;  width: 60px; height: 60px; border-radius: 50%; }
.bg span:nth-child(3) { left: 52%; background: var(--hijau);  animation-delay: -10s; }
.bg span:nth-child(4) { left: 74%; background: var(--kuning); animation-delay: -3s;  width: 100px; height: 100px; border-radius: 50%; }
.bg span:nth-child(5) { left: 90%; background: #fff;          animation-delay: -13s; width: 50px; height: 50px; }
@keyframes floatUp {
  from { transform: translateY(0) rotate(0); }
  to   { transform: translateY(-130vh) rotate(360deg); }
}

/* ---------- logo ---------- */
.logo {
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1;
  text-shadow: 0 6px 0 rgba(0,0,0,.25);
}
.logo .bang { color: var(--kuning); }

/* ---------- tombol umum ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  background: #fff; color: var(--ungu);
  font-weight: 700;
  font-size: clamp(1.2rem, 3.2vh, 2rem);
  padding: .55em 1.4em;
  border-radius: 16px;
  box-shadow: 0 6px 0 rgba(0,0,0,.25);
  text-decoration: none;
  transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0,0,0,.25); }
.btn.big { font-size: clamp(1.6rem, 5vh, 3rem); }
.btn.ghost { background: rgba(255,255,255,.15); color: #fff; box-shadow: 0 6px 0 rgba(0,0,0,.2); }

.icon-btn {
  width: clamp(38px, 5.5vh, 54px); height: clamp(38px, 5.5vh, 54px);
  border-radius: 50%;
  background: rgba(255,255,255,.16);
  color: #fff;
  font-size: clamp(1rem, 2.6vh, 1.5rem);
  display: inline-grid; place-items: center;
  transition: background .15s;
}
.icon-btn:hover { background: rgba(255,255,255,.3); }

/* ---------- layar ---------- */
.screen {
  position: fixed; inset: 0;
  display: none;
  flex-direction: column;
  z-index: 1;
}
.screen.active { display: flex; }

/* ---------- layar pembuka ---------- */
#screen-intro { align-items: center; justify-content: center; text-align: center; gap: clamp(10px, 2.5vh, 26px); padding: 20px; }
#screen-intro .logo { font-size: clamp(3rem, 13vh, 8rem); }
.intro-title { font-size: clamp(1.4rem, 4.5vh, 2.8rem); font-weight: 700; }
.intro-theme {
  display: inline-block;
  background: #fff; color: var(--ungu);
  padding: .25em .9em; border-radius: 999px;
  font-size: clamp(1.1rem, 3.4vh, 2rem); font-weight: 700;
}
.chips { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.chip-info { background: rgba(255,255,255,.16); padding: .35em .9em; border-radius: 999px; font-size: clamp(.95rem, 2.2vh, 1.3rem); }
.howto {
  background: rgba(0,0,0,.18);
  border-radius: 18px;
  padding: clamp(10px, 2vh, 20px) clamp(14px, 3vw, 30px);
  max-width: 820px;
  font-size: clamp(1rem, 2.4vh, 1.4rem);
  line-height: 1.4;
}
.color-row { display: flex; gap: 8px; justify-content: center; margin-top: .6em; flex-wrap: wrap; }
.color-row span { padding: .2em .8em; border-radius: 10px; font-weight: 700; }
.top-right { position: fixed; top: 14px; right: 14px; display: flex; gap: 8px; z-index: 5; }

/* ---------- layar pertanyaan ---------- */
#screen-question {
  padding: clamp(8px, 1.6vh, 18px) clamp(10px, 2vw, 28px);
  gap: clamp(8px, 1.6vh, 16px);
}
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.q-counter {
  background: rgba(255,255,255,.16);
  padding: .3em .9em; border-radius: 999px;
  font-size: clamp(1rem, 2.6vh, 1.5rem);
}
.q-counter.practice { background: var(--kuning); color: #3a2a00; font-weight: 700; }
.topbar .logo { font-size: clamp(1.4rem, 4vh, 2.4rem); text-shadow: 0 3px 0 rgba(0,0,0,.25); }
.controls { display: flex; gap: 8px; }

.q-card {
  background: #fff; color: var(--ink);
  border-radius: 20px;
  padding: clamp(12px, 2.2vh, 26px) clamp(16px, 3vw, 40px);
  display: flex; align-items: center; gap: clamp(12px, 2vw, 26px);
  box-shadow: 0 8px 0 rgba(0,0,0,.2);
  animation: dropIn .45s ease-out;
}
.q-emoji { font-size: clamp(2.4rem, 8vh, 5rem); line-height: 1; flex: none; }
.q-text { font-size: clamp(1.3rem, calc(3.6vh + .9vw), 3.2rem); font-weight: 700; line-height: 1.2; }

.middle {
  flex: 1; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  gap: clamp(12px, 2vw, 28px);
}

.timer { position: relative; height: min(100%, 24vh); aspect-ratio: 1; min-height: 90px; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer circle { fill: none; stroke-width: 10; }
.timer .track { stroke: rgba(255,255,255,.18); }
.timer .ring { stroke: #fff; stroke-linecap: round; transition: stroke .3s; }
.timer .num {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: clamp(2.6rem, 10vh, 6.5rem); font-weight: 700;
}
.timer.danger .ring { stroke: #ff5a5a; }
.timer.danger .num { color: #ffd6d6; animation: pulse 1s infinite; }
.timer.paused .num { animation: none; opacity: .35; }
.timer.paused::after {
  content: "JEDA";
  position: absolute; left: 50%; bottom: -6%;
  transform: translateX(-50%);
  background: var(--kuning); color: #3a2a00;
  font-weight: 700; padding: .1em .7em; border-radius: 8px;
  font-size: clamp(.9rem, 2.2vh, 1.3rem);
}

.reveal {
  flex: 1; max-width: 1100px; max-height: 100%; overflow: auto;
  background: rgba(255,255,255,.96); color: var(--ink);
  border-radius: 20px;
  padding: clamp(10px, 2vh, 22px) clamp(14px, 2.4vw, 30px);
  box-shadow: 0 8px 0 rgba(0,0,0,.2);
  animation: slideUp .45s ease-out;
}
.reveal-kicker { font-size: clamp(.9rem, 2.2vh, 1.3rem); color: #6b5a8a; font-weight: 600; }
.reveal-title { font-size: clamp(1.4rem, 4.6vh, 3rem); font-weight: 700; line-height: 1.25; }
.reveal-info { font-size: clamp(1rem, 2.6vh, 1.6rem); margin-top: .35em; line-height: 1.35; }
.chip {
  display: inline-block;
  padding: 0 .45em; border-radius: 12px;
  color: #fff; margin: 0 .1em;
}
.chip.c-kuning { color: #3a2a00; }

.btn-next { flex: none; animation: nudge 1.6s ease-in-out infinite; }

.answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 1fr;
  gap: clamp(8px, 1.4vh, 16px);
  height: 38vh;
}
.answer {
  position: relative;
  border-radius: 18px;
  display: flex; align-items: center;
  gap: clamp(10px, 1.6vw, 22px);
  padding: clamp(8px, 1.6vh, 18px) clamp(12px, 2vw, 26px);
  box-shadow: inset 0 -8px 0 rgba(0,0,0,.18);
  transition: opacity .45s, transform .45s, filter .45s, box-shadow .45s;
  animation: popIn .4s ease-out backwards;
  min-height: 0;
}
.c-merah  { background: var(--merah); }
.c-biru   { background: var(--biru); }
.c-hijau  { background: var(--hijau); }
.c-kuning { background: var(--kuning); color: #3a2a00; }

.answer .shape { width: clamp(38px, 8.5vh, 86px); flex: none; display: grid; }
.answer .shape svg { width: 100%; height: auto; filter: drop-shadow(0 3px 0 rgba(0,0,0,.2)); }
.a-body { display: flex; flex-direction: column; min-width: 0; }
.a-label { font-size: clamp(.8rem, 2vh, 1.25rem); letter-spacing: .18em; font-weight: 600; opacity: .85; }
.a-text { font-size: clamp(1.05rem, calc(2.9vh + .6vw), 2.5rem); font-weight: 700; line-height: 1.15; }

.answer .check {
  position: absolute; top: -14px; right: -10px;
  width: clamp(40px, 7vh, 64px); height: clamp(40px, 7vh, 64px);
  border-radius: 50%;
  background: #fff; color: var(--hijau);
  font-size: clamp(1.6rem, 4.6vh, 2.8rem); font-weight: 700;
  display: none; place-items: center;
  box-shadow: 0 4px 0 rgba(0,0,0,.2);
}
.answer.correct { transform: scale(1.025); box-shadow: inset 0 -8px 0 rgba(0,0,0,.18), 0 0 0 6px #fff, 0 0 40px 12px rgba(255,255,255,.55); z-index: 2; }
.answer.correct .check { display: grid; animation: popIn .4s ease-out; }
.answer.wrong { opacity: .25; filter: grayscale(.7); transform: scale(.96); }

/* ---------- overlay: hitung mundur & judul pertanyaan ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  display: none; place-items: center; text-align: center;
  background: rgba(35, 8, 80, .93);
}
.overlay.show { display: grid; }
.overlay .big { font-size: clamp(5rem, 30vh, 18rem); font-weight: 700; text-shadow: 0 10px 0 rgba(0,0,0,.25); }
.overlay .mid { font-size: clamp(2.4rem, 10vh, 6rem); font-weight: 700; text-shadow: 0 6px 0 rgba(0,0,0,.25); }
.overlay .sub { font-size: clamp(1.2rem, 4vh, 2.4rem); opacity: .85; margin-top: .3em; }
.anim { animation: zoom .8s ease-out; }

/* ---------- layar selesai ---------- */
#screen-end { align-items: center; justify-content: center; text-align: center; gap: clamp(12px, 3vh, 30px); padding: 20px; }
#screen-end h1 { font-size: clamp(2.6rem, 11vh, 7rem); text-shadow: 0 8px 0 rgba(0,0,0,.25); }
#screen-end p { font-size: clamp(1.2rem, 3.6vh, 2.2rem); }
.verse {
  background: #fff; color: var(--ink);
  border-radius: 20px; max-width: 900px;
  padding: clamp(14px, 2.6vh, 28px) clamp(18px, 3vw, 40px);
  font-size: clamp(1.1rem, 3vh, 1.9rem); line-height: 1.4;
  box-shadow: 0 8px 0 rgba(0,0,0,.2);
}
.verse b { display: block; margin-top: .4em; color: var(--ungu); }
.btn-row { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }

#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }

/* ---------- izin musik ---------- */
.overlay.unlock { background: rgba(35, 8, 80, .7); cursor: pointer; z-index: 70; }
.unlock-box {
  background: #fff; color: var(--ungu);
  border-radius: 24px;
  padding: .8em 1.4em;
  font-size: clamp(1.5rem, 5vh, 2.8rem); font-weight: 700; line-height: 1.25;
  box-shadow: 0 8px 0 rgba(0,0,0,.25);
  animation: pulse 1.6s ease-in-out infinite;
}

/* ---------- daftar game ---------- */
#screen-list.active { display: block; overflow-y: auto; }
.head-actions { display: flex; align-items: center; gap: 10px; }
.page { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; padding: 28px 20px 60px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head .logo { font-size: clamp(2.4rem, 7vw, 4.2rem); text-decoration: none; }
.page h2 { margin: 30px 0 16px; font-size: clamp(1.4rem, 3vw, 2rem); }
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.game-card {
  background: #fff; color: var(--ink);
  border-radius: 22px; overflow: hidden;
  box-shadow: 0 8px 0 rgba(0,0,0,.2);
  display: flex; flex-direction: column;
  text-decoration: none;
  transition: transform .15s;
}
.game-card:hover { transform: translateY(-4px) rotate(-.5deg); }
.game-card .band { display: grid; grid-template-columns: repeat(4, 1fr); height: 12px; }
.game-card .band i:nth-child(1) { background: var(--merah); }
.game-card .band i:nth-child(2) { background: var(--biru); }
.game-card .band i:nth-child(3) { background: var(--hijau); }
.game-card .band i:nth-child(4) { background: var(--kuning); }
.game-card .body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.game-card .emoji { font-size: 3rem; line-height: 1; }
.game-card h3 { font-size: 1.5rem; }
.game-card .theme { color: var(--ungu); font-weight: 600; font-size: 1.1rem; }
.game-card .meta { color: #6b5a8a; }
.game-card .play {
  margin-top: auto; align-self: flex-start;
  background: var(--ungu); color: #fff;
  padding: .5em 1.2em; border-radius: 12px; font-weight: 700; font-size: 1.15rem;
}

/* ---------- animasi ---------- */
@keyframes pulse   { 50% { transform: scale(1.12); } }
@keyframes popIn   { from { transform: scale(.6); opacity: 0; } }
@keyframes dropIn  { from { transform: translateY(-30px); opacity: 0; } }
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } }
@keyframes zoom    { from { transform: scale(2.2); opacity: 0; } 60% { transform: scale(.95); opacity: 1; } }
@keyframes nudge   { 50% { transform: translateX(8px); } }

/* ---------- layar kecil (HP / portrait) ---------- */
@media (max-width: 700px) {
  .answers { height: auto; flex: none; }
  .answer { min-height: 80px; }
  .middle { flex-direction: column; }
  .timer { height: 20vh; }
  .topbar .logo { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
