/* 집현전 한글 탐험 — 화면 스타일 (screens: .scr-*) */

/* ================================================================ */
/* 0. 공통 조각                                                      */
/* ================================================================ */
.scr-face {
  display: block; flex: none;
  width: 68px; height: 68px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--ink);
  background: radial-gradient(circle at 50% 35%, #fff6d6, #f0d9a8);
  box-shadow: 0 3px 0 var(--ink);
}
.scr-face img { width: 200%; max-width: none; height: auto; margin-left: -62%; margin-top: -14%; }

.scr-bubble {
  position: relative;
  padding: 10px 16px;
  background: #fff;
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: 0 3px 0 var(--ink);
  font-weight: 800;
  line-height: 1.45;
}
.scr-mini-stars { letter-spacing: 1px; white-space: nowrap; }
.scr-mini-stars .on { color: var(--gold-2); }
.scr-mini-stars .off { color: #c9b594; }

.scr-skip {
  position: absolute; z-index: 20;
  top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right));
  background: rgba(255, 255, 255, .12) !important;
  color: #fff !important;
  border-color: rgba(255, 255, 255, .6) !important;
  box-shadow: none !important;
}
.scr-skip:hover { background: rgba(255, 255, 255, .22) !important; }
.scr-skip:focus-visible { outline-color: var(--gold); }

@keyframes scr-breathe { 0%, 100% { opacity: .65; transform: scale(.96); } 50% { opacity: 1; transform: scale(1.04); } }
@keyframes scr-pulse-ring { 0% { box-shadow: 0 0 0 0 rgba(255, 210, 80, .75), inset 0 0 18px rgba(255, 210, 80, .5); } 70% { box-shadow: 0 0 0 16px rgba(255, 210, 80, 0), inset 0 0 18px rgba(255, 210, 80, .5); } 100% { box-shadow: 0 0 0 0 rgba(255, 210, 80, 0), inset 0 0 18px rgba(255, 210, 80, .5); } }
@keyframes scr-twinkle { 0%, 100% { opacity: .15; transform: scale(.7) rotate(0deg); } 45% { opacity: 1; transform: scale(1.15) rotate(20deg); } 60% { opacity: .9; transform: scale(1) rotate(25deg); } }
@keyframes scr-pulse-btn { 0%, 100% { box-shadow: 0 5px 0 var(--ink), 0 0 0 0 rgba(245, 184, 46, .7); } 50% { box-shadow: 0 5px 0 var(--ink), 0 0 0 10px rgba(245, 184, 46, 0); } }
@keyframes scr-hint-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(245, 184, 46, .9); border-color: var(--gold-2); } 50% { box-shadow: 0 0 0 8px rgba(245, 184, 46, .15), 0 0 22px rgba(245, 184, 46, .9); border-color: var(--gold); } }
.scr-pulse { animation: scr-pulse-btn 1.6s ease-in-out infinite; }

/* 세종대왕 그림의 책 표지 가림: '빛나는 책' (sejong.png 비율 1086×1448 기준 %) */
.scr-sejong-fig { position: relative; display: inline-block; line-height: 0; }
.scr-sejong-fig .scr-sejong-img { max-width: none; }
.scr-book-glow {
  position: absolute; left: 54%; top: 23%; width: 46%; height: 34%;
  border-radius: 50%;
  background: radial-gradient(closest-side,
    rgba(255, 253, 240, 1) 0%, rgba(255, 246, 205, .98) 50%, rgba(255, 228, 140, .9) 68%,
    rgba(255, 214, 100, .45) 84%, rgba(255, 210, 90, 0) 100%);
  container-type: inline-size;
  pointer-events: none;
}
.scr-book-glow i {
  position: absolute; font-style: normal; line-height: 1;
  font-size: 16px; font-size: 13cqw;
  color: #fffbe0;
  text-shadow: 0 0 6px #ffd766, 0 0 14px #f5b82e;
  animation: scr-twinkle 3s ease-in-out infinite;
}
.scr-book-glow i.a { left: 22%; top: 26%; }
.scr-book-glow i.b { left: 60%; top: 16%; font-size: 10px; font-size: 9cqw; animation-delay: -1s; }
.scr-book-glow i.c { left: 52%; top: 62%; font-size: 12px; font-size: 10cqw; animation-delay: -2s; }
@media (prefers-reduced-motion: reduce) { .scr-book-glow i { animation: none !important; opacity: .9; } }

/* 그림 속 책 표지('훈민음') 위에 붙이는 '훈민정음' 제목 쪽지.
 * 위치·크기·기울기·글자 크기는 js/screens.js 의 PATCH 값으로 인라인 지정(부모는 그림과 같은 비율의 container). */
