/* VOICE   놀이: 밤의 카드 선술집에서 벌이는 도트 결투, 신나지만 정돈된 화면
   IDEA    오래된 게임기 화면 속 돌벽 던전 — 양피지 카드, 두툼한 픽셀 테두리 버튼
   PICTURE 직접 그린 영웅 스프라이트와 카드 그림이 곧 화면의 주인공
   COLOUR  보랏빛 돌벽 #1d1630 바탕, 크림색 글자, 금화 #ffcc33 강조, 다섯 속성 색
   TYPE    Galmuri11 (도트 한글 글꼴) 굵게/보통, 작은 표기는 Galmuri9
   LAYOUT  폰: 아래 탭바·세로 쌓기·가로로 미는 손패 / PC: 위 메뉴·2단 인벤토리·넓은 대전판 */

@font-face { font-family: 'Galmuri11'; src: url('/fonts/Galmuri11.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Galmuri11'; font-weight: 700; src: url('/fonts/Galmuri11-Bold.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Galmuri9'; src: url('/fonts/Galmuri9.woff2') format('woff2'); font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #1d1630; --bg2: #251c3b; --panel: #2c2140; --panel2: #3b2d55; --edge: #0f0a18;
  --hi: #5a4880; --lo: #191228; --ink: #f4ead5; --dim: #b4a9c8; --gold: #ffcc33; --gold2: #b8860b;
  --red: #e0393e; --green: #5bd15b; --blue: #3fa7ff; --purple: #a66bff;
  --fire: #ff6b3d; --water: #3fa7ff; --nature: #5bd15b; --earth: #c08a4a; --thunder: #ffd93d; --neutral: #c9c3d6;
  --font: 'Galmuri11', 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  --tiny: 'Galmuri9', 'Galmuri11', system-ui, sans-serif;
  --cut: polygon(4px 0, calc(100% - 4px) 0, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 0 calc(100% - 4px), 0 4px);
}
:root[data-theme=light], :root[data-theme=dark] { color-scheme: dark; }
* { box-sizing: border-box; min-width: 0; }
html, body { height: 100%; }
body {
  margin: 0; color: var(--ink); font: 15px/1.5 var(--font); overflow-x: clip; word-break: keep-all; overflow-wrap: anywhere;
  background: var(--bg) url('/assets/sprites/bg_tile.png') repeat; background-size: 64px;
  image-rendering: auto; -webkit-font-smoothing: none; -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.1; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 26px; } h3 { font-size: 18px; }
p { margin: .3em 0; }
a { color: var(--gold); }
button, input { font: inherit; color: inherit; }
img.spr { image-rendering: pixelated; image-rendering: crisp-edges; display: inline-block; vertical-align: middle; width: 48px; height: 48px; }
.spr.ico { width: 1.3em; height: 1.3em; margin-right: .15em; }
.spr.xl { width: 96px; height: 96px; }
.spr.xxl { width: 144px; height: 144px; }
.dim { color: var(--dim); } .small { font-size: 13px; } .ok { color: var(--green); }
.err { color: #ff7a7e; min-height: 1.2em; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.row.end { justify-content: flex-end; } .row.center { justify-content: center; }
.col { display: flex; flex-direction: column; gap: 10px; }
.booting { padding: 40px; text-align: center; }
.t-weak { color: var(--thunder); } .t-resist { color: var(--dim); } .t-ward { color: #8fe3ff; }

/* ── 픽셀 패널 · 버튼 ── */
.px {
  background: var(--panel); border: 3px solid var(--edge); clip-path: var(--cut);
  box-shadow: inset 3px 3px 0 var(--hi), inset -3px -3px 0 var(--lo);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 16px;
  background: #4a3a6e; border: 3px solid var(--edge); clip-path: var(--cut); cursor: pointer; text-decoration: none; color: var(--ink);
  box-shadow: inset 3px 3px 0 #7a68a8, inset -3px -4px 0 #2b2145; font-weight: 700; white-space: nowrap;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(2px); box-shadow: inset 3px 3px 0 #2b2145; }
.btn:focus-visible, [role=button]:focus-visible, input:focus-visible, .seg button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.btn[disabled], .btn.dis { opacity: .45; cursor: not-allowed; filter: grayscale(.6); }
.btn.primary { background: var(--red); box-shadow: inset 3px 3px 0 #ff7a7e, inset -3px -4px 0 #8f1d2c; }
.btn.gold { background: var(--gold); color: #2a1d12; box-shadow: inset 3px 3px 0 #fff3a8, inset -3px -4px 0 var(--gold2); }
.btn.danger { background: #8f1d2c; }
.btn.on { background: var(--gold); color: #2a1d12; box-shadow: inset 3px 3px 0 #fff3a8, inset -3px -4px 0 var(--gold2); }
.btn.sm { min-height: 34px; padding: 4px 10px; font-size: 13px; }
.btn.big { min-height: 56px; padding: 10px 22px; font-size: 17px; flex-direction: column; gap: 0; }
.btn.big small { font-size: 12px; font-weight: 400; opacity: .85; }
.btn.wide { width: 100%; }
.link { background: none; border: 0; color: var(--gold); text-decoration: underline; cursor: pointer; padding: 0; }
input:not([type=checkbox]) {
  width: 100%; min-height: 44px; padding: 8px 12px; font-size: 16px; background: #120d1c; color: var(--ink);
  border: 3px solid var(--edge); box-shadow: inset 3px 3px 0 #000; clip-path: var(--cut);
}
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--gold); vertical-align: middle; }
label { font-weight: 700; font-size: 14px; }
.tag { font-style: normal; font-family: var(--tiny); font-size: 11px; padding: 1px 5px; margin-left: 4px; background: var(--panel2); border: 2px solid var(--edge); white-space: nowrap; }
.tag.ally { background: #2a7a3b; } .tag.me { background: var(--red); } .tag.off { background: #555; } .tag.host { background: var(--gold2); } .tag.warn { background: #8f1d2c; }
.elb { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; padding: 1px 5px 1px 2px; border: 2px solid var(--edge); background: #120d1c; white-space: nowrap; }
.elb .ico { width: 16px; height: 16px; margin: 0; }
.elb.el-fire { color: var(--fire); } .elb.el-water { color: var(--water); } .elb.el-nature { color: var(--nature); }
.elb.el-earth { color: var(--earth); } .elb.el-thunder { color: var(--thunder); } .elb.el-neutral { color: var(--neutral); }

/* ── 껍데기: 상단바 · 탭바 ── */
#app { min-height: 100%; }
.shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 8px max(16px, env(safe-area-inset-left)); padding-top: max(8px, env(safe-area-inset-top));
  background: #150f22; border-bottom: 3px solid var(--edge); box-shadow: 0 3px 0 var(--hi);
}
.brand { display: flex; align-items: center; gap: 6px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 18px; white-space: nowrap; }
.brand .ico { width: 28px; height: 28px; }
.topnav { display: flex; gap: 4px; margin-left: 12px; }
.topnav a, .tabbar a { position: relative; display: flex; align-items: center; gap: 4px; color: var(--dim); text-decoration: none; padding: 8px 12px; font-weight: 700; }
.topnav a.on, .tabbar a.on { color: var(--gold); }
.topnav a.on { box-shadow: inset 0 -3px 0 var(--gold); }
.dot { position: absolute; top: 0; right: 0; font-style: normal; font-size: 11px; background: var(--red); color: #fff; border: 2px solid var(--edge); padding: 0 4px; line-height: 1.3; }
.wallet { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.gold { display: inline-flex; align-items: center; gap: 2px; color: var(--gold); font-weight: 700; white-space: nowrap; }
.gold.big { font-size: 22px; }
.me-btn { display: flex; align-items: center; gap: 4px; background: none; border: 2px solid var(--hi); padding: 4px 8px; cursor: pointer; min-height: 40px; max-width: 160px; }
.me-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabbar { display: none; }
.screen { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 20px max(16px, env(safe-area-inset-right)) 32px max(16px, env(safe-area-inset-left)); }
.offline-bar { display: none; background: #8f1d2c; text-align: center; padding: 4px; font-size: 13px; }
body.offline .offline-bar { display: block; }
.in-room .topnav, .in-room .tabbar { visibility: hidden; }

/* ── 로그인 ── */
.login { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 420px); gap: 32px; align-items: center; max-width: 1100px; margin: 0 auto; padding: 32px 24px; }
.logo { font-size: clamp(40px, 7vw, 72px); color: var(--gold); text-shadow: 4px 4px 0 #8f1d2c, 8px 8px 0 var(--edge); margin-bottom: 12px; }
.tagline { font-size: 17px; color: var(--ink); max-width: 30em; }
.stage-heroes {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 4px; margin-top: 28px; padding: 0 12px 18px;
  background: linear-gradient(transparent 70%, #3b2d55 70%, #3b2d55 78%, #120d1c 78%);
}
.sh { display: flex; flex-direction: column; align-items: center; gap: 6px; animation: bob 1.6s steps(2) infinite; animation-delay: var(--d); }
.sh > img.spr { width: clamp(56px, 10vw, 120px); height: auto; aspect-ratio: 1; }
@keyframes bob { 50% { transform: translateY(-4px); } }
.login-box { padding: 24px; display: flex; flex-direction: column; gap: 8px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 8px; border: 3px solid var(--edge); }
.seg button { min-height: 44px; background: #120d1c; border: 0; cursor: pointer; font-weight: 700; color: var(--dim); }
.seg button.on { background: var(--panel2); color: var(--gold); box-shadow: inset 0 -3px 0 var(--gold); }
.or { display: flex; align-items: center; gap: 8px; color: var(--dim); font-size: 13px; }
.or::before, .or::after { content: ''; flex: 1; border-top: 2px dashed var(--hi); }

/* ── 홈 ── */
.home-hero { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 20px; align-items: center; padding: 20px 24px; position: relative; }
.home-hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, color-mix(in srgb, var(--elc) 35%, transparent), transparent 60%); pointer-events: none; }
.home-hero > * { position: relative; }
.el-fire { --elc: var(--fire); } .el-water { --elc: var(--water); } .el-nature { --elc: var(--nature); }
.el-earth { --elc: var(--earth); } .el-thunder { --elc: var(--thunder); } .el-neutral { --elc: var(--neutral); }
.hh-art img.spr { width: 144px; height: 144px; filter: drop-shadow(4px 4px 0 var(--edge)); }
.hh-title { color: var(--dim); margin: 0; }
.hh-info h2 { font-size: 36px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.quote { font-size: 16px; color: var(--ink); }
.hh-play { display: flex; flex-direction: column; gap: 10px; }
.notice { margin-top: 14px; padding: 12px 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 18px; }
.tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 10px; cursor: pointer; color: var(--ink); min-height: 132px; }
.tile:hover { background: var(--panel2); }
.tile .tile-ico { width: 64px; height: 64px; }
.tile b { font-size: 16px; } .tile span { font-size: 13px; color: var(--dim); }
.tile.hot { box-shadow: inset 3px 3px 0 var(--gold), inset -3px -3px 0 var(--gold2); }
.badge { position: absolute; top: 8px; right: 10px; font-style: normal; background: var(--red); border: 2px solid var(--edge); padding: 0 7px; font-weight: 700; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .55; } }
.stats { text-align: center; margin-top: 16px; }

/* ── 대전 고르기 · 대기실 ── */
.modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.mode-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px; text-align: left; cursor: pointer; color: var(--ink); }
.mode-card b { font-size: 22px; } .mode-card span { color: var(--dim); }
.mode-card.on { background: var(--panel2); box-shadow: inset 3px 3px 0 var(--gold), inset -3px -3px 0 var(--gold2); }
.mc-art { display: flex; align-items: flex-end; gap: 2px; margin-bottom: 6px; }
.mc-art img.spr { width: 56px; height: 56px; }
.mc-art i { font-style: normal; font-weight: 700; color: var(--gold); padding: 0 6px 14px; }
.sizes { display: flex; gap: 8px; margin-top: 14px; }
.sizes .btn { min-width: 72px; }
.join { display: grid; grid-template-columns: auto minmax(0, 160px) auto; gap: 10px; align-items: center; padding: 12px 16px; margin: 18px 0; max-width: 520px; }
.join input { text-transform: uppercase; letter-spacing: .2em; }
.room-list { display: grid; gap: 8px; }
.room-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 14px; }
.room-row b { display: block; } .room-row code { font-size: 18px; color: var(--gold); letter-spacing: .1em; }
.empty { padding: 18px; color: var(--dim); text-align: center; }
.room-head .code { font-size: 26px; color: var(--gold); letter-spacing: .15em; }
.seats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 16px 0; }
.seats.team { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.team-col { display: grid; gap: 12px; align-content: start; }
.team-a { color: var(--fire); } .team-b { color: var(--water); }
.seat { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 10px; min-height: 180px; justify-content: center; text-align: center; }
.seat img.spr { width: 72px; height: 72px; }
.seat.mine { box-shadow: inset 3px 3px 0 var(--gold), inset -3px -3px 0 var(--gold2); }
.seat.empty { background: #1a1329; border-style: dashed; }
.seat .q { font-size: 40px; color: var(--hi); font-weight: 700; }

/* ── 카드 ── */
.card {
  --cw: 112px; --elc: var(--neutral);
  position: relative; width: var(--cw); aspect-ratio: 5 / 7.2; flex: none; display: flex; flex-direction: column;
  background: #f4ead5; color: #2a1d12; border: 3px solid var(--edge); clip-path: var(--cut);
  box-shadow: inset 0 0 0 3px var(--elc), inset 0 0 0 5px #e1d2b3; user-select: none;
}
.card.r-legendary { box-shadow: inset 0 0 0 3px var(--gold), inset 0 0 0 5px var(--elc); }
.c-cost {
  position: absolute; top: 5px; left: 5px; z-index: 2; width: 24px; height: 24px; display: grid; place-items: center;
  background: var(--blue); color: #fff; font-weight: 700; border: 2px solid var(--edge); font-size: 14px;
}
.c-gem { position: absolute; top: 9px; right: 9px; z-index: 2; width: 10px; height: 10px; background: var(--rc); border: 2px solid var(--edge); transform: rotate(45deg); }
.c-art {
  margin: 6px 6px 0; height: 42%; display: grid; place-items: center; border: 2px solid var(--edge);
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .1) 0 2px, transparent 2px 4px), linear-gradient(var(--a1), var(--a2));
}
.c-art img.spr { width: 56%; height: auto; aspect-ratio: 1; filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, .35)); }
.card.el-fire .c-art { --a1: #ffb46b; --a2: #b8323a; } .card.el-water .c-art { --a1: #b8f0ff; --a2: #2a6fc9; }
.card.el-nature .c-art { --a1: #c7f0a0; --a2: #2f8a45; } .card.el-earth .c-art { --a1: #ecc796; --a2: #7a5230; }
.card.el-thunder .c-art { --a1: #8f6ad6; --a2: #2e1f5e; } .card.el-neutral .c-art { --a1: #e9e3f2; --a2: #6d6580; }
.c-name { font-weight: 700; text-align: center; font-size: 12px; line-height: 1.15; padding: 4px 4px 1px; }
.c-text { font-size: 11px; line-height: 1.25; text-align: center; padding: 0 5px; flex: 1; overflow: hidden; color: #3a2a1a; }
.c-foot { display: flex; justify-content: space-between; gap: 2px; font-family: var(--tiny); font-size: 9px; padding: 0 6px 5px; color: #6e4a2a; white-space: nowrap; }
.c-foot .ico { width: 11px; height: 11px; margin: 0 1px 0 0; }
.c-count { position: absolute; top: calc(6px + 42% - 20px); right: 9px; z-index: 2; background: var(--edge); color: var(--gold); font-size: 12px; padding: 0 4px; font-weight: 700; }
.c-badge { position: absolute; top: 34%; left: 0; right: 0; text-align: center; background: rgba(15, 10, 24, .8); color: var(--ink); font-size: 12px; padding: 2px; }
.card.sm { --cw: 104px; }
.card.big { --cw: 180px; }
.card.big .c-name { font-size: 16px; } .card.big .c-text { font-size: 13px; } .card.big .c-foot { font-size: 11px; } .card.big .c-cost { width: 32px; height: 32px; font-size: 18px; }
.card.mini { --cw: 84px; }

/* ── 인벤토리 ── */
.inv-tabs { display: grid; grid-template-columns: 1fr 1fr; max-width: 520px; border: 3px solid var(--edge); margin-bottom: 16px; }
.inv-tabs button { min-height: 50px; display: flex; align-items: center; justify-content: center; gap: 6px; background: #120d1c; border: 0; cursor: pointer; font-weight: 700; font-size: 17px; color: var(--dim); }
.inv-tabs button.on { background: var(--panel2); color: var(--gold); box-shadow: inset 0 -4px 0 var(--gold); }
.inv-tabs small { font-size: 12px; background: var(--edge); padding: 0 5px; }
.inv-cards { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 18px; align-items: start; }
.deck-panel { padding: 14px; display: flex; flex-direction: column; gap: 8px; position: sticky; top: 74px; max-height: calc(100vh - 90px); overflow: auto; }
.deck-slots { display: flex; gap: 4px; flex-wrap: wrap; }
.deck-slots button { flex: 1; min-height: 38px; background: #120d1c; border: 2px solid var(--edge); cursor: pointer; color: var(--dim); font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deck-slots button.on { color: var(--gold); background: var(--panel2); box-shadow: inset 0 -3px 0 var(--gold); }
.lbl { margin: 4px 0 0; font-weight: 700; }
.hero-pick { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.hero-pick button { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 4px 2px; min-height: 44px; background: #120d1c; border: 2px solid var(--edge); cursor: pointer; font-size: 11px; }
.hero-pick button > img.spr { width: 40px; height: 40px; }
.hero-pick button.on { background: var(--panel2); box-shadow: inset 0 0 0 2px var(--gold); color: var(--gold); }
.deck-details summary { cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 6px 0; list-style: none; }
.deck-details summary::-webkit-details-marker { display: none; }
.deck-count { font-size: 20px; font-weight: 700; color: #ff7a7e; }
.deck-count.ok { color: var(--green); }
.deck-list { display: grid; gap: 3px; }
.dl-row { display: grid; grid-template-columns: 24px 20px minmax(0, 1fr) auto auto; gap: 6px; align-items: center; padding: 2px 4px 2px 0; background: #1a1329; border-left: 4px solid var(--elc); }
.dl-cost { background: var(--blue); color: #fff; text-align: center; font-weight: 700; }
.dl-name { cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.chipbtn { min-height: 38px; padding: 4px 10px; background: #120d1c; border: 2px solid var(--edge); cursor: pointer; display: inline-flex; align-items: center; color: var(--dim); white-space: nowrap; }
.chipbtn.on { color: #2a1d12; background: var(--gold); }
.own { display: flex; align-items: center; gap: 6px; margin-left: auto; font-weight: 400; cursor: pointer; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 14px 10px; }
.cg { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.cg .card { cursor: pointer; transition: transform .1s; }
.cg .card:hover { transform: translateY(-3px); }
.cg.locked .card { filter: grayscale(.85) brightness(.75); }
.cg .btn { width: 104px; }
.items-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.item { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 16px; }
.item b { font-size: 17px; }
.item .cnt { position: absolute; top: 10px; right: 12px; color: var(--gold); font-weight: 700; font-size: 18px; }
.item .btn { margin-top: auto; width: 100%; }
.empty-items { padding: 28px; text-align: center; }
.odds { margin-top: 14px; font-size: 12px; color: var(--dim); }

/* ── 상점 ── */
.shop-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.shop h3 { margin-top: 22px; }
.shop-boxes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.sbox { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 16px; }
.sbox b { font-size: 17px; } .sbox .btn { margin-top: auto; width: 100%; }
.sbox > img.spr { width: 96px; height: 96px; }
.shop-cards { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; justify-items: center; }
.scard { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.scard .card { cursor: pointer; }
.scard .btn { width: 104px; }

/* ── 업데이트 노트 ── */
.updates { max-width: 760px; }
.upd { padding: 18px 22px; margin-bottom: 14px; }
.upd header { display: flex; gap: 10px; align-items: baseline; color: var(--gold); font-size: 18px; }
.upd ul { padding-left: 1.2em; margin: 6px 0 0; } .upd li { margin: 4px 0; }

/* ── 모달 · 토스트 ── */
#modal-root { position: relative; z-index: 100; }
.modal-wrap { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(8, 5, 14, .72); animation: fade .15s; }
.modal { position: relative; width: min(440px, 100%); max-height: calc(100dvh - 32px); overflow: auto; padding: 22px; }
.modal.wide { width: min(680px, 100%); }
.modal-x { position: absolute; top: 6px; right: 8px; width: 40px; height: 40px; background: none; border: 0; font-size: 26px; cursor: pointer; color: var(--dim); }
@keyframes fade { from { opacity: 0; } }
.confirm-text { font-size: 16px; padding-right: 24px; }
#toast-root { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100% - 32px); }
.toast { padding: 10px 16px; transition: opacity .4s, transform .4s; text-align: center; }
.toast.err { background: #5c1620; }
.toast.out { opacity: 0; transform: translateY(8px); }
.detail { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: start; }
.detail h3 { font-size: 22px; }
.meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.terms { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; font-size: 13px; }
.terms li { background: #1a1329; padding: 6px 8px; }
.flavor { color: var(--dim); font-style: italic; }
.result { text-align: center; }
.result h2 { font-size: 44px; color: var(--gold); text-shadow: 3px 3px 0 #8f1d2c; }
.result.lose h2 { color: var(--dim); text-shadow: 3px 3px 0 var(--edge); }
.result .place { font-size: 18px; } .result .reward { font-size: 22px; color: var(--gold); margin: 12px 0; }
.bonus { color: var(--green); }
.att-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.att-day { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; min-height: 104px; }
.att-day.last { grid-column: span 1; background: #3d2a12; }
.att-day .d { font-size: 13px; color: var(--dim); }
.att-items { display: flex; flex-wrap: wrap; justify-content: center; }
.att-items span { position: relative; } .att-items img.spr { width: 44px; height: 44px; }
.att-items i { position: absolute; right: -4px; bottom: 0; font-style: normal; font-size: 12px; color: var(--gold); text-shadow: 1px 1px 0 #000; }
.att-day.today { box-shadow: inset 3px 3px 0 var(--gold), inset -3px -3px 0 var(--gold2); animation: blink 1.2s steps(2) infinite; }
.att-day.done img.spr { opacity: .4; }
.stamp { position: absolute; top: 40%; transform: rotate(-12deg); color: var(--red); border: 3px solid var(--red); padding: 0 6px; background: rgba(15, 10, 24, .8); }
.claim-done, .open-box { text-align: center; }
.open-box p { margin-top: 10px; }
.shake { animation: shake .3s steps(3) infinite; }
@keyframes shake { 33% { transform: translate(-4px, 0) rotate(-4deg); } 66% { transform: translate(4px, -2px) rotate(4deg); } }
.pop-in { animation: popin .4s steps(4); }
@keyframes popin { from { transform: scale(.4); opacity: 0; } }
.reveal { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 12px 0; }
.rv { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; animation: flipin .5s steps(5) both; animation-delay: var(--d); }
@keyframes flipin { from { transform: scaleX(0) translateY(20px); opacity: 0; } }
.rv .new { position: absolute; top: -8px; right: -6px; background: var(--red); border: 2px solid var(--edge); padding: 0 6px; font-weight: 700; z-index: 3; }
.rv-r { font-weight: 700; }
.r-glow-epic { filter: drop-shadow(0 0 6px var(--purple)); } .r-glow-legendary { filter: drop-shadow(0 0 8px var(--gold)); }
.tut-intro, .inspect { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; }
.reward-line { color: var(--gold); }
.rules { padding-left: 1.2em; } .rules li { margin: 6px 0; }
.mchart { position: relative; width: min(300px, 80vw); aspect-ratio: 1; margin: 8px auto 12px; }
.mchart svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.mc-node { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; font-weight: 700; color: var(--elc); }
.mc-node img.spr { width: 48px; height: 48px; background: #120d1c; border: 3px solid var(--elc); padding: 4px; }

/* ── 대전 화면 ── */
.match {
  position: fixed; inset: 0; z-index: 10; display: grid; gap: 8px;
  grid-template-rows: auto auto minmax(56px, 1fr) auto auto auto;
  padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  background: radial-gradient(ellipse at 50% 45%, #3b2d55 0%, transparent 70%), var(--bg) url('/assets/sprites/bg_tile.png'); background-size: auto, 64px;
  max-width: 1280px; margin: 0 auto; overflow: hidden;
}
.m-top { display: flex; align-items: center; gap: 8px; }
.m-turn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 15px; white-space: nowrap; overflow: hidden; }
.m-turn.mine b { color: var(--gold); }
.m-timer { color: var(--dim); font-weight: 700; min-width: 3em; } .m-timer.hurry { color: #ff7a7e; animation: blink .5s steps(2) infinite; }
.m-round { color: var(--dim); font-size: 13px; white-space: nowrap; }
.m-others { display: grid; gap: 8px; grid-template-columns: repeat(var(--n, 1), minmax(0, 1fr)); }
.m-others.c1 { --n: 1; max-width: 520px; width: 100%; margin: 0 auto; } .m-others.c2 { --n: 2; } .m-others.c3 { --n: 3; }
.m-field { position: relative; display: grid; place-items: center; min-height: 0; }
.m-field::before { content: ''; position: absolute; inset: 6px 8%; border: 3px dashed rgba(90, 72, 128, .45); pointer-events: none; }
.m-played { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.played-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; animation: played 2.2s steps(8) both; }
.played-wrap p { background: rgba(15, 10, 24, .85); padding: 2px 8px; font-size: 13px; }
@keyframes played { 0% { transform: translateY(14px) scale(.8); opacity: 0; } 12%, 80% { transform: none; opacity: 1; } 100% { opacity: 0; } }
.m-log { position: absolute; left: calc(8% + 10px); bottom: 12px; font-size: 12px; color: var(--dim); max-width: 46%; }
.m-log p { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-me { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: stretch; }
.m-ctrl { display: flex; flex-direction: column; gap: 6px; justify-content: center; align-items: stretch; }
.energy { display: flex; align-items: center; gap: 3px; justify-content: center; }
.energy i { width: 16px; height: 16px; background: #120d1c; border: 2px solid var(--edge); transform: rotate(45deg); margin: 2px; }
.energy i.on { background: var(--blue); box-shadow: inset 2px 2px 0 #8fe3ff; }
.energy b { margin-left: 6px; color: #8fe3ff; }
.btn.end { min-height: 48px; }
.m-selbar { min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 10px; background: rgba(15, 10, 24, .7); border: 2px solid var(--edge); }
.m-selbar p { margin: 0; font-size: 13px; } .m-selbar .row { margin: 0; flex-wrap: nowrap; }
.hl { color: var(--gold); }
.m-hand { display: flex; gap: 8px; overflow-x: auto; overflow-y: visible; padding: 12px 4px 6px; scroll-snap-type: x proximity; justify-content: safe center; min-height: 170px; }
.m-hand .card { scroll-snap-align: center; cursor: pointer; transition: transform .12s; }
.m-hand .card.cant { filter: brightness(.6) saturate(.6); }
.m-hand .card.can:hover { transform: translateY(-6px); }
.m-hand .card.sel { transform: translateY(-12px); box-shadow: inset 0 0 0 3px var(--gold), inset 0 0 0 5px #fff3a8; }
.empty-hand { color: var(--dim); align-self: center; }

.pp { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: center; padding: 8px 10px; background: var(--panel); border: 3px solid var(--edge); clip-path: var(--cut); box-shadow: inset 3px 3px 0 var(--hi), inset -3px -3px 0 var(--lo); cursor: pointer; }
.pp.ally { box-shadow: inset 3px 3px 0 #2a7a3b, inset -3px -3px 0 #194a24; }
.pp.me { box-shadow: inset 3px 3px 0 #8f1d2c, inset -3px -3px 0 #4a0f18; }
.pp.turn { background: #3a2c55; }
.pp.turn::after { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--gold); }
.pp.dead { filter: grayscale(1) brightness(.6); }
.pp.targetable { background: #45325e; box-shadow: inset 0 0 0 3px var(--gold); animation: tgt 0.8s steps(2) infinite; }
@keyframes tgt { 50% { box-shadow: inset 0 0 0 3px #fff3a8; } }
.pp-hero img.spr { width: 64px; height: 64px; }
.pp-name { display: flex; align-items: center; gap: 2px; font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; }
.pp-name span { overflow: hidden; text-overflow: ellipsis; }
.hp { position: relative; height: 16px; background: #120d1c; border: 2px solid var(--edge); margin: 3px 0; }
.hp i { position: absolute; inset: 0 auto 0 0; background: var(--green); box-shadow: inset 0 3px 0 #9be07b; transition: width .3s steps(6); }
.pp.low .hp i { background: var(--red); box-shadow: inset 0 3px 0 #ff7a7e; }
.hp b { position: absolute; inset: 0; text-align: center; font-size: 11px; line-height: 12px; text-shadow: 1px 1px 0 #000; }
.pp-sub { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 12px; }
.shieldv, .handv, .weakv { display: inline-flex; align-items: center; white-space: nowrap; }
.shieldv { color: #8fe3ff; font-weight: 700; }
.weakv { color: var(--dim); font-size: 11px; } .weakv .ico { width: 14px; height: 14px; }
.weakv.warded { text-decoration: line-through; color: #8fe3ff; }
.pp-st { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 2px; }
.chip { display: inline-flex; align-items: center; font-size: 11px; padding: 0 4px 0 1px; background: #1a1329; border: 2px solid var(--edge); white-space: nowrap; }
.chip .ico { width: 14px; height: 14px; margin: 0 1px 0 0; }
.chip b { font-weight: 400; margin-right: 2px; }
.chip.bad { color: #ffb0a8; } .chip.good { color: #b9f5b9; }
.pp-hint { position: absolute; right: 6px; top: 6px; background: var(--edge); color: var(--ink); padding: 1px 8px; font-size: 12px; font-weight: 700; white-space: nowrap; z-index: 3; border: 2px solid var(--gold); }
.pp.k-weak .pp-hint { background: var(--thunder); color: #2a1d12; } .pp.k-resist .pp-hint { background: #555; } .pp.k-warded .pp-hint { background: #1f4f9c; }
.pp-dead { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; font-size: 18px; color: #ff7a7e; text-shadow: 2px 2px 0 #000; }
.pops { position: absolute; inset: 0; pointer-events: none; display: grid; place-items: center; }
.pop { grid-area: 1 / 1; font-weight: 700; font-size: 20px; text-shadow: 2px 2px 0 #000, -1px -1px 0 #000; animation: pop 1.2s steps(10) both; white-space: nowrap; }
@keyframes pop { 0% { opacity: 0; transform: translateY(10px) scale(.6); } 15% { opacity: 1; transform: translateY(0) scale(1.15); } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-30px); } }
.pop.dmg { color: #ff5a5f; } .pop.heal { color: var(--green); } .pop.blk { color: #8fe3ff; font-size: 15px; }
.pop.weak { color: var(--thunder); font-size: 24px; } .pop.resist { color: var(--dim); } .pop.ward { color: #8fe3ff; }
.pop.bad { color: #ffb0a8; font-size: 15px; } .pop.good { color: #b9f5b9; font-size: 15px; } .pop.ko { color: #ff5a5f; font-size: 26px; }
.pp.hit { animation: hit .35s steps(4); }
@keyframes hit { 25% { transform: translateX(-5px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
.turn-banner {
  position: absolute; left: 0; right: 0; top: 40%; text-align: center; font-size: 44px; font-weight: 700; color: var(--gold);
  text-shadow: 4px 4px 0 #8f1d2c, 6px 6px 0 var(--edge); pointer-events: none; animation: banner 1.2s steps(8) both; z-index: 5;
  background: linear-gradient(transparent, rgba(15, 10, 24, .8) 30%, rgba(15, 10, 24, .8) 70%, transparent);
}
@keyframes banner { 0% { opacity: 0; transform: scaleY(0); } 20%, 75% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.coach { max-width: 640px; width: 100%; padding: 12px 14px; align-self: center; }
.coach-in { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; }
.coach-in img.coach-face { width: 64px; height: 64px; }
.coach p { margin: 0; font-size: 15px; } .coach b { color: var(--gold); } .coach .row { margin-top: 6px; }
/* 튜토리얼 강조: 테두리를 잘라 내는 clip-path 안쪽에 그립니다 */
.focus { position: relative; z-index: 2; animation: nudge .9s steps(2) infinite !important; box-shadow: inset 0 0 0 4px var(--gold), inset 0 0 0 7px #fff3a8 !important; }
@keyframes nudge { 50% { transform: translateY(-5px); } }

/* ── 넓은 화면 ── */
@media (min-width: 900px) {
  .card.sm { --cw: 122px; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
  .cg .btn, .scard .btn { width: 122px; }
  .shop-cards .card.sm { --cw: 140px; } .scard .btn { width: 140px; }
  .team-col .seat { min-height: 200px; }
  .m-hand .card { --cw: 122px; }
  .m-hand .card .c-text { font-size: 12px; } .m-hand .card .c-name { font-size: 13px; }
  .m-hand { min-height: 200px; }
  .pp-hero img.spr { width: 80px; height: 80px; }
  .m-me { max-width: 760px; width: 100%; justify-self: center; }
  .m-selbar { max-width: 900px; width: 100%; justify-self: center; }
}

/* ── 중간 화면 ── */
@media (max-width: 899px) {
  .inv-cards { grid-template-columns: minmax(0, 1fr); }
  .deck-panel { position: static; max-height: none; }
  .shop-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-hero { grid-template-columns: auto minmax(0, 1fr); }
  .hh-play { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .hh-play .btn { flex: 1; }
  .login { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 24px 16px; }
}

/* ── 폰 ── */
@media (max-width: 600px) {
  body { font-size: 14px; }
  h2 { font-size: 22px; }
  .topbar { padding: 6px 12px; padding-top: max(6px, env(safe-area-inset-top)); }
  .brand span { display: none; }
  .topnav { display: none; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: sticky; bottom: 0; z-index: 20;
    background: #150f22; border-top: 3px solid var(--edge); box-shadow: 0 -3px 0 var(--hi); padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a { flex-direction: column; gap: 0; font-size: 12px; padding: 6px 2px; min-height: 54px; justify-content: center; }
  .tabbar a .ico { width: 24px; height: 24px; margin: 0; }
  .tabbar .dot { right: 18%; }
  .screen { padding: 14px 12px 24px; }
  .login { padding: 18px 12px; }
  .stage-heroes { margin-top: 14px; padding: 0 0 12px; }
  .stage-heroes .elb { display: none; }
  .home-hero { padding: 14px; gap: 12px; }
  .hh-art img.spr { width: 96px; height: 96px; }
  .hh-info h2 { font-size: 26px; }
  .hh-play .btn.big { font-size: 15px; padding: 8px 10px; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .tile { min-height: 104px; padding: 10px 4px; }
  .tile .tile-ico { width: 44px; height: 44px; }
  .tile b { font-size: 13px; text-align: center; } .tile span { font-size: 11px; }
  .modes { grid-template-columns: minmax(0, 1fr); }
  .mc-art img.spr { width: 44px; height: 44px; }
  .join { grid-template-columns: minmax(0, 1fr) auto; }
  .join label { grid-column: 1 / -1; }
  .room-row { grid-template-columns: minmax(0, 1fr) auto; }
  .room-row code { display: none; }
  .seats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seat { min-height: 150px; padding: 10px 6px; }
  .seat img.spr { width: 56px; height: 56px; }
  .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 6px; }
  .cg .card.sm { --cw: 100%; max-width: 112px; }
  .cg .btn { width: 100%; max-width: 112px; padding: 4px; }
  .own { margin-left: 0; }
  .shop-boxes { grid-template-columns: minmax(0, 1fr); }
  .sbox { display: grid; grid-template-columns: auto minmax(0, 1fr); text-align: left; align-items: center; column-gap: 12px; }
  .sbox > img.spr { grid-row: span 3; width: 72px; height: 72px; }
  .sbox .btn { grid-column: 2; }
  .shop-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .items-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .item { padding: 12px 8px; } .item img.spr.xl { width: 72px; height: 72px; }
  .detail { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .card.big { --cw: 150px; }
  .att-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .att-items img.spr { width: 36px; height: 36px; }
  .tut-intro, .inspect { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
  #toast-root { bottom: 96px; }

  .match { gap: 6px; grid-template-rows: auto auto minmax(40px, 1fr) auto auto auto; }
  .m-top .btn.sm { min-height: 36px; padding: 2px 8px; font-size: 12px; }
  .m-round { display: none; }
  .m-turn { font-size: 13px; }
  .m-others.c2 .pp, .m-others.c3 .pp { grid-template-columns: minmax(0, 1fr); padding: 6px; gap: 2px; justify-items: center; text-align: center; }
  .m-others.c2 .pp-hero img.spr, .m-others.c3 .pp-hero img.spr { width: 40px; height: 40px; }
  .m-others.c3 .pp-name { font-size: 12px; }
  .m-others.c2 .pp-name, .m-others.c3 .pp-name { justify-content: center; }
  .m-others.c3 .pp-body, .m-others.c2 .pp-body { width: 100%; }
  .m-others.c3 .pp-sub, .m-others.c2 .pp-sub, .m-others.c3 .pp-st, .m-others.c2 .pp-st { justify-content: center; }
  .m-others.c3 .elb { font-size: 0; padding: 1px; } .m-others.c3 .weakv { display: none; }
  .m-others.c3 .handv { display: none; }
  .pp-hero img.spr { width: 48px; height: 48px; }
  .m-me .pp { padding: 6px 8px; }
  .m-log { left: 10px; right: 10px; bottom: 8px; max-width: none; font-size: 11px; }
  .m-log p:nth-last-child(n+3) { display: none; }
  .m-field::before { inset: 4px 0; }
  .reveal .card { --cw: 92px; }
  .reveal { gap: 6px; }
  .card.mini { --cw: 64px; } .card.mini .c-text, .card.mini .c-foot { display: none; }
  .m-selbar { padding: 4px 8px; } .m-selbar p { font-size: 12px; }
  .m-hand { justify-content: flex-start; min-height: 150px; padding-top: 14px; }
  .m-hand .card { --cw: 96px; }
  .m-hand .card .c-text { font-size: 10.5px; }
  .coach { padding: 8px 10px; } .coach p { font-size: 13px; } .coach-in img.coach-face { width: 44px; height: 44px; }
  .turn-banner { font-size: 34px; }
  .pp-hint { font-size: 11px; padding: 0 5px; }
}

@media (max-height: 700px) and (max-width: 600px) {
  .m-hand { min-height: 136px; } .m-hand .card { --cw: 86px; }
  .m-others.c2 .pp-hero img.spr, .m-others.c3 .pp-hero img.spr { width: 32px; height: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}
.odds summary { cursor: pointer; padding: 6px 0; } .odds ul { padding-left: 1.2em; margin: 4px 0; } .odds li { margin: 3px 0; }
.home-news { margin-top: 18px; padding: 14px 18px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.home-news img.spr { width: 48px; height: 48px; }
.home-news b { color: var(--gold); } .home-news p { margin: 2px 0 0; color: var(--dim); font-size: 13px; }
@media (max-width: 600px) { .home-news { grid-template-columns: auto minmax(0, 1fr); } .home-news .btn { grid-column: 1 / -1; } }
.home-news p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ── 던전 탐험 ── */
.home-dungeon {
  margin-top: 14px; padding: 12px 18px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center;
  color: var(--ink); text-decoration: none; background: linear-gradient(90deg, #4a2a1a, var(--panel) 55%);
}
.home-dungeon > img.spr { width: 56px; height: 56px; animation: bob 1.4s steps(2) infinite; }
.home-dungeon b { font-size: 18px; color: #ffb46b; } .home-dungeon p { margin: 2px 0 0; color: var(--dim); font-size: 13px; }
.home-dungeon:hover { filter: brightness(1.1); }

.dungeon { display: flex; flex-direction: column; gap: 14px; }
.dg-room { padding: 18px 22px; width: 100%; max-width: 920px; margin: 0 auto; }
.dg-room h3 { margin: 20px 0 10px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.dg-room h3 small { font-size: 13px; font-weight: 400; }
.dg-room-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; }
.dg-room-head h2 { font-size: 30px; color: var(--gold); text-shadow: 3px 3px 0 #8f1d2c; }
.dg-art { display: flex; align-items: flex-end; }
.dg-art img.spr { width: 96px; height: 96px; filter: drop-shadow(3px 3px 0 var(--edge)); }
.dg-art img.dg-foe + img.dg-foe { margin-left: -24px; }
.dg-fire { animation: flick .5s steps(2) infinite; }
@keyframes flick { 50% { transform: scaleX(-1); } }
.dg-result { margin: 16px 0 0; padding: 10px 14px; background: #120d1c; border: 2px solid var(--edge); }
.dg-result p { margin: 2px 0; }

/* 로비 */
.dg-lobby { display: flex; flex-direction: column; gap: 14px; }
.dg-intro { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: center; padding: 18px 24px; background: linear-gradient(90deg, #4a2a1a, var(--panel) 50%); }
.dg-intro h2 { font-size: 34px; color: #ffb46b; text-shadow: 3px 3px 0 #8f1d2c; }
.dg-torch { width: 112px; height: 112px; animation: bob 1.2s steps(2) infinite; }
.dg-rules { margin: 8px 0 0; padding-left: 1.2em; } .dg-rules li { margin: 3px 0; }
.dg-start { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 16px 20px; position: relative; }
.dg-start::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, color-mix(in srgb, var(--elc) 22%, transparent), transparent 70%); pointer-events: none; }
.dg-start > * { position: relative; }
.dg-start h3 { margin: 0 0 8px; }
.dg-heroes { max-width: 460px; }
.dg-heroes button > img.spr { width: 48px; height: 48px; }
.dg-hero-line { margin: 10px 0 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dg-go { min-width: 180px; }
.dg-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.dchip { display: inline-flex; align-items: center; gap: 2px; padding: 2px 8px 2px 2px; background: #120d1c; border: 2px solid var(--edge); border-left: 4px solid var(--elc); cursor: pointer; font-size: 13px; min-height: 30px; }
.dchip .ico { width: 18px; height: 18px; }
.dchip b { color: var(--gold); margin-left: 3px; }
.dchip:hover { background: var(--panel2); }
.dg-zones { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.dg-zone { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; padding: 12px 14px; box-shadow: inset 3px 3px 0 var(--zc), inset -3px -3px 0 var(--lo); }
.dg-zone > img.spr { width: 64px; height: 64px; }
.dg-zone b { color: var(--zc); }
.dg-zone p { margin: 2px 0; }
.dg-record { text-align: center; } .dg-record b { color: var(--gold); }

/* 상단 정보 */
.dg-hud { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; padding: 8px 14px; box-shadow: inset 3px 3px 0 var(--hi), inset -3px -3px 0 var(--lo), inset 0 -4px 0 var(--zc); }
.dg-who { display: flex; align-items: center; gap: 8px; flex: 1 1 200px; max-width: 300px; }
.dg-who > img.spr { width: 48px; height: 48px; }
.dg-hud > * { flex-shrink: 0; }
.dg-hud > .dg-who { flex-shrink: 1; }
.dg-who > div { flex: 1; }
.dg-hud .hp { margin: 2px 0 0; height: 18px; }
.dg-hud .hp b { line-height: 14px; font-size: 12px; }
.hp.low i { background: var(--red); box-shadow: inset 0 3px 0 #ff7a7e; }
.dg-relics { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.relic { width: 40px; height: 40px; padding: 2px; background: #120d1c; border: 2px solid var(--edge); cursor: pointer; display: inline-grid; place-items: center; }
.relic img.spr { width: 30px; height: 30px; }
.relic.used { filter: grayscale(1) brightness(.6); }
.dg-floor { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; font-size: 13px; line-height: 1.3; white-space: nowrap; }
.dg-floor b { color: var(--zc); }

/* 지도 */
.dg-board { display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 300px); gap: 16px; justify-content: center; align-items: start; }
.dg-map {
  position: relative; height: calc(var(--rows) * 80px + 32px); padding: 0;
  background: linear-gradient(color-mix(in srgb, var(--zc) 22%, #1a1329), #1a1329 30%, #1a1329 80%, color-mix(in srgb, var(--zc) 12%, #1a1329));
}
.dg-map-in { position: absolute; inset: 16px 0; }
.dg-map svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.dg-map line { stroke: #4f4166; stroke-width: 3; stroke-dasharray: 3 5; vector-effect: non-scaling-stroke; }
.dg-map line.old { stroke: #33284a; }
.dg-map line.taken { stroke: var(--gold2); stroke-dasharray: none; stroke-width: 4; }
.dg-map line.open { stroke: #fff3a8; stroke-dasharray: 4 4; animation: march .6s steps(4) infinite; }
.dg-map line.start { stroke-opacity: .5; }
@keyframes march { to { stroke-dashoffset: -8; } }
.dg-node {
  position: absolute; transform: translate(-50%, -50%); width: 54px; height: 54px; padding: 0;
  display: grid; place-items: center; background: #2c2140; border: 3px solid var(--edge); cursor: default; color: var(--ink);
  box-shadow: inset 2px 2px 0 var(--hi), inset -2px -2px 0 var(--lo);
}
.dg-node img.spr { width: 36px; height: 36px; }
.dg-node.t-elite { background: #4a1d2c; }
.dg-node.t-rest { background: #3a2a1a; }
.dg-node.t-treasure { background: #3d3418; }
.dg-node.t-boss { width: 92px; height: 92px; background: #3b1a2e; box-shadow: inset 0 0 0 3px #ff7a7e, inset 0 0 0 6px var(--edge); }
.dg-node.t-boss img.spr { width: 72px; height: 72px; }
.dg-node.done { background: #4a3a20; box-shadow: inset 0 0 0 3px var(--gold2); }
.dg-node.past { opacity: .35; filter: grayscale(.7); }
.dg-node.can { cursor: pointer; z-index: 2; background: #5a4880; box-shadow: inset 0 0 0 3px var(--gold), 0 0 0 0 transparent; animation: nodep .8s steps(2) infinite; }
.dg-node.can:hover, .dg-node.can:focus-visible { background: #7a68a8; animation: none; transform: translate(-50%, -50%) scale(1.12); }
@keyframes nodep { 50% { transform: translate(-50%, -50%) scale(1.1); box-shadow: inset 0 0 0 3px #fff3a8; } }
.dg-node.here { z-index: 3; box-shadow: inset 0 0 0 3px var(--gold), inset 0 0 0 6px #fff3a8; }
.dg-me { position: absolute; width: 34px !important; height: 34px !important; right: -18px; top: -20px; filter: drop-shadow(2px 2px 0 var(--edge)); animation: bob 1s steps(2) infinite; }
.dg-side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 90px; }
.dg-boss { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; padding: 14px; box-shadow: inset 3px 3px 0 var(--zc), inset -3px -3px 0 var(--lo); }
.dg-boss p { margin: 2px 0; } .dg-boss b { font-size: 18px; }
.dg-boss img.spr.xl { width: 80px; height: 80px; }
.dg-legend { padding: 12px 14px; }
.dg-legend ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.dg-legend li { display: flex; align-items: center; gap: 4px; }
.dg-legend .ico { width: 24px; height: 24px; }

/* 방: 보상 · 상점 · 모닥불 · 이벤트 */
.dg-card-pick { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.dg-pick { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.dg-pick .card { cursor: pointer; transition: transform .1s; }
.dg-pick .card:hover { transform: translateY(-4px); }
.dg-pick .btn { width: 100%; }
.dg-pick.sold .card { filter: grayscale(1) brightness(.55); }
.dg-relic-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.dg-relic-pick.one { grid-template-columns: minmax(0, 300px); justify-content: center; margin-top: 12px; }
.relic-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 12px; color: var(--ink); }
.relic-card > img.spr { width: 52px; height: 52px; }
.relic-card b { font-size: 16px; } .relic-card span { font-size: 13px; color: var(--dim); }
.relic-card.boss { box-shadow: inset 3px 3px 0 var(--gold), inset -3px -3px 0 var(--gold2); }
button.relic-card { cursor: pointer; }
button.relic-card:hover:not(:disabled) { background: var(--panel2); }
button.relic-card:disabled { cursor: default; opacity: .5; }
.relic-card.on, button.relic-card.on:disabled { opacity: 1; background: #4a3a20; }
.relic-card.sold { opacity: .5; }
.dg-service { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; background: #120d1c; border: 2px solid var(--edge); }
.dg-service span { flex: 1; }
.dg-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-top: 16px; }
.dg-choice { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; text-align: left; color: var(--ink); min-height: 68px; }
.dg-choice > div { flex: 1; display: flex; flex-direction: column; }
.dg-choice b { font-size: 17px; } .dg-choice span { color: var(--dim); font-size: 13px; }
.dg-choice em { font-style: normal; }
.dg-choice > img.spr { width: 40px; height: 40px; }
.dg-choice:hover:not(:disabled) { background: var(--panel2); }
.dg-choice:disabled { opacity: .45; cursor: not-allowed; }
.dg-over { text-align: center; }
.dg-over h2 { font-size: 40px; color: var(--gold); text-shadow: 3px 3px 0 #8f1d2c; margin-top: 8px; }
.dg-over.lose h2 { color: var(--dim); text-shadow: 3px 3px 0 var(--edge); }
.dg-over .dg-chips, .dg-relic-row { justify-content: center; display: flex; flex-wrap: wrap; gap: 4px; }
.dg-over h3 { justify-content: center; }
.dg-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 16px 0 4px; }
.dg-stats div { background: #120d1c; border: 2px solid var(--edge); padding: 8px 4px; display: flex; flex-direction: column; }
.dg-stats b { font-size: 26px; color: var(--gold); } .dg-stats span { font-size: 12px; color: var(--dim); }
.dg-loot { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 16px; font-size: 18px; color: var(--gold); font-weight: 700; }
.dg-loot span { display: inline-flex; align-items: center; }
.dg-zone-intro h2 { color: var(--zc); font-size: 34px; text-shadow: 3px 3px 0 var(--edge); }

@media (max-width: 899px) {
  .dg-board { grid-template-columns: minmax(0, 1fr); }
  .dg-map { width: 100%; max-width: 520px; margin: 0 auto; }
  .dg-side { position: static; max-width: 520px; width: 100%; margin: 0 auto; }
  .dg-zones { grid-template-columns: minmax(0, 1fr); }
  .dg-start { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .home-dungeon { grid-template-columns: auto minmax(0, 1fr); padding: 10px 12px; }
  .home-dungeon .btn { grid-column: 1 / -1; }
  .home-dungeon > img.spr { width: 44px; height: 44px; }
  .tabbar a { font-size: 11px; }
  .dg-intro { grid-template-columns: minmax(0, 1fr); padding: 14px; gap: 6px; }
  .dg-intro .dg-torch { width: 64px; height: 64px; justify-self: center; }
  .dg-intro h2 { font-size: 28px; text-align: center; }
  .dg-heroes button > img.spr { width: 40px; height: 40px; }
  .dg-start { padding: 12px; }
  .dg-go { width: 100%; }
  .dg-hud { padding: 6px 10px; gap: 6px 10px; }
  .dg-who { flex: 1 1 140px; }
  .dg-who > img.spr { width: 40px; height: 40px; }
  .dg-floor { margin-left: 0; align-items: flex-start; flex: 1 0 auto; }
  .relic { width: 34px; height: 34px; } .relic img.spr { width: 26px; height: 26px; }
  .dg-map { height: calc(var(--rows) * 70px + 32px); }
  .dg-node { width: 46px; height: 46px; } .dg-node img.spr { width: 30px; height: 30px; }
  .dg-node.t-boss { width: 76px; height: 76px; } .dg-node.t-boss img.spr { width: 58px; height: 58px; }
  .dg-me { width: 28px !important; height: 28px !important; right: -14px; top: -16px; }
  .dg-room { padding: 14px; }
  .dg-room-head { gap: 10px; }
  .dg-room-head h2 { font-size: 24px; }
  .dg-art img.spr { width: 64px; height: 64px; }
  .dg-art img.dg-foe + img.dg-foe { margin-left: -16px; }
  .dg-card-pick { gap: 8px; }
  .dg-card-pick .card.sm { --cw: 98px; }
  .dg-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dg-choices { grid-template-columns: minmax(0, 1fr); }
}

/* ── 쌍둥이 카드 ── */
.c-twin {
  position: absolute; left: 50%; top: calc(6px + 42% - 16px); transform: translateX(-50%); z-index: 2;
  font-family: var(--tiny); font-size: 9px; line-height: 1; padding: 2px 5px; white-space: nowrap;
  background: linear-gradient(90deg, #ff8a3d 50%, #3fa7ff 50%); color: #fff; border: 2px solid var(--edge); text-shadow: 1px 1px 0 #000;
}
.card.mini .c-twin { font-size: 8px; padding: 1px 3px; }
.m-hand .card.resonate { box-shadow: inset 0 0 0 3px var(--gold), inset 0 0 0 5px #fff3a8; animation: reso .7s steps(2) infinite; }
.m-hand .card.resonate .c-badge { background: var(--gold); color: #2a1d12; font-weight: 700; top: auto; bottom: 30%; }
@keyframes reso { 50% { box-shadow: inset 0 0 0 3px #ff8a3d, inset 0 0 0 5px #3fa7ff; } }
.pop.twin { color: var(--gold); font-size: 26px; text-shadow: 2px 2px 0 #8f1d2c, -1px -1px 0 #000; }
.twin-pair { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; margin: 10px 0; padding: 8px; background: #120d1c; border: 2px solid var(--edge); }
.twin-pair p { margin: 0; font-size: 13px; }
.t-twin { color: var(--gold); }

/* ── v0.3: 상단 아이콘 · 공지 · 설정 · 친구 · 관리자 ── */
button, input, select, textarea { font: inherit; color: inherit; }
select, textarea {
  width: 100%; min-height: 44px; padding: 8px 10px; font-size: 15px; background: #120d1c; color: var(--ink);
  border: 3px solid var(--edge); box-shadow: inset 3px 3px 0 #000;
}
textarea { resize: vertical; line-height: 1.5; }
select:focus-visible, textarea:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.center { text-align: center; }
.tag.bad { background: #5c1620; }
.btn.ghost { background: transparent; box-shadow: none; border-color: var(--hi); color: var(--dim); }
.icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  border: 2px solid var(--hi); background: none; text-decoration: none;
}
.icon-btn .ico { width: 26px; height: 26px; margin: 0; }
.icon-btn .dot { top: -6px; right: -6px; }
.icon-btn.on, .me-btn.on { border-color: var(--gold); background: #2a1f3d; }
.me-btn { text-decoration: none; color: var(--ink); }
.me-btn .gear { width: 18px; height: 18px; margin: 0 0 0 2px; opacity: .85; }
.join.plain input { text-transform: none; letter-spacing: normal; }

.notice-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; margin-bottom: 14px; background: #3a2a14; }
.notice-bar b { color: var(--gold); white-space: nowrap; }
.notice-bar span { flex: 1; }

.settings h2 { margin-bottom: 14px; }
.set-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.set-grid #set-sound { grid-row: span 2; }
.set-box { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.set-box h3 { display: flex; align-items: center; gap: 6px; margin: 0; }
.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.preset {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; text-align: left; cursor: pointer;
  background: #1a1329; border: 3px solid var(--edge); box-shadow: inset 0 0 0 2px var(--hi); min-height: 64px;
}
.preset span { font-size: 12px; color: var(--dim); }
.preset.on { background: #3a2a14; box-shadow: inset 0 0 0 3px var(--gold); }
.preset.on b { color: var(--gold); }
.vol-row { display: grid; grid-template-columns: 9em minmax(0, 1fr) 2.6em; gap: 10px; align-items: center; }
.vol-row label { display: flex; align-items: center; gap: 4px; }
.vol-row output { font-weight: 700; color: var(--gold); text-align: right; }
input[type=range] {
  -webkit-appearance: none; appearance: none; min-height: 32px; padding: 0; background: transparent; border: 0; box-shadow: none; clip-path: none; accent-color: var(--gold);
}
input[type=range]::-webkit-slider-runnable-track { height: 10px; background: #120d1c; border: 2px solid var(--edge); box-shadow: inset 2px 2px 0 #000; }
input[type=range]::-moz-range-track { height: 10px; background: #120d1c; border: 2px solid var(--edge); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 24px; margin-top: -9px; background: var(--gold); border: 3px solid var(--edge); box-shadow: inset -3px -3px 0 var(--gold2); cursor: pointer; }
input[type=range]::-moz-range-thumb { width: 16px; height: 20px; background: var(--gold); border: 3px solid var(--edge); border-radius: 0; cursor: pointer; }
input[type=range]:disabled { opacity: .4; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.rec { padding: 10px 12px; background: #23193a; }
.rec b { color: var(--gold); }
.try { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.coupon-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.coupon-form input { text-transform: uppercase; letter-spacing: .12em; }
.coupon-msg { min-height: 1.4em; margin: 0; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.coupon-msg.ok { color: var(--green); } .coupon-msg.err { color: #ff7a7e; }
.reward-icons { display: flex; justify-content: center; gap: 10px; }
.reward-icons .ico { width: 72px; height: 72px; animation: popin .4s steps(4) both; }

.friends h2, .admin h2 { display: flex; align-items: center; gap: 6px; }
.friends h3 { margin-top: 18px; }
.friends .join { max-width: 640px; grid-template-columns: auto minmax(0, 1fr) auto; }
.friend-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.friend { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; }
.friend > img.spr { width: 56px; height: 56px; }
.friend.off > img.spr { filter: grayscale(.8) brightness(.8); }
.f-info { display: flex; flex-direction: column; }
.f-info b { font-size: 16px; }
.f-act { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.on-dot, .off-dot { display: inline-block; width: 10px; height: 10px; margin-right: 4px; border: 2px solid var(--edge); vertical-align: middle; }
.on-dot { background: var(--green); } .off-dot { background: #666; }
.modal .friend-list { grid-template-columns: minmax(0, 1fr); margin: 10px 0; }

.tabs { display: flex; gap: 4px; border-bottom: 3px solid var(--edge); margin: 4px 0 16px; flex-wrap: wrap; }
.tabs button { min-height: 42px; padding: 6px 16px; background: #1a1329; border: 3px solid var(--edge); border-bottom: 0; cursor: pointer; font-weight: 700; color: var(--dim); }
.tabs button.on { background: var(--panel2); color: var(--gold); box-shadow: inset 0 3px 0 var(--gold); }
.a-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.a-stat { display: flex; flex-direction: column; align-items: center; padding: 14px 8px; }
.a-stat b { font-size: 30px; color: var(--gold); line-height: 1.1; }
.a-stat span { font-size: 13px; color: var(--dim); }
.a-table { display: flex; flex-direction: column; border: 3px solid var(--edge); background: #1a1329; }
.a-tr { display: grid; grid-template-columns: minmax(0, 2fr) 5em 5em 6em 5em; gap: 8px; align-items: center; padding: 8px 10px; border-bottom: 2px solid #120d1c; }
.a-tr.head { background: var(--panel2); font-weight: 700; font-size: 13px; color: var(--dim); }
.a-tr > span:first-child { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; }
.a-tr small { width: 100%; }
.a-tr.banned { background: #2a1219; }
.a-tr.off { opacity: .55; }
.a-table.coupons .a-tr { grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr) 5em 7em 9em; }
.a-tr > span:last-child { text-align: right; }
.a-grid input, .a-grid select, .a-form input, .a-form select { font-weight: 400; }
.a-btns { display: flex; gap: 6px; justify-content: flex-end; }
.a-form { display: grid; grid-template-columns: 8em minmax(0, 1fr) 6em auto; gap: 8px; align-items: center; margin-top: 8px; }
.a-form[data-a=gold], .a-form[data-a=ban] { grid-template-columns: 8em minmax(0, 1fr) auto; }
.a-form[data-a=unban] { grid-template-columns: auto; justify-content: start; }
.a-coupon-form { margin-bottom: 18px; }
.a-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.a-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.a-grid .span2 { grid-column: span 2; }
#a-notice textarea { min-height: 90px; }

@media (min-width: 601px) {
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 899px) {
  .set-grid { grid-template-columns: minmax(0, 1fr); }
  .set-grid #set-sound { grid-row: auto; }
  .a-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .a-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .tile { min-height: 92px; padding: 8px 2px; gap: 2px; }
  .tile .tile-ico { width: 36px; height: 36px; }
  .tile b { font-size: 12px; } .tile span { font-size: 10px; text-align: center; }
  .wallet { gap: 6px; }
  .me-btn span { display: none; }
  .me-btn { padding: 4px 6px; }
  .icon-btn { width: 38px; height: 38px; }
  .vol-row { grid-template-columns: minmax(0, 1fr) 2.6em; gap: 2px 8px; }
  .vol-row label { grid-column: 1 / -1; }
  .presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .friends .join { grid-template-columns: minmax(0, 1fr) auto; }
  .friend-list { grid-template-columns: minmax(0, 1fr); }
  .friend { grid-template-columns: auto minmax(0, 1fr); }
  .friend > img.spr { width: 44px; height: 44px; }
  .f-act { grid-column: 1 / -1; justify-content: flex-start; }
  .a-tr { grid-template-columns: minmax(0, 1fr) 5em; }
  .a-tr > span:nth-child(2), .a-tr > span:nth-child(3), .a-tr > span:nth-child(4) { display: none; }
  .a-table.coupons .a-tr { grid-template-columns: minmax(0, 1fr) 9em; }
  .a-table.coupons .a-tr > span:nth-child(2) { display: block; grid-column: 1 / -1; order: 3; }
  .a-table.coupons .a-tr.head > span:nth-child(2) { display: none; }
  .a-form, .a-form[data-a=gold], .a-form[data-a=ban] { grid-template-columns: minmax(0, 1fr) 5em auto; }
  .a-form label { grid-column: 1 / -1; }
  .a-form[data-a=gold] input, .a-form[data-a=ban] input { grid-column: 1 / 3; }
  .a-grid { grid-template-columns: minmax(0, 1fr); }
  .a-grid .span2 { grid-column: auto; }
  .tabs button { flex: 1; padding: 6px 4px; }
}

/* 던전: 덱 고르기 */
.dg-decks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; max-width: 640px; }
.dg-deck {
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 6px; align-items: center;
  padding: 6px 8px; min-height: 54px; text-align: left; cursor: pointer; background: #120d1c; border: 2px solid var(--edge);
}
.dg-deck > img.spr { grid-row: span 2; width: 30px; height: 30px; margin: 0; }
.dg-deck b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-deck span { font-size: 11px; color: var(--dim); }
.dg-deck.on { background: var(--panel2); box-shadow: inset 0 0 0 2px var(--gold); }
.dg-deck.on b { color: var(--gold); }
.dg-deck.bad { opacity: .55; }
.dg-sub { margin-top: 12px !important; }
.dg-deck-note { margin: 8px 0 0; }
@media (max-width: 600px) {
  .dg-decks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
