:root {
  --navy: #1d3a4f;
  --navy2: #14293a;
  --navy3: #2b5470;
  --cream: #fff6e0;
  --cream2: #f3dfb0;
  --ink: #233140;
  --gold: #ffd23f;
  --gold2: #e2a21a;
  --red: #e5483b;
  --red2: #b42a20;
  --green: #4fbf5a;
  --green2: #2f8c3a;
  --blue: #3f8fe0;
  --blue2: #2a62a8;
  --font: 'Jua', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; height: 100%;
  background: #2f7f5b;
  color: #fff;
  font-family: var(--font);
  overscroll-behavior: none;
  touch-action: manipulation;
  user-select: none; -webkit-user-select: none;
  overflow: hidden;
}
button { font-family: inherit; cursor: pointer; border: none; color: inherit; touch-action: manipulation; }
.hidden { display: none !important; }

/* 동전 아이콘 */
.coin {
  display: inline-block; width: .95em; height: .95em; margin-left: 3px; vertical-align: -0.12em;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff3a8, #ffd23f 45%, #d99a12);
  box-shadow: inset 0 0 0 2px #b97c0c;
}

#app {
  height: 100%; height: 100dvh;
  display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: var(--navy2);
}

/* ---------- HUD ---------- */
#hud {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  background: linear-gradient(#244a63, #1a3549);
  border-bottom: 3px solid #0e1f2c;
  flex: 0 0 auto;
  z-index: 2;
}
.pill {
  display: flex; align-items: center; gap: 4px;
  height: 32px; padding: 0 10px 0 4px;
  background: rgba(8, 20, 30, .55);
  border: 2px solid rgba(255,255,255,.18);
  border-radius: 16px;
  font-size: 18px; white-space: nowrap;
  text-shadow: 0 2px 0 rgba(0,0,0,.45);
}
#hud .ico { font-size: 18px; width: 24px; text-align: center; }
#hud .hp { flex: 1 1 140px; min-width: 96px; max-width: 320px; padding-right: 4px; }
#hud .bar {
  position: relative; flex: 1; height: 20px;
  background: #0b1822; border-radius: 10px; overflow: hidden;
  box-shadow: inset 0 2px 3px rgba(0,0,0,.6);
}
#hpFill {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%;
  background: linear-gradient(#8ff07a, #3fae3a);
  transition: width .25s;
  border-radius: 10px;
}
#hpFill.mid { background: linear-gradient(#ffe066, #e2a21a); }
#hpFill.low { background: linear-gradient(#ff7a6a, #c42b1f); animation: blink .6s infinite; }
@keyframes blink { 50% { opacity: .55; } }
#hpText {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 400; text-shadow: 0 1px 2px #000, 0 0 2px #000;
}
#hud .gold-pill b { color: var(--gold); }
#hud .gem-pill b { color: #9fe6ff; }
#hud .wave { padding-left: 10px; font-size: 15px; }
#hud .wave b { color: var(--gold); font-size: 20px; margin-left: 2px; }
.hud-btns { display: flex; gap: 6px; margin-left: auto; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; font-size: 17px;
  background: linear-gradient(#4b8fd0, #2a62a8);
  border: 2px solid #9cd0ff;
  box-shadow: 0 3px 0 #173a66;
}
.icon-btn:active { transform: translateY(2px); box-shadow: none; }

/* ---------- 메인 ---------- */
#main { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
#stageWrap {
  position: relative; flex: 1 1 0; min-height: 0; min-width: 0;
  overflow: hidden;
  background: #2f7f5b;
}
#overlay { z-index: 2; }
.full-btn {
  font-family: inherit; font-size: 15px; color: #13222f; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%;
  background: linear-gradient(180deg, #fff3b8, #ffd862);
  border: 2px solid #13222f; border-radius: 12px; padding: 7px 12px;
  box-shadow: 0 3px 0 #13222f;
}
.full-btn .ic { width: 20px; height: 20px; filter: none; }
.full-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #13222f; }
#btnFull.nudge { animation: hudNudge 1.4s ease-in-out infinite; background: #ffc21f; }
@keyframes hudNudge { 50% { box-shadow: 0 0 0 5px rgba(255,210,63,.55); transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { #btnFull.nudge { animation: none; } }
/* 시작 버튼: "웨이브 9" / "시작" 두 줄로 고정 (글자가 중간에서 끊기지 않게) */
#btnStart .l1, #btnStart .l2 { display: block; white-space: nowrap; line-height: 1.15; }
#btnStart .l2 { font-size: 1.12em; }
.full-btn.hidden, #btnFull.hidden { display: none; }
.fs-guide ol { margin: 6px 0 10px; padding-left: 20px; line-height: 1.7; }
.fs-guide .big-btn { width: 100%; margin-top: 6px; }
#game, #overlay {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  display: block;
}
#overlay { touch-action: none; }

#banner {
  position: absolute; left: 50%; top: 20%;
  transform: translate(-50%, -50%);
  padding: 10px 28px;
  background: linear-gradient(#ff6a55, #d23a2c);
  border: 3px solid #fff;
  border-radius: 18px;
  color: #fff; font-size: clamp(20px, 4.6vw, 34px);
  text-shadow: 0 3px 0 rgba(0,0,0,.35);
  box-shadow: 0 5px 0 #8f2017, 0 10px 24px rgba(0,0,0,.35);
  white-space: nowrap;
  pointer-events: none;
  animation: bannerIn .45s cubic-bezier(.2,1.6,.4,1);
  z-index: 3;
}
#banner.boss { background: linear-gradient(#a65be0, #5b2a86); box-shadow: 0 5px 0 #33124f, 0 10px 24px rgba(0,0,0,.4); }
#banner.good { background: linear-gradient(#7ad66a, #3a9b3d); box-shadow: 0 5px 0 #1f5f22, 0 10px 24px rgba(0,0,0,.35); }
@keyframes bannerIn { from { transform: translate(-50%, -50%) scale(.3); opacity: 0; } }

#prepInfo {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  width: max-content; max-width: 94%;
  padding: 7px 14px;
  background: rgba(14, 31, 44, .82);
  border: 2px solid rgba(255,255,255,.35);
  border-radius: 14px;
  font-size: clamp(12px, 2.8vw, 16px); text-align: center; line-height: 1.4;
  pointer-events: none;
  z-index: 2;
}
#prepInfo b { color: var(--gold); font-weight: 400; }

/* ---------- 컨트롤 ---------- */
#controls {
  flex: 0 0 auto;
  padding: 8px 10px 10px;
  background: linear-gradient(#244a63, #183247);
  border-top: 3px solid #0e1f2c;
  width: 100%;
}
#controls > * { max-width: 760px; margin-left: auto; margin-right: auto; }

#answerRow { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
#answerBox {
  flex: 1; height: 46px;
  display: flex; align-items: center; justify-content: center;
  background: #fff;
  color: var(--ink);
  border: 3px solid #0e1f2c;
  border-radius: 14px;
  box-shadow: inset 0 3px 0 rgba(0,0,0,.12);
  font-size: 32px;
}
#answerBox.wrong { animation: shake .35s; background: #ffc9c0; }
#answerBox.right { background: #d4f7c4; }
@keyframes shake {
  20% { transform: translateX(-8px); } 40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); } 80% { transform: translateX(5px); }
}
.caret { width: 3px; height: 28px; background: var(--ink); margin-left: 3px; animation: caret 1s steps(1) infinite; border-radius: 2px; }
@keyframes caret { 50% { opacity: 0; } }
#combo { min-width: 70px; text-align: center; color: var(--gold); font-size: 15px; line-height: 1.05; text-shadow: 0 2px 0 rgba(0,0,0,.4); }
#combo b { font-size: 26px; display: block; font-weight: 400; }