.scr-title-slip {
  position: absolute; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-sizing: border-box;
  font-size: 10px;
  font-weight: 900; line-height: 1.06;
  color: #2e1b0c;
  background: linear-gradient(180deg, #fffaf0 0%, #f1e1b8 100%);
  border: 1px solid #8a6a3a;
  border: .11cqw solid #8a6a3a;
  border-radius: 2px;
  border-radius: .17cqw;
  box-shadow: 0 1px 3px rgba(40, 20, 5, .35);
  box-shadow: inset 0 0 0 .18cqw rgba(255, 250, 240, .9), inset 0 0 0 .26cqw rgba(138, 106, 58, .5), 0 .08cqw .25cqw rgba(40, 20, 5, .35);
  pointer-events: none;
  user-select: none; -webkit-user-select: none;
  transform-origin: 50% 50%;
}
.scr-title-slip i { display: block; font-style: normal; }

/* 연출 화면 공통: 움직임 줄이기면 페이드만 */
.scr-seq.rm, .scr-seq.rm * { animation: none !important; transition-property: opacity, visibility !important; transition-duration: .6s !important; }
@media (prefers-reduced-motion: reduce) {
  .scr-seq, .scr-seq * { animation: none !important; transition-property: opacity, visibility !important; transition-duration: .6s !important; }
}

/* ================================================================ */
/* 1. 인트로                                                         */
/* ================================================================ */
.scr-intro {
  position: fixed; inset: 0; z-index: 1;
  overflow: hidden;
  color: #fff;
  background: radial-gradient(ellipse at 50% 58%, #26204a 0%, #100d22 50%, #050409 100%);
  cursor: pointer;
  user-select: none; -webkit-user-select: none;
}
.scr-intro-story {
  position: absolute; left: 0; right: 0; top: 24%;
  padding: 0 20px;
  text-align: center;
  transition: opacity .8s ease, transform .8s ease;
}
.scr-intro-l1, .scr-intro-l2 {
  opacity: 0; transform: translateY(10px);
  transition: opacity 1s ease, transform 1s ease;
  font-weight: 900;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .6);
}
.scr-intro-l1 { font-size: clamp(24px, 3.6vw, 40px); color: #ffe9a8; margin-bottom: 10px; }
.scr-intro-l2 { font-size: clamp(24px, 4.3vw, 50px); transition-delay: 1.2s; }
.s0 .scr-intro-l1, .s0 .scr-intro-l2 { opacity: 1; transform: none; }
.s2 .scr-intro-story { opacity: 0; transform: translateY(-24px); }

.scr-intro-jamos { position: absolute; inset: 0; pointer-events: none; }
.scr-intro-jamo {
  position: absolute;
  top: 58%;
  left: calc(50% + var(--k) * 1.25em);
  font-size: clamp(40px, 8vmin, 88px);
  font-weight: 900; line-height: 1;
  color: #ffd766;
  text-shadow: 0 0 10px rgba(255, 215, 90, .95), 0 0 30px rgba(245, 184, 46, .85);
  opacity: 0;
  transform: translate(-50%, -50%) scale(.3);
  transition: left 1.7s cubic-bezier(.2, .8, .2, 1), top 1.7s cubic-bezier(.2, .8, .2, 1), opacity .7s ease, transform .8s var(--ease-pop);
  transition-delay: var(--d), var(--d), var(--d), var(--d);
}
.scr-intro-jamo i { display: inline-block; font-style: normal; }
.s1 .scr-intro-jamo { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.s1:not(.scatter) .scr-intro-jamo i { animation: scr-breathe 1.1s ease-in-out infinite; }
.scatter .scr-intro-jamo, .s2 .scr-intro-jamo {
  left: var(--x1); top: var(--y1);
  opacity: .55;
  transform: translate(-50%, -50%) scale(.72) rotate(var(--r));
  transition-delay: 0s;
}
.s2 .scr-intro-jamo i { animation: jh-float 3.2s ease-in-out infinite; animation-delay: var(--d); }

.scr-intro-cast {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: center; align-items: flex-start;
  pointer-events: none;
}
.scr-intro-sejong {
  position: relative;
  flex: none;
  height: min(60vh, 540px);
  aspect-ratio: 1086 / 1448;
  opacity: 0;
  transform: translateY(105%);
  transition: transform 1.1s cubic-bezier(.2, .8, .2, 1), opacity 1s ease;
}
.scr-intro-sejong img { width: 100%; height: 100%; object-fit: contain; object-position: bottom; filter: drop-shadow(0 0 30px rgba(255, 215, 120, .35)); }
.s2 .scr-intro-sejong { opacity: 1; transform: none; }
.scr-intro-say {
  flex: none;
  width: min(380px, 40vw);
  margin-left: calc(min(60vh, 540px) * -0.2);
  margin-top: calc(min(60vh, 540px) * 0.02);
  display: flex; flex-direction: column; align-items: flex-start; gap: 18px;
  pointer-events: auto;
}
.scr-intro-bubble {
  font-size: clamp(18px, 2.2vw, 24px);
  opacity: 0; transform: scale(.85); transform-origin: left center;
  transition: opacity .6s ease .7s, transform .6s var(--ease-pop) .7s;
}
.scr-intro-bubble::before, .scr-intro-bubble::after {
  content: ""; position: absolute; top: 50%; transform: translateY(-50%);
  border: 12px solid transparent; border-left: 0;
}
.scr-intro-bubble::before { left: -15px; border-right-color: var(--ink); }
.scr-intro-bubble::after { left: -10px; border-width: 9px; border-left: 0; border-right-color: #fff; }
.s2 .scr-intro-bubble { opacity: 1; transform: none; }
.scr-intro-start { opacity: 0; visibility: hidden; transition: opacity .5s ease, visibility 0s linear .5s; }
.s3 .scr-intro-start { opacity: 1; visibility: visible; transition: opacity .5s ease; animation: scr-pulse-btn 1.6s ease-in-out infinite; }
.scr-tap-hint {
  position: absolute; left: 0; right: 0; bottom: max(14px, env(safe-area-inset-bottom));
  text-align: center; font-size: 15px; font-weight: 700; color: rgba(255, 255, 255, .6);
  transition: opacity .5s;
}
.s2 .scr-tap-hint { opacity: 0; }

@media (max-width: 700px), (max-aspect-ratio: 4/5) {
  .scr-intro-story { top: 16%; }
  .scr-intro-cast { flex-direction: column; align-items: center; }
  .scr-intro-say { order: -1; width: auto; max-width: 440px; margin: 0 16px 10px; align-items: center; text-align: center; }
  .scr-intro-sejong { height: min(44vh, 420px); }
  .scr-intro-bubble { transform-origin: center bottom; }
  .scr-intro-bubble::before, .scr-intro-bubble::after { top: auto; left: 50%; transform: translateX(-50%); border: 12px solid transparent; border-bottom: 0; }
  .scr-intro-bubble::before { bottom: -15px; border-top-color: var(--ink); }
  .scr-intro-bubble::after { bottom: -10px; border-width: 9px; border-bottom: 0; border-top-color: #fff; }
}

/* ================================================================ */
/* 2. 메인                                                           */
/* ================================================================ */
.scr-main {
  position: relative;
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  overflow: hidden;
  background: linear-gradient(180deg, #1d2b4f 0%, #34497a 30%, #f3dfb5 70%, var(--bg) 100%);
}
/* 그림은 stage(그림과 같은 비율의 상자)에 그리고, 그림 속 글자 오류 덮개도 stage 안에 % 로 붙인다.
 * 가로 화면: stage 를 background 'center 18% / cover' 와 똑같이 배치 / 세로 화면: 폭 100%, 위쪽 맞춤. */
.scr-main-art { position: relative; overflow: hidden; }
.scr-main-stage {
  position: absolute; left: 0; top: 0; width: 100%;
  aspect-ratio: 1672 / 941;
  background: url('../assets/main.jpg') 0 0 / 100% 100% no-repeat;
  container-type: inline-size;
}
/* 현판 '접현전' → '집현전' */
.scr-main-sign {
  position: absolute;
  display: flex; align-items: center; justify-content: center;
  box-sizing: border-box;
  font-size: 12px;
  font-weight: 900; line-height: 1; white-space: nowrap;
  letter-spacing: .1em;
  padding-left: .1em;
  color: #f3c85e;
  text-shadow: 0 0 .25cqw rgba(0, 0, 0, .7);
  background: linear-gradient(180deg, #37323f 0%, #25212b 100%);
  border: 2px solid #8d5328;
  border: .2cqw solid #8d5328;
  border-radius: .15cqw;
  box-shadow: inset 0 0 0 .07cqw rgba(243, 200, 94, .45);
  pointer-events: none;
  user-select: none; -webkit-user-select: none;
}
.scr-main-panel {
  position: relative; z-index: 2;
  padding: 14px 16px 12px;
  background: rgba(255, 250, 240, .95);
  border: 4px solid var(--ink);
  border-radius: 24px;
  box-shadow: 0 6px 0 var(--ink), 0 18px 40px rgba(0, 0, 0, .35);
}
.scr-main-lead { text-align: center; font-size: 20px; font-weight: 900; margin-bottom: 10px; }
.scr-grade-row { display: flex; gap: 14px; }
.scr-grade {
  flex: 1 1 0; min-width: 0;
  display: flex; align-items: center; gap: 14px;
  min-height: 96px;
  padding: 10px 16px;
  text-align: left;
  border: 3px solid var(--ink);
  border-radius: 20px;
  box-shadow: 0 5px 0 var(--ink);
  transition: transform .08s ease, box-shadow .08s ease, filter .15s;
  touch-action: manipulation;
}
.scr-grade:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--ink); filter: brightness(1.03); }
.scr-grade:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.scr-grade-lower { background: linear-gradient(180deg, #e6f4ff 0%, #b9dcff 100%); }
.scr-grade-upper { background: linear-gradient(180deg, #ffeef3 0%, #ffc6d6 100%); }
.scr-grade.current { outline: 4px solid var(--gold); outline-offset: 2px; }
.scr-grade-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.scr-grade-name { font-size: 26px; font-weight: 900; }
.scr-grade-sub { font-size: 17px; font-weight: 800; color: var(--ink-2); }
.scr-grade-cont, .scr-grade-new {
  align-self: flex-start;
  margin-top: 4px; padding: 2px 10px;
  border-radius: 999px;
  font-size: 15px; font-weight: 900;
  background: var(--navy); color: #fff;
  white-space: nowrap;
}
.scr-grade-new { background: var(--gold); color: var(--ink); }
.scr-main-note { text-align: center; font-size: 14px; font-weight: 700; color: var(--ink-2); margin-top: 8px; }
.scr-main-menu { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
.scr-main-menu .btn { font-size: 15px; }

@media (min-aspect-ratio: 1/1) {
  .scr-main-art { position: absolute; inset: 0; container-type: size; }
  .scr-main-stage {
    left: 50%; top: 18%;
    width: max(100%, calc(100vh * 1672 / 941));
    width: max(100cqw, calc(100cqh * 1672 / 941));
    transform: translate(-50%, -18%);
  }
  .scr-main-panel {
    position: absolute; left: 50%; bottom: max(14px, 2.5vh);
    transform: translateX(-50%);
    width: min(94vw, 780px);
  }
}
@media (max-aspect-ratio: 1/1) {
  .scr-main-art { width: 100%; aspect-ratio: 1672 / 941; flex: none; }
  .scr-main-stage { left: 0; top: 0; width: 100%; transform: none; }
  .scr-main-panel { margin: -18px 12px 16px; }
}
@media (max-width: 560px) {
  .scr-grade-row { flex-direction: column; gap: 10px; }
  .scr-grade { min-height: 84px; }
  .scr-grade-name { font-size: 23px; }
  .scr-main-panel { padding: 12px 12px 10px; }
}
@media (min-aspect-ratio: 1/1) and (max-height: 520px) {
  .scr-main-panel { width: min(96vw, 760px); padding: 8px 12px; bottom: 8px; }
  .scr-main-lead, .scr-main-note { display: none; }
  .scr-grade { min-height: 70px; padding: 6px 12px; }
  .scr-grade .scr-face { width: 54px; height: 54px; }
  .scr-grade-name { font-size: 21px; }
  .scr-main-menu { margin-top: 6px; }
}

/* ================================================================ */
/* 3. 지도                                                           */
/* ================================================================ */
.scr-map { display: flex; flex-direction: column; min-height: calc(100vh - var(--hud-h)); min-height: calc(100dvh - var(--hud-h)); overflow-x: clip; }
.scr-map-bar {
  display: flex; align-items: center; gap: 10px;
  width: 100%; max-width: 1600px;
  margin: 0 auto;
  padding: 8px 12px 6px;
  min-height: 66px;
}
.scr-guide { display: flex; align-items: center; gap: 12px; flex: 1 1 auto; min-width: 0; }
.scr-guide .scr-face { width: 52px; height: 52px; }
.scr-guide-bubble { font-size: 17px; padding: 7px 14px; min-width: 0; }
.scr-guide-bubble small { font-size: 14px; color: var(--ink-2); font-weight: 700; }
.scr-guide-bubble::before, .scr-guide-bubble::after {
  content: ""; position: absolute; top: 50%; transform: translateY(-50%);
  border: 10px solid transparent; border-left: 0;
}
.scr-guide-bubble::before { left: -13px; border-right-color: var(--ink); }
.scr-guide-bubble::after { left: -8px; border-width: 7px; border-left: 0; border-right-color: #fff; }
.celebrate .scr-guide-bubble { background: var(--gold-soft); }
.scr-map-tools { display: flex; gap: 8px; flex: none; margin-left: auto; }
.scr-map-tools .btn { font-size: 16px; }
@media (max-width: 640px) {
  .scr-guide { display: none; }
  .scr-map-bar { min-height: 60px; justify-content: flex-end; }
}
@media (max-width: 400px) {
  .scr-map-tools .btn { padding: 6px 10px; font-size: 15px; }
}

.scr-map-view { flex: 1 1 auto; display: flex; flex-direction: column; }

/* 지도 보기 */
.scr-map-stage { display: flex; justify-content: center; align-items: flex-start; padding: 0 12px 12px; }
.scr-map-frame {
  position: relative;
  width: 100%;
  max-width: calc((100vh - var(--hud-h) - 94px) * 1.7768);
  max-width: calc((100dvh - var(--hud-h) - 94px) * 1.7768);
  aspect-ratio: 1672 / 941;
  border: 4px solid var(--ink);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: #bfe3a6;
  container-type: inline-size;
}
.scr-map-img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: fill; user-select: none; -webkit-user-drag: none; }
.scr-spot {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 48px; min-height: 48px;
  padding: 0;
  background: transparent;
  border: 3px solid transparent;
  border-radius: 22px;
  color: var(--ink);
  transition: background-color .2s, border-color .2s, box-shadow .2s;
  touch-action: manipulation;
}
.scr-spot:hover { background: rgba(255, 244, 200, .2); border-color: rgba(255, 255, 255, .85); box-shadow: 0 0 18px rgba(255, 240, 180, .55); }
.scr-spot:focus-visible { outline: 4px solid var(--blue); outline-offset: 0; border-color: #fff; background: rgba(255, 244, 200, .2); }
.scr-spot:active { background: rgba(255, 234, 160, .32); }
html.debug .scr-spot { border: 2px dashed red !important; }

.scr-spot-label {
  position: absolute; left: 50%; bottom: 3%;
  transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 3px;
  white-space: nowrap;
  padding: .12em .7em;
  background: rgba(255, 250, 240, .96);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 2px 0 var(--ink);
  font-size: 14px;
  font-size: clamp(11px, 1.3cqw, 18px);
  font-weight: 900; line-height: 1.35;
  pointer-events: none;
}
.scr-spot-label small { font-size: .82em; color: var(--ink-2); font-weight: 800; }
.scr-spot-label.small { font-size: 13px; font-size: clamp(10px, 1.1cqw, 15px); bottom: 6%; opacity: .92; }
.scr-spot.done .scr-spot-label { background: linear-gradient(180deg, #fff3c0, #ffd966); border-color: #7a4d00; }
.scr-ok { color: var(--green); font-weight: 900; }
.scr-spot.done::before {
  content: ""; position: absolute; inset: -6% -2% 4%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 219, 100, .55), rgba(255, 219, 100, .2) 60%, rgba(255, 219, 100, 0));
  animation: scr-breathe 2.8s ease-in-out infinite;
  pointer-events: none;
}
.scr-done-badge {
  position: absolute; right: 4%; top: 6%;
  padding: .1em .55em;
  background: var(--green); color: #fff;
  border: 2px solid #fff;
  border-radius: 999px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .3);
  font-size: 12px; font-size: clamp(10px, 1.05cqw, 15px);
  font-weight: 900;
  pointer-events: none;
}

.scr-spot-final.locked .scr-final-cover {
  position: absolute; inset: 12% 10% 18%;
  display: flex; align-items: center; justify-content: center;
  border-radius: 18px;
  background: rgba(20, 14, 32, .45);
  -webkit-backdrop-filter: grayscale(.85) brightness(.55);
  backdrop-filter: grayscale(.85) brightness(.55);
  font-size: 26px; font-size: clamp(18px, 3cqw, 44px);
  pointer-events: none;
}
@supports not ((backdrop-filter: grayscale(1)) or (-webkit-backdrop-filter: grayscale(1))) {
  .scr-spot-final.locked .scr-final-cover { background: rgba(20, 14, 32, .66); }
}
.scr-spot-final.locked .scr-spot-label { background: #3a3350; color: #fff; border-color: #1a1526; }
.scr-spot-final.open { border-color: rgba(255, 215, 90, .9); animation: scr-pulse-ring 1.8s ease-out infinite; }
.scr-spot-final.open .scr-spot-label { background: linear-gradient(180deg, #ffe27a, var(--gold)); }
.scr-spot-final.cleared { animation: none; border-color: rgba(255, 215, 90, .6); box-shadow: inset 0 0 18px rgba(255, 210, 80, .5); }
.celebrate .scr-spot-final.open { animation-duration: 1s; background: rgba(255, 230, 140, .25); }

.scr-spot-hall { opacity: .9; }
/* 좁은 지도(휴대폰 폭 등): 지도 그림에 이름 간판이 있으므로 이름만 있는 이름표는 숨기고
   완료 별·비밀문 상태처럼 짧은 정보만 남긴다. 가장자리에서 잘리거나 서로 겹치지 않게. */
@container (max-width: 560px) {
  .scr-spot-label .scr-lbl-long, .scr-spot-label.name-only { display: none; }
  .scr-spot-label { padding: .08em .5em; }
}
@supports not (container-type: inline-size) {
  @media (max-width: 640px) {
    .scr-spot-label .scr-lbl-long, .scr-spot-label.name-only { display: none; }
    .scr-spot-label { padding: .08em .5em; }
  }
}

.scr-egg { border-radius: 50%; min-width: 48px; min-height: 48px; }
.scr-egg-glint {
  position: absolute; right: 8%; top: 4%;
  font-size: 18px; font-size: clamp(13px, 1.8cqw, 26px);
  line-height: 1;
  color: #fffbe0;
  text-shadow: 0 0 6px #ffd766, 0 0 14px #f5b82e;
  animation: scr-twinkle 3.4s ease-in-out infinite;
  pointer-events: none;
}
.scr-egg.found .scr-egg-glint { animation: none; opacity: .35; }
@media (prefers-reduced-motion: reduce) { .scr-egg-glint { animation: none !important; opacity: .85; } }

/* 목록 보기 */
.scr-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%; max-width: 1100px;
  margin: 0 auto;
  padding: 4px 12px 24px;
}
@media (min-width: 640px) { .scr-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; } }
@media (min-width: 900px) { .scr-list { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.scr-card {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px;
  min-width: 0; min-height: 48px;
  padding: 10px 8px 12px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 20px;
  box-shadow: 0 5px 0 var(--ink);
  text-align: center;
  transition: transform .08s ease, box-shadow .08s ease;
  touch-action: manipulation;
}
.scr-card:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--ink); }
.scr-card:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.scr-card-icon { width: auto; height: 104px; max-width: 100%; object-fit: contain; filter: drop-shadow(0 3px 0 rgba(59, 36, 18, .2)); }
.scr-card-name { font-size: 20px; font-weight: 900; line-height: 1.25; }
.scr-card-game { font-size: 14px; font-weight: 700; color: var(--ink-2); line-height: 1.3; }
.scr-card-status {
  margin-top: 4px; padding: 2px 10px;
  border-radius: 999px;
  background: #fff; border: 2px solid var(--line);
  font-size: 14px; font-weight: 900;
  color: var(--ink-2);
}
.scr-card-status.done { background: var(--green-soft); border-color: var(--green); color: #1d5a2a; }
.scr-card-status.free { background: var(--sky); border-color: var(--blue); color: var(--blue); }
.scr-card-status.lock { background: #3a3350; border-color: #1a1526; color: #fff; }
.scr-card.done { background: linear-gradient(180deg, #fffbe8 0%, #ffeaa8 100%); }
.scr-card.done .scr-card-icon { filter: drop-shadow(0 0 10px rgba(245, 184, 46, .85)); }
.scr-card-final { grid-column: 1 / -1; flex-direction: row; justify-content: center; gap: 16px; padding: 10px 16px; }
.scr-card-gate { width: auto; height: 120px; object-fit: contain; }
.scr-card-final-text { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; }
.scr-card-final.locked .scr-card-gate { filter: grayscale(.8) brightness(.55); }
.scr-card-final.open { background: linear-gradient(180deg, #fff6d0, #ffd95e); animation: scr-pulse-ring 2s ease-out infinite; }
@media (max-width: 400px) {
  .scr-card-icon { height: 88px; }
  .scr-card-name { font-size: 18px; }
  .scr-card-game { font-size: 13px; }
  .scr-card-gate { height: 96px; }
}

/* 디버그 패널 */
.scr-debug {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  margin: 8px 12px 16px; padding: 10px;
  background: #fff0f0; border: 2px dashed var(--red); border-radius: 12px;
  font-size: 14px;
}
.scr-debug .btn { font-size: 14px; min-height: 40px; padding: 4px 10px; }

/* 이스터에그 모달 */
.scr-egg-body { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.scr-egg-big {
  display: flex; align-items: center; justify-content: center;
  width: 130px; height: 130px;
  font-size: 110px; font-weight: 900; line-height: 1;
  color: var(--gold-2);
  background: radial-gradient(circle, #fffbe6 0%, #fff1c4 60%, rgba(255, 241, 196, 0) 72%);
  border-radius: 50%;
  text-shadow: 0 0 18px rgba(245, 184, 46, .9);
  animation: jh-piece-in .8s var(--ease-pop) both;
}
.scr-egg-name { font-size: 22px; font-weight: 900; }
.scr-egg-desc { font-size: 18px; font-weight: 700; max-width: 440px; }
.scr-egg-reward { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.scr-egg-badge, .scr-egg-star {
  padding: 6px 14px; border: 2px solid var(--ink); border-radius: 999px;
  background: #fff; box-shadow: 0 3px 0 var(--ink); font-weight: 900;
}
.scr-egg-star { background: var(--gold-soft); color: #7a4d00; }

/* ================================================================ */
/* 4. 마지막 비밀문                                                  */
/* ================================================================ */
.scr-final { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 14px 16px 36px; }
.scr-final-title { font-size: 28px; font-weight: 900; }

/* 잠김 */
.scr-final-locked { display: flex; align-items: center; justify-content: center; gap: 24px; min-height: calc(100vh - var(--hud-h) - 60px); min-height: calc(100dvh - var(--hud-h) - 60px); }
.scr-gate { position: relative; flex: none; }
.scr-gate img { height: min(62vh, 480px); width: auto; }
.scr-gate.locked img { filter: grayscale(.8) brightness(.55); }
.scr-gate-lock {
  position: absolute; left: 50%; top: 62%;
  transform: translate(-50%, -50%);
  display: flex; align-items: center; justify-content: center;
  width: 84px; height: 84px;
  font-size: 46px;
  background: rgba(20, 14, 32, .7);
  border: 3px solid #fff3c4;
  border-radius: 50%;
}
.scr-final-info { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; max-width: 380px; }
.scr-final-msg { font-size: 22px; font-weight: 800; }
.scr-dots { display: flex; gap: 8px; }
.scr-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border: 3px dashed var(--ink-2); border-radius: 50%;
  font-weight: 900; color: #fff;
}
.scr-dot.on { border-style: solid; border-color: var(--ink); background: var(--green); }
@media (max-width: 700px) {
  .scr-final-locked { flex-direction: column; min-height: 0; gap: 16px; }
  .scr-gate img { height: min(40vh, 320px); }
}

/* ㄹ 조각 받기 */
.scr-gift { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); align-items: center; gap: 16px; min-height: calc(100vh - var(--hud-h) - 60px); min-height: calc(100dvh - var(--hud-h) - 60px); }
.scr-gift-gate img { height: min(56vh, 420px); width: auto; margin: 0 auto; filter: drop-shadow(0 0 24px rgba(245, 184, 46, .65)); }
.scr-gift-right { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.scr-sejong-box { position: relative; display: inline-block; }
.scr-sejong-img { height: min(44vh, 340px); width: auto; }
.scr-gift-bubble {
  position: absolute; left: 64%; top: 1%;
  width: max-content; max-width: min(320px, 44vw);
  font-size: 20px;
  animation: jh-fade-in .5s ease both;
}
.scr-gift-bubble::before, .scr-gift-bubble::after {
  content: ""; position: absolute; top: 40%; transform: translateY(-50%);
  border: 12px solid transparent; border-left: 0;
}
.scr-gift-bubble::before { left: -15px; border-right-color: var(--ink); }
.scr-gift-bubble::after { left: -10px; border-width: 9px; border-left: 0; border-right-color: #fff; }
.scr-gift-action { min-height: 64px; display: flex; flex-direction: column; align-items: flex-start; }
.scr-gift-reveal { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.scr-gift-text { font-size: 24px; font-weight: 900; }
.scr-gift-sub { font-size: 18px; font-weight: 700; color: var(--ink-2); }
@media (max-width: 760px) {
  .scr-gift { grid-template-columns: 1fr; min-height: 0; justify-items: center; }
  .scr-gift-gate { display: none; }
  .scr-gift-right { align-items: center; }
  .scr-sejong-box { display: flex; flex-direction: column; align-items: center; }
  .scr-gift-bubble { position: static; order: -1; margin-bottom: 14px; max-width: 320px; text-align: center; }
  .scr-gift-bubble::before, .scr-gift-bubble::after { top: auto; left: 50%; transform: translateX(-50%); border: 12px solid transparent; border-bottom: 0; }
  .scr-gift-bubble::before { bottom: -15px; border-top-color: var(--ink); }
  .scr-gift-bubble::after { bottom: -10px; border-width: 9px; border-bottom: 0; border-top-color: #fff; }
  .scr-sejong-img { height: min(34vh, 260px); }
  .scr-gift-action { align-items: center; }
}

/* 조립 퍼즐 */
.scr-puzzle-head { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.scr-puzzle-gate { flex: none; transition: filter .8s ease, transform .8s ease; }
.scr-puzzle-gate img { height: 128px; width: auto; filter: drop-shadow(0 0 12px rgba(245, 184, 46, .55)); }
.scr-puzzle-gate.open { transform: scale(1.08); filter: brightness(1.2) drop-shadow(0 0 22px rgba(255, 215, 90, .95)); }
.scr-puzzle-intro { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.scr-puzzle-lead { font-size: 20px; font-weight: 800; }
.grade-lower .scr-puzzle-lead { font-size: 22px; }
.scr-puzzle-tip { font-size: 15px; font-weight: 700; color: var(--ink-2); }
.scr-puzzle-tip.done { color: #1d5a2a; }

.scr-syls { display: flex; justify-content: center; flex-wrap: wrap; gap: 20px; }
.scr-syl {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 14px 12px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  transition: box-shadow .4s, border-color .4s;
}
.scr-syl-no { font-size: 14px; font-weight: 900; color: var(--ink-2); }
.scr-syl-slots { display: flex; gap: 8px; }
.scr-slot-cell { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.scr-slot { padding: 0; cursor: pointer; font-family: var(--font); line-height: 1; touch-action: manipulation; }
.scr-slot:hover:not(:disabled) { background: var(--gold-soft); }
.scr-slot.sel { outline: 4px solid var(--blue); outline-offset: 2px; background: var(--sky); }
.scr-slot.filled.gold { background: linear-gradient(180deg, #ffe27a 0%, var(--gold) 60%, var(--gold-2) 100%); color: #5a3300; }
.scr-slot.filled.stone { background: linear-gradient(180deg, #e2dfd8 0%, #b3ada3 100%); color: #4a4540; }
.scr-slot:disabled { cursor: default; opacity: 1; }
.scr-slot.scr-hint-glow { animation: scr-hint-glow 1.2s ease-in-out infinite; border-style: solid; border-color: var(--gold-2); background: #fff7d6; }
.scr-slot-label { font-size: 12px; font-weight: 800; color: var(--ink-2); white-space: nowrap; }
.scr-syl-arrow { font-size: 14px; color: var(--ink-2); line-height: 1; }
.scr-syl-preview {
  display: flex; align-items: center; justify-content: center;
  min-width: 92px; height: 88px; padding: 0 10px;
  font-size: 66px; font-weight: 900; line-height: 1;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: inset 0 3px 0 rgba(59, 36, 18, .08);
}
.scr-syl-preview.empty { color: #cdb99c; border-style: dashed; border-color: var(--line); }
.scr-syl-preview.partial { color: var(--ink-2); }
.scr-syls.win .scr-syl { border-color: var(--gold-2); box-shadow: 0 0 0 4px var(--gold), 0 0 30px rgba(245, 184, 46, .8); }
.scr-syls.win .scr-syl-preview { color: #7a4d00; background: var(--gold-soft); border-color: var(--gold-2); }

.scr-puzzle-feedback { min-height: 30px; margin: 12px 0 4px; text-align: center; font-size: 20px; font-weight: 900; }
.scr-puzzle-feedback.bad { color: #9b2320; }
.scr-puzzle-feedback.good { color: #1d5a2a; }
.scr-tray {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px;
  max-width: 760px; margin: 6px auto 0;
  padding: 14px;
  background: rgba(255, 255, 255, .5);
  border: 3px dashed var(--line);
  border-radius: 22px;
}
.scr-tile { font-family: var(--font); }
.scr-tile.used { visibility: hidden; }
.tile.scr-stone {
  background: linear-gradient(180deg, #e0ddd6 0%, #a9a49b 100%);
  color: #45403a;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .5), inset 0 -4px 0 rgba(60, 55, 50, .25), 0 4px 0 var(--ink);
}
.scr-puzzle-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 12px; }
.scr-puzzle-next { display: flex; justify-content: center; margin-top: 14px; }
@media (max-width: 600px) {
  .scr-puzzle-head { gap: 10px; }
  .scr-puzzle-gate img { height: 88px; }
  .scr-final-title { font-size: 23px; }
  .scr-puzzle-lead { font-size: 17px; }
  .grade-lower .scr-puzzle-lead { font-size: 19px; }
  .scr-puzzle-tip { display: none; }
  .scr-puzzle-tip.done { display: block; }
  .scr-syls { flex-direction: column; align-items: center; gap: 10px; }
  .scr-syl { flex-direction: row; flex-wrap: wrap; justify-content: center; column-gap: 8px; row-gap: 2px; padding: 6px 10px 8px; width: 100%; max-width: 360px; }
  .scr-syl-no { flex-basis: 100%; text-align: center; }
  .scr-syl-slots { gap: 5px; }
  .scr-slot { width: 56px; height: 56px; font-size: 30px; }
  .scr-slot-label { font-size: 11px; }
  .scr-syl-arrow { align-self: center; transform: rotate(-90deg); margin-bottom: 14px; }
  .scr-syl-preview { align-self: flex-start; height: 60px; font-size: 44px; min-width: 64px; }
  .scr-tray { gap: 9px; padding: 10px; }
  .scr-tray .tile { width: 58px; height: 58px; font-size: 32px; }
}

/* ================================================================ */
/* 5. 엔딩                                                           */
/* ================================================================ */
.scr-ending {
  position: fixed; inset: 0; z-index: 1;
  overflow: hidden;
  color: #fff;
  background: #07060d;
  cursor: pointer;
  user-select: none; -webkit-user-select: none;
}
.scr-end-bg {
  position: absolute; inset: -24px;
  background: linear-gradient(rgba(10, 8, 22, .5), rgba(10, 8, 22, .5)), url('../assets/main.jpg') center / cover no-repeat;
  filter: blur(7px) brightness(.6) saturate(1.1);
  opacity: 0;
  transition: opacity 1.6s ease;
}
.s2 .scr-end-bg { opacity: 1; }
.scr-end-glow {
  position: absolute; left: 50%; top: 50%;
  width: 70vmin; height: 70vmin;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 236, 170, .7), rgba(255, 200, 80, .3) 55%, rgba(255, 200, 80, 0));
  transform: translate(-50%, -50%) scale(.2);
  opacity: 0;
  transition: transform 2.4s ease-out, opacity 2s ease;
  pointer-events: none;
}
.s1 .scr-end-glow { transform: translate(-50%, -50%) scale(2.1); opacity: 1; }
.s2 .scr-end-glow { opacity: .35; }
.s6 .scr-end-glow { opacity: .3; }

.scr-end-gatebox {
  position: absolute; left: 50%; top: 50%;
  height: min(64vh, 540px);
  aspect-ratio: 1122 / 1402;
  transform: translate(-50%, -50%) scale(.92);
  opacity: 0;
  perspective: 900px;
  transition: opacity 1s ease, transform 2.4s cubic-bezier(.3, .6, .3, 1), filter 2s ease;
}
.scr-end-gatebox img { width: 100%; height: 100%; object-fit: contain; }
.s0 .scr-end-gatebox { opacity: 1; }
.s1 .scr-end-gatebox { transform: translate(-50%, -50%) scale(1.12); filter: drop-shadow(0 0 40px rgba(255, 210, 90, .8)); }
.s2 .scr-end-gatebox { opacity: 0; transform: translate(-50%, -50%) scale(1.5); }
.scr-door-light {
  position: absolute; left: 30.7%; top: 39.6%; width: 39.8%; height: 47.1%;
  background: radial-gradient(ellipse at 50% 55%, #fffdf0 0%, #ffe9a0 45%, #f5b82e 100%);
  opacity: 0;
  transition: opacity 1.4s ease .4s;
}
.s1 .scr-door-light { opacity: 1; }
.scr-door {
  position: absolute; top: 39.6%; width: 19.9%; height: 47.1%;
  background-image: url('../assets/final-gate.png');
  background-repeat: no-repeat;
  background-size: 502.5% 212.3%;
  backface-visibility: visible;
  transition: transform 1.9s cubic-bezier(.5, 0, .3, 1) .3s;
}
.scr-door.l { left: 30.7%; background-position: 38.33% 74.86%; transform-origin: left center; }
.scr-door.r { left: 50.6%; background-position: 63.17% 74.86%; transform-origin: right center; }
.s1 .scr-door.l { transform: rotateY(-100deg); }
.s1 .scr-door.r { transform: rotateY(100deg); }
.scr-ending.rm .scr-door { display: none; }

.scr-end-lines {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2.2vh;
  padding: 70px 16px 130px;
  text-align: center;
  pointer-events: none;
  background: radial-gradient(ellipse 46% 42% at 50% 46%, rgba(8, 6, 16, .5), rgba(8, 6, 16, 0));
  opacity: 0;
  transition: opacity 1s ease;
}
.s3 .scr-end-lines { opacity: 1; }
.scr-end-line { opacity: 0; transform: translateY(18px) scale(.96); transition: opacity .9s ease, transform .9s var(--ease-pop); }
.scr-end-cap { font-size: clamp(20px, 3vw, 32px); font-weight: 800; color: #fff3c4; text-shadow: 0 2px 10px rgba(0, 0, 0, .7); }
.scr-end-big {
  font-size: clamp(46px, 9vmin, 96px); font-weight: 900; line-height: 1.05;
  color: #fff;
  text-shadow: 0 4px 0 rgba(0, 0, 0, .35), 0 0 24px rgba(255, 215, 90, .7);
  letter-spacing: 2px;
}
.scr-end-big.gold { color: var(--gold); text-shadow: 0 4px 0 #6b4300, 0 0 30px rgba(255, 215, 90, .9); }
.s3 .scr-end-line.l1, .s4 .scr-end-line.l2, .s5 .scr-end-line.l3 { opacity: 1; transform: none; }
.s4 .scr-end-line.l1, .s5 .scr-end-line.l2 { opacity: .78; }
.s6 .scr-end-line { opacity: 1; transform: none; }
.scr-end-actions {
  position: absolute; left: 0; right: 0; bottom: max(24px, 5vh);
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px;
  padding: 0 16px;
  opacity: 0; visibility: hidden;
  transition: opacity .6s ease .8s, visibility 0s linear 1.4s;
}
.s6 .scr-end-actions { opacity: 1; visibility: visible; transition: opacity .6s ease .8s, visibility 0s linear .8s; }
.scr-end-actions .btn.primary { animation: scr-pulse-btn 1.6s ease-in-out 1.4s infinite; }
.scr-end-map { background: rgba(255, 250, 240, .9) !important; }
@media (max-height: 560px) {
  .scr-end-lines { gap: 4px; padding: 56px 16px 96px; }
  .scr-end-big { font-size: clamp(34px, 8vmin, 60px); }
  .scr-end-cap { font-size: 18px; }
}

/* ================================================================ */
/* 6. 수료증                                                         */
/* ================================================================ */
.scr-cert-page { width: 100%; max-width: 1240px; margin: 0 auto; padding: 12px 16px 28px; }
.scr-cert-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.scr-cert-h { font-size: 24px; font-weight: 900; }
.scr-name-card { max-width: 560px; margin: 6vh auto 0; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.scr-name-emoji { font-size: 56px; line-height: 1; }
.scr-name-title { font-size: 28px; font-weight: 900; }
.scr-name-lead { font-size: 20px; font-weight: 800; }
.scr-name-sub { font-size: 16px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.scr-cert-holder { display: flex; justify-content: center; }
.scr-cert {
  position: relative;
  width: 100%;
  max-width: max(520px, calc((100vh - 220px) * 1.3333));
  max-width: max(520px, calc((100dvh - 220px) * 1.3333));
  aspect-ratio: 1448 / 1086;
  background: url('../assets/certificate-bg.jpg') center / 100% 100% no-repeat;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  container-type: inline-size;
  color: var(--ink);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.scr-cert-body {
  position: absolute; left: 12%; right: 12%; top: 39%; bottom: 9.5%;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  text-align: center;
}
.scr-cert-title { font-size: 2.2cqw; font-weight: 900; color: #8a5a2c; letter-spacing: .3cqw; }
.scr-cert-nameline {
  display: flex; align-items: center; justify-content: center; gap: 1.4cqw;
  max-width: 100%;
  padding: 0 3cqw .3cqw;
  border-bottom: .25cqw solid #b98b4e;
}
.scr-cert-name { font-size: 5cqw; font-weight: 900; line-height: 1.15; white-space: nowrap; }
.scr-cert-team { font-size: 1.7cqw; font-weight: 900; color: #fff; background: var(--blue); padding: .35cqw 1.2cqw; border-radius: 99cqw; white-space: nowrap; }
.scr-cert-stats { display: flex; gap: 1.4cqw; }
.scr-cert-stat {
  display: flex; flex-direction: column; align-items: center;
  min-width: 15cqw;
  padding: .45cqw 1.4cqw;
  background: rgba(255, 255, 255, .72);
  border: .2cqw solid #d9b77f;
  border-radius: 1.2cqw;
  line-height: 1.3;
}
.scr-cert-stat small { font-size: 1.35cqw; font-weight: 800; color: var(--ink-2); }
.scr-cert-stat b { font-size: 2.2cqw; font-weight: 900; white-space: nowrap; }
.scr-cert-badges { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .5cqw .8cqw; max-width: 100%; font-size: 1.45cqw; font-weight: 800; }
.scr-cert-badges-label { color: var(--ink-2); }
.scr-cert-badge { padding: .12cqw .8cqw; background: #fff; border: .15cqw solid #d9b77f; border-radius: 99cqw; white-space: nowrap; }
.scr-cert-badge.none { color: var(--ink-2); }
.scr-cert-text { font-size: 1.75cqw; font-weight: 700; line-height: 1.55; max-width: 60cqw; }
.scr-cert-foot { display: flex; align-items: center; justify-content: center; gap: 3cqw; }
.scr-cert-date { font-size: 1.8cqw; font-weight: 800; }
.scr-seal {
  display: flex; align-items: center; justify-content: center;
  width: 6.4cqw; height: 6.4cqw;
  border: .45cqw solid #c62f2f;
  border-radius: .8cqw;
  color: #c62f2f;
  background: rgba(214, 69, 65, .06);
  box-shadow: inset 0 0 0 .22cqw rgba(198, 47, 47, .3);
  transform: rotate(-8deg);
  font-size: 1.85cqw; font-weight: 900; line-height: 1.05;
}
.scr-seal-text { writing-mode: vertical-rl; text-orientation: upright; letter-spacing: .05cqw; }
.scr-cert-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 16px; }
.scr-cert-reset { display: flex; justify-content: center; margin-top: 14px; }

@page cert { size: A4 landscape; margin: 0; }
@media print {
  body[data-screen="certificate"] { background: #fff !important; min-height: 0 !important; }
  body[data-screen="certificate"] #app { min-height: 0 !important; }
  body[data-screen="certificate"] #overlay-root,
  body[data-screen="certificate"] .no-print { display: none !important; }
  .scr-cert-page { page: cert; padding: 0 !important; margin: 0 !important; max-width: none !important; }
  .scr-cert-holder { animation: none !important; }
  .scr-cert {
    width: 277mm !important; max-width: none !important;
    margin: 1mm auto 0 !important;
    box-shadow: none !important; border-radius: 0 !important;
    break-inside: avoid; page-break-inside: avoid;
  }
}

/* ================================================================ */
/* 7. 교사용 정답표                                                  */
/* ================================================================ */
.scr-teacher { width: 100%; max-width: 1180px; margin: 0 auto; padding: 16px 16px 40px; }
.scr-pin-card { max-width: 460px; margin: 10vh auto 0; display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center; }
.scr-pin { letter-spacing: 10px; }
.scr-pin-back { margin-top: 6px; }
.scr-pin-help { font-size: 14px; font-weight: 700; line-height: 1.5; color: var(--ink-2); word-break: keep-all; overflow-wrap: anywhere; }
.scr-t-h1 { font-size: 26px; font-weight: 900; }
.scr-t-top {
  position: sticky; top: 0; z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 0;
  background: var(--bg);
  border-bottom: 3px solid var(--line);
}
.scr-t-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.scr-t-print-title { display: none; font-size: 20px; font-weight: 900; }
.scr-t-info { margin: 12px 0; font-size: 15px; font-weight: 700; color: var(--ink-2); }
.scr-t-grade { margin-top: 18px; }
.scr-t-h2 { font-size: 24px; font-weight: 900; padding: 6px 12px; background: var(--navy); color: #fff; border-radius: 12px; }
.scr-t-sec { margin-top: 16px; }
.scr-t-h3 { font-size: 20px; font-weight: 900; margin-bottom: 6px; }
.scr-t-h3 small { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.scr-t-h4 { font-size: 16px; font-weight: 900; margin: 8px 0 4px; color: var(--ink-2); }
.scr-t-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.scr-t-table { width: 100%; background: #fff; border: 2px solid var(--line); font-size: 15px; line-height: 1.4; }
.scr-t-table th, .scr-t-table td { padding: 6px 8px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.scr-t-table th { background: var(--paper-2); font-weight: 900; white-space: nowrap; }
.scr-t-table td .emoji { font-size: 22px; }
.scr-t-note { margin-top: 6px; font-size: 15px; font-weight: 700; background: var(--paper-2); border-radius: 8px; padding: 6px 10px; }
.scr-t-details summary { cursor: pointer; font-weight: 800; min-height: 40px; display: flex; align-items: center; }
.scr-t-err { color: var(--red); font-weight: 700; }
@media print {
  body[data-screen="teacher"] { background: #fff !important; }
  .scr-t-print-title { display: block; }
  .scr-t-top { position: static; }
  .scr-t-scroll { overflow: visible; }
  .scr-t-table { font-size: 11pt; }
  .scr-t-table tr { break-inside: avoid; page-break-inside: avoid; }
  .scr-t-h2, .scr-t-h3 { break-after: avoid; page-break-after: avoid; }
  .scr-t-h2 { background: #fff; color: #000; border: 2px solid #000; }
  .scr-t-details > p { display: block; }
}

/* ================================================================ */
/* 8. 배지 / 게임 방법 모달                                          */
/* ================================================================ */
.scr-badges-count { text-align: center; font-weight: 900; font-size: 18px; margin-bottom: 12px; color: var(--ink-2); }
.scr-badges { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.scr-badge {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 8px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: 0 3px 0 var(--ink);
  text-align: center;
}
.scr-badge.on { background: linear-gradient(180deg, #fffbe8, #ffefb8); }
.scr-badge-ic { font-size: 46px; line-height: 1.1; }
.scr-badge-name { font-size: 17px; font-weight: 900; }
.scr-badge-desc { font-size: 14px; font-weight: 700; color: var(--ink-2); line-height: 1.35; }
.scr-badge.locked { background: #efe6d6; border-style: dashed; border-color: #a38d77; box-shadow: none; }
.scr-badge.locked .scr-badge-ic { filter: grayscale(1) brightness(0); opacity: .22; }
.scr-badge.locked .scr-badge-name { color: #a38d77; letter-spacing: 3px; }
@media (max-width: 520px) {
  .scr-badges { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .scr-badge-ic { font-size: 40px; }
}

/* 기록 지우기 확인: 안전한 '취소'가 주 버튼, 지우기는 흰 바탕 + 빨간 테두리 */
.scr-reset-body { text-align: center; }
.scr-reset-sub { font-size: 16px; font-weight: 700; color: var(--ink-2); line-height: 1.5; }
.modal-actions .btn.scr-danger {
  background: #fff;
  color: #9b2320;
  border-color: var(--red);
  box-shadow: 0 4px 0 #9b2320;
}
.modal-actions .btn.scr-danger:hover { background: var(--red-soft); }
.modal-actions .btn.scr-danger:active { box-shadow: 0 1px 0 #9b2320; }

.scr-howto { display: flex; gap: 16px; align-items: flex-start; }
.scr-howto-cast { flex: none; padding-top: 4px; }
.scr-howto-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.scr-howto-bubble { font-size: 18px; }
.scr-howto-bubble::before, .scr-howto-bubble::after {
  content: ""; position: absolute; top: 50%; transform: translateY(-50%);
  border: 11px solid transparent; border-left: 0;
}
.scr-howto-bubble::before { left: -14px; border-right-color: var(--ink); }
.scr-howto-bubble::after { left: -9px; border-width: 8px; border-left: 0; border-right-color: #fff; }
.scr-steps { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.scr-steps li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 14px;
  font-size: 18px; font-weight: 800;
}
.scr-howto.lower .scr-steps li { font-size: 21px; }
.scr-step-no {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--navy); color: #fff;
  font-weight: 900; font-size: 17px;
}
.scr-step-ic { font-size: 26px; flex: none; }
.scr-howto-extra { font-size: 16px; font-weight: 800; color: var(--ink-2); }
@media (max-width: 560px) {
  .scr-howto { flex-direction: column; align-items: center; }
  .scr-howto-bubble::before, .scr-howto-bubble::after { display: none; }
  .scr-steps li { font-size: 17px; }
  .scr-howto.lower .scr-steps li { font-size: 19px; }
}
