/* 철갑 원정대 — 기지(성장) · 2D 카드 전투 · 3D 대전
   어두운 남색 판 + 금색 테두리, 카드 크림색 본문. 공격=붉은 띠, 스킬=파란 띠, 능력=금색 띠 */
:root {
  --ink: #f4efe4;
  --ink-dim: #b8b3a8;
  --navy: #1b2232;
  --navy-2: #262f44;
  --navy-3: #323d57;
  --line: rgba(244, 239, 228, 0.14);
  --gold: #e9b84c;
  --gold-2: #f6d27a;
  --gold-ink: #2b1f08;
  --red: #d24f3e;
  --blue: #3f7fd1;
  --green: #4fae5a;
  --steel: #9fb3c8;
  --card-body: #f6eee0;
  --card-ink: #2a2620;
  --atk: #c9493a;
  --skl: #3c78c6;
  --pow: #d39a2a;
  --f-display: "Black Han Sans", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --f-body: "IBM Plex Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --cw: clamp(96px, 13.2vw, 150px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
[hidden] { display: none !important; }
body { margin: 0; background: #11151f; color: var(--ink); font-family: var(--f-body); overflow: hidden; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
kbd { font-family: var(--f-body); font-size: 11px; padding: 1px 5px; border-radius: 4px; border: 1px solid currentColor; opacity: .75; }

.screen { position: fixed; inset: 0; display: flex; flex-direction: column; overflow: hidden; }
.bg { position: absolute; inset: 0; background: var(--bg) center/cover no-repeat, linear-gradient(180deg, #6f8fa8 0%, #a9b98f 62%, #7c6a4c 63%, #5d4f38 100%); }
.bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 14, 22, .55) 0%, rgba(10, 14, 22, 0) 22%, rgba(10, 14, 22, 0) 58%, rgba(10, 14, 22, .7) 100%); }

/* ---------- 상단 줄 ---------- */
.topbar { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px));
  background: linear-gradient(180deg, rgba(14, 18, 28, .92), rgba(14, 18, 28, .72)); border-bottom: 1px solid var(--line); }
