/* 페이지별 스타일 (n·q·f·b·m·홈) */

/* ---------- 연습장 계산 (n) ---------- */
.note {
  position: relative;
  background-color: var(--white);
  background-image: linear-gradient(90deg, transparent 38px, var(--margin) 38px, var(--margin) 39.5px, transparent 39.5px),
    linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 100% 100%, 20px 20px, 20px 20px;
  border: var(--line);
  border-radius: 18px;
  box-shadow: 0 6px 0 var(--ink);
  padding: 16px 12px 18px 46px;
  overflow: hidden;
}
.note-head { display: flex; justify-content: space-between; font-size: 18px; color: var(--ink2); }
.names { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin: 14px 0 18px; font-size: 32px; }
.heart { width: 22px; height: 22px; flex: none; }
.pyr { display: flex; flex-direction: column; align-items: center; }
.pyr-row { display: flex; justify-content: center; position: relative; }
.cell { width: var(--cell); text-align: center; font-family: var(--f-hand); font-weight: 700; font-size: var(--fs); line-height: 1.15; letter-spacing: 0; visibility: hidden; }
.cell.in { visibility: visible; animation: cellIn 0.26s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
@keyframes cellIn { from { transform: scale(0.2); opacity: 0; } to { transform: none; opacity: 1; } }
.cell.letter { padding-bottom: 2px; }
.cell.letter b { display: block; font-weight: 700; }
.cell.letter i { display: block; height: 3px; width: 60%; margin: 0 auto; border-radius: 2px; }
.cell.a b { color: var(--hot); }
.cell.a i { background: var(--strawberry); }
.cell.b b { color: var(--sky-deep); }
.cell.b i { background: var(--sky); }
.cell.last { color: var(--red); }
.final-wrap { position: relative; display: inline-flex; padding: 2px 10px; }
.score-pop { font-family: var(--f-display); color: var(--red); text-align: center; margin-top: 8px; opacity: 0; transform: scale(0.6); transition: opacity 0.3s, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
.score-pop.in { opacity: 1; transform: none; }
.calc-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }

/* ---------- 결과 카드 (n) ---------- */
.result-card { text-align: center; padding: 26px 18px 18px; border-radius: 28px; }
.result-card .tape.l { left: 24px; top: -10px; transform: rotate(-7deg); }
.result-card .tape.r { right: 30px; top: -8px; transform: rotate(8deg); width: 60px; }
.score-area { position: relative; height: 130px; display: flex; align-items: center; justify-content: center; }
.score-num { position: relative; display: inline-flex; align-items: flex-end; padding: 4px 24px; }
.score-num .n { font-family: var(--f-display); font-size: 96px; line-height: 1.05; }
.score-num .u { font-family: var(--f-display); font-size: 28px; margin: 0 0 16px 2px; }
.score-area .stamp { position: absolute; right: -6px; top: 0; }
.tier { font-family: var(--f-display); font-size: 24px; margin-top: 4px; }
.line { font-size: 21px; margin-top: 6px; }
.wm { margin-top: 12px; }
.wbar { height: 16px; border: 2px solid var(--ink); border-radius: 999px; background: var(--white); overflow: hidden; margin-top: 6px; }
.wbar i { display: block; height: 100%; width: 2%; transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1); }
.wrow + .wrow { margin-top: 10px; }
.wrow .row { justify-content: space-between; font-weight: 700; font-size: 14px; }
.wrow .pct { font-family: var(--f-display); font-size: 17px; }
.proof { background-color: var(--paper); background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 20px 20px; border-radius: 10px; padding: 14px 8px; margin: 12px 0 10px; }
.proof .cell { visibility: visible; }
.linkbox { font-size: 12.5px; font-weight: 700; background: var(--paper-deep); border: 1.5px dashed var(--pencil); border-radius: 12px; padding: 10px 12px; word-break: break-all; color: var(--ink2); }
.mode-row { display: flex; gap: 8px; }

