/* ============================================================
 * ARCANA — UI 스타일 (1600×900 스테이지를 화면에 맞춰 확대/축소)
 * 디자인 토큰은 DESIGN.md 참고
 * ============================================================ */
@property --ang { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
:root {
  --bg0: #0a0817; --bg1: #171036;
  --gold: #f5c96a; --gold-2: #ffe9b0; --gold-d: #8a5a12;
  --violet: #8b5cf6; --blue: #4aa8ff; --crimson: #ff4d6d; --green: #5dffa0;
  --ink: #f3f1ff; --muted: #a9a6c9;
  --glass: linear-gradient(160deg, rgba(255,255,255,.09), rgba(255,255,255,.025));
  --line: rgba(255,255,255,.12);
  --font: "Pretendard", "Pretendard Variable", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --display: "Cinzel", "Times New Roman", serif;
  --s: 1;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #05040d; }
body { font-family: var(--font); color: var(--ink); -webkit-font-smoothing: antialiased; user-select: none; }
button { font-family: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

#stage { position: fixed; left: 50%; top: 50%; width: 1600px; height: 900px; transform-origin: 50% 50%; overflow: hidden;
  background: radial-gradient(ellipse 85% 65% at 50% 38%, #3b2a8a 0%, #1c1446 42%, var(--bg0) 85%); }
#fx-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 500; }

/* ---------- 배경 ---------- */
.bg-layer { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.bg-rays { position: absolute; left: 50%; top: -40%; width: 2400px; height: 2400px; margin-left: -1200px;
  background: repeating-conic-gradient(from 0deg, rgba(255,233,176,.07) 0deg 4deg, transparent 4deg 18deg);
  mask: radial-gradient(circle, #000 0%, transparent 55%); -webkit-mask: radial-gradient(circle, #000 0%, transparent 55%);
  animation: spin 140s linear infinite; }
.bg-hex { position: absolute; inset: 0; opacity: .8;
  background: repeating-linear-gradient(60deg, rgba(255,255,255,.022) 0 1px, transparent 1px 46px), repeating-linear-gradient(-60deg, rgba(255,255,255,.022) 0 1px, transparent 1px 46px),
    radial-gradient(ellipse 60% 40% at 15% 100%, rgba(74,168,255,.18), transparent), radial-gradient(ellipse 50% 40% at 90% 0%, rgba(255,77,109,.14), transparent); }
.bg-vignette { position: absolute; inset: 0; background: radial-gradient(ellipse 75% 70% at 50% 50%, transparent 55%, rgba(0,0,0,.72)); }
@keyframes spin { to { transform: rotate(360deg); } }

.screen { position: absolute; inset: 0; display: none; z-index: 1; }
.screen.active { display: block; }

/* ---------- 공용 버튼 ---------- */
.icon-btn { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: rgba(20,14,48,.6); backdrop-filter: blur(6px);
  font-size: 20px; cursor: pointer; display: grid; place-items: center; transition: transform .15s, box-shadow .15s, border-color .15s; }
.icon-btn:hover { transform: translateY(-2px); border-color: var(--gold); box-shadow: 0 0 18px rgba(245,201,106,.4); }
.icon-btn.small { width: 38px; height: 38px; font-size: 16px; }
.btn-primary { position: relative; display: inline-flex; align-items: center; gap: 12px; height: 78px; padding: 0 46px; border: 0; border-radius: 999px; cursor: pointer;
  font-size: 28px; font-weight: 900; color: #2b1700; letter-spacing: 1px;
  background: linear-gradient(180deg, #fff3c7 0%, #ffd36b 40%, #f0a92b 100%);
  box-shadow: 0 0 0 2px #fff3c7 inset, 0 6px 0 #9b6400, 0 10px 30px rgba(0,0,0,.5), 0 0 40px rgba(255,200,80,.45);
  transition: transform .15s, filter .15s; animation: ctaGlow 2.4s ease-in-out infinite; }
.btn-primary::after { content: ""; position: absolute; inset: 0; border-radius: inherit; overflow: hidden;
  background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.7) 50%, transparent 65%); background-size: 250% 100%; animation: sweep 3s infinite; mix-blend-mode: overlay; }
.btn-primary:hover { transform: translateY(-3px) scale(1.02); filter: brightness(1.08); }
.btn-primary:active { transform: translateY(3px); box-shadow: 0 0 0 2px #fff3c7 inset, 0 2px 0 #9b6400; }
.btn-primary small { font-family: var(--display); font-size: 13px; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: rgba(60,30,0,.18); letter-spacing: 2px; }
.btn-primary.sm { height: 54px; padding: 0 30px; font-size: 19px; animation: none; }
.cta-ic { font-size: 30px; }
@keyframes ctaGlow { 50% { box-shadow: 0 0 0 2px #fff3c7 inset, 0 6px 0 #9b6400, 0 10px 30px rgba(0,0,0,.5), 0 0 70px rgba(255,200,80,.75); } }
@keyframes sweep { from { background-position: 150% 0; } to { background-position: -60% 0; } }
.btn-ghost { height: 54px; padding: 0 28px; border-radius: 999px; cursor: pointer; font-size: 18px; font-weight: 700;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,233,176,.45); backdrop-filter: blur(6px); transition: background .15s, transform .15s; }
.btn-ghost:hover { background: rgba(255,233,176,.14); transform: translateY(-2px); }

/* ============================================================ 로비 — 별점술사의 관측실 */
#lobby { --verm: #e5533c; --bone: #efe6d2; --brass: #c9a45c; --teal: #1d4d4f; background: #0a1c1f; overflow: hidden; }
.room { position: absolute; inset: 0; }
.layer { position: absolute; will-change: translate; }
.wall { inset: -40px; background:
  radial-gradient(ellipse 50% 60% at 28% 45%, rgba(120,200,190,.16), transparent 70%),
  radial-gradient(ellipse 40% 50% at 78% 30%, rgba(229,83,60,.14), transparent 70%),
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cg fill='%23c9a45c' fill-opacity='.09'%3E%3Cpath d='M40 30l2.5 7.5L50 40l-7.5 2.5L40 50l-2.5-7.5L30 40l7.5-2.5z'/%3E%3Ccircle cx='0' cy='0' r='1.6'/%3E%3Ccircle cx='80' cy='0' r='1.6'/%3E%3Ccircle cx='0' cy='80' r='1.6'/%3E%3Ccircle cx='80' cy='80' r='1.6'/%3E%3C/g%3E%3C/svg%3E"),
  linear-gradient(180deg, #0e2a2d 0%, #0b2023 55%, #071315 100%); }
.wall::after { content: ""; position: absolute; left: 0; right: 0; top: 610px; height: 6px; background: linear-gradient(90deg, transparent, rgba(201,164,92,.5), transparent); }
.moonbeam { left: 150px; top: 120px; width: 900px; height: 780px; pointer-events: none;
  background: linear-gradient(160deg, rgba(239,230,210,.16), rgba(239,230,210,.03) 60%, transparent);
  clip-path: polygon(10% 0, 52% 0, 100% 100%, 30% 100%); filter: blur(6px); mix-blend-mode: screen; animation: beam 8s ease-in-out infinite; }
@keyframes beam { 50% { opacity: .65; } }
.window { left: 200px; top: 70px; width: 500px; height: 640px; border-radius: 250px 250px 10px 10px; overflow: hidden;
  box-shadow: 0 0 0 14px #2a1d14, 0 0 0 18px #c9a45c, 0 0 0 22px #3a2a1c, 0 30px 60px rgba(0,0,0,.6), 0 0 120px rgba(120,200,190,.25); }
.sky { position: absolute; inset: -30px; background: radial-gradient(circle at 62% 26%, #3d7f86 0%, #1d4a55 30%, #0c2433 65%, #07121c 100%); will-change: translate; }
.stars { position: absolute; left: 0; top: 0; width: 2px; height: 2px; border-radius: 50%; background: transparent; }
.stars.s1 { animation: twinkle 4s ease-in-out infinite; } .stars.s2 { animation: twinkle 5.5s ease-in-out infinite reverse; }
@keyframes twinkle { 50% { opacity: .35; } }
.constellation { position: absolute; left: 10px; top: 380px; width: 480px; opacity: .9; }
.moon { position: absolute; left: 370px; top: 250px; width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle at 40% 38%, #fffaf0, #efe6d2 55%, #cdbf9f 100%);
  box-shadow: 0 0 40px rgba(255,246,220,.75), 0 0 120px rgba(255,246,220,.35); animation: moonGlow 6s ease-in-out infinite; }
.moon i { position: absolute; border-radius: 50%; background: rgba(160,140,110,.28); }
.moon i:nth-child(1) { left: 26px; top: 30px; width: 22px; height: 22px; } .moon i:nth-child(2) { left: 66px; top: 62px; width: 30px; height: 30px; } .moon i:nth-child(3) { left: 40px; top: 78px; width: 12px; height: 12px; }
@keyframes moonGlow { 50% { box-shadow: 0 0 56px rgba(255,246,220,.9), 0 0 160px rgba(255,246,220,.45); } }
.cloud { position: absolute; height: 50px; border-radius: 50px; background: rgba(200,230,225,.12); filter: blur(10px); }
.cloud.c1 { width: 320px; top: 210px; left: -340px; animation: drift 50s linear infinite; }
.cloud.c2 { width: 220px; top: 450px; left: -240px; animation: drift 70s linear infinite 12s; }
@keyframes drift { to { transform: translateX(1000px); } }
.shooting { position: absolute; left: 80px; top: 60px; width: 140px; height: 2px; background: linear-gradient(90deg, transparent, #fff); transform: rotate(18deg); opacity: 0; animation: shoot 9s ease-in infinite 3s; }
@keyframes shoot { 0%, 88% { opacity: 0; translate: 0 0; } 90% { opacity: 1; } 100% { opacity: 0; translate: 260px 90px; } }
.window-frame { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 2px 2px rgba(0,0,0,.6)); }

.lantern { left: 770px; top: -10px; width: 60px; height: 260px; transform-origin: 50% 0; animation: swing 6s ease-in-out infinite; }
@keyframes swing { 50% { transform: rotate(4deg); } }
.lantern .chain { position: absolute; left: 29px; top: 0; width: 2px; height: 150px; background: repeating-linear-gradient(180deg, #c9a45c 0 6px, transparent 6px 9px); }
.lantern .lamp { position: absolute; left: 6px; top: 150px; width: 48px; height: 70px; border-radius: 10px 10px 20px 20px; border: 3px solid #c9a45c;
  background: radial-gradient(circle at 50% 60%, #ffe7b0, #ff9a4a 45%, rgba(229,83,60,.4) 75%); box-shadow: 0 0 40px 12px rgba(255,160,80,.45), 0 0 140px 50px rgba(255,140,60,.18); animation: flicker 3s infinite; }
.lantern .lamp::before { content: ""; position: absolute; left: 8px; right: 8px; top: -14px; height: 12px; border-radius: 6px 6px 0 0; background: #c9a45c; }
@keyframes flicker { 0%, 100% { opacity: 1; } 40% { opacity: .88; } 42% { opacity: 1; } 70% { opacity: .93; } }

.armillary { left: 1468px; top: 440px; width: 150px; height: 190px; scale: .85; }
.armillary .ring { position: absolute; left: 15px; top: 0; width: 120px; height: 120px; border-radius: 50%; border: 3px solid #c9a45c; box-shadow: 0 0 10px rgba(201,164,92,.4); }
.armillary .r1 { animation: armA 9s linear infinite; } .armillary .r2 { animation: armB 13s linear infinite; border-color: #e5533c; } .armillary .r3 { animation: armC 17s linear infinite; border-width: 2px; }
@keyframes armA { to { transform: rotateY(360deg) rotateX(20deg); } } @keyframes armB { to { transform: rotateX(360deg) rotateZ(30deg); } } @keyframes armC { from { transform: rotateZ(60deg) rotateY(0); } to { transform: rotateZ(60deg) rotateY(360deg); } }
.armillary .core { position: absolute; left: 63px; top: 48px; width: 24px; height: 24px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fff3c7, #e5533c); box-shadow: 0 0 20px #ff7a55; }
.armillary .stand { position: absolute; left: 65px; top: 118px; width: 20px; height: 60px; background: linear-gradient(90deg, #8a6a30, #e0bd72, #8a6a30); clip-path: polygon(30% 0, 70% 0, 100% 100%, 0 100%); }

.seolpyo { left: 930px; top: 70px; width: 700px; height: 700px; cursor: pointer; outline: none; filter: drop-shadow(0 24px 30px rgba(0,0,0,.55)) drop-shadow(0 0 1px rgba(8,23,26,.9));  -webkit-mask-image: linear-gradient(180deg, #000 78%, transparent 97%); mask-image: linear-gradient(180deg, #000 78%, transparent 97%); }
.seolpyo .sp-face { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; user-select: none; pointer-events: none;
  opacity: 0; transition: opacity .35s ease; transform-origin: 50% 85%; animation: breathe 5s ease-in-out infinite; }
.seolpyo .sp-face.on { opacity: 1; }
.seolpyo:focus-visible { filter: drop-shadow(0 0 10px #efe6d2) drop-shadow(0 24px 30px rgba(0,0,0,.55)); }
.seolpyo.poke .sp-face { animation: poke .45s ease, breathe 5s ease-in-out infinite .45s; }
@keyframes breathe { 50% { transform: scale(1.01, 1.006) translateY(-3px); } }
@keyframes poke { 30% { transform: translateY(-10px) rotate(-.8deg); } }

.bubble { left: 720px; top: 196px; width: 390px; min-height: 96px; padding: 16px 22px 18px; border-radius: 6px 22px 22px 22px; opacity: 0; transition: opacity .3s;
  background: linear-gradient(180deg, #f5eedd, #e9dcc0); color: #1b2a2a; box-shadow: 0 0 0 2px #c9a45c, 0 0 0 6px rgba(8,23,26,.8), 0 16px 30px rgba(0,0,0,.45);
  font-family: "Nanum Myeongjo", "Noto Serif KR", serif; font-size: 19px; line-height: 1.55; font-weight: 700; }
.bubble.show { opacity: 1; }
.bubble::after { content: ""; position: absolute; right: -18px; top: 26px; border: 12px solid transparent; border-left: 20px solid #efe6d2; }
.bubble .speaker { position: absolute; left: 18px; top: -16px; padding: 3px 14px; border-radius: 4px; background: #e5533c; color: #fff4e8; font-family: var(--font); font-size: 14px; letter-spacing: 2px; box-shadow: 0 3px 0 #8f2a20; }

.table { left: 60px; top: 650px; width: 1480px; height: 520px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(ellipse at 50% 30%, #8a2f24 0%, #5a1b15 45%, #2b0c09 80%);
  box-shadow: 0 -4px 0 #c9a45c, 0 -10px 0 #2a1d14, 0 -40px 80px rgba(0,0,0,.6), inset 0 30px 60px rgba(255,140,90,.15); }
.table .cloth { position: absolute; inset: 40px 120px; border-radius: 50%; border: 2px dashed rgba(224,189,114,.5); }
.table .cloth::after { content: ""; position: absolute; inset: 30px 80px; border-radius: 50%; border: 1px solid rgba(224,189,114,.3); }
.candle { position: absolute; top: -30px; width: 22px; height: 60px; border-radius: 4px; background: linear-gradient(90deg, #d9cdb2, #fff8e8, #cdbf9f); }
.candle.k1 { left: 120px; top: 20px; } .candle.k2 { left: 160px; top: 34px; height: 44px; }
.candle i { position: absolute; left: 5px; top: -26px; width: 12px; height: 24px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: radial-gradient(circle at 50% 70%, #fff, #ffd27a 40%, #ff7a3a 80%);
  box-shadow: 0 0 20px 8px rgba(255,170,80,.5); animation: flame 1.2s ease-in-out infinite alternate; transform-origin: 50% 100%; }
@keyframes flame { to { transform: scale(.9, 1.1) rotate(3deg); } }

/* 타로 메뉴 */
.spread { left: 0; top: 0; width: 1600px; height: 900px; pointer-events: none; perspective: 1100px; perspective-origin: 50% 20%; }
.tarot { position: absolute; top: 612px; width: 140px; margin-left: -70px; padding: 0; border: 0; background: none; cursor: pointer; pointer-events: auto; outline: none;
  display: flex; flex-direction: column; align-items: center; transform: translateY(var(--dy)); transform-style: preserve-3d; color: #1d4d4f; }
.tarot-card { position: relative; display: block; width: 118px; height: 186px; border-radius: 10px; transform: rotateX(48deg) rotateZ(var(--rz)); transform-origin: 50% 100%;
  transition: transform .35s cubic-bezier(.2,.9,.3,1.25), box-shadow .3s; background: #efe6d2; padding: 6px;
  box-shadow: 0 0 0 2px #c9a45c, 0 0 0 5px #1b1410, 0 18px 24px rgba(0,0,0,.55); }
.tc-face { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: space-between; height: 100%; border: 1.5px solid #e5533c; border-radius: 6px; padding: 8px 4px 10px;
  background: radial-gradient(ellipse at 50% 40%, #fbf6ea, #e6d9bd 80%), #efe6d2; overflow: hidden; }
.tc-face::before { content: ""; position: absolute; inset: 4px; border: 1px solid rgba(29,77,79,.35); border-radius: 4px; }
.tc-no { font-family: var(--display); font-weight: 900; font-size: 20px; color: #1d4d4f; letter-spacing: 1px; }
.tc-face svg { width: 84px; height: 92px; color: #1d4d4f; }
.tc-en { font-family: var(--display); font-weight: 800; font-size: 8.6px; letter-spacing: .6px; color: #8f2a20; white-space: nowrap; }
.tarot-label { margin-top: 16px; display: flex; flex-direction: column; align-items: center; gap: 4px; transition: transform .3s; }
.tarot-label b { white-space: nowrap; font-size: 21px; font-weight: 800; color: #f5eedd; text-shadow: 0 2px 6px #000, 0 0 2px #000; letter-spacing: 1px; }
.tarot-label em { font-style: normal; font-size: 13px; font-weight: 700; color: #f2d79a; padding: 2px 10px; border-radius: 999px; background: rgba(8,23,26,.7); border: 1px solid rgba(201,164,92,.6); }
.tarot-label em.soon { color: #cfc6b2; border-color: rgba(239,230,210,.3); }
.tarot-label em.soon::before { content: "🔒 "; font-size: 11px; }
.tarot:hover .tarot-card, .tarot:focus-visible .tarot-card { transform: rotateX(0deg) rotateZ(0deg) translateY(-70px) scale(1.12);
  box-shadow: 0 0 0 2px #f2d79a, 0 0 0 5px #1b1410, 0 0 36px rgba(255,122,85,.75), 0 30px 40px rgba(0,0,0,.5); }
.tarot:hover .tarot-label, .tarot:focus-visible .tarot-label { transform: translateY(-6px); }
.tarot:focus-visible .tarot-label b { text-decoration: underline; text-decoration-color: #e5533c; text-underline-offset: 6px; }
.tarot.is-soon .tc-face { filter: sepia(.4) saturate(.6); }
/* 메인 CTA: 전차 */
.tarot.main { top: 400px; width: 200px; margin-left: -100px; z-index: 5; }
.tarot.main .tarot-card { width: 176px; height: 278px; transform: rotateX(8deg); padding: 8px; background: linear-gradient(160deg, #fff3dc, #efe6d2);
  box-shadow: 0 0 0 3px #f2d79a, 0 0 0 7px #1b1410, 0 0 0 9px #e5533c, 0 0 50px rgba(229,83,60,.6), 0 30px 40px rgba(0,0,0,.55); animation: chariot 2.6s ease-in-out infinite; }
@keyframes chariot { 50% { box-shadow: 0 0 0 3px #f2d79a, 0 0 0 7px #1b1410, 0 0 0 9px #ff7a55, 0 0 90px rgba(255,122,85,.9), 0 30px 40px rgba(0,0,0,.55); } }
.tarot.main .tc-face { border-width: 2px; background: radial-gradient(ellipse at 50% 45%, #fffaf0, #ecdcbc 80%); }
.tarot.main .tc-no { font-size: 30px; }
.tarot.main .tc-face svg { width: 130px; height: 140px; }
.tarot.main .tc-en { font-size: 13px; }
.tarot.main:hover .tarot-card, .tarot.main:focus-visible .tarot-card { transform: rotateX(0) translateY(-14px) scale(1.06); }
.tarot.main .tarot-label { margin-top: 18px; flex-direction: row; gap: 10px; padding: 12px 34px; border-radius: 4px; background: linear-gradient(180deg, #ff6a48, #c63a26); box-shadow: 0 0 0 2px #f2d79a, 0 5px 0 #6e1d14, 0 10px 24px rgba(0,0,0,.5), 0 0 30px rgba(229,83,60,.6); clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%); }
.tarot.main .tarot-label b { white-space: nowrap; font-size: 28px; font-weight: 900; color: #fff6ea; text-shadow: 0 2px 0 #6e1d14; letter-spacing: 3px; }
.tarot.main .tarot-label small { font-family: var(--display); font-size: 12px; font-weight: 800; letter-spacing: 2px; color: #ffe2d4; padding: 3px 8px; border: 1px solid rgba(255,226,212,.6); border-radius: 3px; }
.tarot.main::before { content: ""; position: absolute; left: 50%; top: 140px; width: 380px; height: 380px; margin: -190px 0 0 -190px; border-radius: 50%; pointer-events: none;
  background: repeating-conic-gradient(rgba(239,230,210,.14) 0 2deg, transparent 2deg 15deg); -webkit-mask: radial-gradient(circle, transparent 40%, #000 41%, #000 60%, transparent 61%); mask: radial-gradient(circle, transparent 40%, #000 41%, #000 60%, transparent 61%); animation: spin 40s linear infinite; }

/* 브랜드 타이포 (비대칭 세로 로고) */
.brand { position: absolute; left: 40px; top: 40px; z-index: 6; pointer-events: none; display: flex; gap: 14px; }
.brand-no { writing-mode: vertical-rl; font-family: var(--display); font-size: 13px; font-weight: 800; letter-spacing: 6px; color: #c9a45c; border-left: 1px solid rgba(201,164,92,.5); padding-left: 8px; height: 560px; }
.brand-title { margin: 0; writing-mode: vertical-rl; text-orientation: upright; font-family: var(--display); font-weight: 900; font-size: 92px; line-height: .9; letter-spacing: -6px; color: #efe6d2;
  text-shadow: 5px 5px 0 #e5533c, 10px 10px 0 rgba(8,23,26,.9), 0 0 40px rgba(239,230,210,.25); }
.brand-sub { writing-mode: vertical-rl; font-family: "Nanum Myeongjo", "Noto Serif KR", serif; font-weight: 800; font-size: 22px; line-height: 1.5; letter-spacing: 6px; color: #f2d79a; margin-top: 20px; text-shadow: 0 2px 8px #000; }

.hud { position: absolute; top: 22px; right: 30px; z-index: 8; display: flex; align-items: center; gap: 12px; }
#lobby .profile, #lobby .currency, #lobby .icon-btn { background: rgba(8,23,26,.78); border: 1px solid rgba(201,164,92,.55); border-radius: 4px; }
#lobby .icon-btn { border-radius: 4px; }
#lobby .profile { display: flex; align-items: center; gap: 12px; padding: 6px 16px 6px 6px; }
#lobby .avatar { width: 40px; height: 40px; border-radius: 3px; background: radial-gradient(circle at 50% 35%, #5fd0bb, #1d4d4f 70%); box-shadow: 0 0 0 2px #c9a45c; position: relative; }
#lobby .avatar::after { content: "☾"; position: absolute; inset: 0; display: grid; place-items: center; color: #efe6d2; font-size: 22px; }
.profile-name { font-size: 15px; color: #efe6d2; } .profile-name b { color: #ff8a68; margin-right: 4px; }
.exp { width: 130px; height: 5px; background: rgba(239,230,210,.15); margin-top: 6px; overflow: hidden; }
.exp i { display: block; height: 100%; background: linear-gradient(90deg, #5fd0bb, #e5533c); }
.currency { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 18px 0 8px; font-size: 16px; min-width: 100px; color: #efe6d2; }
.cur-ic { width: 24px; height: 24px; }
.gem-ic { background: linear-gradient(135deg, #e8fffa, #5fd0bb 50%, #1d4d4f); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.gold-ic { border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3c7, #c9a45c 55%, #7a5a20); }
.lobby-foot { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 8; display: flex; gap: 22px; font-size: 13px; color: rgba(239,230,210,.6); white-space: nowrap; }
.lobby-foot b { color: #f2d79a; }
.hint-key { opacity: .7; }

/* 대전 진입 워프 */
#warp { position: fixed; inset: 0; z-index: 600; pointer-events: none; visibility: hidden; }
#warp.in, #warp.out { visibility: visible; }
.warp-iris { position: absolute; inset: 0; background: radial-gradient(circle at var(--wx, 50%) var(--wy, 50%), #efe6d2 0, #ff7a55 3%, #c63a26 12%, #3a0e0a 30%, #08171a 55%);
  clip-path: circle(0 at var(--wx, 50%) var(--wy, 50%)); }
#warp.in .warp-iris { animation: irisIn .8s cubic-bezier(.7,0,.3,1) forwards; }
#warp.out .warp-iris { clip-path: circle(150% at 50% 50%); animation: irisOut .8s cubic-bezier(.7,0,.3,1) forwards; }
@keyframes irisIn { to { clip-path: circle(150% at var(--wx, 50%) var(--wy, 50%)); } }
@keyframes irisOut { to { opacity: 0; transform: scale(1.1); } }
.warp-sigil { position: absolute; left: 50%; top: 50%; width: 60vmin; height: 60vmin; margin: -30vmin 0 0 -30vmin; border-radius: 50%; opacity: 0;
  border: 3px solid rgba(239,230,210,.8); background: repeating-conic-gradient(rgba(239,230,210,.35) 0 3deg, transparent 3deg 22.5deg);
  -webkit-mask: radial-gradient(circle, transparent 55%, #000 56%); mask: radial-gradient(circle, transparent 55%, #000 56%); }
#warp.in .warp-sigil { animation: sigil .8s ease forwards; }
#warp.out .warp-sigil { opacity: 1; animation: sigilOut .7s ease forwards; }
@keyframes sigil { 40% { opacity: 0; } to { opacity: 1; transform: rotate(120deg) scale(1); } }
@keyframes sigilOut { to { opacity: 0; transform: rotate(220deg) scale(1.6); } }

/* ============================================================ 카드 */
.r-N  { --rc: #c9d1de; --frame: linear-gradient(145deg, #f6f8fb, #8e98aa 28%, #e6ebf2 52%, #6d7587 78%, #dfe4ec); }
.r-R  { --rc: #4aa8ff; --frame: linear-gradient(145deg, #dcf1ff, #2d7fe0 28%, #a4d6ff 52%, #1a4ea8 78%, #c4e6ff); }
.r-SR { --rc: #b77cff; --frame: linear-gradient(145deg, #fff0bf, #9b5cf0 25%, #ffd36b 50%, #6a2fb8 75%, #ffe9a8); }
.r-SSR { --rc: #ffd166; --frame: conic-gradient(from var(--ang), #ff9ad5, #ffd166, #fff3b0, #9dff9a, #7ad7ff, #c77dff, #ff9ad5); }
.r-SSR .c-frame, .r-SSR .u-frame { animation: foilspin 4s linear infinite; }
@keyframes foilspin { to { --ang: 360deg; } }

.card { position: relative; width: 10em; height: 14em; font-size: 14px; flex-shrink: 0; }
.c-frame { position: absolute; inset: 0; border-radius: .95em; padding: .3em; background: var(--frame); box-shadow: 0 .5em 1.2em rgba(0,0,0,.55); }
.c-inner { position: relative; width: 100%; height: 100%; border-radius: .7em; overflow: hidden; background: #120d2a; box-shadow: inset 0 0 0 1px rgba(255,255,255,.4); }
.r-SR .c-inner, .r-SSR .c-inner { box-shadow: inset 0 0 0 .12em #ffe9b0, inset 0 0 1em rgba(255,209,102,.35); }
.art { position: absolute; inset: 0; overflow: hidden; background: #1b1638; }
.art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.art .ph { position: absolute; inset: 0; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--elc) 85%, #fff), color-mix(in srgb, var(--elc) 45%, #120d2a) 45%, #120d2a 85%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.05) 0 2px, transparent 2px 10px); background-blend-mode: normal; }
.art .ph::before { content: ""; position: absolute; inset: 12% 20% 42%; border-radius: 50% 50% 40% 40%; background: radial-gradient(circle at 50% 40%, rgba(255,255,255,.35), transparent 70%); }
.art .ph span { position: relative; font-size: 3.4em; font-weight: 900; color: rgba(255,255,255,.88); text-shadow: 0 .06em 0 rgba(0,0,0,.35), 0 0 .4em rgba(255,255,255,.5); margin-bottom: 40%; }
.c-shade { position: absolute; inset: 0; z-index: 2; background: linear-gradient(180deg, rgba(10,6,30,.35) 0%, transparent 18%, transparent 44%, rgba(10,6,30,.88) 62%, rgba(10,6,30,.97) 100%); }
.c-foil { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.r-SSR .c-foil { background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.55) 45%, rgba(255,180,240,.35) 50%, transparent 62%); background-size: 260% 100%; animation: sweep 3.2s infinite; mix-blend-mode: overlay; }
.r-SR .c-foil { background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.25) 50%, transparent 60%); background-size: 260% 100%; animation: sweep 5s infinite; mix-blend-mode: overlay; }
.c-ribbon { position: absolute; z-index: 4; left: -.1em; right: -.1em; top: 55%; height: 1.9em; display: grid; place-items: center;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--rc) 55%, #120a30) 12%, color-mix(in srgb, var(--rc) 35%, #120a30) 50%, color-mix(in srgb, var(--rc) 55%, #120a30) 88%, transparent);
  border-top: 1px solid color-mix(in srgb, var(--rc) 70%, #fff); border-bottom: 1px solid color-mix(in srgb, var(--rc) 70%, #fff); }
.c-ribbon span { font-size: .92em; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 92%; text-shadow: 0 1px 3px #000; }
.c-desc { position: absolute; z-index: 4; left: .6em; right: .6em; top: calc(55% + 2.15em); bottom: 1.5em; font-size: .74em; line-height: 1.35; text-align: center; color: #e8e4ff; overflow: hidden; }
.c-desc .kw { color: var(--gold); font-weight: 800; margin-bottom: .1em; }
.c-desc .kw b { font-weight: 800; }
.c-cost { position: absolute; z-index: 6; top: -.5em; left: -.5em; width: 2.5em; height: 2.5em; display: grid; place-items: center; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d4f3ff, #3aa0ff 45%, #12409c 100%);
  box-shadow: 0 0 0 .14em #ffe9b0, 0 0 0 .26em #6b4510, 0 .2em .5em rgba(0,0,0,.6), 0 0 .8em rgba(74,168,255,.8); }
.c-cost span { font-size: 1.4em; font-weight: 900; color: #fff; text-shadow: 0 .06em 0 #0a2a70, 0 0 .3em rgba(0,0,0,.6); }
.c-rar { position: absolute; z-index: 6; top: .45em; right: .55em; font-family: var(--display); font-weight: 900; font-size: .82em; letter-spacing: .05em;
  background: linear-gradient(180deg, #fff, var(--rc)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 1px 1px #000) drop-shadow(0 0 3px rgba(0,0,0,.8)); }
.r-SSR .c-rar { background: linear-gradient(90deg, #ff9ad5, #ffe08a, #9dff9a, #7ad7ff); -webkit-background-clip: text; background-clip: text; font-size: .95em; }
.c-el, .u-el { position: absolute; z-index: 6; display: grid; place-items: center; border-radius: 50%; color: #fff;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--elc) 40%, #fff), var(--elc) 60%, color-mix(in srgb, var(--elc) 60%, #000));
  box-shadow: 0 0 0 .12em #ffe9b0, 0 .15em .4em rgba(0,0,0,.6), 0 0 .6em var(--elc); }
.c-el { top: 2.35em; left: -.2em; width: 1.75em; height: 1.75em; font-size: .9em; }
.unknown { filter: grayscale(.5); }
.stat { position: absolute; z-index: 6; bottom: -.45em; width: 2.4em; height: 2.4em; display: grid; place-items: center; }
.stat span { position: relative; font-size: 1.3em; font-weight: 900; color: #fff; -webkit-text-stroke: .08em rgba(30,10,0,.7); paint-order: stroke fill; text-shadow: 0 .06em 0 rgba(0,0,0,.6); }
.stat.atk { left: -.4em; background: linear-gradient(160deg, #fff0b8, #f3a42b 50%, #a25a00); clip-path: polygon(50% 0, 100% 22%, 100% 68%, 50% 100%, 0 68%, 0 22%); }
.stat.atk::before { content: ""; position: absolute; inset: .14em; background: radial-gradient(circle at 50% 30%, #ffc04d, #c96a00); clip-path: polygon(50% 0, 100% 22%, 100% 68%, 50% 100%, 0 68%, 0 22%); }
.stat.hp { right: -.4em; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffd0d8, #ff3d5f 45%, #8a0a24); box-shadow: 0 0 0 .12em #ffe9b0, 0 .15em .4em rgba(0,0,0,.6); }
.stat.hp.hurt span { color: #ffd0d0; text-shadow: 0 0 .3em #ff0030; }
.c-spell { position: absolute; z-index: 6; bottom: .35em; left: 50%; transform: translateX(-50%); font-size: .72em; font-weight: 800; padding: .15em .8em; border-radius: 999px;
  color: #dff8ff; background: linear-gradient(90deg, #1b6f8f, #2aa4c8); box-shadow: 0 0 0 1px #bff0ff; }
.t-spell .c-inner { box-shadow: inset 0 0 0 .12em #9feaff, inset 0 0 1.4em rgba(80,220,255,.35); }
.card.big { font-size: 24px; }
.card.hero { font-size: 21px; }
.card.dex { font-size: 14px; }

/* ============================================================ 전투 */
#battle .battle-top { position: absolute; top: 14px; right: 24px; display: flex; gap: 10px; z-index: 40; }
.arena { position: absolute; left: 300px; top: 70px; width: 1000px; height: 620px; border-radius: 30px;
  background: radial-gradient(ellipse 60% 45% at 50% 50%, rgba(255,233,176,.10), transparent 70%), linear-gradient(180deg, rgba(150,30,80,.55) 0%, rgba(70,26,110,.42) 46%, rgba(30,22,80,.5) 50%, rgba(40,60,160,.42) 54%, rgba(24,90,200,.55) 100%), repeating-linear-gradient(90deg, rgba(255,255,255,.025) 0 1px, transparent 1px 60px);
  box-shadow: 0 0 80px rgba(139,92,246,.22), inset 0 0 90px rgba(0,0,0,.55), 0 30px 60px rgba(0,0,0,.45); }
.arena-frame { position: absolute; inset: 0; border-radius: inherit; padding: 2px; pointer-events: none; z-index: 1;
  background: linear-gradient(180deg, #ffe9b0, #b8812a 30%, #5b3a10 50%, #b8812a 70%, #ffe9b0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.arena::before { content: ""; position: absolute; inset: 10px; border-radius: 22px; border: 1px solid rgba(255,233,176,.15); pointer-events: none; }
.corner { position: absolute; width: 22px; height: 22px; transform: rotate(45deg); background: linear-gradient(135deg, #fff3c7, #c48a2c); box-shadow: 0 0 12px rgba(245,201,106,.7); }
.corner.tl { left: 14px; top: 14px; } .corner.tr { right: 14px; top: 14px; } .corner.bl { left: 14px; bottom: 14px; } .corner.br { right: 14px; bottom: 14px; }
.arena-half { position: absolute; left: 0; right: 0; height: 50%; pointer-events: none; }
.magic-circle { position: absolute; left: 50%; top: 50%; width: 560px; height: 560px; margin: -280px 0 0 -280px; border-radius: 50%; pointer-events: none; opacity: .5;
  border: 2px solid rgba(245,201,106,.18);
  background: repeating-conic-gradient(rgba(245,201,106,.1) 0 1deg, transparent 1deg 10deg);
  -webkit-mask: radial-gradient(circle, transparent 0 58%, #000 58.5% 62%, transparent 62.5% 80%, #000 80.5% 100%); mask: radial-gradient(circle, transparent 0 58%, #000 58.5% 62%, transparent 62.5% 80%, #000 80.5% 100%);
  animation: spin 90s linear infinite; }
.lane { position: absolute; left: 40px; right: 40px; height: 190px; z-index: 2; border-radius: 22px;
  background: radial-gradient(ellipse 70% 60% at 50% 55%, rgba(255,255,255,.07), transparent 75%); }
.lane::after { content: ""; position: absolute; left: 10%; right: 10%; bottom: 20px; height: 26px; border-radius: 50%; background: radial-gradient(ellipse, rgba(0,0,0,.35), transparent 70%); z-index: -1; }
.lane.enemy { top: 32px; } .lane.me { top: 400px; }
.field { display: flex; justify-content: center; align-items: center; gap: 18px; height: 100%; }
.lane-empty { font-size: 16px; color: rgba(233,227,255,.4); letter-spacing: 1px; }
#battle.aiming .lane.enemy { background: radial-gradient(ellipse 70% 60% at 50% 55%, rgba(255,77,109,.14), transparent 75%); }

.divider { position: absolute; left: 0; right: 0; top: 310px; height: 0; z-index: 3; }
.div-line { position: absolute; left: 30px; right: 30px; top: -1px; height: 2px; background: linear-gradient(90deg, transparent, rgba(255,233,176,.9) 20%, #fff3c7 50%, rgba(255,233,176,.9) 80%, transparent); box-shadow: 0 0 14px rgba(245,201,106,.7); }
.emblem { position: absolute; left: 50%; top: -44px; width: 88px; height: 88px; margin-left: -44px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 35%, #3a2a85, #140e34 75%); box-shadow: 0 0 0 3px #f5c96a, 0 0 0 7px rgba(20,14,52,.9), 0 0 0 8px rgba(245,201,106,.5), 0 0 30px rgba(245,201,106,.5); }
.emblem small { font-family: var(--display); font-size: 10px; letter-spacing: 3px; color: var(--gold); }
.emblem b { font-family: var(--display); font-size: 34px; line-height: 1; color: #fff; text-shadow: 0 0 10px rgba(255,233,176,.8); }
.ticker { position: absolute; left: 50%; top: 52px; transform: translateX(-50%); max-width: 640px; height: 30px; line-height: 30px; padding: 0 18px; border-radius: 999px; font-size: 14px;
  color: #e3dcff; background: rgba(8,5,22,.55); border: 1px solid rgba(255,255,255,.08); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticker:empty { display: none; }

/* 리더 */
.col-left, .col-right { position: absolute; top: 70px; width: 260px; height: 620px; z-index: 5; }
.col-left { left: 22px; } .col-right { right: 22px; }
.leader { position: absolute; left: 0; right: 0; }
.leader.enemy { top: 6px; } .leader.me { bottom: 6px; }
.leader-plate { position: relative; height: 236px; display: flex; flex-direction: column; align-items: center; }
.portrait { position: relative; width: 168px; height: 168px; margin-top: 10px; border-radius: 50%; cursor: default; transition: transform .2s; }
.portrait .ring { position: absolute; inset: -9px; border-radius: 50%;
  background: conic-gradient(from 200deg, #fff3c7, #b8812a, #ffe9b0, #8a5a12, #fff3c7, #b8812a, #ffe9b0);
  -webkit-mask: radial-gradient(circle, transparent 0 calc(50% - 9px), #000 calc(50% - 8px)); mask: radial-gradient(circle, transparent 0 calc(50% - 9px), #000 calc(50% - 8px));
  box-shadow: 0 0 30px rgba(245,201,106,.4); }
.leader-plate.enemy .portrait .ring { background: conic-gradient(from 200deg, #ffd0dc, #a11d4f, #ffe9b0, #5a0a28, #ffd0dc, #a11d4f, #ffe9b0); }
.portrait .crest { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; box-shadow: inset 0 0 30px rgba(0,0,0,.6); }
.portrait .crest svg { width: 100%; height: 100%; display: block; }
.portrait::after { content: ""; position: absolute; inset: -22px; border-radius: 50%; z-index: -1;
  background: radial-gradient(circle, rgba(74,168,255,.35), transparent 70%); }
.leader-plate.enemy .portrait::after { background: radial-gradient(circle, rgba(255,77,109,.35), transparent 70%); }
.portrait.targetable { cursor: crosshair; transform: scale(1.04); }
.portrait.targetable .reticle, .unit.targetable .reticle { display: block; }
.reticle { display: none; position: absolute; inset: -16px; border-radius: 50%; border: 3px dashed var(--crimson); box-shadow: 0 0 24px var(--crimson), inset 0 0 24px rgba(255,77,109,.5); animation: spin 6s linear infinite; z-index: 8; pointer-events: none; }
.hp-orb { position: absolute; left: 50%; margin-left: 42px; top: 118px; width: 76px; height: 76px; border-radius: 50%; overflow: hidden; z-index: 4;
  background: radial-gradient(circle at 50% 40%, #3a0a1a, #14030a); box-shadow: 0 0 0 3px #ffe9b0, 0 0 0 6px #6b4510, 0 6px 16px rgba(0,0,0,.6), 0 0 22px rgba(255,61,95,.5); }
.hp-orb .liquid { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(180deg, #ff7a93, #e0163f 50%, #8a0a24); transition: height .5s ease; }
.hp-orb .liquid::before { content: ""; position: absolute; left: -50%; top: -8px; width: 200%; height: 16px; border-radius: 45%; background: #ff7a93; animation: wave 3s linear infinite; opacity: .8; }
.hp-orb::after { content: ""; position: absolute; left: 14px; top: 10px; width: 26px; height: 14px; border-radius: 50%; background: rgba(255,255,255,.4); transform: rotate(-25deg); }
.hp-orb b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 30px; font-weight: 900; color: #fff; -webkit-text-stroke: 2px rgba(60,0,15,.6); paint-order: stroke fill; z-index: 2; }
.hp-orb.low { animation: lowhp 1s infinite; }
@keyframes lowhp { 50% { box-shadow: 0 0 0 3px #ffe9b0, 0 0 0 6px #6b4510, 0 0 40px #ff1744; } }
@keyframes wave { to { transform: translateX(25%); } }
.nameplate { margin-top: 18px; min-width: 190px; height: 46px; padding: 0 28px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  clip-path: polygon(0 50%, 14px 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 14px 100%);
  background: linear-gradient(180deg, rgba(74,168,255,.55), rgba(20,40,110,.9)); }
.leader-plate.enemy .nameplate { background: linear-gradient(180deg, rgba(255,77,109,.55), rgba(90,10,40,.9)); }
.nameplate small { font-family: var(--display); font-size: 10px; letter-spacing: 4px; color: var(--gold-2); }
.nameplate b { font-size: 18px; font-weight: 800; }
.leader.me .leader-plate { flex-direction: column-reverse; justify-content: flex-start; }
.leader.me .nameplate { margin: 0 0 18px; }
.leader.me .hp-orb { top: auto; bottom: 0; }

/* 마나 */
.mana-panel { position: absolute; left: 0; right: 0; padding: 16px 18px; border-radius: 20px; border: 1px solid var(--line); background: var(--glass), rgba(14,10,38,.7); backdrop-filter: blur(6px); box-shadow: 0 12px 28px rgba(0,0,0,.35); }
.mana-panel.enemy { top: 60px; } .mana-panel.me { bottom: 6px; }
.mana-head { display: flex; align-items: center; justify-content: space-between; }
.mana-head small { font-family: var(--display); font-weight: 800; letter-spacing: 4px; font-size: 13px; color: #9fd4ff; }
.mana-num b { font-size: 40px; font-weight: 900; color: #e6f7ff; text-shadow: 0 0 14px #2b8cff, 0 0 4px #2b8cff; }
.mana-num span { font-size: 18px; color: #8fb6e6; margin-left: 4px; font-weight: 700; }
.crystals { display: flex; gap: 4px; margin: 8px 0 12px; }
.crystal { flex: 1; height: 26px; clip-path: polygon(50% 0, 100% 28%, 82% 100%, 18% 100%, 0 28%); background: rgba(255,255,255,.1); transition: background .3s; }
.crystal.full { background: linear-gradient(180deg, #e8faff 0%, #7fd0ff 35%, #2b8cff 70%, #1552b8); }
.crystal.used { background: linear-gradient(180deg, rgba(127,208,255,.35), rgba(43,140,255,.18)); }
.counts { display: flex; gap: 18px; font-size: 18px; font-weight: 800; color: #e3dcff; }
.counts span { display: inline-flex; align-items: center; gap: 8px; }
.ic-deck, .ic-hand, .ic-fat { display: inline-block; width: 16px; height: 22px; border-radius: 3px; border: 2px solid var(--gold); background: #3b2a7a; box-shadow: 3px -3px 0 -1px #2a1d5c, 3px -3px 0 1px var(--gold); }
.ic-hand { box-shadow: none; transform: rotate(-12deg); border-color: #9fd4ff; background: #20306e; position: relative; }
.ic-hand::after { content: ""; position: absolute; left: 4px; top: -4px; width: 14px; height: 20px; border-radius: 3px; border: 2px solid #9fd4ff; background: #20306e; transform: rotate(22deg); }
.ic-fat { border-color: var(--crimson); background: #5a0a28; box-shadow: none; }

/* 턴 종료 버튼 */
.end-btn { position: absolute; left: 0; right: 0; top: 50%; height: 92px; margin-top: -46px; border: 0; border-radius: 999px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #fff3c7 0%, #ffd36b 40%, #e99a1c 100%); color: #2b1700;
  box-shadow: 0 0 0 2px #fff3c7 inset, 0 0 0 4px #6b4510, 0 0 0 6px rgba(245,201,106,.6), 0 8px 0 #6b4510, 0 0 40px rgba(255,200,80,.45);
  transition: transform .15s, filter .15s; }
.end-btn:hover:not(:disabled) { transform: translateY(-3px); filter: brightness(1.08); }
.end-btn:active:not(:disabled) { transform: translateY(3px); }
.end-main { font-size: 30px; font-weight: 900; letter-spacing: 2px; }
.end-sub { font-family: var(--display); font-size: 12px; font-weight: 800; letter-spacing: 4px; opacity: .7; }
.end-btn.glow { animation: ctaGlow2 1.1s ease-in-out infinite; }
@keyframes ctaGlow2 { 50% { box-shadow: 0 0 0 2px #fff3c7 inset, 0 0 0 4px #6b4510, 0 0 0 6px rgba(245,201,106,.9), 0 8px 0 #6b4510, 0 0 80px rgba(255,200,80,.95); } }
.end-btn:disabled { cursor: default; }
.end-btn.enemy-turn { background: linear-gradient(180deg, #8a93c9, #4b548f 60%, #2c3266); color: #e3e7ff; box-shadow: 0 0 0 2px rgba(255,255,255,.3) inset, 0 0 0 4px #1c2048, 0 8px 0 #1c2048; }

/* 손패 */
.hand { position: absolute; left: 0; top: 0; width: 1600px; height: 900px; pointer-events: none; z-index: 30; }
.hand-slot { position: absolute; width: 140px; height: 196px; margin-left: -70px; bottom: calc(34px - var(--dy)); transform: rotate(var(--rot)); transform-origin: 50% 100%; pointer-events: auto; cursor: pointer; outline: none; }
.hand-slot .card { transition: transform .22s cubic-bezier(.2,.9,.3,1.2), filter .2s; transform-origin: 50% 100%; }
.hand-slot:hover, .hand-slot:focus-visible, .hand-slot.targeting { z-index: 100 !important; }
.hand-slot:hover .card, .hand-slot:focus-visible .card { transform: rotate(calc(var(--rot) * -1)) translateY(-96px) scale(1.42); }
.hand-slot.targeting .card { transform: rotate(calc(var(--rot) * -1)) translateY(-80px) scale(1.3); }
.hand-slot:not(.playable) .card { filter: brightness(.72) saturate(.75); }
.hand-slot:not(.playable):hover .card { filter: brightness(.9) saturate(.85); }
.hand-slot.playable .c-frame { box-shadow: 0 0 0 .14em #5dffa0, 0 0 1.1em rgba(61,255,134,.85), 0 .5em 1.2em rgba(0,0,0,.55); }
.hand-slot.targeting .c-frame { box-shadow: 0 0 0 .16em #fff, 0 0 1.4em var(--gold); }
.hand-slot.nope .card { animation: nope .3s; }
@keyframes nope { 25% { translate: -8px 0; } 75% { translate: 8px 0; } }

.enemy-hand { position: absolute; left: 0; top: 0; width: 1600px; height: 70px; z-index: 6; pointer-events: none; }
.card-back { position: absolute; top: -46px; width: 66px; height: 92px; margin-left: -33px; border-radius: 8px; transform: rotate(var(--rot)) translateY(var(--dy)); transform-origin: 50% 0;
  border: 2px solid #e8c37a; box-shadow: 0 6px 12px rgba(0,0,0,.6), inset 0 0 0 3px #2a1d5c, inset 0 0 0 4px rgba(232,195,122,.5);
  background: radial-gradient(circle at 50% 60%, rgba(255,233,176,.45), transparent 32%), repeating-linear-gradient(45deg, #3b2a7a 0 6px, #2a1d5c 6px 12px); }
.back-count { position: absolute; left: 50%; top: 52px; transform: translateX(-50%); min-width: 40px; height: 24px; padding: 0 10px; border-radius: 999px; text-align: center; line-height: 24px;
  font-size: 13px; font-weight: 800; background: rgba(90,10,40,.85); border: 1px solid rgba(255,208,220,.5); }

/* 유닛 */
.unit { position: relative; width: 124px; height: 162px; font-size: 13px; cursor: pointer; transition: transform .18s; flex-shrink: 0; outline: none; }
.u-body { position: absolute; inset: 0; }
.u-frame { position: absolute; inset: 0; padding: .3em; background: var(--frame); border-radius: 50% 50% 1.1em 1.1em / 34% 34% 1.1em 1.1em; box-shadow: 0 .6em 1.2em rgba(0,0,0,.6); transition: box-shadow .2s; }
.u-inner { position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: 50% 50% .85em .85em / 33% 33% .85em .85em; box-shadow: inset 0 0 0 1px rgba(255,255,255,.4); }
.u-inner .art .ph span { font-size: 3.2em; margin-bottom: 10%; }
.u-el { top: -.55em; left: 50%; margin-left: -.95em; width: 1.9em; height: 1.9em; font-size: .9em; }
.unit .stat { bottom: -.6em; }
.unit:hover, .unit:focus-visible { transform: translateY(-4px) scale(1.05); z-index: 10; }
.unit.ready .u-frame { box-shadow: 0 0 0 .18em #5dffa0, 0 0 1.3em rgba(61,255,134,.9), 0 .6em 1.2em rgba(0,0,0,.6); animation: readyPulse 1.4s ease-in-out infinite; }
@keyframes readyPulse { 50% { box-shadow: 0 0 0 .18em #b8ffd4, 0 0 2em rgba(61,255,134,1), 0 .6em 1.2em rgba(0,0,0,.6); } }
.unit.selected { transform: translateY(-16px) scale(1.1); z-index: 20; }
.unit.selected .u-frame { box-shadow: 0 0 0 .2em #fff, 0 0 2em var(--gold), 0 1em 1.6em rgba(0,0,0,.6); animation: none; }
.unit.targetable { cursor: crosshair; }
.unit.targetable .u-frame { box-shadow: 0 0 0 .18em var(--crimson), 0 0 1.4em var(--crimson); }
.unit .reticle { inset: -12px -10px; border-radius: 50% 50% 22px 22px / 34% 34% 22px 22px; animation: pulseRet 1s ease-in-out infinite; }
@keyframes pulseRet { 50% { transform: scale(1.05); opacity: .7; } }
.unit.sleeping .art { filter: saturate(.55) brightness(.75); }
.zzz { position: absolute; z-index: 7; top: 22%; right: 10%; font-weight: 900; font-size: 1.3em; color: #cfe0ff; text-shadow: 0 0 6px #000; animation: floatZ 2s ease-in-out infinite; font-style: italic; }
@keyframes floatZ { 50% { transform: translateY(-6px); opacity: .6; } }
.unit.taunt .u-body::before { content: ""; position: absolute; inset: -12px -14px -6px; z-index: -1;
  background: linear-gradient(180deg, #f2f5fb, #8c95aa 45%, #4b5266); clip-path: polygon(50% 0, 100% 12%, 100% 62%, 50% 100%, 0 62%, 0 12%);
  filter: drop-shadow(0 0 6px rgba(255,255,255,.5)); }
.unit.shielded .u-body::after { content: ""; position: absolute; inset: -7px; z-index: 7; pointer-events: none; border-radius: 50% 50% 26px 26px / 36% 36% 26px 26px;
  border: 3px solid rgba(255,247,179,.95); background: radial-gradient(ellipse at 50% 30%, rgba(255,247,179,.25), transparent 70%); box-shadow: 0 0 22px #fff3a0, inset 0 0 22px rgba(255,247,179,.6); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.unit.summon { animation: summon .6s cubic-bezier(.2,1.5,.4,1); }
@keyframes summon { from { transform: translateY(-80px) scale(1.7); opacity: 0; filter: brightness(3); } }
.shake { animation: shake .38s; }
@keyframes shake { 20% { translate: -8px 0; rotate: -2deg; } 40% { translate: 8px 0; rotate: 2deg; } 60% { translate: -6px 0; } 80% { translate: 4px 0; } }
.dying { animation: dying .42s forwards !important; }
@keyframes dying { to { transform: scale(.4) rotate(14deg); opacity: 0; filter: brightness(3) blur(3px); } }

/* 툴팁 */
#tooltip { position: absolute; z-index: 120; width: 240px; pointer-events: none; opacity: 0; transform: scale(.94); transition: opacity .15s, transform .15s; }
#tooltip.show { opacity: 1; transform: none; }
.tt-label { text-align: center; margin-bottom: 14px; font-size: 16px; font-weight: 800; padding: 6px 0; border-radius: 999px; background: linear-gradient(90deg, transparent, rgba(255,77,109,.85), transparent); }
.tt-extra { margin-top: 20px; padding: 12px 14px; border-radius: 14px; background: rgba(10,7,28,.88); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: #ddd8f7; }
.tt-extra b { color: var(--gold); margin-right: 4px; }
.tt-el { color: color-mix(in srgb, var(--elc) 60%, #fff); font-weight: 800; }
.tt-extra .muted { color: var(--muted); }

#hint { position: absolute; left: 50%; top: 612px; transform: translateX(-50%) translateY(6px); z-index: 60; padding: 10px 22px; border-radius: 999px; font-size: 17px; font-weight: 700;
  background: rgba(10,7,28,.9); border: 1px solid rgba(255,208,220,.5); color: #ffe0e6; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; white-space: nowrap; }
#hint:empty { display: none; }
#hint.show { opacity: 1; transform: translateX(-50%); }
#lobby #hint { display: none; }

/* 기록 서랍 */
#log-drawer { position: absolute; top: 0; right: 0; width: 400px; height: 900px; z-index: 200; transform: translateX(105%); transition: transform .3s cubic-bezier(.2,.8,.2,1);
  background: linear-gradient(180deg, rgba(20,14,48,.96), rgba(10,7,28,.96)); border-left: 1px solid rgba(245,201,106,.4); box-shadow: -20px 0 50px rgba(0,0,0,.5); display: flex; flex-direction: column; }
#log-drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 22px 14px; font-size: 20px; border-bottom: 1px solid var(--line); }
#log { flex: 1; overflow-y: auto; padding: 12px 22px 22px; font-size: 15px; line-height: 1.55; }
#log div { padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
#log .turn { color: var(--gold); font-weight: 800; margin-top: 8px; }
#log .me { color: #bfe9ff; } #log .enemy { color: #ffc2cc; } #log .bad { color: #ff8a8a; } #log .muted { color: var(--muted); }

/* 턴 배너 */
#turn-banner { position: absolute; inset: 0; pointer-events: none; z-index: 150; opacity: 0; }
.tb-ribbon { position: absolute; left: 0; right: 0; top: 380px; height: 140px; margin-top: -70px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(90deg, transparent, rgba(30,80,190,.9) 22%, rgba(40,100,220,.95) 50%, rgba(30,80,190,.9) 78%, transparent);
  border-top: 2px solid rgba(255,233,176,.8); border-bottom: 2px solid rgba(255,233,176,.8); }
#turn-banner.enemy .tb-ribbon { background: linear-gradient(90deg, transparent, rgba(150,20,60,.9) 22%, rgba(190,30,75,.95) 50%, rgba(150,20,60,.9) 78%, transparent); }
.tb-ribbon b { font-size: 66px; font-weight: 900; letter-spacing: 12px; text-shadow: 0 4px 0 rgba(0,0,0,.35), 0 0 30px rgba(255,255,255,.6); }
.tb-ribbon small { font-family: var(--display); font-size: 16px; letter-spacing: 12px; color: var(--gold-2); }
#turn-banner.show { animation: bannerFade 1.4s ease forwards; }
#turn-banner.show .tb-ribbon { animation: bannerRibbon 1.4s cubic-bezier(.2,.9,.2,1) forwards; }
#turn-banner.show .tb-ribbon b { animation: bannerText 1.4s cubic-bezier(.2,.9,.2,1) forwards; }
@keyframes bannerFade { 0% { opacity: 0; } 12% { opacity: 1; } 78% { opacity: 1; } 100% { opacity: 0; } }
@keyframes bannerRibbon { 0% { transform: scaleY(0); } 14% { transform: scaleY(1); } 100% { transform: scaleY(1); } }
@keyframes bannerText { 0% { transform: translateX(-120px); opacity: 0; } 20% { transform: none; opacity: 1; } 80% { transform: translateX(20px); } 100% { transform: translateX(140px); opacity: 0; } }

/* 떠오르는 숫자 (스테이지 밖, 화면 좌표) */
#float-layer { position: fixed; inset: 0; pointer-events: none; z-index: 510; }
.floater { position: absolute; transform: translate(-50%, -50%); font-weight: 900; font-size: calc(46px * var(--s)); animation: floatup 1.2s ease-out forwards; white-space: nowrap;
  -webkit-text-stroke: calc(2px * var(--s)) #2a0010; paint-order: stroke fill; font-family: var(--font); }
.floater.dmg { color: #ff4d6d; text-shadow: 0 0 14px #ff0033; }
.floater.heal { color: #6bff9e; text-shadow: 0 0 14px #00ff66; }
.floater.buff { color: #7ad7ff; font-size: calc(30px * var(--s)); }
.floater.shield { color: #fff7b3; font-size: calc(28px * var(--s)); }
.floater.adv { color: #ffd166; font-size: calc(26px * var(--s)); text-shadow: 0 0 14px #ff9900; }
.floater.dis { color: #b9c2e6; font-size: calc(22px * var(--s)); }
@keyframes floatup { 0% { opacity: 0; transform: translate(-50%, -20%) scale(.5); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.3); }
  30% { transform: translate(-50%, -60%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -170%) scale(1); } }

/* ============================================================ 모달 */
#modal { position: absolute; inset: 0; z-index: 300; display: grid; place-items: center; background: rgba(5,3,15,.68); backdrop-filter: blur(6px); }
#modal.hidden { display: none; }
.modal-box { position: relative; min-width: 560px; max-width: 760px; max-height: 800px; overflow: auto; padding: 40px 44px 34px; border-radius: 26px;
  background: radial-gradient(ellipse at 50% 0%, rgba(139,92,246,.35), transparent 60%), linear-gradient(170deg, #241a56, #110b2a);
  border: 1px solid rgba(245,201,106,.5); box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 60px rgba(139,92,246,.3); animation: pop .25s cubic-bezier(.2,1.4,.4,1); }
.modal-box.wide { width: 1140px; max-width: 1140px; }
@keyframes pop { from { transform: scale(.92); opacity: 0; } }
.modal-close { position: absolute; top: 18px; right: 18px; }
.modal-box h2 { margin: 0 0 22px; font-size: 30px; font-weight: 900; }
.modal-box h2 .count { font-size: 18px; color: var(--gold); margin-left: 8px; font-weight: 700; }
.modal-foot { color: var(--muted); font-size: 15px; margin: 18px 0 0; }
.modal-actions { display: flex; justify-content: center; gap: 14px; margin-top: 28px; }
.rules-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.rule { padding: 20px 22px; border-radius: 18px; background: var(--glass); border: 1px solid var(--line); }
.rule i { font-style: normal; font-size: 28px; display: block; margin-bottom: 8px; }
.rule > b { font-size: 19px; display: block; margin-bottom: 6px; color: var(--gold-2); }
.rule p { margin: 0; font-size: 15px; line-height: 1.6; color: #d4cff2; }
.rule p b { color: var(--gold); }
.dex-grid { display: grid; grid-template-columns: repeat(auto-fill, 152px); gap: 26px 22px; justify-content: center; padding: 10px 6px 16px; }
.dex-item { border-radius: 14px; transition: transform .18s; outline: none; }
.dex-item:hover, .dex-item:focus-visible { transform: translateY(-6px) scale(1.04); }
.dex-item:focus-visible .c-frame { box-shadow: 0 0 0 3px var(--gold); }
.empty-state { text-align: center; padding: 20px 10px; }
.empty-state .empty-ic { font-size: 64px; margin-bottom: 10px; filter: drop-shadow(0 0 20px rgba(199,125,255,.6)); }
.empty-state b, .empty-state h2 { display: block; font-size: 28px; margin: 0 0 8px; }
.empty-state p { font-size: 18px; color: #e0dbff; margin: 0 0 10px; line-height: 1.6; }
.empty-state small { color: var(--muted); font-size: 14px; display: block; margin-bottom: 14px; }
.empty-state .tile-badge { position: static; }
.warn { text-align: left; font-size: 13px; color: #ffb3b3; background: rgba(255,0,0,.08); border-radius: 10px; padding: 10px 12px; margin-top: 12px; }
.set-row { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; border-bottom: 1px solid var(--line); font-size: 18px; gap: 30px; }
.segs { display: flex; gap: 8px; }
.seg { height: 44px; min-width: 90px; padding: 0 18px; border-radius: 12px; cursor: pointer; font-size: 16px; font-weight: 700; background: rgba(255,255,255,.06); border: 1px solid var(--line); transition: background .15s; }
.seg:hover { background: rgba(255,255,255,.12); }
.seg.on { background: linear-gradient(180deg, rgba(245,201,106,.35), rgba(245,201,106,.15)); border-color: var(--gold); color: #fff3c7; }
.seg.danger { border-color: rgba(255,77,109,.6); color: #ffc2cc; }

/* ============================================================ 결과 */
#result { z-index: 250; background: radial-gradient(ellipse at 50% 45%, rgba(40,28,100,.85), rgba(5,3,15,.95) 70%); }
.res-rays { position: absolute; left: 50%; top: 42%; width: 1800px; height: 1800px; margin: -900px 0 0 -900px;
  background: repeating-conic-gradient(rgba(255,214,110,.16) 0 6deg, transparent 6deg 18deg); -webkit-mask: radial-gradient(circle, #000, transparent 60%); mask: radial-gradient(circle, #000, transparent 60%); animation: spin 40s linear infinite; }
.res-lose .res-rays, .res-draw .res-rays { background: repeating-conic-gradient(rgba(120,140,220,.1) 0 6deg, transparent 6deg 18deg); }
.res-box { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; width: 1000px; animation: pop .5s cubic-bezier(.2,1.4,.4,1); }
.res-big { font-family: var(--display); font-weight: 900; font-size: 150px; letter-spacing: 16px; line-height: 1;
  background: linear-gradient(180deg, #fffbe9, #ffd36b 50%, #b87414); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 6px 0 rgba(80,40,0,.6)) drop-shadow(0 0 40px rgba(255,200,80,.6)); }
.res-lose .res-big { background: linear-gradient(180deg, #e6ebff, #8a98d6 50%, #3d4a8a); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 6px 0 rgba(0,0,30,.6)) drop-shadow(0 0 30px rgba(100,120,220,.5)); }
.res-draw .res-big { background: linear-gradient(180deg, #fff, #bbb); -webkit-background-clip: text; background-clip: text; }
.res-ko { font-size: 40px; font-weight: 900; letter-spacing: 10px; margin: 10px 0 36px; }
.res-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 0 auto; max-width: 860px; }
.res-stats > div { padding: 18px; border-radius: 18px; background: var(--glass), rgba(14,10,38,.6); border: 1px solid var(--line); }
.res-stats small { display: block; color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.res-stats b { font-size: 30px; font-weight: 900; }
.res-actions { display: flex; justify-content: center; gap: 18px; margin-top: 40px; align-items: center; }

/* ============================================================ 테마: ARCANA 시그니처 팔레트 (청록 잉크 + 주홍 + 본색 + 황동) */
:root { --gold: #e0bd72; --gold-2: #f5e6c4; --violet: #3fb8a6; --crimson: #ff5a3c; --blue: #5fd0bb; --ink: #f3ede0; --muted: #a9b9b4; --line: rgba(224,189,114,.22);
  --glass: linear-gradient(160deg, rgba(239,230,210,.08), rgba(239,230,210,.02)); }
#stage { background: radial-gradient(ellipse 85% 65% at 50% 40%, #1f5157 0%, #10313a 42%, #071316 85%); }
.bg-rays { background: repeating-conic-gradient(from 0deg, rgba(239,230,210,.06) 0deg 3deg, transparent 3deg 15deg); }
.bg-hex { background: repeating-linear-gradient(60deg, rgba(224,189,114,.03) 0 1px, transparent 1px 46px), repeating-linear-gradient(-60deg, rgba(224,189,114,.03) 0 1px, transparent 1px 46px),
  radial-gradient(ellipse 60% 40% at 15% 100%, rgba(95,208,187,.16), transparent), radial-gradient(ellipse 50% 40% at 90% 0%, rgba(229,83,60,.16), transparent); }
.arena { background: radial-gradient(ellipse 60% 45% at 50% 50%, rgba(239,230,210,.07), transparent 70%),
  linear-gradient(180deg, rgba(150,40,26,.55) 0%, rgba(80,24,20,.4) 46%, rgba(10,30,34,.6) 50%, rgba(20,80,82,.45) 54%, rgba(30,110,104,.55) 100%),
  repeating-linear-gradient(90deg, rgba(239,230,210,.03) 0 1px, transparent 1px 60px);
  box-shadow: 0 0 80px rgba(95,208,187,.15), inset 0 0 90px rgba(0,0,0,.55), 0 30px 60px rgba(0,0,0,.45); }
.arena-frame { background: linear-gradient(180deg, #f5e6c4, #b88a3c 30%, #4a3010 50%, #b88a3c 70%, #f5e6c4); }
.magic-circle { border-color: rgba(239,230,210,.16); background: repeating-conic-gradient(rgba(239,230,210,.1) 0 1deg, transparent 1deg 10deg); }
.emblem { background: radial-gradient(circle at 50% 35%, #1f5157, #08171a 75%); box-shadow: 0 0 0 3px #e0bd72, 0 0 0 7px rgba(8,23,26,.9), 0 0 0 8px rgba(229,83,60,.7), 0 0 30px rgba(229,83,60,.4); }
.emblem b, .emblem small { font-family: var(--display); }
.ticker { background: rgba(8,23,26,.7); }
.leader-plate.me .portrait .ring { background: conic-gradient(from 200deg, #f5e6c4, #b88a3c, #5fd0bb, #1d4d4f, #f5e6c4, #b88a3c, #5fd0bb); }
.leader-plate.me .portrait::after { background: radial-gradient(circle, rgba(95,208,187,.35), transparent 70%); }
.leader-plate.enemy .portrait .ring { background: conic-gradient(from 200deg, #ffd8c8, #c63a26, #f5e6c4, #5a120a, #ffd8c8, #c63a26, #f5e6c4); }
.nameplate { background: linear-gradient(180deg, rgba(95,208,187,.55), rgba(16,52,56,.95)); }
.leader-plate.enemy .nameplate { background: linear-gradient(180deg, rgba(255,106,72,.6), rgba(90,18,10,.95)); }
.mana-panel { background: var(--glass), rgba(8,23,26,.78); border-color: rgba(224,189,114,.3); border-radius: 6px; }
.mana-head small { color: #8fe3d2; }
.mana-num b { color: #f0fffb; text-shadow: 0 0 14px #2bb39b, 0 0 4px #2bb39b; }
.mana-num span { color: #8fb9b0; }
.crystal.full { background: linear-gradient(180deg, #f0fffb 0%, #8fe3d2 35%, #2bb39b 70%, #146b5f); }
.crystal.used { background: linear-gradient(180deg, rgba(143,227,210,.35), rgba(43,179,155,.18)); }
.ic-hand, .ic-hand::after { border-color: #8fe3d2; background: #123c3c; }
.ic-deck { background: #4a1a12; }
.end-btn { background: linear-gradient(180deg, #ff8a68 0%, #e5533c 45%, #a8301f 100%); color: #fff6ea; border-radius: 6px;
  box-shadow: 0 0 0 2px #f5e6c4 inset, 0 0 0 4px #3a0e0a, 0 0 0 6px rgba(224,189,114,.7), 0 8px 0 #3a0e0a, 0 0 40px rgba(229,83,60,.45);
  clip-path: none; }
.end-btn .end-main { text-shadow: 0 2px 0 #6e1d14; }
@keyframes ctaGlow2 { 50% { box-shadow: 0 0 0 2px #f5e6c4 inset, 0 0 0 4px #3a0e0a, 0 0 0 6px rgba(224,189,114,1), 0 8px 0 #3a0e0a, 0 0 80px rgba(255,106,72,.95); } }
.end-btn.enemy-turn { background: linear-gradient(180deg, #4f7f80, #24494b 60%, #11292b); color: #cfe7e2; box-shadow: 0 0 0 2px rgba(239,230,210,.25) inset, 0 0 0 4px #08171a, 0 8px 0 #08171a; }
.tb-ribbon { background: linear-gradient(90deg, transparent, rgba(20,90,86,.92) 22%, rgba(30,120,112,.96) 50%, rgba(20,90,86,.92) 78%, transparent); border-color: rgba(245,230,196,.85); }
#turn-banner.enemy .tb-ribbon { background: linear-gradient(90deg, transparent, rgba(150,36,22,.92) 22%, rgba(200,58,38,.96) 50%, rgba(150,36,22,.92) 78%, transparent); }
.tb-ribbon b { font-family: "Nanum Myeongjo", var(--font); }
#turn-banner.show .tb-ribbon::before, #turn-banner.show .tb-ribbon::after { content: "✦"; position: absolute; top: 50%; margin-top: -24px; font-size: 36px; color: #f5e6c4; animation: spin 2s linear infinite; }
#turn-banner.show .tb-ribbon::before { left: 30%; } #turn-banner.show .tb-ribbon::after { right: 30%; }
.icon-btn { background: rgba(8,23,26,.75); border-color: rgba(224,189,114,.45); }
.btn-primary { background: linear-gradient(180deg, #ff8a68 0%, #e5533c 45%, #a8301f 100%); color: #fff6ea; text-shadow: 0 2px 0 #6e1d14; border-radius: 6px;
  box-shadow: 0 0 0 2px #f5e6c4 inset, 0 6px 0 #3a0e0a, 0 10px 30px rgba(0,0,0,.5), 0 0 40px rgba(229,83,60,.45); animation: none; }
.btn-ghost { border-radius: 6px; border-color: rgba(224,189,114,.55); }
.modal-box { border-radius: 8px; background: radial-gradient(ellipse at 50% 0%, rgba(95,208,187,.2), transparent 60%), linear-gradient(170deg, #12343a, #08171a); border-color: rgba(224,189,114,.6); box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 0 6px rgba(8,23,26,.8), 0 0 0 7px rgba(224,189,114,.3); }
.modal-box h2 { font-family: "Nanum Myeongjo", var(--font); }
.rule, .res-stats > div { border-radius: 6px; }
.rule > b { color: #ffb49c; }
.seg { border-radius: 4px; }
.seg.on { background: linear-gradient(180deg, rgba(229,83,60,.45), rgba(229,83,60,.2)); border-color: #ff8a68; color: #fff1e8; }
.slider { display: flex; align-items: center; gap: 14px; }
.slider input { width: 280px; accent-color: #e5533c; height: 6px; cursor: pointer; }
.slider output { min-width: 40px; text-align: right; font-weight: 800; color: #f5e6c4; }
#result { background: radial-gradient(ellipse at 50% 45%, rgba(20,70,72,.85), rgba(4,12,14,.96) 70%); }
.res-rays { background: repeating-conic-gradient(rgba(255,150,110,.16) 0 6deg, transparent 6deg 18deg); }
.res-big { background: linear-gradient(180deg, #fffaf0, #f5e6c4 40%, #ff8a68 75%, #c63a26); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 6px 0 rgba(60,10,5,.7)) drop-shadow(0 0 40px rgba(255,122,85,.5)); }
.res-lose .res-big { background: linear-gradient(180deg, #e8f5f2, #8fb9b0 50%, #2c5a58); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 6px 0 rgba(0,20,20,.6)); }
.res-ko { font-family: "Nanum Myeongjo", var(--font); }
#log-drawer { background: linear-gradient(180deg, rgba(12,40,44,.97), rgba(6,18,20,.97)); border-left-color: rgba(224,189,114,.5); }
.back-count { background: rgba(140,36,22,.9); }
.card-back { border-color: #e0bd72; box-shadow: 0 6px 12px rgba(0,0,0,.6), inset 0 0 0 3px #12343a, inset 0 0 0 4px rgba(224,189,114,.5);
  background: radial-gradient(circle at 50% 60%, rgba(239,230,210,.5), transparent 30%), repeating-linear-gradient(45deg, #1d4d4f 0 6px, #12343a 6px 12px); }
.arena::after { content: "VII"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-family: var(--display); font-weight: 900; font-size: 300px; color: rgba(239,230,210,.035); pointer-events: none; letter-spacing: 10px; }

/* ============================================================
 * 반응형 · 모바일 가로 · 인트로 · 화면 전환
 * 스테이지 높이는 900 고정, 너비는 화면비에 맞춰 1600~2160으로 늘어나요(--ex = 늘어난 양의 절반).
 * 세로가 긴 화면(4:3 태블릿)은 높이가 900~1200으로 늘어나요(--ey).
 * 콘텐츠(로비/전투)는 가운데 1600×900 안에 있고, 배경만 가장자리까지 채워져요.
 * ============================================================ */
:root { --ex: 0px; --ey: 0px; --sw: 1600px; }
html, body { height: 100%; height: 100dvh; overscroll-behavior: none; touch-action: pan-y; -webkit-text-size-adjust: 100%; }
body { -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; }
img { -webkit-user-drag: none; -webkit-touch-callout: none; }
button, [role="button"], .tarot, .hand-slot, .unit, .portrait { touch-action: manipulation; }
input[type="range"] { touch-action: none; }

#stage { left: 0; top: 0; transform-origin: 0 0; contain: layout paint; }
#fx-canvas { width: 100%; height: 100%; }
#lobby, #battle { left: 50%; top: 50%; right: auto; bottom: auto; width: 1600px; height: 900px; margin: -450px 0 0 -800px; }
#lobby { overflow: visible; background: none; }
.wall { left: calc(-40px - var(--ex)); right: calc(-40px - var(--ex)); top: calc(-40px - var(--ey)); bottom: calc(-40px - var(--ey)); }
.table { left: calc(60px - var(--ex) * .6); width: calc(1480px + var(--ex) * 1.2); }
.brand { left: calc(40px - var(--ex)); top: calc(40px - var(--ey)); }
.hud { right: calc(30px - var(--ex)); top: calc(22px - var(--ey)); }
.lobby-foot { bottom: calc(10px - var(--ey)); }
#battle .battle-top { right: calc(24px - var(--ex)); top: calc(14px - var(--ey)); }
.col-left { left: calc(22px - min(var(--ex), 150px)); }
.col-right { right: calc(22px - min(var(--ex), 150px)); }
.hand { height: calc(900px + var(--ey)); }
.enemy-hand { top: calc(0px - var(--ey)); }

/* 화면 밖 배경(세이프 에어리어·여백) — 스테이지와 같은 톤으로 이어져 보이게 */
#backdrop { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 70% 60% at 50% 42%, #164046 0%, #0c2629 45%, #050d0f 100%); }
#backdrop::after { content: ""; position: absolute; inset: 0; opacity: .7;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cg fill='%23c9a45c' fill-opacity='.08'%3E%3Cpath d='M40 30l2.5 7.5L50 40l-7.5 2.5L40 50l-2.5-7.5L30 40l7.5-2.5z'/%3E%3C/g%3E%3C/svg%3E"); }
#sa-probe { position: fixed; left: 0; top: 0; width: 0; height: 0; visibility: hidden; pointer-events: none;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }

/* 넓은 히트 영역(작은 화면에서도 44px 이상) */
.icon-btn { position: relative; }
.icon-btn::after { content: ""; position: absolute; inset: -8px; border-radius: inherit; }
.fs-btn { display: none; }
html.can-fs .fs-btn { display: grid; }
.fs-ic { font-size: 22px; line-height: 1; }

/* ---------- 화면 전환 ---------- */
.screen.active { animation: screenIn .45s cubic-bezier(.2,.8,.2,1) both; }
#lobby.active { animation-duration: .6s; }
@keyframes screenIn { from { opacity: 0; } to { opacity: 1; } }
#modal:not(.hidden) { animation: screenIn .22s ease both; }
#modal:not(.hidden) .modal-box { animation: modalIn .32s cubic-bezier(.2,1.2,.3,1) both; }
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(.97); } }

/* ---------- 첫 진입 연출(로비가 순서대로 나타남) ---------- */
#stage { transition: opacity .6s ease; }
#lobby.enter .wall, #lobby.enter .moonbeam { animation: enFade .9s ease both; }
#lobby.enter .window { animation: enRise .9s cubic-bezier(.2,.8,.2,1) .12s both; }
#lobby.enter .lantern { animation: enDrop .9s cubic-bezier(.2,.8,.2,1) .3s both; }
#lobby.enter .armillary { animation: enFade .8s ease .5s both; }
#lobby.enter .table { animation: enTable .8s cubic-bezier(.2,.8,.2,1) .3s both; }
#lobby.enter .tarot { animation: enDeal .7s cubic-bezier(.2,.9,.25,1.15) calc(.55s + var(--i, 0) * .07s) both; }
#lobby.enter .seolpyo { animation: enChar 1s cubic-bezier(.2,.8,.2,1) .6s both; }
#lobby.enter .bubble { animation: enHold 1.1s linear backwards; }
#lobby.enter .brand { animation: enLeft .9s cubic-bezier(.2,.8,.2,1) .2s both; }
#lobby.enter .hud { animation: enTop .7s cubic-bezier(.2,.8,.2,1) .7s both; }
#lobby.enter .lobby-foot { animation: enFade .6s ease 1.2s both; }
#lobby.enter.fast * { animation-duration: .3s !important; animation-delay: 0s !important; }
@keyframes enFade { from { opacity: 0; } }
@keyframes enRise { from { opacity: 0; translate: 0 30px; } }
@keyframes enDrop { from { opacity: 0; translate: 0 -60px; } }
@keyframes enTable { from { opacity: 0; translate: 0 160px; } }
@keyframes enDeal { from { opacity: 0; translate: 0 260px; rotate: -10deg; } }
@keyframes enChar { from { opacity: 0; scale: .97; } }
@keyframes enHold { from, to { opacity: 0; } }
@keyframes enLeft { from { opacity: 0; translate: -40px 0; } }
@keyframes enTop { from { opacity: 0; translate: 0 -24px; } }

/* ---------- 세로 화면 안내 ---------- */
#rotate { display: none; position: fixed; inset: 0; z-index: 3000; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 24px;
  background: radial-gradient(ellipse 80% 60% at 50% 45%, #12343a, #071316 70%, #030809); color: #efe6d2; font-family: var(--font); }
#rotate b { font-family: "Nanum Myeongjo", var(--font); font-size: 22px; font-weight: 800; letter-spacing: 1px; text-shadow: 2px 2px 0 rgba(229,83,60,.6); }
#rotate small { font-size: 13px; color: #c9a45c; letter-spacing: 1px; }
.rot-phone { width: 64px; height: 108px; border-radius: 12px; border: 3px solid #c9a45c; position: relative; margin-bottom: 14px; animation: rotPhone 2.4s cubic-bezier(.6,0,.3,1) infinite;
  box-shadow: 0 0 0 6px rgba(201,164,92,.12), 0 0 40px rgba(229,83,60,.25); background: linear-gradient(160deg, #1d4d4f, #0b2023); }
.rot-phone i { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; background: #e5533c; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
@keyframes rotPhone { 0%, 20% { transform: rotate(0); } 55%, 80% { transform: rotate(-90deg); } 100% { transform: rotate(-90deg); opacity: 0; } }
@media (orientation: portrait) and (hover: none) and (pointer: coarse) {
  #rotate { display: flex; }
}

/* ---------- 터치 기기: 호버 확대 대신 탭 미리보기 ---------- */
@media (hover: none) {
  .hand-slot:hover .card { transform: none; }
  .hand-slot:not(.playable):hover .card { filter: brightness(.72) saturate(.75); }
  .unit:hover { transform: none; }
  .hint-key { display: none; }
  .icon-btn:hover { transform: none; }
}
.hand-slot.preview { z-index: 100 !important; }
.hand-slot.preview .card { transform: rotate(calc(var(--rot) * -1)) translateY(-96px) scale(1.42) !important; }
.hand-slot.preview .c-frame { box-shadow: 0 0 0 .16em #fff, 0 0 1.4em #ff7a55, 0 .5em 1.2em rgba(0,0,0,.55) !important; }
.tap-hint { position: absolute; left: 50%; top: -34px; transform: translateX(-50%); white-space: nowrap; padding: 6px 14px; border-radius: 999px; font-size: 16px; font-weight: 800;
  background: rgba(8,23,26,.9); color: #efe6d2; border: 1px solid rgba(201,164,92,.7); pointer-events: none; z-index: 2; }

/* ---------- 작은 높이(모바일 가로): 글자·버튼을 키워서 읽기 쉽게 ---------- */
html.compact .hud { zoom: 1.6; }
html.compact #battle .battle-top { zoom: 1.7; }
html.compact .brand-no { display: none; }
html.compact .brand-title { font-size: 84px; }
html.compact .brand-sub { font-size: 30px; }
html.compact .bubble { left: 470px; top: 150px; width: 640px; font-size: 32px; line-height: 1.45; padding: 22px 30px 24px; }
html.compact .bubble .speaker { font-size: 22px; top: -22px; }
html.compact .bubble::after { top: 34px; }
html.compact .seolpyo { left: calc(1000px + min(var(--ex), 160px) * .6); top: 120px; width: 620px; height: 620px; }
html.compact .tarot-label { zoom: 1.45; margin-top: 10px; }
html.compact .tarot.main .tarot-label { zoom: 1.25; }
html.compact .lobby-foot { zoom: 1.6; bottom: 4px; }
html.compact .lobby-foot .hint-key { display: none; }
html.compact .modal-box { zoom: 1.6; max-height: 520px; min-width: 520px; }
html.compact .modal-box.wide { width: min(1140px, calc((var(--sw) - 60px) / 1.6)); }
html.compact #modal { overflow: auto; }
html.compact .res-box { zoom: 1.35; }
html.compact #log-drawer { zoom: 1.6; height: 562px; }
html.compact #tooltip { zoom: 1.45; }
html.compact .ticker { zoom: 1.5; }
html.compact .lane-empty { font-size: 26px; }
html.compact .end-btn { height: 130px; margin-top: -65px; }
html.compact .end-main { font-size: 42px; }
html.compact .end-sub { font-size: 16px; }
html.compact .mana-panel { zoom: 1.2; }
html.compact .col-right .mana-panel.enemy { top: 40px; }
html.compact .hand-slot { scale: 1.3; bottom: calc(-36px - var(--dy)); }
html.compact .hand-slot.preview .card, html.compact .hand-slot:focus-visible .card { transform: rotate(calc(var(--rot) * -1)) translateY(-150px) scale(1.75) !important; }
@media (hover: hover) { html.compact .hand-slot:hover .card { transform: rotate(calc(var(--rot) * -1)) translateY(-150px) scale(1.75); } }
html.compact .tap-hint { font-size: 18px; top: -40px; }

/* ---------- 저사양·모션 줄이기 ---------- */
html.lowfx *, html.lowfx *::before, html.lowfx *::after { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
html.lowfx .moonbeam, html.lowfx .cloud { filter: none; }
html.lowfx .cloud { background: radial-gradient(ellipse, rgba(200,230,225,.14), transparent 70%); }
html.lowfx .seolpyo { filter: none; }
html.lowfx .seolpyo::before { content: ""; position: absolute; left: 15%; right: 15%; bottom: 8%; height: 18%; border-radius: 50%; background: radial-gradient(ellipse, rgba(0,0,0,.45), transparent 70%); }
html.lowfx .bg-rays, html.lowfx .magic-circle, html.lowfx .tarot.main::before { animation: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
/* 넓은 스테이지에서 기록 서랍이 화면 끝에 붙도록 */
#log-drawer { right: calc(0px - var(--ex)); top: calc(0px - var(--ey)); height: calc(900px + var(--ey) * 2); }
/* zoom 된 요소는 위치값도 zoom 배율로 나눠요 */
html.compact .hud { right: calc((30px - var(--ex)) / 1.6); top: calc((18px - var(--ey)) / 1.6); }
html.compact #battle .battle-top { right: calc((24px - var(--ex)) / 1.7); top: calc((12px - var(--ey)) / 1.7); }
html.compact #log-drawer { right: calc((0px - var(--ex)) / 1.6); top: calc((0px - var(--ey)) / 1.6); height: calc((900px + var(--ey) * 2) / 1.6); }
html.compact .tarot { top: 566px; }
html.compact .tarot.main { top: 352px; }
html.compact .table { top: 612px; }
.fs-ic { display: block; }
.fs-ic .fs-close { display: none; }
html.is-fs .fs-ic .fs-open { display: none; }
html.is-fs .fs-ic .fs-close { display: inline; }
.tap-hint { top: -214px; transform: translateX(-50%) rotate(calc(var(--rot) * -1)); box-shadow: 0 6px 16px rgba(0,0,0,.5); }
html.compact .tap-hint { top: -340px; }
.bubble { width: 430px; }

/* ---------- 속성 배지: 테두리 색 지정(어둠 등) ---------- */
.c-el, .u-el { box-shadow: 0 0 0 .12em var(--elo, #ffe9b0), 0 .15em .4em rgba(0,0,0,.6), 0 0 .6em var(--elo, var(--elc)); }

/* ---------- 게임 방법: 속성 상성표 ---------- */
.aff { margin-top: 18px; display: grid; grid-template-columns: 300px 1fr; gap: 22px; align-items: center; padding: 16px 20px; border-radius: 6px; background: var(--glass); border: 1px solid var(--line); }
.aff h3 { grid-column: 1 / -1; margin: 0; font-size: 19px; color: #ffb49c; font-family: "Nanum Myeongjo", var(--font); }
.aff svg { width: 300px; height: 280px; display: block; }
.aff svg text { font-family: var(--font); font-weight: 800; }
.aff-notes { display: flex; flex-direction: column; gap: 10px; font-size: 15px; line-height: 1.5; color: #e6e0d0; }
.aff-notes div { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.aff-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-weight: 800; font-size: 14px; color: #fff; background: var(--elc); box-shadow: 0 0 0 1.5px var(--elo, rgba(255,255,255,.35)); text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.aff-x { font-family: var(--display); font-weight: 900; padding: 1px 8px; border-radius: 4px; font-size: 14px; }
.aff-x.up { background: rgba(255,90,60,.2); color: #ff9b7e; } .aff-x.down { background: rgba(120,160,255,.18); color: #a9c3ff; } .aff-x.eq { background: rgba(255,255,255,.1); color: #ddd; }
.aff-small { font-size: 13px; color: var(--muted); }
html.compact .aff { grid-template-columns: 260px 1fr; gap: 14px; padding: 12px 14px; }
html.compact .aff svg { width: 260px; height: 243px; }

/* ============================================================ 빈사(체력 낮음) 상태
 * 아트 슬롯 쌓임 순서: .ph(대체) < .art-main(기본) < .art-dying(빈사) < .dying-fx(붉은 맥동·균열)
 * 이후 카드 테두리 프레임은 .art 위에 겹쳐 올릴 예정(z-index 5 이상 권장).
 * ============================================================ */
.art .art-main { z-index: 1; }
.art .art-dying { z-index: 2; opacity: 0; }
.art.has-dying .art-dying { opacity: 1; }
.art.has-dying .art-main { opacity: 0; }
.art.dying-enter.has-dying .art-dying { animation: dyFadeIn .55s ease var(--dage, 0ms) both; }
.art.dying-enter.has-dying .art-main { animation: dyFadeOut .55s ease var(--dage, 0ms) both; }
.art.dying-exit .art-dying { animation: dyFadeOut .55s ease var(--dage, 0ms) both; }
.art.dying-exit .art-main { animation: dyFadeIn .55s ease var(--dage, 0ms) both; }
@keyframes dyFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes dyFadeOut { from { opacity: 1; } to { opacity: 0; } }
.art.is-dying:not(.has-dying) .art-main, .art.is-dying:not(.has-dying) .ph { filter: saturate(.75) sepia(.25) brightness(.9); }
.dying-fx { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; }
.art.is-dying .dying-fx { opacity: 1;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 140' preserveAspectRatio='none'%3E%3Cg fill='none' stroke='%23ffd9d0' stroke-opacity='.75' stroke-width='1.1' stroke-linecap='round'%3E%3Cpath d='M100 18 L82 30 L86 44 L70 52 L74 66'/%3E%3Cpath d='M82 30 L94 40'/%3E%3Cpath d='M70 52 L58 50'/%3E%3Cpath d='M0 104 L14 98 L20 110 L34 106'/%3E%3Cpath d='M14 98 L10 88'/%3E%3C/g%3E%3C/svg%3E") center / 100% 100% no-repeat,
    radial-gradient(ellipse 75% 65% at 50% 45%, transparent 45%, rgba(200,20,20,.55) 100%);
  animation: dyPulse 1.3s ease-in-out infinite; }
.art.dying-enter .dying-fx { animation: dyFlash .55s ease var(--dage, 0ms) both, dyPulse 1.3s ease-in-out infinite .55s; }
@keyframes dyPulse { 50% { opacity: .55; } }
@keyframes dyFlash { 0% { opacity: 0; } 25% { opacity: 1; background-color: rgba(255,60,40,.45); } 100% { opacity: 1; background-color: transparent; } }
.unit.near-death .stat.hp { animation: dyHp 1.3s ease-in-out infinite; }
@keyframes dyHp { 50% { transform: scale(1.12); filter: drop-shadow(0 0 .35em #ff2a2a); } }
.unit.near-death .u-frame { filter: drop-shadow(0 0 .35em rgba(255,40,40,.65)); }
html.lowfx .unit.near-death .u-frame { filter: none; }
@media (prefers-reduced-motion: reduce) {
  .art.is-dying .dying-fx, .art.dying-enter .dying-fx, .unit.near-death .stat.hp { animation: none; }
}

/* ============================================================ 금색 카드 테두리(오너 제공) · 2:3 아트 슬롯
 * 아트는 2:3 슬롯을 object-fit: cover 로 채우고, 그 위에 .art-frame(투명 중앙 테두리)을 덮어요.
 * 빈사 아트도 같은 슬롯 안에서 바뀌므로 테두리는 그대로 유지돼요.
 * 코스트·공격력·체력·속성 배지는 .c-inner/.u-inner 바깥(z-index 6)이라 테두리 위에 보여요.
 * ============================================================ */
.card { width: 9.333em; height: 14em; }
.hand-slot { width: 131px; margin-left: -65.5px; }
.c-frame { padding: .14em; border-radius: .6em; }
.c-inner { border-radius: .48em; }
.art-frame { position: absolute; inset: 0; z-index: 5; pointer-events: none;
  background: url("assets/frame/card_frame.webp") center / 100% 100% no-repeat; }
.no-webp .art-frame { background-image: url("assets/frame/card_frame.png"); }
.art img { object-position: 50% 18%; }
.c-ribbon { left: 6%; right: 6%; }
.c-desc { left: 1.1em; right: 1.1em; bottom: 1.9em; }
.unit { width: 108px; height: 162px; }
.u-frame { border-radius: .55em; padding: .16em; }
.u-inner { border-radius: .42em; }
.unit .reticle { border-radius: 14px; }
.unit.shielded .u-body::after { border-radius: 16px; }
.u-inner .art .ph span { margin-bottom: 0; }

/* ============================================================ 단정한 카드(.fcard) · 정보 패널(.ci) · 도감 2
 * 그림 위에는 코스트·등급·속성·이름판만. 설명/키워드는 그림 밖 정보 패널로.
 * ============================================================ */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.fcard { position: relative; width: 14em; aspect-ratio: 2 / 3; font-size: 15px; flex-shrink: 0; }
.fcard.xl { font-size: 24px; }
.fcard.tt { font-size: 11px; }
.fc-art { position: absolute; inset: 0; border-radius: .45em; overflow: hidden; background: #0b1a1d; box-shadow: 0 .5em 1.4em rgba(0,0,0,.55), 0 0 0 1px rgba(224,189,114,.35); }
.r-SSR .fc-art { box-shadow: 0 .5em 1.4em rgba(0,0,0,.55), 0 0 0 1px rgba(255,224,138,.8), 0 0 1.2em rgba(255,214,120,.35); }
.fc-cost { position: absolute; z-index: 7; top: -.45em; left: -.45em; width: 2.3em; height: 2.3em; display: grid; place-items: center; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d4f3ff, #3aa0ff 45%, #12409c 100%);
  box-shadow: 0 0 0 .12em #ffe9b0, 0 0 0 .22em #6b4510, 0 .2em .5em rgba(0,0,0,.6); }
.fc-cost span { font-size: 1.25em; font-weight: 900; color: #fff; text-shadow: 0 .06em 0 #0a2a70; }
.fc-el { position: absolute; z-index: 7; top: 2.15em; left: -.25em; width: 1.55em; height: 1.55em; font-size: .85em; display: grid; place-items: center; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--elc) 40%, #fff), var(--elc) 60%, color-mix(in srgb, var(--elc) 60%, #000));
  box-shadow: 0 0 0 .12em var(--elo, #ffe9b0), 0 .15em .4em rgba(0,0,0,.6); }
.fc-rar { position: absolute; z-index: 7; top: .7em; right: .75em; padding: .12em .5em; border-radius: .25em; font-family: var(--display); font-weight: 900; font-size: .72em; letter-spacing: .08em; color: #fff;
  background: rgba(8,23,26,.78); border: 1px solid var(--rc, #8aa); }
.r-SSR .fc-rar { color: #ffe08a; border-color: #ffe08a; box-shadow: 0 0 .6em rgba(255,214,120,.5); }
.r-SR .fc-rar { color: #e3c6ff; border-color: #b47cff; }
.r-R .fc-rar { color: #bfe3ff; border-color: #4aa8ff; }
.fc-plate { position: absolute; z-index: 6; left: 7%; right: 7%; bottom: 5.5%; height: 2.2em; display: flex; align-items: center; justify-content: space-between; gap: .4em; padding: 0 .6em;
  background: linear-gradient(180deg, rgba(8,23,26,.72), rgba(8,23,26,.94)); border-top: 1px solid rgba(224,189,114,.55); border-radius: 0 0 .25em .25em; }
.fc-name { font-weight: 800; font-size: .95em; color: #fff6e0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: "Nanum Myeongjo", var(--font); }
.fc-stats { display: flex; gap: .45em; flex-shrink: 0; font-size: .78em; font-weight: 800; }
.fc-stats i { font-style: normal; }
.fc-stats .a { color: #ffcf7a; } .fc-stats .h { color: #ff8f9f; }
.fc-new { position: absolute; z-index: 8; top: -.5em; right: -.4em; padding: .15em .5em; border-radius: 999px; font-size: .7em; font-weight: 900; letter-spacing: .06em; color: #fff; background: #e5533c; box-shadow: 0 0 .8em rgba(229,83,60,.8); animation: newPulse 1.4s ease-in-out infinite; }
@keyframes newPulse { 50% { transform: scale(1.1); } }
.fc-dup { position: absolute; z-index: 8; right: 8%; bottom: 14%; font-size: .72em; font-weight: 800; padding: .05em .45em; border-radius: 999px; background: rgba(8,23,26,.85); color: #ffe9b0; border: 1px solid rgba(224,189,114,.5); }
.fc-lock { position: absolute; z-index: 8; left: 50%; top: 42%; transform: translate(-50%, -50%); font-size: .8em; font-weight: 800; letter-spacing: .1em; padding: .3em .9em; border-radius: 999px; background: rgba(8,23,26,.85); color: #cfd8d6; border: 1px solid rgba(255,255,255,.25); }
.unowned .fc-art .art { filter: grayscale(1) brightness(.38) contrast(1.1); }
.unowned .fc-name { color: #aab5b3; }

/* 정보 패널 */
.ci { display: flex; flex-direction: column; gap: 16px; min-width: 0; text-align: left; }
.ci-head { display: flex; align-items: center; gap: 10px; }
.ci-rar { font-family: var(--display); font-weight: 900; font-size: 14px; letter-spacing: .1em; padding: 4px 12px; border-radius: 4px; border: 1px solid #4aa8ff; color: #bfe3ff; background: rgba(8,23,26,.6); }
.ci-rar.r-SR { border-color: #b47cff; color: #e3c6ff; }
.ci-rar.r-SSR { border-color: #ffe08a; color: #ffe08a; box-shadow: 0 0 10px rgba(255,214,120,.35); }
.ci-rar.r-N { border-color: #889; color: #ccd; }
.el-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; font-size: 15px; font-weight: 800;
  color: color-mix(in srgb, var(--elo, var(--elc)) 55%, #fff); background: color-mix(in srgb, var(--elc) 22%, rgba(8,23,26,.7)); border: 1px solid color-mix(in srgb, var(--elo, var(--elc)) 75%, transparent); }
.el-chip i { font-style: normal; font-size: .95em; }
.el-chip.sm { height: 26px; padding: 0 10px; font-size: 13px; }
.el-chip.none { --elc: #667; }
.ci-name { margin: -4px 0 0; font-size: 38px; font-weight: 900; line-height: 1.15; font-family: "Nanum Myeongjo", var(--font); color: #fff6e0; }
.ci-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ci-stats > div { padding: 10px 0 8px; border-radius: 6px; text-align: center; background: rgba(255,255,255,.045); border: 1px solid rgba(224,189,114,.22); }
.ci-stats small { display: block; font-size: 12px; color: var(--muted); letter-spacing: .08em; margin-bottom: 2px; }
.ci-stats b { font-size: 26px; font-weight: 900; }
.ci-stats b em { font-size: .55em; font-style: normal; color: var(--muted); margin-left: 2px; }
.ci-stats .c { color: #8fd0ff; } .ci-stats .a { color: #ffcf7a; } .ci-stats .h { color: #ff8f9f; }
.ci-sec > small { display: block; font-size: 12px; font-weight: 800; letter-spacing: .14em; color: rgba(224,189,114,.85); margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid rgba(224,189,114,.18); }
.ci-kw { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ci-kw li { display: flex; align-items: baseline; gap: 10px; font-size: 15px; color: #dfe9e7; }
.ci-kw b { flex-shrink: 0; min-width: 64px; text-align: center; padding: 2px 8px; border-radius: 4px; font-size: 13px; color: #ffe9b0; background: rgba(224,189,114,.14); border: 1px solid rgba(224,189,114,.4); }
.ci-desc { margin: 0; font-size: 16px; line-height: 1.6; color: #e9f1ef; }
.ci-aff { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.ci-aff > span { min-width: 74px; font-size: 13px; font-weight: 800; }
.ci-aff.good > span { color: #8ff0b0; } .ci-aff.bad > span { color: #ff9a8a; } .ci-aff.meh > span { color: var(--muted); }
.ci-note { margin: 0; font-size: 13px; color: var(--muted); }
.ci-note.bad { color: #ff8a7a; font-weight: 800; }
.ci.compact { gap: 9px; }
.ci.compact .ci-name { font-size: 22px; }
.ci.compact .ci-stats b { font-size: 19px; }
.ci.compact .ci-stats > div { padding: 5px 0 4px; }
.ci.compact .ci-stats small { font-size: 10.5px; }
.ci.compact .ci-sec > small { font-size: 10.5px; margin-bottom: 5px; padding-bottom: 4px; }
.ci.compact .ci-kw li { font-size: 12.5px; gap: 6px; }
.ci.compact .ci-kw b { min-width: 52px; font-size: 11.5px; padding: 1px 5px; }
.ci.compact .ci-desc { font-size: 13.5px; line-height: 1.5; }
.ci.compact .el-chip { height: 24px; font-size: 12.5px; padding: 0 9px; }
.ci.compact .el-chip.sm { height: 21px; font-size: 11px; padding: 0 7px; }
.ci.compact .ci-aff > span { min-width: 54px; font-size: 11.5px; }
.ci.compact .ci-rar { font-size: 11px; padding: 2px 8px; }

/* 대전 툴팁 */
#tooltip { width: 470px; }
.tt-card { display: flex; gap: 16px; align-items: flex-start; padding: 14px 16px 14px 14px; border-radius: 10px; background: rgba(8,23,26,.95); border: 1px solid rgba(224,189,114,.45); box-shadow: 0 20px 50px rgba(0,0,0,.6); }
.tt-card .ci { flex: 1; }

/* 도감 */
.modal-box.dexbox { width: 1220px; max-width: 1220px; max-height: 850px; padding: 30px 40px 30px; }
.dex-head { display: flex; align-items: baseline; justify-content: space-between; padding-right: 50px; }
.dex-head h2 { margin-bottom: 14px; }
.dex-own { font-size: 16px; color: var(--muted); } .dex-own b { color: #ffe9b0; font-size: 20px; }
.dex-tools { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.dex-tools .chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { height: 38px; padding: 0 14px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; cursor: pointer; color: #dfe9e7; background: rgba(255,255,255,.05); border: 1px solid var(--line); }
.chip i { font-style: normal; }
.chip:hover { background: rgba(255,255,255,.1); }
.chip.on { color: #fff3c7; border-color: var(--gold); background: rgba(224,189,114,.2); }
.chip.el.on { color: #fff; border-color: var(--elo, var(--elc)); background: color-mix(in srgb, var(--elc) 35%, rgba(8,23,26,.6)); }
.dex-tools .segs { display: flex; gap: 6px; align-items: center; }
.dex-tools .segs small { color: var(--muted); margin-right: 4px; font-size: 14px; }
.dex-tools .seg { height: 38px; min-width: 70px; padding: 0 14px; font-size: 15px; }
.dex-grid2 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 34px 26px; justify-items: center; padding: 10px 4px 16px; }
.dex-cell { appearance: none; background: none; border: 0; padding: 0; cursor: pointer; color: inherit; font: inherit; transition: transform .18s; border-radius: 10px; outline: none; }
.dex-cell .fcard { font-size: 16px; }
.dex-cell:hover, .dex-cell:focus-visible { transform: translateY(-6px); }
.dex-cell:focus-visible .fc-art { box-shadow: 0 0 0 3px var(--gold), 0 .5em 1.4em rgba(0,0,0,.55); }
.dex-empty { text-align: center; color: var(--muted); padding: 60px 0; }
.dex-detail .dd-nav { display: flex; align-items: center; gap: 16px; margin: -4px 50px 22px 0; }
.dd-pos { color: var(--muted); font-size: 15px; }
.dd-arrows { margin-left: auto; display: flex; gap: 10px; }
.dd-arrows .icon-btn { width: 44px; height: 44px; font-size: 26px; line-height: 1; }
.dd-body { display: grid; grid-template-columns: auto 1fr; gap: 48px; align-items: start; }
.dd-art { padding: 8px 0 0 8px; }
.dd-info { padding-top: 6px; max-width: 600px; }
.dd-own { margin: 22px 0 0; color: var(--muted); font-size: 15px; } .dd-own b { color: #ffe9b0; }
html.compact .modal-box.dexbox { width: min(1220px, calc((var(--sw) - 60px) / 1.6)); max-height: 520px; padding: 22px 26px; }
html.compact .dex-grid2 { grid-template-columns: repeat(3, 1fr); gap: 26px 18px; }
html.compact .dex-cell .fcard { font-size: 13px; }
html.compact .fcard.xl { font-size: 15px; }
html.compact .dd-body { gap: 28px; }
html.compact .dex-tools { margin-bottom: 14px; }
html.compact #tooltip { zoom: 1.3; }
.icon-btn.modal-close { position: absolute; top: 16px; right: 16px; z-index: 5; }
html.compact .dex-cell .fcard { font-size: 14px; }

/* ============================================================ 토스트 · 카드 레벨 */
#toast { position: absolute; z-index: 450; left: 50%; top: 90px; transform: translate(-50%, -10px); padding: 12px 26px; border-radius: 6px; font-size: 18px; font-weight: 800; color: #fff6e0;
  background: rgba(8,23,26,.94); border: 1px solid rgba(224,189,114,.6); box-shadow: 0 12px 30px rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
html.compact #toast { zoom: 1.5; top: 40px; }
.fc-lv { position: absolute; z-index: 8; left: 9%; bottom: 15%; display: flex; align-items: center; gap: .25em; padding: .08em .45em; border-radius: .3em; font-family: var(--display); font-weight: 900; font-size: .68em; letter-spacing: .04em;
  color: #fff3c7; background: rgba(8,23,26,.86); border: 1px solid rgba(224,189,114,.55); }
.fc-up { font-style: normal; color: #6dffa8; font-size: .9em; text-shadow: 0 0 .5em #36ff8a; animation: upBob 1s ease-in-out infinite; }
@keyframes upBob { 50% { transform: translateY(-.15em); } }
.unowned .fc-lv { display: none; }
.ci-lv { margin-left: auto; font-family: var(--display); font-weight: 900; font-size: 15px; color: #fff3c7; padding: 3px 10px; border-radius: 4px; background: rgba(224,189,114,.16); border: 1px solid rgba(224,189,114,.5); }
.ci.compact .ci-lv { font-size: 11.5px; padding: 1px 7px; }
.lvp { margin-top: 20px; padding: 16px 18px; border-radius: 8px; background: rgba(255,255,255,.035); border: 1px solid rgba(224,189,114,.25); display: flex; flex-direction: column; gap: 12px; }
.lvp.ready { border-color: rgba(109,255,168,.45); box-shadow: inset 0 0 24px rgba(109,255,168,.06); }
.lvp-top { display: flex; align-items: center; gap: 14px; }
.lvp-lv { font-family: var(--display); font-size: 26px; color: #fff3c7; } .lvp-lv small { font-size: 14px; color: var(--muted); }
.lvp-pips { display: flex; gap: 4px; margin-left: 14px; } .lvp-pips i { width: 14px; height: 6px; border-radius: 2px; background: rgba(255,255,255,.12); } .lvp-pips i.on { background: linear-gradient(90deg, #e0bd72, #ffe9b0); box-shadow: 0 0 6px rgba(255,214,120,.5); }
.lvp-own { margin-left: auto; font-size: 14px; color: var(--muted); }
.lvp-bar { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.lvp-label { font-size: 13px; color: var(--muted); }
.lvp-track { height: 10px; border-radius: 999px; background: rgba(0,0,0,.35); border: 1px solid rgba(224,189,114,.25); overflow: hidden; }
.lvp-track i { display: block; height: 100%; background: linear-gradient(90deg, #5fd0bb, #6dffa8); transition: width .5s; }
.lvp:not(.ready) .lvp-track i { background: linear-gradient(90deg, #8a7448, #e0bd72); }
.lvp-num { font-size: 15px; color: #fff6e0; min-width: 60px; text-align: right; }
.lvp-prev { display: flex; gap: 18px; align-items: center; font-size: 15px; color: #dfe9e7; }
.lvp-prev > span:first-child { color: var(--muted); font-size: 13px; }
.lvp-prev .pv b { color: #6dffa8; } .lvp-prev .a { color: #ffcf7a; } .lvp-prev .h { color: #ff8f9f; }
.lvp-btn { position: relative; height: 54px; border-radius: 6px; border: 1px solid #ffe08a; cursor: pointer; font-size: 19px; font-weight: 900; color: #2a1a00; display: flex; align-items: center; justify-content: center; gap: 12px;
  background: linear-gradient(180deg, #ffe9a8, #e0bd72 55%, #b8892e); box-shadow: 0 0 0 3px rgba(224,189,114,.18), 0 8px 22px rgba(0,0,0,.4), 0 0 26px rgba(255,214,120,.45); overflow: hidden; }
.lvp-btn small { font-size: 13px; font-weight: 700; opacity: .75; }
.lvp-btn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.6) 48%, transparent 66%); background-size: 250% 100%; animation: sweep 2.4s infinite; }
.lvp-btn:hover:not([disabled]) { filter: brightness(1.08); transform: translateY(-1px); }
.lvp-btn[disabled] { cursor: not-allowed; color: #9aa6a4; background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.18); box-shadow: none; }
.lvp-btn[disabled]::after { display: none; }
.lvp-maxline { font-family: var(--display); font-weight: 900; font-size: 18px; letter-spacing: .1em; background: linear-gradient(90deg, #ff9ad5, #ffe08a, #9dff9a, #7ad7ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lv-flash .fc-art { animation: lvFlash .9s ease-out; }
@keyframes lvFlash { 0% { box-shadow: 0 0 0 0 rgba(255,236,170,.9), 0 0 0 rgba(255,214,120,0); filter: brightness(1.8); } 100% { box-shadow: 0 0 0 26px rgba(255,236,170,0), 0 0 60px rgba(255,214,120,0); filter: none; } }
.lv-pop .lvp-lv { animation: lvPop .6s cubic-bezier(.2,1.6,.3,1); display: inline-block; }
@keyframes lvPop { 0% { transform: scale(1.6); color: #6dffa8; } 100% { transform: none; } }

/* ============================================================ 출석 보상 · 확률 정보 */
.daily { text-align: center; min-width: 520px; }
.daily-card { position: relative; width: 150px; height: 150px; margin: 0 auto 6px; display: grid; place-items: center; }
.daily-gem { width: 84px; height: 84px; background: linear-gradient(135deg, #f2fffb, #5fd0bb 45%, #15484a); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); filter: drop-shadow(0 0 18px rgba(95,208,187,.8)); animation: gemFloat 2.4s ease-in-out infinite; position: relative; z-index: 1; }
.daily-rays { position: absolute; inset: 0; border-radius: 50%; background: repeating-conic-gradient(rgba(255,233,176,.28) 0 8deg, transparent 8deg 22deg); -webkit-mask: radial-gradient(circle, #000 30%, transparent 70%); mask: radial-gradient(circle, #000 30%, transparent 70%); animation: spin 14s linear infinite; }
@keyframes gemFloat { 50% { transform: translateY(-8px) rotate(4deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
.daily-k { font-family: var(--display); letter-spacing: .25em; color: rgba(224,189,114,.9); font-size: 13px; }
.daily h2 { margin: 6px 0 10px; }
.daily-amt { font-size: 34px; font-weight: 900; margin: 0; color: #e8fffa; display: flex; align-items: center; justify-content: center; gap: 10px; }
.daily-amt .cur-ic { width: 26px; height: 26px; display: inline-block; } .daily-amt em { font-style: normal; font-size: 18px; color: var(--muted); }
.daily-sub { color: var(--muted); margin: 6px 0 16px; }
.daily-q { margin: 0 auto; max-width: 440px; padding: 12px 16px; border-left: 3px solid #e5533c; background: rgba(255,255,255,.04); text-align: left; font-size: 16px; color: #efe6d2; }
.daily-q b { display: block; font-size: 13px; color: #e5533c; margin-bottom: 4px; letter-spacing: .1em; }
.rates { width: 100%; border-collapse: collapse; font-size: 16px; }
.rates th, .rates td { padding: 10px 12px; border-bottom: 1px solid rgba(224,189,114,.18); text-align: left; vertical-align: middle; }
.rates thead th { font-size: 13px; color: var(--muted); font-weight: 700; }
.rates td small { color: var(--muted); }
.rates-notes { margin: 16px 0 0; padding-left: 20px; color: #dfe9e7; font-size: 15px; line-height: 1.8; }
#lobby button.currency { cursor: pointer; font: inherit; }

/* ============================================================ 뽑기 화면 — 운명의 수레바퀴 */
#gacha { left: 50%; top: 50%; right: auto; bottom: auto; width: 1600px; height: 900px; margin: -450px 0 0 -800px; overflow: visible; }
.g-bg { position: absolute; left: calc(-1 * var(--ex)); right: calc(-1 * var(--ex)); top: calc(-1 * var(--ey)); bottom: calc(-1 * var(--ey));
  background: radial-gradient(ellipse 60% 70% at 30% 52%, rgba(95,208,187,.18), transparent 70%), radial-gradient(ellipse 50% 60% at 78% 40%, rgba(229,83,60,.12), transparent 70%), linear-gradient(180deg, #06161a, #0b2328 55%, #050f12); overflow: hidden; }
.g-starmap { position: absolute; inset: 0; width: 100%; height: 100%; }
.g-starmap .tw { animation: twinkle 2.6s ease-in-out infinite; }
@keyframes twinkle { 50% { opacity: .1; } }
.g-wheel-wrap { position: absolute; left: 110px; top: 140px; width: 640px; height: 640px; }
.g-wheel { width: 100%; height: 100%; animation: wheelIdle 60s linear infinite; filter: drop-shadow(0 20px 40px rgba(0,0,0,.6)); }
@keyframes wheelIdle { to { transform: rotate(360deg); } }
.g-wheel-glow { position: absolute; inset: -10%; border-radius: 50%; pointer-events: none; opacity: 0; background: radial-gradient(circle, var(--gcol, #4aa8ff) 0%, transparent 62%); mix-blend-mode: screen; }
#gacha.g-best-SR { --gcol: rgba(180,124,255,.75); } #gacha.g-best-R { --gcol: rgba(74,168,255,.6); } #gacha.g-best-SSR { --gcol: rgba(255,211,107,.9); }
#gacha.g-spinning .g-wheel { animation: wheelSpin 2.1s cubic-bezier(.15,.6,.25,1) both; }
#gacha.g-spinning .g-wheel-glow { animation: glowUp 2.1s ease-in both; }
#gacha.g-best-SSR.g-spinning .g-wheel-glow { background: conic-gradient(from 0deg, #ff9ad5, #ffe08a, #9dff9a, #7ad7ff, #ff9ad5); -webkit-mask: radial-gradient(circle, #000 20%, transparent 64%); mask: radial-gradient(circle, #000 20%, transparent 64%); }
@keyframes wheelSpin { from { transform: rotate(0); } to { transform: rotate(1440deg); } }
@keyframes glowUp { 0% { opacity: 0; transform: scale(.8); } 70% { opacity: .5; } 100% { opacity: 1; transform: scale(1.15); } }
.g-top { position: absolute; z-index: 5; left: calc(30px - var(--ex)); right: calc(30px - var(--ex)); top: calc(24px - var(--ey)); display: flex; align-items: center; gap: 18px; }
.g-title { display: flex; flex-direction: column; margin-left: 10px; }
.g-title small { font-family: var(--display); letter-spacing: .25em; font-size: 12px; color: rgba(224,189,114,.85); }
.g-title b { font-family: "Nanum Myeongjo", var(--font); font-size: 28px; color: #fff6e0; }
.g-cur { margin-left: auto; background: rgba(8,23,26,.8); border: 1px solid rgba(201,164,92,.55); border-radius: 4px; }
.g-banner { position: absolute; left: 800px; top: 150px; width: 720px; height: 470px; }
.g-feat { position: absolute; left: 0; top: 0; width: 460px; height: 420px; }
.g-feat-c { position: absolute; left: 150px; top: 20px; transform: translateX(calc(var(--k) * 120px)) rotate(calc(var(--k) * 9deg)) translateY(calc(var(--k) * var(--k) * 14px)); transform-origin: 50% 120%; z-index: calc(5 - var(--k) * var(--k)); }
.g-feat-c .fcard { font-size: 12.5px; }
.g-feat-c:nth-child(2) .fcard { font-size: 14px; margin-top: -14px; }
.g-copy { position: absolute; left: 480px; top: 70px; width: 260px; }
.g-copy small { font-family: var(--display); letter-spacing: .2em; color: #e5533c; font-size: 13px; }
.g-copy h2 { margin: 8px 0 12px; font-family: "Nanum Myeongjo", var(--font); font-size: 34px; line-height: 1.25; color: #fff6e0; }
.g-copy p { color: #cfe0dd; font-size: 15px; line-height: 1.7; margin: 0; } .g-copy b { color: #ffe08a; }
.g-panel { position: absolute; left: 820px; top: 640px; width: 700px; display: flex; flex-direction: column; gap: 14px; z-index: 3; }
.g-pity { display: flex; align-items: center; gap: 14px; font-size: 15px; color: #cfe0dd; }
.g-pity b { color: #ffe08a; font-size: 18px; }
.g-pity-track { flex: 1; height: 8px; border-radius: 999px; background: rgba(0,0,0,.4); border: 1px solid rgba(224,189,114,.3); overflow: hidden; }
.g-pity-track i { display: block; height: 100%; background: linear-gradient(90deg, #e0bd72, #ffe08a); }
.g-btns { display: flex; gap: 18px; }
.g-btn { flex: 1; height: 86px; border-radius: 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1px solid rgba(224,189,114,.7); color: #fff6e0; font: inherit;
  background: linear-gradient(180deg, #164248, #0b2428); box-shadow: 0 10px 26px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.12); transition: transform .15s, filter .15s; }
.g-btn b { font-size: 22px; font-weight: 900; } .g-btn span { display: flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 800; color: #bff3e8; }
.g-btn .cur-ic { width: 16px; height: 16px; display: inline-block; }
.g-btn.ten { background: linear-gradient(180deg, #ef6a4f, #b8341f); border-color: #ffb08f; box-shadow: 0 10px 26px rgba(0,0,0,.45), 0 0 26px rgba(229,83,60,.35), inset 0 1px 0 rgba(255,255,255,.3); }
.g-btn.ten span { color: #fff1e8; }
.g-btn:hover { transform: translateY(-2px); filter: brightness(1.08); }
.g-btn.sm { height: 52px; flex: 0 0 auto; min-width: 170px; flex-direction: row; gap: 12px; } .g-btn.sm b { font-size: 17px; } .g-btn.sm span { font-size: 14px; }
.g-rates-link { align-self: flex-end; background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: 14px; }
.g-flash { position: absolute; z-index: 40; left: calc(-1 * var(--ex)); right: calc(-1 * var(--ex)); top: calc(-1 * var(--ey)); bottom: calc(-1 * var(--ey)); pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 50%, #fff, #ffe9b0 30%, rgba(255,154,213,.5) 60%, transparent 85%); }
.g-flash.go { animation: gFlash .8s ease-out; }
@keyframes gFlash { 0% { opacity: 0; } 12% { opacity: 1; } 100% { opacity: 0; } }
#gacha.g-shake { animation: gShake .5s ease; }
@keyframes gShake { 10%, 50%, 90% { transform: translate(-8px, 4px); } 30%, 70% { transform: translate(8px, -4px); } }

/* 기원 연출 */
.g-show { position: absolute; z-index: 20; left: calc(-1 * var(--ex)); right: calc(-1 * var(--ex)); top: calc(-1 * var(--ey)); bottom: calc(-1 * var(--ey)); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 30px;
  background: radial-gradient(ellipse at 50% 48%, rgba(14,48,54,.9), rgba(3,10,12,.96) 75%); animation: screenIn .35s ease both; }
.g-show[hidden] { display: none; }
.g-row { display: grid; grid-template-columns: repeat(5, auto); gap: 34px 30px; }
.g-show.n1 .g-row { grid-template-columns: auto; }
.g-card { position: relative; width: 168px; height: 252px; padding: 0; border: 0; background: none; cursor: pointer; perspective: 1200px; font: inherit; color: inherit; animation: gDeal .55s cubic-bezier(.2,.9,.3,1.1) var(--d) both; }
.g-show.n1 .g-card { width: 280px; height: 420px; }
@keyframes gDeal { from { opacity: 0; transform: translateY(-260px) scale(.4) rotate(-12deg); } to { opacity: 1; transform: none; } }
.g-inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.3,.7,.3,1.2); }
.g-card.flipped .g-inner { transform: rotateY(180deg); }
.g-card.instant .g-inner { transition: none; }
.g-back, .g-front { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 10px; }
.g-front { transform: rotateY(180deg); }
.g-front .fcard { font-size: 12px; }
.g-show.n1 .g-front .fcard { font-size: 20px; }
.g-back { background: linear-gradient(160deg, #164a50, #0a2226); border: 2px solid #e0bd72; box-shadow: 0 12px 30px rgba(0,0,0,.55), inset 0 0 0 6px rgba(8,23,26,.9), inset 0 0 0 7px rgba(224,189,114,.5); display: grid; place-items: center; overflow: hidden; }
.g-back i { width: 46%; aspect-ratio: 1; background: #e0bd72; clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%); opacity: .9; }
.g-back::before { content: ""; position: absolute; inset: 14px; border: 1px solid rgba(224,189,114,.35); border-radius: 6px; }
.g-card.t-SR .g-back { box-shadow: 0 0 22px rgba(180,124,255,.7), inset 0 0 0 6px rgba(8,23,26,.9), inset 0 0 0 7px rgba(200,160,255,.8); }
.g-card.t-SSR .g-back { box-shadow: 0 0 30px rgba(255,211,107,.85), inset 0 0 0 6px rgba(8,23,26,.9), inset 0 0 0 7px #ffe08a; animation: ssrTease 1.2s ease-in-out infinite; }
@keyframes ssrTease { 50% { box-shadow: 0 0 46px rgba(255,154,213,.9), inset 0 0 0 6px rgba(8,23,26,.9), inset 0 0 0 7px #fff3c2; } }
.g-card:not(.flipped):hover .g-inner { transform: translateY(-6px); }
.g-pillar { position: absolute; left: -30%; right: -30%; bottom: -10%; height: 260%; pointer-events: none; opacity: 0; transform-origin: 50% 100%; border-radius: 50% 50% 0 0;
  background: linear-gradient(0deg, transparent 0%, var(--pc, #4aa8ff) 25%, transparent 100%); filter: blur(10px); mix-blend-mode: screen; }
.g-card.t-R { --pc: rgba(74,168,255,.55); } .g-card.t-SR { --pc: rgba(180,124,255,.8); } .g-card.t-SSR { --pc: rgba(255,214,120,.95); }
.g-card.t-SSR .g-pillar { background: linear-gradient(0deg, transparent, #ff9ad5 20%, #ffe08a 40%, #9dff9a 60%, #7ad7ff 80%, transparent); }
.g-card.flipped .g-pillar { animation: pillar 1.3s ease-out .2s both; }
.g-card.flipped.instant .g-pillar { animation: none; opacity: .3; transform: scaleY(.5); }
@keyframes pillar { 0% { opacity: 0; transform: scaleY(0); } 30% { opacity: 1; transform: scaleY(1.1); } 100% { opacity: .35; transform: scaleY(.55); } }
.g-hint { font-size: 18px; color: #cfe0dd; letter-spacing: .05em; min-height: 32px; display: flex; align-items: center; gap: 16px; }
.g-hint b { font-family: "Nanum Myeongjo", var(--font); font-size: 26px; color: #fff6e0; }
.g-cnt { display: flex; gap: 8px; } .g-cnt i { font-style: normal; font-weight: 800; font-size: 15px; padding: 3px 10px; border-radius: 4px; border: 1px solid; }
.g-cnt .r-SSR { color: #ffe08a; border-color: #ffe08a; } .g-cnt .r-SR { color: #e3c6ff; border-color: #b47cff; } .g-cnt .r-R { color: #bfe3ff; border-color: #4aa8ff; } .g-cnt .new { color: #fff; background: #e5533c; border-color: #e5533c; }
.g-actions { display: flex; gap: 14px; align-items: center; }
.g-show.summary .g-card { animation: none; cursor: default; }
/* SSR 쇼케이스 */
.g-ssr { position: absolute; z-index: 60; left: calc(-1 * var(--ex)); right: calc(-1 * var(--ex)); top: calc(-1 * var(--ey)); bottom: calc(-1 * var(--ey)); display: flex; align-items: center; justify-content: center; gap: 60px; cursor: pointer;
  background: radial-gradient(circle at 50% 50%, rgba(60,40,10,.75), rgba(3,8,10,.95) 70%); animation: screenIn .3s ease both; }
.g-ssr.out { animation: fadeOut .3s ease both; }
@keyframes fadeOut { to { opacity: 0; } }
.g-ssr-rays { position: absolute; left: 50%; top: 50%; width: 1400px; height: 1400px; margin: -700px 0 0 -700px; border-radius: 50%; pointer-events: none;
  background: repeating-conic-gradient(rgba(255,233,176,.16) 0 6deg, transparent 6deg 18deg); -webkit-mask: radial-gradient(circle, #000 10%, transparent 60%); mask: radial-gradient(circle, #000 10%, transparent 60%); animation: spin 18s linear infinite; }
.g-ssr-card { position: relative; animation: ssrIn .7s cubic-bezier(.2,1.3,.3,1) both; }
.g-ssr-card .fcard { box-shadow: 0 0 80px rgba(255,214,120,.55); border-radius: 12px; }
@keyframes ssrIn { from { opacity: 0; transform: scale(.6) rotateY(90deg); } to { opacity: 1; transform: none; } }
.g-ssr-text { position: relative; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; animation: enLeft .6s ease .25s both; }
.g-ssr-text b { font-family: var(--display); font-size: 88px; line-height: 1; letter-spacing: .06em; background: linear-gradient(90deg, #ff9ad5, #ffe08a, #9dff9a, #7ad7ff); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 20px rgba(255,214,120,.6)); }
.g-ssr-text h3 { margin: 0; font-family: "Nanum Myeongjo", var(--font); font-size: 46px; color: #fff6e0; }
.g-ssr-text .fc-new { position: static; font-size: 16px; }
.g-ssr-text small { color: #ffe08a; font-size: 16px; }
.g-ssr-text p { color: var(--muted); margin: 18px 0 0; font-size: 15px; }
@keyframes enLeft { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
/* 모바일/저사양/움직임 줄이기 */
html.compact .g-top { zoom: 1.4; left: calc((30px - var(--ex)) / 1.4); right: calc((30px - var(--ex)) / 1.4); top: calc((24px - var(--ey)) / 1.4); }
html.compact .g-panel { zoom: 1.25; left: 640px; top: 520px; width: 640px; }
html.compact .g-copy p { font-size: 18px; }
html.compact .g-hint, html.compact .g-actions { zoom: 1.4; }
html.lowfx .g-starmap .tw, html.lowfx .g-wheel { animation: none; }
html.lowfx .g-pillar { filter: none; }
@media (prefers-reduced-motion: reduce) {
  .g-wheel, #gacha.g-spinning .g-wheel, .g-starmap .tw, .g-ssr-rays, .daily-rays, .daily-gem, .fc-up, .fc-new { animation: none !important; }
  .g-card { animation: none; } .g-inner { transition-duration: .15s; }
}
.g-top .g-lobbybtn { flex: 0 0 auto; width: auto; min-width: 0; padding: 0 18px; }
.g-feat { left: -40px; }
.g-copy { left: 520px; width: 220px; }
