/* GIQ-8 종합인지능력검사 — 지오넷 백오피스 디자인 시스템 이식 (gocode.ai.kr/order 참고).
   딥 네이비 + 앤틱 골드, html 20px 기준 rem, Pretendard.
   방송 화면에 그대로 나가는 페이지라 글자를 전반적으로 크게 잡는다. */
@font-face { font-family: Pretendard; font-weight: 400; src: url(/assets/fonts/Pretendard-Regular.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: Pretendard; font-weight: 500; src: url(/assets/fonts/Pretendard-Medium.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: Pretendard; font-weight: 600; src: url(/assets/fonts/Pretendard-SemiBold.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: Pretendard; font-weight: 800; src: url(/assets/fonts/Pretendard-ExtraBold.woff2) format('woff2'); font-display: swap; }

:root {
  --ink: #15212e;            /* 본문 — 딥 차콜 네이비 */
  --ink-soft: #42566b;
  --muted: #7d8ea0;
  --line: #e3e9f0;
  --line-soft: #edf1f6;
  --navy: #0b3d6e;           /* 메인 네이비 */
  --navy-deep: #082c50;
  --navy2: #155590;
  --mist: #eef3f8;
  --mist-soft: #f5f8fb;
  --gold: #b8905a;           /* 앤틱 골드 */
  --gold-deep: #997446;
  --gold-soft: #f6efe3;
  --bg: #f4f6f9;
  --card: #ffffff;
  --ok: #0e8a6b;
  --danger: #bb3a30;
  --danger-soft: #faedeb;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 2px 10px rgba(11,45,80,.06);
  --shadow: 0 10px 32px rgba(11,45,80,.10);
  --shadow-lg: 0 24px 64px rgba(8,44,80,.16);
}
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 20px; -webkit-text-size-adjust: 100%; }
@media (max-width: 900px) { html { font-size: 18px; } }
@media (max-width: 560px) { html { font-size: 17px; } }
body {
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg); color: var(--ink);
  letter-spacing: -.012em; word-break: keep-all; line-height: 1.55;
  padding: 22px 14px 48px;
}
button { font: inherit; cursor: pointer; border: none; letter-spacing: inherit; }
input { font: inherit; letter-spacing: inherit; }

.paper {
  max-width: 900px; margin: 0 auto; background: var(--card);
  border-radius: var(--radius-lg); overflow: hidden;
  border-top: 6px solid var(--navy);
  box-shadow: var(--shadow);
}

/* ── 헤더 ── */
.hd { display: flex; align-items: center; gap: 1rem; padding: 1.4rem 1.6rem 1.1rem; border-bottom: 2px solid var(--navy); background: #fff; }
.hd-mark {
  width: 66px; height: 66px; flex: 0 0 66px; border: 3px solid var(--navy); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.05rem; letter-spacing: .02em; color: var(--navy);
  background: repeating-conic-gradient(from 0deg, transparent 0 29deg, rgba(11,61,110,.06) 29deg 30deg);
}
.hd-title { flex: 1; min-width: 0; }
.hd-title h1 { font-size: clamp(1.15rem, 3.4vw, 1.5rem); font-weight: 800; color: var(--navy-deep); letter-spacing: -.02em; }
.hd-sub { font-size: .72rem; color: var(--muted); margin-top: .15rem; letter-spacing: .01em; }
.hd-meta { text-align: right; font-size: .62rem; color: var(--muted); }
.serial { font-family: 'SF Mono', ui-monospace, Consolas, monospace; font-size: .68rem; color: var(--navy); margin-top: 2px; letter-spacing: .04em; }
@media (max-width: 560px) { .hd-meta { display: none; } }

/* ── 진행바 + 전체 제한시간 ── */
.progress-wrap { padding: .85rem 1.6rem 0; background: var(--mist-soft); }
.progress-label { display: flex; justify-content: space-between; align-items: center; gap: .7rem; font-size: .82rem; font-weight: 700; color: var(--navy); margin-bottom: .45rem; flex-wrap: wrap; }
.gtimer {
  margin-left: auto; background: var(--navy); color: #fff; border-radius: 999px;
  padding: .28rem .95rem; font-size: .95rem; font-weight: 800;
  font-variant-numeric: tabular-nums; letter-spacing: .03em;
  box-shadow: 0 6px 18px rgba(11,61,110,.24);
}
.gtimer.low { background: var(--danger); box-shadow: 0 6px 18px rgba(187,58,48,.3); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .75; } }
#progTimer { font-variant-numeric: tabular-nums; color: var(--danger); font-size: .95rem; font-weight: 800; }
.progress-bar { height: 7px; background: #e0e7ef; border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--navy), var(--navy2)); transition: width .35s ease; }

/* ── 본문 공통 ── */
#stage { padding: 1.5rem 1.6rem; min-height: 24rem; background: var(--mist-soft); }
@media (max-width: 560px) { #stage { padding: 1.1rem .8rem; } .hd { padding: 1.1rem 1rem .9rem; } .progress-wrap { padding: .8rem 1rem 0; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem 1.5rem; box-shadow: var(--shadow-sm); }
.sec-kicker { font-size: .72rem; font-weight: 800; color: var(--gold-deep); letter-spacing: .16em; text-transform: uppercase; }
.sec-title { font-size: clamp(1.35rem, 4vw, 1.7rem); font-weight: 800; color: var(--navy-deep); margin: .25rem 0 .6rem; letter-spacing: -.02em; }
.sec-desc { color: var(--ink-soft); font-size: 1rem; line-height: 1.65; }
.sec-desc b { color: var(--navy); }
.rule-box {
  margin: 1.1rem 0; padding: .9rem 1.05rem; background: var(--gold-soft); border-left: 4px solid var(--gold);
  border-radius: 0 12px 12px 0; font-size: .92rem; color: var(--ink-soft); line-height: 1.7;
}
.rule-box b { color: var(--navy); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--navy); color: #fff; font-size: 1.05rem; font-weight: 700;
  padding: .8rem 2.1rem; border-radius: 999px; letter-spacing: -.01em; line-height: 1.25;
  box-shadow: 0 8px 22px rgba(11,61,110,.24);
  transition: transform .12s ease, background .15s;
}
.btn:hover { background: var(--navy-deep); transform: translateY(-1px); }
.btn:active { transform: scale(.97); }
.btn.ghost { background: #fff; color: var(--navy); border: 1.5px solid var(--line); box-shadow: none; }
.btn.ghost:hover { border-color: var(--navy2); color: var(--navy2); background: var(--mist-soft); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.center { text-align: center; }
.mt { margin-top: 1.3rem; }

/* ── 시작 화면 ── */
.intro-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .6rem; margin: 1.2rem 0; }
.intro-cell { background: var(--mist-soft); border: 1px solid var(--line); border-radius: 12px; padding: .75rem .9rem; }
.intro-cell .no { font-size: .66rem; font-weight: 800; color: var(--gold-deep); letter-spacing: .06em; }
.intro-cell .nm { font-weight: 800; color: var(--navy-deep); font-size: .95rem; margin-top: .1rem; }
.intro-cell .dm { font-size: .72rem; color: var(--muted); }
.name-row { display: flex; gap: .6rem; margin-top: 1.2rem; flex-wrap: wrap; }
.name-row input {
  flex: 1; min-width: 220px; font-size: 1.05rem; padding: .7rem .95rem;
  border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.name-row input:focus { outline: none; border-color: var(--navy2); box-shadow: 0 0 0 3px rgba(21,85,144,.14); }
.name-row input::placeholder { color: #a8b6c6; }

/* ── 문항 ── */
.q-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .85rem; }
.q-no { font-size: .8rem; font-weight: 800; color: var(--gold-deep); letter-spacing: .08em; }
.q-text { font-size: clamp(1.1rem, 3vw, 1.25rem); font-weight: 600; color: var(--ink); margin-bottom: 1.15rem; line-height: 1.6; }
.q-pair { font-size: clamp(1.5rem, 4.6vw, 1.9rem); font-weight: 800; color: var(--navy-deep); text-align: center; margin: 1rem 0 1.4rem; letter-spacing: -.02em; }
.q-pair .tie { color: var(--gold); margin: 0 .8rem; font-weight: 400; }
.opts { display: grid; gap: .6rem; }
.opt {
  text-align: left; font-size: 1.05rem; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: .9rem 1.05rem;
  display: flex; gap: .75rem; align-items: center; line-height: 1.5;
  transition: border-color .12s, background .12s, box-shadow .12s;
}
.opt:hover { border-color: var(--navy2); background: var(--mist-soft); box-shadow: var(--shadow-sm); }
.opt .marker {
  flex: 0 0 1.7rem; width: 1.7rem; height: 1.7rem; border-radius: 50%; border: 1.5px solid var(--navy);
  color: var(--navy); font-size: .8rem; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.opts.grid2 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.opts.grid3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 620px) { .opts.grid3 { grid-template-columns: repeat(2, 1fr); } }
.opt.sym { justify-content: center; font-size: 1.5rem; letter-spacing: .1em; padding: 1rem .3rem; }
.opt.sym .marker { display: none; }

/* ── 행렬추론 ── */
.matrix { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; max-width: 480px; margin: 0 auto 1.4rem; }
.mcell {
  aspect-ratio: 1; background: #fff; border: 1.5px solid var(--line); border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(1.4rem, 5.4vw, 2rem); letter-spacing: .08em; color: var(--ink);
  text-align: center; line-height: 1.25; padding: .2rem; word-break: break-all;
}
.mcell.qm { background: var(--gold-soft); color: var(--gold-deep); font-size: 2.4rem; font-weight: 800; border: 2px dashed var(--gold); }

/* ── 무게비교 ── */
.scales { display: grid; gap: .7rem; max-width: 540px; margin: 0 auto 1.3rem; }
.scale-row {
  display: grid; grid-template-columns: 1fr 2.6rem 1fr; align-items: center;
  background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: .9rem .7rem;
}
.scale-row.qrow { border: 2px solid var(--gold); background: var(--gold-soft); }
.pan { text-align: center; font-size: clamp(1.3rem, 4.2vw, 1.7rem); letter-spacing: .12em; }
.beam { text-align: center; font-size: 1.4rem; color: var(--navy); }
.pan .qmark { color: var(--gold-deep); font-weight: 800; }

/* ── 숫자/순서화 플래시 ── */
.flash-zone { min-height: 13rem; display: flex; align-items: center; justify-content: center; }
.flash-char { font-size: clamp(4.5rem, 18vw, 7rem); font-weight: 800; color: var(--navy-deep); font-variant-numeric: tabular-nums; }
.entry-view {
  min-height: 3.4rem; background: #fff; border: 1.5px solid var(--line); border-radius: 14px;
  font-size: 1.8rem; font-weight: 800; letter-spacing: .3em; text-align: center; padding: .55rem;
  color: var(--navy-deep); margin-bottom: .9rem; font-variant-numeric: tabular-nums;
}
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; max-width: 400px; margin: 0 auto; }
.pad button {
  font-size: 1.4rem; font-weight: 700; padding: .8rem 0;
  background: #fff; border: 1.5px solid var(--line); border-radius: 14px; color: var(--ink);
}
.pad button:active { background: var(--mist); }
.pad button:disabled { opacity: .35; }
.pad button.fn { font-size: .92rem; color: var(--navy); font-weight: 800; background: var(--mist-soft); }
.pad.wide { grid-template-columns: repeat(4, 1fr); max-width: 480px; }

/* ── 산수 ── */
.ar-input-row { display: flex; gap: .6rem; max-width: 440px; margin: 0 auto; }
.ar-input-row input {
  flex: 1; min-width: 0; font-size: 1.5rem; font-weight: 700; text-align: center;
  padding: .7rem; border: 1.5px solid var(--line); border-radius: 14px; background: #fff;
  font-variant-numeric: tabular-nums; transition: border-color .15s, box-shadow .15s;
}
.ar-input-row input:focus { outline: none; border-color: var(--navy2); box-shadow: 0 0 0 3px rgba(21,85,144,.14); }

/* ── 동형찾기 ── */
.ss-board { display: grid; grid-template-columns: auto 1fr; gap: .7rem; align-items: stretch; margin-bottom: 1.1rem; }
.ss-box { background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: .9rem; text-align: center; }
.ss-box .lb { font-size: .66rem; font-weight: 800; color: var(--muted); letter-spacing: .1em; margin-bottom: .5rem; }
.ss-syms { font-size: clamp(1.6rem, 5vw, 2.2rem); letter-spacing: .45em; white-space: nowrap; }
.ss-target { border-color: var(--navy2); background: var(--mist-soft); }
.ss-btns { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; max-width: 480px; margin: 0 auto; }
.ss-btns .btn { font-size: 1.2rem; padding: .95rem 0; }
.ss-count { text-align: center; font-size: .78rem; color: var(--muted); margin-top: .8rem; }
@media (max-width: 520px) { .ss-board { grid-template-columns: 1fr; } .ss-syms { letter-spacing: .3em; } }

/* ── 결과 리포트 ──
   FSIQ 히어로 — 방송 화면에서 한눈에 읽히도록 네이비 패널 + 초대형 흰 숫자 */
.rp-band {
  text-align: center; padding: 1.6rem 1rem 1.7rem; margin: -.4rem -.3rem 0;
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.rp-band::after { /* 은은한 골드 링 워터마크 */
  content: ''; position: absolute; right: -3rem; top: -3rem; width: 12rem; height: 12rem;
  border: 2px solid rgba(184,144,90,.28); border-radius: 50%; pointer-events: none;
}
.rp-band .rp-name { font-size: 1rem; font-weight: 700; color: rgba(255,255,255,.78); letter-spacing: .02em; }
.rp-fsiq {
  font-size: clamp(6.5rem, 26vw, 11rem); font-weight: 800; color: #fff; line-height: 1.02;
  font-variant-numeric: tabular-nums; letter-spacing: -.045em;
  text-shadow: 0 6px 30px rgba(0,0,0,.35);
}
.rp-class {
  display: inline-block; margin-top: .5rem; padding: .5rem 1.6rem; border-radius: 999px;
  background: var(--gold); color: #fff; font-weight: 800; font-size: 1.15rem; letter-spacing: .05em;
  box-shadow: 0 8px 22px rgba(0,0,0,.28);
}
.rp-ci { font-size: .85rem; color: rgba(255,255,255,.72); margin-top: .85rem; }
.rp-section-title {
  font-size: .95rem; font-weight: 800; color: var(--navy-deep); letter-spacing: -.01em;
  border-bottom: 2px solid var(--navy); padding-bottom: .35rem; margin: 1.9rem 0 .9rem;
  display: flex; justify-content: space-between; align-items: baseline;
}
.rp-section-title small { font-weight: 600; color: var(--muted); font-size: .62rem; letter-spacing: .08em; }
.idx-row { display: grid; grid-template-columns: 6rem 1fr 3rem; gap: .6rem; align-items: center; margin-bottom: .65rem; }
.idx-row .nm { font-size: .88rem; font-weight: 800; color: var(--ink); }
.idx-row .nm small { display: block; font-weight: 600; color: var(--muted); font-size: .58rem; letter-spacing: .05em; }
.idx-track { height: 1.35rem; background: var(--mist); border-radius: 8px; overflow: hidden; position: relative; }
.idx-fill { height: 100%; width: 0; border-radius: 8px; background: linear-gradient(90deg, var(--navy), var(--navy2)); transition: width .9s cubic-bezier(.2,.7,.3,1); }
.idx-mid { position: absolute; left: 50%; top: 0; bottom: 0; width: 1.5px; background: rgba(8,44,80,.22); }
.idx-val { font-size: 1.1rem; font-weight: 800; color: var(--navy-deep); text-align: right; font-variant-numeric: tabular-nums; }
.curve-wrap { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: .9rem .6rem .4rem; }
.curve-wrap svg { display: block; width: 100%; height: auto; }
table.rp-table { width: 100%; border-collapse: collapse; font-size: .9rem; background: #fff; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm); }
.rp-table th { background: var(--navy); color: #fff; font-weight: 700; padding: .6rem .5rem; font-size: .74rem; letter-spacing: .05em; }
.rp-table td { padding: .6rem .5rem; text-align: center; border-top: 1px solid var(--line-soft); font-variant-numeric: tabular-nums; }
.rp-table td.l { text-align: left; font-weight: 700; }
.rp-table tr.me td { background: var(--gold-soft); font-weight: 800; color: var(--navy-deep); }
.rank-medal { font-size: 1rem; }
.rp-foot { font-size: .68rem; color: var(--muted); margin-top: .9rem; line-height: 1.75; }

/* ── 인터스티셜(준비/채점) ── */
.ready-big { font-size: clamp(2.6rem, 10vw, 4.2rem); font-weight: 800; color: var(--navy-deep); text-align: center; padding: 3rem 0; letter-spacing: -.02em; }

/* ── 푸터 ── */
.ft { border-top: 1px solid var(--line); padding: .85rem 1.6rem 1.1rem; font-size: .62rem; color: var(--muted); line-height: 1.7; background: #fff; }

.fade-in { animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── 주관식(공통성·어휘·이해) ── */
.name-row input.age { flex: 0 0 7.5rem; min-width: 7.5rem; text-align: center; }
.start-note { font-size: .8rem; color: var(--muted); margin-top: .6rem; min-height: 1.2em; }
.q-pair.subjq { font-size: clamp(1.3rem, 4vw, 1.65rem); }
.subj-input {
  width: 100%; font: inherit; font-size: 1.1rem; line-height: 1.6; color: var(--ink);
  padding: .85rem 1rem; border: 1.5px solid var(--line); border-radius: 14px; background: #fff;
  resize: vertical; letter-spacing: inherit; word-break: keep-all;
  transition: border-color .15s, box-shadow .15s;
}
.subj-input:focus { outline: none; border-color: var(--navy2); box-shadow: 0 0 0 3px rgba(21,85,144,.14); }
.subj-input::placeholder { color: #a8b6c6; }

.grading { display: flex; align-items: center; justify-content: center; gap: .7rem;
  font-size: 1.15rem; font-weight: 700; color: var(--navy-deep); padding: 2.2rem 0 1.2rem; }
.grading-spin {
  width: 1.4rem; height: 1.4rem; border-radius: 50%;
  border: 3px solid var(--mist); border-top-color: var(--navy); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.judge-label { font-size: .8rem; font-weight: 800; color: var(--gold-deep); letter-spacing: .14em; margin-top: 1rem; }
.judge-score { font-size: clamp(3.2rem, 11vw, 4.6rem); font-weight: 800; line-height: 1.15; letter-spacing: -.02em; }
.judge-score small { font-size: .35em; font-weight: 700; color: var(--muted); margin-left: .3rem; }
.judge-score.j2 { color: var(--navy); }
.judge-score.j1 { color: var(--gold-deep); }
.judge-score.j0 { color: var(--danger); }
.judge-reason { font-size: 1rem; color: var(--ink-soft); max-width: 34rem; margin: .4rem auto 0; }
