:root {
  --ink: #4a3728;
  --muted: #7a5a48;
  --cream: #fffdf4;
  --lemon: #ffe27a;
  --mint: #b8f0d0;
  --peach: #ffd4c4;
  --pink: #ff9ec4;
  --sky: #7ec8ff;
  --ok: #3d9a6a;
  --bad: #e25b4a;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html,
body {
  margin: 0;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  font-family: "Jua", system-ui, sans-serif;
  color: var(--ink);
  background: #f3e2b0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stage {
  position: relative;
  width: min(100vw, calc(100dvh * 0.557));
  height: min(100dvh, calc(100vw / 0.557));
  max-width: 420px;
  border-radius: 22px;
  overflow: hidden;
  background:
    radial-gradient(circle at 16% 10%, rgba(255, 255, 255, 0.75), transparent 28%),
    radial-gradient(circle at 90% 14%, rgba(184, 240, 208, 0.7), transparent 30%),
    linear-gradient(180deg, #fff3b0 0%, #d9f7e4 48%, #ffe8d2 100%);
  box-shadow: 0 18px 44px rgba(74, 55, 40, 0.18);
  display: flex;
  flex-direction: column;
  padding: 12px 14px 16px;
}

.hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  z-index: 4;
}

.home,
.pill {
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 4px 0 rgba(201, 138, 62, 0.22);
  text-decoration: none;
  color: inherit;
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  white-space: nowrap;
}

.play {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-top: 6px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.quiz {
  width: 100%;
}

.quiz .hero {
  width: 64px;
  height: 64px;
  margin: 0 auto 4px;
}

.quiz h1 {
  font-size: 22px;
}

.quiz .lead {
  margin: 2px 0 8px;
  font-size: 13px;
}

h1 {
  margin: 0;
  font-family: "Bagel Fat One", "Jua", sans-serif;
  font-weight: 400;
  font-size: 28px;
  text-align: center;
}

.lead {
  margin: 4px 0 12px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.hero {
  width: 88px;
  height: 88px;
  margin: 0 auto 8px;
  display: block;
  object-fit: cover;
  border-radius: 22px;
  box-shadow: 0 8px 0 rgba(201, 138, 62, 0.18);
}

.dots {
  display: flex;
  gap: 6px;
  width: 100%;
  margin-bottom: 10px;
}

.dot {
  flex: 1;
  height: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  overflow: hidden;
}

.dot i {
  display: block;
  height: 100%;
  width: 0;
  background: #ffb347;
}

.dot.done i {
  width: 100%;
  background: var(--ok);
}

.dot.cur i {
  width: 100%;
}

.qnum {
  color: #d96a28;
  font-size: 13px;
  margin-bottom: 6px;
}

.qtext {
  margin: 0 0 10px;
  font-size: 18px;
  line-height: 1.4;
}

.opts {
  display: grid;
  gap: 8px;
}

.opt {
  appearance: none;
  border: 4px solid #fff;
  border-radius: 16px;
  min-height: 48px;
  padding: 10px 12px;
  text-align: left;
  font-family: inherit;
  font-size: 16px;
  color: inherit;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 5px 0 rgba(201, 138, 62, 0.22);
  cursor: pointer;
}

.opt:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 rgba(201, 138, 62, 0.22);
}

.opt.correct {
  background: #e8fff4;
  border-color: #6fd6b0;
}

.opt.wrong {
  background: #ffece8;
  border-color: #ff9e85;
}

.opt[disabled] {
  cursor: default;
}

.feedback {
  min-height: 22px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.next,
.btn {
  appearance: none;
  border: 0;
  width: 100%;
  margin-top: 12px;
  min-height: 52px;
  border-radius: 16px;
  font-family: "Bagel Fat One", "Jua", sans-serif;
  font-size: 20px;
  color: #fff;
  background: linear-gradient(180deg, #ffb347, #ff8c42);
  box-shadow: 0 6px 0 #d96a28;
  cursor: pointer;
}

.next {
  opacity: 0;
  pointer-events: none;
}

.next.show {
  opacity: 1;
  pointer-events: auto;
}

.btn.soft {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 0 rgba(201, 138, 62, 0.22);
}

.btn.kakao {
  color: #191919;
  background: linear-gradient(180deg, #fee500, #f5d800);
  box-shadow: 0 6px 0 #c4a800;
}

.row {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 300px;
}

.row .btn {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  white-space: nowrap;
}

.quiz.hide,
.result {
  display: none;
}

.result.show {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 18px;
}

.score {
  font-family: "Bagel Fat One", "Jua", sans-serif;
  font-size: 56px;
  color: #ff6b3d;
  margin: 8px 0 0;
}

.score small {
  font-size: 22px;
  color: var(--muted);
}

.msg,
.best,
.timer {
  margin: 8px 0 0;
  color: var(--muted);
}

.best {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--lemon);
  color: var(--ink);
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px 18px;
  text-align: center;
  background: rgba(255, 248, 230, 0.94);
}

.overlay.hidden {
  display: none;
}

.overlay .btn {
  width: auto;
  min-width: 180px;
  padding: 0 22px;
}

.link {
  color: var(--muted);
  text-decoration: none;
}

.today-pause-btn {
  display: none !important;
}
