/* 세로 한 화면 미니앱: 상단 재화 → 던전 탭 → 릴 → 사냥 버튼 → 하단 탭. 의도적으로 어두운 단일 테마(던전 석조 + 골드 금색) */
:root {
  --ground: #15110d;
  --stone: #221b15;
  --stone-2: #2c241c;
  --line: #4a3c2c;
  --ink: #efe6d6;
  --ink-dim: #a99a84;
  --gold: #e3b450;
  --gold-deep: #9a7426;
  --blood: #d0452f;
  --r-miss: #7d7365;
  --r-adena: #e3b450;
  --r-item: #6fb0ff;
  --r-rare: #c98cff;
  --r-jack: #ff6b3d;
  --tg: #2b5278;
  --tg-bubble: #182533;
  --dg-a: #3d5a2c;
  --dg-b: #141c0e;
  --dg-accent: #9bc46a;
  --f-display: "Song Myung", "Nanum Myeongjo", serif;
  --f-body: "Gowun Dodum", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --f-num: "Silkscreen", "Gowun Dodum", ui-monospace, monospace;
  color-scheme: dark;
}
html, body { height: 100%; }
body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
.recent { display: none !important; } /* 지난 결과 칩: 헷갈려서 숨김 */
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.num { font-family: var(--f-num); font-variant-numeric: tabular-nums; letter-spacing: .02em; }