.tb-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tb-face { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--gold); background: #2b3247 50% 12% / 170% no-repeat; flex: none; }
.tb-name { font-size: 13px; color: var(--ink-dim); }
.tb-name b { font-family: var(--f-display); font-weight: 400; color: var(--gold-2); font-size: 18px; margin-left: 2px; }
.xpbar { position: relative; width: clamp(120px, 22vw, 220px); height: 14px; border-radius: 7px; background: rgba(0, 0, 0, .45); overflow: hidden; border: 1px solid var(--line); }
.xpbar i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, #6fb0ff, #9fd2ff); transition: width .5s; }
.xpbar span { position: relative; display: block; text-align: center; font-size: 10px; line-height: 13px; font-weight: 700; text-shadow: 0 1px 2px #000; font-variant-numeric: tabular-nums; }
.tb-res { display: flex; gap: 10px; align-items: center; }
.res { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px 4px 5px; border-radius: 999px; background: rgba(0, 0, 0, .4); border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.res i { width: 18px; height: 18px; border-radius: 50%; }
.res.gold i { background: radial-gradient(circle at 35% 35%, #fff2b0, #e9b84c 55%, #9a6a14); }
.res.steel i { border-radius: 4px; background: linear-gradient(135deg, #e3ecf5, #8ea3b8 55%, #56677a); transform: rotate(45deg) scale(.8); }
.res b { font-size: 15px; }

/* ---------- 기지 ---------- */
.base-main { position: relative; z-index: 2; flex: 1; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(300px, 1fr); gap: 16px; padding: 14px max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px)); min-height: 0; max-width: 1240px; width: 100%; margin: 0 auto; }
.hero { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-height: 0; }
.power { position: absolute; top: 6px; left: 0; padding: 8px 16px 8px 14px; border-radius: 12px; background: rgba(14, 18, 28, .78); border: 1px solid rgba(233, 184, 76, .5); }
.power small { display: block; font-size: 11px; color: var(--ink-dim); }
.power b { font-family: var(--f-display); font-weight: 400; font-size: 28px; color: var(--gold-2); letter-spacing: .5px; }
.power.bump b { animation: bump .6s; }
@keyframes bump { 30% { transform: scale(1.25); color: #fff; } }
.hero-unit { position: relative; width: min(100%, 520px); margin-bottom: 6%; }
.hero-shadow { position: absolute; left: 12%; right: 12%; bottom: -4px; height: 22px; border-radius: 50%; background: rgba(0, 0, 0, .35); filter: blur(6px); z-index: -1; }
.recon { position: absolute; top: 6px; right: 0; display: flex; flex-direction: column; align-items: flex-end; padding: 8px 12px; border-radius: 12px; background: rgba(14, 18, 28, .78); border: 1px solid var(--line); text-align: right; }
.recon span { font-size: 11px; color: var(--ink-dim); }
.recon b { font-size: 15px; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.recon em { font-style: normal; font-size: 11px; margin-top: 2px; padding: 2px 10px; border-radius: 999px; background: var(--gold); color: var(--gold-ink); font-weight: 700; }
.recon:disabled em { background: #4b5265; color: #aab; }

/* 2D 유닛 (탱크 그림 + 해치 위 지휘관) */
.unitart { position: relative; width: 100%; aspect-ratio: var(--ar, 1.9); }
.unitart img { position: absolute; display: block; pointer-events: none; }
.unitart .spr { inset: 0; width: 100%; height: 100%; object-fit: contain; }
.unitart .spr { z-index: 1; }
.hatch-hole, .hatch-lip { position: absolute; width: 21%; aspect-ratio: 3.6; transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none; }
.hatch-hole { z-index: 2; background: radial-gradient(ellipse at 50% 45%, #0e0c0a 40%, #2a2620 75%); border: 4px solid #4d5046; }
.cmdwrap { position: absolute; z-index: 3; width: 60%; height: 230%; transform: translateX(-50%); overflow: hidden; pointer-events: none; }
.cmdwrap .cmd { position: absolute; left: 50%; bottom: -6.2%; height: 31%; transform: translateX(-50%); transform-origin: 50% 100%; transition: transform .18s; }
.hatch-lip { z-index: 4; border: 4px solid #5d6055; border-top-color: transparent; border-left-color: transparent; border-right-color: transparent; box-shadow: 0 3px 0 -1px #2c2e28; clip-path: inset(48% -10% -40% -10%); }
.unitart.flip .spr { transform: scaleX(-1); }

.panel { position: relative; display: flex; flex-direction: column; min-height: 0; border-radius: 16px; background: rgba(18, 23, 35, .88); border: 1px solid rgba(233, 184, 76, .35); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); overflow: hidden; }
.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tab { flex: 1; padding: 11px 6px; font-weight: 700; color: var(--ink-dim); border-bottom: 3px solid transparent; }
.tab.on { color: var(--gold-2); border-bottom-color: var(--gold); background: rgba(233, 184, 76, .06); }
.tab span { display: inline-block; min-width: 20px; padding: 0 5px; border-radius: 999px; background: var(--navy-3); font-size: 11px; color: var(--ink); }
.tabbody { flex: 1; overflow-y: auto; padding: 12px 14px 16px; -webkit-overflow-scrolling: touch; }
.ptitle { margin: 2px 0 10px; font-family: var(--f-display); font-weight: 400; font-size: 18px; color: var(--gold-2); }
.pnote { margin: 0 0 12px; font-size: 13px; color: var(--ink-dim); line-height: 1.5; }
.pnote b { color: var(--ink); }

.stages { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.stage { display: grid; grid-template-columns: 54px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--navy-2); border: 2px solid transparent; cursor: pointer; }
.stage.sel { border-color: var(--gold); background: #2d3550; }
.stage.locked { opacity: .45; cursor: not-allowed; }
.stage .num { font-family: var(--f-display); font-size: 20px; color: var(--gold-2); text-align: center; }
.stage .nm { font-weight: 700; font-size: 14px; }
.stage .foes { display: flex; gap: 3px; margin-top: 3px; }
.stage .foes img { height: 22px; width: auto; }
.stage .tag { font-size: 11px; padding: 3px 8px; border-radius: 999px; background: var(--navy-3); color: var(--ink-dim); white-space: nowrap; }
.stage .tag.boss { background: var(--red); color: #fff; }
.stage .tag.done { background: rgba(79, 174, 90, .25); color: #9be0a3; }

.parts { display: grid; gap: 10px; }
.part { display: grid; grid-template-columns: 46px 1fr auto; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; background: var(--navy-2); }
.part .ico { width: 46px; height: 46px; border-radius: 10px; display: grid; place-items: center; font-family: var(--f-display); font-size: 18px; color: var(--gold-ink); background: linear-gradient(160deg, var(--gold-2), var(--gold)); }
.part .pn { font-weight: 700; }
.part .pn small { margin-left: 6px; color: var(--gold-2); font-family: var(--f-display); font-weight: 400; font-size: 15px; }
.part .eff { font-size: 12px; color: var(--ink-dim); margin-top: 3px; line-height: 1.45; }
.part .eff b { color: #9be0a3; font-weight: 600; }
.part .eff .m { display: inline-block; padding: 0 5px; border-radius: 4px; background: var(--navy-3); color: var(--ink); font-size: 10px; margin-right: 4px; }
.upbtn { min-width: 86px; padding: 8px 10px; border-radius: 10px; background: var(--gold); color: var(--gold-ink); font-weight: 700; font-size: 13px; line-height: 1.25; }
.upbtn small { display: block; font-weight: 600; font-size: 11px; }
.upbtn:disabled { background: #444b5c; color: #9aa0ad; cursor: not-allowed; }
.part.locked { opacity: .55; }
.part.flash { animation: pflash .7s; }
@keyframes pflash { 30% { background: #3f5a3f; } }

.deckgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; justify-items: center; }
.deckgrid .card { --cw: 104px; position: relative; }

.base-foot { position: relative; z-index: 2; display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; padding: 8px max(16px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 14px) max(16px, env(safe-area-inset-left, 0px)); max-width: 1240px; width: 100%; margin: 0 auto; }
.bigbtn { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px 14px; border-radius: 16px; min-height: 64px; box-shadow: 0 4px 0 rgba(0, 0, 0, .35); transition: transform .08s; }
.bigbtn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, .35); }
.bigbtn small { font-size: 12px; opacity: .85; font-weight: 600; }
.bigbtn b { font-family: var(--f-display); font-weight: 400; font-size: 22px; letter-spacing: .5px; }
.bigbtn.go { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--gold-ink); }
.bigbtn.pvp { background: linear-gradient(180deg, #e2685a, #b8392b); color: #fff; }
.bigbtn:disabled { background: #3a4152; color: #8b92a2; box-shadow: none; cursor: not-allowed; }

/* ---------- 카드 ---------- */
.card { position: absolute; width: var(--cw); height: calc(var(--cw) * 1.4); border-radius: calc(var(--cw) * .08); background: var(--navy); padding: calc(var(--cw) * .045); color: var(--card-ink);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .45), inset 0 0 0 2px var(--fr, var(--skl)); display: flex; flex-direction: column; cursor: pointer; transition: transform .16s, box-shadow .16s, opacity .2s; font-size: calc(var(--cw) * .085); }
.card.atk { --fr: var(--atk); }
.card.skl { --fr: var(--skl); }
.card.pow { --fr: var(--pow); }
.card .cname { height: 16%; display: flex; align-items: center; justify-content: center; font-family: var(--f-display); color: var(--ink); font-size: 1.25em; letter-spacing: .3px; padding-left: 14%; white-space: nowrap; }
.card .art { height: 40%; border-radius: 6px; background: var(--art, none) center/cover no-repeat, linear-gradient(160deg, #6d8fb1, #2e4466); border: 2px solid rgba(0, 0, 0, .35); position: relative; }
.card.atk .art { background: var(--art, none) center/cover no-repeat, linear-gradient(160deg, #e0957a, #7a2d22); }
.card.pow .art { background: var(--art, none) center/cover no-repeat, linear-gradient(160deg, #f0d084, #8a5e12); }
.card .art .glyph { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--f-display); font-size: 2.8em; color: rgba(255, 255, 255, .85); text-shadow: 0 2px 0 rgba(0, 0, 0, .3); }
.card .art.has .glyph { display: none; }
.card .ctype { align-self: center; margin-top: -0.6em; position: relative; padding: 0 .8em; border-radius: 4px; background: var(--fr); color: #fff; font-size: .8em; font-weight: 700; line-height: 1.5; }
.card .ctext { flex: 1; margin-top: .3em; border-radius: 6px; background: var(--card-body); display: flex; align-items: center; justify-content: center; text-align: center; padding: .3em .45em; font-size: 1em; line-height: 1.35; font-weight: 600; word-break: keep-all; }
.card .ctext b { color: #b5311f; }
.card .ctext b.up { color: #2f8a3b; }
.card .ctext b.down { color: #c0392b; }
.card .ctext em { font-style: normal; color: #6a4bb0; font-weight: 700; }
.card .cost { position: absolute; left: -6%; top: -4%; width: 28%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-family: var(--f-display); font-size: 1.7em; color: var(--ink);
  background: radial-gradient(circle at 35% 30%, #4d5c7e, #1b2232 70%); border: 2px solid var(--gold); box-shadow: 0 2px 4px rgba(0, 0, 0, .5); z-index: 2; }
.card.unplayable .cost { color: #ff7b6b; }
.card.unplayable { filter: saturate(.55) brightness(.85); }
.card.static { position: relative; cursor: default; }
.card.pickable:hover { transform: translateY(-6px) scale(1.04); box-shadow: 0 12px 22px rgba(0, 0, 0, .55), inset 0 0 0 2px var(--fr), 0 0 0 3px var(--gold); }

/* ---------- 카드 전투 ---------- */
.fight-top .heart { color: #ff5a5a; font-size: 20px; }
.fight-top .tb-who b { font-family: var(--f-display); font-weight: 400; font-size: 20px; color: #ff8a7a; margin-right: 8px; }
.ftitle { font-size: 13px; color: var(--ink-dim); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ftitle b { font-family: var(--f-display); font-weight: 400; color: var(--ink); font-size: 20px; margin-left: 4px; }
.iconbtn { padding: 6px 12px; border-radius: 8px; background: rgba(0, 0, 0, .4); border: 1px solid var(--line); font-size: 13px; }

.field { position: relative; z-index: 2; flex: 1; display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.3fr); align-items: end; padding: 0 max(20px, 3vw) 2vh; min-height: 0; }
.side-me { display: flex; justify-content: center; align-items: flex-end; padding-bottom: 1vh; }
.side-foe { display: flex; justify-content: space-evenly; align-items: flex-end; gap: 2vw; padding-bottom: 1vh; }
.unit { position: relative; display: flex; flex-direction: column; align-items: center; transition: transform .18s ease-out; }
.unit .unitart { width: calc(var(--uw, 160px) * var(--us, 1)); }
.side-me .unit { --uw: clamp(150px, 22vw, 300px); }
.side-foe .unit { --uw: clamp(96px, 14vw, 200px); }
.side-foe .unit { min-width: 0; flex: 0 1 auto; }
.side-foe .unit .unitart, .side-foe .unit .hpbar { max-width: 100%; }
.unit.fly .unitart { margin-bottom: 4vh; animation: hover 2.4s ease-in-out infinite; }
@keyframes hover { 50% { transform: translateY(-8px); } }
.unit .ushadow { width: 80%; height: 14px; margin-top: -10px; border-radius: 50%; background: rgba(0, 0, 0, .38); filter: blur(4px); }
.unit.fly .ushadow { width: 50%; opacity: .6; }
.hpbar { position: relative; width: clamp(96px, 12vw, 170px); height: 16px; margin-top: 6px; border-radius: 8px; background: rgba(0, 0, 0, .6); border: 1px solid rgba(0, 0, 0, .6); overflow: hidden; }
.hpbar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(180deg, #ef5f4f, #b8392b); transition: width .3s; }
.hpbar .lag { background: #f6d27a; transition: width .8s .25s; }
.hpbar span { position: relative; display: block; text-align: center; font-size: 11px; line-height: 15px; font-weight: 700; text-shadow: 0 1px 2px #000; font-variant-numeric: tabular-nums; }
.hpbar.shielded { border-color: #7fb6ff; box-shadow: 0 0 0 2px rgba(127, 182, 255, .55); }
.hpbar.shielded i:not(.lag) { background: linear-gradient(180deg, #7fb6ff, #3c78c6); }
.badges { display: flex; gap: 4px; margin-top: 4px; min-height: 22px; flex-wrap: wrap; justify-content: center; }
.badge { display: inline-flex; align-items: center; gap: 2px; padding: 1px 6px; border-radius: 999px; font-size: 11px; font-weight: 700; background: rgba(0, 0, 0, .55); border: 1px solid var(--line); }
.badge.blk { background: #2e5a94; border-color: #7fb6ff; }
.badge.str { background: #8a3a25; }
.badge.weak { background: #5b4a7a; }
.badge.vuln { background: #7a4a2a; }
.intent { position: absolute; top: -34px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; background: rgba(14, 18, 28, .82); border: 1px solid var(--line); font-family: var(--f-display); font-size: 18px; white-space: nowrap; animation: bob 1.6s ease-in-out infinite; z-index: 3; }
.intent .ic { width: 20px; height: 20px; }
.intent.atk { color: #ffb4a6; }
.intent.def { color: #a9cdff; }
.intent.buf { color: #ffd77a; }
.intent.dbf { color: #d3b6ff; }
@keyframes bob { 50% { transform: translate(-50%, -4px); } }
.unit.foe { cursor: default; }
.unit.foe.targetable { cursor: crosshair; }
.unit.foe { cursor: pointer; }
.unit.foe.targetable .unitart { filter: drop-shadow(0 0 6px rgba(255, 210, 120, .9)); }
.unit.foe.targetable:hover .unitart, .unit.foe.aimed .unitart { filter: drop-shadow(0 0 10px #ffdf7a) drop-shadow(0 0 2px #fff); }
.unit .reticle { position: absolute; inset: -6% 10% 30%; border: 3px dashed #ffdf7a; border-radius: 50%; opacity: 0; pointer-events: none; transition: opacity .15s; }
.unit.aimed .reticle { opacity: 1; animation: spin 3s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.unit.dead { animation: die .7s forwards; pointer-events: none; }
@keyframes die { 40% { filter: brightness(3) saturate(0); } 100% { opacity: 0; transform: translateY(20px) scale(.9); } }
.unit.hit .unitart { animation: hit .35s; }
@keyframes hit { 20% { transform: translateX(10px); filter: brightness(2.2) saturate(.3); } 50% { transform: translateX(-6px); } }
.unit.lunge-r { transform: translateX(28px); }
.unit.lunge-l { transform: translateX(-28px); }
.unit.recoil-r { transform: translateX(-14px); }

.handzone { position: relative; z-index: 3; height: calc(var(--cw) * 1.4 + 22px + env(safe-area-inset-bottom, 0px)); display: flex; align-items: flex-end; padding: 0 max(12px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(12px, env(safe-area-inset-left, 0px)); }
.hand { position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); width: 0; height: 0; }
.hand .card { left: 0; bottom: 0; transform-origin: 50% 100%; }
.hand .card:hover, .hand .card.sel { z-index: 20 !important; }
.energy { position: absolute; left: max(14px, env(safe-area-inset-left, 0px)); bottom: calc(env(safe-area-inset-bottom, 0px) + var(--cw) * .62); width: calc(var(--cw) * .66); aspect-ratio: 1; clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
  background: radial-gradient(circle at 40% 35%, #59678a, #1b2232 70%); display: flex; align-items: center; justify-content: center; font-family: var(--f-display); font-size: calc(var(--cw) * .2); color: var(--ink); box-shadow: inset 0 0 0 4px var(--gold); }
.energy::before { content: ""; position: absolute; inset: 0; clip-path: inherit; border: 4px solid var(--gold); }
.energy.empty b:first-child { color: #ff7b6b; }
.energy span { opacity: .6; margin: 0 1px; }
.pile { position: absolute; bottom: calc(env(safe-area-inset-bottom, 0px) + 8px); display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 11px; color: var(--ink-dim); }
.pile.draw { left: max(14px, env(safe-area-inset-left, 0px)); }
.pile.disc { right: max(14px, env(safe-area-inset-right, 0px)); }
.pile i { width: 26px; height: 34px; border-radius: 4px; background: linear-gradient(160deg, #e4d7bd, #a7987c); border: 2px solid #3a3326; box-shadow: 3px -3px 0 -1px #c9bb9e, 3px -3px 0 1px #3a3326; }
.pile b { position: absolute; top: -8px; right: -10px; min-width: 22px; height: 22px; border-radius: 11px; background: var(--navy); border: 2px solid var(--ink-dim); color: var(--ink); font-size: 12px; display: grid; place-items: center; }
.endturn { position: absolute; right: max(14px, env(safe-area-inset-right, 0px)); bottom: calc(env(safe-area-inset-bottom, 0px) + var(--cw) * .62); padding: 12px 22px; border-radius: 999px; background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--gold-ink); font-family: var(--f-display); font-size: calc(var(--cw) * .15); box-shadow: 0 4px 0 #8a6214, 0 0 0 2px #2b1f08; white-space: nowrap; }
.endturn kbd { font-size: 11px; vertical-align: 2px; }
.endturn:disabled { background: #555c6c; color: #a6abb6; box-shadow: 0 4px 0 #333845; cursor: wait; }
.endturn.pulse { animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 4px 0 #8a6214, 0 0 0 2px #2b1f08, 0 0 18px 4px rgba(246, 210, 122, .7); } }
.tiphint { position: absolute; left: 50%; top: 64px; transform: translateX(-50%); z-index: 6; padding: 6px 14px; border-radius: 999px; background: rgba(14, 18, 28, .85); border: 1px solid var(--line); font-size: 13px; pointer-events: none; opacity: 0; transition: opacity .2s; white-space: nowrap; }
.tiphint.on { opacity: 1; }
.banner { position: fixed; left: 0; right: 0; top: 40%; z-index: 30; text-align: center; font-family: var(--f-display); font-size: clamp(30px, 6vw, 56px); color: var(--ink); text-shadow: 0 3px 0 #000, 0 0 20px rgba(0, 0, 0, .6); pointer-events: none; animation: banner 1.1s forwards; }
.banner.foe { color: #ff8f7f; }
@keyframes banner { 0% { opacity: 0; transform: scale(1.4); } 20% { opacity: 1; transform: scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: scale(.95); } }
.dmgnum { position: fixed; z-index: 40; font-family: var(--f-display); font-size: 34px; color: #fff; text-shadow: 0 3px 0 #7a1a10, 0 0 8px rgba(0, 0, 0, .6); pointer-events: none; animation: dmg 1s ease-out forwards; transform: translate(-50%, -50%); }
.dmgnum.blk { color: #a9cdff; text-shadow: 0 3px 0 #1d3f6e; font-size: 26px; }
.dmgnum.heal { color: #9be0a3; text-shadow: 0 3px 0 #1d5a26; }
.dmgnum.info { font-size: 20px; color: #ffd77a; text-shadow: 0 2px 0 #4a3108; }
@keyframes dmg { 0% { opacity: 0; transform: translate(-50%, -20%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -60%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -160%) scale(1); } }
.shell { position: fixed; z-index: 35; width: 18px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #fff6c8, #f0b13a); box-shadow: 0 0 10px #ffd36b; pointer-events: none; }
.boom { position: fixed; z-index: 36; width: 90px; height: 90px; margin: -45px 0 0 -45px; border-radius: 50%; background: radial-gradient(circle, #fff6c8 0%, #ffb347 35%, rgba(210, 79, 62, .6) 60%, rgba(0, 0, 0, 0) 72%); pointer-events: none; animation: boom .4s forwards; }
@keyframes boom { from { transform: scale(.3); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
.muzzle { position: fixed; z-index: 36; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: radial-gradient(circle, #fff 0%, #ffd36b 40%, rgba(255, 140, 40, 0) 70%); pointer-events: none; animation: boom .2s forwards; }
.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translate(6px, -3px); } 50% { transform: translate(-5px, 2px); } 75% { transform: translate(3px, 1px); } }

/* ---------- 덮개 창 ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(8, 10, 16, .72); backdrop-filter: blur(3px); }
.sheet { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 22px 20px 20px; border-radius: 18px; background: linear-gradient(180deg, #232b40, #171d2c); border: 2px solid rgba(233, 184, 76, .6); text-align: center; box-shadow: 0 20px 50px rgba(0, 0, 0, .5); animation: pop .3s; }
.sheet.wide { width: min(860px, 100%); }
@keyframes pop { from { transform: scale(.9); opacity: 0; } }
.sheet h2 { margin: 0 0 12px; font-family: var(--f-display); font-weight: 400; font-size: 34px; color: var(--gold-2); }
.sheet > p { margin: 0 0 12px; color: var(--ink-dim); line-height: 1.5; }
.sheet img { height: 130px; width: auto; margin: -6px 0 4px; }
.gains { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 14px; }
.gain { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); font-weight: 700; }
.gain i { width: 16px; height: 16px; border-radius: 50%; }
.gain.exp i { background: linear-gradient(90deg, #6fb0ff, #9fd2ff); border-radius: 3px; }
.gain.gold i { background: radial-gradient(circle at 35% 35%, #fff2b0, #e9b84c 55%, #9a6a14); }
.gain.steel i { background: linear-gradient(135deg, #e3ecf5, #8ea3b8 55%, #56677a); border-radius: 3px; }
.pick { margin: 4px 0 10px; font-weight: 700; }
.rwcards { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.rwcards .card { --cw: clamp(110px, 26vw, 140px); }
.primary, .ghost { padding: 11px 26px; border-radius: 999px; font-weight: 700; font-size: 15px; }
.primary { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--gold-ink); box-shadow: 0 3px 0 #8a6214; }
.ghost { border: 1px solid var(--line); color: var(--ink-dim); }
.row { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.lvup img { height: 150px; }
.lvnum { font-family: var(--f-display); font-size: 26px; margin: 0 0 10px; color: var(--ink); }
.lvnum b { color: var(--gold-2); font-weight: 400; }
.lvup ul { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 6px; text-align: left; }
.lvup li { padding: 8px 12px; border-radius: 10px; background: rgba(0, 0, 0, .3); font-size: 14px; }
.lvup li b { color: #9be0a3; }
.lvup li.unlock { border: 1px solid var(--gold); color: var(--gold-2); font-weight: 700; }
.toast { position: fixed; left: 50%; bottom: 120px; transform: translateX(-50%); z-index: 60; padding: 10px 18px; border-radius: 999px; background: rgba(14, 18, 28, .94); border: 1px solid var(--gold); font-size: 14px; font-weight: 600; max-width: calc(100vw - 32px); text-align: center; }
.loading { position: fixed; inset: 0; z-index: 99; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: #11151f; }
.loading b { font-family: var(--f-display); font-weight: 400; font-size: 40px; color: var(--gold-2); }
.loading span { color: var(--ink-dim); }

/* ---------- 매칭 ---------- */
.match { position: relative; z-index: 2; margin: auto; display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; align-items: center; width: min(760px, calc(100% - 32px)); }
.mcard { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 12px; border-radius: 18px; background: rgba(18, 23, 35, .88); border: 2px solid var(--blue); }
.mcard.foe { border-color: var(--red); }
.mface { width: 110px; height: 110px; border-radius: 50%; background: #2b3247 50% 14% / 150% no-repeat; border: 3px solid currentColor; display: grid; place-items: center; font-family: var(--f-display); font-size: 48px; color: var(--ink-dim); }
.mcard.me .mface { color: var(--blue); }
.mcard.foe .mface { color: var(--red); }
.mface.q { animation: pulseq 1s infinite; }
@keyframes pulseq { 50% { opacity: .5; } }
.mname { font-family: var(--f-display); font-weight: 400; font-size: 22px; margin-top: 6px; }
.mlv { font-weight: 700; color: var(--gold-2); }
.mpow { font-size: 13px; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.mmid { text-align: center; }
.vs { font-family: var(--f-display); font-size: 54px; color: var(--gold-2); text-shadow: 0 3px 0 #000; }
.mstatus { max-width: 200px; font-size: 13px; line-height: 1.5; color: var(--ink); min-height: 4.5em; }
.mdots { display: flex; justify-content: center; gap: 6px; margin-top: 6px; }
.mdots i { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); animation: dot 1s infinite; }
.mdots i:nth-child(2) { animation-delay: .15s; }
.mdots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 50% { transform: translateY(-6px); opacity: .4; } }

/* ---------- 3D 대전 ---------- */
#scrArena { background: #c9d6c4; }
#stage3d { position: absolute; inset: 0; }
#stage3d canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.ahud { position: relative; z-index: 3; display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; padding: calc(env(safe-area-inset-top, 0px) + 8px) max(14px, env(safe-area-inset-right, 0px)) 8px max(14px, env(safe-area-inset-left, 0px)); background: linear-gradient(180deg, rgba(14, 18, 28, .85), rgba(14, 18, 28, 0)); pointer-events: none; }
.aside { display: flex; align-items: center; gap: 8px; min-width: 0; }
.aside.foe { justify-content: flex-end; text-align: right; }
.aface { width: 46px; height: 46px; border-radius: 50%; flex: none; background: #2b3247 50% 14% / 165% no-repeat; border: 3px solid var(--blue); }
.aside.foe .aface { border-color: var(--red); }
.awho { min-width: 0; flex: 1; max-width: 240px; }
.awho b { font-size: 13px; white-space: nowrap; }
.abar { height: 12px; border-radius: 6px; background: rgba(0, 0, 0, .5); overflow: hidden; margin-top: 3px; }
.abar i { display: block; height: 100%; width: 100%; background: linear-gradient(180deg, #8fd896, #4fae5a); transition: width .2s; }
.aside.foe .abar i { background: linear-gradient(180deg, #ef7a6a, #c9493a); margin-left: auto; }
.akills { margin-top: 3px; font-size: 14px; letter-spacing: 2px; color: #ffd77a; min-height: 1em; }
.aclock { text-align: center; }
.aclock b { display: block; font-family: var(--f-display); font-weight: 400; font-size: 28px; line-height: 1; text-shadow: 0 2px 0 #000; font-variant-numeric: tabular-nums; }
.aclock small { font-size: 11px; color: var(--ink-dim); }
.akeys { position: absolute; z-index: 3; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 12px); transform: translateX(-50%); padding: 6px 14px; border-radius: 999px; background: rgba(14, 18, 28, .75); font-size: 13px; white-space: nowrap; pointer-events: none; }
.stick { position: absolute; z-index: 4; left: max(22px, env(safe-area-inset-left, 0px)); bottom: calc(env(safe-area-inset-bottom, 0px) + 26px); width: 130px; height: 130px; border-radius: 50%; background: rgba(14, 18, 28, .35); border: 2px solid rgba(255, 255, 255, .35); touch-action: none; display: none; }
.stick i { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px; border-radius: 50%; background: rgba(255, 255, 255, .85); box-shadow: 0 3px 8px rgba(0, 0, 0, .4); }
.firebtn { position: absolute; z-index: 4; right: max(26px, env(safe-area-inset-right, 0px)); bottom: calc(env(safe-area-inset-bottom, 0px) + 40px); width: 100px; height: 100px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #f27d6c, #b8392b); color: #fff; font-family: var(--f-display); font-size: 22px; box-shadow: 0 5px 0 #6d1f15; touch-action: none; display: none; }
.firebtn.down { transform: translateY(4px); box-shadow: 0 1px 0 #6d1f15; }
body.touch .stick, body.touch .firebtn { display: block; }
body.touch .akeys { display: none; }
.countdown { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; font-family: var(--f-display); font-size: 110px; color: #fff; text-shadow: 0 6px 0 #000; pointer-events: none; }
.float3d { position: fixed; z-index: 6; transform: translate(-50%, -50%); font-family: var(--f-display); font-size: 24px; color: #fff; text-shadow: 0 2px 0 #7a1a10; pointer-events: none; animation: dmg .9s ease-out forwards; }

/* ---------- 좁은 화면 ---------- */
@media (max-width: 760px) {
  .base-main { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); gap: 10px; padding-top: 8px; }
  .hero { min-height: 190px; }
  .hero-unit { width: min(64%, 300px); margin-bottom: 4px; }
  .power b { font-size: 22px; }
  .bigbtn b { font-size: 19px; }
  .tb-face { width: 36px; height: 36px; }
  .xpbar { width: 110px; }
  .field { grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr); padding: 0 10px 1vh; }
  .side-me .unit { --uw: clamp(120px, 38vw, 230px); }
  .side-foe .unit { --uw: clamp(80px, 23vw, 150px); }
  .hpbar { width: clamp(70px, 20vw, 120px); height: 14px; }
  .intent { font-size: 15px; top: -28px; }
  .handzone { height: calc(var(--cw) * 1.4 + 74px + env(safe-area-inset-bottom, 0px)); }
  .endturn { padding: 9px 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + var(--cw) * 1.4 + 22px); font-size: 17px; }
  .energy { bottom: calc(env(safe-area-inset-bottom, 0px) + var(--cw) * 1.4 + 16px); width: 62px; font-size: 22px; }
  .pile { bottom: calc(env(safe-area-inset-bottom, 0px) + var(--cw) * 1.4 + 22px); }
  .pile.draw { left: 88px; }
  .pile.disc { right: 132px; }
  .pile span { display: none; }
  .endturn kbd { display: none; }
  .match { grid-template-columns: 1fr; gap: 10px; }
  .mface { width: 70px; height: 70px; font-size: 32px; }
  .vs { font-size: 36px; }
  .mstatus { max-width: none; min-height: 3em; }
  .aface { width: 36px; height: 36px; }
  .aclock b { font-size: 22px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  :root { --cw: clamp(66px, 8.6vw, 96px); }
  .topbar { padding-top: calc(env(safe-area-inset-top, 0px) + 4px); padding-bottom: 4px; }
  .tb-face { width: 32px; height: 32px; }
  .base-main { padding-top: 8px; gap: 10px; }
  .hero-unit { width: min(78%, 280px); margin-bottom: 2px; }
  .power { padding: 4px 10px; } .power b { font-size: 18px; }
  .recon { padding: 4px 8px; }
  .bigbtn { min-height: 46px; padding: 4px 10px; } .bigbtn b { font-size: 17px; }
  .base-foot { padding-top: 4px; padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 8px); }
  .tab { padding: 7px 6px; }
  .side-me .unit { --uw: clamp(100px, 17vw, 190px); }
  .side-foe .unit { --uw: clamp(64px, 10.5vw, 130px); }
  .hpbar { height: 13px; } .hpbar span { font-size: 10px; line-height: 12px; }
  .intent { font-size: 14px; top: -26px; }
  .tiphint { top: 42px; font-size: 12px; }
  .endturn { font-size: 15px; padding: 8px 14px; }
  .match { grid-template-columns: 1fr auto 1fr; }
}

/* 세로 휴대폰: 카드를 크게, 덜 기울여 겹침 줄이기 (누르면 더 크게) */
@media (max-width: 600px) and (orientation: portrait) {
  :root { --cw: min(30vw, 124px); }
  .card { font-size: calc(var(--cw) * .088); }
  .handzone { height: calc(var(--cw) * 1.4 + 70px + env(safe-area-inset-bottom, 0px)); }
  .hand { bottom: calc(env(safe-area-inset-bottom, 0px) + 12px); }
  .endturn { bottom: calc(env(safe-area-inset-bottom, 0px) + var(--cw) * 1.4 + 22px); }
  .energy { bottom: calc(env(safe-area-inset-bottom, 0px) + var(--cw) * 1.4 + 16px); }
  .pile { bottom: calc(env(safe-area-inset-bottom, 0px) + var(--cw) * 1.4 + 22px); }
}

/* 카드 던지기 · 조준 화살표 */
.card.ghost { position: fixed; z-index: 45; transform: translate(-50%, -50%); pointer-events: none; box-shadow: 0 0 0 3px var(--gold-2), 0 0 26px 6px rgba(246, 210, 122, .65), 0 10px 20px rgba(0, 0, 0, .5); }
.cardburst { position: fixed; z-index: 44; width: 140px; height: 140px; margin: -70px 0 0 -70px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 246, 200, .95) 0%, rgba(246, 210, 122, .7) 30%, rgba(233, 184, 76, 0) 65%); animation: boom .45s forwards; }
.minicard { position: fixed; z-index: 44; width: 26px; height: 36px; border-radius: 4px; transform: translate(-50%, -50%); background: var(--navy); border: 2px solid var(--fr, var(--skl)); box-shadow: 0 0 8px rgba(246, 210, 122, .8); pointer-events: none; }
.minicard.atk { --fr: var(--atk); } .minicard.skl { --fr: var(--skl); } .minicard.pow { --fr: var(--pow); }
.pile.bump i { animation: bump .35s; }
.hand .card { touch-action: none; }
.hand .card.dragging { transition: none; z-index: 30 !important; }
.hand .card.willplay { box-shadow: 0 0 0 3px var(--gold-2), 0 0 24px 6px rgba(246, 210, 122, .7); }
.aimarrow { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 42; pointer-events: none; color: #f6d27a; opacity: 0; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .6)); }
.aimarrow.on { opacity: 1; }
.aimarrow.hot { color: #ff6b57; }

/* 탱크(짝꿍) 목록 */
.power em { display: block; font-style: normal; font-size: 12px; color: var(--ink); margin-top: 2px; font-weight: 600; }
.tankgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.tcard { position: relative; display: grid; grid-template-columns: 96px 1fr; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--navy-2); border: 2px solid transparent; cursor: pointer; }
.tcard.on { border-color: var(--gold); background: #2d3550; }
.tcard.locked .tpic img { filter: brightness(0) opacity(.45); }
.tcard.locked .tinfo { opacity: .6; }
.tpic { aspect-ratio: 1.56; display: grid; place-items: center; }
.tpic img { width: 100%; height: 100%; object-fit: contain; }
.tname { font-family: var(--f-display); font-size: 17px; color: var(--gold-2); }
.tname small { font-family: var(--f-body); font-size: 12px; color: var(--ink); margin-left: 4px; font-weight: 600; }
.tcls { display: inline-block; margin: 2px 0 3px; padding: 0 7px; border-radius: 999px; font-size: 10px; font-weight: 700; line-height: 17px; }
.tcls.round { background: #3d6b46; } .tcls.radar { background: #6b5a2a; } .tcls.assault { background: #5a3d6b; }
.tperk { font-size: 11px; color: var(--ink-dim); line-height: 1.45; }
.tperk .m { display: inline-block; padding: 0 4px; border-radius: 4px; background: var(--navy-3); color: var(--ink); font-size: 10px; margin-right: 4px; }
.tstate { position: absolute; top: 6px; right: 8px; font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: rgba(0, 0, 0, .35); color: var(--ink-dim); }
.tcard.on .tstate { background: var(--gold); color: var(--gold-ink); }
.lvup img { max-width: 100%; object-fit: contain; }
.cheatbtn { width: 100%; margin: 0 0 10px; padding: 9px 12px; border-radius: 10px; border: 1px dashed var(--gold); color: var(--gold-2); font-weight: 700; font-size: 13px; background: rgba(233, 184, 76, .08); }
.cheatbtn.on { background: var(--gold); color: var(--gold-ink); border-style: solid; }

/* ===== 2D 탱크 움직임 · 등급 빛 · 부품 장식 ===== */
@keyframes idleBob { 0%, 100% { transform: translateY(0) rotate(0deg); } 30% { transform: translateY(-1.6%) rotate(-.5deg); } 60% { transform: translateY(.4%) rotate(.3deg); } }
@keyframes driveBob { 0%, 100% { transform: translateY(0) rotate(0deg); } 25% { transform: translateY(-3.5%) rotate(-1.4deg); } 50% { transform: translateY(.8%) rotate(.6deg); } 75% { transform: translateY(-2%) rotate(-.8deg); } }
.unitart.ride > .spr, .unitart.ride > .dec:not(.rays) { animation: idleBob 1.15s ease-in-out infinite; }
.unitart.ride.driving > .spr, .unitart.ride.driving > .dec:not(.rays) { animation: driveBob .32s linear infinite; }
.unitart .dec { position: absolute; pointer-events: none; }
.unitart .tread { left: 0; right: 0; bottom: 0; height: 30%; z-index: 3; -webkit-mask-size: 100% 333%; mask-size: 100% 333%; -webkit-mask-position: bottom; mask-position: bottom; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  background: repeating-linear-gradient(90deg, rgba(0, 0, 0, .34) 0 5px, rgba(255, 255, 255, .06) 5px 7px, transparent 7px 15px); mix-blend-mode: multiply; animation: idleBob 1.15s ease-in-out infinite, treadRoll 1.4s linear infinite !important; }
.unitart.driving .tread { animation: driveBob .32s linear infinite, treadRoll .35s linear infinite !important; }
@keyframes treadRoll { from { background-position: 0 0; } to { background-position: -30px 0; } }
.unitart .shine { inset: 0; z-index: 4; -webkit-mask-size: 100% 100%; mask-size: 100% 100%; background-size: 260% 100%; background-repeat: no-repeat; mix-blend-mode: screen; }
.unitart .shine.t1 { background-image: linear-gradient(105deg, transparent 42%, rgba(232, 160, 96, .55) 50%, transparent 58%); animation: idleBob 1.15s ease-in-out infinite, sweep 3.4s ease-in-out infinite !important; }
.unitart .shine.t2 { background-image: linear-gradient(105deg, transparent 40%, rgba(230, 240, 255, .75) 50%, transparent 60%); animation: idleBob 1.15s ease-in-out infinite, sweep 2.6s ease-in-out infinite !important; }
.unitart .shine.t3 { background-image: linear-gradient(105deg, transparent 36%, rgba(255, 214, 90, .9) 48%, rgba(255, 255, 255, .9) 50%, rgba(255, 214, 90, .9) 52%, transparent 64%); animation: idleBob 1.15s ease-in-out infinite, sweep 1.9s ease-in-out infinite !important; }
@keyframes sweep { 0% { background-position: 130% 0; } 60%, 100% { background-position: -40% 0; } }
.unitart .muzglow { width: 14%; aspect-ratio: 1; transform: translate(-50%, -50%); z-index: 5; border-radius: 50%; }
.unitart .muzglow::before { content: ""; position: absolute; inset: 0; border-radius: 50%; animation: muzPulse 1.2s ease-in-out infinite; }
.unitart .muzglow.t1::before { background: radial-gradient(circle, rgba(255, 190, 120, .9), rgba(205, 127, 50, .4) 40%, transparent 70%); }
.unitart .muzglow.t2::before { background: radial-gradient(circle, #fff, rgba(190, 220, 255, .7) 35%, transparent 70%); }
.unitart .muzglow.t3::before { background: radial-gradient(circle, #fff, rgba(255, 210, 80, .95) 30%, rgba(255, 120, 30, .4) 55%, transparent 72%); animation-duration: .7s; }
@keyframes muzPulse { 50% { transform: scale(1.35); opacity: .7; } }
.unitart .exhaust { width: 1px; height: 1px; z-index: 0; }
.unitart .exhaust i { position: absolute; left: 0; top: 0; width: 28px; height: 28px; margin: -14px; border-radius: 50%; background: url(fx/fx_smoke.webp) center/contain no-repeat, radial-gradient(circle, rgba(200, 200, 200, .7), transparent 70%); animation: puffOut 1.4s ease-out infinite; opacity: 0; }
.unitart .exhaust.t3 i { background: radial-gradient(circle, #fff 10%, #6fd0ff 35%, rgba(60, 120, 255, .4) 60%, transparent 72%); animation-duration: .6s; mix-blend-mode: screen; }
@keyframes puffOut { 0% { opacity: .9; transform: translate(0, 0) scale(.4); } 100% { opacity: 0; transform: translate(-60px, -26px) scale(1.6); } }
.unitart .orbit { left: 50%; top: 18%; width: 0; height: 0; z-index: 6; }
.unitart .orbit i { position: absolute; width: 12px; height: 12px; margin: -6px; border-radius: 50%; animation: orbitSpin 1.6s linear infinite; }
.unitart .orbit.t1 i { background: radial-gradient(circle, #ffe1b0, #cd7f32 60%, transparent 70%); }
.unitart .orbit.t2 i { background: radial-gradient(circle, #fff, #c9d6e8 60%, transparent 70%); }
.unitart .orbit.t3 i { background: radial-gradient(circle, #fff, #ffcf4a 55%, transparent 70%); box-shadow: 0 0 10px #ffcf4a; }
@keyframes orbitSpin { from { transform: rotate(0deg) translateX(60px) scaleY(.4); } to { transform: rotate(360deg) translateX(60px) scaleY(.4); } }
/* 등급 빛 */
.unitart.g1 > .spr { filter: drop-shadow(0 0 6px rgba(74, 163, 255, .85)); }
.unitart.g2 > .spr { filter: drop-shadow(0 0 8px rgba(192, 123, 255, .95)) drop-shadow(0 0 2px #fff); }
.unitart.g3 > .spr { filter: drop-shadow(0 0 10px rgba(255, 181, 46, 1)) drop-shadow(0 0 3px #fff6c8); }
.unitart .aura { inset: 0; z-index: 0; }
.unitart .aura i { position: absolute; inset: 0; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; transform-origin: 50% 85%; animation: auraPulse 1.5s ease-in-out infinite; }
.unitart.flip .aura i { transform: scaleX(-1); }
.unitart.g2 .aura i { background: radial-gradient(ellipse at 50% 70%, #f3e0ff, #b06bff 55%, #6a2bd1); }
.unitart.g3 .aura i { background: radial-gradient(ellipse at 50% 70%, #fffbe6, #ffd04a 55%, #ff9a1f); }
@keyframes auraPulse { 0%, 100% { scale: 1.08 1.12; filter: blur(5px); opacity: .75; } 50% { scale: 1.15 1.26; filter: blur(9px); opacity: 1; } }
.unitart .embers { inset: 0; z-index: 2; }
.unitart .embers i { position: absolute; bottom: 12%; width: 3%; aspect-ratio: 1; border-radius: 50%; opacity: 0; animation: emberRise 2.2s ease-out infinite; }
.unitart.g2 .embers i { background: #ecd6ff; box-shadow: 0 0 6px 2px #b06bff; }
.unitart.g3 .embers i { background: #fff6cc; box-shadow: 0 0 7px 3px #ffb52e; }
@keyframes emberRise { 0% { bottom: 10%; opacity: 0; transform: scale(.5); } 20% { opacity: 1; } 100% { bottom: 88%; opacity: 0; transform: scale(1.1) translateX(5px); } }
.unitart .rays { left: 50%; top: 45%; width: 150%; aspect-ratio: 1; transform: translate(-50%, -50%); z-index: 0; opacity: .55; mix-blend-mode: screen; }
.unitart.g2 .rays { opacity: .35; filter: hue-rotate(230deg) saturate(1.3); }
.unitart .rays img { width: 100%; height: 100%; object-fit: contain; animation: spin 14s linear infinite; }
.unitart .gspark { width: 9%; aspect-ratio: 1; z-index: 6; }
.unitart .gspark img { width: 100%; height: 100%; animation: twinkle 2.2s ease-in-out infinite; opacity: 0; }
.unitart.g1 .gspark img { filter: hue-rotate(180deg); }
.unitart.g2 .gspark img { filter: hue-rotate(250deg) saturate(1.4); }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.3) rotate(0deg); } 40% { opacity: 1; transform: scale(1) rotate(45deg); } 70% { opacity: 0; transform: scale(.4) rotate(90deg); } }
/* 등장 */
@keyframes driveL { from { transform: translateX(-110vw); } 75% { transform: translateX(14px); } to { transform: translateX(0); } }
@keyframes driveR { from { transform: translateX(110vw); } 75% { transform: translateX(-14px); } to { transform: translateX(0); } }
.fximg { position: fixed; z-index: 37; pointer-events: none; transform: translate(-50%, -50%); }
.fximg.dust { opacity: .9; animation: dustPuff .9s ease-out forwards; }
@keyframes dustPuff { from { opacity: .95; transform: translate(-50%, -50%) scale(.5) rotate(var(--rot, 0deg)); } to { opacity: 0; transform: translate(-50%, -80%) scale(1.5) rotate(var(--rot, 0deg)); } }
.fximg.muz { animation: fxPop .22s ease-out forwards; mix-blend-mode: screen; }
.fximg.boom { animation: fxBoom .5s ease-out forwards; }
@keyframes fxPop { from { opacity: 1; transform: translate(-50%, -50%) scale(.5); } to { opacity: 0; transform: translate(-50%, -50%) scale(1.3); } }
@keyframes fxBoom { 0% { opacity: 1; transform: translate(-50%, -50%) scale(.3); } 60% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.25); } }
/* 동전 */
.flycoin { position: fixed; left: 0; top: 0; width: 28px; height: 28px; z-index: 70; pointer-events: none; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .4)); }
.res.gulp { animation: gulp .25s; }
@keyframes gulp { 40% { transform: scale(1.18); box-shadow: 0 0 14px rgba(255, 210, 90, .8); } }
.res.ticket i { background: url(fx/fx_ticket.webp) center/contain no-repeat !important; border-radius: 0 !important; transform: none !important; width: 24px !important; height: 20px !important; }
.unit.foe:not(.fly) .unitart { animation: idleBob 1.35s ease-in-out infinite; }
.unit.foe:nth-child(2):not(.fly) .unitart { animation-delay: -.5s; }

/* ===== 등급 · 뽑기 · 합성 ===== */
.gbadge { display: inline-block; padding: 0 7px; margin-right: 4px; border-radius: 999px; font-size: 10px; font-weight: 800; line-height: 17px; color: #10131a; }
.gbadge.g0 { background: #aab3bd; } .gbadge.g1 { background: #4aa3ff; } .gbadge.g2 { background: #c07bff; } .gbadge.g3 { background: linear-gradient(90deg, #ffd56a, #ff9d2e); }
.tcard.gr1 { box-shadow: inset 0 0 0 1px rgba(74, 163, 255, .6); }
.tcard.gr2 { box-shadow: inset 0 0 0 1px rgba(192, 123, 255, .8), 0 0 12px rgba(192, 123, 255, .25); }
.tcard.gr3 { box-shadow: inset 0 0 0 1px rgba(255, 181, 46, .9), 0 0 16px rgba(255, 181, 46, .35); background: linear-gradient(135deg, #3a3020, var(--navy-2) 55%); }
.gacha-bar { display: grid; grid-template-columns: 1fr 1fr .8fr; gap: 8px; margin-bottom: 6px; }
.gbtn { display: flex; flex-direction: column; align-items: center; padding: 8px 6px; border-radius: 12px; background: linear-gradient(180deg, #6a4bd1, #4a2fa8); color: #fff; box-shadow: 0 3px 0 #2c1a6b; }
.gbtn b { font-family: var(--f-display); font-weight: 400; font-size: 16px; }
.gbtn small { font-size: 10px; opacity: .9; }
.gbtn.synth { background: linear-gradient(180deg, #2e9a8a, #1d6e62); box-shadow: 0 3px 0 #10443c; }
.rates { margin: 0 0 8px; font-size: 10.5px; color: var(--ink-dim); }
.part .eff .tier { font-weight: 800; }
.tier.t0 { color: #aab3bd; } .tier.t1 { color: #e8a060; } .tier.t2 { color: #d8e4f4; } .tier.t3 { color: #ffd056; text-shadow: 0 0 6px rgba(255, 200, 60, .7); }
.gain.ticket i { background: url(fx/fx_ticket.webp) center/contain no-repeat; border-radius: 0; width: 20px; }

.gacha-ov { background: radial-gradient(ellipse at 50% 40%, rgba(70, 50, 140, .92), rgba(8, 10, 16, .95)); }
.gacha-ov.flash { animation: gflash .6s; }
@keyframes gflash { 0% { background-color: rgba(255, 220, 120, .9); } }
.gacha-stage { width: min(980px, 100%); max-height: calc(100vh - 24px); overflow-y: auto; text-align: center; }
.gacha-stage h2 { font-family: var(--f-display); font-weight: 400; color: var(--gold-2); font-size: 32px; margin: 0 0 10px; }
.gnote { color: var(--ink-dim); margin: 10px 0; }
.gcards { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.gcard { --w: clamp(120px, 26vw, 170px); width: var(--w); aspect-ratio: 5 / 7; perspective: 800px; cursor: pointer; animation: dealIn .45s cubic-bezier(.2, .8, .3, 1.2) both; }
.gcards.many .gcard { --w: clamp(84px, 17vw, 150px); }
@keyframes dealIn { from { opacity: 0; transform: translateY(60px) rotate(-8deg) scale(.7); } }
.ginner { position: relative; width: 100%; height: 100%; transition: transform .55s cubic-bezier(.3, .7, .3, 1.3); transform-style: preserve-3d; }
.gcard.open .ginner { transform: rotateY(180deg); }
.gback, .gface { position: absolute; inset: 0; border-radius: 12px; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
.gback { background: #1b2232; box-shadow: 0 8px 18px rgba(0, 0, 0, .5); }
.gback img { width: 100%; height: 100%; object-fit: cover; }
.gcard:not(.open):hover .gback { box-shadow: 0 0 0 3px var(--gold-2), 0 8px 18px rgba(0, 0, 0, .5); }
.gcard.g3:not(.open) .gback { animation: tease 1.2s ease-in-out infinite; }
@keyframes tease { 50% { box-shadow: 0 0 18px 4px rgba(255, 190, 60, .8); } }
.gface { transform: rotateY(180deg); display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 8px 6px; background: linear-gradient(180deg, #2a3248, #171d2c); border: 3px solid var(--gc, #aab3bd); }
.gface.g0 { --gc: #aab3bd; } .gface.g1 { --gc: #4aa3ff; } .gface.g2 { --gc: #c07bff; background: linear-gradient(180deg, #3a2a58, #171d2c); }
.gface.g3 { --gc: #ffb52e; background: radial-gradient(circle at 50% 40%, #6a4a14, #241a0c 70%); box-shadow: inset 0 0 24px rgba(255, 190, 60, .6); }
.gtop { font-family: var(--f-display); color: var(--gc); font-size: calc(var(--w, 150px) * .12); text-shadow: 0 0 8px var(--gc); }
.gface img { width: 100%; height: 50%; object-fit: contain; filter: drop-shadow(0 0 6px var(--gc)); }
.gname { font-weight: 800; font-size: calc(var(--w, 150px) * .095); }
.gname small { font-weight: 600; opacity: .8; }
.gres { font-size: calc(var(--w, 150px) * .075); color: var(--ink-dim); line-height: 1.3; }
.gres b { color: #9be0a3; }
.banner.legend { color: #ffd056; text-shadow: 0 3px 0 #6a3a00, 0 0 24px rgba(255, 190, 60, .9); font-size: clamp(40px, 9vw, 80px); }

.synth-rows { display: grid; gap: 10px; margin-bottom: 12px; text-align: left; }
.srow { display: grid; grid-template-columns: 90px 1fr auto; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; background: rgba(0, 0, 0, .3); }
.srow .sg { font-weight: 700; font-size: 13px; }
.srow .sth { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; min-height: 34px; }
.srow .sth img { height: 30px; width: auto; }
.srow .sth em { font-size: 12px; color: var(--ink-dim); font-style: normal; }
.srow .primary { padding: 8px 14px; font-size: 13px; line-height: 1.2; }
.srow .primary small { display: block; font-size: 11px; font-weight: 600; }
.srow .primary:disabled { background: #444b5c; color: #9aa0ad; box-shadow: none; }
.synth-stage { position: relative; min-height: 0; display: flex; justify-content: center; align-items: center; margin-bottom: 12px; }
.synth-stage:not(:empty) { min-height: 300px; }
.smat { position: absolute; width: clamp(56px, 16vw, 84px); padding: 6px; border-radius: 10px; background: #232b40; border: 2px solid #aab3bd; animation: merge .9s cubic-bezier(.5, 0, .7, .4) both; }
.smat.g1 { border-color: #4aa3ff; } .smat.g2 { border-color: #c07bff; }
.smat img { width: 100%; height: auto; margin: 0; display: block; }
.smat { --x: 0px; --y: 0px; }
@keyframes merge { 0% { transform: translate(var(--x), var(--y)) scale(1); } 70% { transform: translate(0, 0) scale(.8) rotate(10deg); opacity: 1; filter: brightness(1); } 100% { transform: translateX(0) scale(.3) rotate(40deg); opacity: 0; filter: brightness(3); } }
.sres { display: flex; flex-direction: column; align-items: center; gap: 8px; animation: pop .35s; }
.sres .gcard { --w: 150px; animation: none; cursor: default; }
.sres b { font-family: var(--f-display); font-weight: 400; font-size: 22px; }
.sres.ok b { color: #9be0a3; } .sres.fail b { color: #ff8f7f; }
@media (max-width: 600px) { .srow { grid-template-columns: 1fr; } .gacha-bar { grid-template-columns: 1fr 1fr 1fr; } }

/* ===== 원정 지도 ===== */
.mapbg { position: absolute; inset: -30px; background-color: #1a2234; background-size: cover; background-position: center; filter: blur(14px) brightness(.42) saturate(.8); }
.mapscroll { position: relative; z-index: 2; flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.mapinner { position: relative; width: min(560px, calc(100% - 20px)); margin: 10px auto 14px; border-radius: 18px; background: #2a3248 center / cover no-repeat;
  box-shadow: 0 0 0 2px rgba(255, 236, 190, .18), 0 0 0 6px rgba(8, 10, 18, .55), 0 24px 60px rgba(0, 0, 0, .6); }
.mapinner::before { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(10, 13, 22, .35), transparent 14%, transparent 86%, rgba(10, 13, 22, .35)), radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(8, 10, 18, .45) 100%); }
.maplines .bridge rect { fill: #8a5a2e; stroke: #3b2410; stroke-width: 2; }
.maplines .bridge line { stroke: #5b3a1a; stroke-width: 14; stroke-dasharray: 2.5 4.5; }
.maplines .bridge line.rail { stroke: #3b2410; stroke-width: 2.5; stroke-dasharray: none; }
/* 길: 둥근 점선 + 어두운 테두리 */
.maplines { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.maplines path { fill: none; stroke-linecap: round; }
.maplines .shade path { stroke: rgba(20, 16, 10, .75); stroke-width: 9; stroke-dasharray: 0 13; }
.maplines .dots path { stroke: #fbf3dc; stroke-width: 5; stroke-dasharray: 0 13; }
.maplines .shade path.walked { stroke-dasharray: none; stroke-width: 9; stroke: rgba(8, 10, 16, .5); }
.maplines .dots path.walked { stroke: #f2c45a; stroke-dasharray: none; stroke-width: 4; filter: drop-shadow(0 0 4px rgba(242, 196, 90, .7)); }
.maplines .dots path.open { stroke: #ffe08a; stroke-width: 6; animation: dashmove .9s linear infinite; filter: drop-shadow(0 0 5px rgba(255, 214, 110, .9)); }
.maplines .shade path.open { stroke-width: 10; animation: dashmove .9s linear infinite; }
@keyframes dashmove { to { stroke-dashoffset: -26; } }
/* 칸: 색 테두리 메달 + 아래 이름표 */
.mnode { --nc: #d8c49a; position: absolute; width: 60px; height: 60px; margin: -30px 0 0 -30px; padding: 0; border: 0; background: none; border-radius: 50%; color: var(--ink); transition: transform .15s, opacity .2s, filter .2s; filter: saturate(.5) brightness(.78); }
.mnode .disc { position: absolute; inset: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: radial-gradient(circle at 50% 32%, #46516e, #1d2335 72%); border: 3px solid var(--nc);
  box-shadow: 0 0 0 3px rgba(10, 13, 22, .85), 0 6px 12px rgba(0, 0, 0, .55), inset 0 2px 0 rgba(255, 255, 255, .16), inset 0 -6px 10px rgba(0, 0, 0, .35); }
.mnode .ic { font-size: 26px; line-height: 1; filter: drop-shadow(0 2px 1px rgba(0, 0, 0, .5)); }
.mnode small { position: absolute; left: 50%; top: calc(100% + 5px); transform: translateX(-50%); white-space: nowrap; font-size: 10.5px; font-weight: 800; letter-spacing: .02em;
  padding: 2px 8px; border-radius: 999px; background: rgba(12, 15, 25, .86); border: 1px solid color-mix(in srgb, var(--nc) 55%, transparent); color: #f4efe4; box-shadow: 0 2px 4px rgba(0, 0, 0, .4); }
.mnode:disabled { cursor: default; }
.mnode.t-fight { --nc: #d9c08a; } .mnode.t-elite { --nc: #ff6b5b; } .mnode.t-shop { --nc: #4cc28e; } .mnode.t-rest { --nc: #f39443; }
.mnode.t-event { --nc: #a184f2; } .mnode.t-chest { --nc: #f1c84c; } .mnode.t-boss { --nc: #ff5a48; }
.mnode.done { opacity: .95; filter: saturate(.35) brightness(.8); }
.mnode.done::after { content: '✓'; position: absolute; right: -4px; top: -4px; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 900; color: #1a1408; background: #f2c45a; box-shadow: 0 0 0 2px rgba(10, 13, 22, .9); }
.mnode.cur { opacity: 1; filter: none; }
.mnode.cur .disc { box-shadow: 0 0 0 3px rgba(10, 13, 22, .85), 0 0 0 7px rgba(242, 196, 90, .55), 0 6px 14px rgba(0, 0, 0, .55); }
.mnode.can { opacity: 1; filter: none; cursor: pointer; z-index: 2; }
.mnode.can .disc { background: radial-gradient(circle at 50% 32%, #56638a, #232b42 72%); }
.mnode.can::before { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--nc); animation: canRing 1.4s ease-out infinite; pointer-events: none; }
.mnode.can small { background: var(--nc); color: #1a1408; border-color: transparent; }
.mnode.can:hover { transform: scale(1.1); }
@keyframes canRing { 0% { transform: scale(.92); opacity: .95; } 100% { transform: scale(1.45); opacity: 0; } }
.mnode.boss { width: 112px; height: 112px; margin: -56px 0 0 -56px; }
.mnode.boss .disc { border-width: 4px; background: radial-gradient(circle at 50% 40%, #6b2a22, #26100e 75%);
  box-shadow: 0 0 0 4px rgba(10, 13, 22, .9), 0 0 26px rgba(255, 80, 60, .45), 0 8px 16px rgba(0, 0, 0, .6), inset 0 -10px 18px rgba(0, 0, 0, .5); }
.mnode.boss .bimg { width: 96%; height: auto; transform: scaleX(-1) translateY(6%); filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .6)); }
.mnode.boss small { font-size: 12px; padding: 3px 10px; background: #5a1c16; border-color: #ff7b6b; }
.mnode.boss.can small { background: #ff6b5b; color: #fff; }
/* 내 위치 표시 */
.mme { position: absolute; z-index: 3; width: 34px; height: 34px; margin: -17px 0 0 -17px; pointer-events: none; }
.mme i { display: block; width: 100%; height: 100%; border-radius: 50%; background: #2a3248 center 20% / 150% no-repeat; border: 2px solid #ffe08a; box-shadow: 0 0 0 2px rgba(10, 13, 22, .9), 0 3px 8px rgba(0, 0, 0, .6); animation: meBob 1.6s ease-in-out infinite; }
.mme.start { width: 44px; height: 44px; margin: -22px 0 0 -22px; }
.mme small { position: absolute; left: 50%; top: -18px; transform: translateX(-50%); font-size: 10px; font-weight: 800; color: #1a1408; background: #ffe08a; padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
@keyframes meBob { 50% { transform: translateY(-3px); } }
.maplegend { position: relative; z-index: 2; text-align: center; font-size: 11px; color: var(--ink-dim); padding: 6px 12px calc(env(safe-area-inset-bottom, 0px) + 8px); background: rgba(14, 18, 28, .8); }
.stage.act .num { font-size: 18px; }
.stage .actinfo { font-size: 11px; color: var(--ink-dim); margin-top: 2px; }
.card.up .cname { color: #9be0a3; }

/* 칸 창 (상점·휴식·이벤트·보물) */
.nodesheet .nodeicon { font-size: 46px; line-height: 1; margin-bottom: 4px; }
.nchoices { display: flex; flex-direction: column; gap: 8px; align-items: stretch; max-width: 380px; margin: 6px auto 0; }
.nchoices button:disabled { opacity: .45; cursor: not-allowed; }
.shopgrid { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.shopitem { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.shopitem .card { --cw: clamp(96px, 22vw, 120px); }
.shopitem.sold .card { filter: grayscale(1) brightness(.6); }
.buy, .svc { padding: 7px 14px; border-radius: 999px; background: var(--gold); color: var(--gold-ink); font-weight: 800; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.buy:disabled, .svc:disabled { background: #444b5c; color: #9aa0ad; cursor: not-allowed; }
.cn { display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff2b0, #e9b84c 55%, #9a6a14); }
.services { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.svc { flex-direction: column; border-radius: 12px; background: #2e3a55; color: var(--ink); }
.svc small { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--gold-2); }
.chestbox { width: 120px; margin: 4px auto 12px; animation: hover 1.6s ease-in-out infinite; }
.chestbox img { width: 100%; }
.iconbtn { white-space: nowrap; }
@media (max-width: 600px) {
  #scrMap .ftitle { display: none; }
  #scrMap .tb-who { gap: 6px; }
  #scrMap .tb-who b { font-size: 16px; margin-right: 2px; }
  #scrMap .res { padding: 3px 8px 3px 4px; }
  #scrMap .iconbtn { padding: 6px 9px; font-size: 12px; }
}
@media (max-width: 420px) {
  #scrMap .tb-res { gap: 5px; }
  #scrMap .iconbtn { padding: 5px 7px; }
  #scrMap .res { padding: 2px 6px 2px 3px; }
}

/* ---- 테스트 치트 ---- */
.cheatchip { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 16px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); opacity: .75; }
.cheatchip.on { opacity: 1; background: #6b3fd1; border-color: #c7a8ff; box-shadow: 0 0 10px rgba(160, 110, 255, .7); }
.cheat-sheet { max-width: 440px; }
.cheat-state { color: var(--ink-dim); margin: 2px 0 10px; }
.cheat-toggle { width: 100%; margin-bottom: 10px; }
.cheat-list { text-align: left; margin: 0 0 12px; padding-left: 20px; font-size: 13px; line-height: 1.7; color: var(--ink-dim); }
.cheat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.cheat-grid button, .cheat-close { padding: 10px 8px; border-radius: 10px; background: var(--navy-3); border: 1px solid var(--line); font-size: 14px; }
.cheat-close { width: 100%; }
.cheatwin { background: #6b3fd1 !important; border-color: #c7a8ff !important; color: #fff; margin-right: 6px; }
#aWin { position: absolute; right: 14px; top: 84px; z-index: 20; }

/* ---- 졌을 때 추천 ---- */
.adv-prog { margin: 4px 0 6px; font-size: 15px; }
.adv-prog b { color: #ffd77a; font-size: 18px; }
.adv-bar { height: 10px; border-radius: 5px; background: rgba(0, 0, 0, .45); overflow: hidden; margin: 0 auto 12px; max-width: 360px; }
.adv-bar i { display: block; height: 100%; background: linear-gradient(90deg, #e05a3a, #ffb347); }
.adv { text-align: left; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 0 auto 10px; max-width: 460px; }
.adv-t { font-weight: 700; font-size: 13px; color: var(--ink-dim); margin-bottom: 6px; }
.adv ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.adv li { font-size: 13.5px; line-height: 1.45; }
.adv small { color: var(--ink-dim); margin-left: 4px; }
.adv em { font-style: normal; font-size: 12px; padding: 1px 7px; border-radius: 999px; margin-left: 4px; white-space: nowrap; }
.adv .adv-ok { background: rgba(79, 174, 90, .3); color: #9be0a3; }
.adv .adv-need { background: rgba(255, 255, 255, .08); color: var(--ink-dim); }

.choice2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-width: 520px; margin: 0 auto 10px; text-align: left; }
.choice2 .c2 { border-radius: 12px; padding: 9px 11px; border: 1px solid var(--line); background: rgba(0, 0, 0, .25); }
.choice2 .c2.retry { border-color: rgba(233, 184, 76, .55); }
.choice2 .c2.fresh { border-color: rgba(120, 190, 255, .5); }
.choice2 .c2 > b { display: block; font-size: 14px; margin-bottom: 5px; }
.choice2 ul { margin: 0; padding-left: 16px; font-size: 12.5px; line-height: 1.5; }
.choice2 li.minus { color: var(--ink-dim); list-style: "– "; }
.choice2 small { color: #ffd77a; }
@media (max-width: 480px) { .choice2 { grid-template-columns: 1fr; } }
.nodesheet:has(.choice2) { padding-top: 14px; }
.nodesheet:has(.choice2) .nodeicon { font-size: 30px; }
.nodesheet:has(.choice2) h2 { margin: 2px 0 4px; }
.nodesheet:has(.choice2) .adv-bar { margin-bottom: 8px; }
.nodesheet:has(.choice2) .nchoices { flex-direction: row; flex-wrap: wrap; max-width: 620px; }
.nodesheet:has(.choice2) .nchoices button { flex: 1 1 170px; }
@media (max-width: 480px) { .nodesheet h2 { font-size: 23px; } }

/* ---- 탱크별 성장 · 성장 이전 ---- */
.tgrow { display: flex; gap: 6px; align-items: center; margin: 1px 0 2px; font-size: 11px; }
.tstar { color: #ffcf4a; letter-spacing: 1px; }
.tps { padding: 0 6px; border-radius: 999px; background: rgba(110, 170, 255, .2); color: #a9cdff; font-weight: 700; }
.movebar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 0 8px; padding: 6px 8px 6px 12px; border-radius: 12px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); }
.movebar .kits { font-size: 13px; color: var(--ink-dim); } .movebar .kits b { color: var(--ink); }
.gbtn.move { background: linear-gradient(180deg, #c7802a, #94571a); box-shadow: 0 3px 0 #5a3108; min-width: 150px; }
.gain.kit { background: rgba(199, 128, 42, .25); } .gain.kit.p { background: rgba(110, 200, 255, .2); }
.gain.mast { background: rgba(255, 207, 74, .18); color: #ffcf4a; }
.movesheet { text-align: left; max-width: 640px; }
.movesheet h2 { text-align: center; }
.mv-l { font-size: 12px; font-weight: 700; color: var(--ink-dim); margin: 10px 0 4px; }
.mv-list { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.mv-chip { flex: none; width: 96px; display: flex; flex-direction: column; align-items: center; padding: 6px 4px; border-radius: 10px; background: var(--navy-2); border: 2px solid transparent; font-size: 12px; }
.mv-chip img { width: 80px; height: 48px; object-fit: contain; }
.mv-chip small { font-size: 10px; color: var(--ink-dim); }
.mv-chip.on { border-color: #ffcf4a; background: #3a3420; }
.mv-kits { display: grid; gap: 6px; }
.mv-kit { text-align: left; padding: 8px 10px; border-radius: 10px; background: var(--navy-2); border: 2px solid transparent; font-size: 13px; }
.mv-kit small { color: var(--ink-dim); margin-left: 4px; }
.mv-kit.on { border-color: #ffcf4a; }
.mv-kit:disabled { opacity: .45; }
.mv-t { width: 100%; border-collapse: collapse; margin: 12px 0 8px; font-size: 13px; }
.mv-t th, .mv-t td { padding: 5px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.mv-t th { font-size: 11px; color: var(--ink-dim); }
.mv-t .up { color: #9be0a3; } .mv-t .down { color: #ff8f7f; }
.mv-t em { font-style: normal; font-size: 10px; color: var(--ink-dim); }
.mv-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mv-sum > div { padding: 8px 10px; border-radius: 10px; font-size: 12.5px; }
.mv-sum ul { margin: 4px 0 0; padding-left: 16px; line-height: 1.5; }
.mv-sum .minus { background: rgba(224, 90, 58, .14); border: 1px solid rgba(224, 90, 58, .4); }
.mv-sum .plus { background: rgba(79, 174, 90, .14); border: 1px solid rgba(79, 174, 90, .45); }
.mv-btns { display: flex; gap: 8px; margin-top: 12px; }
.mv-btns button { flex: 1; padding: 11px; border-radius: 12px; }
@media (max-width: 520px) { .mv-sum { grid-template-columns: 1fr; } .movebar { flex-direction: column; align-items: stretch; } }

.cheatchip.off { opacity: .5; }
@media (max-width: 420px) { .cheatchip { width: 28px; height: 28px; font-size: 13px; } .tb-res { gap: 5px; } }

/* ---- 유물 ---- */
.relics { position: absolute; z-index: 6; left: 10px; top: 58px; display: flex; flex-wrap: wrap; gap: 4px; max-width: 60vw; }
.relic { width: 30px; height: 30px; display: grid; place-items: center; font-size: 17px; border-radius: 9px; background: rgba(10, 14, 24, .72); border: 2px solid #8a7a52; cursor: pointer; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); }
.relic.r1 { border-color: #4aa3ff; box-shadow: 0 0 8px rgba(74, 163, 255, .5); }
.gain.grelic { background: rgba(138, 122, 82, .3); flex-wrap: wrap; } .gain.grelic small { font-weight: 400; opacity: .85; margin-left: 2px; }
.svc em.rtxt { font-style: normal; font-size: 10px; opacity: .8; }
@media (max-width: 600px) { .relics { top: 52px; left: 6px; } .relic { width: 26px; height: 26px; font-size: 14px; } }

.gain.grelic { flex-basis: 100%; justify-content: center; flex-wrap: nowrap; white-space: normal; text-align: center; }
@media (max-width: 600px) { #scrFight:has(#fRelics:not([hidden])) .tiphint { top: 92px; } }

/* ---- 새 카드 ---- */
.badge.burn { background: #b5461f; }
.card.sig { box-shadow: 0 0 0 2px #ffcf4a, 0 6px 14px rgba(0, 0, 0, .4); }
.card.sig .cname { color: #ffcf4a; }
.card .art.bust { background-size: 115% auto !important; background-position: 50% 12% !important; background-color: #cfe3f2; }

/* ---- 튜토리얼 ---- */
#coach { position: fixed; inset: 0; z-index: 70; pointer-events: none; opacity: 0; transition: opacity .2s; }
#coach.on { opacity: 1; }
#coach .c-ring { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(6, 9, 16, .55), 0 0 0 3px #ffcf4a, 0 0 18px 4px rgba(255, 207, 74, .8); animation: coachPulse 1.2s ease-in-out infinite; transition: left .15s, top .15s, width .15s, height .15s; }
@keyframes coachPulse { 50% { box-shadow: 0 0 0 9999px rgba(6, 9, 16, .55), 0 0 0 5px #ffe28a, 0 0 28px 8px rgba(255, 207, 74, .9); } }
#coach .c-bub { position: fixed; pointer-events: auto; padding: 12px 14px 10px; border-radius: 14px; background: #fffaf0; color: #2a2418; font-size: 14px; line-height: 1.5; box-shadow: 0 10px 28px rgba(0, 0, 0, .45); border: 3px solid #ffcf4a; }
#coach .c-txt b { color: #b4540e; }
#coach .c-btns { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; }
#coach .c-btns button { padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; }
#coach .c-ok { background: #e9b84c; color: #3a2a08; }
#coach .c-skip { background: transparent; color: #8a7d64; }

/* ---- 오늘의 임무 ---- */
.dailybtn { position: relative; display: flex; flex-direction: column; align-items: center; margin-top: 8px; padding: 6px 10px; border-radius: 12px; background: rgba(10, 14, 24, .7); border: 1px solid var(--line); font-size: 20px; line-height: 1.1; }
.dailybtn span { font-size: 11px; font-weight: 700; }
.dailybtn.dot::after { content: ''; position: absolute; top: -3px; right: -3px; width: 12px; height: 12px; border-radius: 50%; background: #ff4f3a; box-shadow: 0 0 0 2px #fff; animation: pulseq 1s infinite; }
.dailysheet { max-width: 600px; text-align: left; }
.dailysheet h2 { text-align: center; }
.dsec { margin-bottom: 14px; }
.dt { font-weight: 700; margin-bottom: 8px; } .dt small { font-weight: 400; color: var(--ink-dim); margin-left: 6px; }
.attrow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-bottom: 8px; }
.att { position: relative; padding: 6px 3px; border-radius: 10px; background: var(--navy-2); text-align: center; border: 2px solid transparent; min-height: 64px; }
.att b { display: block; font-size: 12px; } .att small { display: block; font-size: 9.5px; line-height: 1.3; color: var(--ink-dim); margin-top: 2px; }
.att.now { border-color: #ffcf4a; background: #3a3420; } .att.got { opacity: .55; }
.att i { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-size: 26px; color: #9be0a3; }
.dsec > .primary { width: 100%; }
.mis { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; background: var(--navy-2); margin-bottom: 6px; }
.mis .mtx { flex: 1; min-width: 0; } .mis b { font-size: 14px; } .mis small { color: var(--ink-dim); font-size: 11.5px; }
.mbar { height: 8px; border-radius: 4px; background: rgba(0, 0, 0, .45); overflow: hidden; margin: 4px 0 2px; } .mbar i { display: block; height: 100%; background: linear-gradient(90deg, #4fae5a, #9be0a3); }
.mis .primary { padding: 7px 14px; font-size: 13px; }
.mis.claimed { opacity: .5; } .mis.bonus { background: #3a3420; }
@media (max-width: 480px) { .att small { font-size: 8.5px; } .att { min-height: 70px; } }
.dailysheet .primary:disabled { opacity: .45; filter: grayscale(.7); cursor: default; box-shadow: none; }

/* ---- 대전 방식 ---- */
.modesheet { max-width: 420px; }
.modebtn { display: flex; flex-direction: column; align-items: flex-start; width: 100%; padding: 14px 16px; margin-bottom: 10px; border-radius: 14px; background: linear-gradient(180deg, #d9573f, #a8392a); color: #fff; box-shadow: 0 4px 0 #6e1f15; text-align: left; }
.modebtn.team { background: linear-gradient(180deg, #3f7fd1, #2a5aa0); box-shadow: 0 4px 0 #173a6e; }
.modebtn b { font-family: var(--f-display); font-weight: 400; font-size: 20px; } .modebtn small { font-size: 12px; opacity: .9; }
.modebtn:disabled { filter: grayscale(.8); opacity: .55; }
.countdown.mapname { font-size: 34px !important; letter-spacing: 0; }
