﻿

.screen { padding-top: 14px; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.menu-screen {
  position: fixed; inset: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center;
  padding: 28px 20px; overflow: hidden;
  animation: fade .4s ease;
}
.menu-bg {
  position: absolute; inset: -3%;
  background: #0b0912 url('../assets/ui/bg_intro.png') center/cover no-repeat;
  filter: saturate(.85) brightness(.42);
  animation: kenburns 34s ease-in-out infinite alternate;
}
@keyframes kenburns {
  from { transform: scale(1) translate(0, 0); }
  to { transform: scale(1.12) translate(-1.5%, -1%); }
}
.menu-vignette {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(58% 62% at 50% 42%, rgba(255,150,60,.16), transparent 72%),
    radial-gradient(90% 80% at 50% 50%, transparent 30%, rgba(4,3,8,.86) 100%),
    linear-gradient(rgba(4,3,8,.55), rgba(4,3,8,.2) 40%, rgba(4,3,8,.9));
}

.menu-embers { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.menu-embers i {
  position: absolute; bottom: -20px; width: 4px; height: 4px; border-radius: 50%;
  background: #ffb14a; box-shadow: 0 0 10px 2px rgba(255,150,50,.75);
  animation: ember linear infinite;
}
@keyframes ember {
  0% { transform: translateY(0) scale(.6); opacity: 0; }
  15% { opacity: .9; }
  100% { transform: translateY(-88vh) translateX(30px) scale(1.1); opacity: 0; }
}
.menu-embers i:nth-child(1) { left: 8%; animation-duration: 13s; animation-delay: 0s; }
.menu-embers i:nth-child(2) { left: 17%; animation-duration: 16s; animation-delay: 2s; }
.menu-embers i:nth-child(3) { left: 26%; animation-duration: 11s; animation-delay: 5s; }
.menu-embers i:nth-child(4) { left: 34%; animation-duration: 18s; animation-delay: 1s; }
.menu-embers i:nth-child(5) { left: 43%; animation-duration: 14s; animation-delay: 7s; }
.menu-embers i:nth-child(6) { left: 52%; animation-duration: 12s; animation-delay: 3s; }
.menu-embers i:nth-child(7) { left: 61%; animation-duration: 17s; animation-delay: 6s; }
.menu-embers i:nth-child(8) { left: 70%; animation-duration: 13s; animation-delay: 9s; }
.menu-embers i:nth-child(9) { left: 78%; animation-duration: 15s; animation-delay: 4s; }
.menu-embers i:nth-child(10) { left: 86%; animation-duration: 19s; animation-delay: 8s; }
.menu-embers i:nth-child(11) { left: 93%; animation-duration: 12s; animation-delay: 11s; }
.menu-embers i:nth-child(12) { left: 3%; animation-duration: 20s; animation-delay: 6s; }

.menu-guard {
  position: absolute; bottom: 4vh; height: min(34vh, 300px); width: auto;
  opacity: .5; filter: brightness(.55) contrast(1.1) drop-shadow(0 10px 20px rgba(0,0,0,.8));
  pointer-events: none;
}
.menu-guard.left { left: 5vw; transform: scaleX(-1); }
.menu-guard.right { right: 6vw; }
@media (max-width: 1180px) { .menu-guard { display: none; } }

.menu-inner {
  position: relative; z-index: 2;
  width: 100%; max-width: 620px; text-align: center;
  max-height: 100%; overflow-y: auto; scrollbar-width: none;
  animation: menuIn .55s cubic-bezier(.2,.9,.3,1);
}
.menu-inner::-webkit-scrollbar { display: none; }
@keyframes menuIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.menu-inner::before {
  content: ''; position: absolute; inset: -8% -12%; z-index: -1; pointer-events: none;
  background: radial-gradient(58% 52% at 50% 42%, rgba(8,6,14,.78), rgba(8,6,14,.35) 62%, transparent 78%);
  filter: blur(18px);
}

#menu-logo {
  width: min(92%, 620px);
  animation: logoIn .7s cubic-bezier(.2,1.3,.4,1);
}
@keyframes logoIn { from { opacity: 0; transform: translateY(-14px) scale(.94); } }

.screen-logo { display: block; width: min(360px, 62%); margin: 4px auto 14px; }
.head-logo { height: 30px; width: auto; margin-right: 12px; }
.menu-title {
  font-family: 'PixelTitle', monospace; font-size: clamp(26px, 5.4vw, 44px);
  color: #fff; letter-spacing: 3px; margin: 14px 0 10px;
  text-shadow: 3px 3px 0 #000, 0 0 34px rgba(255,160,60,.75);
}
.menu-screen .tagline { font-size: 15px; color: #d8cfc2; margin-bottom: 28px; }

.menu-actions { display: flex; flex-direction: column; gap: 10px; align-items: stretch; margin: 0 0 22px; }

.gbtn {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 12px 14px; cursor: pointer; text-align: left;
  color: var(--text); font-family: inherit;
  background:
    linear-gradient(rgba(255,255,255,.06), transparent 45%),
    linear-gradient(90deg, rgba(38,32,52,.95), rgba(20,17,30,.95));
  border: 2px solid #4a4458; border-radius: 10px;
  box-shadow: 0 5px 0 rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.07);
  transition: transform .1s, border-color .14s, box-shadow .14s, filter .14s;
}
.gbtn:hover { border-color: var(--gold); filter: brightness(1.08); box-shadow: 0 5px 0 rgba(0,0,0,.5), 0 0 24px rgba(255,190,70,.22); }
.gbtn:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0,0,0,.5); }

.gbtn.green {
  background:
    linear-gradient(rgba(255,255,255,.18), transparent 45%),
    linear-gradient(90deg, #4fae55, #2f8235);
  border-color: #6bd071;
  box-shadow: 0 5px 0 rgba(0,40,0,.55), inset 0 1px 0 rgba(255,255,255,.25);
}
.gbtn.green:hover { border-color: #b6ffb9; }

.gbtn-ico {
  flex: 0 0 auto; width: 66px; height: 77px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle, rgba(255,200,110,.18), transparent 70%), rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--gold);
}
.gbtn.green .gbtn-ico { color: #eaffea; background: rgba(0,0,0,.22); }
.gbtn-ico .ico { width: 26px; height: 26px; }
.gbtn-ico .ico svg { width: 100%; height: 100%; }
.gbtn-img {
  max-width: 60px;
  max-height: 77px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .7));
}