.app {
  max-width: 440px;
  margin: 0 auto;
  padding-inline: 16px;
  padding-block: 12px calc(84px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* 상단 재화 */
.top {
  display: flex; align-items: center; gap: 10px;
  background: var(--stone);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.purse { display: flex; align-items: baseline; gap: 8px; min-width: 0; flex: 1; }
.purse .lbl { font-size: 12px; color: var(--ink-dim); letter-spacing: .06em; white-space: nowrap; }
.purse .val { font-size: clamp(15px, 4.6vw, 20px); color: var(--gold); white-space: nowrap; }
.coin {
  width: 14px; height: 14px; border-radius: 50%; flex: none; align-self: center;
  background: radial-gradient(circle at 35% 35%, #ffe7a0, var(--gold) 45%, var(--gold-deep));
  box-shadow: 0 0 0 1px #5a4214;
}
.daily {
  border: 1px solid var(--gold-deep); background: transparent;
  border-radius: 999px; padding: 6px 12px; font-size: 13px; white-space: nowrap;
  color: var(--gold);
}
.daily.ready { background: var(--gold); color: #2a1d06; border-color: var(--gold); animation: pulse 1.6s ease-in-out infinite; }
.daily:disabled { color: var(--ink-dim); border-color: var(--line); cursor: default; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(227,180,80,.18); } }

/* 던전 탭 */
.dungeons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.dg {
  border: 1px solid var(--line); background: var(--stone); border-radius: 8px;
  padding: 7px 2px 6px; display: flex; flex-direction: column; align-items: center; gap: 1px;
}
.dg .n { font-family: var(--f-display); font-size: 15px; }
.dg .c { font-size: 10px; color: var(--ink-dim); }
.dg[aria-pressed="true"] { border-color: var(--dg-accent); background: color-mix(in srgb, var(--dg-a) 55%, var(--stone)); }
.dg[aria-pressed="true"] .c { color: var(--ink); }
.dg.locked { opacity: .55; filter: grayscale(.6); }
.dg .req { font-size: 9.5px; color: #ff8a8a; white-space: nowrap; }
.me-card { display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 10px 12px; border-radius: 12px; text-align: left;
  border: 1px solid var(--line); background: var(--stone-2); color: var(--ink); font: inherit; cursor: pointer; }
.me-card:hover { border-color: var(--gold-deep); }
.me-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.me-stats span { display: flex; flex-direction: column; gap: 1px; }
.me-stats small { font-size: 11px; color: var(--ink-dim); }
.me-stats b { font-size: 17px; color: var(--ink); }
.me-stats b.pw { color: var(--gold); }
.me-w { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-w > b { color: var(--gold); }
.me-next { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 12px; color: var(--ink-dim); }
.me-next > span { display: inline-flex; align-items: center; gap: 5px; }
.me-next b { color: #ff8a8a; font-weight: 700; } .me-next b.ok { color: var(--r-item); }
.me-next.ok { color: var(--r-item); }
.me-bar { display: inline-block; width: 44px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.1); overflow: hidden; }
.me-bar > i { display: block; height: 100%; background: var(--gold); }
.me-mat { font-size: 11.5px; color: var(--ink-dim); }
.me-mat b { color: var(--ink); }
.mat-row { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--stone-2); }
.mat-h { font-size: 13px; color: var(--ink); } .mat-h small { margin-left: 6px; font-size: 11px; color: var(--ink-dim); }
.mat-have { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--ink-dim); }
.mat-have b { color: var(--ink); }
.mat-btns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.mat-btn { display: flex; flex-direction: column; gap: 3px; padding: 8px; border-radius: 10px; text-align: left; font: inherit; font-size: 12.5px;
  border: 1px solid var(--line); background: var(--stone); color: var(--ink); cursor: pointer; word-break: keep-all; }
.mat-btn small { font-size: 10.5px; color: var(--ink-dim); line-height: 1.35; }
.mat-btn:disabled { opacity: .5; cursor: default; }
.mat-btn:not(:disabled):hover { border-color: var(--gold-deep); }
.mat-chip { display: inline-block; margin-top: 4px; padding: 2px 10px; border-radius: 99px; font-size: 12.5px; color: var(--ink);
  background: color-mix(in srgb, var(--r-item) 22%, transparent); border: 1px solid color-mix(in srgb, var(--r-item) 55%, transparent); animation: mat-pop .4s ease-out; }
@keyframes mat-pop { from { transform: scale(.6); opacity: 0; } }
.chest-row .mat-ic { width: 40px; height: 40px; object-fit: contain; }
.mat-img { width: 1.35em; height: 1.35em; object-fit: contain; vertical-align: -.35em; }
.chest-row .nm .mat-img { width: 18px; height: 18px; vertical-align: -4px; }   /* 요새 상자 칸의 재료 덤(2026-11-22) — 줄 머리 아이콘(36px)보다 작게 */
.mat-btn .mat-img { width: 22px; height: 22px; vertical-align: -6px; margin-right: 2px; }
.sheet-h .mat-img { width: 26px; height: 26px; }
.set-bonus { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; color: var(--ink-dim); }
.set-bonus span.on { color: var(--r-item); font-weight: 700; } .set-bonus small { font-size: 11px; }
.set-list { display: flex; flex-direction: column; gap: 6px; }
.set-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--stone-2); }
.set-row img { width: 38px; height: 38px; object-fit: contain; }
.set-row > div { flex: 1; min-width: 0; } .set-row b { display: block; font-size: 14px; } .set-row small { font-size: 11.5px; color: var(--ink-dim); }
@media (max-width: 999px) { .me-mat { display: none; } .me-card { gap: 4px; padding: 8px 12px; } .me-stats b { font-size: 15px; } .me-next { flex-wrap: nowrap; gap: 8px; font-size: 11px; } .me-bar { width: 26px; } }
.atkdef { font-size: 11.5px; color: var(--ink-dim); text-align: center; }
.atkdef b { color: var(--ink); }
small.pre-b { display: inline-block !important; width: auto; margin-top: 0; color: var(--pc) !important; font-size: 10.5px !important; } /* 가방·거래소 .nm small(block)보다 우선 */
.pre-b { display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 6px; font-size: 10.5px; line-height: 1.5; font-weight: 700; vertical-align: 1px;
  color: var(--pc); border: 1px solid color-mix(in srgb, var(--pc) 60%, transparent); background: color-mix(in srgb, var(--pc) 14%, transparent); white-space: nowrap; }
.gr-legend { font-size: 11.5px; color: var(--ink-dim); } .gr-legend b { font-weight: 700; margin-right: 2px; }

/* 사냥 무대 */
.stage {
  position: relative;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--dg-accent) 40%, var(--line));
  background:
    linear-gradient(rgba(0,0,0,.25), rgba(0,0,0,.15) 40%, color-mix(in srgb, var(--dg-b) 85%, transparent) 92%),
    var(--dg-bg, none) center 28% / cover no-repeat,
    radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--dg-a) 90%, white 4%), var(--dg-b) 75%);
  padding: 14px 14px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  overflow: hidden;
  transition: background .4s;
}
.stage-head { width: 100%; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.stage-title { font-family: var(--f-display); font-size: 22px; text-wrap: balance; }
.stage-sub { font-size: 12px; color: var(--ink-dim); }
.vol { font-size: 11px; color: var(--dg-accent); letter-spacing: .08em; white-space: nowrap; }
.reel-frame {
  width: 168px; height: 168px; position: relative;
  border-radius: 12px;
  background: rgba(0,0,0,.35);
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.5), inset 0 0 0 4px color-mix(in srgb, var(--dg-accent) 35%, transparent), 0 10px 30px rgba(0,0,0,.4);
  overflow: hidden;
}
.reel-frame::before, .reel-frame::after {
  content: ""; position: absolute; left: 0; right: 0; height: 34px; z-index: 2; pointer-events: none;
}
.reel-frame::before { top: 0; background: linear-gradient(rgba(0,0,0,.55), transparent); }
.reel-frame::after { bottom: 0; background: linear-gradient(transparent, rgba(0,0,0,.55)); }
.strip { display: flex; flex-direction: column; will-change: transform; }
.cell { height: 168px; flex: none; display: grid; place-items: center; }
.cell img { width: 140px; height: 140px; object-fit: contain; filter: drop-shadow(0 6px 6px rgba(0,0,0,.6)); }
.reel-frame .fx { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.fx { --s: 168px; width: var(--s); height: var(--s); background-size: calc(var(--s) * 4) var(--s); background-repeat: no-repeat;
  animation: fx-play var(--d, .32s) steps(4) forwards; }
@keyframes fx-play { from { background-position: 0 0; } to { background-position: calc(var(--s) * -4) 0; } }
.cell.hit img { animation: hit .3s ease-out; }
@keyframes hit { 30% { transform: translateX(-5px); filter: brightness(2.2) sepia(1) hue-rotate(-40deg) saturate(4); } 60% { transform: translateX(4px); } }
.result {
  min-height: 52px; text-align: center; display: flex; flex-direction: column; justify-content: center; gap: 2px;
}
.result .mon { font-size: 13px; color: var(--ink-dim); }
.result .gain { font-size: 18px; font-weight: 700; }
.result .gain .num { font-size: 17px; }
.k-miss { color: var(--r-miss); } .k-adena { color: var(--r-adena); } .k-item { color: var(--r-item); }
.k-rare { color: var(--r-rare); } .k-jackpot { color: var(--r-jack); }

.stage.flash-item .reel-frame { animation: ring-item .7s ease-out; }
.stage.flash-rare { animation: shake .45s ease-in-out; }
.stage.flash-rare .reel-frame { animation: ring-rare 1s ease-out; }
@keyframes ring-item { from { box-shadow: 0 0 0 3px var(--r-item), 0 0 40px var(--r-item); } }
@keyframes ring-rare { from { box-shadow: 0 0 0 4px var(--r-rare), 0 0 60px var(--r-rare); } }
@keyframes shake { 20%{transform:translateX(-5px)} 40%{transform:translateX(5px)} 60%{transform:translateX(-3px)} 80%{transform:translateX(2px)} }

/* 사냥 버튼 */
.controls { display: grid; grid-template-columns: 1fr 2.2fr; gap: 8px; }
.btn {
  border-radius: 12px; border: 1px solid var(--line); background: var(--stone-2);
  padding: 12px 10px; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.btn small { font-size: 11px; color: var(--ink-dim); }
#hunt10.stop { border-color: var(--blood); color: #ffd9cf; background: color-mix(in srgb, var(--blood) 25%, var(--stone-2)); }
.sheet-bg { position: fixed; inset: 0; z-index: 45; background: rgba(0,0,0,.6); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 440px; background: var(--stone); border: 1px solid var(--line); border-bottom: 0;
  border-radius: 16px 16px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 12px;
  animation: sheet-up .2s ease-out; }
@keyframes sheet-up { from { transform: translateY(30px); opacity: 0; } }
.sheet-h { font-family: var(--f-display); font-size: 18px; }
.seg.speed { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.seg.speed button { border: 1px solid var(--line); background: var(--stone-2); border-radius: 10px; padding: 9px; }
.seg.speed button[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); }
.auto-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.auto-n { border: 1px solid #e0745c; background: linear-gradient(#b8452f, #8a2a1c); border-radius: 12px; padding: 14px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 2px; box-shadow: 0 3px 0 #4f160d; }
.auto-n b { font-size: 18px; } .auto-n small { font-size: 11px; color: #ffd9cf; }
.auto-n:disabled { opacity: .4; }
.sheet-note { font-size: 12px; color: var(--ink-dim); text-align: center; }
.sheet-x { align-self: center; }
.btn-boss { width: 100%; flex-direction: row; justify-content: space-between; gap: 8px; text-align: left; padding: 10px 14px;
  border-color: #b38a2e; background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 22%, var(--stone-2)), var(--stone-2)); }
.btn-boss .bt b { font-family: var(--f-display); font-size: 17px; color: var(--gold); }
.btn-boss small { text-align: right; }
.btn-boss:disabled { opacity: .45; }
.btn-bless { display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px; padding: 10px; border: 1px solid var(--gold);
  background: linear-gradient(#6a5418, #3e300c); color: #fff3cf; font-family: var(--f-display); font-size: 16px; flex-wrap: wrap; }
.btn-bless img { width: 26px; height: 26px; object-fit: contain; }
.btn-bless small { width: 100%; font-family: var(--f-body); font-size: 11px; color: #e9d7a0; }
.btn-bless:disabled { opacity: .45; }
.boss-ov { justify-content: flex-start; overflow-y: auto; gap: 10px; }
.boss-ov .ov-title { font-size: 26px; color: var(--r-jack); }
.hpbar { position: relative; width: min(360px, 100%); height: 18px; border-radius: 9px; background: #2a0c08; border: 1px solid #6a2a1c; overflow: hidden; flex: none; }
.hpbar i { position: absolute; inset: 0 auto 0 0; width: 100%; background: linear-gradient(#e2553a, #9a2414); transition: width .35s ease-out; }
.hpbar span { position: relative; font-size: 11px; line-height: 18px; display: block; text-align: center; color: #fff; text-shadow: 0 1px 2px #000; }
.boss-stage { position: relative; isolation: isolate; width: min(360px, 100%); height: 260px; flex: none; border-radius: 14px; overflow: hidden;
  background-size: cover; background-position: center 30%; display: grid; place-items: center; border: 1px solid var(--line);
  box-shadow: inset 0 -60px 60px rgba(0,0,0,.6); }
.boss-stage > .fx { position: absolute; --s: 220px; }
.boss-art { width: 230px; height: 230px; object-fit: contain; filter: drop-shadow(0 10px 12px rgba(0,0,0,.7)); animation: boss 1s ease-out; }
.boss-art.hit { animation: hit .3s ease-out; }
.boss-art.crit { animation: crit .45s ease-out; }
@keyframes crit { 20% { transform: translateX(-10px) scale(1.06); filter: brightness(3) saturate(0); } 50% { transform: translateX(8px); } 75% { transform: translateX(-4px); } }
.boss-art.gone { animation: vanish .9s forwards; }
.boss-art.flee { transition: transform .8s ease-in, opacity .8s; transform: translateX(140%); opacity: 0; }
.dmg-layer { position: absolute; inset: 0; pointer-events: none; }
.dmg { position: absolute; top: 38%; font-family: var(--f-num); font-size: 22px; color: #fff; text-shadow: 0 2px 0 #000, 0 0 8px #000; animation: dmg .9s ease-out forwards; }
.dmg.crit { font-size: 30px; color: var(--r-jack); } .dmg.strong { color: #ffd27a; } .dmg.miss { color: var(--ink-dim); font-size: 18px; }
@keyframes dmg { to { transform: translateY(-60px); opacity: 0; } }
.boss-log { min-height: 22px; font-size: 14px; color: var(--ink); }
.boss-got { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; min-height: 34px; max-width: 360px; }
.boss-got .gi { width: 34px; height: 34px; border-radius: 6px; background: var(--stone); border: 1px solid var(--line); display: grid; place-items: center; }
.boss-got .gi img { width: 28px; height: 28px; object-fit: contain; }
.boss-ctl { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; width: min(360px, 100%); }
.chest { width: 150px; height: 150px; object-fit: contain; }
.chest.shake { animation: chest-shake .25s ease-in-out infinite; }
@keyframes chest-shake { 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
.chest.pop { animation: chest-pop .6s ease-out forwards; }
@keyframes chest-pop { 0% { transform: scale(1); filter: brightness(3); } 100% { transform: scale(1.15); filter: drop-shadow(0 0 24px #ffd36a); } }
.boss-stage.flash-big { animation: shake .45s ease-in-out; }
.chest-list { display: flex; flex-direction: column; gap: 6px; width: min(360px, 100%); }
.chest-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 8px; align-items: center; padding: 6px 10px; border-radius: 10px;
  background: var(--stone); border: 1px solid var(--line); text-align: left; animation: sheet-up .3s ease-out; }
.chest-row img { width: 36px; height: 36px; object-fit: contain; }
.chest-row.t-E { border-color: var(--r-jack); box-shadow: 0 0 18px color-mix(in srgb, var(--r-jack) 40%, transparent); }
.chest-row.t-L { border-color: var(--gold); box-shadow: 0 0 24px color-mix(in srgb, var(--gold) 55%, transparent); }
.boss-only { color: #ff8a5c; font-weight: 700; }
.seg.slot6 { grid-template-columns: repeat(3, 1fr); }
.seg.slot6 button small { display: block; font-family: var(--f-num); font-size: 11px; color: var(--ink-dim); }
.boss-sum { font-size: 15px; } .boss-sum small { color: var(--ink-dim); }
.btn-hunt {
  background: linear-gradient(#b8452f, #8a2a1c);
  border: 1px solid #e0745c;
  box-shadow: 0 3px 0 #4f160d, inset 0 1px 0 rgba(255,255,255,.2);
  font-family: var(--f-display); font-size: 22px; letter-spacing: .1em;
}
.btn-hunt small { color: #ffd9cf; font-family: var(--f-body); letter-spacing: 0; }
.btn-hunt:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #4f160d; }
.btn:disabled { opacity: .45; cursor: default; }
.notice { font-size: 13px; color: var(--blood); text-align: center; min-height: 1.2em; }

.recent { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; }
.chip {
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  border: 1px solid currentColor; background: rgba(0,0,0,.25); white-space: nowrap;
}

details.odds { background: var(--stone); border: 1px solid var(--line); border-radius: 10px; }
details.odds summary { padding: 10px 12px; cursor: pointer; font-size: 13px; color: var(--ink-dim); }
.odds-body { padding: 0 12px 12px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td { text-align: left; padding: 5px 4px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--ink-dim); font-weight: 400; font-size: 11px; letter-spacing: .05em; }
td.r, th.r { text-align: right; }
.rtp { margin-top: 8px; font-size: 12px; color: var(--ink-dim); }
.rtp b { color: var(--gold); font-weight: 400; }

/* 강화 탭 */
.char {
  background:
    radial-gradient(90% 70% at 50% 20%, #3a2c1e, var(--stone) 70%);
  border: 1px solid var(--line); border-radius: 14px;
  padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
}
.char-tag { font-size: 11px; color: var(--ink-dim); letter-spacing: .1em; }
.char-stage { display: flex; align-items: flex-end; justify-content: center; gap: 4px; width: 100%; }
.char-pick { position: relative; background: none; border: 0; padding: 0; display: grid; justify-items: center; }
.char-pick img { height: 200px; width: 120px; object-fit: contain; object-position: bottom; filter: drop-shadow(0 8px 8px rgba(0,0,0,.6)); }
.char-pick span { position: absolute; bottom: -2px; font-size: 11px; color: var(--ink-dim); background: rgba(0,0,0,.55); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.char-stage .weapon-art { width: 110px; height: 110px; margin-bottom: 30px; }
.cls-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.cls { border: 1px solid var(--line); background: var(--stone-2); border-radius: 10px; padding: 6px 2px 4px; display: grid; justify-items: center; gap: 2px; font-size: 11px; }
.cls img { height: 84px; width: 100%; object-fit: contain; object-position: bottom; }
.cls[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, var(--stone-2)); }
.row .av { width: 38px; height: 38px; border-radius: 8px; overflow: hidden; background: var(--stone-2); border: 1px solid var(--line); }
.row .av img { display: block; width: 150%; height: auto; margin: -2px 0 0 -25%; }
.weapon-art { width: 120px; height: 120px; object-fit: contain; transition: filter .3s; filter: var(--glow, none); }
.weapon-wrap { position: relative; display: grid; place-items: center; }
.weapon-wrap .fx { position: absolute; --s: 180px; }
.weapon-art.charging { animation: charge .9s ease-in infinite; }
@keyframes charge { 50% { transform: scale(1.06) rotate(-3deg); filter: drop-shadow(0 0 18px #fff) brightness(1.4); } }
.weapon-art.gone { animation: vanish .8s forwards; }
@keyframes vanish { to { opacity: 0; transform: scale(.2) rotate(40deg); filter: brightness(3); } }
.wname { font-family: var(--f-display); font-size: 24px; text-wrap: balance; }
.wname .plus { font-family: var(--f-num); font-size: 20px; margin-right: 4px; }
.power { font-size: 13px; color: var(--ink-dim); }
.power .num { color: var(--gold); font-size: 15px; }
.slots { display: flex; gap: 8px; font-size: 12px; color: var(--ink-dim); flex-wrap: wrap; justify-content: center; }

.enchant {
  background: var(--stone); border: 1px solid var(--line); border-radius: 12px; padding: 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.seg button { border: 1px solid var(--line); background: transparent; border-radius: 8px; padding: 7px; font-size: 13px; }
.seg button[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); }
.odds-line { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; flex-wrap: wrap; }
.odds-line .p { font-size: 22px; }
.ench-stat { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(0,0,0,.25); font-size: 13px; }
.ench-stat:empty { display: none; }
.es-row { display: flex; justify-content: space-between; gap: 10px; }
.es-row > span:first-child { color: var(--ink-dim); white-space: nowrap; }
.es-row > span:last-child { text-align: right; }
.es-row b { color: var(--gold); }
.es-row em { font-style: normal; color: var(--r-item); }
.es-ok { color: var(--r-item); font-weight: 700; }
.es-bad { color: #ff6b6b; font-weight: 700; }
.es-bless > span:last-child { color: var(--gold); font-size: 12px; }
.es-table summary { cursor: pointer; color: var(--ink-dim); font-size: 12px; padding-top: 4px; }
.es-table table { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 12px; }
.es-table th, .es-table td { padding: 3px 4px; text-align: right; border-bottom: 1px solid var(--line); }
.es-table th:first-child, .es-table td:first-child { text-align: left; }
.es-table tr.on td { color: var(--gold); font-weight: 700; }
.es-table small { display: block; margin-top: 4px; color: var(--ink-dim); font-size: 11px; }
.es-prot { color: var(--gold); font-weight: 700; }
.prot-row { display: grid; gap: 6px; }
.prot-row .crys { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-dim); }
.prot-row .crys img { width: 20px; height: 20px; }
.prot-row .crys b { color: var(--r-rare); }
.prot-row .crys .mini { margin-left: auto; }
.prot-btn { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--stone-2); color: var(--ink); font-size: 14px; }
.prot-btn i { flex: none; width: 20px; height: 20px; border-radius: 5px; border: 2px solid var(--ink-dim); }
.prot-btn[aria-pressed="true"] { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, var(--stone-2)); }
.prot-btn[aria-pressed="true"] i { border-color: var(--gold); background: var(--gold); box-shadow: inset 0 0 0 3px var(--stone-2); }
.prot-btn small { display: block; font-size: 11.5px; color: var(--ink-dim); margin-top: 2px; }
.prot-btn:disabled { opacity: .5; }
.crys-note { font-size: 11px; color: var(--ink-dim); }
.prot-row .crys b.seal-n { color: var(--r-jack); }
.es-extra b { color: var(--ink); font-weight: 700; }
.es-extra b.lack { color: #ff6b6b; }
.es-extra small { color: var(--ink-dim); font-size: 11px; }
.duel-elite-h { margin-top: 8px; font-family: var(--f-display); font-size: 15px; color: var(--r-jack); }
.duel-elite-h small { display: block; font-family: inherit; font-size: 11.5px; color: var(--ink-dim); }
.duel-row.elite { border-color: color-mix(in srgb, var(--r-jack) 55%, var(--line)); background: linear-gradient(90deg, color-mix(in srgb, var(--r-jack) 14%, var(--stone-2)), var(--stone-2)); }
.duel-row.elite .rw { color: var(--r-jack); }
.seal-ic { margin-right: 3px; }
.ov-result .crys-got { display: block; font-size: 15px; color: var(--r-rare); margin-top: 6px; }
.safe { color: #8fd18a; } .risky { color: var(--blood); }
.btn-enchant {
  border-radius: 10px; padding: 12px; border: 1px solid #6f8fd8;
  background: linear-gradient(#3d5aa8, #283c78); box-shadow: 0 3px 0 #141f45;
  font-family: var(--f-display); font-size: 18px; letter-spacing: .06em;
}
.btn-enchant:disabled { opacity: .45; cursor: default; }
.ench-msg { text-align: center; min-height: 1.4em; font-size: 15px; }

.bag { display: flex; flex-direction: column; gap: 6px; }
.bag h3, .section-h { font-family: var(--f-display); font-weight: 400; font-size: 17px; margin: 4px 0 0; }
.it {
  display: grid; grid-template-columns: 36px 1fr auto auto; gap: 8px; align-items: center;
  background: var(--stone); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
}
.it .nm { min-width: 0; font-size: 14px; }
.it .ic { width: 36px; height: 36px; object-fit: contain; filter: var(--glow); }
.result .gain img { width: 26px; height: 26px; object-fit: contain; vertical-align: -7px; margin-right: 4px; }
.it .nm small { display: block; font-size: 11px; color: var(--ink-dim); }
.it.on { border-color: var(--gold-deep); }
.mini { border: 1px solid var(--line); background: transparent; border-radius: 6px; padding: 4px 8px; font-size: 12px; white-space: nowrap; }
.mini:disabled { opacity: .4; cursor: default; }
.empty { font-size: 13px; color: var(--ink-dim); padding: 6px 2px; }

/* 랭킹 */
.rank { display: flex; flex-direction: column; gap: 4px; }
.row {
  display: grid; grid-template-columns: 24px 38px 1fr auto; gap: 8px; align-items: center;
  padding: 6px 10px; border-radius: 8px; background: var(--stone); border: 1px solid var(--line);
}
.row .pos { font-family: var(--f-num); color: var(--ink-dim); text-align: center; }
.row:nth-child(-n+3) .pos { color: var(--gold); }
.row .who { min-width: 0; }
.row .who small { display: block; font-size: 11.5px; color: var(--ink-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.me { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 10%, var(--stone)); }
.example { font-size: 11px; color: var(--ink-dim); }
.feed { display: flex; flex-direction: column; gap: 6px; }
.demo-tools { display: flex; gap: 8px; flex-wrap: wrap; }

/* 텔레그램 봇 메시지 (토스트) */
.toasts {
  position: fixed; left: 0; right: 0; top: calc(8px + env(safe-area-inset-top, 0px));
  z-index: 50; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none;
  padding-inline: 16px;
}
.tg {
  width: 100%; max-width: 408px;
  background: var(--tg-bubble); border: 1px solid #2a3b4e; border-radius: 12px;
  padding: 8px 10px; display: grid; grid-template-columns: 30px 1fr; gap: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.5); pointer-events: auto;
  animation: drop .3s ease-out;
}
.tg.out { animation: lift .3s ease-in forwards; }
@keyframes drop { from { transform: translateY(-16px); opacity: 0; } }
@keyframes lift { to { transform: translateY(-16px); opacity: 0; } }
.tg .av {
  width: 30px; height: 30px; border-radius: 50%; background: var(--tg);
  display: grid; place-items: center; font-family: var(--f-display); font-size: 15px; color: #fff;
}
.tg .bn { font-size: 12px; color: #6ab3f3; }
.tg .tx { font-size: 13.5px; color: #e8eef4; }
.tg .tx b { color: #fff; }
.tg { pointer-events: none !important; } .tg .act { pointer-events: auto; }
.tg .act { margin-top: 6px; border: 0; border-radius: 6px; background: #2b5278; color: #fff; padding: 5px; width: 100%; font-size: 13px; }
.feed .tg { animation: none; box-shadow: none; max-width: none; }

/* 중계 / 잭팟 오버레이 */
.overlay {
  position: fixed; inset: 0; z-index: 40;
  background: radial-gradient(circle at 50% 45%, rgba(40,24,10,.92), rgba(5,3,2,.97));
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 24px 16px; text-align: center;
}
.live-badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; letter-spacing: .12em;
  color: #fff; background: var(--blood); padding: 3px 10px; border-radius: 4px;
}
.live-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.ov-title { font-family: var(--f-display); font-size: 26px; text-wrap: balance; }
.ov-sub { color: var(--ink-dim); font-size: 13px; }
.ov-count { font-family: var(--f-num); font-size: 64px; color: var(--gold); line-height: 1; min-height: 64px; }
.ov-art { width: 200px; height: 200px; object-fit: contain; filter: var(--glow, drop-shadow(0 8px 10px rgba(0,0,0,.6))); }
.ov-result { font-family: var(--f-display); font-size: 30px; min-height: 1.3em; }
.overlay .close { margin-top: 8px; border: 1px solid var(--line); background: var(--stone); border-radius: 8px; padding: 8px 20px; }
.overlay.jack .ov-title { color: var(--r-jack); font-size: 30px; }
.overlay.jack .ov-art { animation: boss 1.2s ease-out; }
@keyframes boss { from { transform: scale(2.2); filter: brightness(4); } }
.rays {
  position: absolute; inset: -50%; z-index: -1;
  background: repeating-conic-gradient(from 0deg, rgba(255,140,60,.10) 0 8deg, transparent 8deg 20deg);
  animation: spin 14s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 하단 탭 */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: #100c09; border-top: 1px solid var(--line);
  padding: 6px 16px calc(6px + env(safe-area-inset-bottom, 0px));
}
.nav-in { max-width: 440px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.nav button { background: transparent; border: 0; padding: 8px 4px; border-radius: 8px; font-size: 14px; color: var(--ink-dim); }
.nav button[aria-pressed="true"] { color: var(--gold); background: var(--stone); }
.sound { position: absolute; right: 12px; top: 12px; z-index: 3; border: 1px solid rgba(255,255,255,.15); background: rgba(0,0,0,.3); border-radius: 6px; font-size: 11px; padding: 3px 7px; color: var(--ink-dim); }