/* ---------- 모의고사 (q) ---------- */
.cover { border-radius: 14px; padding: 18px; }
.cover .rule2 { height: 3px; background: var(--ink); margin-top: 10px; }
.cover .rule1 { height: 1px; background: var(--ink); margin-top: 2px; }
.cover .rule1.b { margin-top: 14px; }
.cover .rule2.b { margin-top: 2px; }
.cover .yr { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; font-weight: 700; color: var(--ink2); }
.cover .odd { border: 1.6px solid var(--ink); padding: 2px 6px; font-weight: 800; color: var(--ink); font-size: 12px; }
.cover .subj { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 14px; }
.cover .gyo { background: var(--ink); color: var(--white); border-radius: 4px; padding: 4px 8px; font-weight: 800; font-size: 14px; flex: none; }
.cover .area { font-family: var(--f-display); font-size: 34px; line-height: 1.1; }
.cover .boxes { display: flex; gap: 8px; margin-top: 12px; }
.cover .box { flex: 1; display: flex; border: 1.4px solid var(--ink); height: 34px; }
.cover .box b { display: grid; place-items: center; padding: 0 6px; border-right: 1.4px solid var(--ink); font-size: 11.5px; }
.cover .box span { flex: 1; display: grid; place-items: center; font-size: 19px; }
.cover .rules { margin-top: 12px; font-size: 12px; color: var(--ink2); font-weight: 600; }
.cover .rules div { padding-top: 4px; }
.qnum { font-family: var(--f-display); font-size: 26px; flex: none; }
.qtext { font-size: 21px; font-weight: 800; line-height: 1.35; letter-spacing: -0.6px; }
.omr-sheet { background: var(--white); border: 1.6px solid rgba(255, 77, 94, 0.75); border-radius: 10px; padding: 8px 10px 10px; margin-top: 18px; }
.omr-sheet .head { display: flex; gap: 6px; align-items: baseline; color: var(--red); font-size: 11px; font-weight: 600; }
.omr-sheet .head b { font-size: 12px; }
.omr-sheet .cols { display: flex; margin-top: 6px; }
.omr-sheet .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0; border-radius: 6px; }
.omr-sheet .col.cur { background: var(--butter-soft); }
.omr-sheet .col > b { color: var(--red); font-size: 11px; }
.omr-sheet .dot { width: 12px; height: 15px; border-radius: 8px; border: 1.2px solid rgba(255, 77, 94, 0.75); }
.omr-sheet .dot.on { background: var(--ink); border-color: var(--ink); }
.grade-score { position: relative; height: 120px; display: flex; align-items: center; justify-content: center; }
.grade-score .num { text-align: center; color: var(--red); transition: opacity 0.3s; }
.grade-score .num .n { font-family: var(--f-display); font-size: 80px; line-height: 1.05; }
.grade-score .num .u { font-family: var(--f-display); font-size: 24px; }
.grade-score .dbl { width: 130px; height: 3px; background: var(--red); margin: 0 auto; box-shadow: 0 6px 0 var(--red); }
.grade-score .stamp { position: absolute; right: 2px; top: 6px; }
.grow-row { display: flex; gap: 8px; padding: 8px 0; align-items: flex-start; }
.grow-row + .grow-row { border-top: 1px dashed var(--grid); }
.mark { position: relative; width: 34px; height: 34px; flex: none; display: grid; place-items: center; font-family: var(--f-display); font-size: 18px; }
.mark svg { position: absolute; inset: 0; overflow: visible; }
.mark path { fill: none; stroke: var(--red); stroke-width: 3; stroke-linecap: round; transition: stroke-dashoffset 0.26s ease-out; }
.my-ans { font-weight: 800; font-size: 14.5px; }
.my-ans.wrong { color: var(--ink2); text-decoration: line-through; text-decoration-color: var(--red); }
.right-ans { color: var(--red); font-size: 19px; }

