:root {
  --paper: #fcfcf8;
  --desk: #eef0ec;
  --ink: #161616;
  --ink-soft: #5f625e;
  --omr: #d24a62;
  --omr-soft: #f6dde2;
  --omr-faint: #fbeef0;
}

* { box-sizing: border-box; }
html, body { overflow-x: hidden; }

body {
  margin: 0;
  background: var(--desk);
  color: var(--ink);
  font-family: "Nanum Gothic", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  line-height: 1.6;
}

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 32px 16px 64px;
}

.home {
  color: var(--ink-soft);
  font-size: 14px;
  text-decoration: none;
}
.home:hover { color: var(--ink); }

/* ── 시험지 ── */
.paper {
  margin-top: 14px;
  background: var(--paper);
  border: 1px solid #d9dbd5;
  padding: 28px 22px 26px;
}

.masthead {
  text-align: center;
  border-bottom: 3px double var(--ink);
  padding-bottom: 14px;
}
.masthead h1 {
  font-family: "Nanum Myeongjo", serif;
  font-weight: 800;
  font-size: clamp(22px, 6vw, 30px);
  line-height: 1.3;
  margin: 0;
  word-break: keep-all;
}
.masthead .period {
  display: inline-block;
  margin-top: 10px;
  border: 1.5px solid var(--ink);
  padding: 2px 14px;
  font-family: "Nanum Myeongjo", serif;
  font-weight: 700;
  font-size: 15px;
}

.label {
  margin: 22px 0 0;
  text-align: center;
  font-family: "Nanum Myeongjo", serif;
  font-weight: 700;
  font-size: 18px;
}

/* ── OMR 마킹 칸 ── */
.card {
  margin: 18px auto 0;
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 0;
}
.sign {
  display: flex;
  align-items: center;
  padding: 0 14px 0 0;
  font-family: "Nanum Myeongjo", serif;
  font-weight: 800;
  font-size: clamp(34px, 11vw, 52px);
  color: var(--ink);
  white-space: nowrap;
}
.omr {
  display: flex;
  border: 2px solid var(--omr);
  background: var(--omr-faint);
}
.col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 0 7px 10px;
  border-left: 1px solid var(--omr-soft);
}
.col:first-child { border-left: 0; }
.written {
  width: calc(100% + 14px);
  text-align: center;
  font-family: "Nanum Myeongjo", serif;
  font-weight: 800;
  font-size: 26px;
  line-height: 1.5;
  border-bottom: 2px solid var(--omr);
  background: var(--paper);
  margin-bottom: 5px;
}
.bubble {
  width: 22px;
  height: 30px;
  border: 1.5px solid var(--omr);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--omr);
  background: var(--paper);
}
.bubble.on {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--ink);
}

.facts {
  margin: 24px 0 0;
  display: grid;
  grid-template-columns: auto 1fr;
  border-top: 1px solid var(--ink);
}
.facts dt, .facts dd {
  margin: 0;
  padding: 9px 4px;
  border-bottom: 1px solid #d9dbd5;
}
.facts dt { color: var(--ink-soft); padding-right: 18px; }
.facts dd { text-align: right; font-weight: 700; }

.share {
  display: block;
  width: 100%;
  margin-top: 22px;
  padding: 15px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font: 700 16px/1 "Nanum Gothic", sans-serif;
  cursor: pointer;
}
.share:hover { background: #000; }
.share:active { transform: translateY(1px); }
.share:focus-visible, .years a:focus-visible {
  outline: 3px solid var(--omr);
  outline-offset: 3px;
}

.years {
  margin-top: 22px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.years a {
  flex: 1;
  min-width: 110px;
  text-align: center;
  padding: 10px 8px;
  border: 1.5px solid var(--ink);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  background: var(--paper);
}
.years a:hover { background: var(--omr-faint); }
.years a[aria-current="page"] {
  background: var(--omr);
  border-color: var(--omr);
  color: #fff;
}

.about {
  margin-top: 40px;
  font-size: 15px;
  color: #3d3f3b;
}
.about h2 {
  font-family: "Nanum Myeongjo", serif;
  font-weight: 800;
  font-size: 20px;
  margin: 0 0 8px;
  color: var(--ink);
}
.about p { margin: 0 0 10px; }
.about a { color: inherit; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: var(--paper);
  padding: 12px 20px;
  font-size: 15px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 400px) {
  .paper { padding: 22px 14px; }
  .col { padding: 0 5px 8px; }
  .written { width: calc(100% + 10px); }
  .bubble { width: 20px; height: 27px; }
}
@media (prefers-reduced-motion: reduce) {
  .toast { transition: none; }
}