.gbtn-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.gbtn-title {
  font-family: 'PixelTitle', monospace;
  font-size: 16px;
  color: #fff;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, .65);
}
.gbtn-sub { font-size: 13px; color: #cfc7ba; }
.gbtn.green .gbtn-sub { color: #dff6df; }
.gbtn-bar {
  display: block; height: 6px; margin-top: 3px; border-radius: 3px;
  background: rgba(0,0,0,.45); overflow: hidden;
}
.gbtn-bar-fill { display: block; height: 100%; background: linear-gradient(90deg, #ffd83d, #ff9a3d); }
.gbtn-go { font-size: 22px; color: rgba(255,255,255,.35); flex: 0 0 auto; }
.gbtn:hover .gbtn-go { color: var(--gold); }

.stat-grid {
  display: flex; gap: 0; margin: 14px 0 8px;
  background: radial-gradient(75% 120% at 50% 50%, rgba(24,20,36,.92), rgba(12,10,20,.55) 70%, transparent);
  border-radius: 12px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.stat-box {
  flex: 1; border: none; border-radius: 0; background: none;
  padding: 14px 8px; backdrop-filter: none; box-shadow: none;
}
.btn.hero {
  width: min(100%, 420px); font-size: 14px; padding: 20px 22px;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  letter-spacing: 1px;
}
.btn.hero:hover { filter: brightness(1.12); }
.btn-ico { width: 22px; height: 22px; flex: 0 0 auto; }
.btn-ico svg { width: 100%; height: 100%; }

.stat-box {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-align: center;
}
.sb-ico { width: 22px; height: 22px; color: var(--dim); }
.sb-ico svg { width: 100%; height: 100%; }
.stat-box.em .sb-ico { color: var(--em); }
.stat-box.win .sb-ico { color: var(--gold); }
.sb-val { display: block; font-family: 'PixelTitle', monospace; font-size: 14px; color: #fff; }
.sb-val.em { color: var(--em); }
.stat-box.em .sb-val { color: var(--em); }
.stat-box.win .sb-val { color: var(--gold); }
.sb-lab { display: block; font-size: 13px; color: var(--dim); }

@media (max-width: 520px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .menu-screen { padding: 20px 14px; }
}

.prep-screen {
  position: fixed; inset: 0; z-index: 4; display: flex; padding: 0;
  background: #14121c url('../assets/ui/deepslate.png') repeat;
  background-size: 96px 96px;
}
.prep-screen::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(75% 55% at 50% 0%, rgba(255,150,60,.10), transparent 70%),
              linear-gradient(rgba(10,8,16,.85), rgba(10,8,16,.95));
}
.prep-wrap {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; min-height: 0;
  width: 100%; max-width: 1780px; margin: 0 auto;
  padding: clamp(10px, 1.4vh, 18px) clamp(14px, 2.4vw, 44px) calc(clamp(10px, 1.4vh, 18px) + var(--safe-b));
}
.prep-top {
  flex: 0 0 auto; order: 2; margin-top: clamp(10px, 1.6vh, 18px);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.phud-go.quit {
  background: linear-gradient(#3d3a4c, #26242f);
  border-color: #55506a; border-top-color: #6e6885;
  box-shadow: 0 4px 0 #171520, 0 10px 22px rgba(0,0,0,.5);
  color: #cfc9bd;
}
.phud-go.quit:hover { box-shadow: 0 6px 0 #171520, 0 16px 28px rgba(0,0,0,.55); }
.phud-go.quit:active { box-shadow: 0 2px 0 #171520; }
.phud-go.quit .phud-go-ico { color: #cfc9bd; animation: none; }
.prep-cols {
  flex: 1 1 auto; min-height: 0; order: 1;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(10px, 1.2vw, 22px);
}
.prep-hero { grid-column: span 3; }
.prep-bag { grid-column: span 4; }
.prep-detail { grid-column: span 5; }

@media (min-width: 1500px) {
  .prep-bag { grid-column: span 3; }
  .prep-detail { grid-column: span 6; }
}
@media (max-width: 1000px) {
  .prep-hero { grid-column: span 4; }
  .prep-bag { grid-column: span 4; }
  .prep-detail { grid-column: span 4; }
}

.prep-hero {
  display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto;
  scrollbar-width: none;
  border-radius: 12px; padding: 14px;
}
.prep-hero::-webkit-scrollbar { display: none; }

.ph-id { text-align: center; }
.ph-name {
  display: block; font-family: 'PixelTitle', monospace; font-size: 16px; color: #fff;
  text-shadow: 2px 2px 0 #000, 0 0 22px rgba(255,180,70,.45); line-height: 1.6;
}
.ph-class {
  display: block; font-family: 'PixelTitle', monospace; font-size: 9px;
  color: var(--gold); letter-spacing: 2px; margin-top: 6px;
}
.ph-stage { position: relative; flex: 1 1 auto; min-height: clamp(220px, 30vh, 400px); }
.ph-glow {
  position: absolute; left: 50%; bottom: 6%; width: 62%; aspect-ratio: 1;
  transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(circle, rgba(255,190,90,.26), transparent 68%);
  filter: blur(6px);
}
.ph-figure {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  height: 86%; width: auto; max-width: 100%; object-fit: contain;
  image-rendering: pixelated; filter: drop-shadow(0 10px 14px rgba(0,0,0,.75));
}
.ph-slot { position: absolute; z-index: 2; }
.bslot[draggable="true"] { cursor: grab; }
.bslot.dragging { opacity: .35; cursor: grabbing; }
.ph-slot, .ph-arts { border-radius: 12px; transition: box-shadow .15s, transform .15s; }
.drop-ok { box-shadow: 0 0 0 2px rgba(255,216,61,.55), 0 0 22px rgba(255,216,61,.3); }
.drop-ok .slot-frame { border-color: var(--gold); }
.drop-no { opacity: .35; }
.drop-over { box-shadow: 0 0 0 3px var(--gold), 0 0 30px rgba(255,216,61,.6); transform: scale(1.06); }
.drop-over .slot-frame { background: rgba(255,216,61,.14); }
.ph-slot.armor { top: 0; left: 50%; transform: translateX(-50%); }
.ph-slot.melee { left: 0; top: 44%; }
.ph-slot.ranged { right: 0; top: 44%; }

.ph-badge {
  position: absolute; top: 2px; z-index: 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 54px; height: 62px; padding-top: 2px;
  background: linear-gradient(#2b2738, #16131f);
  clip-path: polygon(50% 0, 100% 26%, 100% 74%, 50% 100%, 0 74%, 0 26%);
}
.ph-badge span { font-family: 'PixelTitle', monospace; font-size: 9px; color: var(--dim); letter-spacing: .5px; }
.ph-badge b { font-family: 'PixelTitle', monospace; font-size: 15px; color: #fff; margin-top: 3px; }
.ph-badge.lv { left: 0; }
.ph-badge.lv b { color: #c9a6ff; }
.ph-badge.pw { right: 0; }
.ph-badge.pw b { color: var(--gold); }

.ph-arts { display: flex; gap: 10px; justify-content: center; flex: 0 0 auto; }

.ph-name {
  font-family: 'PixelTitle', monospace; font-size: 11px; color: var(--gold);
  text-align: center; text-shadow: 1px 1px 0 #000;
}
.ph-bars { display: flex; flex-direction: column; gap: 7px; }
.ph-bar { display: flex; align-items: center; gap: 8px; }
.phb-lab { font-family: 'PixelTitle', monospace; font-size: 9px; color: var(--dim); min-width: 42px; }
.bar {
  position: relative; flex: 1; height: 20px;
  background: #100e14; border: 2px solid #000; border-radius: 4px; overflow: hidden;
}
.bar .fill { height: 100%; width: 100%; transition: width .35s cubic-bezier(.2,.8,.3,1); }
.bar.hp .fill {
  background: linear-gradient(rgba(255,255,255,.25), transparent 45%, rgba(0,0,0,.3)),
              repeating-linear-gradient(90deg, var(--hp) 0 12px, #b23030 12px 14px);
}
.bar.mp .fill {
  background: linear-gradient(rgba(255,255,255,.25), transparent 45%, rgba(0,0,0,.3)),
              repeating-linear-gradient(90deg, var(--mana) 0 12px, #3a72c9 12px 14px);
}
.bar-text {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: bold; color: #fff; text-shadow: 1px 1px 0 #000;
}
.ph-bar .bar { flex: 1; height: 18px; }
.bar.ar .fill {
  background: linear-gradient(rgba(255,255,255,.25), transparent 45%, rgba(0,0,0,.3)),
              repeating-linear-gradient(90deg, #b9a27a 0 12px, #8d7a58 12px 14px);
}
.ph-points {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,171,46,.1); border: 1px solid rgba(255,171,46,.4);
  border-radius: 8px; padding: 9px 11px; font-size: 13px; color: var(--dim);
}
.ph-points img { width: 20px; height: 20px; object-fit: contain; }
.ph-points b { font-family: 'PixelTitle', monospace; font-size: 13px; color: var(--t5); }

.slot.big { width: 64px; }
.slot.big .slot-frame { width: 64px; height: 64px; border-width: 3px; }
.slot.big .slot-frame img { max-width: 48px; max-height: 48px; }
.slot.big.art .slot-frame { border-color: #8f6fd8; }
.slot.big:hover .slot-frame { border-color: var(--gold); box-shadow: 0 0 16px rgba(255,216,61,.45); }
.slot.big .slot-glyph { font-size: 26px; }

.prep-bag {
  display: flex; flex-direction: column; min-height: 0;
  background: radial-gradient(80% 60% at 50% 20%, rgba(24,20,34,.85), rgba(10,9,16,.5) 80%, transparent);
  border-radius: 12px; padding: 4px 14px 14px;
}
.prep-bag .sec { margin-top: 14px; }
.tabs.icons {
  display: flex; gap: 6px; overflow: visible;
  padding-bottom: 10px; margin-bottom: 25px;
  border-bottom: 1px solid var(--line);
}
.bp-ico-tab {
  flex: 1 1 0; height: 40px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 0; border-radius: 0;
  color: #6a6478; transition: color .12s, transform .12s;
}
.bp-ico-tab .ico { width: 22px; height: 22px; }
.bp-ico-tab .ico svg { width: 100%; height: 100%; }
.bp-ico-tab:hover { color: #fff; transform: translateY(-2px); }
.bp-ico-tab.on { color: var(--gold); filter: drop-shadow(0 0 10px rgba(255,216,61,.5)); }

.bp-grid { display: block; }
.bp-row {
  display: grid; grid-template-columns: repeat(3, minmax(0, 112px));
  justify-content: center; align-content: start; gap: 8px;
}
.bslot {
  --rar: var(--t1);
  position: relative; width: auto; aspect-ratio: 1; padding: 0; cursor: pointer;
  background: linear-gradient(rgba(22,22,32,.8), rgba(8,8,14,.9));
  border: 2px solid #4c4c58; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .12s, box-shadow .12s, background .12s;
}
.bslot.tier-1 { --rar: var(--t1); } .bslot.tier-2 { --rar: var(--t2); }
.bslot.tier-3 { --rar: var(--t3); } .bslot.tier-4 { --rar: var(--t4); }
.bslot.tier-5 { --rar: var(--t5); }
.bslot:hover { border-color: var(--rar); box-shadow: 0 0 16px color-mix(in srgb, var(--rar) 50%, transparent); }
.bslot:hover .bslot-img { transform: scale(1.08); }
.bslot.sel, .bslot.sel:hover { border-color: var(--gold); box-shadow: none; }
.bslot.eq::before {
  content: ''; position: absolute; right: 5px; top: 5px; width: 7px; height: 7px;
  border-radius: 50%; background: #63c268; box-shadow: 0 0 7px rgba(99,194,104,.9);
}
.bslot.empty {
  cursor: default; border-color: #34313f;
  background:
    linear-gradient(45deg, transparent calc(50% - 1px), #34313f calc(50% - 1px), #34313f calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(-45deg, transparent calc(50% - 1px), #34313f calc(50% - 1px), #34313f calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(rgba(18,16,26,.6), rgba(8,8,14,.7));
}
.bslot.empty:hover { border-color: #34313f; box-shadow: none; }
.bslot-frame { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.bslot-img {
  max-width: 76%; max-height: 76%; object-fit: contain; image-rendering: pixelated;
  transition: transform .12s;
}
.bslot-val {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center; gap: 4px;
  padding: 2px 0 3px; border-radius: 0 0 6px 6px;
  background: linear-gradient(transparent, rgba(0,0,0,.85) 40%);
}
.bslot-val b { font-family: 'PixelTitle', monospace; font-size: 13px; color: #fff; text-shadow: 1px 1px 0 #000; }
.bv-ico { width: 12px; height: 12px; color: var(--rar); }
.bv-ico svg { width: 100%; height: 100%; }

.bslot-cmp {
  font-size: 13px; line-height: 1;
  text-shadow: 0 0 6px #000, 1px 1px 0 #000;
}
.bslot-cmp.up { color: #6ee78a; }
.bslot-cmp.down { color: #ff7d7d; }

.bslot-uniq { position: absolute; left: 4px; top: 2px; font-size: 13px; color: var(--t5); text-shadow: 1px 1px 0 #000; }
.bslot-count {
  position: absolute; right: 4px; bottom: 4px;
  font-size: 13px; font-weight: bold; color: #fff; text-shadow: 1px 1px 0 #000;
}
.ench-zoom {
  margin-left: 10px; display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; padding: 0; cursor: pointer;
  background: rgba(255,255,255,.06); border: 1px solid var(--line); border-radius: 6px;
  color: var(--dim); transition: color .12s, border-color .12s;
}
.ench-zoom:hover { color: var(--gold); border-color: var(--gold); }
.ench-zoom .ico, .ench-zoom svg { width: 15px; height: 15px; }

.ench-slots.tight { grid-template-columns: repeat(3, 1fr); gap: 7px; }
.ench-slots.tight .eslot-wrap { padding: 8px 3px 9px; }
.ench-slots.tight .eslot-head { font-size: 9px; margin-bottom: 5px; letter-spacing: 0; }
.ench-slots.tight .ediamond { max-width: 118px; }
.ench-slots.tight .ediamond::before { border-width: 1px; border-radius: 8px; }
.ench-slots.tight .ed-glyph { width: 22px; height: 22px; top: 10%; }
.ench-slots.tight .edia-face { width: 38px; height: 38px; border-width: 1px; border-radius: 6px; }
.ench-slots.tight .edia-ico { width: 40px; height: 34px; }
.ench-slots.tight .edia-cost { display: none; }
.ench-slots.tight .edia.big .edia-face { width: 76px; height: 76px; border-width: 2px; border-radius: 10px; }
.ench-slots.tight .edia.big .edia-ico { width: 54px; height: 54px; }
.ench-slots.tight .edia.big .edia-cost { display: none; }
.ench-slots.tight .edia-pips { font-size: 11px; letter-spacing: 1px; }
.ench-slots.tight .eslot-label { font-size: 13px; margin-top: 4px; line-height: 1.25; }
.ench-mod-title { display: flex; align-items: center; gap: 10px; }
.ench-mod-ico { width: 34px; height: 34px; object-fit: contain; image-rendering: pixelated; }
.prep-bag .bp-list {
  flex: 1 1 auto; min-height: 120px; overflow-y: auto; padding-right: 6px;
  scrollbar-width: thin; scrollbar-color: #4a4658 transparent;
}
.prep-bag .bp-list::-webkit-scrollbar { width: 10px; }
.prep-bag .bp-list::-webkit-scrollbar-thumb { background: #3d3a4c; border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
.irow.sel { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(255,216,61,.35) inset; }

.prep-detail {
  min-height: 0; overflow-y: auto; padding: 16px;
  background: radial-gradient(75% 55% at 50% 25%, rgba(26,21,38,.9), rgba(10,9,16,.5) 78%, transparent);
  border-radius: 12px;
  scrollbar-width: none;
}
.prep-detail::-webkit-scrollbar { display: none; }
.prep-detail > .mo { max-width: 620px; margin: 0 auto; }
.pd-empty {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; text-align: center; color: var(--dim); font-size: 13px; line-height: 1.5; padding: 20px;
}
.pd-ico { width: 40px; height: 40px; color: #4a4658; }
.pd-ico svg { width: 100%; height: 100%; }

.mo.compact .mo-top {
  grid-template-columns: minmax(0, 34%) minmax(0, 1fr);
  gap: 16px; align-items: center;
}
.mo.compact .mo-art { min-height: 0; padding: 4px; align-self: center; }
.mo.compact .mo-img { max-height: 200px; }
.mo.compact .mo-name { font-size: 14px; margin: 0 0 8px; }
.mo.compact .ench-slots { grid-template-columns: 1fr; gap: 10px; }
.mo.compact .ench-slots.tight { grid-template-columns: repeat(3, 1fr); gap: 7px; }
.mo.compact .einfo { height: 152px; }
.mo.compact .mo-actions { flex-direction: column; }
.mo.compact .mo-actions .btn { width: 100%; }

.boss-tease {
  position: absolute; left: 0; right: 0; bottom: 14px; text-align: center;
  font-family: 'PixelTitle', monospace; font-size: 10px; color: #ffb04a;
  letter-spacing: 2px; text-shadow: 2px 2px 0 #000;
}
.prep-art .boss-art { filter: brightness(.06) drop-shadow(0 0 26px rgba(255,80,40,.55)); }

@media (max-width: 1100px) {
  .prep-wrap { padding-inline: 10px; }
  .ph-badge { width: 46px; height: 54px; }
  .ph-badge b { font-size: 13px; }
  .ph-badge span { font-size: 8px; }
  .slot.big { width: 54px; }
  .slot.big .slot-frame { width: 54px; height: 54px; }
  .slot.big .slot-frame img { max-width: 40px; max-height: 40px; }
  .gate-logo { width: min(220px, 60%); }
}

.prep-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-family: 'PixelTitle', monospace; font-size: 12px; color: #fff;
  padding: 10px 12px; background: rgba(10,10,16,.65);
  border: 1px solid var(--line); border-radius: 6px;
}

.gate {
  position: fixed; inset: 0; z-index: 65;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: #0c0a12 url('../assets/ui/deepslate.png') repeat;
  background-size: 96px 96px;
  animation: fade .22s ease;
}
.gate::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 55% at 50% 45%, rgba(255,160,60,.16), transparent 72%),
              linear-gradient(rgba(8,6,12,.86), rgba(8,6,12,.96));
}
.gate-box {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: clamp(10px, 2vh, 20px);
  width: 100%; max-width: 720px; text-align: center;
  animation: gateIn .3s cubic-bezier(.2, 1.3, .4, 1);
}
@keyframes gateIn { from { opacity: 0; transform: translateY(16px) scale(.97); } }
.gate-logo { width: min(280px, 52%); height: auto; }
.gate-plate { display: flex; align-items: baseline; gap: 12px; }
.gate .phud-num { font-size: clamp(44px, 7vw, 76px); }
.gate .prep-area { font-size: 15px; }
.gate .phud-track { justify-content: center; }
.gate .prep-art { width: 100%; margin-top: 0; }
.gate .phud-go { justify-self: auto; margin-top: 4px; padding: 14px 26px 14px 18px; }
.gate .phud-go-txt b { font-size: 15px; }
.gate-back {
  background: none; border: 0; padding: 4px 8px; cursor: pointer;
  font-family: inherit; font-size: 13px; color: var(--dim);
  text-decoration: underline; text-underline-offset: 3px;
}
.gate-back:hover { color: var(--gold); }

.phud-lab {
  font-family: 'PixelTitle', monospace; font-size: 12px; letter-spacing: 4px;
  color: var(--dim);
}
.phud-num {
  font-family: 'PixelTitle', monospace; font-size: clamp(28px, 3.4vw, 40px); line-height: 1;
  color: #fff; text-shadow: 3px 3px 0 #000, 0 0 22px rgba(255,180,70,.6);
}
.phud-max { font-family: 'PixelTitle', monospace; font-size: 14px; color: var(--gold); }
.phud-meta { display: flex; align-items: center; gap: 10px; }
.phud-meta .prep-area {
  flex: 0 0 auto; font-family: 'PixelTitle', monospace; font-size: 13px;
  letter-spacing: 2px; color: var(--torch); text-shadow: 1px 1px 0 #000;
}

.phud-track { display: flex; align-items: center; gap: 4px; }
.phud-pip {
  width: 13px; height: 6px; border-radius: 2px;
  background: rgba(255,255,255,.11); box-shadow: inset 0 0 0 1px rgba(0,0,0,.5);
}
.phud-pip.boss { background: rgba(255,110,60,.26); }
.phud-pip.done { background: linear-gradient(#6fd074, #2f7d3a); }
.phud-pip.boss.done { background: linear-gradient(#ff9a4a, #a33a12); }
.phud-pip.now {
  height: 12px; width: 15px;
  background: linear-gradient(#ffe08a, #ff9a2e);
  box-shadow: 0 0 12px rgba(255,170,60,.85);
}

.phud-go {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px 10px 14px; cursor: pointer; font-family: inherit; color: #eafbe8;
  background: linear-gradient(#4aa851, #2c7a35);
  border: 1px solid #63c268; border-top-color: #8ade8f; border-radius: 6px;
  box-shadow: 0 4px 0 #1c4d22, 0 10px 22px rgba(0,0,0,.5);
  transition: transform .12s, box-shadow .12s, filter .12s;
}
.phud-go:hover { filter: brightness(1.12); transform: translateY(-2px); box-shadow: 0 6px 0 #1c4d22, 0 16px 28px rgba(0,0,0,.55); }
.phud-go:active { transform: translateY(2px); box-shadow: 0 2px 0 #1c4d22; }
.phud-go-ico { width: 34px; height: 34px; flex: 0 0 auto; color: #f2fff0; animation: doorGlow 2.2s ease-in-out infinite; }
.phud-go-ico .ico, .phud-go-ico svg { display: block; width: 100%; height: 100%; }
@keyframes doorGlow {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(255,255,255,0)); }
  50% { filter: drop-shadow(0 0 9px rgba(255,255,190,.9)); }
}
.phud-go-txt { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.phud-go-txt b {
  font-family: 'PixelTitle', monospace; font-size: 14px; letter-spacing: 1px;
  text-shadow: 2px 2px 0 rgba(0,0,0,.45);
}
.phud-go-txt i { font-style: normal; font-size: 13px; color: rgba(255,255,255,.75); }
.phud-go.boss {
  background: linear-gradient(#c8502a, #8a2d12);
  border-color: #ff8a4a; border-top-color: #ffb07a;
  box-shadow: 0 4px 0 #4d1707, 0 10px 24px rgba(180,50,10,.35);
}
.phud-go.boss:hover { box-shadow: 0 6px 0 #4d1707, 0 16px 30px rgba(180,50,10,.45); }

.boss-badge {
  font-family: 'PixelTitle', monospace; font-size: 9px; color: #1a0e00;
  background: linear-gradient(#ffb43c, #ff7a1c);
  padding: 5px 9px; border-radius: 4px; letter-spacing: 1px;
  animation: pulse 1.4s ease infinite;
}
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 rgba(255,150,50,0); } 50% { box-shadow: 0 0 16px rgba(255,150,50,.85); } }

.prep-art {
  position: relative; margin-top: 12px; border-radius: 8px; overflow: hidden;
  border: 2px solid #000; outline: 1px solid rgba(255,150,60,.5);
  box-shadow: 0 6px 20px rgba(0,0,0,.6);
  background-size: cover; background-position: center 35%;
  min-height: 230px;
  display: flex; align-items: flex-end; justify-content: center;
}
.boss-art {
  display: block; max-height: 210px; max-width: 78%; width: auto;
  margin: 16px auto 34px;
  image-rendering: pixelated;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,.75));
  animation: bob 2.6s ease-in-out infinite;
}
.prep-art .boss-name {
  position: absolute; left: 12px; bottom: 26px;
  font-family: 'PixelTitle', monospace; font-size: 14px; color: #fff;
  text-shadow: 2px 2px 0 #000, 0 0 14px rgba(255,120,40,.8);
}
.prep-art .boss-intro {
  position: absolute; left: 12px; right: 12px; bottom: 8px;
  font-size: 13px; color: #ffd9b0; text-shadow: 1px 1px 2px #000;
}
.prep-art::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(transparent 45%, rgba(8,6,12,.92));
  pointer-events: none;
}

.enemy-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.enemy-chip {
  flex: 0 0 auto; width: 104px;
  background: rgba(10,10,16,.6); border: 1px solid var(--line);
  border-bottom: 3px solid #7a2a2a; border-radius: 6px;
  padding: 8px 6px; text-align: center;
}
.enemy-chip.boss { border-bottom-color: var(--torch); background: rgba(40,16,6,.6); }
.enemy-chip img { width: 46px; height: 46px; object-fit: contain; image-rendering: pixelated; }
.ec-name { font-size: 13px; color: #fff; margin-top: 4px; font-weight: bold; line-height: 1.25; }
.ec-stats {
  font-size: 13px; color: var(--dim); margin-top: 3px; line-height: 1.5;
  display: flex; flex-wrap: wrap; gap: 2px 6px; justify-content: center;
}
.ec-stats span { white-space: nowrap; }

.form-box {
  margin-top: 10px; padding: 10px 12px;
  background: rgba(255,154,61,.08); border-left: 3px solid var(--torch); border-radius: 4px;
}
.form-title { font-family: 'PixelTitle', monospace; font-size: 10px; color: var(--torch); }
.form-hint { font-size: 13px; color: var(--text); margin-top: 5px; }

.slot-row { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-start; }
.pstat-row { display: flex; flex-direction: column; gap: 1px; }
.pstat {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 7px;
  background: rgba(10,9,16,.45);
}
.pstat:nth-child(odd) { background: rgba(10,9,16,.22); }
.pstat.dim { opacity: .55; }
.pstat-ico { width: 18px; height: 18px; color: var(--gold); flex: 0 0 auto; }
.pstat-ico svg { width: 100%; height: 100%; }
.pstat-lab { flex: 1; font-size: 13px; color: var(--text); }
.pstat-val { font-family: 'PixelTitle', monospace; font-size: 12px; color: #fff; text-shadow: 1px 1px 0 #000; }
.pstat.dim .pstat-val { font-family: Arial, sans-serif; font-size: 13px; color: var(--dim); }

.tabs { display: flex; gap: 5px; overflow-x: auto; padding-bottom: 6px; }
.bp-tab {
  flex: 0 0 auto; font-family: 'PixelTitle', monospace; font-size: 9px;
  color: var(--dim); background: #22222c; border: 1px solid var(--line);
  border-radius: 5px; padding: 9px 11px; cursor: pointer;
}
.bp-tab.on { color: #fff; background: linear-gradient(#3fa344, #2f8235); border-color: #57c05c; }

.bp-list { display: flex; flex-direction: column; gap: 7px; padding-bottom: 8px; }
.irow {
  --rar: var(--t1);
  position: relative; display: flex; align-items: center; gap: 10px;
  background: linear-gradient(rgba(12,10,18,.35), rgba(12,10,18,.6)), var(--panel);
  border: 1px solid var(--line); border-left: 4px solid var(--rar);
  border-radius: 6px; padding: 7px 9px; cursor: pointer;
}
.irow:active { transform: translateX(2px); }
.irow.tier-1 { --rar: var(--t1); } .irow.tier-2 { --rar: var(--t2); }
.irow.tier-3 { --rar: var(--t3); } .irow.tier-4 { --rar: var(--t4); }
.irow.equipped { background: linear-gradient(rgba(60,140,60,.18), rgba(12,10,18,.6)), var(--panel); border-color: #4c9c50; }
.irow-info { flex: 1; min-width: 0; }
.irow-top { display: flex; align-items: center; gap: 7px; }
.irow-name { font-size: 13.5px; font-weight: bold; color: var(--gold); }
.irow-desc { font-size: 13px; color: var(--dim); margin-top: 2px; line-height: 1.3; }
.irow-shape { font-size: 17px; color: var(--t3); flex: 0 0 auto; opacity: .8; }
.irow-count {
  position: absolute; right: 8px; top: 6px;
  font-size: 13px; color: var(--em); font-weight: bold;
}
.irow-eq {
  position: absolute; right: 8px; bottom: 6px;
  font-family: 'PixelTitle', monospace; font-size: 9px; color: #7de08a;
}
.bp-empty { color: var(--dim); font-size: 13px; text-align: center; padding: 18px 0; }
.bp-group {
  font-family: 'PixelTitle', monospace; font-size: 9px; color: var(--torch);
  letter-spacing: 1px; margin: 12px 0 2px; padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.bp-group:first-child { margin-top: 2px; }

.sticky-foot {
  position: sticky; bottom: 0; z-index: 20;
  margin: 8px -12px 0;
  padding: 10px 12px calc(10px + var(--safe-b));
  background: linear-gradient(rgba(20,18,28,0), rgba(20,18,28,.96) 40%, var(--bg));
  backdrop-filter: blur(3px);
}
#screen-prep, #screen-shop { padding-bottom: 8px; }
#bp-list, #shop-grid { padding-bottom: 14px; }

.over-screen {
  position: fixed; inset: 0; z-index: 5; padding: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.over-wrap {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: minmax(0, 42%) minmax(0, 1fr);
  align-items: center; gap: clamp(20px, 4vw, 60px);
  width: 100%; max-width: 1280px; height: 100%;
  padding: clamp(16px, 3vh, 40px) clamp(20px, 4vw, 60px) calc(clamp(16px, 3vh, 40px) + var(--safe-b));
}
.over-side { display: flex; align-items: center; justify-content: center; min-height: 0; height: 100%; }
.over-main {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: clamp(8px, 1.4vh, 16px); min-width: 0;
}
.over-wrap.noart { grid-template-columns: minmax(0, 1fr); max-width: 780px; }
.over-wrap.noart .over-side { display: none; }
.over-logo { width: min(300px, 70%); height: auto; }
.over-sub { color: var(--dim); font-size: 15px; line-height: 1.5; }
.over-main .stat-grid { width: 100%; margin: clamp(4px, 1vh, 12px) 0; }
.over-actions { display: flex; flex-wrap: wrap; gap: 12px; width: 100%; }
.over-actions .btn { flex: 1 1 200px; }

@media (max-width: 900px) {
  .over-wrap { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; gap: 10px; }
  .over-title { margin: 6px 0; }
}

.over-bg {
  position: absolute; inset: -2%; z-index: 0;
  background: #0b0912 url('../assets/ui/bg_end.png') center/cover no-repeat;
  filter: saturate(.8) brightness(.34);
  animation: kenburns 34s ease-in-out infinite alternate;
}
.over-bg::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(70% 60% at 50% 45%, rgba(10,8,16,.45), rgba(6,5,10,.92));
}
.over-title {
  font-family: 'PixelTitle', monospace; font-size: clamp(22px, 3vw, 34px);
  margin: 4px 0; line-height: 1.4; text-shadow: 3px 3px 0 #000;
}
.over-title.lose { color: var(--danger); text-shadow: 2px 2px 0 #000, 0 0 22px rgba(224,69,69,.6); }
.over-title.win { color: var(--em); text-shadow: 2px 2px 0 #000, 0 0 22px rgba(79,214,106,.6); }

.over-art {
  display: block; margin: 0 auto;
  max-height: 82vh; max-width: 100%; width: auto;
  image-rendering: pixelated;
  -webkit-mask-image: radial-gradient(72% 68% at 50% 46%, #000 55%, transparent 100%);
  mask-image: radial-gradient(72% 68% at 50% 46%, #000 55%, transparent 100%);
  filter: drop-shadow(0 0 40px rgba(255,190,70,.35));
  animation: fade .6s ease;
}
.over-art.lose { filter: saturate(.65) drop-shadow(0 0 40px rgba(224,69,69,.3)); }

.b-em { color: var(--em); font-family: 'PixelTitle', monospace; font-size: 13px; }

.hero-screen {
  position: fixed; inset: 0; z-index: 5; display: flex; padding: 0;
  align-items: center; justify-content: center; overflow: hidden;
}
.hero-bg {
  position: absolute; inset: -2%;
  background: #0b0912 url('../assets/ui/bg_intro.png') center/cover no-repeat;
  filter: saturate(.7) brightness(.3) blur(2px);
}
.hero-vignette {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(50% 60% at 32% 55%, rgba(255,170,70,.14), transparent 70%),
    radial-gradient(95% 85% at 50% 50%, transparent 35%, rgba(4,3,8,.9) 100%);
}
.hero-wrap {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center;
  width: 100%; max-width: 1180px; max-height: 100%;
  padding: 18px 20px calc(16px + var(--safe-b));
  overflow-y: auto; scrollbar-width: none;
}
.hero-wrap::-webkit-scrollbar { display: none; }
.hero-wrap .screen-logo { width: min(300px, 46%); margin-bottom: 6px; }

.hero-stage {
  display: grid; grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 26px; align-items: center; width: 100%; margin-bottom: 18px;
}
.hs-art { position: relative; display: flex; align-items: flex-end; justify-content: center; height: clamp(220px, 34vh, 340px); }
.hs-glow {
  position: absolute; bottom: 0; width: 86%; height: 86%; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,190,90,.28), transparent 68%);
  filter: blur(10px);
}
#hs-img {
  position: relative; max-height: 100%; max-width: 100%; width: auto;
  image-rendering: pixelated;
  filter: drop-shadow(0 14px 20px rgba(0,0,0,.8));
  animation: heroIn .45s cubic-bezier(.2,1.3,.4,1);
}
#hs-img.locked-art {
  filter: brightness(0) drop-shadow(0 14px 20px rgba(0, 0, 0, .8));
}
@keyframes heroIn { from { opacity: 0; transform: translateY(16px) scale(.94); } }

.hs-info { min-width: 0; text-align: left; }
.hs-kicker { font-family: 'PixelTitle', monospace; font-size: 9px; color: var(--dim); letter-spacing: 2px; }
.hs-name {
  font-family: 'PixelTitle', monospace; font-size: clamp(20px, 3.2vw, 32px); color: #fff;
  text-shadow: 3px 3px 0 #000, 0 0 30px rgba(255,160,60,.6);
  margin: 2px 0 10px; letter-spacing: 2px; line-height: 1.2;
}
.hs-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; max-width: 620px; }
.hs-boxes {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px; max-width: 620px;
}
.hs-stat {
  display: flex; align-items: center; gap: 6px;
  background: rgba(10,9,16,.65); border: 1px solid var(--line); border-radius: 7px;
  padding: 7px 11px;
}
.hs-ico { width: 16px; height: 16px; color: var(--dim); }
.hs-ico svg { width: 100%; height: 100%; }
.hs-val { font-family: 'PixelTitle', monospace; font-size: 13px; color: #fff; }
.hs-lab2 { font-size: 13px; color: var(--dim); }
.hs-pass {
  display: flex; align-items: center; gap: 9px; min-width: 0;
  background: rgba(40,90,160,.14); border-left: 3px solid #4fa8ff; border-radius: 6px;
  padding: 10px 12px; font-size: 13px; color: #cfe6ff; line-height: 1.4;
}
.hs-start {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  background: rgba(255,171,46,.10); border-left: 3px solid var(--t5); border-radius: 6px;
  padding: 10px 12px;
}
.hs-start-lab {
  font-family: 'PixelTitle', monospace; font-size: 9px; color: var(--dim); letter-spacing: 1.5px;
}
.hs-start-img { width: 30px; height: 30px; object-fit: contain; image-rendering: pixelated; }
.hs-start-ico { width: 20px; height: 20px; color: var(--t5); }
.hs-start-ico svg { width: 100%; height: 100%; }
.hs-start-name { font-size: 14px; color: #ffd98a; }
.hs-pass-ico { width: 18px; height: 18px; color: #4fa8ff; flex: 0 0 auto; }
.hs-pass-ico svg { width: 100%; height: 100%; }
.hs-locked { color: var(--dim); font-size: 13px; }
.hs-lore {
  font-size: 13.5px; color: #d9cfc0; font-style: italic; line-height: 1.55;
  margin: 0 0 16px; max-width: 620px;
}

.hs-namebox { width: 100%; max-width: 420px; margin: 0 auto; text-align: center; }
.hs-lab { font-family: 'PixelTitle', monospace; font-size: 9px; color: var(--gold); letter-spacing: 1.5px; }
.hs-name-row { display: flex; gap: 8px; align-items: center; }
.hs-name-row .text-input { margin-top: 8px; }
.hs-name-row .btn.small { margin-top: 8px; width: auto; flex: 0 0 auto; font-size: 14px; padding: 12px 14px; }

.hero-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; width: 100%; }
.hero-card {
  flex: 0 1 190px;
  background: linear-gradient(rgba(12,10,18,.5), rgba(12,10,18,.85)),
              #1a1824 url('../assets/ui/deepslate.png') repeat;
  background-size: auto, 64px 64px;
  border: 2px solid var(--line); border-radius: 10px;
  padding: 10px 8px 12px; cursor: pointer; text-align: center;
  color: var(--text); font-family: inherit;
  transition: border-color .15s, transform .14s, box-shadow .15s;
}
.hero-card:hover { transform: translateY(-4px); border-color: var(--gold); box-shadow: 0 10px 26px rgba(0,0,0,.6); }
.hero-card.on { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(255,216,61,.35), 0 10px 26px rgba(0,0,0,.6); }
.hero-card.peek { border-color: #6a6478; box-shadow: 0 10px 26px rgba(0,0,0,.6); }
.hero-portrait {
  position: relative; height: 118px;
  display: flex; align-items: flex-end; justify-content: center;
  background: radial-gradient(60% 50% at 50% 80%, rgba(255,190,90,.14), transparent 70%);
}
.hero-portrait img {
  max-height: 114px; image-rendering: pixelated;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,.6));
  transition: transform .16s;
}
.hero-card:hover .hero-portrait img { transform: scale(1.07); }
.hero-name { font-family: 'PixelTitle', monospace; font-size: 12px; color: var(--gold); margin-top: 8px; }
.hero-tagline { font-size: 13px; color: var(--dim); margin-top: 6px; line-height: 1.35; }

.hero-foot { display: flex; gap: 12px; margin-top: 18px; width: 100%; max-width: 560px; }
.hero-foot .btn { flex: 1; }
.hero-foot .btn.big { flex: 1.6; }

@media (max-width: 860px) {
  .hero-stage { grid-template-columns: 1fr; gap: 12px; }
  .hs-art { height: 200px; }
  .hs-info { text-align: center; }
  .hs-stats, .hs-namebox, .hs-boxes, .hs-lore { justify-content: center; margin-inline: auto; }
  .hero-card { flex: 0 1 150px; }
}
.hero-card.locked { cursor: default; opacity: .75; }
.hero-card.locked:hover { border-color: var(--line); transform: none; }
.hero-card.locked .hero-portrait img { filter: brightness(0); }
.hero-portrait { position: relative; }
.hero-lock {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 34px; filter: drop-shadow(0 2px 6px #000);
}
.hero-locked-note { font-size: 13px; color: var(--dim); margin-top: 8px; line-height: 1.4; }
.hero-blurb { font-size: 13px; color: var(--dim); margin-top: 5px; font-style: italic; }
.sticky-foot { display: flex; gap: 8px; }
.sticky-foot .btn { flex: 1; }
.sticky-foot .btn.big { flex: 2; }

.prep-area { font-size: 13px; color: var(--torch); flex: 1; text-align: center; }
.prep-bar {
  display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: space-between;
  margin-top: 8px; padding: 8px 12px;
  background: rgba(10,10,16,.5); border: 1px solid var(--line); border-radius: 6px;
  font-size: 13px; color: var(--dim);
}
.pb-item b { color: #fff; font-size: 13px; }
.pb-item.mana b, .pb-item.mana { color: var(--mana); }
.pb-item.ench { color: var(--t5); }
.pb-item.ench b { color: var(--t5); }

.irow.tier-5 { --rar: var(--t5); }
.irow-ench { display: flex; gap: 3px; margin-top: 4px; flex-wrap: wrap; }
.ench-chip {
  font-size: 13px; color: #ffd98a; background: rgba(255,171,46,.14);
  border: 1px solid rgba(255,171,46,.45); border-radius: 3px; padding: 1px 5px;
}
.irow-new {
  position: absolute; right: 8px; top: 6px;
  font-family: 'PixelTitle', monospace; font-size: 9px; color: #ffd83d;
}

.mo { --rar: var(--t1); position: relative; }
.mo.tier-1 { --rar: var(--t1); } .mo.tier-2 { --rar: var(--t2); }
.mo.tier-3 { --rar: var(--t3); } .mo.tier-4 { --rar: var(--t4); }
.mo.tier-5 { --rar: var(--t5); }

.mo-top { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: center; }
.mo-art.ench { grid-column: 1 / -1; }

.mo-art {
  position: relative; display: flex; align-items: center; justify-content: center;
  min-height: 220px; padding: 10px;
}
.mo-glow {
  position: absolute; width: 190%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--rar) 55%, transparent) 0%,
              color-mix(in srgb, var(--rar) 18%, transparent) 42%, transparent 70%);
  filter: blur(6px);
  animation: glowPulse 3.2s ease-in-out infinite;
}
@keyframes glowPulse { 0%,100% { transform: scale(1); opacity: .85; } 50% { transform: scale(1.08); opacity: 1; } }
.mo-img {
  position: relative; max-width: 100%; max-height: 210px; width: auto;
  image-rendering: pixelated;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.75));
  animation: bob 3.4s ease-in-out infinite;
}
.mo-art.ench .mo-img, .ench-big { max-height: 148px; }

.mo-info { min-width: 0; }
.mo-tier {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 13px; color: var(--dim); letter-spacing: 1px;
}
.mo-unique {
  font-family: 'PixelTitle', monospace; font-size: 9px; color: #1a1000;
  background: var(--t5); padding: 3px 6px; border-radius: 3px;
}
.mo-eq {
  position: absolute; left: 0; top: 0; z-index: 3;
  font-family: 'PixelTitle', monospace; font-size: 11px; color: #06210b;
  background: linear-gradient(#7de08a, #3fa344);
  border: 1px solid #a4f0ad; padding: 4px 9px; border-radius: 4px;
  letter-spacing: 1px; text-shadow: none;
  box-shadow: 0 0 14px rgba(90,220,120,.45);
}
.mo-name {
  font-family: 'PixelTitle', monospace; font-size: 17px; line-height: 1.5;
  color: #fff; text-shadow: 2px 2px 0 #000, 0 0 22px color-mix(in srgb, var(--rar) 60%, transparent);
  margin: 0 0 10px;
}
.mo-stats { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.mo-stats li {
  display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--text);
  background: rgba(255,255,255,.05); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 10px 4px 8px;
}
.ms-ico { color: var(--rar); flex: 0 0 auto; font-size: 10px; }
.mo-about { font-size: 14px; color: #e8e2d6; margin-top: 12px; line-height: 1.5; }
.mo-flavor {
  font-size: 13px; color: #ffcf8a; font-style: italic; line-height: 1.45;
  margin-top: 12px; padding-left: 11px; border-left: 2px solid rgba(255,171,46,.45);
}

.mo-block {
  margin-top: 30px; padding: 12px 13px 13px;
  border-radius: 10px;
}
.mo-block-t {
  font-family: 'PixelTitle', monospace; font-size: 9px; color: var(--dim);
  letter-spacing: 1.5px; margin-bottom: 10px;
}
.mo-block-t.sep { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }

.mo-bars { display: flex; flex-direction: column; gap: 6px; }
.mo-bar {
  display: grid; grid-template-columns: 96px minmax(0, 1fr) auto;
  align-items: center; gap: 10px; cursor: help;
}
.mb-lab { font-family: 'PixelTitle', monospace; font-size: 9px; color: var(--dim); line-height: 1.4; }
.mb-track { height: 8px; background: rgba(0,0,0,.55); border: 1px solid #000; border-radius: 2px; overflow: hidden; }
.mb-fill { height: 100%; background: linear-gradient(90deg, var(--rar), #fff); opacity: .9; }
.mb-val {
  font-family: 'PixelNum', 'PixelTitle', monospace; font-size: 16px; line-height: 1;
  color: #fff; text-shadow: 1px 1px 0 #000; min-width: 62px; text-align: right;
}

.mo-actions {
  display: flex; gap: 14px; margin-top: 26px; padding-top: 20px;
  border-top: 1px solid var(--line);
}
.mo-actions .btn { flex: 1; width: auto; padding: 17px 18px; }
.mo-actions .btn.green { flex: 1.4; }
.mo-actions .cost { color: #ffe9a8; }

.mo-actions.tiles {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 10px; margin-top: 18px; padding-top: 16px;
}
.tbtn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  min-height: 92px; padding: 12px 6px; cursor: pointer;
  font-family: inherit; color: #e8e2d6;
  background: linear-gradient(#33303f, #201d2a);
  border: 1px solid #4f4a60; border-bottom-width: 3px; border-radius: 9px;
  transition: transform .12s, border-color .12s, box-shadow .12s, filter .12s;
}
.tbtn:hover { border-color: var(--gold); color: #fff; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.5); }
.tbtn:active { transform: translateY(1px); }
.tb-ico { width: 24px; height: 24px; color: var(--gold); }
.tb-ico svg { width: 100%; height: 100%; }
.tb-lab { font-family: 'PixelTitle', monospace; font-size: 12px; line-height: 1.3; text-align: center; }
.tb-sub { font-size: 13px; color: var(--dim); text-align: center; line-height: 1.25; }
.tbtn.go { background: linear-gradient(#4aa851, #2c7a35); border-color: #63c268; color: #eafbe8; }
.tbtn.go .tb-ico { color: #eaffe6; }
.tbtn.go .tb-sub { color: rgba(255,255,255,.72); }
.tbtn.arm { border-color: #e04545; background: linear-gradient(#4a2630, #2a1720); }
.tbtn.arm .tb-ico, .tbtn.arm .tb-lab { color: #ff9d9d; }
.tbtn.off, .tbtn:disabled { opacity: .45; cursor: default; }
.tbtn.off:hover, .tbtn:disabled:hover { transform: none; border-color: #4f4a60; box-shadow: none; }
.mo.compact .mo-actions.tiles .tbtn { width: auto; }
.mo-rule {
  font-size: 13px; color: var(--dim); line-height: 1.5;
  margin: -2px 0 14px;
}
.mo-rule b { color: #ffd98a; }

.mo-ench-head {
  display: flex; align-items: center; justify-content: space-between;
  font-family: 'PixelTitle', monospace; font-size: 10px; color: var(--torch);
  margin: 22px 0 10px; padding-top: 14px; border-top: 1px solid var(--line);
}
.mo-points { display: flex; align-items: center; gap: 6px; margin-left: auto; font-family: Arial, sans-serif; font-size: 13px; color: var(--t5); }
.pt-ico { width: 18px; height: 18px; object-fit: contain; }
.mo-hint { font-size: 13px; color: var(--dim); margin-bottom: 10px; }

.ench-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.eslot-wrap {
  background: linear-gradient(rgba(12,10,18,.4), rgba(12,10,18,.7));
  border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 8px 14px;
}
.eslot-wrap.done { border-color: rgba(255,171,46,.55); background: rgba(60,42,12,.35); }
.eslot-head {
  font-family: 'PixelTitle', monospace; font-size: 9px; color: var(--dim);
  text-align: center; letter-spacing: 1px; margin-bottom: 12px;
}
.eslot-wrap.done .eslot-head { color: var(--t5); }

.ediamond {
  position: relative; width: 100%; aspect-ratio: 1; max-width: 168px; margin: 0 auto;
}
.ediamond::before {
  content: ''; position: absolute; inset: 12%;
  background: linear-gradient(160deg, rgba(120,80,190,.42), rgba(40,26,66,.55));
  border: 2px solid rgba(170,120,255,.55);
  border-radius: 12px; transform: rotate(45deg);
  box-shadow: inset 0 0 26px rgba(150,100,255,.25);
}
.ediamond.chosen::before {
  background: linear-gradient(160deg, rgba(190,130,40,.42), rgba(60,40,10,.6));
  border-color: rgba(255,171,46,.7);
  box-shadow: inset 0 0 26px rgba(255,171,46,.3), 0 0 22px rgba(255,171,46,.25);
}
.ed-glyph {
  position: absolute; left: 50%; top: 12%; transform: translateX(-50%);
  width: 34px; height: 34px; object-fit: contain; opacity: .35; image-rendering: pixelated;
}

.edia {
  position: absolute; background: none; border: none; padding: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--dim); font-family: inherit; transition: transform .12s;
}
.edia.spot-a { left: 4%; top: 34%; }
.edia.spot-b { right: 4%; top: 34%; }
.edia.spot-c { left: 50%; bottom: 4%; transform: translateX(-50%); }
.edia:hover:not(:disabled) { z-index: 3; }
.edia.spot-c:hover:not(:disabled) { transform: translateX(-50%) scale(1.12); }
.edia.spot-a:hover:not(:disabled), .edia.spot-b:hover:not(:disabled) { transform: scale(1.12); }
.edia:disabled { cursor: default; opacity: .5; }

.edia-face {
  position: relative; width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #322d45, #17141f);
  border: 2px solid #6a5f86;
  transform: rotate(45deg); border-radius: 9px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.edia:hover:not(:disabled) .edia-face,
.edia:focus-visible .edia-face {
  border-color: var(--t5);
  box-shadow: 0 0 20px rgba(255,171,46,.65);
  background: linear-gradient(145deg, #4a3a5e, #241b2e);
}
.edia-ico {
  width: 34px; height: 34px; object-fit: contain;
  transform: rotate(-45deg); image-rendering: pixelated;
}

.edia.big {
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  flex-direction: column; color: #fff;
}
.edia.big:hover:not(:disabled) { transform: translate(-50%, -50%) scale(1.06); }
.edia.big .edia-face {
  width: 76px; height: 76px;
  border-color: var(--t5);
  background: linear-gradient(145deg, #6a4a18, #2a1d08);
  box-shadow: 0 0 26px rgba(255,171,46,.55);
}
.edia.big .edia-ico { width: 48px; height: 48px; }
.edia.big .edia-name {
  font-family: 'PixelTitle', monospace; font-size: 9px; color: #ffd98a;
  line-height: 1.6; text-align: center; margin-top: 10px; max-width: 120px;
}
.edia-pips { font-size: 13px; color: var(--t5); letter-spacing: 3px; line-height: 1; }
.edia.maxed .edia-face { box-shadow: 0 0 30px rgba(255,171,46,.9); }

.edia-cost {
  position: absolute; right: -12px; top: -12px;
  display: flex; align-items: center; gap: 2px;
  transform: rotate(-45deg);
  background: #14121c; border: 1px solid var(--t5); border-radius: 12px;
  padding: 1px 6px 1px 3px;
  font-size: 13px; color: var(--t5); font-weight: bold; line-height: 1.4;
}
.edia-cost.off { border-color: #5a5566; color: #7c7688; }
.edia-cost-ico { width: 12px; height: 12px; object-fit: contain; }

.eslot-label {
  font-family: 'PixelTitle', monospace; font-size: 9px; color: #b9a6e8;
  text-align: center; margin-top: 6px; line-height: 1.6;
}
.eslot-label.on { color: var(--t5); }

.einfo {
  display: flex; align-items: center; gap: 14px;
  margin-top: 14px; padding: 12px 14px;
  height: 132px; overflow: hidden;
  background: rgba(8,7,12,.65); border: 1px solid var(--line);
  border-left: 3px solid var(--t5); border-radius: 8px;
}
.einfo.empty { border-left-color: var(--line); justify-content: center; }
.einfo-hint { font-size: 13px; color: var(--dim); text-align: center; max-width: 460px; line-height: 1.5; }
.einfo-ico {
  width: 52px; height: 52px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle, rgba(255,171,46,.22), transparent 70%);
}
.einfo-img { width: 44px; height: 44px; object-fit: contain; image-rendering: pixelated; }
.einfo-txt { min-width: 0; }
.einfo-name { font-family: 'PixelTitle', monospace; font-size: 9px; color: #ffd98a; line-height: 1.6; }
.einfo-eff { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; margin-top: 5px; }
.ei-now { color: #fff; }
.ei-next { color: #7de08a; }
.einfo-about {
  font-size: 13px; color: var(--dim); margin-top: 5px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.einfo-txt { flex: 1; }
.einfo-eff { max-height: 48px; overflow: hidden; }

@media (max-width: 620px) {
  .ench-slots { grid-template-columns: 1fr; }
  .ecluster { gap: 10px 16px; }
  .edia { flex: 0 0 auto; }
}

@media (min-width: 700px) {
  .mo-top { grid-template-columns: 320px 1fr; gap: 24px; align-items: start; }
  .mo-art { min-height: 300px; }
  .mo-img { max-height: 280px; }
  .mo-name { font-size: 21px; }
}

.sh-head { display: flex; gap: 12px; align-items: center; padding-right: 26px; }
.sh-title { font-family: 'PixelTitle', monospace; font-size: 12px; color: var(--gold); line-height: 1.5; }
.sh-type { font-size: 13px; color: var(--dim); text-transform: uppercase; letter-spacing: .5px; }
.sh-desc { font-size: 13px; color: var(--text); margin-top: 8px; }
.sh-about { font-size: 13px; color: #9fd6ff; margin-top: 7px; line-height: 1.4; }
.sh-flavor { font-size: 13px; color: #ffcf8a; font-style: italic; margin-top: 6px; }
.eo-about { font-size: 13px; color: var(--dim); margin-top: 3px; line-height: 1.35; }
.sh-actions { display: flex; gap: 8px; margin: 12px 0 4px; }
.sh-points {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; color: var(--dim); margin-top: 14px;
}
.sh-points b { color: var(--t5); font-size: 14px; }

.ench-slot {
  margin-top: 8px; padding: 9px;
  background: rgba(10,10,16,.55); border: 1px solid var(--line); border-radius: 6px;
}
.ench-slot.taken { border-color: rgba(255,171,46,.6); background: rgba(60,40,10,.35); }
.ench-slot-head {
  display: flex; align-items: center; justify-content: space-between;
  font-family: 'PixelTitle', monospace; font-size: 9px; color: var(--dim); margin-bottom: 6px;
}
.ench-opts { display: flex; flex-direction: column; gap: 6px; }
.ench-opt {
  display: flex; align-items: center; gap: 8px;
  background: #22222c; border: 1px solid var(--line); border-radius: 5px;
  padding: 8px 9px; cursor: pointer; text-align: left; width: 100%;
  color: var(--text); font-family: inherit;
}
.ench-opt:disabled { opacity: .45; cursor: default; }
.ench-opt.chosen { border-color: var(--t5); background: rgba(255,171,46,.12); }
.eo-name { font-size: 13px; font-weight: bold; color: #ffd98a; }
.eo-desc { font-size: 13px; color: var(--dim); }
.eo-lvl {
  margin-left: auto; font-family: 'PixelTitle', monospace; font-size: 9px; color: var(--t5);
  white-space: nowrap;
}
.pips { letter-spacing: 2px; }

.loot-summary {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: center;
  margin: 14px 0 16px;
}
.loot-card {
  --rar: var(--t1);
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 178px; min-height: 224px; padding: 16px 12px 12px;
  background: linear-gradient(rgba(20,17,28,.85), rgba(10,9,16,.92));
  border: 1px solid rgba(255,255,255,.10); border-radius: 10px;
  animation: lootPop .45s cubic-bezier(.2,1.5,.4,1) backwards;
}
.loot-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--rar);
}
.loot-card:nth-child(2) { animation-delay: .08s; }
.loot-card:nth-child(3) { animation-delay: .16s; }
.loot-card:nth-child(4) { animation-delay: .24s; }
@keyframes lootPop { from { opacity: 0; transform: translateY(14px) scale(.9); } }
.loot-card.em { --rar: var(--em); }
.lc-art { position: relative; height: 84px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; }
.lc-glow {
  position: absolute; width: 86px; height: 86px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--rar) 40%, transparent), transparent 68%);
  filter: blur(4px);
}
.lc-img {
  position: relative; max-width: 76px; max-height: 76px; object-fit: contain;
  image-rendering: pixelated; filter: drop-shadow(0 6px 10px rgba(0,0,0,.7));
}
.lc-amount { font-family: 'PixelTitle', monospace; font-size: 15px; color: #fff; text-shadow: 2px 2px 0 #000; }
.loot-card.em .lc-amount { color: var(--em); }
.lc-label { font-size: 13px; color: var(--dim); text-align: center; }

.loot-card.gear.tier-1 { --rar: var(--t1); } .loot-card.gear.tier-2 { --rar: var(--t2); }
.loot-card.gear.tier-3 { --rar: var(--t3); } .loot-card.gear.tier-4 { --rar: var(--t4); }
.loot-card.gear.tier-5 { --rar: var(--t5); }
.loot-card.gear .lc-amount {
  font-size: 13px; line-height: 1.5; color: var(--gold); text-align: center;
}
.loot-card.gear .lc-label { font-size: 13px; letter-spacing: 1px; }
.loot-card.uniq { box-shadow: 0 0 26px rgba(255,171,46,.35); }
.lc-note {
  font-size: 13px; color: #cfe6ff; text-align: center; line-height: 1.35;
  margin-top: 4px; max-width: 100%;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.lc-badge {
  position: absolute; top: 9px; right: 8px; z-index: 2;
  font-family: 'PixelTitle', monospace; font-size: 9px; color: #14121c;
  background: var(--gold); border-radius: 3px; padding: 3px 5px;
  box-shadow: 0 2px 6px rgba(0,0,0,.6);
}
.loot-card.uniq .lc-badge { background: var(--t5); }
.loot-card { position: relative; }
.card.is-new::after {
  content: 'NUOVO'; position: absolute; top: 6px; right: 6px;
  font-family: 'PixelTitle', monospace; font-size: 9px; color: #14121c;
  background: var(--gold); padding: 2px 4px; border-radius: 3px;
}
.card { position: relative; }
.card-unique { animation: uniqueGlow 2s ease infinite; }
@keyframes uniqueGlow {
  0%,100% { box-shadow: 0 4px 0 rgba(0,0,0,.45), 0 0 14px rgba(255,171,46,.25); }
  50% { box-shadow: 0 4px 0 rgba(0,0,0,.45), 0 0 30px rgba(255,171,46,.65); }
}

.loot-screen {
  position: fixed; inset: 0; z-index: 4; display: flex; padding: 0;
  align-items: center; justify-content: center;
  background: #0d0b13 url('../assets/ui/deepslate.png') repeat;
  background-size: 96px 96px;
}
.loot-screen::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(55% 55% at 50% 45%, rgba(255,180,70,.16), transparent 72%),
              linear-gradient(rgba(8,6,12,.86), rgba(8,6,12,.95));
}
.loot-wrap {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 100%; max-width: 1100px; height: 100%;
  margin: 0 auto; padding: clamp(10px, 2vh, 22px) 20px calc(clamp(10px, 2vh, 22px) + var(--safe-b));
  overflow-y: auto; scrollbar-width: none;
}
.loot-wrap::-webkit-scrollbar { display: none; }
.loot-wrap .screen-logo { width: min(300px, 48%); margin: 0 auto clamp(4px, 1vh, 12px); }
.loot-reveal { width: 100%; animation: fade .45s ease; }
.loot-foot { width: 100%; max-width: 420px; margin-top: clamp(8px, 1.6vh, 18px); }
.loot-foot .btn { width: 100%; }

.loot-title {
  font-family: 'PixelTitle', monospace; font-size: 15px; text-align: center;
  color: var(--gold); text-shadow: 2px 2px 0 #000, 0 0 24px rgba(255,180,60,.5);
  margin: 0 0 8px; letter-spacing: 1px; line-height: 1.6;
}
.loot-sub { text-align: center; color: var(--dim); font-size: 14px; margin-bottom: 4px; }

.chest-box {
  position: relative; display: flex; flex-direction: column; align-items: center;
  padding: clamp(8px, 2vh, 22px) 0 10px; cursor: pointer; user-select: none;
  min-height: 0;
}
.chest-glow {
  position: absolute; top: 6%; width: min(62%, 340px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,196,90,.42) 0%, rgba(255,150,50,.16) 45%, transparent 70%);
  filter: blur(10px);
  animation: glowPulse 2.8s ease-in-out infinite;
}
.chest-box.boss .chest-glow {
  background: radial-gradient(circle, rgba(206,110,255,.45) 0%, rgba(255,196,90,.18) 45%, transparent 70%);
}
.chest-img {
  position: relative; width: min(56%, 300px); height: auto;
  filter: drop-shadow(0 14px 20px rgba(0,0,0,.7));
  animation: chestIdle 2.6s ease-in-out infinite;
  transition: width .35s ease;
}
@keyframes chestIdle {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-9px) scale(1.02); }
}
.chest-hint {
  position: relative; font-size: 13px; color: var(--gold); margin-top: 14px;
  min-height: 20px; transition: opacity .18s ease;
  animation: aim 1.6s ease-in-out infinite;
}
.chest-box.open .chest-hint { opacity: 0; animation: none; }

.chest-flash {
  position: absolute; left: 50%; top: 46%; width: min(72%, 420px); aspect-ratio: 1;
  transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none; opacity: 0;
  background: radial-gradient(circle, rgba(255,246,214,.95) 0%, rgba(255,196,90,.6) 35%, transparent 68%);
}
.chest-box.open .chest-flash { animation: chestFlash .55s ease-out; }
@keyframes chestFlash {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.35); }
  25% { opacity: 1; transform: translate(-50%, -50%) scale(.85); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); }
}

.chest-box.open .chest-img { animation: chestShake .58s cubic-bezier(.36,.07,.19,.97); }
.chest-box.opened .chest-img { animation: chestPop .45s cubic-bezier(.2,1.6,.4,1); }
.chest-box.opened .chest-glow { animation: none; opacity: .9; transform: scale(1.2); }
@keyframes chestShake {
  0% { transform: translate(0, 0) rotate(0) scale(1); }
  12% { transform: translate(-11px, 3px) rotate(-6deg) scale(1.04); }
  28% { transform: translate(10px, -4px) rotate(6deg) scale(1.06); }
  44% { transform: translate(-8px, 2px) rotate(-5deg) scale(1.05); }
  60% { transform: translate(7px, -3px) rotate(4deg) scale(1.07); }
  78% { transform: translate(-4px, 1px) rotate(-2deg) scale(1.04); }
  100% { transform: translate(0, 0) rotate(0) scale(1); }
}
@keyframes chestPop {
  0% { transform: scale(.86); }
  55% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
#loot-reveal { animation: fade .45s ease; }
#loot-cards .bp-empty { grid-column: 1 / -1; text-align: center; }

.levelup {
  position: fixed; inset: 0; z-index: 70;
  background: radial-gradient(60% 50% at 50% 45%, rgba(60,40,10,.55), rgba(5,4,9,.94));
  display: flex; align-items: center; justify-content: center;
  animation: fade .25s ease; cursor: pointer;
}
.lu-box { position: relative; text-align: center; padding: 20px; max-width: 580px; width: 100%; }
.lu-head {
  position: relative; width: 168px; height: 168px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
}
.lu-rays {
  position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 0deg, rgba(255,200,90,.26) 0 6deg, transparent 6deg 30deg);
  -webkit-mask-image: radial-gradient(circle, transparent 26%, #000 42%, #000 78%, transparent 100%);
  mask-image: radial-gradient(circle, transparent 26%, #000 42%, #000 78%, transparent 100%);
  animation: spin 16s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.lu-icon {
  position: relative; width: 92px; height: 92px; object-fit: contain;
  filter: drop-shadow(0 0 26px rgba(255,200,90,.9));
  animation: luPop .6s cubic-bezier(.2,1.6,.4,1);
}
@keyframes luPop { from { transform: scale(.3) rotate(-25deg); opacity: 0; } to { transform: none; opacity: 1; } }
.lu-kicker {
  font-family: 'PixelTitle', monospace; font-size: 10px; color: var(--gold);
  letter-spacing: 2px; margin-top: 14px; text-shadow: 2px 2px 0 #000;
}
.lu-level {
  font-family: 'PixelTitle', monospace; font-size: 46px; color: #fff;
  text-shadow: 3px 3px 0 #000, 0 0 30px rgba(255,190,70,.9);
  margin: 6px 0 16px; animation: luPop .5s .1s backwards cubic-bezier(.2,1.6,.4,1);
}
.lu-gains {
  display: flex; flex-wrap: nowrap; justify-content: center; gap: 8px;
  margin: 0 auto 16px; max-width: 520px;
}
.lu-gain {
  display: flex; align-items: center; gap: 7px; min-width: 0;
  background: rgba(10,10,16,.6); border: 1px solid var(--line); border-radius: 6px;
  padding: 9px 11px; font-size: 13px;
}
.lg-ico { font-size: 15px; flex: 0 0 auto; }
.lg-lab { color: var(--dim); text-align: left; white-space: nowrap; }
.lg-val { color: #7de08a; font-weight: bold; }
.lu-point {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,171,46,.12); border: 1px solid rgba(255,171,46,.5);
  border-radius: 20px; padding: 8px 16px; margin-bottom: 20px;
  font-size: 13px; color: var(--t5);
}
.lu-point img { width: 20px; height: 20px; object-fit: contain; }
.lu-box .btn { max-width: 260px; margin: 0 auto; }

.shop-screen {
  position: fixed; inset: 0; z-index: 4;
  display: flex; padding: 0;
  background: #14121c url('../assets/ui/deepslate.png') repeat;
  background-size: 96px 96px;
}
.shop-screen::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(70% 50% at 50% 0%, rgba(255,150,60,.10), transparent 70%),
              linear-gradient(rgba(10,8,16,.82), rgba(10,8,16,.94));
}
.shop-wrap {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  width: 100%; max-width: 1120px; margin: 0 auto;
  padding: 14px 16px calc(12px + var(--safe-b));
  min-height: 0;
}
.shop-fixed { flex: 0 0 auto; }
.shop-fixed .tabs { margin-top: 4px; }

.purse-box {
  flex: 0 0 auto; align-self: stretch;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-width: 150px; padding: 12px 16px;
  background: linear-gradient(rgba(24,52,32,.9), rgba(12,26,18,.95));
  border: 2px solid rgba(79,214,106,.45); border-radius: 10px;
  box-shadow: inset 0 0 24px rgba(79,214,106,.12);
}
.purse-lab {
  font-family: 'PixelTitle', monospace; font-size: 9px; color: #8fe0a0;
  letter-spacing: 1.5px;
}
.purse-row { display: flex; align-items: center; gap: 9px; }
.purse-em {
  width: 26px; height: 32px; object-fit: contain; image-rendering: pixelated;
  filter: drop-shadow(0 0 10px rgba(79,214,106,.7));
  animation: bob 3s ease-in-out infinite;
}
.purse-box b { font-family: 'PixelTitle', monospace; font-size: 20px; color: var(--em); text-shadow: 2px 2px 0 #000; }
.purse-sub { font-size: 13px; color: var(--dim); }

@media (max-width: 720px) {
  .merchant-bar { flex-wrap: wrap; }
  .purse-box { flex: 1 1 100%; flex-direction: row; gap: 10px; min-width: 0; padding: 10px 14px; }
  .purse-lab { display: none; }
}

.shop-grid {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  grid-auto-rows: min-content; align-content: start;
  gap: 12px; padding: 12px 4px 16px;
  scrollbar-width: thin; scrollbar-color: #4a4658 transparent;
}
.shop-grid::-webkit-scrollbar { width: 10px; }
.shop-grid::-webkit-scrollbar-thumb { background: #3d3a4c; border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
.shop-foot { flex: 0 0 auto; padding-top: 10px; }
.shop-foot .btn { width: 100%; }

.shop-card {
  position: relative; overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 10px;
  padding: 16px 10px 14px; min-height: 250px;
  transition: transform .14s, border-color .14s, box-shadow .14s;
}
.shop-card:hover { transform: translateY(-4px); border-color: var(--rar); box-shadow: 0 10px 26px rgba(0,0,0,.6); }
.shop-card.owned { opacity: .55; cursor: default; }
.shop-card.locked, .shop-card.poor { cursor: default; }
.shop-card.poor .sc-img { filter: grayscale(.7) brightness(.7); }

.sc-art {
  position: relative; width: 100%; height: 136px; flex: 0 0 136px;
  display: flex; align-items: center; justify-content: center;
}
.sc-glow {
  position: absolute; width: 78%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--rar) 40%, transparent) 0%, transparent 68%);
  filter: blur(4px);
}
.sc-img {
  position: relative; max-height: 128px; max-width: 86%; width: auto; height: auto;
  object-fit: contain;
  image-rendering: pixelated; filter: drop-shadow(0 8px 12px rgba(0,0,0,.7));
  transition: transform .18s;
}
.sc-upico { position: relative; width: 84px; height: 84px; color: var(--rar); }
.sc-upico svg { width: 100%; height: 100%; filter: drop-shadow(0 0 14px currentColor); }
.sc-name { flex: 0 0 auto; min-height: 30px; display: flex; align-items: center; }
.sc-price { flex: 0 0 auto; margin-top: auto; }
.shop-card:hover .sc-img { transform: scale(1.06); }
.sc-name {
  font-family: 'PixelTitle', monospace; font-size: 9px; line-height: 1.7;
  color: var(--gold); text-align: center; text-shadow: 1px 1px 0 #000;
}
.sc-price { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.sc-em { width: 16px; height: 19px; object-fit: contain; image-rendering: pixelated; }
.sc-price b { color: var(--em); font-family: 'PixelTitle', monospace; font-size: 11px; }
.sc-miss { font-size: 13px; color: var(--danger); }
.sc-owned { font-size: 13px; color: #7de08a; }
.shop-card.poor .sc-price b { color: #9a9a9a; }

.sc-hover {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; justify-content: center; gap: 7px;
  padding: 14px 13px;
  background: linear-gradient(rgba(10,8,16,.95), rgba(16,13,24,.98));
  border-top: 3px solid var(--rar);
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
}
.shop-card:hover .sc-hover { opacity: 1; transform: none; }
.sc-type { font-size: 13px; color: var(--dim); letter-spacing: 1px; }
.sc-desc { font-size: 13px; color: #fff; line-height: 1.4; }
.sc-about { font-size: 13px; color: #9fd6ff; line-height: 1.4; }
.sc-cta {
  margin-top: 4px; font-size: 13px; color: #7de08a;
  border-top: 1px solid var(--line); padding-top: 8px;
}
.sc-cta.off { color: var(--dim); }

@media (hover: none) {
  .sc-hover { position: static; opacity: 1; transform: none; background: none; border-top: none; padding: 0; gap: 5px; }
  .shop-card { align-items: stretch; }
  .sc-name, .sc-price { align-self: center; }
}

.merchant-bar {
  display: flex; align-items: center; gap: 14px;
  margin: 12px 0 14px; padding: 12px 14px;
  background:
    radial-gradient(70% 120% at 12% 50%, rgba(90,70,40,.35), transparent 70%),
    linear-gradient(rgba(12,10,18,.5), rgba(12,10,18,.75)), var(--panel);
  border: 2px solid var(--line); border-left: 4px solid var(--torch);
  border-radius: 8px;
}
.merchant-img {
  width: clamp(72px, 22%, 120px); height: auto; flex: 0 0 auto;
  image-rendering: pixelated;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.7));
  animation: bob 3.6s ease-in-out infinite;
}
.merchant-say { flex: 1; min-width: 0; }
.ms-name {
  font-family: 'PixelTitle', monospace; font-size: 9px; color: var(--gold);
  margin-bottom: 7px; text-shadow: 1px 1px 0 #000;
}
.ms-text { font-size: 13px; color: var(--text); line-height: 1.5; }
.ms-text b { color: #ffd98a; }

.card-foot .buy { color: #7de08a; font-size: 13px; }
.card-foot .price.short { opacity: .8; }

.cloud-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 10px 0 4px; padding: 9px 11px;
  background: rgba(20,40,60,.45); border: 1px solid #2f5570; border-radius: 6px;
}
.cloud-status { flex: 1; min-width: 150px; font-size: 13px; color: #9fd6ff; }
.cloud-status b { color: #fff; }
.cloud-bar .btn.small { flex: 0 0 auto; width: auto; }

.text-input {
  width: 100%; margin-top: 10px; padding: 12px;
  background: #14121c; border: 2px solid var(--line); border-radius: 6px;
  color: var(--text); font-size: 15px; font-family: inherit;
}
.text-input:focus { outline: none; border-color: var(--gold); }

.board-list { display: flex; flex-direction: column; gap: 5px; margin-top: 12px; }
.board-row {
  display: flex; align-items: center; gap: 10px;
  background: rgba(10,10,16,.55); border: 1px solid var(--line); border-radius: 5px;
  padding: 8px 10px; font-size: 13px;
}
.board-row.me { border-color: var(--gold); background: rgba(255,216,61,.08); }
.bd-pos { font-family: 'PixelTitle', monospace; font-size: 9px; color: var(--dim); min-width: 18px; }
.bd-name { flex: 1; color: #fff; font-weight: bold; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-floor { color: var(--dim); font-size: 13px; }
.bd-em { color: var(--em); font-size: 13px; }

@media (min-width: 560px) {
  .hero-row { grid-template-columns: repeat(4, 1fr); }
}