#ctrlBody { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; }

#keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
#keypad button {
  height: clamp(42px, 6.2vh, 58px);
  font-size: 26px;
  color: var(--ink);
  background: linear-gradient(#ffffff, #e9eef3);
  border: 2px solid #0e1f2c;
  border-radius: 12px;
  box-shadow: 0 4px 0 #0e1f2c;
}
#keypad button:active, #keypad button.pressed { transform: translateY(4px); box-shadow: 0 0 0 #0e1f2c; }
#keypad .k-del { background: linear-gradient(#ffd9cf, #f2ab98); }
#keypad .k-ok { background: linear-gradient(#a8ef8e, #5cc44c); color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.3); }

#side { display: flex; flex-direction: column; gap: 7px; }
.big-btn {
  display: block; width: 100%;
  padding: 10px 12px;
  font-size: 19px;
  color: #fff;
  background: linear-gradient(#ff8a4a, #e5583b);
  border: 2px solid #0e1f2c;
  border-radius: 14px;
  box-shadow: 0 4px 0 #0e1f2c, inset 0 2px 0 rgba(255,255,255,.35);
  text-shadow: 0 2px 0 rgba(0,0,0,.35);
}
.big-btn small { font-size: 12px; opacity: .9; display: block; }
.big-btn.alt { background: linear-gradient(#5cc4f0, #2f86c9); }
.big-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #0e1f2c; }
.big-btn:disabled { filter: grayscale(.8) brightness(.75); }
#btnStart.pulse { animation: pulse 1.1s infinite; }
@keyframes pulse { 50% { transform: scale(1.03); box-shadow: 0 4px 0 #0e1f2c, 0 0 0 5px rgba(255,210,63,.6); } }
#side .big-btn { flex: 1 1 auto; min-height: 42px; }

#skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.skill {
  height: clamp(42px, 6.2vh, 56px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(#7b6cf0, #4b3cb8);
  border: 2px solid #0e1f2c; border-radius: 12px;
  font-size: 19px; line-height: 1;
  box-shadow: 0 4px 0 #0e1f2c;
}
.skill small { font-size: 12px; margin-top: 3px; color: #e6e1ff; }
.skill:disabled { filter: grayscale(1) brightness(.6); }
.skill:active { transform: translateY(3px); box-shadow: 0 1px 0 #0e1f2c; }

/* ---------- 화면 / 모달 ---------- */
.screen {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(8, 18, 26, .62);
}
#title {
  background:
    radial-gradient(ellipse at 50% 35%, rgba(255,230,140,.25), transparent 60%),
    linear-gradient(rgba(20,60,45,.25), rgba(10,30,24,.6));
}
.parchment {
  position: relative;
  width: min(520px, 100%);
  max-height: 100%; overflow-y: auto;
  padding: 26px 22px 22px;
  color: var(--ink);
  background: linear-gradient(#fffaf0, #f6e8c6);
  border: 3px solid #0e1f2c;
  border-radius: 22px;
  box-shadow: 0 6px 0 #0e1f2c, 0 18px 40px rgba(0,0,0,.45), inset 0 0 0 4px #fff;
  text-align: center;
}
.parchment h1 {
  margin: 0; font-size: clamp(38px, 10vw, 56px); font-weight: 400;
  color: #ffd23f;
  -webkit-text-stroke: 2px #0e1f2c; paint-order: stroke fill;
  text-shadow: 0 4px 0 #0e1f2c;
  letter-spacing: 1px;
}
.parchment h1.red { color: #ff6a55; font-size: clamp(30px, 8vw, 42px); }
.parchment h2 { margin: -4px 0 14px; font-size: 26px; font-weight: 400; color: var(--ink); }
.parchment .sub { margin: 6px 0 10px; letter-spacing: 3px; color: #8a6a2a; font-size: 14px; }
.crest { font-size: 54px; line-height: 1; margin-bottom: 4px; filter: drop-shadow(0 4px 0 rgba(0,0,0,.25)); }
.lore { line-height: 1.6; font-size: 16px; margin: 10px 4px 18px; color: #4a3a24; }
.menu { display: flex; flex-direction: column; gap: 12px; }
.menu .big-btn { padding: 14px; font-size: 21px; }
.link-btn { background: none; color: var(--ink); text-decoration: underline; font-size: 16px; padding: 6px; }
.best { margin: 12px 0 0; font-size: 14px; color: #8a6a2a; }
#goStats, #clearStats { font-size: 17px; line-height: 1.6; }
#clear { background: radial-gradient(ellipse at 50% 40%, rgba(255,210,63,.35), rgba(8,18,26,.7) 70%); }
.clear-card { animation: bannerIn .6s cubic-bezier(.2,1.6,.4,1); }
.clear-card .crest { font-size: 70px; animation: float 2s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px) rotate(-4deg); } }
.opt.diff-easy .icon { background: #e3f7dc; border-color: #a8dc98; }
.opt.diff-hard .icon { background: #ffe3dc; border-color: #f2ab98; }
.close {
  position: absolute; right: 12px; top: 12px;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--red); color: #fff; font-size: 17px;
  border: 2px solid #0e1f2c; box-shadow: 0 3px 0 #0e1f2c;
}
.sheet { width: min(560px, 100%); text-align: left; }
.sheet h2 { text-align: center; }
.stat-line { text-align: center; margin: 0 0 12px; font-size: 16px; }

.opt-list { display: flex; flex-direction: column; gap: 9px; }
.opt {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 10px 12px;
  text-align: left; color: var(--ink);
  background: #fff;
  border: 2px solid #0e1f2c; border-radius: 14px;
  box-shadow: 0 4px 0 #0e1f2c;
}
.opt:active { transform: translateY(3px); box-shadow: 0 1px 0 #0e1f2c; }
.opt:disabled { opacity: .5; }
.opt .icon { font-size: 30px; width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
  background: #e4f2fb; border-radius: 12px; border: 2px solid #b8d6ea; }
.opt .info { flex: 1; min-width: 0; }
.opt .info b { font-size: 18px; font-weight: 400; }
.opt .info small { display: block; font-size: 13px; color: #5a6874; margin-top: 2px; line-height: 1.35; }
.opt .cost { font-size: 19px; white-space: nowrap; color: #b07800; }
.opt .lvl { font-size: 13px; color: #2f8c3a; }
.opt.danger { background: #fff1ed; }

.help { line-height: 1.6; font-size: 15px; }
.help h3 { margin: 12px 0 4px; color: #c2410c; font-size: 18px; font-weight: 400; }
.help ul { margin: 0; padding-left: 20px; }
.pause-menu { display: flex; flex-direction: column; gap: 12px; }
.pause-menu .note { font-size: 13px; text-align: center; margin: 4px 0 0; color: #6b5a3a; }

/* ---------- 반응형 ---------- */
@media (orientation: landscape) and (max-height: 620px) {
  #main { flex-direction: row; }
  #controls {
    width: min(330px, 40vw);
    border-top: none; border-left: 3px solid #0e1f2c;
    display: flex; flex-direction: column; justify-content: center;
    padding: 6px 8px; overflow-y: auto;
  }
  #controls > * { width: 100%; }
  #ctrlBody { grid-template-columns: 1fr; gap: 6px; }
  #answerRow { margin-bottom: 6px; }
  #answerBox { height: 40px; font-size: 26px; }
  #keypad { gap: 5px; }
  #keypad button { height: clamp(32px, 10.5vh, 50px); font-size: 21px; }
  #side { flex-direction: row; flex-wrap: wrap; gap: 5px; }
  #side .big-btn { flex: 1 1 40%; padding: 6px; font-size: 15px; min-height: 34px; }
  #skills { flex: 1 1 100%; }
  .skill { height: 38px; flex-direction: row; gap: 4px; font-size: 15px; }
  .skill small { margin: 0; }
  #hud { padding: 3px 10px; }
  .pill { height: 28px; }
  .icon-btn { width: 30px; height: 30px; font-size: 14px; }
}

@media (max-width: 430px) {
  #hud { gap: 5px; padding: 5px 6px; }
  .pill { font-size: 15px; padding: 0 7px 0 2px; height: 30px; }
  #hud .ico { font-size: 15px; width: 20px; }
  #hud .hp { flex: 1 1 70px; min-width: 70px; }
  #hud .wave { font-size: 12px; padding-left: 7px; }
  #hud .wave b { font-size: 17px; }
  .icon-btn { width: 32px; height: 32px; font-size: 15px; }
}

/* =====================================================================
   v3: 아이콘, 영웅, 보스 컷인, 토스트, 결과/카드, 맵 선택, 도감, 업적
   ===================================================================== */
.ic { width: 1.2em; height: 1.2em; vertical-align: -0.25em; flex: 0 0 auto; filter: drop-shadow(0 1px 0 rgba(0,0,0,.25)); }
#hud .pill .ic { width: 22px; height: 22px; }
#hud .gold-pill b { color: var(--gold); }
#hud .gem-pill b { color: #9fe6ff; }
#hud .wave { gap: 4px; }
#hud .wave small { color: #9fb4c6; font-size: 13px; }
#todIcon .ic { width: 20px; height: 20px; }
.icon-btn .ic { width: 22px; height: 22px; }
.big-btn .ic { width: 1.25em; height: 1.25em; margin-right: 2px; }
.skill .ic { width: 24px; height: 24px; }
.skill small::after { content: ''; display: inline-block; width: .9em; height: .9em; margin-left: 2px; vertical-align: -.1em;
  background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M8 6h16l5 7-13 15L3 13z' fill='%235fd3ff' stroke='%2313222f' stroke-width='2.2'/%3E%3C/svg%3E"); }
#keypad .ic { width: 28px; height: 28px; }
.close .ic { width: 16px; height: 16px; }
.crest .ic { width: 64px; height: 64px; }
.coin-ic { display: inline-flex; align-items: center; gap: 2px; }
.cost .ic, .stat-line .ic { width: 1.05em; height: 1.05em; }

/* 타이틀 */
.title-card .crest { animation: float 3s ease-in-out infinite; }
.menu-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.menu-row.three { grid-template-columns: repeat(3, 1fr); }
.mini-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px; font-size: 15px; color: var(--ink);
  background: #fff; border: 2px solid #0e1f2c; border-radius: 12px; box-shadow: 0 3px 0 #0e1f2c;
}
.mini-btn .ic { width: 28px; height: 28px; }
.mini-btn small { font-size: 11px; color: #8a6a2a; }
.mini-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #0e1f2c; }

/* 영웅 필살기 버튼 */
#heroBtn {
  position: absolute; right: 12px; bottom: 12px; z-index: 3;
  width: 74px; height: 74px; border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #4b7fe0, #1d3a7a);
  border: 3px solid #0e1f2c;
  box-shadow: 0 4px 0 #0e1f2c, 0 6px 16px rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center;
  --g: 0;
}
#heroBtn .ring {
  position: absolute; top: -7px; right: -7px; bottom: -7px; left: -7px; border-radius: 50%;
  background: conic-gradient(#ffd23f calc(var(--g) * 1turn), rgba(10,20,30,.55) 0);
  -webkit-mask: radial-gradient(circle, transparent 58%, #000 60%); mask: radial-gradient(circle, transparent 58%, #000 60%);
}
#heroBtn .face .ic { width: 54px; height: 54px; }
#heroBtn .lbl {
  position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%);
  padding: 1px 8px; border-radius: 8px; font-size: 12px; white-space: nowrap;
  background: #0e1f2c; color: #9fb4c6;
}
#heroBtn.ready { animation: heroPulse .9s infinite; background: radial-gradient(circle at 50% 35%, #ffd27a, #e2561a); }
#heroBtn.ready .lbl { background: var(--red); color: #fff; }
@keyframes heroPulse { 50% { transform: scale(1.08); box-shadow: 0 4px 0 #0e1f2c, 0 0 0 8px rgba(255,210,63,.45); } }
#heroBtn:active { transform: translateY(2px); }

/* 보스 컷인 */
#bossCut {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 4; pointer-events: none;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
#bossCut .slash {
  position: absolute; left: -10%; right: -10%; top: 50%; height: 110px; transform: translateY(-50%) skewY(-6deg);
  background: linear-gradient(90deg, transparent, rgba(30,0,40,.85) 15%, rgba(60,10,70,.92) 50%, rgba(30,0,40,.85) 85%, transparent);
  border-top: 3px solid #e7b6ff; border-bottom: 3px solid #e7b6ff;
  animation: cutSlash 2.3s cubic-bezier(.2,.9,.3,1) forwards;
}
#bossCut .txt { position: relative; text-align: center; animation: cutText 2.3s cubic-bezier(.2,.9,.3,1) forwards; }
#bossCut small { display: block; letter-spacing: 8px; color: #e7b6ff; font-size: 16px; }
#bossCut b { display: block; font-weight: 400; font-size: clamp(34px, 8vw, 64px); color: #fff; text-shadow: 0 4px 0 #3a0a4a, 0 0 24px #c27bff; }
#bossCut.final .slash { background: linear-gradient(90deg, transparent, rgba(60,0,0,.88) 15%, rgba(110,10,20,.95) 50%, rgba(60,0,0,.88) 85%, transparent); border-color: #ff8a7a; }
#bossCut.final small { color: #ffb0a0; }
#bossCut.final b { text-shadow: 0 4px 0 #4a0000, 0 0 30px #ff3b2f; }
@keyframes cutSlash { 0% { transform: translateY(-50%) skewY(-6deg) scaleX(0); } 15% { transform: translateY(-50%) skewY(-6deg) scaleX(1); } 85% { opacity: 1; } 100% { opacity: 0; transform: translateY(-50%) skewY(-6deg) scaleX(1); } }
@keyframes cutText { 0% { opacity: 0; transform: translateX(-60px) scale(1.3); } 18% { opacity: 1; transform: none; } 85% { opacity: 1; } 100% { opacity: 0; transform: translateX(40px); } }

#flash { position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; background: #fff; opacity: 0; z-index: 3; }

/* 토스트 (업적) */
#toasts { position: fixed; right: 12px; top: calc(56px + env(safe-area-inset-top)); z-index: 30; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; min-width: 240px;
  padding: 8px 14px 8px 8px; border-radius: 16px;
  background: linear-gradient(#2b5470, #1a3549); border: 3px solid var(--gold);
  box-shadow: 0 4px 0 #0e1f2c, 0 10px 24px rgba(0,0,0,.4);
  animation: toastIn .5s cubic-bezier(.2,1.5,.4,1), toastOut .4s ease-in 3.4s forwards;
}
.toast .medal { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 3px solid #0e1f2c; }
.toast .medal .ic { width: 28px; height: 28px; }
.toast small { display: block; color: var(--gold); font-size: 12px; }
.toast b { font-weight: 400; font-size: 17px; }
@keyframes toastIn { from { transform: translateY(-30px) scale(.8); opacity: 0; } }
@keyframes toastOut { to { transform: translateY(-20px); opacity: 0; } }

/* 별 */
.stars { display: flex; justify-content: center; gap: 4px; }
.stars .ic { width: 22px; height: 22px; }
.stars.big .ic { width: 56px; height: 56px; }
.stars.big .on { animation: starPop .5s cubic-bezier(.2,1.8,.4,1) both; }
.stars.big .on:nth-child(2) { animation-delay: .25s; }
.stars.big .on:nth-child(3) { animation-delay: .5s; }
.stars.big span:nth-child(2) .ic { width: 68px; height: 68px; margin-top: -10px; }
@keyframes starPop { from { transform: scale(0) rotate(-90deg); opacity: 0; } }

/* 결과 */
.result-rows { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 12px 4px 16px; font-size: 17px; }
.result-rows span { color: #5a6874; display: flex; align-items: center; gap: 6px; }
.result-rows b { font-weight: 400; text-align: right; }
.result-rows .gold { color: #b07800; }
.result-title { text-align: center; font-size: 15px; color: #8a6a2a; margin: -6px 0 6px; }

/* 보상 카드 */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; perspective: 800px; }
.rcard {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 14px 8px 12px; min-height: 210px;
  background: linear-gradient(#ffffff, #eef3f8);
  border: 3px solid var(--rc, #6fb6e8); border-radius: 16px;
  box-shadow: 0 5px 0 #0e1f2c, 0 0 0 3px #0e1f2c inset;
  color: var(--ink);
  animation: cardIn .6s cubic-bezier(.2,1.4,.4,1) both;
}
.rcard:nth-child(2) { animation-delay: .12s; } .rcard:nth-child(3) { animation-delay: .24s; }
.rcard .rar { font-size: 12px; padding: 1px 10px; border-radius: 10px; color: #fff; background: var(--rc); margin-bottom: 8px; }
.rcard .big { width: 64px; height: 64px; border-radius: 16px; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--rc) 22%, white); border: 2px solid var(--rc); margin-bottom: 8px; }
.rcard .big .ic { width: 44px; height: 44px; }
.rcard b { font-weight: 400; font-size: 17px; }
.rcard p { font-size: 13px; color: #5a6874; margin: 6px 0 0; line-height: 1.35; }
.rcard .own { position: absolute; top: 6px; right: 8px; font-size: 11px; color: #8a6a2a; }
.rcard.epic { box-shadow: 0 5px 0 #0e1f2c, 0 0 18px rgba(255,176,42,.7); }
.rcard:active { transform: translateY(3px); }
.rcard.picked { animation: cardPick .5s forwards; }
@keyframes cardIn { from { transform: rotateY(90deg) translateY(30px); opacity: 0; } }
@keyframes cardPick { 50% { transform: scale(1.12); } to { transform: scale(1.05); box-shadow: 0 0 0 4px var(--gold), 0 0 30px var(--gold); } }
.owned-cards { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 12px; }
.owned-cards span { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: #eef3f8; border: 1.5px solid #b8d6ea; color: var(--ink); }

/* 맵 선택 */
.maps { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mapc {
  position: relative; padding: 0; overflow: hidden; text-align: left; color: var(--ink);
  background: #fff; border: 3px solid #0e1f2c; border-radius: 16px; box-shadow: 0 4px 0 #0e1f2c;
}
.mapc canvas { display: block; width: 100%; height: auto; }
.mapc .info { padding: 6px 10px 8px; }
.mapc .info b { font-weight: 400; font-size: 16px; display: flex; align-items: center; gap: 4px; }
.mapc .info small { display: block; font-size: 12px; color: #5a6874; }
.mapc .stars { justify-content: flex-start; margin-top: 4px; }
.mapc .stars .ic { width: 18px; height: 18px; }
.mapc.locked { filter: grayscale(.8); }
.mapc .lockv { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: rgba(14,31,44,.88); color: #fff; font-size: 13px; text-align: center; padding: 10px; }
.mapc .lockv b { font-weight: 400; font-size: 16px; color: var(--gold); }
.mapc .lockv .ic { width: 36px; height: 36px; }
.mapc:active:not(.locked) { transform: translateY(3px); box-shadow: 0 1px 0 #0e1f2c; }

/* 도감 */
.tabs { display: flex; gap: 6px; justify-content: center; margin-bottom: 12px; }
.tabs button { padding: 6px 14px; border-radius: 12px; background: #e4ecf3; color: var(--ink); border: 2px solid #b8cad8; font-size: 15px; }
.tabs button.on { background: var(--blue); color: #fff; border-color: #0e1f2c; box-shadow: 0 3px 0 #0e1f2c; }
.dex { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.dexc {
  position: relative; padding: 6px 4px 8px; color: var(--ink); text-align: center;
  background: radial-gradient(circle at 50% 35%, #ffffff, #dfe9f2); border: 2px solid #0e1f2c; border-radius: 14px; box-shadow: 0 3px 0 #0e1f2c;
}
.dexc img { width: 100%; aspect-ratio: 1; display: block; }
.dexc b { font-weight: 400; font-size: 13px; display: block; }
.dexc small { font-size: 11px; color: #5a6874; }
.dexc.boss { background: radial-gradient(circle at 50% 35%, #fff, #e9dcff); }
.dexc.lock b { color: #8a96a2; }
.dexc .badge { position: absolute; top: 4px; left: 6px; font-size: 10px; padding: 0 6px; border-radius: 8px; background: #5b2a86; color: #fff; }
.dex-detail { display: grid; grid-template-columns: 150px 1fr; gap: 12px; align-items: start; }
.dex-detail img { width: 150px; height: 150px; border-radius: 16px; background: radial-gradient(circle at 50% 35%, #fff, #dfe9f2); border: 2px solid #0e1f2c; }
.dex-detail h3 { margin: 0 0 4px; font-weight: 400; font-size: 22px; }
.dex-detail p { margin: 0 0 8px; font-size: 14px; line-height: 1.5; color: #4a5a68; }
.dex-stats { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 14px; }
.dex-stats span { color: #6b7a88; }
.back-link { background: none; color: var(--blue2); font-size: 15px; padding: 4px 0 10px; }
@media (max-width: 460px) { .dex-detail { grid-template-columns: 1fr; justify-items: center; text-align: center; } .dex-stats { justify-self: stretch; } }

/* 업적 */
.ach-head { display: flex; align-items: center; justify-content: center; gap: 8px; margin: -4px 0 12px; font-size: 16px; color: #5a6874; }
.ach-head .ic { width: 26px; height: 26px; }
.ach-list { display: flex; flex-direction: column; gap: 8px; }
.ach {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  background: #fff; border: 2px solid #c9d6e2; border-radius: 14px;
}
.ach.done { border-color: #0e1f2c; box-shadow: 0 3px 0 #0e1f2c; background: linear-gradient(#fffdf2, #fff6d6); }
.ach .medal { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
  border: 3px solid #0e1f2c; background: #c9d6e2; }
.ach .medal .ic { width: 28px; height: 28px; }
.ach:not(.done) .medal { filter: grayscale(1) opacity(.55); }
.ach .info { flex: 1; min-width: 0; }
.ach .info b { font-weight: 400; font-size: 16px; color: var(--ink); }
.ach .info small { display: block; font-size: 12.5px; color: #6b7a88; }
.ach .tier { font-size: 11px; padding: 0 7px; border-radius: 8px; color: #fff; margin-left: 4px; vertical-align: 2px; }
.ach .prog { height: 8px; border-radius: 4px; background: #e4ecf3; overflow: hidden; margin-top: 4px; }
.ach .prog i { display: block; height: 100%; background: linear-gradient(90deg, #5cc44c, #a8ef8e); border-radius: 4px; }
.ach .when { font-size: 11px; color: #8a6a2a; white-space: nowrap; }

/* 탑 진화 미리보기 */
.evo { display: flex; align-items: center; gap: 8px; justify-content: center; margin: 4px 0 12px; }
.evo img { width: 92px; height: 92px; border-radius: 14px; background: radial-gradient(circle at 50% 35%, #fff, #dfe9f2); border: 2px solid #0e1f2c; }
.evo .arrow { font-size: 26px; color: var(--gold2); }
.evo .cap { text-align: center; font-size: 12px; color: #5a6874; }
.opt.evolve { background: linear-gradient(#fff8d6, #ffe58a); }
.lv-tag { display: inline-block; font-size: 12px; padding: 0 8px; border-radius: 8px; background: var(--blue); color: #fff; margin-left: 4px; vertical-align: 2px; }

#banner .ic { width: 1.1em; height: 1.1em; }
#prepInfo .ic { width: 1.1em; height: 1.1em; }
.opt .icon .ic { width: 32px; height: 32px; }

@media (max-width: 520px) {
  .cards { grid-template-columns: 1fr; }
  .rcard { min-height: 0; flex-direction: row; text-align: left; gap: 10px; padding: 10px; }
  .rcard .big { margin: 0; flex: 0 0 auto; }
  .rcard .rar { position: absolute; top: -10px; left: 12px; margin: 0; }
  .rcard .txt { flex: 1; }
  #heroBtn { width: 62px; height: 62px; right: 8px; bottom: 8px; }
  #heroBtn .face .ic { width: 45px; height: 45px; }
}
@media (orientation: landscape) and (max-height: 620px) {
  #heroBtn { width: 58px; height: 58px; }
  #heroBtn .face .ic { width: 43px; height: 43px; }
}

/* 좁은 휴대폰: 상단 바 압축 */
@media (max-width: 430px) {
  #hud { gap: 4px; padding: 5px 5px; }
  #hud .pill { padding: 0 6px 0 3px; gap: 2px; font-size: 15px; }
  #hud .pill .ic { width: 18px; height: 18px; }
  #hud .hp { flex: 1 1 64px; min-width: 64px; }
  #hpText { font-size: 10px; }
  #hud .wave .wlabel, #todIcon { display: none; }
  #hud .wave small { font-size: 11px; }
  .hud-btns { gap: 4px; }
  .icon-btn { width: 30px; height: 30px; }
  .icon-btn .ic { width: 18px; height: 18px; }
}

/* 처음 화면: 카드를 아래쪽에 두고 위쪽에 성문이 보이도록 */
@media (min-height: 560px) {
  #title { align-items: flex-end; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
}

.toast.map-toast { border-color: #7dff8a; animation: toastIn .5s cubic-bezier(.2,1.5,.4,1), toastOut .4s ease-in 5s forwards; }
.toast .sub { color: #cfe0ec !important; font-size: 11px !important; margin-top: 2px; }
.diff-easy.evolve, .diff-normal.evolve, .diff-hard.evolve { box-shadow: 0 4px 0 #0e1f2c, 0 0 0 3px var(--gold); }
.mapc .saved-tag { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; padding: 2px 8px; border-radius: 999px; background: #2f9e4f; color: #fff !important; font-size: 11px; width: fit-content; }
.mapc .saved-tag svg { width: 12px; height: 12px; }
.dexc .badge.maptag { background: #3f86c6; }
.opt.diff-expert .icon { background: #efe3ff; border-color: #b998f2; }
.diff-expert.evolve { box-shadow: 0 4px 0 #0e1f2c, 0 0 0 3px var(--gold); }

/* 필살기: 하늘이 붉게 어두워짐 */
#ultDim { position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; z-index: 1; opacity: 0;
  background: radial-gradient(ellipse at 50% 40%, rgba(255,110,30,.10), rgba(120,20,10,.55) 60%, rgba(20,5,5,.85)); }
#ultDim.on { animation: ultDim 2.6s ease-out; }
@keyframes ultDim { 0% { opacity: 0; } 12% { opacity: 1; } 70% { opacity: .85; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #ultDim.on { animation-duration: 1.2s; } }

/* 만든 사람 표시 (채쌤) */
.maker { margin-top: 12px; padding-top: 10px; border-top: 2px dashed rgba(19,34,47,.18); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.maker-title { display: flex; align-items: baseline; justify-content: center; gap: 8px; }
.maker-title span { font-size: 13px; color: #6b5a3e; letter-spacing: 1px; }
.maker-title b { font-weight: 400; font-size: 22px; color: #13222f; text-shadow: 0 2px 0 #ffd23f; }
.maker-link { font-size: 13.5px; color: #2d6fb8; text-decoration: none; border-bottom: 1.5px solid rgba(45,111,184,.35); padding-bottom: 1px; }
.maker-link:hover, .maker-link:focus-visible { color: #13222f; border-bottom-color: #13222f; outline: none; }

/* 참여 플레이어 수 */
.player-stats { margin: 6px 0 0; font-size: 14px; white-space: nowrap; color: #13222f; background: rgba(255,210,63,.28); border-radius: 10px; padding: 3px 10px; text-align: center; }
.player-stats b { font-weight: 400; color: #b5361e; }
.player-stats.hidden { display: none; }

/* QR 공유 */
.mini-btn.share { background: #fff6cf; }
.qr-share { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.qr-box { background: #fff; border: 3px solid #13222f; border-radius: 14px; padding: 10px; width: min(260px, 70vw); box-shadow: 0 4px 0 #13222f; }
.qr-box svg, .qr-big-code svg { display: block; width: 100%; height: auto; }
.qr-url { font-size: 15px; color: #13222f; word-break: break-all; user-select: all; -webkit-user-select: all; background: rgba(255,255,255,.7); border-radius: 8px; padding: 4px 10px; }
.qr-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.qr-actions .big-btn { font-size: 16px; padding: 9px 6px; }
.qr-tip { font-size: 13px; color: #6b5a3e; line-height: 1.5; margin: 0; }
#qrBig { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 60; background: rgba(10,20,30,.92); display: flex; align-items: center; justify-content: center; padding: 16px; }
#qrBig.hidden { display: none; }
.qr-big-card { background: #fffaf0; border: 4px solid #13222f; border-radius: 22px; padding: 18px 22px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; max-height: 100%; }
.qr-big-card h2 { margin: 0; font-size: clamp(24px, 4.5vh, 44px); color: #13222f; }
.qr-big-code { width: min(60vh, 86vw, 640px); max-width: 100%; background: #fff; padding: 2vmin; border-radius: 14px; }
.qr-big-url { margin: 0; font-size: clamp(16px, 3vh, 30px); color: #13222f; word-break: break-all; text-align: center; }
.qr-big-tip { margin: 0; font-size: clamp(14px, 2.4vh, 24px); color: #6b5a3e; }

/* 로그인 */
.login-card { text-align: center; }
.login-card .crest { animation: float 3s ease-in-out infinite; }
.login-form { display: flex; flex-direction: column; gap: 6px; text-align: left; margin-top: 10px; }
.login-form label { font-size: 15px; color: #13222f; margin-top: 4px; }
.login-form label small { font-size: 12px; color: #6b5a3e; }
.login-form input { font-family: inherit; font-size: 18px; padding: 9px 12px; border: 2px solid #13222f; border-radius: 12px; background: #fff; color: #13222f; width: 100%; box-sizing: border-box; }
.login-form input:focus { outline: 3px solid #ffd23f; outline-offset: 1px; }
.login-form #lgPin, .login-form #lgPin2 { letter-spacing: 10px; font-size: 22px; text-align: center; }
.login-form .big-btn { margin-top: 6px; }
.school-pick { position: relative; }
.school-results { position: absolute; left: 0; right: 0; top: 100%; z-index: 5; margin-top: 4px; max-height: 240px; overflow-y: auto; background: #fff; border: 2px solid #13222f; border-radius: 12px; box-shadow: 0 6px 16px rgba(0,0,0,.25); }
.school-results.hidden, .school-picked.hidden { display: none; }
.school-results button { display: block; width: 100%; text-align: left; font-family: inherit; font-size: 16px; padding: 8px 12px; background: none; border: 0; border-bottom: 1px solid #eee3c8; color: #13222f; cursor: pointer; }
.school-results button small { display: block; font-size: 12px; color: #6b5a3e; }
.school-results button:hover, .school-results button:focus { background: #fff3c4; outline: none; }
.school-results .empty { padding: 10px 12px; font-size: 14px; color: #6b5a3e; }
.school-picked { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border: 2px solid #13222f; border-radius: 12px; background: #fff3c4; font-size: 17px; color: #13222f; }
.school-picked small { display: block; font-size: 12px; color: #6b5a3e; }
.school-picked button { font-family: inherit; font-size: 13px; padding: 4px 10px; border-radius: 10px; border: 2px solid #13222f; background: #fff; color: #13222f; cursor: pointer; flex: none; }
.lg-msg { min-height: 20px; margin: 4px 0 0; font-size: 14px; color: #b5361e; line-height: 1.45; }
.lg-msg.ok { color: #2f7d3a; }
.lg-notes { text-align: left; margin: 14px 0 0; padding-left: 18px; font-size: 13px; color: #6b5a3e; line-height: 1.6; }
.acct-bar { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin: -6px 0 6px; font-size: 14px; color: #13222f; }
.acct-bar.hidden { display: none; }
.acct-bar b { font-weight: 400; }
.acct-bar button { font-family: inherit; font-size: 12px; padding: 2px 10px; border-radius: 10px; border: 2px solid #13222f; background: #fff; color: #13222f; cursor: pointer; }

/* 저장 목록 */
.save-list { display: flex; flex-direction: column; gap: 8px; }
.save-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 10px; background: #fff; border: 2px solid #13222f; border-radius: 14px; box-shadow: 0 3px 0 #13222f; }
.save-row .sv-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: #fff3c4; border: 2px solid #13222f; }
.save-row .sv-ic .ic { width: 26px; height: 26px; }
.save-row .sv-main { min-width: 0; text-align: left; }
.save-row .sv-main b { display: block; font-weight: 400; font-size: 16px; color: #13222f; }
.save-row .sv-main small { display: block; font-size: 12.5px; color: #6b5a3e; line-height: 1.4; }
.save-row .sv-time { font-size: 12px; color: #2d6fb8; }
.save-row .sv-btns { display: flex; flex-direction: column; gap: 5px; }
.save-row .sv-btns button { font-family: inherit; font-size: 14px; padding: 5px 10px; border-radius: 10px; border: 2px solid #13222f; cursor: pointer; white-space: nowrap; }
.save-row .sv-go { background: #ff8a3d; color: #fff; text-shadow: 0 1px 0 #13222f; }
.save-row .sv-del { background: #fff; color: #6b5a3e; font-size: 12px !important; }
.save-row .sv-del.confirm { background: #e5483b; color: #fff; }
.save-empty, .save-sync { text-align: center; font-size: 14px; color: #6b5a3e; margin: 6px 0; }

/* 점수 · 랭킹 */
#scoreBox { min-width: 74px; text-align: center; color: #fff; font-size: 12px; line-height: 1.05; text-shadow: 0 2px 0 rgba(0,0,0,.4); }
#scoreBox small { display: block; color: #9fb4c6; }
#scoreBox b { display: block; font-weight: 400; font-size: 18px; font-variant-numeric: tabular-nums; }
.mini-btn.rank { background: linear-gradient(#fff6cf, #ffe27a); }
.result-rows b.score { color: #2d6fb8; }
.rank-note { min-height: 18px; margin: 6px 0 2px; font-size: 13px; color: #2d6fb8; text-align: center; }
.rank-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-bottom: 8px; }
.rank-tabs button, .rank-scope button { font-family: inherit; font-size: 14px; padding: 6px 2px; border: 2px solid #13222f; border-radius: 10px; background: #fff; color: #13222f; cursor: pointer; }
.rank-tabs button { white-space: nowrap; letter-spacing: -0.5px; font-size: 13px; }
.rank-tabs button.on, .rank-scope button.on { background: #ffd23f; }
.rank-scope { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 8px; }
.rank-list { display: flex; flex-direction: column; gap: 5px; }
.rank-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 7px 9px; background: #fff; border: 2px solid #13222f; border-radius: 12px; }
.rank-row.me { background: #fff3c4; box-shadow: 0 0 0 3px #ffd23f; }
.rank-row .rk { font-size: 18px; text-align: center; color: #13222f; font-variant-numeric: tabular-nums; }
.rank-row .rk.m1, .rank-row .rk.m2, .rank-row .rk.m3 { width: 32px; height: 32px; line-height: 32px; border-radius: 50%; color: #13222f; border: 2px solid #13222f; font-size: 16px; justify-self: center; }
.rank-row .rk.m1 { background: #ffd23f; } .rank-row .rk.m2 { background: #d9e2ea; } .rank-row .rk.m3 { background: #e8a46a; }
.rank-row .who { min-width: 0; text-align: left; }
.rank-row .who b { display: block; font-weight: 400; font-size: 16px; color: #13222f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row .who small { display: block; font-size: 12px; color: #6b5a3e; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row .pts { text-align: right; font-variant-numeric: tabular-nums; }
.rank-row .pts b { display: block; font-weight: 400; font-size: 16px; color: #b5361e; }
.rank-row .pts small { display: block; font-size: 12px; color: #2d6fb8; }
.rank-me-sep { text-align: center; color: #6b5a3e; font-size: 13px; margin: 4px 0; }
.rank-empty { text-align: center; font-size: 14px; color: #6b5a3e; margin: 10px 0; }

/* 영웅 고르기 (처음 화면 줄 + 창) */
.hero-strip {
  display: flex; align-items: center; gap: 10px; width: 100%; margin: 0 0 8px; padding: 4px 10px 4px 4px; text-align: left; color: var(--ink);
  background: linear-gradient(90deg, #fff7dc, #ffffff); border: 2px solid #0e1f2c; border-radius: 14px; box-shadow: 0 3px 0 #0e1f2c; cursor: pointer;
}
.hero-strip:empty { display: none; }
.hero-strip img { width: 48px; height: 48px; border-radius: 10px; background: radial-gradient(circle at 50% 35%, #fff, #dfe9f2); flex: none; }
.hero-strip span { flex: 1; min-width: 0; line-height: 1.15; }
.hero-strip small { display: block; font-size: 11.5px; color: #6b7a88; }
.hero-strip span b { font-weight: 400; font-size: 18px; }
.hero-strip em { font-style: normal; font-size: 13px; color: #fff; background: #5b2a86; padding: 4px 9px; border-radius: 10px; white-space: nowrap; }
.hero-strip em b { font-weight: 400; color: #ffd23f; }
.hero-strip:active { transform: translateY(2px); box-shadow: 0 1px 0 #0e1f2c; }
.hero-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.hero-card {
  position: relative; padding: 4px 2px 6px; text-align: center; color: var(--ink); cursor: pointer;
  background: radial-gradient(circle at 50% 35%, #ffffff, #dfe9f2); border: 2px solid #0e1f2c; border-radius: 14px; box-shadow: 0 3px 0 #0e1f2c;
}
.hero-card img { width: 100%; aspect-ratio: 1; display: block; }
.hero-card b { display: block; font-weight: 400; font-size: 17px; line-height: 1.1; }
.hero-card .ht { color: #6b7a88; font-size: 10.5px; min-height: 1.2em; }
.hero-card small { display: block; font-size: 10.5px; color: #5a6874; line-height: 1.2; }
.hero-card small .ic { width: 1em; height: 1em; }
.hero-card.on { background: radial-gradient(circle at 50% 35%, #fff, #ffe9a8); }
.hero-card.focus { outline: 3px solid var(--hc); outline-offset: 1px; }
.hero-card.lock b { color: #8a96a2; }
.hero-card .badge { position: absolute; top: 3px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 9.5px; padding: 0 5px; border-radius: 8px; background: #5b2a86; color: #fff; }
.hero-info { margin-top: 10px; padding: 10px 12px; background: #fff; border: 2px solid #0e1f2c; border-radius: 14px; }
.hero-info h3 { margin: 0 0 4px; font-weight: 400; font-size: 21px; }
.hero-info h3 .ic { width: 1em; height: 1em; vertical-align: -3px; }
.hero-info p { margin: 0 0 8px; font-size: 13.5px; line-height: 1.5; color: #4a5a68; }
.hero-moves { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 13px; margin-bottom: 10px; }
.hero-moves span { color: #6b7a88; }
.hero-moves b { font-weight: 400; }
.hero-on { text-align: center; color: #2f8a3a !important; font-size: 15px !important; margin: 0 !important; }

/* 새 영웅 합류 */
.hero-join { text-align: center; }
.hero-join .hj-art { width: 180px; height: 180px; margin: 0 auto 6px; border-radius: 50%; border: 3px solid #0e1f2c;
  background: radial-gradient(circle at 50% 40%, #ffffff, var(--hc)); box-shadow: 0 0 0 6px rgba(255,210,63,.5), 0 0 30px var(--hc); animation: hjGlow 1.6s ease-in-out infinite; }
.hero-join .hj-art img { width: 100%; height: 100%; border-radius: 50%; animation: float 3s ease-in-out infinite; }
.hero-join h3 { margin: 4px 0; font-weight: 400; font-size: 26px; color: var(--hc); text-shadow: 0 2px 0 #fff; }
.hero-join h3 .ic { width: 1em; height: 1em; vertical-align: -4px; }
.hero-join p { margin: 0 0 6px; font-size: 14px; color: #4a5a68; }
.hero-join .lore { font-size: 13px; line-height: 1.5; margin-bottom: 12px; }
.hero-join .big-btn { margin-top: 6px; }
@keyframes hjGlow { 50% { box-shadow: 0 0 0 10px rgba(255,210,63,.25), 0 0 46px var(--hc); } }
@media (prefers-reduced-motion: reduce) { .hero-join .hj-art, .hero-join .hj-art img { animation: none; } }

/* 업데이트 안내 */
.notice .nt { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; margin-bottom: 7px; background: #fff; border: 2px solid #0e1f2c; border-radius: 14px; text-align: left; }
.notice .nt > span { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: #fff3c4; border: 2px solid #0e1f2c; }
.notice .nt > span .ic { width: 26px; height: 26px; }
.notice .nt b { display: block; font-weight: 400; font-size: 16.5px; }
.notice .nt small { display: block; font-size: 13px; line-height: 1.45; color: #4a5a68; }
.notice .nt small b { display: inline; font-size: inherit; color: #c0392b; }
.notice .big-btn { margin-top: 4px; }

/* 웨이브 다시 도전 */
.retry-btn { margin-top: 8px; font-size: 16px; padding: 8px 12px; }
.retry-btn small { font-size: 11.5px; }
.retry-btn.confirm { background: linear-gradient(#ffcf5a, #e8a21f); }

/* 일시정지: 지금 난이도 (게임 중에는 바꿀 수 없음) */
.pause-diff { margin: 10px 0 8px; padding: 8px 10px; text-align: center; font-size: 15px; color: var(--ink); background: #fff; border: 2px dashed #b8cad8; border-radius: 12px; }
.pause-diff b { font-weight: 400; color: #c0392b; }
.pause-diff small { display: block; font-size: 12px; color: #6b7a88; word-break: keep-all; }
.pause-diff .ic { width: 1.1em; height: 1.1em; vertical-align: -3px; }
