:root{
  /* v8 타이포그래피 — 제목: Noto Serif KR(700/900) · 본문·UI: Pretendard(400~800) */
  --ink:#070a0e;
  --ink2:#0d131a;
  --ink3:#141d27;
  --line:#243040;
  --paper:#f2e8d4;
  --paper-dim:#b3a892;
  --gold:#e0bd6a;
  --gold-lt:#ffe6a8;
  --gold-deep:#8a6516;
  --jade:#5ccdb4;
  --red:#cf4a41;
  --red-deep:#7d2019;
  --title:'Noto Serif KR', 'Nanum Myeongjo', serif;                 /* 제목·대형 배너 (900) */
  --brush:'Noto Serif KR', 'Nanum Myeongjo', serif;                 /* 기존 붓글씨 자리 → 명조 Black */
  --serif:'Noto Serif KR', 'Nanum Myeongjo', serif;                 /* 라벨·전적표·한자 (700) */
  --num:'Pretendard Variable', Pretendard, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  --sans:'Pretendard Variable', Pretendard, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  --k:1;               /* 캔버스 월드 1단위 → CSS px (game.js가 갱신) */
  --console:126px;     /* 세로 모드 우측 버튼 열 폭 */
}

*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;height:100%}
body{
  font-family:var(--sans);
  font-variant-numeric:tabular-nums;          /* 전투 중 수치 흔들림 방지 */
  font-feature-settings:"tnum" 1;
  background:#04070b;
  color:var(--paper);
  overflow:hidden;
  user-select:none;-webkit-user-select:none;
}
.stage{
  position:relative;width:100%;height:100vh;height:100dvh;
  display:flex;justify-content:center;align-items:stretch;
  background:radial-gradient(120% 90% at 50% -10%,#17202b 0%,#080b10 58%,#03050a 100%);
}

/* =========================================================
   앱 셸 — 세로: 꽉 찬 1열 / 가로·데스크톱: 헤더 + 2단
   ========================================================= */
.app{
  position:relative;width:100%;height:100vh;height:100dvh;min-height:0;
  display:flex;flex-direction:column;
  background:linear-gradient(180deg,#0b1219 0%,#080c12 46%,#05080d 100%);
  overflow:hidden;touch-action:none;
}

/* ================= 상단 (브랜드 + HUD) ================= */
.topwrap{
  flex:0 0 auto;position:relative;z-index:8;
  display:flex;flex-direction:column;
  padding-top:env(safe-area-inset-top);
  background:
    linear-gradient(180deg,rgba(42,26,22,.94),rgba(12,10,12,.80)),
    repeating-linear-gradient(90deg,rgba(255,255,255,.02) 0 1px,transparent 1px 4px);
  border-bottom:1px solid rgba(224,189,106,.18);
}
.topbar{
  height:38px;flex:0 0 38px;
  display:flex;align-items:center;gap:7px;
  padding:0 10px;
}
.brand{display:flex;align-items:center;gap:7px;flex:1;min-width:0}
.seal{
  width:26px;height:26px;flex:0 0 26px;border-radius:6px;
  display:grid;place-items:center;
  background:linear-gradient(160deg,#a8342c,#5e1811);
  border:1px solid rgba(255,220,180,.38);
  font-family:var(--serif);font-size:9px;font-weight:400;letter-spacing:.3px;color:#ffe9d6;
  box-shadow:inset 0 0 10px rgba(0,0,0,.55), 0 2px 8px rgba(0,0,0,.5);
}
.brand-txt{display:flex;flex-direction:column;line-height:1;min-width:0}
.brand-txt b{font-family:var(--brush);font-size:19px;font-weight:900;letter-spacing:.6px;color:#f7ecd8;
  text-shadow:0 2px 10px rgba(207,74,65,.35);white-space:nowrap}
.brand-txt small{font-family:var(--serif);font-size:8.5px;letter-spacing:1.6px;color:#8d8171;margin-top:2px;white-space:nowrap}

.silver{
  display:flex;align-items:center;gap:4px;height:23px;padding:0 8px 0 5px;border-radius:20px;
  background:linear-gradient(180deg,rgba(60,48,22,.85),rgba(30,24,12,.85));
  border:1px solid rgba(224,189,106,.42);
  box-shadow:inset 0 0 8px rgba(224,189,106,.12);
  flex:0 0 auto;
}
.silver i{
  font-style:normal;width:15px;height:15px;border-radius:50%;
  display:grid;place-items:center;font-family:var(--serif);font-size:8.5px;color:#3a2c08;
  background:radial-gradient(circle at 35% 30%,#ffeab4,#d8ab4e 60%,#8a6516);
}
.silver b{font-family:var(--num);font-size:12.5px;color:var(--gold-lt);font-weight:700;letter-spacing:.3px}
.icon-btn{
  height:26px;min-width:26px;padding:0 8px;border-radius:8px;flex:0 0 auto;
  border:1px solid #2a3340;background:#131a23;color:#b9c3cf;
  display:grid;place-items:center;cursor:pointer;
  font-family:var(--sans);font-weight:600;font-size:10.5px;letter-spacing:.4px;
}
.icon-btn:active{transform:scale(.94)}
.icon-btn .mute-x{display:none}
.icon-btn.muted{color:#6c7683}
.icon-btn.muted .wave1,.icon-btn.muted .wave2{display:none}
.icon-btn.muted .mute-x{display:block}

.hud{
  height:26px;flex:0 0 26px;
  display:flex;align-items:center;gap:5px;
  padding:0 10px;
  background:rgba(4,8,12,.36);
  border-top:1px solid rgba(255,255,255,.045);
}
.pill{
  display:flex;align-items:center;gap:4px;height:21px;padding:0 8px;border-radius:20px;
  background:linear-gradient(180deg,#111923,#0c131b);border:1px solid #22303f;
  font-family:var(--sans);font-weight:600;font-size:10.5px;letter-spacing:.3px;color:#93a1b0;
  white-space:nowrap;
}
.pill b{font-family:var(--num);font-size:13px;font-weight:700;color:#e9eef4;font-variant-numeric:tabular-nums}
.pill .k{color:#7b8896}
.pill.gold{border-color:rgba(224,189,106,.35)}
.pill.gold b{color:var(--gold);min-width:22px}
.pill.gate{padding-right:9px}
.pill.gate b{color:#f0a79f;min-width:24px;text-align:right;font-size:12.5px}
.gate-bar{display:block;width:38px;height:4px;border-radius:3px;background:#2a1a1c;overflow:hidden;margin-left:2px}
.gate-bar u{display:block;height:100%;width:100%;background:linear-gradient(90deg,#cf4a41,#e08a6a);transition:width .25s}
.pill.mini{margin-left:auto;border-color:#1e2a36}
.pill.mini b{font-size:12px;color:#a8b6c4}

/* ================= 전장 ================= */
.fieldwrap{
  position:relative;width:100%;flex:1 1 auto;min-height:150px;overflow:hidden;
  background:#070b10;border-bottom:1px solid rgba(224,189,106,.14);
  touch-action:none;
}
#field{display:block;position:absolute;inset:0;width:100%;height:100%;touch-action:none;z-index:1}
#fieldbg{display:block;position:absolute;inset:0;width:100%;height:100%;z-index:0;pointer-events:none}
.fieldwrap::after{
  content:'';position:absolute;inset:0;pointer-events:none;
  box-shadow:inset 0 0 46px rgba(0,0,0,.55), inset 0 0 2px rgba(224,189,106,.2);
  z-index:1;
}
.slots{position:absolute;inset:0;pointer-events:none;z-index:2}.slot{
  position:absolute;width:52px;height:52px;margin:-26px 0 0 -26px;
  border-radius:50%;pointer-events:auto;cursor:pointer;
  border:1px dashed rgba(224,189,106,.20);
  background:radial-gradient(circle,rgba(224,189,106,.06),rgba(224,189,106,0) 70%);
  display:grid;place-items:center;
  transition:border-color .15s, box-shadow .15s, opacity .15s;
}
.slot span{font-size:calc(14px * var(--k));color:rgba(224,189,106,.38);font-weight:300;line-height:1}
.slot.filled{border-color:transparent;background:none}
.slot.filled span{opacity:0}
.slot.armed{border-color:rgba(92,205,180,.85);box-shadow:0 0 0 3px rgba(92,205,180,.14),0 0 20px rgba(92,205,180,.32);
  background:radial-gradient(circle,rgba(92,205,180,.14),transparent 70%)}
.slot.armed span{color:rgba(140,230,210,.9)}
.slot.hot{border-color:rgba(224,189,106,.95);box-shadow:0 0 0 4px rgba(224,189,106,.2),0 0 24px rgba(224,189,106,.5)}
.slot.locked{border-color:rgba(120,150,180,.35);border-style:solid;background:rgba(8,14,20,.55)}
/* v6 — 특수 명당(지형 버프) 표시 */
.slot.terr{border-color:rgba(224,189,106,.30)}
.slot .terrtag{
  position:absolute;left:50%;top:-9px;transform:translateX(-50%);pointer-events:none;
  font-style:normal;font-family:var(--serif);font-weight:700;font-size:calc(7.4px * var(--k));line-height:1.3;
  letter-spacing:0;padding:0 3px;border-radius:4px;color:var(--tc,#ffe6a8);white-space:nowrap;
  border:1px solid rgba(224,189,106,.30);background:rgba(4,8,13,.86);
  box-shadow:0 1px 6px rgba(0,0,0,.6);
}
.slot.filled .terrtag{opacity:.72}
/* 탭으로 고른 명당(자리 맞바꾸기 대상) */
.slot.selected{border-style:solid;border-color:rgba(140,230,210,.95);
  box-shadow:0 0 0 3px rgba(140,230,210,.16),0 0 22px rgba(140,230,210,.45);
  background:radial-gradient(circle,rgba(140,230,210,.15),transparent 70%)}
.slot.locked span{
  font-family:var(--serif);font-size:calc(9.5px * var(--k));color:#8aa0b4;letter-spacing:0;
  border:1px solid rgba(120,150,180,.4);border-radius:4px;padding:1px 4px;background:rgba(8,14,20,.8)
}

/* 연격 콤보 */
.combo{
  position:absolute;left:50%;top:40px;transform:translate(-50%,-6px) scale(.9);
  display:flex;align-items:baseline;gap:3px;pointer-events:none;opacity:0;
  transition:opacity .18s, transform .18s;
  text-shadow:0 2px 10px rgba(0,0,0,.85);z-index:5;
}
.combo.show{opacity:1;transform:translate(-50%,0) scale(1)}
.combo b{font-family:var(--num);font-size:28px;font-weight:700;color:#fff0c8;letter-spacing:-.5px;
  text-shadow:0 0 16px rgba(255,190,90,.8),0 2px 6px #000}
.combo span{font-family:var(--brush);font-weight:900;font-size:19px;color:#ffd68a}
.combo.hot b{color:#ffd0e0;text-shadow:0 0 20px rgba(255,90,120,.9),0 2px 6px #000}
.combo.pop b{animation:comboPop .18s ease-out}
@keyframes comboPop{0%{transform:scale(1.35)}100%{transform:scale(1)}}

/* 보스 HP */
.bossbar{
  position:absolute;left:12px;right:12px;top:7px;height:25px;display:none;align-items:center;gap:7px;
  padding:0 9px 0 4px;border-radius:9px;
  background:rgba(22,6,8,.88);border:1px solid rgba(207,74,65,.5);
  box-shadow:0 4px 18px rgba(0,0,0,.6), inset 0 0 14px rgba(207,74,65,.14);
  z-index:6;
}
.bossbar.show{display:flex}
.bossbar img{width:18px;height:18px;border-radius:5px;object-fit:cover;object-position:50% 22%;border:1px solid rgba(207,74,65,.5)}
.bossbar span{font-family:var(--serif);font-size:10px;letter-spacing:1.2px;color:#ffb3a6;white-space:nowrap}
.bossbar i{flex:1;height:5px;border-radius:3px;background:#3a1518;overflow:hidden}
.bossbar u{display:block;height:100%;width:100%;background:linear-gradient(90deg,#b8382f,#ff9a7a);transition:width .12s linear}

/* 보스 배너 */
.bossbanner{
  position:absolute;left:0;right:0;top:50%;transform:translateY(-50%);
  display:none;align-items:center;justify-content:center;gap:12px;
  padding:10px 0;pointer-events:none;z-index:7;
  background:linear-gradient(90deg,rgba(60,6,10,0),rgba(70,8,12,.82) 20%,rgba(70,8,12,.82) 80%,rgba(60,6,10,0));
}
.bossbanner.show{display:flex;animation:bossIn 2.1s ease-out forwards}
.bb-img{width:52px;height:52px;border-radius:8px;overflow:hidden;border:1px solid rgba(255,150,130,.5);
  box-shadow:0 0 18px rgba(207,74,65,.55)}
.bb-img img{width:100%;height:100%;object-fit:cover;object-position:50% 18%}
.bb-txt{display:flex;flex-direction:column;line-height:1}
.bb-txt b{font-family:var(--brush);font-size:34px;font-weight:900;letter-spacing:4px;color:#ffe4d8;
  text-shadow:0 0 24px rgba(255,80,60,.95),0 3px 8px #000}
.bb-txt span{font-family:var(--serif);font-size:9px;letter-spacing:5px;color:#e08a7a;margin-top:3px;padding-left:4px}
@keyframes bossIn{
  0%{opacity:0;transform:translateY(-50%) scale(1.25)}
  12%{opacity:1;transform:translateY(-50%) scale(1)}
  76%{opacity:1}
  100%{opacity:0;transform:translateY(-50%) scale(.99)}
}

/* 시너지 컷인 */
.cutin{
  position:absolute;left:0;right:0;top:34%;transform:translateY(-50%) scale(.94);
  display:none;flex-direction:column;align-items:center;gap:2px;pointer-events:none;z-index:13;
  padding:2px 0 4px;
  background:radial-gradient(60% 100% at 50% 50%,rgba(4,7,11,.55),rgba(4,7,11,0) 74%);
}
.cutin.show{display:flex;animation:cutIn 1.9s ease-out forwards}
.cutin b{
  font-family:var(--brush);font-size:36px;font-weight:900;letter-spacing:2px;line-height:1.05;
  color:#fff3d8;text-shadow:0 0 22px currentColor,0 0 6px #000,0 3px 10px #000;
  white-space:nowrap;
}
.cutin span{
  font-family:var(--serif);font-size:10px;letter-spacing:1.2px;color:#ffe0a8;
  background:rgba(6,10,14,.62);padding:2px 10px;border-radius:10px;border:1px solid rgba(255,220,170,.25);
  max-width:330px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;
}
@keyframes cutIn{
  0%{opacity:0;transform:translateY(-50%) scale(1.4)}
  14%{opacity:1;transform:translateY(-50%) scale(1)}
  74%{opacity:1}
  100%{opacity:0;transform:translateY(-50%) scale(.96)}
}

/* 어검 일섬 버튼 */
.skillwrap{position:absolute;right:10px;bottom:10px;z-index:4}
.skillbtn{
  position:relative;width:58px;height:58px;border-radius:50%;cursor:pointer;overflow:hidden;
  border:1px solid rgba(120,210,240,.55);
  background:radial-gradient(circle at 40% 32%,rgba(60,140,190,.55),rgba(10,26,40,.92) 72%);
  box-shadow:0 6px 20px rgba(0,0,0,.6), inset 0 0 14px rgba(120,220,255,.2);
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;
  color:#d8f4ff;font-family:var(--sans);
}
.skillbtn .sb-ico{font-family:var(--brush);font-weight:900;font-size:21px;line-height:1;color:#eafcff;text-shadow:0 0 12px rgba(120,220,255,.9)}
.skillbtn .sb-txt{font-size:8px;letter-spacing:-.1px;color:#a9dcf0;margin-top:1px}
.skillbtn .sb-cd{
  position:absolute;inset:0;border-radius:50%;
  background:conic-gradient(rgba(4,10,16,.82) var(--cd,0deg), rgba(4,10,16,0) 0deg);
  pointer-events:none;
}
.skillbtn.ready{animation:skillReady 1.6s ease-in-out infinite}
@keyframes skillReady{0%,100%{box-shadow:0 6px 20px rgba(0,0,0,.6),0 0 0 0 rgba(120,220,255,.4)}50%{box-shadow:0 6px 20px rgba(0,0,0,.6),0 0 0 7px rgba(120,220,255,0)}}
.skillbtn.cooling{filter:saturate(.5) brightness(.75)}
.skillbtn.cooling .sb-txt{color:#7f96a5}
.skillbtn:active{transform:scale(.95)}

/* 정비 바 */
.breakbar{
  position:absolute;left:10px;right:78px;bottom:10px;height:38px;
  display:none;align-items:center;gap:7px;
  padding:0 7px 0 10px;border-radius:10px;
  background:rgba(8,13,19,.88);
  border:1px solid rgba(224,189,106,.3);
  box-shadow:0 8px 22px rgba(0,0,0,.5);
  backdrop-filter:blur(6px);
  z-index:4;
}
.breakbar.show{display:flex}
.bb-left{display:flex;flex-direction:column;line-height:1.1;min-width:0}
.bb-wave{font-family:var(--serif);font-size:10.5px;color:var(--gold);letter-spacing:.3px;white-space:nowrap}
.bb-label{font-size:10px;color:#8e9baa;letter-spacing:.2px;white-space:nowrap}
.bb-mid{flex:1;display:flex;flex-direction:column;gap:3px;min-width:0}
.bb-mid span{font-family:var(--num);font-weight:700;font-size:11.5px;color:#e7dcc4;text-align:right;font-variant-numeric:tabular-nums}
.bb-mid i{display:block;height:3px;border-radius:2px;background:#1d2632;overflow:hidden}
.bb-mid u{display:block;height:100%;width:100%;background:linear-gradient(90deg,#5ccdb4,#e0bd6a)}
.bb-go{
  height:26px;padding:0 9px;border-radius:7px;white-space:nowrap;
  border:1px solid rgba(92,205,180,.5);
  background:linear-gradient(180deg,rgba(46,120,105,.55),rgba(26,74,64,.7));
  color:#c9f2e7;font-family:var(--sans);font-size:11px;font-weight:700;cursor:pointer;
  display:flex;align-items:center;gap:3px;
}
.bb-go em{font-style:normal;color:#ffe6a8;font-size:10px;font-variant-numeric:tabular-nums}
.bb-go:active{transform:scale(.97)}

.fieldtag{
  display:none;position:absolute;left:10px;right:78px;bottom:14px;
  padding:5px 11px;border-radius:12px;text-align:center;
  background:rgba(5,9,13,.78);border:1px solid rgba(255,255,255,.08);
  font-size:10.5px;color:#96a3b1;letter-spacing:.1px;line-height:1.35;
  transition:opacity .3s;z-index:3;
}
.fieldtag.hide{opacity:0}

.toast{
  position:absolute;left:50%;top:76%;transform:translate(-50%,-50%) scale(.96);
  padding:7px 14px;border-radius:9px;
  background:rgba(8,12,18,.95);border:1px solid rgba(224,189,106,.42);
  font-family:var(--sans);font-weight:500;font-size:11.5px;color:#f2e6cc;letter-spacing:.2px;white-space:nowrap;
  opacity:0;pointer-events:none;transition:opacity .18s,transform .18s;
  box-shadow:0 10px 26px rgba(0,0,0,.55);
  z-index:7;
}
.toast.show{opacity:1;transform:translate(-50%,-50%) scale(1)}

/* 3스텝 가이드 */
.guide{position:absolute;display:none;z-index:14;pointer-events:none}
.guide.show{display:block}
.g-bubble{
  position:absolute;left:50%;transform:translateX(-50%);bottom:calc(100% + 8px);
  padding:6px 11px;border-radius:10px;white-space:nowrap;
  background:linear-gradient(180deg,rgba(36,28,16,.97),rgba(14,12,10,.97));
  border:1px solid rgba(224,189,106,.6);
  box-shadow:0 8px 22px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,230,180,.14);
  display:flex;flex-direction:column;gap:1px;align-items:center;
}
.g-bubble b{font-family:var(--brush);font-size:18px;font-weight:900;color:#ffe6a8;line-height:1;letter-spacing:.5px}
.g-bubble span{font-size:10.5px;color:#c9bda6;letter-spacing:.1px}
.g-bubble::after{
  content:'';position:absolute;left:50%;top:100%;transform:translateX(-50%);
  border:5px solid transparent;border-top-color:rgba(224,189,106,.6);
}
.g-hand{
  font-size:20px;line-height:1;color:#ffe6a8;
  animation:handTap 1s ease-in-out infinite;
  text-shadow:0 0 12px rgba(255,200,90,.8);
  transform-origin:50% 30%;
}
@keyframes handTap{0%,100%{transform:translate(0,0) rotate(-8deg)}50%{transform:translate(0,6px) rotate(6deg)}}
.guide-focus{animation:guidePulse 1.2s ease-in-out infinite !important;z-index:3;position:relative}
@keyframes guidePulse{0%,100%{box-shadow:0 0 0 0 rgba(255,214,120,.55),0 0 18px rgba(255,200,90,.35)}50%{box-shadow:0 0 0 8px rgba(255,214,120,0),0 0 26px rgba(255,200,90,.5)}}

/* ================= 시너지 바 ================= */
.synbar{
  flex:0 0 auto;
  display:flex;flex-direction:column;justify-content:center;gap:2px;
  padding:3px 10px 4px;
  background:linear-gradient(180deg,#0b1118,#080d13);
  border-bottom:1px solid rgba(224,189,106,.1);
}
.syn-factions{display:flex;gap:5px;align-items:center}
.fchip{
  flex:1;min-width:0;display:flex;align-items:center;gap:3px;
  height:22px;padding:0 6px;border-radius:6px;
  background:linear-gradient(180deg,#111923,#0b1119);
  border:1px solid #1f2b38;position:relative;overflow:hidden;
  transition:border-color .2s, box-shadow .2s;
}
.fchip .fi{font-size:11px;line-height:1;filter:saturate(.85)}
.fchip .fn{font-family:var(--sans);font-weight:500;font-size:9.5px;color:#93a0ae;letter-spacing:0;white-space:nowrap}
.fchip .fc{font-family:var(--num);font-size:12px;font-weight:700;color:#dce6f0;margin-left:auto;line-height:1}
.fchip .fneed{font-family:var(--sans);font-weight:400;font-size:8.5px;color:#5f6d7c;margin-left:-1px}
.fchip.on{border-color:currentColor;box-shadow:0 0 0 1px currentColor, inset 0 0 12px rgba(255,255,255,.05)}
.fchip.on .fn{color:#f2e8d4}
.fchip.near{border-color:rgba(255,110,90,.55)}
.fchip.near .fneed{color:#ff9b86;font-size:9px}
.fchip.near .fc{color:#ff9b86}
.fchip.near .fn{color:#d3bcb3}
.syn-active{display:flex;gap:4px;align-items:center;overflow:hidden;height:17px;flex-wrap:nowrap}
.syn-active .none{font-family:var(--sans);font-weight:500;font-size:9.5px;color:#6f7c86;letter-spacing:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.syn-active .sb{
  font-family:var(--sans);font-weight:500;font-size:9.5px;letter-spacing:0;white-space:nowrap;
  padding:1px 7px;border-radius:9px;border:1px solid currentColor;color:#e8d9b4;
  background:rgba(255,255,255,.03);line-height:1.5;
}
.syn-active .sb.ult{background:rgba(255,214,120,.14);box-shadow:0 0 10px rgba(255,214,120,.35)}

/* ================= 하단 패널 (보드 + 버튼) ================= */
.panel{
  flex:0 0 auto;display:grid;
  grid-template-columns:minmax(0,1fr) var(--console);
  grid-template-rows:auto auto;
  grid-template-areas:"head acts" "board acts";
  column-gap:8px;row-gap:3px;
  padding:6px 10px calc(6px + env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg,rgba(26,20,14,.5),rgba(8,11,16,0) 34%),
    repeating-linear-gradient(0deg,rgba(255,255,255,.012) 0 1px,transparent 1px 3px),
    linear-gradient(180deg,#0c1118,#070a0f);
  border-top:1px solid rgba(224,189,106,.12);
}
.board-head{grid-area:head;height:15px;display:flex;align-items:baseline;gap:7px;padding:0 2px}
.bh-title{font-family:var(--serif);font-size:11px;letter-spacing:1.2px;color:#c8b48b;white-space:nowrap}
.bh-hint{font-size:10px;color:#6b7887;letter-spacing:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.board{
  grid-area:board;align-self:start;justify-self:stretch;
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(4,1fr);
  gap:6px;margin-top:2px;width:100%;aspect-ratio:1/1;
  touch-action:none;
}
.cell{
  position:relative;border-radius:11px;min-height:0;min-width:0;
  background:
    linear-gradient(180deg,rgba(20,30,42,.55),rgba(8,13,19,.9)),
    repeating-linear-gradient(45deg,rgba(255,255,255,.014) 0 2px,transparent 2px 7px),
    linear-gradient(180deg,#111a24,#0a1017);
  border:1px solid #1e2836;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04), inset 0 -8px 14px rgba(0,0,0,.35);
  cursor:pointer;overflow:hidden;
}
.cell::before{
  content:'';position:absolute;left:0;top:0;width:14px;height:14px;pointer-events:none;
  border-top:1px solid rgba(224,189,106,.16);border-left:1px solid rgba(224,189,106,.16);
  border-radius:11px 0 0 0;
}
.cell::after{
  content:'';position:absolute;inset:0;border-radius:10px;
  background:radial-gradient(circle at 50% 118%,rgba(224,189,106,.05),transparent 62%);
  pointer-events:none;
}
.cell.drop{border-color:rgba(92,205,180,.9);box-shadow:0 0 0 2px rgba(92,205,180,.22),0 0 18px rgba(92,205,180,.3)}
.cell.selected{border-color:rgba(224,189,106,.95);box-shadow:0 0 0 2px rgba(224,189,106,.28),0 0 20px rgba(224,189,106,.28)}

.unit{
  position:absolute;inset:3px;border-radius:9px;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  background:
    radial-gradient(circle at 50% 24%,color-mix(in srgb,var(--c) 34%,transparent),transparent 70%),
    linear-gradient(180deg,#18222e,#0f151e);
  border:1px solid color-mix(in srgb,var(--c) 50%,#1e2836);
  box-shadow:inset 0 0 14px color-mix(in srgb,var(--c) 16%,transparent);
  pointer-events:none;overflow:hidden;
}
.unit .wm{
  position:absolute;right:-2px;bottom:-8px;
  font-family:var(--serif);font-size:38px;line-height:1;color:var(--f,#fff);
  opacity:.10;pointer-events:none;
}
.unit .tier{
  font-family:var(--num);font-size:9px;font-weight:700;color:var(--c);
  line-height:1;opacity:.95;letter-spacing:.3px;
}
.unit .nm{
  font-family:var(--serif);font-size:12px;font-weight:400;color:#f4ecdc;line-height:1.1;
  text-shadow:0 1px 2px rgba(0,0,0,.8);margin-top:1px;letter-spacing:-.2px;
}
.unit .fmark{
  font-family:var(--serif);font-size:8.5px;line-height:1;color:var(--f);
  border:1px solid color-mix(in srgb,var(--f) 55%,transparent);
  border-radius:4px;padding:0 3px;margin-top:2px;
  background:color-mix(in srgb,var(--f) 14%,transparent);
}
.unit.t10{box-shadow:inset 0 0 18px color-mix(in srgb,var(--c) 34%,transparent),0 0 16px color-mix(in srgb,var(--c) 36%,transparent)}
.unit.t9,.unit.t10{background:
    radial-gradient(circle at 50% 24%,color-mix(in srgb,var(--c) 40%,transparent),transparent 72%),
    linear-gradient(180deg,#1d2734,#101822);}

.unit.pop{animation:popIn .34s cubic-bezier(.2,1.4,.4,1)}
.unit.pop::after{content:'';position:absolute;inset:-4px;border-radius:12px;border:2px solid var(--c);animation:popRing .42s ease-out forwards}
@keyframes popIn{0%{transform:scale(.5);filter:brightness(2.2)}55%{transform:scale(1.12);filter:brightness(1.3)}100%{transform:scale(1);filter:brightness(1)}}
@keyframes popRing{0%{opacity:.95;transform:scale(.7)}100%{opacity:0;transform:scale(1.3)}}

.ghost{
  position:fixed;z-index:60;width:64px;height:64px;pointer-events:none;
  transform:translate(-50%,-50%) scale(1.05);
  filter:drop-shadow(0 10px 16px rgba(0,0,0,.65));
}

/* 버튼 열 (세로 모드) */
.console{grid-area:acts;display:flex;flex-direction:column;gap:5px;min-height:0}
.act1,.act2{display:flex;flex-direction:column;gap:5px;min-height:0}
.act1{flex:1.3 1 0}
.act2{flex:1 1 0}
.act1 .btn{flex:1.5 1 0}
.act1 .btn.summon.sub{flex:0.9 1 0}
.act2 .btn{flex:1 1 0}

.btn{
  position:relative;border-radius:10px;cursor:pointer;font-family:var(--sans);
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;
  border:1px solid #28343f;background:linear-gradient(180deg,#182130,#101722);color:#dfe6ee;
  transition:transform .06s, filter .15s;padding:0 4px;min-height:0;
}
.btn:active{transform:translateY(1px) scale(.985)}
.btn .bt{font-size:11.5px;font-weight:900;letter-spacing:-.2px;line-height:1.15}
.btn .bc{font-size:9.5px;color:#8d9aa8;letter-spacing:0;line-height:1.2}
.btn .bc b{color:var(--gold);font-weight:800;font-size:10.5px}
.btn.summon{
  flex:1.3;border-color:#7d6229;
  background:linear-gradient(180deg,#4c3b1b,#2b2110);color:#ffeec4;
  box-shadow:inset 0 1px 0 rgba(255,226,160,.18),0 4px 14px rgba(0,0,0,.42);
}
.btn.summon .bt{font-family:var(--brush);font-size:22px;font-weight:900;line-height:1;letter-spacing:1px}
.btn.summon .bc{color:#c7a96c;margin-top:-1px;font-size:9.5px}
.btn.summon.ready{box-shadow:inset 0 1px 0 rgba(255,226,160,.22),0 0 0 1px rgba(224,189,106,.35),0 4px 18px rgba(120,88,26,.4)}
.btn.summon.disabled{filter:grayscale(.7) brightness(.6);cursor:default}
.btn.summon.sub{flex:1;border-color:#3b4a58;background:linear-gradient(180deg,#1c2a34,#101a22);color:#cfe0e6}
.btn.summon.sub .bt{font-family:var(--sans);font-size:11px;letter-spacing:.2px;font-weight:600}
.btn.summon.sub .bc b{color:#9fd6c8}
.btn.small .bt{font-size:10px;font-weight:800;letter-spacing:-.45px}
.btn.small{flex:1}
.btn.auto{border-color:#2f4a45;background:linear-gradient(180deg,#152e2a,#0d1b19);color:#bfe6dc}
.btn.auto .badge{
  position:absolute;top:-5px;right:-4px;min-width:16px;height:16px;padding:0 3px;
  border-radius:8px;background:linear-gradient(180deg,#5cc9b0,#2c8d78);
  color:#06211b;font-size:9px;font-weight:900;line-height:16px;text-align:center;
  box-shadow:0 2px 6px rgba(0,0,0,.5);
}
.btn.ad{border-color:#5a4630;background:linear-gradient(180deg,#2a2216,#171208);color:#e8d5a8}
.btn.ad .bc{color:#c0a068;font-size:8.5px}
.btn.ad.used{filter:grayscale(.8) brightness(.65);cursor:default}
.btn.speed{flex:0 0 42px;border-color:#3a3346;background:linear-gradient(180deg,#201b2a,#131019);color:#cfc2e6;
  font-family:var(--num);font-size:13px;font-weight:700}
.btn.speed.s2{color:#ffd68a;border-color:#6c5527}
.btn.speed.s05{color:#8fd7ff;border-color:#28506b}

/* ================= 오버레이 공통 ================= */
.overlay{
  position:absolute;inset:0;z-index:50;display:none;
  align-items:center;justify-content:center;padding:18px;
  padding-top:calc(18px + env(safe-area-inset-top));
  background:radial-gradient(circle at 50% 30%,rgba(20,14,12,.86),rgba(3,5,9,.97) 72%);
}
.overlay.show{display:flex}
#overScreen{backdrop-filter:blur(4px);background:radial-gradient(circle at 50% 40%,rgba(34,12,11,.9),rgba(3,5,9,.97) 74%)}
.tcard{
  width:100%;max-width:420px;padding:18px 18px 16px;border-radius:18px;text-align:center;
  background:linear-gradient(180deg,rgba(30,24,18,.95),rgba(11,14,20,.97));
  border:1px solid rgba(224,189,106,.28);
  box-shadow:0 24px 64px rgba(0,0,0,.65), inset 0 1px 0 rgba(255,235,200,.07);
}
.tseal{
  width:44px;height:44px;margin:0 auto 8px;border-radius:8px;
  display:grid;place-items:center;
  background:linear-gradient(160deg,#a8342c,#5c170f);
  border:1px solid rgba(255,220,180,.38);
  font-family:var(--serif);font-size:12px;color:#ffe9d6;letter-spacing:1px;
  box-shadow:inset 0 0 12px rgba(0,0,0,.55);
}
.tseal.red{background:linear-gradient(160deg,#7e2a26,#3a0e0b)}
.tcard h2{margin:0;font-family:var(--brush);font-size:32px;font-weight:900;letter-spacing:2px;color:#f4e3cb;
  text-shadow:0 2px 16px rgba(207,74,65,.4)}
.tsub{margin:2px 0 0;font-family:var(--serif);font-size:10px;letter-spacing:3px;color:#9c8f79}
.big{
  width:100%;height:46px;border-radius:12px;cursor:pointer;
  border:1px solid rgba(255,220,170,.38);
  background:linear-gradient(180deg,#a83a30,#651d16);
  color:#fff0dd;font-family:var(--brush);font-size:22px;font-weight:900;letter-spacing:2px;
  box-shadow:0 8px 24px rgba(120,30,24,.5), inset 0 1px 0 rgba(255,220,180,.26);
}
.big:active{transform:translateY(1px)}
.ghostbtn{
  width:100%;height:36px;margin-top:7px;border-radius:10px;cursor:pointer;
  border:1px solid #2b3644;background:linear-gradient(180deg,#161f29,#0d141c);
  color:#a9b7c4;font-family:var(--sans);font-weight:600;font-size:11.5px;letter-spacing:.6px;
}
.fine{display:block;margin-top:7px;font-family:var(--sans);font-weight:400;font-size:9.5px;letter-spacing:.4px;color:#6d6255}
.result{display:flex;justify-content:center;gap:8px;margin:16px 0 10px}
.result>div{
  flex:1;padding:8px 4px;border-radius:10px;background:rgba(8,11,16,.62);
  border:1px solid rgba(255,255,255,.07);
  display:flex;flex-direction:column;align-items:center;gap:1px;
}
.result span{font-family:var(--sans);font-weight:500;font-size:9px;letter-spacing:.4px;color:#8b97a4}
.result b{font-family:var(--num);font-size:20px;font-weight:700;color:#f3e6cc}
.result em{font-style:normal;font-size:9px;color:#7d8895;margin-top:-2px}
.earn{
  display:flex;align-items:center;justify-content:center;gap:6px;margin:0 0 14px;
  padding:7px 10px;border-radius:10px;
  background:linear-gradient(180deg,rgba(52,42,20,.7),rgba(26,20,10,.7));
  border:1px solid rgba(224,189,106,.3);
}
.earn i{
  font-style:normal;width:17px;height:17px;border-radius:50%;display:grid;place-items:center;
  font-family:var(--serif);font-size:9px;color:#3a2c08;
  background:radial-gradient(circle at 35% 30%,#ffeab4,#d8ab4e 60%,#8a6516);
}
.earn b{font-family:var(--num);font-size:16px;font-weight:700;color:#ffe6a8}
.earn span{font-family:var(--sans);font-weight:500;font-size:10px;color:#b6a888}
.earn span b{font-size:11.5px;color:#e8d5a8}

/* ================= 로비 ================= */
.lobby{
  display:none;flex-direction:column;padding:0;justify-content:flex-start;align-items:stretch;
  background:#05080c;
}
.lobby.show{display:flex}
.lobby-hero{position:relative;flex:0 0 38%;min-height:190px;max-height:420px;overflow:hidden}
.lobby-hero::after{content:'';position:absolute;inset:0;pointer-events:none;box-shadow:inset 0 -40px 40px -20px #05080c}
.lh-art{width:100%;height:100%;object-fit:cover;object-position:50% 32%;transform:scale(1.02)}
.lh-veil{
  position:absolute;inset:0;
  background:
    linear-gradient(180deg,rgba(3,6,10,.62) 0%,rgba(3,6,10,.12) 32%,rgba(3,6,10,.55) 72%,#05080c 100%),
    radial-gradient(80% 50% at 50% 30%,rgba(3,6,10,0) 40%,rgba(3,6,10,.55) 100%);
}
.lh-title{position:absolute;left:0;right:0;bottom:16px;display:flex;flex-direction:column;align-items:center;gap:2px}
.lh-title .tseal{position:absolute;right:14px;top:-58px;width:34px;height:34px;margin:0;font-size:10px;
  transform:rotate(-7deg);box-shadow:0 4px 14px rgba(0,0,0,.6), inset 0 0 12px rgba(0,0,0,.5)}
.lh-title h1{
  margin:0;font-family:var(--brush);font-size:clamp(44px,12vh,58px);font-weight:900;letter-spacing:5px;line-height:.95;
  color:#fdf3e2;
  text-shadow:0 0 30px rgba(255,190,120,.35),0 0 60px rgba(207,74,65,.35),0 4px 10px #000;
}
.lh-title p{
  margin:2px 0 0;font-family:var(--serif);font-size:10px;letter-spacing:5px;color:#cbb894;
  text-shadow:0 1px 6px #000;
}
.silver.big{
  position:absolute;right:12px;top:12px;left:auto;width:max-content;height:28px;padding:0 10px 0 6px;
  background:linear-gradient(180deg,rgba(30,24,12,.9),rgba(14,11,6,.9));
  backdrop-filter:blur(4px);
}
.silver.big i{width:18px;height:18px;font-size:9.5px}
.silver.big b{font-size:14px}
.silver.big span{font-family:var(--serif);font-size:9px;color:#a89877;margin-left:1px}

.lobby-side{flex:1 1 auto;min-height:0;display:flex;flex-direction:column}
.lobby-panel{
  flex:1;min-height:0;display:flex;flex-direction:column;
  padding:8px 14px 0;
  background:
    linear-gradient(180deg,rgba(3,6,10,.9),rgba(5,9,14,.98) 40%),
    repeating-linear-gradient(0deg,rgba(255,255,255,.012) 0 1px,transparent 1px 3px);
}
.tabs{display:flex;gap:6px;flex:0 0 34px;height:34px}
.tab{
  flex:1;border-radius:9px 9px 0 0;cursor:pointer;
  border:1px solid #1e2937;border-bottom:none;
  background:linear-gradient(180deg,#0e141c,#0a0f16);
  color:#7f8d9c;font-family:var(--sans);font-weight:600;font-size:11.5px;letter-spacing:1px;
}
.tab.on{
  color:#ffe6a8;border-color:rgba(224,189,106,.42);
  background:linear-gradient(180deg,rgba(48,36,18,.85),rgba(18,14,10,.9));
  box-shadow:inset 0 1px 0 rgba(255,230,180,.14);
}
.tab-body{flex:1;min-height:0;overflow-y:auto;padding:8px 2px 4px;
  border-top:1px solid rgba(224,189,106,.16);margin-top:-1px;-webkit-overflow-scrolling:touch}
.tab-body.hide{display:none}
.tab-body::-webkit-scrollbar{width:3px}
.tab-body::-webkit-scrollbar-thumb{background:rgba(224,189,106,.3);border-radius:2px}

.uprow{
  display:flex;align-items:center;gap:9px;padding:7px 9px;margin-bottom:6px;
  border-radius:10px;
  background:linear-gradient(180deg,rgba(22,30,40,.85),rgba(10,15,21,.9));
  border:1px solid #1e2a38;
}
.uprow .uic{
  width:30px;height:30px;flex:0 0 30px;border-radius:7px;display:grid;place-items:center;
  font-family:var(--sans);font-weight:600;font-size:13px;color:#ffe6a8;
  background:linear-gradient(160deg,rgba(70,54,24,.9),rgba(28,22,12,.95));
  border:1px solid rgba(224,189,106,.32);
}
.uprow .uinfo{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}
.uprow .un{font-family:var(--sans);font-weight:500;font-size:12px;color:#f0e6d2;letter-spacing:.3px}
.uprow .ud{font-size:9.5px;color:#8593a1;letter-spacing:0}
.uprow .ulv{display:flex;gap:2px;margin-top:2px}
.uprow .ulv i{width:11px;height:3px;border-radius:2px;background:#22303f}
.uprow .ulv i.on{background:linear-gradient(90deg,#e0bd6a,#ffe6a8)}
.uprow .ubtn{
  flex:0 0 66px;height:31px;border-radius:8px;cursor:pointer;
  border:1px solid rgba(224,189,106,.4);
  background:linear-gradient(180deg,rgba(66,52,22,.9),rgba(30,24,10,.95));
  color:#ffe6a8;font-family:var(--sans);font-size:10.5px;font-weight:800;
  display:flex;align-items:center;justify-content:center;gap:3px;
}
.uprow .ubtn i{font-style:normal;width:12px;height:12px;border-radius:50%;display:grid;place-items:center;
  font-family:var(--serif);font-size:7px;color:#3a2c08;
  background:radial-gradient(circle at 35% 30%,#ffeab4,#d8ab4e 60%,#8a6516)}
.uprow .ubtn.max{border-color:#2b3644;background:#101720;color:#6f7d8b;font-family:var(--serif)}
.uprow .ubtn.poor{filter:grayscale(.7) brightness(.62)}
.uprow .ubtn.poor i{filter:grayscale(1) brightness(.8)}
.lobby-note{
  margin:2px 2px 0;padding:7px 9px;border-radius:8px;text-align:center;
  font-family:var(--sans);font-weight:500;font-size:9px;letter-spacing:.2px;color:#7d8b98;
  background:rgba(255,255,255,.02);border:1px dashed rgba(224,189,106,.16);
}
.lobby-note b{color:#c8b48b;font-weight:400}
.lobby-how{display:flex;gap:5px;margin-top:6px}
.howc{
  flex:1;display:flex;flex-direction:column;align-items:center;gap:1px;
  padding:7px 3px 6px;border-radius:9px;text-align:center;
  background:linear-gradient(180deg,rgba(22,30,40,.7),rgba(9,14,20,.8));
  border:1px solid #1c2733;
}
.howc b{
  font-family:var(--serif);font-size:9px;color:#7d6a3f;letter-spacing:1px;
  width:16px;height:16px;line-height:16px;border-radius:50%;
  border:1px solid rgba(224,189,106,.35);margin-bottom:1px;
}
.howc .ht{font-family:var(--sans);font-weight:500;font-size:11.5px;color:#f0e4cc;letter-spacing:.3px}
.howc .hd{font-size:8.5px;color:#728090;letter-spacing:-.1px;line-height:1.25}

/* 도감 */
.codex-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:5px;margin-bottom:10px}
.cx{
  position:relative;aspect-ratio:1/1.15;border-radius:8px;overflow:hidden;
  background:linear-gradient(180deg,#121b25,#0a1017);border:1px solid #1d2836;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;
}
.cx .ct{font-family:var(--num);font-weight:700;font-size:8.5px;color:var(--c,#5b6877)}
.cx .cg{font-family:var(--serif);font-size:17px;line-height:1;color:var(--c,#3a4552)}
.cx .cn{font-family:var(--sans);font-weight:500;font-size:8px;color:#9aa7b5;letter-spacing:-.3px;text-align:center;padding:0 1px}
.cx.lock .cg{color:#2b3644}
.cx.lock .cn{color:#3d4956}
.cx.seen{border-color:color-mix(in srgb,var(--c) 45%,#1d2836);
  box-shadow:inset 0 0 16px color-mix(in srgb,var(--c) 16%,transparent)}
.cx .ck{position:absolute;right:3px;top:2px;font-size:7px;color:#6bd8b8}
.cxsec{font-family:var(--serif);font-size:10px;letter-spacing:1.2px;color:#c8b48b;margin:2px 0 6px;
  display:flex;align-items:center;gap:6px}
.cxsec::after{content:'';flex:1;height:1px;background:linear-gradient(90deg,rgba(224,189,106,.28),transparent)}
.frow{display:flex;align-items:center;gap:8px;padding:6px 8px;margin-bottom:5px;border-radius:9px;
  background:linear-gradient(180deg,rgba(20,27,36,.8),rgba(9,14,20,.85));border:1px solid #1d2836}
.frow .fic{width:24px;height:24px;flex:0 0 24px;border-radius:6px;display:grid;place-items:center;
  font-family:var(--serif);font-size:12px;border:1px solid;background:rgba(255,255,255,.03)}
.frow .fnm{font-family:var(--serif);font-size:11px;color:#eee3ce}
.frow .fde{font-size:9px;color:#7e8b99;letter-spacing:-.1px}
.frow.lock{opacity:.45}
.recs{display:flex;gap:6px;margin:4px 0 8px}
.recs>div{flex:1;padding:6px 4px;border-radius:8px;text-align:center;background:rgba(8,12,17,.7);border:1px solid rgba(255,255,255,.06)}
.recs span{display:block;font-family:var(--sans);font-weight:400;font-size:8.5px;color:#7e8b99;letter-spacing:.3px}
.recs b{font-family:var(--num);font-size:15px;font-weight:700;color:#f0e3c6}
.lobby-foot{flex:0 0 auto;padding:6px 14px calc(12px + env(safe-area-inset-bottom));background:#05080c;text-align:center}
.lobby-foot .big{height:48px}

/* ================= 비급 선택 ================= */
.draftov{
  background:radial-gradient(circle at 50% 34%,rgba(30,22,10,.9),rgba(2,4,8,.98) 74%);
}
.draft{width:100%;max-width:520px;display:flex;flex-direction:column;align-items:center}
.d-han{
  font-family:var(--serif);font-size:11px;letter-spacing:8px;color:#a08c62;margin-bottom:2px;
}
.draft h2{
  margin:0;font-family:var(--brush);font-size:clamp(34px,5.4vh,44px);font-weight:900;letter-spacing:4px;color:#fdf1d8;
  text-shadow:0 0 26px rgba(255,190,110,.45),0 3px 10px #000;
}
.d-sub{margin:2px 0 14px;font-family:var(--sans);font-weight:500;font-size:10.5px;letter-spacing:.4px;color:#a99a80}
.d-sub b{color:#ffe6a8}
.cards{width:100%;display:flex;flex-direction:column;gap:8px}
.gcard{
  position:relative;display:flex;align-items:center;gap:10px;padding:11px 12px;
  border-radius:12px;cursor:pointer;text-align:left;overflow:hidden;
  background:linear-gradient(100deg,rgba(30,26,18,.95),rgba(12,16,22,.97));
  border:1px solid rgba(224,189,106,.3);
  box-shadow:0 10px 26px rgba(0,0,0,.5);
  transform:translateY(0);transition:transform .08s, box-shadow .15s, border-color .15s;
  animation:cardIn .3s ease-out backwards;
}
.gcard:nth-child(1){animation-delay:.02s}
.gcard:nth-child(2){animation-delay:.08s}
.gcard:nth-child(3){animation-delay:.14s}
@keyframes cardIn{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}
.gcard:active{transform:scale(.985)}
.gcard .gs{
  width:44px;height:44px;flex:0 0 44px;border-radius:9px;display:grid;place-items:center;
  font-family:var(--brush);font-weight:900;font-size:24px;color:#fff3dc;
  background:linear-gradient(160deg,rgba(90,70,30,.95),rgba(34,26,14,.95));
  border:1px solid rgba(255,225,170,.35);
  box-shadow:inset 0 0 12px rgba(0,0,0,.45);
}
.gcard .gt{flex:1;min-width:0}
.gcard .gn{font-family:var(--serif);font-size:14.5px;color:#fbf2e0;letter-spacing:.3px;display:flex;align-items:center;gap:6px}
.gcard .gn .rar{
  font-family:var(--serif);font-size:8.5px;letter-spacing:.3px;padding:1px 5px;border-radius:8px;border:1px solid currentColor;
}
.gcard .gd{font-size:10.5px;color:#a9b6c4;margin-top:2px;letter-spacing:.1px}
.gcard .gst{font-family:var(--num);font-weight:700;font-size:9.5px;color:#ffe6a8;margin-left:auto;flex:0 0 auto}
.gcard.legend{border-color:rgba(255,205,110,.55);
  background:linear-gradient(100deg,rgba(58,40,14,.96),rgba(16,14,20,.97));
  box-shadow:0 10px 30px rgba(0,0,0,.55), inset 0 0 24px rgba(255,190,90,.10)}
.gcard.legend .gs{background:linear-gradient(160deg,rgba(140,100,30,.95),rgba(48,32,10,.95));color:#fff8e2}
.gcard.rare{border-color:rgba(120,180,220,.4)}
.gcard .shine{
  position:absolute;inset:0;pointer-events:none;
  background:linear-gradient(100deg,transparent 30%,rgba(255,240,200,.10) 46%,transparent 62%);
}

/* ================= 모의 광고 ================= */
#adScreen{z-index:70}
.adbox{
  width:100%;max-width:320px;padding:22px 18px;border-radius:16px;text-align:center;
  background:linear-gradient(180deg,rgba(26,22,16,.96),rgba(10,13,18,.98));
  border:1px solid rgba(224,189,106,.3);
  box-shadow:0 20px 50px rgba(0,0,0,.65);
}
.adbox b{font-family:var(--brush);font-size:30px;font-weight:900;color:#ffe6a8;letter-spacing:3px}
.adbox p{margin:6px 0 12px;font-size:11.5px;color:#b3bfcb}
.adbar{height:5px;border-radius:3px;background:#1d2733;overflow:hidden}
.adbar i{display:block;height:100%;width:0%;background:linear-gradient(90deg,#5ccdb4,#e0bd6a)}

/* ================= 도감 오버레이 ================= */
#codexScreen{
  padding:0;align-items:stretch;background:radial-gradient(circle at 50% 20%,rgba(18,24,32,.97),rgba(3,5,9,.99) 70%);
}
.codex{
  width:100%;max-width:760px;margin:0 auto;display:flex;flex-direction:column;
  padding:calc(14px + env(safe-area-inset-top)) 14px calc(10px + env(safe-area-inset-bottom));
}
.codex-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.codex-head h2{margin:0;font-family:var(--brush);font-size:34px;font-weight:900;letter-spacing:2px;color:#f6e7cc}
.codex-body{flex:1;min-height:0;overflow-y:auto}

/* ================= 서사 배너 (스토리 20파) ================= */
.story{
  position:absolute;left:0;right:0;top:56px;display:none;flex-direction:column;align-items:center;gap:1px;
  pointer-events:none;z-index:6;padding:5px 0 7px;
  background:linear-gradient(90deg,rgba(4,6,10,0),rgba(6,8,12,.74) 18%,rgba(6,8,12,.74) 82%,rgba(4,6,10,0));
}
.story.show{display:flex;animation:storyIn 3.4s ease-out forwards}
.story b{
  font-family:var(--brush);font-size:26px;font-weight:900;letter-spacing:1.5px;color:#fdf1d8;
  text-shadow:0 0 22px rgba(255,180,110,.55),0 2px 10px #000;white-space:nowrap;
}
.story span{font-family:var(--sans);font-weight:500;font-size:9.5px;letter-spacing:1.2px;color:#c9b58f}
@keyframes storyIn{
  0%{opacity:0;transform:translateY(-9px)}
  9%{opacity:1;transform:none}
  79%{opacity:1;transform:none}
  100%{opacity:0;transform:translateY(-3px)}
}

/* ================= 최종 보스 연출 ================= */
.bossbar.final{
  border-color:rgba(255,60,84,.78);background:rgba(36,3,9,.93);
  box-shadow:0 4px 24px rgba(0,0,0,.65), inset 0 0 20px rgba(255,40,60,.28);
}
.bossbar.final span{color:#ffb0bd;font-size:11px;letter-spacing:1.2px;text-shadow:0 0 10px rgba(255,50,70,.7)}
.bossbar.final img{border-color:rgba(255,80,100,.85);box-shadow:0 0 12px rgba(255,40,60,.65)}
.bossbar.final u{background:linear-gradient(90deg,#ff2038,#ff8494)}
.bossbanner.final{
  padding:14px 0;
  background:linear-gradient(90deg,rgba(60,0,8,0),rgba(88,4,14,.9) 20%,rgba(88,4,14,.9) 80%,rgba(60,0,8,0));
}
.bossbanner.final.show{animation:bossIn 3s ease-out forwards}
.bossbanner.final .bb-img{width:64px;height:64px;border-color:rgba(255,110,130,.7);
  box-shadow:0 0 28px rgba(255,30,60,.7)}
.bossbanner.final .bb-txt b{font-size:41px;color:#fff0f2;
  text-shadow:0 0 32px rgba(255,40,60,1),0 3px 10px #000}
.bossbanner.final .bb-txt span{color:#ff9aaa}

/* ================= 무한 강호 HUD ================= */
.pill.wave.endless{
  border-color:rgba(255,120,140,.55);
  background:linear-gradient(180deg,rgba(64,16,26,.92),rgba(18,8,12,.92));
}
.pill.wave.endless .k{color:#e08a9a;letter-spacing:0}
.pill.wave.endless b{color:#ffb3c0}

/* ================= 승리 엔딩 ================= */
.winscreen{
  background:radial-gradient(circle at 50% 26%,rgba(58,38,12,.92),rgba(3,4,8,.985) 74%);
  backdrop-filter:blur(5px);
}
.tcard.win{
  max-width:460px;
  border-color:rgba(255,214,138,.5);
  background:linear-gradient(180deg,rgba(40,31,16,.97),rgba(10,12,18,.985));
  box-shadow:0 26px 70px rgba(0,0,0,.72), inset 0 1px 0 rgba(255,235,200,.12), 0 0 70px rgba(255,190,90,.1);
}
.tseal.gold{
  background:linear-gradient(160deg,#e8c063,#7a4d10);
  border-color:rgba(255,244,214,.6);color:#2c1c05;
  font-family:var(--brush);font-weight:900;font-size:20px;
  box-shadow:0 0 22px rgba(255,190,90,.5), inset 0 0 14px rgba(255,240,200,.5);
}
.tcard.win h2{font-size:39px;color:#fdf3dc;text-shadow:0 0 30px rgba(255,196,110,.6),0 3px 10px #000}
.wend{
  margin:9px 0 2px;font-family:var(--sans);font-weight:400;font-size:10px;line-height:1.75;
  color:#c6b79a;letter-spacing:.1px;
}
.tcard.win .result div{background:rgba(40,32,16,.6);border-color:rgba(255,220,170,.14)}
.tcard.win .result b{color:#ffe9c0}
.earn.win{border-color:rgba(255,214,138,.45);margin-bottom:5px}
.wrun{
  display:block;margin:0 0 11px;font-family:var(--sans);font-weight:400;font-size:9px;
  letter-spacing:.3px;color:#8d7f66;
}
.big.win{
  background:linear-gradient(180deg,#c8a04a,#7a5410);
  border-color:rgba(255,236,190,.55);color:#fff8e8;
  box-shadow:0 8px 26px rgba(150,100,20,.45), inset 0 1px 0 rgba(255,240,200,.4);
  font-size:21px;
}

/* ================= 로비 훈장 · 도감 스토리 카드 ================= */
.lobby-medal{
  position:absolute;left:12px;top:12px;display:none;flex-direction:column;align-items:center;
  padding:5px 9px 4px;border-radius:9px;
  border:1px solid rgba(255,214,138,.5);
  background:linear-gradient(180deg,rgba(66,50,18,.95),rgba(24,18,8,.95));
  box-shadow:0 4px 16px rgba(0,0,0,.55), inset 0 0 14px rgba(255,190,90,.18);
}
.lobby-medal.show{display:flex}
.lobby-medal b{font-family:var(--brush);font-size:17px;font-weight:900;letter-spacing:1.2px;
  color:#ffe6a8;line-height:1;text-shadow:0 0 12px rgba(255,190,90,.6)}
.lobby-medal small{font-family:var(--sans);font-weight:600;font-size:7px;letter-spacing:.7px;color:#b6a078;margin-top:2px}

.storycard{
  display:flex;align-items:center;gap:8px;padding:7px 9px;margin:2px 0 8px;border-radius:9px;
  background:linear-gradient(90deg,rgba(30,24,14,.9),rgba(10,13,18,.9));
  border:1px dashed rgba(224,189,106,.26);
}
.storycard b{
  font-family:var(--brush);font-size:15px;font-weight:900;color:#8d7f66;letter-spacing:1px;
  flex:0 0 auto;
}
.storycard span{font-family:var(--sans);font-weight:400;font-size:9px;line-height:1.35;color:#8b97a4}
.storycard.done{
  border-style:solid;border-color:rgba(255,214,138,.5);
  background:linear-gradient(90deg,rgba(58,44,18,.85),rgba(12,15,20,.9));
}
.storycard.done b{color:#ffe6a8;text-shadow:0 0 12px rgba(255,190,90,.55)}
.storycard.done span{color:#c9b58f}

/* =========================================================
   좁은 세로 화면 — 보드를 줄여 전장을 지킨다
   ========================================================= */
@media (orientation:portrait) and (max-height:700px){
  :root{--console:122px}
  .board{width:min(100%,222px);justify-self:center}
  .bh-hint{display:none}
  .lobby-hero{flex-basis:29%;min-height:158px}
}
/* 세로 모드 태블릿: 폰과 같은 구도를 유지하려고 폭을 제한한다 */
@media (orientation:portrait) and (min-width:600px){
  .app{max-width:560px;margin:0 auto;border-left:1px solid #16202c;border-right:1px solid #16202c;box-shadow:0 0 80px rgba(0,0,0,.6)}
  .panel{grid-template-columns:minmax(0,1fr) 132px}
  .board{width:min(100%,308px);justify-self:center}
  .synbar{padding:4px 14px 5px}
}
@media (orientation:portrait){
  /* 좁은 세로 화면: 칩의 '/2'는 아래 시너지 줄이 대신 알려준다 */
  .fchip .fneed{display:none}
  .syn-factions{overflow:hidden}
  .act2{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr;gap:5px;flex:1.15 1 0}
  .act2 .btn{flex:none;min-height:30px}
  .btn.speed{flex:none;width:100%;min-width:0}
}
@media (orientation:portrait) and (max-height:600px){
  .brand-txt small{display:none}
  .board-head{height:13px}
  .board{width:min(100%,202px)}
  .fchip{height:20px}
  .pill.gate .gate-bar{width:30px}
  .act2{grid-template-columns:1fr;grid-template-rows:repeat(4,1fr)}
  .act2 .btn{min-height:0}
}

/* =========================================================
   가로 / 데스크톱 — 통합 헤더 + 좌우 2단
   ========================================================= */
@media (orientation:landscape) and (min-width:720px){
  .app{
    max-width:1680px;margin:0 auto;
    display:grid;
    grid-template-columns:minmax(0,1.62fr) minmax(330px,1fr);
    grid-template-rows:auto minmax(0,1fr) auto;
    grid-template-areas:
      "top   top"
      "field panel"
      "syn   panel";
    border-left:1px solid #16202c;border-right:1px solid #16202c;
    box-shadow:0 0 90px rgba(0,0,0,.7);
  }
  .topwrap{
    grid-area:top;flex-direction:row;align-items:center;gap:20px;
    height:60px;padding:0 18px;
    border-bottom:1px solid rgba(224,189,106,.2);
  }
  .topbar{height:auto;flex:0 0 auto;padding:0;gap:16px;align-items:center}
  .brand{gap:10px}
  .seal{width:32px;height:32px;flex:0 0 32px;font-size:10.5px;border-radius:7px}
  .brand-txt b{font-size:24px;letter-spacing:1px}
  .brand-txt small{font-size:8.5px;letter-spacing:2.4px;margin-top:3px}
  .silver{height:27px;padding:0 10px 0 6px}
  .silver i{width:17px;height:17px;font-size:9px}
  .silver b{font-size:14px}
  .icon-btn{height:30px;min-width:30px;padding:0 10px;font-size:11.5px}
  .hud{
    height:auto;flex:1 1 auto;padding:0;background:none;border-top:0;gap:9px;
    justify-content:flex-start;
  }
  .pill{height:26px;padding:0 11px;font-size:11.5px;gap:5px}
  .pill b{font-size:15px}
  .pill.gate b{font-size:14.5px}
  .gate-bar{width:64px;height:5px}
  .pill.mini{margin-left:auto}
  .pill.mini b{font-size:14px}

  .fieldwrap{
    grid-area:field;min-height:0;height:auto;
    border-bottom:0;border-right:1px solid rgba(224,189,106,.14);
  }
  .synbar{
    grid-area:syn;padding:6px 16px 8px;gap:5px;
    border-bottom:0;border-top:1px solid rgba(224,189,106,.12);
  }
  .fchip{height:26px;padding:0 9px;gap:5px;border-radius:7px}
  .fchip .fi{font-size:13px}
  .fchip .fn{font-size:11.5px}
  .fchip .fc{font-size:14px}
  .fchip .fneed{font-size:10px}
  .syn-active{height:20px}
  .syn-active .sb{font-size:11px;padding:2px 9px}
  .syn-active .none{font-size:11px}

  .panel{
    grid-area:panel;display:flex;flex-direction:column;
    padding:14px 16px 16px;gap:10px;
    border-top:0;border-left:1px solid rgba(224,189,106,.12);
    container-type:size;
  }
  .board-head{height:16px;flex:0 0 16px}
  .bh-title{font-size:12.5px;letter-spacing:1.6px}
  .bh-hint{font-size:11px}
  .board{
    flex:0 0 auto;margin:auto;
    width:100%;max-width:520px;
    width:min(100%, 520px, calc(100cqh - 150px));
    aspect-ratio:1/1;
    grid-template-columns:repeat(4,minmax(0,1fr));
    grid-template-rows:repeat(4,minmax(0,1fr));
    gap:9px;
  }
  .cell{border-radius:13px}
  .unit .tier{font-size:11px}
  .unit .nm{font-size:14px}
  .unit .fmark{font-size:9.5px}
  .unit .wm{font-size:48px;right:-3px;bottom:-10px}

  .console{flex:0 0 auto;display:flex;flex-direction:column;gap:8px}
  .act1{flex:0 0 56px;display:flex;flex-direction:row;gap:9px}
  .act2{flex:0 0 42px;display:flex;flex-direction:row;gap:9px}
  .act2 .btn{min-height:0}
  .act1 .btn,.act2 .btn{flex:1 1 0}
  .act1 .btn.summon{flex:1.35 1 0}
  .act1 .btn.summon .bt{font-size:26px}
  .btn .bt{font-size:13px}
  .btn .bc{font-size:10.5px}
  .btn.small .bt{font-size:11.5px}
  .btn.speed{flex:0 0 54px;font-size:15px}
  .skillbtn{width:66px;height:66px}
  .skillbtn .sb-txt{font-size:8.5px}
  .breakbar{right:88px;height:40px}

  .toast{font-size:12.5px}
  .cutin b{font-size:44px}
  .bossbanner .bb-txt b{font-size:42px}
  .story b{font-size:30px}
  .story span{font-size:10px}

  /* 로비 · 도감 · 비급 · 엔딩 */
  .lobby{flex-direction:row}
  .lobby-hero{flex:1 1 46%;height:auto;max-height:none;min-height:0}
  .lobby-side{flex:1 1 54%}
  .lobby-panel{padding:14px 20px 0}
  .lobby-foot{padding:10px 20px 18px}
  .lh-title h1{font-size:clamp(48px,8.5vh,86px)}
  .codex-grid{grid-template-columns:repeat(10,1fr)}
  .codex{max-width:920px;padding:20px 24px}
  .codex-head h2{font-size:40px}
  .draft{max-width:560px}
  .overlay{padding:24px}
  .tcard{padding:22px 24px 18px}
  .tcard h2{font-size:38px}
}

/* 아주 낮은 가로 화면 (가로 모드 휴대폰) */
@media (orientation:landscape) and (min-width:720px) and (max-height:520px){
  .topwrap{height:48px}
  .brand-txt small{display:none}
  .seal{width:28px;height:28px;flex:0 0 28px}
  .brand-txt b{font-size:20px}
  .pill{height:23px;font-size:10.5px}
  .pill b{font-size:13px}
  .panel{padding:8px 10px 10px;gap:6px}
  .board{width:min(100%, 520px, calc(100cqh - 128px));gap:7px}
  .act1{flex:0 0 44px}
  .act2{flex:0 0 34px}
  .synbar{padding:3px 10px 5px}
  .fchip{height:22px}
}

/* =========================================================
   v5 — 보스 파훼 전조 · 오늘의 시험 · 강호 전적표
   ========================================================= */

/* HUD 모드 배지 (오늘의 시험에서만) */
.modechip{
  flex:0 0 auto;height:18px;padding:0 7px;border-radius:20px;
  display:flex;align-items:center;
  background:linear-gradient(180deg,rgba(122,28,24,.92),rgba(58,12,12,.92));
  border:1px solid rgba(255,150,130,.5);
  font-family:var(--serif);font-size:8.5px;letter-spacing:.2px;color:#ffcdb8;
  white-space:nowrap;
  box-shadow:inset 0 0 8px rgba(255,120,90,.16);
}
.modechip.hide{display:none}
@media (max-width:359px){ .modechip{display:none} }

/* 보스 필살기 전조 — 전장 안내 */
.parryAlert{
  position:absolute;left:50%;top:64px;transform:translate(-50%,0) scale(1);
  display:none;flex-direction:column;align-items:center;gap:0;
  padding:4px 14px 5px;border-radius:10px;pointer-events:none;z-index:15;
  background:linear-gradient(180deg,rgba(88,10,12,.92),rgba(24,6,8,.88));
  border:1px solid rgba(255,150,120,.55);
  box-shadow:0 6px 24px rgba(0,0,0,.6), inset 0 0 18px rgba(255,90,60,.22);
}
.parryAlert.show{
  display:flex;
  animation:parryIn .22s ease-out both, parryPulse .9s ease-in-out infinite;
}
.parryAlert b{
  font-family:var(--brush);font-size:21px;font-weight:900;line-height:1.05;
  color:#ffd479;text-shadow:0 0 14px rgba(255,120,60,.9),0 2px 6px #000;
}
.parryAlert span{
  font-family:var(--sans);font-weight:600;font-size:9.5px;letter-spacing:.3px;color:#ffc7b0;white-space:nowrap;
}
@keyframes parryIn{from{opacity:0;transform:translate(-50%,-10px) scale(1.08)}to{opacity:1;transform:translate(-50%,0) scale(1)}}
@keyframes parryPulse{
  0%,100%{box-shadow:0 6px 24px rgba(0,0,0,.6), inset 0 0 18px rgba(255,90,60,.22)}
  50%{box-shadow:0 6px 28px rgba(0,0,0,.6), inset 0 0 26px rgba(255,120,70,.42), 0 0 0 4px rgba(255,90,60,.08)}
}

/* 결과 화면 — 모드 표기 + 전적표 버튼 */
.runmode{
  display:inline-block;margin:5px auto 0;padding:2px 11px;border-radius:20px;
  background:rgba(122,28,24,.82);border:1px solid rgba(255,150,130,.45);
  font-family:var(--serif);font-size:9.5px;letter-spacing:.4px;color:#ffcdb8;
}
.runmode.hide{display:none}
.cardbtn{
  width:100%;height:38px;margin-top:7px;border-radius:10px;cursor:pointer;
  display:flex;align-items:center;justify-content:center;gap:6px;
  border:1px solid rgba(224,189,106,.5);
  background:linear-gradient(180deg,rgba(54,44,22,.92),rgba(20,16,10,.96));
  color:#ffe6a8;font-family:var(--sans);font-weight:700;font-size:12.5px;letter-spacing:.6px;
  box-shadow:inset 0 1px 0 rgba(255,230,180,.12);
}
.cardbtn i{
  font-style:normal;font-family:var(--serif);font-size:11px;color:#d8b56a;
  border:1px solid rgba(224,189,106,.45);border-radius:4px;padding:0 3px;line-height:1.35;
}
.cardbtn:active{transform:translateY(1px)}
/* v6 — 은자 1.5배(광고 보상) 버튼 */
.boostbtn{
  width:100%;height:40px;margin:0 0 7px;border-radius:10px;cursor:pointer;
  display:flex;align-items:center;justify-content:center;gap:7px;
  border:1px solid rgba(255,214,138,.55);
  background:linear-gradient(180deg,rgba(88,66,22,.92),rgba(32,24,10,.96));
  color:#ffe6a8;font-family:var(--serif);font-size:11.5px;letter-spacing:.3px;
  box-shadow:0 6px 20px rgba(120,86,20,.26), inset 0 1px 0 rgba(255,235,180,.14);
}
.boostbtn b{font-weight:400}
.boostbtn span{font-family:var(--num);font-weight:700;font-size:13px;letter-spacing:0;color:#fff0c4}
.boostbtn.used{
  border-color:rgba(120,140,160,.35);
  background:linear-gradient(180deg,rgba(26,32,40,.92),rgba(12,16,22,.96));color:#8d9aa8;
  box-shadow:none;cursor:default;
}
.boostbtn.used span{color:#9fb3c4}
.boostbtn:active{transform:translateY(1px)}

/* v6 — 기사회생(부활) 팝업 */
.revivescreen{
  z-index:58;
  background:radial-gradient(circle at 50% 42%,rgba(62,10,10,.92),rgba(2,4,8,.985) 72%);
}
.revivebox{
  width:100%;max-width:340px;padding:20px 18px 14px;border-radius:18px;text-align:center;
  background:linear-gradient(180deg,rgba(36,20,16,.96),rgba(10,12,18,.98));
  border:1px solid rgba(224,120,104,.45);
  box-shadow:0 24px 64px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,220,180,.08);
  animation:reviveIn .34s cubic-bezier(.2,1.4,.4,1) both;
}
@keyframes reviveIn{from{transform:translateY(14px) scale(.94);opacity:0}to{transform:none;opacity:1}}
.rseal{
  width:46px;height:46px;margin:0 auto 6px;border-radius:50%;
  display:grid;place-items:center;font-size:22px;line-height:1;color:#ffe9d6;
  background:radial-gradient(circle at 35% 30%,#b23a30,#5e1811 70%);
  border:1px solid rgba(255,220,180,.45);
  animation:rsealPulse 1.6s ease-in-out infinite;
}
@keyframes rsealPulse{
  0%,100%{box-shadow:0 0 18px rgba(207,74,65,.32),inset 0 0 14px rgba(0,0,0,.5)}
  50%{box-shadow:0 0 36px rgba(255,120,90,.6),inset 0 0 14px rgba(0,0,0,.5)}
}
.revivebox h2{
  margin:0;font-family:var(--brush);font-size:38px;font-weight:900;letter-spacing:3px;color:#ffe9d6;
  text-shadow:0 0 24px rgba(255,120,90,.45);
}
.rsub{margin:2px 0 10px;font-family:var(--sans);font-weight:500;font-size:10px;letter-spacing:1.2px;color:#c2a693}
.rgauge{display:flex;flex-direction:column;align-items:center;gap:4px;margin:0 0 12px}
.rgauge b{
  font-family:var(--num);font-size:30px;font-weight:700;line-height:1;color:#ffd479;
  text-shadow:0 0 18px rgba(255,180,90,.5);
}
.rbar{width:100%;height:5px;border-radius:3px;background:rgba(255,255,255,.10);overflow:hidden}
.rbar i{display:block;height:100%;width:100%;background:linear-gradient(90deg,#cf4a41,#ffd479)}
.rgauge span{font-family:var(--sans);font-weight:400;font-size:9.5px;color:#a08e7c}
.big.revive{height:44px;font-size:20px;background:linear-gradient(180deg,#b8492f,#6d1d12);border-color:rgba(255,220,170,.5)}
.rhint{margin:7px 0 2px;font-family:var(--sans);font-weight:400;font-size:9.5px;line-height:1.55;color:#9b8b78}

/* 전적표 미리보기 */
.cardscreen{
  z-index:60;
  background:radial-gradient(circle at 50% 28%,rgba(20,15,10,.94),rgba(2,4,8,.985) 74%);
}
.cardbox{
  width:100%;max-width:390px;display:flex;flex-direction:column;align-items:center;gap:8px;
}
.cardbox h3{
  margin:0;font-family:var(--brush);font-size:25px;font-weight:900;letter-spacing:2px;
  color:#ffe6a8;text-shadow:0 0 18px rgba(255,190,90,.4);
}
.cardimgwrap{
  width:100%;max-height:min(62vh,520px);display:flex;justify-content:center;
  border-radius:12px;overflow:hidden;background:#0a0f16;
  border:1px solid rgba(224,189,106,.45);
  box-shadow:0 16px 44px rgba(0,0,0,.7);
}
.cardimgwrap img{
  width:100%;height:auto;max-height:min(62vh,520px);object-fit:contain;display:block;
  -webkit-touch-callout:default;user-select:auto;
}
.cardhint{margin:0;font-family:var(--sans);font-weight:400;font-size:10px;letter-spacing:.2px;color:#8f8471;text-align:center}
.big.carddl{height:40px;font-size:18px}
.cardbox .ghostbtn{margin-top:0}

/* 로비 — 일반 입문 + 오늘의 강호 시험 */
.startline{display:flex;flex-direction:column;gap:6px}
.lobby-foot .big.start{font-size:21px}
.lobby-foot .big.start i{
  font-style:normal;font-family:var(--serif);font-size:12px;letter-spacing:0;color:#e8cfae;opacity:.85;
}
.lobby-foot .big.daily{
  height:50px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;
  background:linear-gradient(180deg,rgba(52,42,22,.95),rgba(18,15,10,.97));
  border-color:rgba(255,214,138,.5);
  box-shadow:inset 0 1px 0 rgba(255,230,180,.16), 0 6px 18px rgba(0,0,0,.4);
}
.big.daily .bd-t{
  font-family:var(--brush);font-size:21px;font-weight:900;letter-spacing:1.6px;
  line-height:1;color:#ffe6a8;
}
.big.daily .bd-s{
  font-family:var(--sans);font-weight:400;font-size:9px;letter-spacing:.4px;line-height:1.1;color:#a99a80;
}

@media (orientation:landscape) and (min-width:720px){
  .startline{display:grid;grid-template-columns:1.12fr 1fr;gap:10px;align-items:stretch}
  .lobby-foot .big{height:50px}
  .lobby-foot .big.start{font-size:22px}
  .parryAlert{top:44px}
  .cardbox{max-width:360px}
  .cardimgwrap{max-height:min(70vh,560px)}
  .cardimgwrap img{max-height:min(70vh,560px)}
}
@media (orientation:portrait) and (max-height:640px){
  .lobby-foot .big.start{height:42px;font-size:19px}
  .lobby-foot .big.daily{height:44px}
  .big.daily .bd-t{font-size:18px}
}

/* 전조 중에는 연격 표시를 잠시 숨겨 안내가 읽히게 한다 */
.fieldwrap.parry-on .combo{opacity:0!important}

/* =========================================================
   v7 (2026-12-02) — 전장 2배속 · 정예 예고 · 강호 금패
   ========================================================= */

/* 전장 상단 배속 전환 (1x / 2x) */
.speedHud{
  position:absolute;right:8px;top:36px;z-index:9;display:flex;gap:2px;padding:2px;
  border-radius:9px;background:rgba(6,10,15,.8);border:1px solid rgba(120,150,180,.28);
  box-shadow:0 4px 14px rgba(0,0,0,.45);
}
.speedHud .sp{
  position:relative;min-width:28px;height:22px;padding:0 6px;border-radius:6px;cursor:pointer;
  border:1px solid transparent;background:transparent;color:#8b9aa9;
  font-family:var(--num);font-weight:700;font-size:11px;letter-spacing:0;line-height:1;
}
.speedHud .sp:active{transform:scale(.95)}
.speedHud .sp.on{
  color:#08111a;background:linear-gradient(180deg,#ffe6a8,#e0bd6a);border-color:rgba(255,232,180,.6);
  box-shadow:0 0 10px rgba(224,189,106,.45);
}
.speedHud .sp .splock{
  position:absolute;right:-2px;top:-6px;font-style:normal;font-family:var(--serif);
  font-size:6.5px;line-height:1.15;color:#8fa3b6;background:rgba(6,10,15,.92);
  border:1px solid rgba(120,150,180,.32);border-radius:3px;padding:0 2px;
}
.speedHud .sp .splock:empty{display:none}
.speedHud .sp.locked .splock{color:#ffd479;border-color:rgba(224,189,106,.55)}
.speedHud .sp.owned .splock{color:#ffe6a8;border-color:rgba(255,214,138,.7);background:rgba(64,48,14,.95)}

/* 정예 예고 배너 (보스 파훼 전조 배너와 다른 위치·시간대) */
.eliteBanner{
  position:absolute;left:8px;right:92px;top:34px;transform:translateY(-6px);
  display:none;flex-wrap:wrap;align-items:center;justify-content:center;gap:2px 6px;
  padding:3px 8px 4px;border-radius:9px;pointer-events:none;z-index:14;
  background:linear-gradient(180deg,rgba(40,14,20,.95),rgba(10,8,12,.93));
  border:1px solid rgba(226,74,99,.55);
  box-shadow:0 6px 20px rgba(0,0,0,.6), inset 0 0 14px rgba(226,74,99,.16);
}
.eliteBanner.show{display:flex;animation:eliteIn 2s ease-out forwards}
/* 예고 중에는 연격·서사 배너가 겹치지 않게 잠시 비켜준다 */
.fieldwrap.elite-on .combo{opacity:0!important}
.fieldwrap.elite-on .story{top:92px}
@keyframes eliteIn{
  0%{opacity:0;transform:translateY(-8px)}
  12%{opacity:1;transform:translateY(0)}
  82%{opacity:1;transform:translateY(0)}
  100%{opacity:0;transform:translateY(-2px)}
}
.eliteBanner .eb-title{
  font-family:var(--brush);font-size:14px;font-weight:900;letter-spacing:.5px;
  color:#ffd479;white-space:nowrap;text-shadow:0 0 12px rgba(255,120,90,.55),0 2px 6px #000;
}
.eliteBanner .eb-items{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:1px 5px;min-width:0}
.eliteBanner .eb-items span{
  display:flex;align-items:center;gap:3px;font-family:var(--sans);font-weight:500;font-size:8px;
  letter-spacing:-.2px;color:#e8dcc8;white-space:nowrap;
}
.eliteBanner .eb-items span b{
  font-weight:400;font-size:9px;line-height:1.25;padding:0 2px;border-radius:3px;border:1px solid currentColor;
}
.eliteBanner .eb-items i{font-style:normal;font-size:8px;color:#7c8794}

/* 로비 — 강호 금패 배너 */
.passbar{
  display:flex;align-items:center;gap:8px;margin:0 0 6px;padding:6px 8px;border-radius:11px;
  background:linear-gradient(100deg,rgba(58,44,16,.85),rgba(14,17,22,.9));
  border:1px solid rgba(224,189,106,.4);
  box-shadow:inset 0 1px 0 rgba(255,235,180,.08);
}
.passbar.owned{
  border-color:rgba(255,214,138,.72);
  box-shadow:0 0 0 1px rgba(224,189,106,.14), inset 0 0 18px rgba(224,189,106,.12);
}
.passbar .pb-seal{
  width:26px;height:26px;flex:0 0 26px;display:grid;place-items:center;border-radius:6px;
  font-family:var(--brush);font-weight:900;font-size:16px;line-height:1;color:#ffe9c0;
  background:linear-gradient(160deg,#b8862f,#5c3a0e);border:1px solid rgba(255,225,170,.5);
  box-shadow:inset 0 0 8px rgba(0,0,0,.4);
}
.passbar .pb-txt{flex:1;min-width:0;text-align:left;line-height:1.25}
.passbar .pb-txt b{
  display:block;font-family:var(--serif);font-size:11.5px;font-weight:400;
  color:#ffe6a8;letter-spacing:.4px;
}
.passbar .pb-txt b em{font-style:normal;font-size:8.5px;color:#9aa7b5;margin-left:4px;letter-spacing:0}
.passbar.owned .pb-txt b em{color:#8fe0bb}
.passbar .pb-txt span{
  display:block;font-size:8.5px;color:#93a1b0;letter-spacing:-.1px;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.passbar .pb-btn{
  height:24px;padding:0 10px;border-radius:7px;cursor:pointer;white-space:nowrap;
  border:1px solid rgba(255,214,138,.55);
  background:linear-gradient(180deg,rgba(88,66,22,.9),rgba(32,24,10,.95));
  color:#ffe6a8;font-family:var(--sans);font-weight:600;font-size:10.5px;letter-spacing:.3px;
}
.passbar .pb-btn:active{transform:translateY(1px)}

/* 강호 금패 모달 */
.passscreen{
  z-index:64;
  background:radial-gradient(circle at 50% 34%,rgba(52,36,10,.93),rgba(2,4,8,.985) 74%);
}
.passbox{
  width:100%;max-width:330px;margin:auto;padding:18px 18px 14px;border-radius:18px;text-align:center;
  background:linear-gradient(180deg,rgba(38,30,14,.97),rgba(10,12,18,.98));
  border:1px solid rgba(224,189,106,.5);
  box-shadow:0 24px 64px rgba(0,0,0,.72), inset 0 1px 0 rgba(255,235,180,.12);
  max-height:calc(100dvh - 24px);overflow-y:auto;
}
.passbox .ps-seal{
  width:46px;height:52px;margin:0 auto 6px;display:grid;place-items:center;border-radius:8px;
  font-family:var(--brush);font-weight:900;font-size:31px;line-height:1;color:#ffe9c0;
  background:linear-gradient(160deg,#c8942f,#5c3a0e);border:1px solid rgba(255,225,170,.6);
  box-shadow:0 6px 20px rgba(180,130,40,.32), inset 0 0 12px rgba(0,0,0,.45);
}
.passbox h2{
  margin:0;font-family:var(--brush);font-size:34px;font-weight:900;letter-spacing:3px;
  color:#ffeccb;text-shadow:0 0 24px rgba(255,190,90,.5),0 3px 10px #000;
}
.passbox .ps-sub{
  margin:2px 0 12px;font-family:var(--serif);font-size:9.5px;letter-spacing:.4px;color:#a99a80;
}
.ps-list{display:flex;flex-direction:column;gap:5px;margin:0 0 10px}
.ps-row{
  display:flex;align-items:center;gap:8px;padding:7px 9px;border-radius:9px;text-align:left;
  background:linear-gradient(180deg,rgba(28,24,14,.9),rgba(10,13,18,.9));
  border:1px solid rgba(224,189,106,.22);
}
.ps-row b{
  flex:0 0 74px;font-family:var(--sans);font-weight:600;font-size:11px;color:#ffd479;letter-spacing:.2px;
}
.ps-row span{font-size:9.5px;color:#b8c2cc;letter-spacing:-.1px;line-height:1.35}
.ps-price{
  display:flex;align-items:baseline;justify-content:center;gap:5px;margin:0 0 10px;
  font-family:var(--serif);color:#c9b58f;
}
.ps-price b{font-family:var(--num);font-size:22px;font-weight:700;color:#ffe6a8;letter-spacing:0}
.ps-price span{font-size:9.5px;color:#8e9baa}
.ps-price em{font-style:normal;font-size:8.5px;color:#7e8b99}
.passbox .big.pass{
  height:44px;font-size:20px;margin-bottom:7px;
  background:linear-gradient(180deg,#c79a3a,#7a5212);border-color:rgba(255,226,160,.6);color:#fff6e0;
}
.passbox .big.passclaim{
  height:42px;font-size:18px;margin-bottom:6px;
  background:linear-gradient(180deg,#3f8f74,#1d4c3e);border-color:rgba(150,235,205,.5);color:#ddfff1;
}
.passbox .ps-note{
  margin:0 0 8px;font-family:var(--sans);font-weight:400;font-size:9px;color:#8e9baa;letter-spacing:.2px;
}
.passbox .ps-note.hide{display:none}
.passbox .ghostbtn{width:100%;margin-top:4px}
.passbox .hide{display:none}
.passbox.owned h2{color:#fff3d8}

@media (orientation:landscape) and (min-width:720px){
  .speedHud{top:36px}
  .eliteBanner{top:36px}
  .passbox{max-width:360px}
}

/* =========================================================
   v8 — 연운(Where Winds Meet) 스타일 타이포그래피
   제목: Noto Serif KR 900 · 넓은 자간 · 절제된 금빛/아이보리 그라데이션 · 은은한 그림자
   본문·UI·수치: Pretendard 400~800 · tabular-nums
   ========================================================= */
:root{
  --grad-title:linear-gradient(174deg,#fffdf7 0%,#f9efd9 26%,#eed6a3 56%,#d3ac66 82%,#b8893f 100%);
  --grad-gold:linear-gradient(174deg,#fff6e0 0%,#f6dfab 30%,#e3c07a 62%,#bd9145 90%);
  --title-shadow:drop-shadow(0 1px 2px rgba(0,0,0,.9)) drop-shadow(0 6px 18px rgba(0,0,0,.55));
}

/* ── 공통: 금빛 그라데이션 제목 ── */
.brand-txt b,.lh-title h1,.tcard h2,.codex-head h2,.draft h2,.passbox h2,.cardbox h3,.adbox b,.bb-txt b,.story b{
  font-family:var(--title);font-weight:900;font-style:normal;
  background:var(--grad-title);
  -webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent;
  text-shadow:none;filter:var(--title-shadow);
}
/* ── 자간·크기 미세 조정 (자간이 만든 오른쪽 여백은 음수 마진으로 보정) ── */
.brand-txt b{letter-spacing:.14em;margin-right:-.14em;font-size:19.5px}
.lh-title h1{
  letter-spacing:.2em;margin-right:-.2em;
  filter:drop-shadow(0 2px 4px rgba(0,0,0,.9)) drop-shadow(0 10px 30px rgba(0,0,0,.6)) drop-shadow(0 0 24px rgba(224,189,106,.2));
}
.tcard h2{letter-spacing:.1em;margin-right:-.1em}
.codex-head h2{letter-spacing:.12em;margin-right:-.12em}
.draft h2{letter-spacing:.14em;margin-right:-.14em;filter:drop-shadow(0 1px 2px #000) drop-shadow(0 0 22px rgba(224,189,106,.28))}
.passbox h2{letter-spacing:.14em;margin-right:-.14em;filter:drop-shadow(0 1px 2px #000) drop-shadow(0 0 22px rgba(224,189,106,.32))}
.cardbox h3{letter-spacing:.12em;margin-right:-.12em;filter:drop-shadow(0 1px 2px #000) drop-shadow(0 0 16px rgba(224,189,106,.3))}
.adbox b{letter-spacing:.16em;margin-right:-.16em;background:var(--grad-gold);-webkit-background-clip:text;background-clip:text}
.bb-txt b{
  letter-spacing:.08em;margin-right:-.08em;
  filter:drop-shadow(0 0 16px rgba(255,96,64,.55)) drop-shadow(0 2px 5px #000);
}
.story b{letter-spacing:.1em;margin-right:-.1em;filter:drop-shadow(0 0 16px rgba(255,180,110,.45)) drop-shadow(0 2px 6px #000)}

/* ── 붓글씨 자리에서 올라온 제목들: 단단한 명조 + 절제된 자간 ── */
.cutin b{font-weight:900;letter-spacing:.1em;margin-right:-.1em}
.parryAlert b{font-weight:900;letter-spacing:.12em;margin-right:-.12em}
.g-bubble b{font-weight:900;letter-spacing:.08em}
.revivebox h2{font-weight:900;letter-spacing:.12em;margin-right:-.12em;
  background:linear-gradient(174deg,#fffaf2 0%,#ffe8cf 34%,#f0c489 68%,#c8904a 100%);
  -webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent;
  text-shadow:none;filter:drop-shadow(0 0 14px rgba(255,120,80,.5)) drop-shadow(0 2px 5px #000)}
.btn.summon .bt{font-weight:900;letter-spacing:.18em;margin-right:-.18em;text-shadow:0 2px 8px rgba(0,0,0,.6)}
.btn.summon.sub .bt{letter-spacing:.02em;margin-right:0;text-shadow:none}
.big{font-weight:900;letter-spacing:.14em}
.big.daily .bd-t{letter-spacing:.1em;font-weight:900}
.lobby-medal b{letter-spacing:.1em;font-weight:900}

/* ── 수치·스탯: Pretendard + 고정폭 숫자 ── */
.combo b{font-weight:800;letter-spacing:-.02em}
.result b,.earn b,.rgauge b,.ps-price b,.silver b,.bb-mid span,.fchip .fc,.gcard .gst{font-variant-numeric:tabular-nums;font-feature-settings:"tnum" 1}
.result b,.earn b,.rgauge b,.ps-price b{font-weight:700}

/* ── 본문·라벨의 결: 자간을 살짝 눌러 단정하게 ── */
.pill,.icon-btn,.tab,.ghostbtn,.toast,.fine,.result span,.earn span,.story span,.wend,.d-sub{letter-spacing:.01em}
.gcard .gn{font-weight:700;letter-spacing:.02em}
.bh-title,.cxsec,.bb-wave,.d-han{font-weight:700}

/* =====================================================================
   v9 — ① 시너지 변화 미리보기 ② 첫 합성 두 카드 동시 강조 ③ 광고 슬롯 지연
   ===================================================================== */
/* ① 배치·회수·합성 전 시너지 변화 칩 */
.synprev{
  position:absolute;z-index:44;left:50%;top:0;
  transform:translate(-50%,-100%) translateY(6px);
  display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:4px;
  max-width:calc(100% - 16px);padding:5px 8px;border-radius:9px;
  background:linear-gradient(180deg,rgba(13,19,27,.97),rgba(6,10,15,.97));
  border:1px solid rgba(224,189,106,.38);
  box-shadow:0 8px 22px rgba(0,0,0,.62), inset 0 1px 0 rgba(255,230,180,.08);
  opacity:0;pointer-events:none;transition:opacity .12s ease, transform .12s ease;
}
.synprev.show{opacity:1;transform:translate(-50%,-100%)}
.synprev .sp-lead{font-family:var(--sans);font-size:9.5px;font-weight:600;color:#9dabc0;letter-spacing:0;white-space:nowrap}
.synprev .sp-chip{
  font-family:var(--sans);font-size:10px;font-weight:700;line-height:1.5;
  padding:1px 6px;border-radius:7px;white-space:nowrap;
  color:var(--sc,#cfe0ee);
  border:1px solid color-mix(in srgb, var(--sc,#8fa3b6) 55%, transparent);
  background:color-mix(in srgb, var(--sc,#8fa3b6) 13%, transparent);
}
.synprev .sp-chip.on{color:#ffe6a8;border-color:rgba(255,214,120,.85);background:rgba(255,214,120,.16);
  box-shadow:0 0 10px rgba(255,200,90,.35)}
.synprev .sp-chip.off{color:#ffb3a6;border-color:rgba(255,110,90,.7);background:rgba(255,84,62,.14)}
.synprev .sp-chip.up{color:#cfe6f5;border-color:rgba(150,190,225,.5);background:rgba(130,180,225,.12)}
.synprev .sp-chip.down{color:#ffc2b0;border-color:rgba(235,140,110,.55);background:rgba(220,110,80,.13)}
.synprev .sp-chip.keep{color:#93a3b4;border-color:rgba(140,160,180,.45);background:rgba(140,160,180,.1)}
.synprev .sp-chip.warn{color:#ffd0a0;border-color:rgba(255,150,80,.6);background:rgba(255,120,50,.12)}
.synprev .sp-chip.tier{color:#bfe6ff;border-color:rgba(140,200,255,.5);background:rgba(120,190,255,.12)}

/* ② 첫 합성 — 보드 안 두 카드 동시 강조 + 두 카드를 잇는 화살표 */
.board{position:relative}
.board.tut-merge .cell:not(.tut-pair){opacity:.5;filter:saturate(.65)}
.cell.tut-pair{
  border-color:rgba(255,214,120,.95) !important;
  animation:tutPair 1.1s ease-in-out infinite;
}
@keyframes tutPair{
  0%,100%{box-shadow:0 0 0 2px rgba(255,214,120,.32),0 0 13px rgba(255,200,90,.38),inset 0 0 12px rgba(255,200,90,.16)}
  50%{box-shadow:0 0 0 3px rgba(255,232,164,.85),0 0 26px rgba(255,210,110,.8),inset 0 0 20px rgba(255,210,120,.32)}
}
.tut-link{
  position:absolute;left:0;top:0;height:0;transform-origin:0 50%;pointer-events:none;z-index:4;
  border-top:2px dashed rgba(255,226,152,.95);opacity:0;transition:opacity .16s ease;
  filter:drop-shadow(0 0 4px rgba(255,200,90,.85));
}
.tut-link::before,.tut-link::after{
  content:'';position:absolute;top:-5px;width:0;height:0;
  border-top:5px solid transparent;border-bottom:5px solid transparent;
}
.tut-link::before{left:0;border-right:8px solid rgba(255,226,152,.95)}
.tut-link::after{right:0;border-left:8px solid rgba(255,226,152,.95)}
.tut-link.show{opacity:1}
.tut-tip{
  position:absolute;left:0;top:0;transform:translate(-50%,-100%) translateY(-5px);z-index:5;
  font-family:var(--sans);font-size:9.5px;font-weight:700;letter-spacing:0;color:#ffe6a8;white-space:nowrap;
  padding:2px 7px;border-radius:7px;background:rgba(10,14,20,.95);
  border:1px solid rgba(255,214,120,.6);box-shadow:0 4px 14px rgba(0,0,0,.6);
  opacity:0;pointer-events:none;transition:opacity .16s ease;
}
.tut-tip::after{
  content:'';position:absolute;left:50%;top:100%;transform:translateX(-50%);
  border:4px solid transparent;border-top-color:rgba(255,214,120,.6);
}
.tut-tip.show{opacity:1}
.slot.tut-slot{
  border-style:solid;border-color:rgba(255,214,120,.9) !important;
  animation:tutPair 1.1s ease-in-out infinite;
  background:radial-gradient(circle,rgba(255,214,120,.18),transparent 70%) !important;
}

/* ③ 첫판 초반 — 광고 표식 숨김 · 중앙 명당 지연 노출 */
.slot{transition:border-color .15s, box-shadow .15s, opacity .2s, transform .3s, visibility .2s}
.slot.ad-hide{opacity:0;visibility:hidden;transform:scale(.55);pointer-events:none}
.app.ad-quiet #spdLock{display:none}
.app.ad-quiet #btnReroll .bc{display:none}
.board.nudge{animation:boardNudge .5s ease-in-out}
@keyframes boardNudge{
  0%,100%{transform:translateX(0)}
  18%{transform:translateX(-5px)}
  38%{transform:translateX(5px)}
  58%{transform:translateX(-3px)}
  78%{transform:translateX(2px)}
}
/* v9 — 긴 안내 문구가 화면 밖으로 잘리지 않게 */
.g-bubble{width:max-content;max-width:min(268px, calc(100vw - 28px));white-space:normal;text-align:center}
.g-bubble span{white-space:normal;line-height:1.35;word-break:keep-all}
#btnSlot.hide{display:none}
/* v9 — 보드 단계 안내: 손가락이 아래(보드)를 가리키게 */
.guide.board-step .g-hand{animation:handTapDown 1.15s ease-in-out infinite}
@keyframes handTapDown{
  0%,100%{transform:rotate(176deg) translateY(0)}
  50%{transform:rotate(188deg) translateY(-5px)}
}
