:root {
  --bg: #14110F;
  --panel: #221D19;
  --line: #3A322B;
  --text: #FFF6E9;
  --muted: #B8AA98;
  --yellow: #FFC72C;
  --red: #E8402F;
  --green: #4ADE80;
}

* { box-sizing: border-box; }

html, body { margin: 0; background: var(--bg); color: var(--text); }

body {
  font-family: 'Noto Sans KR', -apple-system, 'Apple SD Gothic Neo', sans-serif;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
}

main { width: 100%; max-width: 440px; flex: 1; }

.screen { display: none; flex-direction: column; gap: 16px; }
.screen.active { display: flex; }

.kicker { margin: 8px 0 0; color: var(--yellow); font-weight: 700; letter-spacing: 0.02em; }

h1 {
  margin: 0;
  font-family: 'Black Han Sans', sans-serif;
  font-weight: 400;
  font-size: 64px;
  line-height: 0.95;
  color: var(--yellow);
  text-shadow: 4px 4px 0 var(--red);
}

.vs { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--red); font-weight: 700; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }

.mission-head { display: flex; align-items: center; justify-content: space-between; font-weight: 700; }

.mission ul, .stage-mission { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.mission li, .stage-mission li {
  padding: 10px 12px;
  border-radius: 10px;
  background: #2C2621;
  font-size: 17px;
  font-weight: 700;
}
.stage-mission li.hit { background: var(--green); color: #0B2614; }

details { margin-top: 12px; color: var(--muted); font-size: 14px; }
summary { cursor: pointer; }
.example { white-space: pre-line; margin: 8px 0 0; line-height: 1.6; color: var(--text); }

button {
  font: inherit;
  font-weight: 700;
  border: 0;
  border-radius: 14px;
  padding: 16px;
  font-size: 18px;
  cursor: pointer;
  width: 100%;
}
button:disabled { opacity: 0.5; cursor: default; }
.primary { background: var(--yellow); color: #1A1300; }
.secondary { background: var(--red); color: #fff; }
.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.ghost.small { width: auto; padding: 6px 10px; font-size: 13px; border-radius: 999px; }

.hint { margin: 0; color: var(--muted); font-size: 13px; text-align: center; }
.error { margin: 0; color: #FF8A7A; font-size: 14px; text-align: center; }

.beat-dots { display: flex; gap: 12px; justify-content: center; margin-top: 8px; }
.beat-dots i { width: 22px; height: 22px; border-radius: 50%; background: var(--line); transition: background 60ms; }
.beat-dots i.on { background: var(--yellow); }
.beat-dots i.on.down { background: var(--red); }

.meter, .progress { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
#level, #progress { height: 100%; width: 0; background: var(--yellow); }
#progress { background: var(--muted); }

.heard { min-height: 3em; margin: 0; color: var(--muted); font-size: 15px; text-align: center; }

#card { width: 100%; height: auto; border-radius: 16px; }
.video-box { display: flex; flex-direction: column; gap: 10px; font-weight: 700; }
.video-box[hidden] { display: none; }
#replay { width: 100%; max-height: 60vh; border-radius: 10px; background: #000; }
.actions { display: flex; flex-direction: column; gap: 10px; }

footer { max-width: 440px; margin-top: 24px; color: #7D7064; font-size: 11px; line-height: 1.6; text-align: center; }

.ad { min-height: 100px; padding-top: 8px; border-top: 1px solid var(--line); }
.ad[hidden] { display: none; }
footer a { color: var(--muted); }

.maker {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}
.maker-icon {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #FF0033;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.maker-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.maker-text b { font-size: 15px; }
.maker-text small { color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.maker-cta {
  flex: none;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-weight: 900;
  font-size: 13px;
}
.credit { margin: -8px 0 0; color: #7D7064; font-size: 12px; text-align: center; }
.credit a { color: var(--muted); }

.counter { margin: 0; color: var(--muted); font-size: 14px; }
.counter b, .rank b { color: var(--yellow); }
.rank { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-weight: 700; text-align: center; }

.inapp { margin: 0; padding: 12px 14px; border-radius: 12px; background: #3A2A12; border: 1px solid #6B4E1E; color: var(--text); font-size: 14px; line-height: 1.5; }
.inapp b { color: var(--yellow); }
