/* 덱 퀘스트 */
:root {
  --bg: #0b0911; --panel: rgba(26, 21, 36, 0.88); --panel2: rgba(38, 31, 52, 0.92); --line: #3a3150; --line2: #57496f;
  --t1: #f5f0ff; --t2: #bdb4cf; --t3: #847b98;
  --gold: #e9c47c; --gold2: #b48a3e; --red: #ff6b6b; --green: #6ee79a; --blue: #8cc0ff;
  --sun: #f5a524; --moon: #a78bfa; --star: #2ad8f0;
  --glow: 108, 76, 180;   /* 횃불·배경 빛 색 (층마다 바뀜) */
  --font: "Pretendard", -apple-system, "Segoe UI", "Malgun Gothic", sans-serif;
}
body[data-tier="1"] { --glow: 52, 140, 120; }
body[data-tier="2"] { --glow: 170, 60, 60; }
body[data-tier="3"] { --glow: 150, 40, 200; }
* { box-sizing: border-box; }
html { background: var(--bg); height: 100%; }
body {
  margin: 0; min-height: 100%; color: var(--t1); font-family: var(--font); -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
  background:
    radial-gradient(120% 70% at 50% 110%, rgba(0,0,0,.85), transparent 60%),
    radial-gradient(90% 60% at 50% -10%, rgba(var(--glow), .35), transparent 70%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 2px, transparent 2px 46px),
    repeating-linear-gradient(90deg, rgba(0,0,0,.25) 0 2px, transparent 2px 92px),
    linear-gradient(#15111f, #0b0911);
  background-attachment: fixed;
  transition: background .6s;
}
/* 양옆 횃불 빛 */
body::before, body::after {
  content: ""; position: fixed; top: 18%; width: 46vmin; height: 46vmin; border-radius: 50%; pointer-events: none; z-index: 0;
  background: radial-gradient(circle, rgba(255, 170, 70, .16), transparent 65%); animation: torch 2.8s ease-in-out infinite alternate;
}
body::before { left: -18vmin; } body::after { right: -18vmin; animation-delay: -1.3s; }
@keyframes torch { 0% { opacity: .65; transform: scale(1); } 40% { opacity: 1; } 70% { opacity: .75; transform: scale(1.06); } 100% { opacity: .95; transform: scale(.97); } }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
svg { display: block; overflow: visible; }
#app { position: relative; z-index: 1; max-width: 520px; margin: 0 auto; height: 100vh; height: 100dvh; display: flex; flex-direction: column; user-select: none; -webkit-user-select: none; }
#app.quake { animation: quake .35s; }
@keyframes quake { 15% { transform: translate(-7px, 3px); } 35% { transform: translate(6px, -4px); } 55% { transform: translate(-4px, 2px); } 75% { transform: translate(3px, -1px); } }

/* ---- 상단 바 ---- */
.top { display: flex; align-items: center; gap: 10px; padding: 8px 10px; font-size: 14px; font-weight: 800; border-bottom: 1px solid var(--line); background: linear-gradient(rgba(20,16,30,.95), rgba(20,16,30,.75)); flex-shrink: 0; }
.top > span { display: inline-flex; align-items: center; gap: 4px; }
.top .ico { width: 17px; height: 17px; }
.top small { color: var(--t3); font-weight: 600; font-size: 11px; }
.top .hp { color: #ff9a9a; } .top .gold { color: var(--gold); } .top .fl { color: var(--t2); }
.top .sp { flex: 1; }
.top .charms { gap: 2px; }
.top .charms span { cursor: help; }
.chi { width: 20px; height: 20px; filter: drop-shadow(0 1px 2px #000); }
.tb { display: inline-flex; align-items: center; gap: 3px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 4px 7px; font-size: 12px; font-weight: 700; color: var(--t2); min-width: 28px; justify-content: center; }
.tb .ico { width: 15px; height: 15px; }
.tb:hover { color: var(--t1); border-color: var(--line2); }
.tb.off { opacity: .4; text-decoration: line-through; }

.screen { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; padding: 14px 14px 18px; animation: screenIn .3s ease-out; }
@keyframes screenIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
h2 { margin: 6px 0 12px; font-size: 21px; text-align: center; letter-spacing: .5px; text-shadow: 0 2px 8px rgba(0,0,0,.7); }
.sub { color: var(--t2); font-size: 13px; text-align: center; margin: 0 0 14px; line-height: 1.6; }
.btn { background: linear-gradient(#433661, #2a2140); border: 1px solid #6a588f; border-radius: 12px; padding: 12px 20px; font-size: 15px; font-weight: 800; color: var(--t1); box-shadow: 0 3px 0 #1a1428, 0 6px 14px rgba(0,0,0,.4); transition: transform .08s, box-shadow .08s, filter .15s; }
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #1a1428, 0 3px 8px rgba(0,0,0,.4); }
.btn.gold { background: linear-gradient(#e2b45a, #9c6b22); border-color: #f3d48f; color: #2a1804; text-shadow: 0 1px 0 rgba(255,255,255,.35); box-shadow: 0 3px 0 #5c3d10, 0 6px 16px rgba(233,196,124,.25); }
.btn.ghost { background: rgba(0,0,0,.25); border-color: var(--line); color: var(--t2); font-weight: 600; box-shadow: none; }
.btn:disabled { opacity: .4; cursor: default; filter: grayscale(.6); }
.row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---- 타이틀 ---- */
.title { justify-content: center; align-items: center; text-align: center; gap: 12px; }
.title-art { position: relative; width: 240px; height: 150px; margin-bottom: -6px; }
.hero-big { position: absolute; left: 50%; bottom: 0; width: 120px; transform: translateX(-50%); filter: drop-shadow(0 8px 14px rgba(0,0,0,.7)); animation: bob 3s ease-in-out infinite; }
.tcard { position: absolute; width: 54px; height: 76px; border-radius: 9px; display: grid; place-items: center; box-shadow: 0 8px 18px rgba(0,0,0,.6); animation: floaty 4s ease-in-out infinite; }
.tcard .sui { width: 30px; height: 30px; }
.tcard.t1 { left: 4px; top: 30px; transform: rotate(-16deg); background: linear-gradient(160deg, #6a3d10, #2b1907); border: 2px solid var(--sun); }
.tcard.t2 { right: 4px; top: 30px; transform: rotate(16deg); background: linear-gradient(160deg, #3d2e70, #1c1533); border: 2px solid var(--moon); animation-delay: -2s; }
.tcard.t3 { left: 50%; top: -6px; margin-left: -27px; background: linear-gradient(160deg, #0f4d5c, #082027); border: 2px solid var(--star); animation-delay: -1s; }
@keyframes floaty { 50% { translate: 0 -8px; } }
.logo { font-size: min(44px, 11vw); font-weight: 900; letter-spacing: 2px; background: linear-gradient(90deg, var(--sun), #ffe3a8 35%, var(--moon) 60%, var(--star)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 3px 0 rgba(0,0,0,.6)); }
.tagline { color: var(--t2); font-size: 13px; letter-spacing: 1px; margin-top: -8px; }
.rules { text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; font-size: 13px; line-height: 1.75; color: var(--t2); max-width: 400px; }
.rules b { color: var(--t1); }
.si { display: inline-flex; align-items: center; gap: 2px; vertical-align: -3px; }
.si svg { width: 16px; height: 16px; }
.proto { font-size: 11px; color: var(--t3); }
.home { color: var(--t3); font-size: 12px; text-decoration: none; }

/* ---- 지도 ---- */
.track { position: relative; display: flex; justify-content: space-between; align-items: center; margin: 4px 0 20px; padding: 0 2px; }
.track::before { content: ""; position: absolute; left: 12px; right: 12px; top: 50%; border-top: 2px dashed var(--line2); }
.track i { position: relative; font-style: normal; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; background: #1a1526; border: 1px solid var(--line2); color: var(--t3); }
.track i .nico { width: 16px; height: 16px; }
.track i.done { background: #2b2340; }
.track i.now { border: 2px solid var(--gold); box-shadow: 0 0 0 4px rgba(233,196,124,.18), 0 0 14px rgba(233,196,124,.4); color: var(--gold); animation: pulse 1.6s ease-in-out infinite; }
.track i.boss { width: 30px; height: 30px; border-color: #b0477a; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(233,196,124,.06), 0 0 18px rgba(233,196,124,.55); } }
.nodes { display: flex; flex-direction: column; gap: 12px; }
.node { display: flex; align-items: center; gap: 14px; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; box-shadow: 0 6px 16px rgba(0,0,0,.35); transition: transform .12s, border-color .12s, background .12s; }
.node:hover { border-color: var(--gold); background: var(--panel2); transform: translateY(-2px); }
.node .ni { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: radial-gradient(circle at 40% 35%, #3a2f52, #1a1526); border: 1px solid var(--line2); flex-shrink: 0; }
.node .ni .nico { width: 34px; height: 34px; filter: drop-shadow(0 2px 3px #000); }
.node[data-k="elite"] .ni { background: radial-gradient(circle at 40% 35%, #5a2430, #22101a); border-color: #8a3a4a; }
.node[data-k="boss"] .ni { background: radial-gradient(circle at 40% 35%, #4a1f5c, #1c0b24); border-color: #a050c0; }
.node b { display: block; font-size: 17px; }
.node small { color: var(--t3); font-size: 12px; }

/* ---- 전투 ---- */
.battle { padding: 6px 10px 10px; overflow: hidden; }
.foes { position: relative; flex: 1; min-height: 170px; display: flex; justify-content: center; align-items: flex-end; gap: 6px; padding-bottom: 14px; }
.foes::after { content: ""; position: absolute; left: 4%; right: 4%; bottom: 0; height: 46%; z-index: -1; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 70%, rgba(var(--glow), .22), rgba(0,0,0,.35) 60%, transparent 72%); }
.foe { position: relative; flex: 0 1 150px; min-width: 0; text-align: center; padding: 6px 6px 6px; border-radius: 16px; border: 2px solid transparent; transition: transform .18s, opacity .45s, filter .45s; }
.foe .art { width: 112px; height: 112px; margin: 0 auto; filter: drop-shadow(0 8px 6px rgba(0,0,0,.55)); animation: bob 2.6s ease-in-out infinite; }
.foe .art svg { width: 100%; height: 100%; }
.foe.big .art { width: 150px; height: 150px; }
.foe .shadow { width: 60%; height: 10px; margin: -6px auto 4px; border-radius: 50%; background: radial-gradient(rgba(0,0,0,.55), transparent 70%); }
@keyframes bob { 50% { transform: translateY(-5px) scale(1.015, .985); } }
.foe.targetable { border-color: rgba(233,196,124,.45); background: rgba(233,196,124,.06); cursor: pointer; }
.foe.targetable:hover { border-color: var(--gold); background: rgba(233,196,124,.13); }
.foe.targetable .art { animation-duration: 1.2s; }
.foe.acting { transform: translateY(14px) scale(1.08); }
.foe.dead { opacity: 0; filter: blur(3px) brightness(2); transform: scale(.7) translateY(10px); pointer-events: none; }
.foe.flash .art { animation: hitflash .3s, bob 2.6s ease-in-out infinite .3s; }
@keyframes hitflash { 0% { filter: brightness(3) saturate(0); } 100% { filter: none; } }
.intent { height: 24px; display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 13px; font-weight: 900; white-space: nowrap; animation: bob 2s ease-in-out infinite; }
.intent > span { display: inline-flex; align-items: center; gap: 1px; padding: 1px 6px 1px 3px; border-radius: 10px; background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.08); }
.intent .ico { width: 16px; height: 16px; }
.intent small { font-size: 10px; margin-left: 1px; }
.intent .ia { color: #ff9a9a; } .intent .ib { color: var(--blue); } .intent .ibuff, .intent .idb { padding: 1px 3px; }
.intent .iname { color: var(--gold); font-size: 11px; padding: 1px 7px; }
.fname { font-size: 12px; font-weight: 700; color: var(--t2); margin: 0 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 3px #000; }
.bar { position: relative; height: 13px; border-radius: 7px; background: #2b1720; border: 1px solid rgba(0,0,0,.6); box-shadow: inset 0 2px 3px rgba(0,0,0,.5); }
.bar > span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: linear-gradient(#ff7b7b, #c43c3c 60%, #9a2a2f); transition: width .35s cubic-bezier(.3,.7,.3,1); }
.bar > em { position: absolute; inset: 0; font-style: normal; font-size: 10px; line-height: 12px; font-weight: 800; text-shadow: 0 1px 2px #000, 0 0 2px #000; }
.bar.blk { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue), 0 0 10px rgba(140,192,255,.4); }
.blkv { position: absolute; left: -8px; top: -7px; display: inline-flex; align-items: center; gap: 1px; font-style: normal; font-size: 10px; font-weight: 900; background: #10263f; color: #cfe5ff; border: 1px solid var(--blue); border-radius: 9px; padding: 0 5px 0 2px; }
.blkv .ico { width: 13px; height: 13px; }
.sts { display: flex; gap: 3px; justify-content: center; flex-wrap: wrap; min-height: 19px; margin-top: 5px; }
.sts span { display: inline-flex; align-items: center; gap: 1px; font-size: 11px; font-weight: 800; padding: 1px 6px 1px 2px; border-radius: 9px; background: rgba(0,0,0,.5); color: var(--t1); border: 1px solid rgba(255,255,255,.08); }
.sts .ico { width: 14px; height: 14px; }
.shake { animation: shake .3s; }
@keyframes shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }

.hero { display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 6px 14px rgba(0,0,0,.35); }
.hero .art { width: 48px; height: 48px; flex-shrink: 0; border-radius: 12px; background: radial-gradient(circle at 50% 35%, #3a2f60, #17122a); border: 1px solid var(--line2); overflow: hidden; }
.hero .art svg { width: 100%; height: 100%; transform: translateY(4px) scale(1.08); }
.hero.flash .art { animation: hitflash .3s; }
.hero .hb { flex: 1; min-width: 0; }
.hero .bar { height: 15px; }
.hero .bar > em { line-height: 14px; font-size: 11px; }
.hero .sts { justify-content: flex-start; }
.chainbar { display: flex; align-items: center; gap: 8px; margin: 8px 2px 0; font-size: 12px; font-weight: 700; color: var(--t3); min-height: 24px; }
.chainbar .lk { display: flex; gap: 1px; }
.chainbar .lk i { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: rgba(0,0,0,.45); animation: linkIn .3s backwards; }
.chainbar .lk i .sui { width: 15px; height: 15px; }
.chainbar .lk i.lk-sun { box-shadow: 0 0 8px rgba(245,165,36,.5); } .chainbar .lk i.lk-moon { box-shadow: 0 0 8px rgba(167,139,250,.5); } .chainbar .lk i.lk-star { box-shadow: 0 0 8px rgba(42,216,240,.5); }
@keyframes linkIn { from { transform: scale(0); } 70% { transform: scale(1.3); } }
.chainbar b { color: var(--t1); font-size: 14px; }
.chainbar .bonus { color: var(--green); font-weight: 900; }
.hint { text-align: center; font-size: 12px; color: var(--t3); min-height: 18px; margin: 2px 0 2px; }

.hand { display: flex; justify-content: center; align-items: flex-end; height: 168px; padding-top: 22px; flex-shrink: 0; }
.hand .card + .card { margin-left: var(--ov, 4px); }
.ctrl { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-shrink: 0; }
.pile { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 8px; font-size: 11px; font-weight: 700; color: var(--t2); min-width: 62px; line-height: 1.3; }
.energy { position: relative; width: 58px; height: 58px; border-radius: 50%; display: flex; align-items: baseline; justify-content: center; padding-top: 14px; flex-shrink: 0;
  background: radial-gradient(circle at 35% 28%, #fff3c4, #f0b545 45%, #a8661a 80%); color: #2a1702; border: 2px solid #ffe2a0; box-shadow: 0 0 18px rgba(240,181,69,.55), inset 0 -4px 8px rgba(0,0,0,.3); }
.energy b { font-size: 22px; font-weight: 900; line-height: 1; }
.energy small { font-size: 11px; font-weight: 800; opacity: .7; }
.energy.empty { filter: grayscale(.85) brightness(.55); box-shadow: none; }
.endturn { flex: 1; padding: 14px 10px; }

/* ---- 카드 ---- */
.card { position: relative; width: 92px; height: 136px; flex-shrink: 0; border-radius: 11px; padding: 5px 5px 4px; display: flex; flex-direction: column; align-items: center; text-align: center;
  background: linear-gradient(170deg, var(--c1), var(--c2)); border: 2px solid var(--cb); box-shadow: 0 6px 14px rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,255,255,.08);
  transition: transform .14s, box-shadow .14s, margin .14s, filter .14s; cursor: pointer; color: #fff; }
.card::before { content: ""; position: absolute; inset: 3px; border-radius: 8px; border: 1px solid rgba(255,255,255,.1); pointer-events: none; }
.card.s-sun { --c1: #6e4214; --c2: #2b1907; --cb: #e09a2a; --sc: var(--sun); --art: radial-gradient(circle at 50% 60%, #ffcf7a55, transparent 70%), linear-gradient(#4a2a0c, #23130a); }
.card.s-moon { --c1: #43327a; --c2: #1c1533; --cb: #9a80f0; --sc: var(--moon); --art: radial-gradient(circle at 50% 60%, #c9b8ff44, transparent 70%), linear-gradient(#2a2050, #140f26); }
.card.s-star { --c1: #0f5262; --c2: #082027; --cb: #22c4dc; --sc: var(--star); --art: radial-gradient(circle at 50% 60%, #8ff0ff44, transparent 70%), linear-gradient(#0b3440, #051a20); }
.card.r3 { box-shadow: 0 6px 14px rgba(0,0,0,.55), 0 0 12px rgba(255,214,120,.35), inset 0 0 0 1px rgba(255,230,160,.25); }
.card .cost { position: absolute; left: -8px; top: -8px; z-index: 2; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 14px;
  background: radial-gradient(circle at 35% 28%, #fff3c4, #f0b545 50%, #a8661a); color: #2a1702; border: 2px solid #2a1702; box-shadow: 0 2px 4px rgba(0,0,0,.5); }
.card .suit { position: absolute; right: 4px; top: 4px; }
.card .suit .sui { width: 14px; height: 14px; filter: drop-shadow(0 0 3px var(--sc)); }
.card .cname { font-size: 12px; font-weight: 900; margin-top: 4px; line-height: 1.2; white-space: nowrap; text-shadow: 0 1px 2px #000; max-width: 100%; overflow: hidden; text-overflow: ellipsis; padding: 0 10px 0 6px; }
.card .cname.upg { color: var(--green); }
.card .cname.long { font-size: 10.5px; letter-spacing: -.3px; padding: 1px 8px 0 4px; }
.card .cart-w { width: 100%; height: 38px; margin-top: 3px; border-radius: 6px; background: var(--art); border: 1px solid rgba(0,0,0,.5); box-shadow: inset 0 0 8px rgba(0,0,0,.5); overflow: hidden; display: grid; place-items: center; }
.card .cart { width: 100%; height: 100%; }
.card .ctype { font-size: 9px; font-weight: 700; color: rgba(255,255,255,.6); margin: 2px 0 1px; letter-spacing: 1px; }
.card .cdesc { font-size: 10.5px; line-height: 1.32; color: #f3eefc; flex: 1; display: flex; flex-direction: column; justify-content: center; word-break: keep-all; padding: 0 1px; }
.card .cdesc b { color: #fff; font-size: 12px; }
.card .cdesc b.up { color: var(--green); }
.card .cdesc b.dn { color: var(--red); }
.card .cdesc em { font-style: normal; color: var(--sc); font-weight: 800; }
.card .cdesc .ex { font-size: 9px; color: rgba(255,255,255,.55); margin-top: 1px; }
.card .rar { position: absolute; bottom: 2px; left: 0; right: 0; font-size: 8px; color: rgba(255,255,255,.4); letter-spacing: 1px; }
.hand .card:hover { transform: translateY(-12px); z-index: 2; }
.hand .card.sel { transform: translateY(-24px) scale(1.07); z-index: 3; box-shadow: 0 0 0 3px var(--gold), 0 0 22px rgba(233,196,124,.55), 0 12px 24px rgba(0,0,0,.6); }
.hand .card.off { filter: grayscale(.75) brightness(.55); }
.hand .card.chainy { box-shadow: 0 0 14px var(--sc), 0 6px 14px rgba(0,0,0,.55); }
.hand .card.chainy::after, .hand .card.shifty::after { position: absolute; top: -19px; left: 50%; transform: translateX(-50%); font-size: 10px; font-weight: 900; white-space: nowrap; padding: 1px 6px; border-radius: 8px; background: rgba(0,0,0,.7); }
.hand .card.chainy::after { content: "체인 +"; color: var(--green); }
.hand .card.shifty::after { content: "전환!"; color: var(--gold); }
.card.big { transform: scale(1.1); margin: 10px 8px; }
.cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 10px; padding: 10px 0; }
.cards .card:hover { box-shadow: 0 0 0 3px var(--gold), 0 0 18px rgba(233,196,124,.4), 0 6px 14px rgba(0,0,0,.5); }
.cards .card.big:hover { transform: scale(1.14) translateY(-3px); }
.cards .card.sold { opacity: .22; pointer-events: none; filter: grayscale(1); }
.price { display: inline-flex; align-items: center; gap: 3px; justify-content: center; font-size: 13px; color: var(--gold); font-weight: 800; margin-top: 6px; }
.price.no { color: var(--red); }
.slot { display: flex; flex-direction: column; align-items: center; }

/* ---- 보상·상점·휴식·사건 ---- */
.box { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; margin-bottom: 12px; box-shadow: 0 6px 16px rgba(0,0,0,.3); }
.box h3 { margin: 0 0 6px; font-size: 13px; color: var(--t2); font-weight: 700; letter-spacing: .5px; }
.charm { display: flex; align-items: center; gap: 12px; }
.charm .ci { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: radial-gradient(circle at 40% 35%, #3a2f52, #1a1526); border: 1px solid var(--line2); flex-shrink: 0; }
.charm .ci .chi { width: 30px; height: 30px; }
.charm b { display: block; }
.charm small { color: var(--t2); font-size: 12px; }
.choices { display: flex; flex-direction: column; gap: 10px; }
.choice { text-align: left; background: var(--panel2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; transition: border-color .12s, transform .12s; }
.choice:hover:not(:disabled) { border-color: var(--gold); transform: translateY(-1px); }
.choice:disabled { opacity: .4; cursor: default; }
.choice b { display: block; margin-bottom: 2px; }
.choice small { color: var(--t2); }
.evart { font-size: 64px; text-align: center; margin: 4px 0 6px; filter: drop-shadow(0 8px 10px rgba(0,0,0,.6)); }
.result { text-align: center; color: var(--gold); font-weight: 700; margin: 10px 0; min-height: 20px; }
.big-icon { width: 110px; height: 110px; margin: 4px auto 0; display: grid; place-items: center; filter: drop-shadow(0 10px 14px rgba(0,0,0,.6)); }
.big-icon svg { width: 100%; height: 100%; }
.big-icon .nico { width: 84px; height: 84px; }
.big-icon.campfire { animation: flicker 1.4s ease-in-out infinite alternate; }
@keyframes flicker { 0% { transform: scale(1); filter: drop-shadow(0 0 16px rgba(255,140,40,.5)); } 100% { transform: scale(1.04, 1.07); filter: drop-shadow(0 0 26px rgba(255,140,40,.8)); } }
.defeated { opacity: .55; filter: grayscale(.6); transform: rotate(-12deg) scale(.9); }
.fallen { opacity: .6; filter: grayscale(.9); transform: rotate(80deg) translateX(12px); }
.stats { text-align: center; color: var(--t2); line-height: 1.9; font-size: 14px; }
.stats b { color: var(--t1); }

/* ---- 오버레이 ---- */
#ov { position: fixed; inset: 0; z-index: 50; background: rgba(6,4,12,.88); backdrop-filter: blur(4px); display: flex; justify-content: center; animation: screenIn .2s; }
#ov[hidden] { display: none; }
#ov .in { width: 100%; max-width: 520px; display: flex; flex-direction: column; padding: 14px; }
#ov .head { display: flex; align-items: center; gap: 10px; }
#ov .head h2 { flex: 1; margin: 0; text-align: left; font-size: 17px; }
#ov .scroll { flex: 1; overflow-y: auto; }
#ov .rules { max-width: none; }

/* ---- 효과 ---- */
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 80; overflow: hidden; }
.float { position: absolute; transform: translate(-50%, -50%); font-weight: 900; font-size: 24px; text-shadow: 0 2px 0 #000, 0 0 6px #000; animation: floatUp .95s cubic-bezier(.2,.7,.3,1) forwards; white-space: nowrap; z-index: 3; }
.float.dmg { color: #ff6363; font-size: 28px; } .float.blk { color: var(--blue); font-size: 17px; } .float.heal { color: var(--green); }
.float.info { color: var(--gold); font-size: 15px; } .float.ps { color: #c49bff; font-size: 16px; }
.float.chain { color: var(--green); font-size: 18px; } .float.shift { color: var(--gold); font-size: 18px; }
@keyframes floatUp { 0% { opacity: 0; margin-top: 8px; scale: .6; } 18% { opacity: 1; scale: 1.15; } 30% { scale: 1; } 100% { opacity: 0; margin-top: -52px; } }
.pt { position: absolute; border-radius: 50%; transform: translate(-50%, -50%); animation: pt .65s ease-out forwards; box-shadow: 0 0 6px currentColor; }
@keyframes pt { from { opacity: 1; } to { opacity: 0; translate: var(--dx) var(--dy); scale: .3; } }
.ring { position: absolute; width: 20px; height: 20px; border-radius: 50%; border: 3px solid; transform: translate(-50%, -50%); animation: ring .55s ease-out forwards; }
@keyframes ring { from { opacity: .9; } to { opacity: 0; width: 110px; height: 110px; border-width: 1px; } }
.sweep { position: absolute; height: 6px; margin-top: -3px; background: linear-gradient(90deg, transparent, #fff3c4, #ffb03b, transparent); box-shadow: 0 0 18px #ffb03b; border-radius: 3px; animation: sweep .45s ease-out forwards; transform-origin: left; }
@keyframes sweep { from { transform: scaleX(0); opacity: 1; } 60% { opacity: 1; } to { transform: scaleX(1); opacity: 0; } }
.ghost { z-index: 4; pointer-events: none; }
.banner { position: absolute; left: 0; right: 0; top: 36%; text-align: center; animation: banner 1.05s ease-out forwards; }
.banner span { display: inline-block; font-size: 30px; font-weight: 900; letter-spacing: 4px; padding: 6px 36px; text-shadow: 0 3px 0 #000; background: linear-gradient(90deg, transparent, rgba(0,0,0,.65) 20%, rgba(0,0,0,.65) 80%, transparent); }
@keyframes banner { 0% { opacity: 0; transform: scaleY(.3); } 18% { opacity: 1; transform: none; } 75% { opacity: 1; } 100% { opacity: 0; } }

@media (max-width: 400px) {
  .foes:has(.foe:nth-child(3)) .foe .art { width: 84px; height: 84px; }
  .card { width: 82px; height: 128px; }
  .card .cdesc { font-size: 10px; }
  .card .cart-w { height: 32px; }
  .foe .art { width: 96px; height: 96px; }
  .foe.big .art { width: 130px; height: 130px; }
  .top { gap: 6px; font-size: 13px; padding: 8px 8px; }
  .top .fl small, .top .hp small { display: none; }
  .top > span { white-space: nowrap; }
  .chi { width: 17px; height: 17px; }
  .tb { padding: 4px 5px; min-width: 24px; }
}
@media (max-height: 680px) {
  .foes { min-height: 130px; }
  .foe .art { width: 70px; height: 70px; }
  .foe.big .art { width: 96px; height: 96px; }
  .hand { height: 160px; }
}
@media (prefers-reduced-motion: reduce) {
  .foe .art, .intent, .hero-big, .tcard, body::before, body::after { animation: none !important; }
}
:lang(ja) .card .cdesc, :lang(en) .card .cdesc { word-break: normal; overflow-wrap: anywhere; }

/* 일시정지 버튼 (상단 바). 공용 일시정지 버튼(화면 위 가운데)은 상단 바와 겹쳐서 숨김 */
.gp-btn { display: none !important; }
.tb.pz { gap: 3px; }
.tb.pz i { width: 3px; height: 11px; border-radius: 1px; background: currentColor; }
