:root {
  color-scheme: light;
  --ink: #26323c;
  --muted: #66727c;
  --paper: #fbfaf5;
  --card: #ffffff;
  --line: #dbe8f2;
  --green: #20a77f;
  --green-deep: #11705b;
  --coral: #ff756b;
  --gold: #ffd85a;
  --sea: #d9f7ff;
  --pink: #ffdcea;
  --blue: #7ec8ff;
  --lavender: #ece5ff;
  --shadow: 0 18px 44px rgba(31, 67, 92, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  font-family: "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 216, 90, 0.78), transparent 10rem),
    radial-gradient(circle at 86% 16%, rgba(255, 220, 234, 0.76), transparent 12rem),
    linear-gradient(180deg, rgba(45, 126, 174, 0.18), rgba(15, 64, 92, 0.42)),
    url("/assets/dokdo-bg.jpg") center / cover fixed,
    linear-gradient(145deg, #fff8d6 0%, #d9f7ff 100%);
  color: var(--ink);
  overflow-x: hidden;
}

.dokdo-page {
  padding: 0 14px 40px;
}

.dokdo-info {
  width: min(100%, 900px);
  margin: 24px auto 0;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  min-height: calc(100svh - 96px);
  width: min(100%, 900px);
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 14px max(12px, env(safe-area-inset-bottom));
  display: grid;
  position: relative;
}

.app-shell::before,
.app-shell::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow:
    42px 18px 0 rgba(255, 255, 255, 0.34),
    86px -4px 0 rgba(255, 255, 255, 0.24);
  pointer-events: none;
}

.app-shell::before {
  width: 82px;
  height: 82px;
  left: -24px;
  top: 15svh;
}

.app-shell::after {
  width: 96px;
  height: 96px;
  right: 18px;
  bottom: 14svh;
}

.screen {
  display: none;
  min-height: calc(100svh - 120px);
}

.screen.active {
  display: flex;
}

.start-screen,
.result-screen {
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}

.quiz-screen {
  flex-direction: column;
  gap: 9px;
}

.brand-strip,
.quiz-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-strip span,
.kicker,
.eyebrow,
.area-label {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0;
}

.start-screen .brand-strip span,
.start-screen .eyebrow,
.start-screen h1,
.start-screen .intro {
  color: #fff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.42);
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background: rgba(255, 248, 214, 0.92);
  color: var(--green-deep);
  font-size: 1.24rem;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 22px rgba(20, 60, 46, 0.08);
}

.hero-copy {
  padding-top: 5svh;
}

.eyebrow {
  margin: 0 0 10px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 3.7rem;
  line-height: 0.96;
  font-weight: 950;
}

.intro {
  margin-top: 12px;
  max-width: 34rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.start-panel,
.result-card,
.question-card {
  background: rgba(255, 255, 255, 0.93);
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.start-panel {
  padding: 10px;
}

.mission-note {
  width: fit-content;
  margin: 0 auto 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--gold);
  color: #5a4200;
  font-size: 0.92rem;
  font-weight: 950;
  box-shadow: 0 7px 0 rgba(126, 96, 9, 0.12);
}

.rule-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.rule-grid div {
  min-height: 62px;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, var(--sea));
  border: 2px solid rgba(126, 200, 255, 0.36);
  display: grid;
  place-items: center;
  padding: 8px;
}

.rule-grid div:nth-child(2) {
  background: linear-gradient(180deg, #ffffff, var(--pink));
  border-color: rgba(255, 117, 107, 0.24);
}

.rule-grid div:nth-child(3) {
  background: linear-gradient(180deg, #ffffff, var(--lavender));
  border-color: rgba(126, 104, 255, 0.2);
}

.rule-grid strong {
  font-size: 1.8rem;
  line-height: 1;
  color: var(--green-deep);
}

.rule-grid span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.primary-button,
.secondary-button,
.choice-button,
.submit-button {
  border: 0;
  border-radius: 8px;
  min-height: 50px;
  font-weight: 900;
  cursor: pointer;
}

.primary-button {
  width: 100%;
  background: linear-gradient(180deg, #26c99a, var(--green-deep));
  color: #fff;
  font-size: 1.08rem;
  box-shadow: 0 8px 0 #0a4d3d;
}

.secondary-button {
  width: 100%;
  background: linear-gradient(180deg, #fff, var(--sea));
  color: var(--green-deep);
  border: 2px solid rgba(126, 200, 255, 0.34);
}

.quiz-topbar {
  min-height: 48px;
}

.quiz-topbar div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.quiz-topbar strong {
  font-size: 1.35rem;
}

.timer-wrap {
  display: grid;
  grid-template-columns: 1fr 52px;
  align-items: center;
  gap: 10px;
}

.quiz-topbar,
.timer-wrap {
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.62);
  border-radius: 8px;
  padding: 7px 10px;
  backdrop-filter: blur(8px);
}

.timer-track {
  height: 14px;
  border-radius: 999px;
  background: rgba(38, 50, 60, 0.12);
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.82);
}

.timer-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--green), var(--gold), var(--coral));
  transform-origin: left center;
  transition: transform 80ms linear;
}

