:root {
  --gw: 480px;
  --ink: #1d1832;
  --blue: #2f6fe8;
  --blue-l: #5aa2ff;
  --gold: #ffc93c;
  --green: #36c95a;
  --red: #ff4d5e;
  --panel: #fff7ea;
  --font-h: 'Lilita One', 'Arial Black', Impact, sans-serif;
  --font-b: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  --coin-img: none;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1d1832; color: var(--ink); font-family: var(--font-b);
  user-select: none; -webkit-user-select: none; touch-action: none; overscroll-behavior: none; }
canvas#game { position: fixed; inset: 0; display: block; cursor: crosshair; }
#ui { position: fixed; top: 0; bottom: 0; left: 50%; width: var(--gw); transform: translateX(-50%); pointer-events: none; }
.hidden { display: none !important; }
button { font-family: var(--font-h); cursor: pointer; border: 0; pointer-events: auto; }

/* ---------- shared bits ---------- */
.coin { display: inline-block; width: 1.2em; height: 1.2em; background: var(--coin-img) center/contain no-repeat; vertical-align: -0.22em; flex: none; }
.coinpill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 14px 4px 8px; border-radius: 999px; background: rgba(29, 24, 50, 0.72);
  color: #fff; font-family: var(--font-h); font-size: 20px; letter-spacing: 0.5px; border: 3px solid var(--ink); box-shadow: inset 0 2px 0 rgba(255,255,255,0.15); }
.coinpill.big { font-size: 24px; }
.coinpill.bump { animation: bump 0.18s ease-out; }
@keyframes bump { 50% { transform: scale(1.15); } }
.iconbtn { width: 46px; height: 46px; border-radius: 14px; background: #fff; border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink);
  display: grid; place-items: center; font-size: 20px; padding: 0; transition: transform 0.08s; }
.iconbtn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.iconbtn.off { opacity: 0.45; }
.iconbtn svg { width: 24px; height: 24px; }
.pause-ico { width: 14px; height: 18px; border-left: 5px solid var(--ink); border-right: 5px solid var(--ink); }

.btn { display: block; width: 100%; padding: 14px 18px; font-size: 22px; color: #fff; letter-spacing: 1px; border-radius: 18px;
  background: linear-gradient(#5aa2ff, #2f6fe8); border: 3px solid var(--ink); box-shadow: 0 6px 0 var(--ink), inset 0 3px 0 rgba(255,255,255,0.35);
  text-shadow: 0 2px 0 rgba(0,0,0,0.3); transition: transform 0.08s, box-shadow 0.08s; }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink), inset 0 3px 0 rgba(255,255,255,0.35); }