/* ---------- 동서남북 (f) ---------- */
.catcher-stage { display: grid; place-items: center; padding: 22px 0 12px; }
/* preserve-3d 를 쓰면 기울어진 날개가 안쪽 판 뒤로 파고들어서, 원근만 주고 그리기 순서는 DOM 순서대로 둔다 */
.catcher { position: relative; width: 248px; height: 248px; perspective: 600px; }
.catcher .inner { position: absolute; inset: 22px; border-radius: 18px; background: var(--white); border: 2px solid var(--ink); }
.catcher .num {
  position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--f-display); font-size: 20px; background: var(--paper-deep); border: 2px solid var(--ink); opacity: 0; transform: scale(0.4);
  transition: opacity 0.2s, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.catcher .num.show { opacity: 1; transform: none; }
.catcher .num.peek { opacity: 0.85; transform: scale(0.85); }
.catcher .num.pick { cursor: pointer; box-shadow: 0 3px 0 var(--ink); background: var(--butter); }
.catcher .num.pick:active { transform: translateY(3px); box-shadow: none; }
.flap {
  position: absolute; width: 50%; height: 50%; display: grid; place-items: center; border: 2.5px solid var(--ink);
  font-family: var(--f-display); font-size: 30px; transition: transform 0.32s cubic-bezier(0.34, 1.4, 0.64, 1);
  background-image: linear-gradient(135deg, transparent calc(50% - 1px), rgba(36, 34, 58, 0.35) calc(50% - 1px), rgba(36, 34, 58, 0.35) calc(50% + 1px), transparent calc(50% + 1px));
}
.flap.tl { left: 0; top: 0; border-radius: 22px 6px 6px 6px; background-color: var(--strawberry); }
.flap.tr { right: 0; top: 0; border-radius: 6px 22px 6px 6px; background-color: var(--butter); background-image: linear-gradient(45deg, transparent calc(50% - 1px), rgba(36, 34, 58, 0.35) calc(50% - 1px), rgba(36, 34, 58, 0.35) calc(50% + 1px), transparent calc(50% + 1px)); }
.flap.bl { left: 0; bottom: 0; border-radius: 6px 6px 6px 22px; background-color: var(--mint); background-image: linear-gradient(45deg, transparent calc(50% - 1px), rgba(36, 34, 58, 0.35) calc(50% - 1px), rgba(36, 34, 58, 0.35) calc(50% + 1px), transparent calc(50% + 1px)); }
.flap.br { right: 0; bottom: 0; border-radius: 6px 6px 22px 6px; background-color: var(--sky); }
.flap.pickable { cursor: pointer; }
.flap.pickable:active { filter: brightness(0.95); }
.catcher.open-v .flap.tl, .catcher.open-v .flap.tr { transform: translateY(-34px) rotateX(18deg); }
.catcher.open-v .flap.bl, .catcher.open-v .flap.br { transform: translateY(34px) rotateX(-18deg); }
.catcher.open-h .flap.tl, .catcher.open-h .flap.bl { transform: translateX(-34px) rotateY(-18deg); }
.catcher.open-h .flap.tr, .catcher.open-h .flap.br { transform: translateX(34px) rotateY(18deg); }
.count-bubble { text-align: center; font-size: 26px; min-height: 36px; }
.counts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.counts button { height: 48px; border: 2px solid var(--ink); border-radius: 14px; background: var(--white); font-family: var(--f-display); font-size: 20px; box-shadow: 0 3px 0 var(--ink); }
.counts button:active { transform: translateY(3px); box-shadow: none; }
.fortune-note { text-align: center; padding: 24px 18px; transform: rotate(-1.2deg); }
.fortune-note .msg { font-size: 26px; margin-top: 10px; }