#timerText {
  text-align: right;
  font-weight: 950;
  color: var(--green-deep);
}

.question-card {
  min-height: 210px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.question-card::before {
  content: "독도";
  position: absolute;
  right: 14px;
  top: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--gold);
  color: #5a4200;
  font-size: 0.82rem;
  font-weight: 950;
}

.question-card h2 {
  font-size: 1.55rem;
  line-height: 1.28;
  font-weight: 950;
  word-break: keep-all;
  white-space: pre-line;
}

.hint {
  min-height: 1.5em;
  color: var(--muted);
  font-weight: 800;
}

.answer-zone {
  display: grid;
  gap: 8px;
}

.answer-zone.ox {
  grid-template-columns: 1fr 1fr;
}

.choice-button {
  width: 100%;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  border: 2px solid rgba(126, 200, 255, 0.28);
  box-shadow: 0 8px 0 rgba(31, 67, 92, 0.12);
  padding: 12px;
  font-size: 1.05rem;
  line-height: 1.28;
  word-break: keep-all;
}

.choice-button:active,
.primary-button:active,
.secondary-button:active,
.submit-button:active {
  transform: translateY(3px);
  box-shadow: 0 4px 0 rgba(31, 67, 92, 0.16);
}

.choice-button.correct {
  background: #dcfff3;
  border-color: #67d9b2;
}

.choice-button.wrong {
  background: #ffe3ee;
  border-color: #ff9fb5;
}

.short-answer {
  display: grid;
  gap: 8px;
}

.short-answer input {
  width: 100%;
  min-height: 56px;
  border: 2px solid rgba(126, 200, 255, 0.52);
  border-radius: 8px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 800;
  outline: none;
}

.short-answer input:focus {
  border-color: var(--green);
}

.submit-button {
  background: linear-gradient(180deg, #fff1a1, var(--gold));
  color: #382600;
  box-shadow: 0 8px 0 rgba(126, 96, 9, 0.2);
}

.feedback {
  min-height: 118px;
  text-align: center;
  font-weight: 900;
  color: var(--green-deep);
}

.feedback.reveal {
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  border: 2px solid rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.result-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff8d6;
  font-size: 2.6rem;
  line-height: 0.9;
  font-weight: 950;
  box-shadow: inset 0 -5px 0 rgba(31, 67, 92, 0.08), 0 6px 0 rgba(31, 67, 92, 0.1);
}

.feedback.correct .result-mark {
  color: var(--green);
}

.feedback.wrong .result-mark,
.feedback.wrong {
  color: #a43f31;
}

.result-label {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--lavender);
  font-size: 1rem;
  color: #4a3a87;
  font-weight: 950;
}

.answer-line {
  color: var(--ink);
  font-size: clamp(1.65rem, 7vw, 2.65rem);
  line-height: 1.18;
  word-break: keep-all;
  padding: 4px 10px 8px;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #fff8d6);
  box-shadow: inset 0 -6px 0 rgba(255, 216, 90, 0.28);
}

.result-screen {
  justify-content: center;
}

.result-card {
  padding: 22px;
  text-align: center;
}

.result-card h2 {
  margin: 10px 0;
  font-size: 4.4rem;
  line-height: 1;
  font-weight: 950;
}

#resultMessage {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.5;
  margin-bottom: 16px;
}

.result-actions {
  display: grid;
  gap: 10px;
}

@media (min-width: 720px) {
  .app-shell {
    padding-inline: 28px;
  }

  h1 {
    font-size: 6rem;
  }

  .intro {
    font-size: 1.2rem;
  }

  .start-panel {
    padding: 18px;
  }

  .question-card {
    padding: 34px;
  }

  .question-card h2 {
    font-size: 2.25rem;
  }

  .choice-button {
    font-size: 1.16rem;
  }

  .result-card {
    padding: 42px;
  }

  .result-card h2 {
    font-size: 6rem;
  }

  .answer-line {
    font-size: 3.3rem;
  }

  .answer-zone:not(.ox) {
    grid-template-columns: 1fr 1fr;
  }

  .short-answer {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 190px;
  }
}

@media (display-mode: fullscreen) {
  .app-shell {
    width: min(100%, 1000px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