.btn.big { font-size: 30px; padding: 16px; }
.btn.ghost { background: #fff; color: var(--ink); text-shadow: none; }
.btn.ghost.hot { background: linear-gradient(#6df07f, #26b04a); color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,0.3); animation: breathe 1.6s ease-in-out infinite; }
.btn.play { background: linear-gradient(#6df07f, #26b04a); animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.04); } }

/* ---------- HUD ---------- */
#hud { position: absolute; inset: 0; }
.hud-top { position: absolute; top: max(10px, env(safe-area-inset-top)); left: 10px; right: 10px; display: flex; align-items: center; gap: 10px; }
.hud-level { flex: 1; min-width: 0; }
.hud-lvl-label { font-family: var(--font-h); color: #fff; font-size: 18px; text-align: center; text-shadow: 0 2px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 -2px 0 var(--ink); }
.hud-prog { position: relative; height: 14px; border-radius: 99px; background: rgba(29, 24, 50, 0.6); border: 3px solid var(--ink); overflow: visible; margin: 2px 14px 0 0; }
#hudProg { height: 100%; width: 0%; border-radius: 99px; background: linear-gradient(#ffe066, #ffb020); transition: width 0.2s linear; }
.hud-skull { position: absolute; right: -16px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; background: var(--red);
  border: 3px solid var(--ink); color: #fff; font-size: 15px; display: grid; place-items: center; line-height: 1; }

#bossBar { position: absolute; top: calc(max(10px, env(safe-area-inset-top)) + 62px); left: 16px; right: 16px; text-align: center; animation: drop 0.4s ease-out; }
.boss-name { font-family: var(--font-h); color: #ffdf3a; font-size: 20px; letter-spacing: 1px; text-shadow: 0 2px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 -2px 0 var(--ink); }
.boss-track { position: relative; height: 22px; border-radius: 10px; background: #3a2030; border: 3px solid var(--ink); overflow: hidden; }
#bossFill { height: 100%; width: 100%; background: linear-gradient(#ff7a8a, #e0213f); transition: width 0.12s; }
#bossHp { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-h); color: #fff; font-size: 14px; text-shadow: 0 1px 0 var(--ink); }
@keyframes drop { from { transform: translateY(-30px); opacity: 0; } }

#banner { position: absolute; top: 30%; left: 0; right: 0; text-align: center; font-family: var(--font-h); font-size: 40px; color: #fff; pointer-events: none;
  -webkit-text-stroke: 2px var(--ink); text-shadow: 0 4px 0 var(--ink), 3px 3px 0 var(--ink), -3px 3px 0 var(--ink); opacity: 0; padding: 0 12px; line-height: 1.05; }
#banner.show { animation: banner 1.6s ease-out forwards; }
#banner.boss { color: #ff4d6d; font-size: 64px; }
#banner.win { color: #ffdf3a; font-size: 56px; }
#banner.weapon { color: #ffb23f; }
#banner.crate { color: #7dff8a; }
#banner.start { color: #fff; font-size: 52px; }
#banner.rank { color: #ffe36a; font-size: 42px; }
#modCard { position: absolute; top: 46%; left: 24px; right: 24px; display: grid; gap: 6px; opacity: 0; pointer-events: none; }
#modCard.show { animation: modIn 3.6s ease-out forwards; }
#modCard div { background: rgba(29, 24, 50, 0.85); border: 3px solid var(--ink); border-radius: 16px; padding: 8px 12px; text-align: center; color: #fff; box-shadow: 0 4px 0 rgba(0,0,0,0.25); }
#modCard b { display: block; font-family: var(--font-h); font-weight: normal; font-size: 24px; color: #ff9a3d; letter-spacing: 1px; }
#modCard span { font-weight: 800; font-size: 14px; }
@keyframes modIn { 0% { opacity: 0; transform: translateY(14px) scale(0.9); } 10% { opacity: 1; transform: none; } 85% { opacity: 1; } 100% { opacity: 0; transform: translateY(-8px); } }
#powerMeter { position: relative; margin-left: auto; text-align: right; font-family: var(--font-h); color: #fff; background: rgba(29, 24, 50, 0.78);
  border: 3px solid var(--ink); border-radius: 12px; padding: 4px 10px; font-size: 20px; line-height: 1.05; }
#powerMeter small { display: block; font-family: var(--font-b); font-weight: 800; font-size: 10px; opacity: 0.75; letter-spacing: 1px; }
#powerMeter b { font-weight: normal; color: #ffe36a; }
#powerMeter.up { animation: powUp 0.5s ease-out; }
@keyframes powUp { 0% { transform: scale(1.25); background: rgba(54, 201, 90, 0.95); } 100% { transform: scale(1); } }
#powerDelta { position: absolute; right: 6px; top: -22px; font-style: normal; font-family: var(--font-h); color: #7dff8a; font-size: 18px; opacity: 0;
  text-shadow: 0 2px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink); }
#powerDelta.show { animation: deltaUp 1s ease-out forwards; }
@keyframes deltaUp { 0% { opacity: 1; transform: translateY(6px); } 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }
.lvl-mods { display: inline-block; margin-top: 6px; font-family: var(--font-h); color: #fff; background: #ff7a3d; border: 3px solid var(--ink); border-radius: 10px; padding: 2px 10px; font-size: 15px; }
.menu-power { margin-top: 6px; font-weight: 900; color: #fff; text-shadow: 0 2px 0 var(--ink); font-size: 14px; display: inline-block; background: rgba(29,24,50,0.55); padding: 3px 12px; border-radius: 99px; }
.menu-power b { color: #ffe36a; font-family: var(--font-h); font-weight: normal; font-size: 17px; }
.menu-power.bump { animation: bump 0.25s ease-out; }
.menu-power { display: inline-flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.menu-power .th b { color: #ff7a8a; }
.menu-power.weak { box-shadow: 0 0 0 3px #ff4d5e; }
#modCard .threat b { color: #ff5d6e; }
.result-stats .record { justify-content: center; color: #e09a00; font-family: var(--font-h); font-weight: normal; }
@keyframes banner {
  0% { opacity: 0; transform: scale(0.3) rotate(-6deg); }
  14% { opacity: 1; transform: scale(1.15) rotate(2deg); }
  24% { transform: scale(1) rotate(0); }
  80% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.05) translateY(-20px); }
}
#hint { position: absolute; top: calc(max(10px, env(safe-area-inset-top)) + 64px); left: 16px; right: 16px; text-align: center; font-weight: 900; font-size: 17px; color: #fff; pointer-events: none;
  background: rgba(29, 24, 50, 0.78); border: 3px solid var(--ink); border-radius: 16px; padding: 10px 12px; opacity: 0; transform: translateY(-10px); transition: opacity 0.3s, transform 0.3s; }
#hint.show { opacity: 1; transform: none; }
#tutorial { position: absolute; bottom: 21%; left: 0; right: 0; text-align: center; color: #fff; font-family: var(--font-h); font-size: 22px;
  text-shadow: 0 2px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink); pointer-events: none; }
#tutorial .hand { font-size: 46px; animation: swipe 1.4s ease-in-out infinite; display: inline-block; }
@keyframes swipe { 0%, 100% { transform: translateX(-70px) rotate(-10deg); } 50% { transform: translateX(70px) rotate(10deg); } }
.hud-bottom { position: absolute; bottom: max(12px, env(safe-area-inset-bottom)); left: 10px; right: 10px; display: flex; align-items: flex-end; gap: 8px; pointer-events: none; }
#weaponChip { font-family: var(--font-h); color: #fff; font-size: 15px; background: rgba(29, 24, 50, 0.72); border: 3px solid var(--ink); border-radius: 12px; padding: 5px 10px; }
#weaponChip small { display: block; font-family: var(--font-b); font-weight: 800; font-size: 10px; opacity: 0.7; letter-spacing: 1px; }
#buffs { display: flex; gap: 6px; flex-wrap: wrap; }
.buff { font-family: var(--font-h); font-size: 13px; color: #fff; border: 3px solid var(--ink); border-radius: 10px; padding: 4px 8px; }

/* ---------- screens ---------- */
.screen { position: absolute; inset: 0; pointer-events: auto; }
#menu { display: flex; flex-direction: column; align-items: stretch; padding: max(12px, env(safe-area-inset-top)) 16px 0;
  background: linear-gradient(rgba(29, 24, 50, 0.15), rgba(29, 24, 50, 0) 30%, rgba(29, 24, 50, 0.5) 62%, rgba(29, 24, 50, 0.85)); }
.menu-top { display: flex; justify-content: space-between; align-items: center; }
.menu-toggles { display: flex; gap: 8px; }
.logo { text-align: center; margin-top: 3vh; font-family: var(--font-h); line-height: 0.88; animation: logoIn 0.7s cubic-bezier(.2,1.6,.4,1) both; }
.logo-1, .logo-2 { font-size: clamp(48px, 15vw, 76px); letter-spacing: 2px; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; }
.logo-1 { color: #ffdf3a; text-shadow: 0 6px 0 var(--ink), 0 8px 18px rgba(0,0,0,.35); transform: rotate(-3deg); }
.logo-2 { color: #fff; text-shadow: 0 6px 0 var(--ink), 0 8px 18px rgba(0,0,0,.35); transform: rotate(-3deg); }
.logo-sub { display: inline-block; font-family: var(--font-b); font-weight: 900; font-size: 13px; color: #fff; margin-top: 14px; line-height: 1.2;
  background: rgba(29, 24, 50, 0.6); padding: 5px 12px; border-radius: 99px; }
@keyframes logoIn { from { transform: scale(0.4); opacity: 0; } }
.menu-level { text-align: center; margin-top: auto; margin-bottom: 10px; }
.lvl-badge { display: inline-block; font-family: var(--font-h); font-size: 26px; color: #fff; background: var(--ink); border-radius: 14px; padding: 4px 18px;
  box-shadow: 0 4px 0 rgba(0,0,0,.25); }
.lvl-badge b { color: #ffdf3a; font-weight: normal; }
.lvl-biome { font-weight: 900; color: #fff; text-shadow: 0 2px 0 var(--ink); margin-top: 4px; font-size: 15px; }
#btnPlay { margin: 4px 0 10px; }
.btn.collect { background: linear-gradient(#ffe27a, #ffb020); color: var(--ink); text-shadow: none; font-size: 18px; padding: 10px; margin-bottom: 10px; display: flex; justify-content: center; align-items: center; gap: 6px; }
.shop { background: var(--panel); border: 3px solid var(--ink); border-bottom: 0; border-radius: 22px 22px 0 0; padding: 10px 10px max(10px, env(safe-area-inset-bottom));
  max-height: 42vh; display: flex; flex-direction: column; box-shadow: 0 -6px 0 rgba(0,0,0,0.15); }
.shop-title { font-family: var(--font-h); text-align: center; font-size: 18px; letter-spacing: 1px; margin-bottom: 8px; }
.shop-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; overflow-y: auto; padding: 2px 2px 6px; touch-action: pan-y; }
.card { position: relative; background: #fff; border: 3px solid var(--ink); border-radius: 16px; padding: 8px 6px 6px; text-align: center; box-shadow: 0 4px 0 var(--ink);
  display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; pointer-events: auto; transition: transform 0.08s; }
.card:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.card img { width: 46px; height: 46px; }
.card .nm { font-family: var(--font-h); font-size: 14px; line-height: 1; }
.card .lv { position: absolute; top: 4px; right: 6px; font-family: var(--font-h); font-size: 12px; color: #fff; background: var(--ink); border-radius: 8px; padding: 1px 6px; }
.card .ds { font-size: 10.5px; font-weight: 800; color: #5a5470; line-height: 1.15; min-height: 2.3em; }
.card .cost { margin-top: auto; width: 100%; font-family: var(--font-h); font-size: 15px; color: #fff; background: linear-gradient(#6df07f, #26b04a); border: 2px solid var(--ink);
  border-radius: 10px; padding: 3px 0; display: flex; align-items: center; justify-content: center; gap: 4px; }
.card.poor .cost { background: linear-gradient(#c9c4d6, #a19bb3); }
.card.max .cost { background: linear-gradient(#ffe27a, #ffb020); color: var(--ink); }
.card.can { animation: canbuy 1.4s ease-in-out infinite; }
@keyframes canbuy { 50% { box-shadow: 0 4px 0 var(--ink), 0 0 0 4px rgba(54, 201, 90, 0.45); } }
.card.flash { animation: buyflash 0.35s ease-out; }
@keyframes buyflash { 0% { transform: scale(1.12); background: #eaffef; } }

.modal { display: grid; place-items: center; background: rgba(20, 12, 40, 0.55); backdrop-filter: blur(3px); padding: 20px;
  left: calc(50% - 50vw); right: auto; width: 100vw; }
.panel { width: 100%; max-width: 380px; background: var(--panel); border: 3px solid var(--ink); border-radius: 26px; padding: 22px 20px; box-shadow: 0 8px 0 var(--ink);
  display: flex; flex-direction: column; gap: 12px; animation: pop 0.35s cubic-bezier(.2,1.5,.4,1); }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } }
.panel-title { font-family: var(--font-h); font-size: 40px; text-align: center; }
.pause-toggles { display: flex; justify-content: center; gap: 12px; }
.result-title { font-family: var(--font-h); font-size: 46px; text-align: center; color: #ffc93c; -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill;
  text-shadow: 0 4px 0 var(--ink); line-height: 1; }
.result-title.lose { color: var(--red); font-size: 40px; }
.result-sub { text-align: center; font-weight: 900; color: #5a5470; margin-top: -6px; }
.result-stats { display: grid; gap: 6px; background: #fff; border: 3px solid var(--ink); border-radius: 16px; padding: 10px 14px; }
.result-stats div { display: flex; justify-content: space-between; font-weight: 800; }
.result-stats b { font-family: var(--font-h); font-weight: normal; font-size: 18px; }
.result-coins { text-align: center; font-family: var(--font-h); font-size: 44px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.result-bonus { text-align: center; font-weight: 900; color: var(--green); margin-top: -10px; min-height: 1.2em; }

@media (max-height: 700px) {
  .logo-1, .logo-2 { font-size: clamp(40px, 12vw, 58px); }
  .logo { margin-top: 1vh; }
  .shop { max-height: 46vh; }
  .card .ds { display: none; }
  .btn.big { font-size: 26px; padding: 12px; }
}

/* ---------- menu: armory / co-op row ---------- */
.menu-row { display: flex; gap: 8px; margin: -2px 0 10px; }
.btn.mid { font-size: 16px; padding: 10px 6px; position: relative; letter-spacing: 0.5px; }
.btn[disabled] { opacity: 0.5; }
.dot { position: absolute; top: -6px; right: -4px; width: 16px; height: 16px; border-radius: 50%; background: var(--red); border: 3px solid var(--ink); animation: breathe 1.2s infinite; }

/* ---------- armory ---------- */
#armory { background: rgba(20, 12, 40, 0.6); backdrop-filter: blur(3px); overflow-y: auto; touch-action: pan-y; left: calc(50% - 50vw); width: 100vw; right: auto; }
.arm-wrap { max-width: 460px; margin: 0 auto; min-height: 100%; background: var(--panel); border-left: 3px solid var(--ink); border-right: 3px solid var(--ink);
  padding: max(12px, env(safe-area-inset-top)) 14px 0; display: flex; flex-direction: column; gap: 8px; }
.arm-head { display: flex; align-items: center; justify-content: space-between; }
.arm-title { font-family: var(--font-h); font-size: 30px; letter-spacing: 1px; }
.arm-msg { background: #ffe27a; border: 3px solid var(--ink); border-radius: 14px; padding: 8px 12px; font-weight: 900; text-align: center; }
.arm-sec { font-family: var(--font-h); font-size: 16px; letter-spacing: 1px; margin-top: 6px; color: #3a3355; }
.arm-sec small { font-family: var(--font-b); font-weight: 800; font-size: 11px; letter-spacing: 0; color: #7a7490; }
.cls-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cls { background: #fff; border: 3px solid var(--ink); border-radius: 16px; padding: 8px 4px 6px; text-align: center; box-shadow: 0 4px 0 var(--ink); cursor: pointer; transition: transform 0.08s; }
.cls:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.cls.on { background: var(--cc); box-shadow: 0 4px 0 var(--ink), inset 0 0 0 3px #fff; }
.cls-ico { font-size: 30px; line-height: 1.1; }
.cls-nm { font-family: var(--font-h); font-size: 15px; }
.cls-role { font-size: 10.5px; font-weight: 800; color: #5a5470; }
.cls.on .cls-role { color: var(--ink); }
.cls-info { background: #fff; border: 3px solid var(--ink); border-radius: 16px; padding: 8px 12px; font-weight: 700; font-size: 13.5px; line-height: 1.3; }
.cls-info p { margin: 0 0 6px; }
.set { color: #8a84a0; font-size: 12.5px; margin-top: 3px; }
.set.on { color: #1f8a3a; font-weight: 900; }
.set b { font-family: var(--font-h); font-weight: normal; }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.slot { border: 3px dashed #b9b2cc; border-radius: 14px; min-height: 92px; display: grid; place-items: center; color: #a19bb3; font-weight: 900; font-size: 13px; text-align: center; }
.slot.locked { border-style: solid; border-color: #d8d2e6; background: #efe9f6; font-size: 20px; }
.slot.buy { cursor: pointer; display: flex; flex-direction: column; justify-content: center; gap: 2px; border-color: var(--ink); background: #fff; color: var(--ink); }
.slot.buy small { font-size: 10px; font-weight: 800; color: #7a7490; }
.slot.buy span { font-family: var(--font-h); font-size: 14px; display: flex; align-items: center; gap: 3px; }
.slot.buy.can { background: linear-gradient(#e9ffe9, #c7f7cf); }
.inv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.inv-empty { grid-column: 1 / -1; text-align: center; font-weight: 800; color: #7a7490; padding: 14px 6px; background: #fff; border: 3px dashed #c9c2da; border-radius: 14px; }
.art { position: relative; background: #fff; border: 3px solid var(--ink); border-radius: 14px; padding: 16px 4px 6px; text-align: center; cursor: pointer;
  box-shadow: 0 4px 0 var(--ink), inset 0 -5px 0 var(--rar); transition: transform 0.08s; }
.art:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink), inset 0 -5px 0 var(--rar); }
.art.equipped { background: #eaf6ff; }
.art.equipped::after { content: '✔'; position: absolute; bottom: 6px; right: 6px; font-size: 12px; color: #1f8a3a; font-weight: 900; }
.art-ico { font-size: 30px; line-height: 1.1; }
.art-nm { font-family: var(--font-h); font-size: 13px; line-height: 1.05; margin-top: 2px; }
.art-tag { position: absolute; top: 3px; left: 5px; font-size: 13px; }
.art-star { position: absolute; top: 2px; right: 5px; font-size: 11px; color: #ffb020; letter-spacing: -1px; text-shadow: 0 1px 0 var(--ink); }
.art-star i { font-style: normal; color: #ddd6ea; text-shadow: none; }
.art-ds { font-size: 12px; font-weight: 800; color: #4a4460; line-height: 1.2; margin: 4px 2px 2px; }
.art-rar { font-family: var(--font-h); font-size: 11px; color: var(--rar); -webkit-text-stroke: 0.4px var(--ink); }
.react-list { display: grid; gap: 6px; }
.react { background: #fff; border: 3px solid var(--ink); border-radius: 12px; padding: 6px 10px; display: flex; gap: 10px; align-items: center; font-size: 12.5px; font-weight: 700; }
.react b { font-size: 17px; white-space: nowrap; }
.react em { font-style: normal; font-weight: 900; }
.arm-foot { position: sticky; bottom: 0; padding: 10px 0 max(12px, env(safe-area-inset-bottom)); background: linear-gradient(rgba(255,247,234,0), var(--panel) 30%); margin-top: 4px; }
.art-panel { gap: 10px; }
.art-big .art { cursor: default; padding-top: 20px; }
.art-big .art-ico { font-size: 46px; }
.art-big .art-nm { font-size: 20px; }
.art-big .art-ds { font-size: 14px; }
.art-next { text-align: center; font-weight: 800; font-size: 12.5px; color: #5a5470; margin-top: 6px; }
.art-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.art-actions .btn { font-size: 15px; padding: 10px 6px; display: flex; align-items: center; justify-content: center; gap: 3px; white-space: nowrap; }
.art-actions #btnArtEquip { grid-column: 1 / -1; font-size: 20px; }
.btn.danger { color: #c81e3c; }

/* ---------- loot chest ---------- */
.chest-panel { max-width: 420px; }
.chest-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.chest-cards .art { padding: 22px 4px 8px; animation: cardIn 0.45s cubic-bezier(.2,1.5,.4,1) both; }
.chest-cards .art-ds { font-size: 11px; }
.art-badge { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-family: var(--font-h); font-size: 11px; color: #fff;
  background: var(--green); border: 2px solid var(--ink); border-radius: 8px; padding: 1px 6px; }
.art.dup .art-badge { background: #ffb020; color: var(--ink); }
@keyframes cardIn { from { transform: translateY(30px) scale(0.6) rotate(-6deg); opacity: 0; } }
#btnReroll { font-size: 16px; padding: 10px; display: flex; align-items: center; justify-content: center; gap: 5px; }

/* ---------- co-op lobby ---------- */
#lobby { background: rgba(20, 12, 40, 0.6); backdrop-filter: blur(3px); overflow-y: auto; touch-action: pan-y; left: calc(50% - 50vw); width: 100vw; right: auto; }
.lobby-wrap { padding-bottom: max(16px, env(safe-area-inset-bottom)); gap: 10px; }
#lbStart, #lbRoom { display: flex; flex-direction: column; gap: 10px; }
#lbStart.hidden, #lbRoom.hidden { display: none; }
.lobby-p { margin: 0; font-weight: 800; color: #4a4460; line-height: 1.3; }
.lobby-lbl { font-family: var(--font-h); font-size: 14px; letter-spacing: 1px; color: #3a3355; margin-bottom: -6px; }
.lobby-in { font-family: var(--font-h); font-size: 22px; padding: 10px 14px; border: 3px solid var(--ink); border-radius: 14px; background: #fff; color: var(--ink);
  width: 100%; outline: none; pointer-events: auto; user-select: text; -webkit-user-select: text; }
.lobby-in:focus { box-shadow: 0 0 0 4px rgba(47, 111, 232, 0.35); }
.lobby-in.code { text-align: center; letter-spacing: 8px; text-transform: uppercase; font-size: 28px; }
.lobby-or { text-align: center; font-weight: 900; color: #8a84a0; }
.lobby-join { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lobby-err { background: #ffd9de; border: 3px solid var(--red); border-radius: 12px; padding: 8px 12px; font-weight: 900; color: #a3132b; }
.lobby-busy { text-align: center; font-weight: 900; color: #5a5470; }
.room-code { text-align: center; background: var(--ink); color: #fff; border-radius: 18px; padding: 8px; }
.room-code small { display: block; font-weight: 900; font-size: 11px; letter-spacing: 2px; opacity: 0.7; }
.room-code b { display: block; font-family: var(--font-h); font-weight: normal; font-size: 52px; letter-spacing: 12px; color: #ffdf3a; line-height: 1.05; padding-left: 12px; }
.room-code span { font-size: 12px; font-weight: 800; color: #7dff8a; }
.room-code span.off { color: #ff9aa8; }
.pl-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pl { background: #fff; border: 3px solid var(--ink); border-radius: 16px; padding: 8px 6px; text-align: center; box-shadow: 0 4px 0 var(--ink), inset 0 6px 0 var(--tc); }
.pl.me { background: #f2f8ff; }
.pl.empty { border-style: dashed; box-shadow: none; color: #8a84a0; }
.pl-ico { font-size: 32px; line-height: 1.2; }
.pl-nm { font-family: var(--font-h); font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-nm small { font-family: var(--font-b); font-size: 11px; color: #7a7490; }
.pl-sub { font-size: 11.5px; font-weight: 800; color: #5a5470; min-height: 1.3em; }
.pl-st { margin-top: 4px; font-size: 12px; font-weight: 900; color: #8a84a0; }
.pl-st .ok { color: #1f8a3a; }
.pl-st .off { color: var(--red); }
.synergy { background: #fff3c4; border: 3px solid var(--ink); border-radius: 14px; padding: 7px 10px; font-weight: 900; font-size: 13px; text-align: center; }
.room-level { text-align: center; font-weight: 900; color: #3a3355; }
.room-level b { font-family: var(--font-h); font-weight: normal; font-size: 22px; color: #e07a10; }
.lobby-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lobby-row .btn { font-size: 17px; padding: 12px 6px; }
#btnReady.on { background: linear-gradient(#6df07f, #26b04a); color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,0.3); }
#btnStart[disabled] { background: linear-gradient(#c9c4d6, #a19bb3); animation: none; font-size: 20px; }
#btnStart.hidden { display: none; }
.guest-wait { text-align: center; font-weight: 900; color: #5a5470; animation: breathe 1.6s ease-in-out infinite; }
.btn.small-link { font-size: 14px; padding: 8px; box-shadow: 0 3px 0 var(--ink); }
.pause-msg { text-align: center; font-weight: 900; color: #a3132b; background: #ffd9de; border-radius: 12px; padding: 8px; }

/* partner chip in the HUD */
#mateChip { position: absolute; bottom: calc(max(12px, env(safe-area-inset-bottom)) + 60px); left: 10px; display: flex; align-items: center; gap: 5px;
  font-weight: 900; font-size: 13px; color: #fff; background: rgba(29, 24, 50, 0.78); border: 3px solid var(--ink); border-radius: 12px; padding: 3px 9px; pointer-events: none; }
#mateChip i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid #fff; }
#mateChip b { font-family: var(--font-h); font-weight: normal; font-size: 16px; color: #ffe36a; }
#mateChip small { opacity: 0.75; font-size: 11px; }
#mateChip .off { color: #ff9aa8; font-family: var(--font-b); font-size: 11px; }
.art-mate { position: absolute; bottom: -11px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-family: var(--font-h); font-size: 10px; color: #fff;
  background: #ff4fa0; border: 2px solid var(--ink); border-radius: 8px; padding: 1px 5px; z-index: 1; }
.art.mate { box-shadow: 0 4px 0 var(--ink), inset 0 -5px 0 var(--rar), 0 0 0 3px #ff8ac6; }
.art.dead { opacity: 0.72; }
.art-dead { font-size: 9.5px; font-weight: 900; color: #a3132b; line-height: 1.1; margin: -6px 0 2px; }
.chest-cards.four { grid-template-columns: repeat(2, 1fr); }

/* ---------- bosses ---------- */
.boss-title { font-weight: 900; font-size: 12px; color: #fff; margin: -2px 0 2px; text-shadow: 0 1px 0 var(--ink), 1px 0 0 var(--ink), -1px 0 0 var(--ink); }
.boss-sub { margin-top: 4px; display: inline-block; font-weight: 900; font-size: 13px; color: #fff; background: rgba(29, 24, 50, 0.8); border: 2px solid var(--ink); border-radius: 10px; padding: 2px 10px; }
.boss-sub.hidden { display: none; }
.boss-tip { margin-top: 6px; font-weight: 900; font-size: 14px; color: #fff; background: rgba(200, 30, 60, 0.88); border: 3px solid var(--ink); border-radius: 14px; padding: 6px 10px;
  opacity: 0; transform: translateY(-6px); transition: opacity 0.3s, transform 0.3s; }
.boss-tip.show { opacity: 1; transform: none; }
.boss-card { display: flex; gap: 8px; align-items: center; text-align: left; margin: 6px auto 0; max-width: 360px; background: rgba(29, 24, 50, 0.72);
  border: 3px solid var(--ink); border-radius: 14px; padding: 5px 10px; color: #fff; }
.bc-ico { font-size: 28px; line-height: 1; }
.bc-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.bc-txt small { font-weight: 900; font-size: 9px; letter-spacing: 1.5px; opacity: 0.7; }
.bc-txt b { font-family: var(--font-h); font-weight: normal; font-size: 17px; color: #ffdf3a; }
.bc-txt i { font-style: normal; font-weight: 800; font-size: 11.5px; }
.bc-txt em { font-style: normal; font-weight: 700; font-size: 11px; opacity: 0.85; margin-top: 2px; }
#menuBoss em { display: none; }
#roomBoss { background: #2a2244; }
