/* ============ 한글 놀이터 2.0 — 공통 스타일 ============ */
:root {
  --ink: #3b2a1e;
  --ink-soft: #6b5442;
  --cream: #fff8e8;
  --paper: #fff3d6;
  --wood: #b5713a;
  --wood-dark: #7a4520;
  --sky: #7ec8ff;
  --pink: #ff7eb6;
  --yellow: #ffd23f;
  --orange: #ff9a3c;
  --green: #4fcf6a;
  --blue: #4aa3ff;
  --purple: #9b6bff;
  --red: #ff5a5f;
  --ok: #2fb35a;
  --bad: #e5484d;
  --font: 'Jua', 'Gowun Dodum', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --font-body: 'Gowun Dodum', 'Jua', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1d2440; font-family: var(--font); color: var(--ink); user-select: none; -webkit-user-select: none; touch-action: manipulation; }
#viewport { position: fixed; inset: 0; overflow: hidden; }
#stage { position: absolute; left: 0; top: 0; width: 1672px; height: 941px; transform-origin: 0 0; overflow: hidden; background: #8fd3ff; }
#screen, #fx, #overlay { position: absolute; inset: 0; }
#fx { pointer-events: none; z-index: 50; overflow: hidden; }
#overlay { z-index: 60; pointer-events: none; }
#overlay > * { pointer-events: auto; }
#rotate { display: none; position: fixed; inset: 0; z-index: 99; background: #1d2440; color: #fff; font-family: var(--font); font-size: 28px; text-align: center; padding-top: 40vh; line-height: 1.6; }
@media (orientation: portrait) and (max-width: 700px) { #rotate { display: block; } }
img { -webkit-user-drag: none; user-select: none; }
button { font-family: var(--font); cursor: pointer; border: 0; color: inherit; }
.paused *, .paused *::before, .paused *::after { animation-play-state: paused !important; }

/* ---------- 공통 화면 ---------- */
.scr { position: absolute; inset: 0; overflow: hidden; }
.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bg.soft { filter: saturate(1.15); }
.veil { position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(255,255,255,.18), rgba(30,20,60,.28)); }
.hotspot { position: absolute; background: transparent; border-radius: 40px; transition: transform .15s, box-shadow .2s; }
.hotspot:hover { box-shadow: 0 0 0 5px rgba(255,255,255,.75), 0 0 30px 8px rgba(255,240,150,.8); transform: scale(1.03); }
.hotspot:active { transform: scale(.97); }
.hotspot:focus-visible { outline: 5px solid #fff; }

/* ---------- 버튼 ---------- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 30px; font-size: 30px; border-radius: 26px; color: #fff; background: linear-gradient(#ffd75e, #ffb020); box-shadow: 0 7px 0 #c97a00, 0 12px 20px rgba(0,0,0,.25), inset 0 3px 0 rgba(255,255,255,.6); text-shadow: 0 2px 0 rgba(0,0,0,.25); transition: transform .08s, box-shadow .08s, filter .15s; white-space: nowrap; }
.btn:hover { filter: brightness(1.07); transform: translateY(-2px); }
.btn:active { transform: translateY(5px); box-shadow: 0 2px 0 #c97a00, 0 4px 10px rgba(0,0,0,.25), inset 0 3px 0 rgba(255,255,255,.6); }
.btn.green { background: linear-gradient(#7ee08a, #2fb35a); box-shadow: 0 7px 0 #1d7d3c, 0 12px 20px rgba(0,0,0,.25), inset 0 3px 0 rgba(255,255,255,.5); }
.btn.blue { background: linear-gradient(#7cc3ff, #2f86ef); box-shadow: 0 7px 0 #1b5bb0, 0 12px 20px rgba(0,0,0,.25), inset 0 3px 0 rgba(255,255,255,.5); }
.btn.pink { background: linear-gradient(#ffa3cc, #ff5fa2); box-shadow: 0 7px 0 #c2366f, 0 12px 20px rgba(0,0,0,.25), inset 0 3px 0 rgba(255,255,255,.5); }
.btn.purple { background: linear-gradient(#c3a2ff, #8456f0); box-shadow: 0 7px 0 #5531b3, 0 12px 20px rgba(0,0,0,.25), inset 0 3px 0 rgba(255,255,255,.5); }
.btn.gray { background: linear-gradient(#c9ced8, #8d95a6); box-shadow: 0 7px 0 #5e6576, 0 12px 20px rgba(0,0,0,.25), inset 0 3px 0 rgba(255,255,255,.5); }
.btn.cream { color: var(--ink); text-shadow: none; background: linear-gradient(#fffaf0, #f4e2bd); box-shadow: 0 7px 0 #c9a46a, 0 12px 20px rgba(0,0,0,.2), inset 0 3px 0 #fff; }
.btn.sm { font-size: 22px; padding: 9px 18px; border-radius: 18px; }
.btn.round { width: 74px; height: 74px; padding: 0; border-radius: 50%; font-size: 34px; }
.btn[disabled] { filter: grayscale(.8) brightness(.9); pointer-events: none; }

/* ---------- 패널/모달 ---------- */
.panel { background: var(--cream); border: 6px solid #e9c98f; border-radius: 34px; box-shadow: 0 0 0 6px var(--wood), 0 20px 40px rgba(0,0,0,.35), inset 0 0 30px rgba(233,201,143,.35); padding: 26px 34px; }
.modal-wrap { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(25,15,50,.55); animation: fadeIn .2s; z-index: 5; }
.modal { position: relative; min-width: 560px; max-width: 1180px; max-height: 860px; overflow: auto; animation: popIn .35s cubic-bezier(.2,1.6,.4,1); }
.modal h2 { margin: 0 0 16px; font-size: 44px; text-align: center; color: var(--wood-dark); }
.modal .close { position: absolute; right: 18px; top: 14px; width: 56px; height: 56px; border-radius: 50%; background: #ffe2e2; color: #c23; font-size: 30px; box-shadow: 0 4px 0 #e0a0a0; }
.row { display: flex; gap: 16px; align-items: center; }
.row.center { justify-content: center; }
.col { display: flex; flex-direction: column; gap: 14px; }
.title-ribbon { display: inline-block; padding: 8px 40px; font-size: 38px; color: #fff; background: linear-gradient(#ff8fb8, #ff5c95); border-radius: 18px; box-shadow: 0 6px 0 #c23a6c; text-shadow: 0 3px 0 rgba(0,0,0,.2); }

/* 설정 항목 */
.set-list { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 26px; font-size: 26px; }
.set-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; background: #fff; border-radius: 18px; padding: 12px 18px; box-shadow: inset 0 -3px 0 #f0dcb5; }
.set-item small { display: block; font-family: var(--font-body); font-size: 17px; color: var(--ink-soft); }
.toggle { width: 92px; height: 48px; border-radius: 30px; background: #d4d4d4; position: relative; flex: none; transition: background .2s; box-shadow: inset 0 3px 5px rgba(0,0,0,.2); }
.toggle::after { content: ''; position: absolute; left: 5px; top: 5px; width: 38px; height: 38px; border-radius: 50%; background: #fff; box-shadow: 0 3px 4px rgba(0,0,0,.25); transition: left .2s; }
.toggle.on { background: var(--green); }
.toggle.on::after { left: 49px; }
.toggle .tx { position: absolute; inset: 0; display: flex; align-items: center; font-size: 17px; color: #fff; padding: 0 12px; }
.seg { display: flex; background: #eadcc0; border-radius: 16px; padding: 4px; gap: 4px; flex: none; }
.seg button { font-size: 19px; padding: 8px 12px; border-radius: 12px; background: transparent; color: var(--ink-soft); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 3px 0 #d3b98a; }

/* ---------- 로딩 ---------- */
.loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 30px; background: linear-gradient(#9fdcff, #fff1c9); }
.loading img.logo { width: 560px; border-radius: 40px; animation: bob 2.4s ease-in-out infinite; -webkit-mask-image: radial-gradient(ellipse 72% 70% at center, #000 60%, transparent 100%); mask-image: radial-gradient(ellipse 72% 70% at center, #000 60%, transparent 100%); }
.loadbar { width: 620px; height: 38px; border-radius: 30px; background: #fff; box-shadow: inset 0 4px 8px rgba(0,0,0,.15), 0 0 0 5px var(--wood); overflow: hidden; }
.loadbar i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(-45deg, #ffd23f 0 20px, #ffb020 20px 40px); border-radius: 30px; transition: width .2s; animation: stripes 1s linear infinite; background-size: 56px 56px; }

/* ---------- 메인 ---------- */
.main-hint { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); font-family: var(--font-body); font-size: 18px; color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,.6); }
.main-sparkle { position: absolute; width: 90px; pointer-events: none; animation: twinkle 2s ease-in-out infinite; }
.saved-chip { position: absolute; left: 24px; top: 20px; background: rgba(255,255,255,.92); border-radius: 22px; padding: 8px 18px 8px 8px; font-size: 22px; display: flex; gap: 10px; align-items: center; box-shadow: 0 4px 0 rgba(0,0,0,.15); }
.saved-chip img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; }

/* ---------- 캐릭터 선택 ---------- */
.char-grid { position: absolute; left: 70px; right: 70px; top: 190px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.char-card { position: relative; background: #fff; border-radius: 34px; padding: 14px 14px 20px; text-align: center; box-shadow: 0 10px 0 rgba(0,0,0,.18), 0 0 0 6px #fff; cursor: pointer; transition: transform .2s, box-shadow .2s; }
.char-card:hover { transform: translateY(-8px) rotate(-1deg); }
.char-card.sel { box-shadow: 0 10px 0 rgba(0,0,0,.18), 0 0 0 8px var(--yellow), 0 0 40px 10px rgba(255,215,0,.7); transform: translateY(-12px) scale(1.04); }
.char-card .art { width: 100%; height: 330px; object-fit: cover; object-position: center 30%; border-radius: 24px; }
.char-card.sel .art { animation: hop .7s ease-in-out infinite; }
.char-card h3 { margin: 10px 0 2px; font-size: 40px; }
.char-card .type { display: inline-block; padding: 3px 16px; border-radius: 14px; color: #fff; font-size: 22px; }
.char-card p { margin: 8px 6px 0; font-family: var(--font-body); font-size: 19px; color: var(--ink-soft); line-height: 1.35; }
.char-card .acc { position: absolute; top: -4px; right: 8px; font-size: 54px; filter: drop-shadow(0 3px 2px rgba(0,0,0,.3)); }
.sub-note { font-family: var(--font-body); font-size: 20px; color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,.5); }

/* ---------- 월드맵 ---------- */
.island-hit { position: absolute; border-radius: 50%; cursor: pointer; }
.island-hit:hover + .isl-label, .isl-label:hover { transform: translate(-50%, -50%) scale(1.08); }
.island-hit:hover { background: radial-gradient(circle, rgba(255,255,220,.35), transparent 70%); }
.isl-label { position: absolute; transform: translate(-50%, -50%); width: 250px; padding: 6px 10px 8px; text-align: center; background: linear-gradient(#fffaf0, #f2dfba); border: 4px solid #c99558; border-radius: 22px; box-shadow: 0 6px 0 #8a5a2b, 0 10px 18px rgba(0,0,0,.3); cursor: pointer; transition: transform .2s; z-index: 2; }
.isl-label .nm { font-size: 27px; line-height: 1.15; }
.isl-label .num { position: absolute; left: -22px; top: -20px; width: 50px; height: 50px; border-radius: 50%; background: linear-gradient(#ff7d7d, #e0383e); color: #fff; font-size: 30px; display: flex; align-items: center; justify-content: center; border: 4px solid #fff; box-shadow: 0 3px 0 rgba(0,0,0,.25); }
.isl-label .st { font-size: 26px; letter-spacing: 2px; line-height: 1; margin-top: 3px; }
.isl-label .st b { color: #ffc107; text-shadow: 0 2px 0 #b27b00; font-weight: normal; }
.isl-label .st i { color: #c7bba4; font-style: normal; }
.isl-label .tag { position: absolute; right: -16px; top: -18px; padding: 2px 10px; border-radius: 12px; font-size: 18px; color: #fff; background: var(--blue); box-shadow: 0 3px 0 rgba(0,0,0,.2); }
.isl-label .tag.rec { background: var(--pink); animation: pulse 1.2s ease-in-out infinite; }
.isl-label.dim { filter: saturate(.55) brightness(.92); }
.isl-label.cur { border-color: #ffb300; box-shadow: 0 6px 0 #8a5a2b, 0 0 0 6px rgba(255,210,63,.9), 0 0 35px rgba(255,210,63,.9); }
.map-cover { position: absolute; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 30px; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.3); border-radius: 22px; }
.map-banner { position: absolute; left: 448px; top: 26px; width: 356px; height: 80px; display: flex; align-items: center; justify-content: center; font-size: 30px; color: var(--ink); background: linear-gradient(#fbecc8, #e9cf9a); border: 5px solid #a9743f; border-radius: 14px; box-shadow: 0 5px 0 #6d4420; }
.char-ring { position: absolute; border-radius: 30px; pointer-events: none; box-shadow: 0 0 0 7px var(--yellow), 0 0 30px 8px rgba(255,220,60,.9); animation: pulse 1.2s ease-in-out infinite; }
.big-char { position: absolute; left: 18px; top: 552px; width: 262px; height: 290px; border-radius: 40px; overflow: hidden; border: 7px solid #fff; box-shadow: 0 8px 18px rgba(0,0,0,.35); background: #bfe6ff; animation: hop 1.6s ease-in-out infinite; }
.big-char img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.big-name { position: absolute; left: 90px; top: 846px; min-width: 120px; padding: 4px 18px; text-align: center; border-radius: 18px; color: #fff; font-size: 30px; background: #e5484d; border: 4px solid #fff; box-shadow: 0 4px 0 rgba(0,0,0,.25); }
.acc-badge { position: absolute; font-size: 50px; pointer-events: none; filter: drop-shadow(0 3px 2px rgba(0,0,0,.35)); animation: bob 2s ease-in-out infinite; }

/* ---------- 게임 소개(난이도 선택) ---------- */
.intro { display: flex; align-items: center; justify-content: center; }
.intro .panel, .result .panel { position: relative; z-index: 1; }
.intro .panel { width: 1120px; display: grid; grid-template-columns: 430px 1fr; gap: 30px; align-items: start; }
.intro .logo { width: 100%; border-radius: 26px; -webkit-mask-image: radial-gradient(ellipse 75% 75% at center, #000 65%, transparent 100%); mask-image: radial-gradient(ellipse 75% 75% at center, #000 65%, transparent 100%); }
.intro h2 { font-size: 50px; color: var(--wood-dark); }
.intro h3 { margin: 4px 0 6px; font-size: 30px; color: var(--wood-dark); }
.intro p { margin: 0 0 8px; font-family: var(--font-body); font-size: 21px; line-height: 1.5; }
.lv-pick { display: flex; gap: 14px; margin: 10px 0 14px; }
.lv-pick button { flex: 1; padding: 14px 6px 12px; border-radius: 22px; background: #fff; font-size: 28px; box-shadow: 0 6px 0 #dcc395; border: 4px solid transparent; position: relative; }
.lv-pick button small { display: block; font-family: var(--font-body); font-size: 15px; color: var(--ink-soft); margin-top: 4px; }
.lv-pick button.on { border-color: var(--orange); background: #fff4dc; transform: translateY(-3px); }
.lv-pick button .rec { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font-size: 15px; padding: 2px 10px; border-radius: 10px; color: #fff; background: var(--pink); white-space: nowrap; }
.how { display: flex; gap: 12px; margin: 6px 0 4px; }
.how div { flex: 1; background: #fff; border-radius: 18px; padding: 10px; text-align: center; font-family: var(--font-body); font-size: 17px; box-shadow: inset 0 -3px 0 #f0dcb5; }
.how div b { display: block; font-family: var(--font); font-size: 38px; font-weight: normal; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip { font-family: var(--font-body); font-size: 16px; padding: 4px 12px; border-radius: 12px; background: #efe3c8; color: var(--ink-soft); }
.chip.on { background: #d9f5df; color: #1d7d3c; }

/* ---------- 게임 HUD ---------- */
.game .bg { transition: filter 1s; }
.game.hype .bg { filter: saturate(1.5) brightness(1.08) hue-rotate(-10deg); }
.game.fever .bg { animation: feverBg 1.6s linear infinite; }
.game .rays { position: absolute; left: 50%; top: 50%; width: 2400px; height: 2400px; margin: -1200px 0 0 -1200px; opacity: 0; pointer-events: none; background: repeating-conic-gradient(rgba(255,255,255,.18) 0 10deg, transparent 10deg 20deg); transition: opacity .6s; animation: spin 18s linear infinite; }
.game.hype .rays { opacity: .55; }
.game.fever .rays { opacity: 1; background: repeating-conic-gradient(rgba(255,240,120,.28) 0 10deg, rgba(255,120,200,.12) 10deg 20deg); animation-duration: 6s; }
.fever-frame { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s; box-shadow: inset 0 0 0 12px rgba(255,255,255,.0); }
.game.fever .fever-frame { opacity: 1; animation: rainbowFrame 1.2s linear infinite; }
.play { position: absolute; inset: 0; }
.hud-tl { position: absolute; left: 14px; top: 10px; display: flex; align-items: flex-start; gap: 14px; z-index: 20; pointer-events: none; }
.hud-tl > * { pointer-events: auto; }
.hud-logo { width: 240px; border-radius: 18px; -webkit-mask-image: radial-gradient(ellipse 75% 75% at center, #000 65%, transparent 100%); mask-image: radial-gradient(ellipse 75% 75% at center, #000 65%, transparent 100%); }
.mission { margin-top: 10px; max-width: 520px; padding: 10px 22px; font-size: 25px; background: linear-gradient(#fffaf0, #f4e4c1); border: 4px solid #c99558; border-radius: 18px; box-shadow: 0 5px 0 #8a5a2b; line-height: 1.25; }
.mission .tagm { display: inline-block; margin-right: 8px; padding: 0 10px; border-radius: 10px; background: var(--pink); color: #fff; font-size: 20px; vertical-align: 3px; }
.hud-tc { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); width: 400px; z-index: 20; display: none; }
.progress { position: absolute; left: 820px; top: 22px; width: 470px; height: 46px; z-index: 20; background: rgba(40,30,80,.55); border: 4px solid #fff; border-radius: 30px; box-shadow: 0 5px 0 rgba(0,0,0,.2); }
.progress .fill { position: absolute; left: 4px; top: 4px; bottom: 4px; width: 0; border-radius: 24px; background: linear-gradient(90deg, #7ee08a, #ffd23f); transition: width .5s cubic-bezier(.2,1.4,.4,1); }
.progress .runner { position: absolute; top: -14px; width: 66px; height: 66px; margin-left: -33px; border-radius: 50%; border: 4px solid #fff; overflow: hidden; box-shadow: 0 4px 6px rgba(0,0,0,.3); transition: left .5s cubic-bezier(.2,1.4,.4,1); left: 0; background: #fff; }
.progress .runner img { width: 100%; height: 100%; object-fit: cover; }
.progress .goal { position: absolute; right: -24px; top: -16px; font-size: 48px; filter: drop-shadow(0 3px 2px rgba(0,0,0,.3)); }
.progress .pct { position: absolute; right: 36px; top: 4px; color: #fff; font-size: 24px; text-shadow: 0 2px 0 rgba(0,0,0,.4); }
.progress.boss .fill { background: linear-gradient(90deg, #ff6b8b, #ff9a3c); }
.hud-tr { position: absolute; right: 16px; top: 14px; display: flex; gap: 12px; z-index: 20; }
.ibtn { width: 70px; height: 70px; border-radius: 22px; font-size: 34px; background: linear-gradient(#fff, #e9eef8); box-shadow: 0 6px 0 #9aa6c0, 0 8px 14px rgba(0,0,0,.25); display: flex; align-items: center; justify-content: center; transition: transform .1s; position: relative; }
.ibtn:active { transform: translateY(4px); box-shadow: 0 2px 0 #9aa6c0; }
.ibtn .lbl { position: absolute; bottom: -24px; font-size: 16px; color: #fff; text-shadow: 0 2px 2px rgba(0,0,0,.6); white-space: nowrap; }
.hud-bl { position: absolute; left: 18px; bottom: 18px; display: flex; gap: 14px; z-index: 20; }
.hud-bl .btn { font-size: 26px; padding: 10px 20px; }
.hud-bl .cnt { position: absolute; top: -10px; right: -10px; min-width: 34px; height: 34px; border-radius: 17px; background: var(--red); color: #fff; font-size: 20px; display: flex; align-items: center; justify-content: center; border: 3px solid #fff; }
.hud-br { position: absolute; right: 18px; bottom: 18px; z-index: 20; width: 230px; padding: 10px 14px 12px; border-radius: 24px; background: rgba(50,25,90,.72); border: 4px solid rgba(255,255,255,.85); color: #fff; box-shadow: 0 6px 0 rgba(0,0,0,.25); }
.hud-br .cb { display: flex; justify-content: space-between; align-items: baseline; font-size: 22px; }
.hud-br .cb b { font-size: 42px; font-weight: normal; color: var(--yellow); text-shadow: 0 3px 0 #b36b00; line-height: 1; }
.gauge { height: 20px; border-radius: 12px; background: rgba(255,255,255,.25); margin-top: 6px; overflow: hidden; }
.gauge i { display: block; height: 100%; width: 0; border-radius: 12px; background: linear-gradient(90deg, #ff7eb6, #ffd23f, #7ee08a, #4aa3ff, #9b6bff); background-size: 300% 100%; transition: width .4s; animation: gaugeFlow 2s linear infinite; }
.hud-br .score { font-size: 19px; margin-top: 6px; opacity: .9; display: flex; justify-content: space-between; }
.game.fever .hud-br { border-color: #ffd23f; box-shadow: 0 0 30px rgba(255,210,63,.9); }

.toast { position: absolute; left: 50%; bottom: 135px; transform: translateX(-50%); z-index: 40; max-width: 1000px; padding: 16px 30px; border-radius: 24px; background: #fff; font-size: 28px; text-align: center; box-shadow: 0 8px 0 rgba(0,0,0,.15), 0 10px 30px rgba(0,0,0,.25); animation: toastIn .35s cubic-bezier(.2,1.6,.4,1); line-height: 1.35; }
.toast.ok { background: #e8ffe9; border: 4px solid var(--ok); }
.toast.bad { background: #fff3e0; border: 4px solid var(--orange); }
.toast.info { background: #eef6ff; border: 4px solid var(--blue); }
.toast small { display: block; font-family: var(--font-body); font-size: 21px; color: var(--ink-soft); margin-top: 4px; }
.toast .mark { font-size: 30px; margin-right: 6px; }
.banner { position: absolute; left: 0; right: 0; top: 330px; height: 170px; z-index: 45; display: flex; align-items: center; justify-content: center; flex-direction: column; color: #fff; pointer-events: none; animation: bannerIn 1.9s ease-in-out forwards; background: linear-gradient(90deg, transparent, rgba(120,40,200,.85) 18%, rgba(255,80,160,.85) 82%, transparent); text-shadow: 0 4px 0 rgba(0,0,0,.3); }
.banner b { font-size: 76px; font-weight: normal; line-height: 1.05; }
.banner span { font-size: 30px; }
.banner.boss { background: linear-gradient(90deg, transparent, rgba(60,20,90,.92) 18%, rgba(160,40,90,.92) 82%, transparent); }
.banner.event { background: linear-gradient(90deg, transparent, rgba(255,150,0,.9) 18%, rgba(255,90,90,.9) 82%, transparent); }

/* 보스 체력 바 */
.boss-bar { position: absolute; right: 24px; top: 114px; width: 500px; z-index: 21; display: none; }
.boss-bar.show { display: block; animation: popIn .4s; }
.boss-bar .nm { font-size: 24px; color: #fff; text-shadow: 0 2px 3px rgba(0,0,0,.6); margin-left: 70px; }
.boss-bar .bar { height: 30px; margin-left: 60px; background: rgba(30,10,40,.7); border: 4px solid #fff; border-radius: 20px; overflow: hidden; }
.boss-bar .bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #ff4f7b, #ff9a3c); transition: width .5s; }
.boss-bar .face { position: absolute; left: 0; top: 0; width: 72px; height: 72px; border-radius: 50%; border: 4px solid #fff; object-fit: cover; background: #503070; }

/* ---------- 효과 ---------- */
.fx-badge { position: absolute; left: 50%; top: 44%; width: 380px; margin-left: -190px; transform: translateY(-50%); animation: badgePop 1.15s cubic-bezier(.2,1.5,.4,1) forwards; filter: drop-shadow(0 8px 12px rgba(0,0,0,.25)); }
.fx-badge.small { width: 250px; margin-left: -125px; }
.fx-badge.side { left: auto; right: 40px; top: 250px; margin-left: 0; width: 260px; animation-name: badgeSide; }
.fx-img { position: absolute; pointer-events: none; }
.fx-p { position: absolute; width: 46px; height: 46px; pointer-events: none; will-change: transform, opacity; }
.fx-text { position: absolute; font-size: 42px; color: #fff; pointer-events: none; text-shadow: 0 3px 0 rgba(0,0,0,.35), 0 0 12px rgba(255,180,0,.8); animation: floatUp 1s ease-out forwards; white-space: nowrap; }
.shake { animation: shake .4s; }

/* ---------- 결과 ---------- */
.result { display: flex; align-items: center; justify-content: center; }
.result .panel { width: 1460px; height: 820px; display: grid; grid-template-columns: 380px 1fr; gap: 30px; padding: 26px 32px; }
.res-left { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.res-left .who { width: 300px; height: 300px; border-radius: 40px; object-fit: cover; object-position: center 25%; box-shadow: 0 0 0 7px #fff, 0 0 0 12px var(--yellow); animation: victory 1.2s ease-in-out infinite; }
.res-stars { display: flex; gap: 6px; justify-content: center; margin-top: 8px; }
.res-stars .s { width: 92px; height: 92px; opacity: .25; filter: grayscale(1); transform: scale(.6); transition: all .4s cubic-bezier(.2,1.8,.4,1); }
.res-stars .s.on { opacity: 1; filter: none; transform: scale(1); }
.res-stars .s:nth-child(2) { transform: scale(.6) translateY(-16px); }
.res-stars .s:nth-child(2).on { transform: scale(1.12) translateY(-16px); }
.res-title { font-size: 46px; color: var(--wood-dark); margin: 0; }
.res-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.res-stats div { background: #fff; border-radius: 18px; padding: 10px; text-align: center; font-family: var(--font-body); font-size: 18px; box-shadow: inset 0 -3px 0 #f0dcb5; }
.res-stats b { display: block; font-family: var(--font); font-weight: normal; font-size: 40px; color: var(--ink); }
.res-right { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.res-box { background: #fff; border-radius: 20px; padding: 12px 18px; box-shadow: inset 0 -3px 0 #f0dcb5; }
.res-box h4 { margin: 0 0 6px; font-size: 25px; color: var(--wood-dark); }
.res-box p, .res-box li { font-family: var(--font-body); font-size: 19px; margin: 2px 0; line-height: 1.45; }
.res-box ul { margin: 0; padding-left: 22px; }
.wrong-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; overflow: auto; }
.wcard { background: #fffaf0; border: 3px dashed #e9c98f; border-radius: 18px; padding: 10px 12px; font-family: var(--font-body); font-size: 17px; line-height: 1.4; }
.wcard .w { color: var(--bad); text-decoration: line-through; font-family: var(--font); font-size: 22px; }
.wcard .r { color: var(--ok); font-family: var(--font); font-size: 22px; }
.wcard .why { color: var(--ink-soft); margin-top: 4px; }
.wcard .again { margin-top: 8px; padding-top: 8px; border-top: 2px dotted #e9c98f; }
.wcard .again .opts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.wcard .again button { font-size: 18px; padding: 5px 12px; border-radius: 12px; background: #eef3ff; box-shadow: 0 3px 0 #b9c6e8; }
.wcard .again button.ok { background: #d9f5df; box-shadow: 0 3px 0 #7cc58f; }
.wcard .again button.no { background: #ffe1e1; box-shadow: 0 3px 0 #e8a3a3; }
.rewards { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.reward { display: flex; align-items: center; gap: 8px; background: #fff4d6; border-radius: 16px; padding: 6px 14px 6px 6px; font-size: 21px; animation: popIn .5s backwards; }
.reward img { width: 48px; height: 48px; object-fit: contain; }
.reward .pc { width: 48px; height: 48px; border-radius: 12px; background: linear-gradient(#fff, #ffe9b0); box-shadow: 0 3px 0 #d6a84b; display: flex; align-items: center; justify-content: center; font-size: 30px; }
.res-btns { display: flex; gap: 16px; justify-content: flex-end; margin-top: auto; }

.res-total { width: 100%; padding: 8px 10px 6px; text-align: center; border-radius: 20px; background: linear-gradient(#4b3f8f, #6a4fd0); color: #fff; box-shadow: 0 5px 0 #2f2770; }
.res-total small { display: block; font-size: 18px; opacity: .9; }
.res-total b { display: block; font-size: 54px; font-weight: normal; line-height: 1.1; color: #ffe14d; text-shadow: 0 3px 0 #b36b00; }
.res-total.hi { animation: glowPulse 1s ease-in-out infinite; }
.res-row { display: grid; grid-template-columns: 1fr 1.05fr 1fr; gap: 12px; }
.res-calc div { display: flex; justify-content: space-between; font-family: var(--font-body); font-size: 16px; line-height: 1.45; }
.res-calc b { font-family: var(--font); font-weight: normal; color: #6a4fd0; }
.res-calc h4 small { font-size: 15px; color: var(--ink-soft); }
.res-rank { text-align: center; }
.res-rank p { font-size: 16px !important; }
.res-rank .btn { margin-top: 4px; }
.rk-big { font-size: 52px; line-height: 1; color: #6a4fd0; }
.rk-big small { font-size: 24px; }

/* ---------- 전국 순위 ---------- */
.rankscr .rk-head { position: absolute; left: 0; right: 0; top: 24px; text-align: center; }
.rk-tabs { position: absolute; left: 30px; top: 110px; width: 290px; display: flex; flex-direction: column; gap: 8px; }
.rk-tabs button { display: flex; align-items: center; gap: 10px; padding: 9px 14px; font-size: 21px; text-align: left; border-radius: 18px; background: rgba(255,255,255,.88); box-shadow: 0 4px 0 rgba(0,0,0,.18); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-tabs button i { flex: none; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-style: normal; color: #fff; background: #e0383e; font-size: 18px; }
.rk-tabs button.on { background: #fff4c7; box-shadow: 0 4px 0 #d6a84b, 0 0 0 4px #ffc107; transform: translateX(8px); }
.rk-main { position: absolute; left: 350px; right: 30px; top: 110px; bottom: 120px; display: flex; flex-direction: column; padding: 18px 24px; }
.rk-top { display: flex; align-items: center; gap: 18px; margin-bottom: 10px; }
.rk-type button { font-size: 24px; padding: 8px 20px; }
.rk-desc { font-family: var(--font-body); font-size: 18px; color: var(--ink-soft); }
.rk-list { flex: 1; overflow: auto; border-radius: 16px; background: #fff; }
.rk-list table { width: 100%; border-collapse: collapse; font-size: 24px; }
.rk-list th { position: sticky; top: 0; background: #f4e4c1; font-weight: normal; padding: 8px; font-size: 20px; z-index: 1; }
.rk-list td { padding: 7px 10px; border-bottom: 1px solid #f0e6d2; text-align: center; white-space: nowrap; }
.rk-list td small { font-size: 16px; color: var(--ink-soft); }
.rk-list td.rk { width: 90px; font-size: 26px; }
.rk-list td.sc { color: #6a4fd0; text-align: right; padding-right: 26px; }
.rk-list tr.top td { background: #fffbe6; }
.rk-list tr.mine td { background: #e5f6ff; font-weight: bold; }
.rk-empty { text-align: center; font-size: 26px; padding: 80px 20px; color: var(--ink-soft); }
.rk-me { margin-top: 10px; font-size: 24px; text-align: center; min-height: 32px; }
.rk-me b { color: #6a4fd0; font-weight: normal; }
.rk-btns { position: absolute; left: 0; right: 0; bottom: 26px; display: flex; gap: 20px; justify-content: center; }
.rank-btn { font-size: 24px; padding: 10px 20px; z-index: 3; }
.prof label { display: flex; align-items: center; gap: 16px; font-size: 28px; margin: 12px 0; }
.prof label small { font-size: 17px; color: var(--ink-soft); }
.prof input, .prof select { flex: 1; font-family: var(--font); font-size: 28px; padding: 8px 16px; border: 4px solid #e9c98f; border-radius: 16px; background: #fff; color: var(--ink); min-width: 0; }
.prof input:focus, .prof select:focus { outline: none; border-color: var(--orange); }
.prof .school { flex: 1; display: flex; align-items: center; gap: 8px; }
.prof .school b { font-weight: normal; font-size: 32px; }
.prof .note { font-family: var(--font-body); font-size: 19px; background: #fff3e0; border-radius: 14px; padding: 10px 14px; margin: 0 0 6px; }
.prof input { user-select: text; -webkit-user-select: text; }
.prof .err { min-height: 30px; color: var(--bad); font-size: 22px; text-align: center; }

/* ---------- 도감/오답노트 ---------- */
.dex-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 10px; }
.dex-grid .pc { height: 66px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 36px; background: #eee6d6; color: #c8bba3; }
.dex-grid .pc.got { background: linear-gradient(#fff, #ffe9b0); color: var(--ink); box-shadow: 0 4px 0 #d6a84b; animation: popIn .4s backwards; }
.badge-row { display: grid; grid-template-columns: repeat(8, 1fr); gap: 12px; }
.badge-row .bd { text-align: center; font-size: 17px; font-family: var(--font-body); }
.badge-row .bd img { width: 90px; height: 90px; object-fit: contain; filter: grayscale(1) opacity(.35); }
.badge-row .bd.got img { filter: none; animation: bob 2.4s ease-in-out infinite; }
.acc-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.acc-item { background: #fff; border-radius: 18px; padding: 10px; text-align: center; font-size: 19px; border: 4px solid transparent; cursor: pointer; }
.acc-item .em { font-size: 50px; display: block; }
.acc-item.lock { filter: grayscale(1); opacity: .5; cursor: default; }
.acc-item.on { border-color: var(--orange); background: #fff4dc; }
.note-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-height: 560px; overflow: auto; }

/* ---------- 고대비 ---------- */
.hc .mission, .hc .toast, .hc .panel { border-color: #000 !important; }
.hc .opt-big, .hc .choice { outline: 4px solid #000; }
.hc .veil { background: rgba(0,0,0,.35); }

/* ---------- 효과 최소화 ---------- */
.fx-min .rays, .fx-min .fever-frame { display: none !important; }
.fx-min .game.fever .bg { animation: none; }
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .05s !important; }

/* ---------- 키프레임 ---------- */
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { 0% { transform: scale(.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes hop { 0%,100% { transform: translateY(0) scale(1); } 40% { transform: translateY(-14px) scale(1.02, .98); } 60% { transform: translateY(-14px); } }
@keyframes victory { 0%,100% { transform: translateY(0) rotate(0); } 25% { transform: translateY(-14px) rotate(-3deg); } 75% { transform: translateY(-14px) rotate(3deg); } }
@keyframes twinkle { 0%,100% { opacity: .2; transform: scale(.7) rotate(0); } 50% { opacity: 1; transform: scale(1.1) rotate(20deg); } }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes stripes { to { background-position: 56px 0; } }
@keyframes wiggle { 0%,100% { transform: rotate(0); } 20% { transform: rotate(-12deg); } 40% { transform: rotate(10deg); } 60% { transform: rotate(-7deg); } 80% { transform: rotate(4deg); } }
@keyframes shake { 0%,100% { transform: translate(0); } 20% { transform: translate(-10px, 4px); } 40% { transform: translate(9px, -5px); } 60% { transform: translate(-7px, 3px); } 80% { transform: translate(5px, -2px); } }
@keyframes badgePop { 0% { transform: translateY(-50%) scale(.2) rotate(-12deg); opacity: 0; } 25% { transform: translateY(-50%) scale(1.15) rotate(4deg); opacity: 1; } 40% { transform: translateY(-50%) scale(1) rotate(0); } 80% { transform: translateY(-50%) scale(1); opacity: 1; } 100% { transform: translateY(-80%) scale(.9); opacity: 0; } }
@keyframes badgeSide { 0% { transform: translateX(200px) scale(.5); opacity: 0; } 20% { transform: translateX(0) scale(1.1); opacity: 1; } 35% { transform: scale(1); } 80% { opacity: 1; } 100% { transform: translateY(-60px); opacity: 0; } }
@keyframes floatUp { 0% { transform: translate(-50%, 0) scale(.6); opacity: 0; } 20% { transform: translate(-50%, -20px) scale(1.15); opacity: 1; } 100% { transform: translate(-50%, -110px) scale(1); opacity: 0; } }
@keyframes toastIn { from { transform: translate(-50%, 40px) scale(.8); opacity: 0; } }
@keyframes bannerIn { 0% { transform: scaleY(0); opacity: 0; } 12% { transform: scaleY(1.1); opacity: 1; } 20% { transform: scaleY(1); } 82% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(0); opacity: 0; } }
@keyframes feverBg { 0% { filter: saturate(1.6) hue-rotate(0deg) brightness(1.1); } 100% { filter: saturate(1.6) hue-rotate(360deg) brightness(1.1); } }
@keyframes rainbowFrame { 0% { box-shadow: inset 0 0 0 12px #ff7eb6, inset 0 0 60px 20px rgba(255,126,182,.6); } 25% { box-shadow: inset 0 0 0 12px #ffd23f, inset 0 0 60px 20px rgba(255,210,63,.6); } 50% { box-shadow: inset 0 0 0 12px #7ee08a, inset 0 0 60px 20px rgba(126,224,138,.6); } 75% { box-shadow: inset 0 0 0 12px #4aa3ff, inset 0 0 60px 20px rgba(74,163,255,.6); } 100% { box-shadow: inset 0 0 0 12px #ff7eb6, inset 0 0 60px 20px rgba(255,126,182,.6); } }
@keyframes gaugeFlow { to { background-position: 300% 0; } }
@keyframes jelly { 0% { transform: scale(1); } 30% { transform: scale(1.25, .8); } 50% { transform: scale(.85, 1.15); } 70% { transform: scale(1.08, .95); } 100% { transform: scale(1); } }
@keyframes glowPulse { 0%,100% { box-shadow: 0 0 0 4px rgba(255,255,255,.6), 0 0 20px 6px rgba(255,230,120,.6); } 50% { box-shadow: 0 0 0 6px rgba(255,255,255,.9), 0 0 40px 14px rgba(255,230,120,.95); } }