/* ---------- 부적 (b) ---------- */
.envelope { text-align: center; padding: 28px 18px 22px; cursor: pointer; }
.envelope .seal { width: 64px; height: 64px; margin: 0 auto 10px; border-radius: 50%; background: var(--cinnabar); color: var(--white); display: grid; place-items: center; font-family: var(--f-display); font-size: 24px; border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink); }
.envelope.opening { animation: openEnv 0.5s ease-in forwards; }
@keyframes openEnv { to { transform: translateY(-30px) scale(0.92); opacity: 0; } }
.talisman {
  position: relative; margin: 0 auto; width: 100%; max-width: 300px; aspect-ratio: 3 / 5; border-radius: 14px; border: 2.5px solid var(--ink);
  box-shadow: 0 6px 0 var(--ink); padding: 12px; color: var(--cinnabar); text-align: center;
}
.talisman .frame { position: absolute; inset: 10px; border: 3px solid var(--cinnabar); border-radius: 8px; }
.talisman .frame::after { content: ''; position: absolute; inset: 5px; border: 1.5px solid var(--cinnabar); border-radius: 5px; }
.talisman .body { position: relative; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 20px 14px 18px; }
.talisman .kicker { font-family: var(--f-hand); font-weight: 700; font-size: 18px; letter-spacing: -0.05em; }
.talisman .main { font-family: var(--f-display); font-size: 52px; line-height: 1.08; white-space: pre-line; }
.talisman .sub { font-size: 12.5px; font-weight: 800; }
.talisman .wish { font-family: var(--f-hand); font-weight: 700; font-size: 19px; color: var(--ink); letter-spacing: -0.06em; }
.talisman .owner { display: flex; align-items: center; justify-content: center; gap: 10px; }
.talisman .owner b { font-family: var(--f-display); font-weight: 400; font-size: 20px; color: var(--ink); }
.talisman .seal-sq { width: 46px; height: 46px; border: 3px solid var(--cinnabar); border-radius: 6px; display: grid; place-items: center; font-family: var(--f-display); font-size: 15px; line-height: 1; transform: rotate(-6deg); padding: 2px; word-break: break-all; }
.talisman .chick { width: 64px; height: 64px; }
.talisman.reveal { animation: reveal 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
@keyframes reveal { from { transform: translateY(40px) rotate(-4deg) scale(0.9); opacity: 0; } to { transform: none; opacity: 1; } }
.save-overlay { position: fixed; inset: 0; background: rgba(36, 34, 58, 0.85); z-index: 80; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; gap: 12px; color: var(--white); }
.save-overlay img { max-height: 72vh; border-radius: 12px; border: 2px solid var(--white); }

/* ---------- 마니또 (m) ---------- */
.scratch-wrap { position: relative; border-radius: 16px; overflow: hidden; border: var(--line); background: var(--white); min-height: 150px; }
.scratch-wrap .secret { padding: 26px 16px; text-align: center; }
.scratch-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; transition: opacity 0.5s; }
.scratch-wrap canvas.gone { opacity: 0; pointer-events: none; }
.details { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

/* ---------- 홈 ---------- */
.hero { text-align: center; padding: 22px 16px 20px; }
.hero img { width: 120px; height: 120px; }
.games { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.game { padding: 12px; border-radius: 18px; box-shadow: 0 5px 0 var(--ink); }
.game .e { width: 42px; height: 42px; border-radius: 50%; background: var(--white); border: 2px solid var(--ink); display: grid; place-items: center; font-size: 21px; box-shadow: 0 2.5px 0 var(--ink); }
.game h3 { font-weight: 800; font-size: 15.5px; margin-top: 8px; }
.game p { margin: 2px 0 0; font-size: 12px; color: rgba(36, 34, 58, 0.75); }
.store-row { display: flex; gap: 10px; }
.store-row a { flex: 1; }

/* ---------- 정책 / 404 ---------- */
.policy h1 { font-size: 26px; }
.policy h2 { font-size: 16px; font-weight: 800; margin-top: 22px; }
.policy p, .policy li { font-size: 14px; color: var(--ink); }
.policy ul { padding-left: 18px; }
.policy li + li { margin-top: 8px; }
.policy code { background: var(--paper-deep); border-radius: 4px; padding: 0 4px; }
.oops h1 { font-size: 22px; margin-top: 8px; }
.oops .btn { margin-top: 14px; }
