* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: linear-gradient(160deg, #0f172a, #1e1b4b 60%, #312e81);
  color: #e2e8f0; min-height: 100vh;
  display: flex; flex-direction: column; align-items: center;
}
#app { width: 100%; max-width: 480px; padding: 16px 14px 8px; flex: 1; }
.screen { display: none; animation: fade .25s; }
.screen.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }
h1 { font-size: 34px; text-align: center; letter-spacing: 2px;
  background: linear-gradient(90deg, #fbbf24, #f97316); -webkit-background-clip: text; background-clip: text; color: transparent; }
h2 { text-align: center; margin: 8px 0 14px; font-size: 22px; }
.logo { font-size: 64px; text-align: center; margin-top: 18px; animation: bounce 1.6s infinite; }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.tagline { text-align: center; color: #94a3b8; margin: 6px 0 16px; font-size: 14px; }
.card { background: rgba(30,41,59,.85); border: 1px solid #334155; border-radius: 16px; padding: 16px; margin-bottom: 12px; }
.lbl { font-size: 12px; color: #94a3b8; margin: 12px 0 6px; display: block; }
.inp { width: 100%; padding: 12px; border-radius: 12px; border: 1px solid #475569;
  background: #0f172a; color: #fff; font-size: 16px; margin-bottom: 10px; }
.inp:focus { outline: none; border-color: #f59e0b; }
.pill-row { display: flex; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.pill { flex: 1; padding: 10px; border-radius: 999px; border: 1px solid #475569;
  background: #0f172a; color: #cbd5e1; font-size: 14px; cursor: pointer; white-space: nowrap; }
.pill.on { background: linear-gradient(90deg, #f59e0b, #f97316); color: #fff; border-color: transparent; font-weight: 700; }
.mode-row { display: flex; gap: 10px; margin-bottom: 12px; }
.mode-card { flex: 1; padding: 16px 8px; border-radius: 16px; border: 1px solid #475569;
  background: #0f172a; color: #fff; cursor: pointer; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.mode-card:active { transform: scale(.97); border-color: #f59e0b; }
.mode-ico { font-size: 36px; }
.mode-nama { font-weight: 800; font-size: 16px; }
.mode-sub { font-size: 12px; color: #94a3b8; }
.btn-primary { width: 100%; padding: 14px; border: none; border-radius: 12px; font-size: 16px; font-weight: 800;
  background: linear-gradient(90deg, #f59e0b, #f97316); color: #fff; cursor: pointer; margin-bottom: 10px; }
.btn-primary:active { transform: scale(.98); }
.btn-link { width: 100%; padding: 10px; background: none; border: none; color: #fbbf24; font-size: 14px; cursor: pointer; }
.btn-back { width: 100%; padding: 10px; background: none; border: none; color: #94a3b8; font-size: 14px; cursor: pointer; margin-top: 4px; }
.btn-kecil { padding: 6px 12px; border-radius: 8px; border: none; background: #334155; color: #fff; font-size: 13px; cursor: pointer; }
.atau { text-align: center; color: #64748b; margin: 6px 0 12px; font-size: 13px; }
.muted { color: #94a3b8; font-size: 13px; text-align: center; margin: 8px 0; }
/* hero */
.hero-list { display: flex; flex-direction: column; gap: 10px; }
.hero-card { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 16px;
  border: 1px solid #475569; background: rgba(30,41,59,.85); cursor: pointer; }
.hero-card:active { border-color: #f59e0b; transform: scale(.98); }
.hero-emoji { font-size: 44px; }
.hero-nama { font-weight: 800; font-size: 16px; }
.hero-stat { font-size: 13px; color: #94a3b8; }
/* battle */
.stage-bar { display: flex; justify-content: space-between; font-size: 14px; font-weight: 700; margin-bottom: 10px; color: #fbbf24; }
.arena { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.fighter { flex: 1; text-align: center; }
.f-emoji { font-size: 52px; }
.f-emoji.enemy { animation: floaty 2s infinite; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.f-emoji.hit { animation: shake .4s; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.f-nama { font-size: 13px; font-weight: 700; margin: 4px 0; }
.hpbar { height: 12px; background: #1e293b; border-radius: 999px; overflow: hidden; border: 1px solid #334155; }
.hpfill { height: 100%; border-radius: 999px; transition: width .5s; }
.hpfill.hero { background: linear-gradient(90deg, #22c55e, #4ade80); width: 100%; }
.hpfill.enemy { background: linear-gradient(90deg, #ef4444, #f97316); width: 100%; }
.hptext { font-size: 11px; color: #94a3b8; margin-top: 2px; }
.vs { font-size: 20px; font-weight: 900; color: #f59e0b; padding: 0 6px; }
#dmgLayer { position: relative; height: 0; }
.dmg { position: absolute; font-weight: 900; font-size: 22px; animation: dmgfloat 1s forwards; pointer-events: none; }
.dmg.you { color: #4ade80; left: 70%; top: -70px; }
.dmg.foe { color: #f87171; left: 20%; top: -70px; }
@keyframes dmgfloat { to { transform: translateY(-40px); opacity: 0; } }
/* soal */
.soal-card { margin-top: 8px; }
.timer { height: 8px; background: #1e293b; border-radius: 999px; overflow: hidden; margin-bottom: 12px; }
.timerfill { height: 100%; width: 100%; background: linear-gradient(90deg, #38bdf8, #818cf8); transition: width 1s linear; }
.soal-teks { font-size: 17px; font-weight: 600; margin-bottom: 12px; line-height: 1.5; }
.opsi-list { display: flex; flex-direction: column; gap: 8px; }
.opsi { padding: 13px; border-radius: 12px; border: 1px solid #475569; background: #0f172a;
  color: #fff; font-size: 15px; text-align: left; cursor: pointer; }
.opsi:active { transform: scale(.98); }
.opsi.benar { background: #14532d; border-color: #22c55e; }
.opsi.salah { background: #7f1d1d; border-color: #ef4444; }
.opsi:disabled { opacity: .85; cursor: default; }
/* hasil */
.hasil-card { text-align: center; }
.hasil-skor { font-size: 52px; font-weight: 900; color: #fbbf24; }
.hasil-detail { color: #94a3b8; margin: 8px 0 14px; font-size: 14px; }
.kode-box { display: flex; gap: 8px; align-items: center; justify-content: center; margin: 8px 0; }
.kode-box span { font-size: 28px; font-weight: 900; letter-spacing: 6px; color: #fbbf24; }
/* leaderboard */
.top-row { display: flex; gap: 10px; padding: 10px 4px; border-bottom: 1px solid #334155; font-size: 14px; align-items: center; }
.top-row:last-child { border: none; }
.top-rank { width: 30px; font-weight: 900; color: #fbbf24; text-align: center; }
.top-nama { flex: 1; }
.top-nama small { display: block; color: #94a3b8; font-size: 11px; }
.top-skor { font-weight: 800; color: #4ade80; }
/* admin */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.form-row { display: flex; gap: 8px; }
.form-row .btn-primary { margin-bottom: 0; }
.adm-row { padding: 10px 4px; border-bottom: 1px solid #334155; font-size: 13px; }
.adm-row:last-child { border: none; }
.adm-q { font-weight: 600; margin-bottom: 4px; }
.adm-meta { color: #94a3b8; font-size: 11px; margin-bottom: 6px; }
.adm-aksi { display: flex; gap: 6px; }
footer { padding: 10px; font-size: 12px; color: #64748b; text-align: center; }
footer a { color: #64748b; }
