/* NOITA DEATHMATCH — Noita-flavoured pixel UI. Dark stone panels, gold accents,
   pixel fonts, crisp 2px borders, no smoothing on any pixel art. */
:root {
  --bg: #0b0a0d;
  --panel: rgba(18, 15, 20, 0.94);
  --panel2: rgba(30, 25, 32, 0.95);
  --edge: #4a3f36;
  --edge2: #7b6650;
  --text: #e8dcc8;
  --dim: #9a8d7a;
  --dimmer: #6f6556;
  --gold: #f2c14e;
  --red: #c8282c;
  --blue: #3b7bd8;
  --lev: #e0b84a;
  --green: #6fd05a;
  --font: 'Pixelify Sans', 'Silkscreen', monospace;
  --title: 'Silkscreen', 'Pixelify Sans', monospace;
  --slot: 36px;
  --hslot: 26px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); overflow: hidden; user-select: none; }
canvas#game { position: fixed; inset: 0; width: 100vw; height: 100vh; image-rendering: pixelated; display: block; }
canvas#ovl { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; image-rendering: pixelated; z-index: 1; }
img.icon, canvas.icon, img { image-rendering: pixelated; }
.hidden { display: none !important; }
.screen { position: fixed; inset: 0; z-index: 2; }
button { font-family: var(--title); font-size: 15px; color: var(--text); background: linear-gradient(#3a3028, #2a221c); border: 2px solid var(--edge2); box-shadow: inset 0 0 0 2px #1a1410, 0 2px 0 #000; padding: 8px 14px; cursor: pointer; text-transform: uppercase; letter-spacing: 1px; }
button:hover, button.padon { color: #fff; border-color: var(--gold); background: linear-gradient(#4a3c30, #33291f); }
button:active { transform: translateY(1px); }
button.big { font-size: 19px; padding: 12px 22px; }
button.small { font-size: 11px; padding: 4px 8px; }
button.primary { border-color: #b08a3a; color: #ffe7a8; }
button:disabled { opacity: 0.45; cursor: default; }
input, select { font-family: var(--title); font-size: 15px; background: #120f14; color: var(--text); border: 2px solid var(--edge); padding: 6px 8px; outline: none; }
input:focus, select:focus { border-color: var(--gold); }
select { cursor: pointer; }
/* pixel sliders + checkboxes (no browser-blue anywhere) */
input[type=range] { -webkit-appearance: none; appearance: none; height: 22px; padding: 0; background: transparent; border: none; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 10px; background: linear-gradient(90deg, #8a6a24 0 var(--fill, 50%), #120f14 var(--fill, 50%) 100%); border: 2px solid var(--edge); box-shadow: 0 0 0 1px #000; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 20px; margin-top: -7px; background: var(--gold); border: 2px solid #3a2a08; box-shadow: inset -2px -2px 0 #b08a3a, 0 0 0 1px #000; }
input[type=range]::-moz-range-track { height: 6px; background: #120f14; border: 2px solid var(--edge); }
input[type=range]::-moz-range-progress { height: 6px; background: #8a6a24; }
input[type=range]::-moz-range-thumb { width: 10px; height: 18px; background: var(--gold); border: 2px solid #3a2a08; border-radius: 0; }
input[type=range]:focus::-webkit-slider-thumb, input[type=range].padon::-webkit-slider-thumb { background: #fff3c4; }
input[type=checkbox] { -webkit-appearance: none; appearance: none; width: 20px; height: 20px; padding: 0; background: #120f14; border: 2px solid var(--edge2); box-shadow: 0 0 0 1px #000; cursor: pointer; position: relative; }
input[type=checkbox]:checked::after { content: ''; position: absolute; inset: 3px; background: var(--gold); box-shadow: inset -2px -2px 0 #b08a3a; }
h2, h3 { font-family: var(--title); font-weight: 400; margin: 0 0 10px; letter-spacing: 1px; }
h2 { font-size: 24px; color: var(--gold); }
h3 { font-size: 14px; color: var(--dim); margin-top: 14px; }
h3 small, h2 small { font-family: var(--font); font-size: 12px; color: var(--dimmer); text-transform: none; letter-spacing: 0; }
.panel { background: var(--panel); border: 2px solid var(--edge); box-shadow: 0 0 0 2px #000, inset 0 0 0 2px #1f1a16, 0 10px 40px rgba(0,0,0,0.6); padding: 22px; }
.row { display: flex; gap: 10px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.lbl { color: var(--dim); font-size: 14px; }
.hint { color: var(--dimmer); font-size: 13px; margin: 14px 0 0; }

/* TITLE */
#title { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: radial-gradient(ellipse at center, rgba(0,0,0,0.25), rgba(0,0,0,0.75)); }
.logo { display: flex; flex-direction: column; align-items: center; font-family: var(--title); line-height: 0.9; text-shadow: 0 0 18px rgba(170, 90, 255, 0.55), 4px 4px 0 #000; }
.logo .l1 { font-size: clamp(56px, 11vw, 132px); color: #e9d7ff; letter-spacing: 8px; }
.logo .l2 { font-size: clamp(22px, 4.2vw, 50px); color: var(--gold); letter-spacing: 10px; text-shadow: 0 0 14px rgba(255, 170, 40, 0.6), 3px 3px 0 #000; }
.tag { color: var(--dim); font-size: 16px; margin-bottom: 8px; text-shadow: 2px 2px 0 #000; }
.menu { display: flex; flex-direction: column; gap: 8px; width: min(340px, 86vw); }
.menu button { width: 100%; }
.menurow { display: flex; gap: 8px; }
.menurow button { flex: 1; }
.joinrow { display: flex; gap: 8px; }
.joinrow input { width: 110px; text-transform: uppercase; text-align: center; letter-spacing: 4px; }
.joinrow button { flex: 1; }
.namebox { margin-top: 10px; color: var(--dim); text-shadow: 2px 2px 0 #000; }
.namebox input { width: 170px; margin-left: 6px; }
.padhint { color: var(--gold); font-size: 13px; text-shadow: 2px 2px 0 #000; }
.foot { position: absolute; bottom: 10px; color: #5a5146; font-size: 12px; }
@media (max-height: 760px) { .logo .l1 { font-size: 84px; } .logo .l2 { font-size: 32px; } .menu { gap: 6px; } .menu button.big { padding: 9px 18px; } #title { gap: 6px; } }

/* LOBBY */
#lobby, #end, #modal, #esc { display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.55); }
#modal, #esc { z-index: 20; }
.lobbypanel { width: min(580px, 94vw); }
.lobbywait { color: var(--gold); font-size: 15px; margin: 6px 0; display: flex; gap: 8px; align-items: center; }
.code { color: #fff; letter-spacing: 6px; background: #120f14; border: 2px solid var(--edge); padding: 2px 10px; }
.plist { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 6px; }
.plist li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--panel2); border: 2px solid #2a231e; font-size: 17px; }
.plist .sw { width: 14px; height: 14px; border: 2px solid #000; flex: none; }
.plist .tagx { margin-left: auto; color: var(--dim); font-size: 13px; }
.plist .ready { color: var(--green); }
body:not(.host) .hostonly { display: none !important; }
body.host .guestonly { display: none !important; }
.waithost { color: var(--dim); }

/* HUD */
#hud { pointer-events: none; }
.wands { position: absolute; left: 12px; top: 12px; display: flex; flex-direction: column; gap: 4px; }
.wandrow { display: flex; align-items: center; gap: 2px; padding: 3px; background: rgba(10, 8, 12, 0.72); border: 2px solid #2a231e; position: relative; }
.wandrow.on { border-color: var(--gold); box-shadow: 0 0 8px rgba(242, 193, 78, 0.35); }
.wandrow:not(.on) { opacity: 0.72; }
.wandrow .num { width: 14px; font-family: var(--title); font-size: 11px; color: var(--dim); text-align: center; }
.wandrow.on .num { color: var(--gold); }
.wandrow img.wand { width: 48px; height: 18px; margin-right: 4px; }
.wandrow .rl { position: absolute; left: 0; bottom: -2px; height: 2px; background: #c8c0b0; }
.slot { width: var(--slot); height: var(--slot); background: rgba(0,0,0,0.5); border: 2px solid #3a3029; display: flex; align-items: center; justify-content: center; position: relative; flex: none; }
.slot img { width: calc(var(--slot) - 4px); height: calc(var(--slot) - 4px); }
.slot .uses { position: absolute; right: 1px; bottom: -1px; font-size: 10px; color: #fff; text-shadow: 1px 1px 0 #000, -1px -1px 0 #000; font-family: var(--title); }
.wandrow .slot { width: var(--hslot); height: var(--hslot); border-width: 1px; }
.wandrow .slot img { width: calc(var(--hslot) - 2px); height: calc(var(--hslot) - 2px); }
.items { display: flex; gap: 4px; margin-top: 4px; }
.items .slot { width: 30px; height: 30px; }
.bars { position: absolute; right: 14px; top: 14px; display: flex; flex-direction: column; gap: 5px; align-items: flex-end; }
.barrow { display: flex; align-items: center; gap: 6px; }
.hico { width: 14px; height: 14px; display: inline-block; background-size: 100% 100%; image-rendering: pixelated; flex: none; }
.bar { width: 190px; height: 12px; background: rgba(0,0,0,0.65); border: 2px solid #2a231e; position: relative; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; transition: width 0.08s linear; }
.bar.hp { height: 16px; } .bar.hp i { background: linear-gradient(#e2393d, #8e1518); }
.bar.hp.low { border-color: #8e1518; animation: pulse 0.5s infinite alternate; }
.bar.mana i { background: linear-gradient(#5ea0ff, #2552a8); }
.bar.reload { height: 8px; } .bar.reload i { background: #c8c0b0; }
.bar.lev { height: 8px; } .bar.lev i { background: linear-gradient(#ffd86a, #b58a1e); }
.bar.hp b { position: absolute; inset: 0; text-align: center; font-size: 12px; line-height: 13px; font-family: var(--title); text-shadow: 1px 1px 0 #000; }
.gold { display: flex; align-items: center; gap: 6px; font-family: var(--title); font-size: 15px; color: var(--gold); text-shadow: 2px 2px 0 #000; margin-top: 2px; }
.coin { width: 10px; height: 10px; background: radial-gradient(#ffe48a, #c08a12); border: 1px solid #5a3c06; display: inline-block; }
/* statuses: Noita-style icon + name + remaining-time bar, one chip per status, by the bars */
.statuses { display: flex; flex-direction: column; gap: 3px; align-items: flex-end; min-height: 0; }
.stchip { display: flex; align-items: center; gap: 5px; background: rgba(8, 6, 10, 0.78); border: 2px solid var(--c); box-shadow: 0 0 10px color-mix(in srgb, var(--c) 45%, transparent); padding: 2px 6px 2px 3px; animation: stin 0.25s ease-out; }
.stchip img { width: 28px; height: 28px; image-rendering: pixelated; flex: none; }
.stchip span { display: flex; flex-direction: column; gap: 2px; min-width: 74px; }
.stchip b { font-family: var(--title); font-size: 12px; font-weight: 400; color: var(--c); text-shadow: 1px 1px 0 #000; text-transform: uppercase; line-height: 1; }
.stchip i { display: block; height: 4px; background: rgba(0, 0, 0, 0.7); border: 1px solid #000; }
.stchip u { display: block; height: 100%; width: 100%; background: var(--c); text-decoration: none; transition: width 0.1s linear; }
@keyframes stin { from { transform: translateX(14px); opacity: 0; } to { transform: none; opacity: 1; } }
/* your perks in the fight: icons in a row under the bars, stack counts as x2 badges */
.hudperks { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 3px; max-width: 214px; }
.hperk { position: relative; width: 26px; height: 26px; background: rgba(8, 6, 10, 0.7); border: 1px solid #3a3029; }
.hperk img { width: 24px; height: 24px; display: block; }
.hperk em, .sperk b { position: absolute; right: -3px; bottom: -4px; font-style: normal; font-family: var(--title); font-size: 10px; color: #fff; background: #7a2e12; border: 1px solid #000; padding: 0 2px; line-height: 11px; }
.hudtip { z-index: 60; max-width: 260px; }
/* flasks: liquid colour + fill level, key hints */
.items { align-items: center; }
.items .slot.flask { position: relative; }
.items .slot.flask img { width: 20px; height: 28px; }
.items .slot.flask .fill { position: absolute; left: 0; bottom: -4px; height: 3px; box-shadow: 0 0 0 1px #000; }
.ihint { font-size: 10px; font-family: var(--title); color: var(--dim); text-shadow: 1px 1px 0 #000; line-height: 1.5; margin-left: 4px; }
.ihint kbd { font-family: var(--title); font-size: 10px; background: #1a1614; border: 1px solid var(--edge); padding: 0 3px; color: #fff; }
.feed { position: absolute; right: 14px; top: 150px; display: flex; flex-direction: column; gap: 3px; align-items: flex-end; font-size: 14px; text-shadow: 2px 2px 0 #000; }
.feed div { background: rgba(0,0,0,0.5); padding: 2px 8px; animation: fadeout 7s forwards; display: flex; align-items: center; gap: 6px; }
.feed img { width: 18px; height: 18px; }
.feed .me { border: 1px solid rgba(242, 193, 78, 0.6); }
@keyframes fadeout { 0%, 82% { opacity: 1; } 100% { opacity: 0; } }
.banner { position: absolute; left: 0; right: 0; top: 24%; text-align: center; font-family: var(--title); font-size: clamp(28px, 5vw, 56px); color: #fff; text-shadow: 0 0 16px rgba(170,90,255,0.6), 4px 4px 0 #000; }
.subbanner { position: absolute; left: 0; right: 0; top: calc(24% + 70px); text-align: center; font-size: 20px; color: var(--gold); text-shadow: 2px 2px 0 #000; }
.roundinfo { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); font-family: var(--title); font-size: 13px; color: var(--dim); text-shadow: 2px 2px 0 #000; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.roundinfo .pipsrow { display: flex; gap: 12px; }
.roundinfo .pp { display: flex; gap: 2px; align-items: center; }
.roundinfo .pp i { width: 9px; height: 9px; border: 1px solid #000; display: inline-block; }
.roundinfo .pp.dead { opacity: 0.35; }
.roundinfo .sd { color: #ff6a20; font-size: 16px; animation: pulse 0.6s infinite alternate; }
.roundinfo .sdw { color: #ff9a4a; }
@keyframes pulse { from { opacity: 0.55; } to { opacity: 1; } }
.score { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); min-width: 460px; }
.score table { width: 100%; border-collapse: collapse; font-size: 16px; }
.score td, .score th { padding: 6px 10px; text-align: left; border-bottom: 1px solid #2a231e; }
.score th { color: var(--dim); font-family: var(--title); font-size: 12px; font-weight: 400; }
.spectate { position: absolute; left: 50%; bottom: 90px; transform: translateX(-50%); font-family: var(--title); font-size: 16px; color: #fff; background: rgba(0,0,0,0.6); border: 2px solid var(--edge); padding: 6px 14px; text-shadow: 2px 2px 0 #000; text-align: center; }
.spectate small { display: block; font-family: var(--font); font-size: 12px; color: var(--dim); }
.pickups { position: absolute; left: 50%; bottom: 36px; transform: translateX(-50%); display: flex; flex-direction: column-reverse; align-items: center; gap: 4px; }
.pickups div { background: rgba(10, 8, 12, 0.8); border: 1px solid var(--edge); padding: 3px 10px; font-size: 14px; display: flex; gap: 6px; align-items: center; text-shadow: 1px 1px 0 #000; transition: opacity 0.4s; }
.pickups div.out { opacity: 0; }
.pickups img { width: 20px; height: 20px; }
.pickups .g { color: var(--gold); }
.netstat { position: absolute; left: 12px; bottom: 8px; font-size: 11px; color: #5a5146; }
.vignette { position: fixed; inset: 0; pointer-events: none; z-index: 1; opacity: 0; background: radial-gradient(ellipse at center, rgba(0,0,0,0) 45%, rgba(170, 0, 0, 0.55) 100%); transition: opacity 0.06s linear; }
.vignette.sd { background: radial-gradient(ellipse at center, rgba(0,0,0,0) 55%, rgba(255, 90, 0, 0.35) 100%); }

/* HOLY MOUNTAIN */
#build { display: flex; align-items: center; justify-content: center; background: rgba(5, 4, 8, 0.62); }
.mountain { width: min(1240px, 97vw); max-height: min(96vh, 940px); display: flex; flex-direction: column; background: var(--panel); border: 2px solid var(--edge2); box-shadow: 0 0 0 2px #000, inset 0 0 40px rgba(255, 200, 120, 0.05), 0 0 60px rgba(242, 193, 78, 0.12); padding: 12px 16px; position: relative; }
.mountain header { display: flex; align-items: center; gap: 14px; border-bottom: 2px solid #2a231e; padding-bottom: 8px; flex: none; }
.htitle { font-family: var(--title); font-size: 22px; color: var(--gold); text-shadow: 0 0 12px rgba(255, 190, 60, 0.4); white-space: nowrap; }
.htitle small { font-size: 12px; color: var(--dim); }
.bnext { color: var(--dim); font-size: 13px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bnext b { color: var(--text); font-weight: 400; }
.hgold { display: flex; align-items: center; gap: 6px; font-family: var(--title); font-size: 20px; color: var(--gold); background: #120f14; border: 2px solid #5a4620; padding: 2px 10px; white-space: nowrap; }
.hgold.bump { animation: bump 0.3s; }
@keyframes bump { 50% { transform: scale(1.15); } }
.breadys { display: flex; gap: 4px; }
.breadys span { font-family: var(--title); font-size: 11px; padding: 3px 6px; border: 2px solid #2a231e; background: #120f14; color: var(--dim); white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.breadys span i { width: 8px; height: 8px; border: 1px solid #000; display: inline-block; }
.breadys span.r { color: var(--green); border-color: #2f5a26; }
.btimer { font-family: var(--title); font-size: 30px; color: #fff; min-width: 54px; text-align: right; }
.btimer.low { color: #ff5a3a; animation: pulse 0.5s infinite alternate; }
.bomen { flex: none; margin-top: 6px; padding: 4px 10px; font-size: 13px; color: var(--dim); background: rgba(90, 30, 10, 0.35); border: 1px solid #5a2a14; }
.bomen b { color: #ff9a4a; font-weight: 400; }
.bwarn { position: absolute; left: 50%; top: 58px; transform: translateX(-50%); z-index: 5; font-family: var(--title); font-size: 20px; color: #fff; background: #7a1a10; border: 2px solid #ff5a3a; padding: 6px 18px; box-shadow: 0 0 0 2px #000, 0 0 30px rgba(255, 60, 30, 0.5); animation: pulse 0.4s infinite alternate; pointer-events: none; }
.bcols { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 16px; }
.bleft, .bright { display: flex; flex-direction: column; min-height: 0; }
.bright { overflow-y: auto; overflow-x: hidden; padding-right: 2px; }
.bleft h3, .bright h3 { margin: 10px 0 6px; }
.bwands { flex: 0 1 auto; min-height: 0; overflow-y: auto; padding-right: 4px; }
.bwand { background: var(--panel2); border: 2px solid #2a231e; padding: 6px 8px; margin-bottom: 6px; cursor: pointer; position: relative; }
.bwand:hover { border-color: #5a4a3a; }
.bwand.sel { border-color: var(--gold); box-shadow: 0 0 0 1px #000, 0 0 14px rgba(242, 193, 78, 0.18); cursor: default; }
.bwand .whead { display: flex; align-items: center; gap: 10px; min-height: 26px; }
.bwand .whead img { width: 64px; height: 24px; }
.bwand .wname { font-size: 15px; color: #fff; white-space: nowrap; }
.bwand .wsum { font-size: 12px; color: var(--dim); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bwand .seltag { font-family: var(--title); font-size: 10px; color: #1a1206; background: var(--gold); padding: 2px 6px; white-space: nowrap; }
.bwand .newtag, .slot .newtag { font-family: var(--title); font-size: 9px; color: #08200a; background: var(--green); padding: 1px 4px; }
.slot .newtag { position: absolute; left: -2px; top: -6px; z-index: 2; pointer-events: none; animation: pulse 0.7s infinite alternate; }
.bwand .wstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px 14px; font-size: 12px; color: var(--dim); margin: 4px 0 6px; }
.bwand .wstats b { color: var(--text); font-weight: 400; }
.bwand .wslots { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.bwand .preview { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; font-size: 11px; color: var(--dimmer); align-items: center; }
.bwand .preview .cast { display: flex; align-items: center; gap: 1px; background: rgba(0,0,0,0.35); padding: 1px 3px; border: 1px solid #241e19; }
.bwand .preview .cast img { width: 14px; height: 14px; }
.bwand .preview .cast.rc { border-color: #5a3c20; }
.bwand .empty { color: #5a5146; font-size: 14px; }
.bagrow { display: flex; gap: 8px; align-items: stretch; flex: none; }
.bag { display: flex; flex-wrap: wrap; gap: 3px; flex: 1; align-content: flex-start; }
.slot.drop, .slot.held { border-color: var(--gold); background: rgba(242, 193, 78, 0.15); }
.slot.filled { cursor: grab; }
.slot.isnew { border-color: #3f8a32; }
.slot.flash { animation: flash 0.45s; }
@keyframes flash { 0% { background: rgba(242, 193, 78, 0.6); } 100% { background: rgba(0,0,0,0.5); } }
.trash { width: 76px; flex: none; padding: 6px; border: 2px dashed #5a2a22; color: #8a4a3a; font-size: 12px; text-align: center; display: flex; flex-direction: column; justify-content: center; font-family: var(--title); }
.trash small { font-family: var(--font); font-size: 10px; }
.trash.drop { border-color: #ff5a3a; color: #ff8a6a; background: rgba(255, 60, 30, 0.1); }
.shophead { display: flex; align-items: center; justify-content: space-between; }
.shophead h3 { margin: 6px 0; }
.shop { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
.shopitem { background: var(--panel2); border: 2px solid #2a231e; padding: 4px 2px; text-align: center; cursor: pointer; font-size: 11px; line-height: 1.15; position: relative; }
.shopitem:hover { border-color: var(--gold); }
.shopitem img { width: 36px; height: 36px; display: block; margin: 0 auto 2px; }
.shopitem .sn { height: 26px; overflow: hidden; }
.shopitem.wand { grid-column: span 5; display: flex; align-items: center; gap: 10px; text-align: left; padding: 5px 8px; }
.shopitem.wand img { width: 64px; height: 24px; margin: 0; }
.shopitem.wand .wsp { display: flex; gap: 2px; margin-top: 2px; } .shopitem.wand .wsp img { width: 18px; height: 18px; }
.shopitem.wand .wmeta { font-size: 11px; color: var(--dim); }
.shopitem.wand .cmp { margin-left: auto; font-family: var(--title); font-size: 10px; }
.shopitem.sold { opacity: 0.3; pointer-events: none; }
.shopitem.poor .price { color: #a04a3a; }
.price { color: var(--gold); font-family: var(--title); font-size: 11px; }
.up, .tooltip td.up { color: var(--green); } .down, .tooltip td.down { color: #e0604a; }
.perks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.perk { background: var(--panel2); border: 2px solid #2a231e; padding: 5px; text-align: center; cursor: pointer; font-size: 11px; position: relative; }
.perk img { width: 34px; height: 34px; display: block; margin: 0 auto 3px; }
.perk b { display: block; color: #fff; font-weight: 400; font-size: 13px; }
.perk span { color: var(--dim); font-size: 11px; line-height: 1.2; display: block; }
.perk:hover { border-color: #8a7a5a; }
.perk .stack { margin-top: 4px; font-family: var(--font); font-size: 11px; line-height: 1.15; color: var(--dimmer); }
.myperks.compact .mperk { padding-right: 3px; }
.perk .stack.have { color: var(--gold); }
.myperks { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: -2px 0 6px; font-size: 12px; }
.myperks .mpl { font-family: var(--title); font-size: 10px; color: var(--dim); text-transform: uppercase; }
.myperks .none { color: var(--dimmer); font-size: 11px; }
.mperk { display: inline-flex; align-items: center; gap: 3px; background: rgba(0, 0, 0, 0.35); border: 1px solid #3a3029; padding: 1px 5px 1px 1px; }
.mperk img { width: 20px; height: 20px; }
.mperk b { color: var(--gold); font-weight: 400; font-family: var(--title); font-size: 11px; }
.mperk small { color: var(--green); font-family: var(--title); font-size: 9px; }
.perkcell { white-space: normal; }
.sperk { position: relative; display: inline-flex; align-items: center; gap: 3px; margin: 1px 8px 1px 0; vertical-align: middle; }
.sperk img { width: 18px; height: 18px; }
.sperk small { font-size: 12px; color: var(--dim); }
.score .sperk b { position: static; background: none; border: 0; color: var(--gold); font-size: 12px; }
.stlegend { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 12px; font-size: 13px; color: var(--dim); }
.stlegend span { display: flex; align-items: center; gap: 6px; }
.stlegend img { width: 24px; height: 24px; flex: none; }
.stlegend b { font-family: var(--title); font-weight: 400; font-size: 12px; white-space: nowrap; }
.perk.pick { border-color: var(--gold); background: rgba(242, 193, 78, 0.1); }
.perk.taken { border-color: var(--green); }
.perk.taken::after { content: '✓ TAKEN'; position: absolute; right: 3px; top: 3px; font-family: var(--title); font-size: 9px; color: #08200a; background: var(--green); padding: 1px 3px; }
.perks.done .perk:not(.taken) { opacity: 0.3; pointer-events: none; }
.perkconfirm { margin-top: 6px; display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--dim); }
.perkconfirm button { flex: none; }
#readybtn { width: 100%; margin-top: auto; flex: none; }
.bright > #readybtn { margin-top: 12px; }
#readybtn.on { border-color: var(--green); color: var(--green); }
#readybtn.nudge { animation: pulse 0.45s infinite alternate; border-color: #ff8a4a; }
#readybtn.confirm { border-color: #ff8a4a; color: #ffcf9a; font-size: 14px; }
.bpadhint { margin-top: 6px; font-size: 12px; color: var(--dim); line-height: 1.4; }
.bpadhint kbd, .keys kbd, .pk { font-family: var(--title); font-size: 11px; background: #1a1614; border: 2px solid var(--edge); padding: 0 5px; color: #fff; }
.tooltip { position: fixed; z-index: 50; pointer-events: none; max-width: 340px; background: rgba(12, 10, 14, 0.97); border: 2px solid var(--edge2); padding: 10px 12px; font-size: 13px; box-shadow: 0 0 0 2px #000; }
.tooltip .tn { font-size: 16px; color: #fff; }
.tooltip .tt { font-size: 11px; font-family: var(--title); margin-bottom: 4px; }
.tooltip .td { color: var(--dim); margin-bottom: 6px; }
.tooltip table { border-collapse: collapse; } .tooltip td, .tooltip th { padding: 0 10px 0 0; color: var(--dim); text-align: left; font-weight: 400; }
.tooltip td + td { color: var(--text); }
.tooltip th { font-family: var(--title); font-size: 10px; color: var(--dimmer); }
.tooltip .cmpnote { margin-top: 6px; font-size: 11px; color: var(--dimmer); }
.dragghost { position: fixed; z-index: 60; pointer-events: none; width: 40px; height: 40px; image-rendering: pixelated; opacity: 0.9; }
@media (max-width: 1100px) { .bcols { grid-template-columns: minmax(0, 1fr) 340px; } .breadys span b { display: none; } }
@media (max-height: 780px) {
  .mountain { padding: 8px 12px; }
  .htitle { font-size: 18px; }
  .btimer { font-size: 24px; }
  .bleft h3, .bright h3 { margin: 6px 0 4px; font-size: 12px; }
  .bwand { padding: 4px 6px; margin-bottom: 4px; }
  .shopitem img { width: 30px; height: 30px; }
  .perk img { width: 28px; height: 28px; }
  .perk span { font-size: 10px; }
  button.big { font-size: 16px; padding: 9px 18px; }
  :root { --slot: 34px; }
}
@media (min-width: 1700px) and (min-height: 1000px) {
  :root { --slot: 44px; --hslot: 30px; }
  .mountain { width: min(1560px, 94vw); padding: 16px 22px; }
  .bcols { grid-template-columns: minmax(0, 1fr) 500px; gap: 22px; }
  .htitle { font-size: 28px; }
  .bnext { font-size: 15px; }
  .bwand .wname { font-size: 18px; }
  .bwand .wstats, .bwand .wsum { font-size: 14px; }
  .bwand .preview .cast img { width: 18px; height: 18px; }
  .shopitem { font-size: 13px; } .shopitem img { width: 48px; height: 48px; } .shopitem .sn { height: 32px; }
  .perk img { width: 44px; height: 44px; } .perk b { font-size: 15px; } .perk span { font-size: 12px; }
  .tooltip { font-size: 14px; max-width: 380px; }
  .bar { width: 230px; }
}

/* END */
.endpanel { width: min(960px, 96vw); max-height: 96vh; overflow-y: auto; }
.endpanel h2 { font-size: 28px; margin-bottom: 2px; }
.endsub { color: var(--dim); font-size: 14px; margin-bottom: 12px; }
.endpanel table { width: 100%; border-collapse: collapse; font-size: 15px; }
.endpanel td, .endpanel th { padding: 6px 8px; border-bottom: 1px solid #2a231e; text-align: left; vertical-align: middle; }
.endpanel th { color: var(--dim); font-family: var(--title); font-size: 11px; font-weight: 400; }
.endpanel .champ td:first-child::before { content: '♛ '; color: var(--gold); }
.endpanel .meRow { background: rgba(242, 193, 78, 0.06); }
.endpanel .mini img { width: 16px; height: 16px; vertical-align: middle; }
.endpanel .pipz i { width: 9px; height: 9px; border: 1px solid #000; display: inline-block; margin-right: 2px; }
.awards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 6px 0 12px; }
.award { background: var(--panel2); border: 2px solid #2a231e; padding: 8px 10px; font-size: 13px; min-height: 76px; }
.award .at { font-family: var(--title); font-size: 10px; color: var(--dim); letter-spacing: 1px; }
.award .an { font-size: 17px; margin: 2px 0; }
.award .av { color: var(--gold); font-size: 13px; }
.award .wsp { display: flex; flex-wrap: wrap; gap: 1px; margin-top: 4px; } .award .wsp img { width: 16px; height: 16px; }
.award .wimg { width: 56px; height: 21px; }
.timeline { display: flex; gap: 4px; margin: 12px 0 4px; flex-wrap: wrap; }
.timeline .tr { flex: 1; min-width: 74px; background: var(--panel2); border: 2px solid #2a231e; border-top-width: 4px; padding: 4px 6px; font-size: 11px; color: var(--dim); }
.timeline .tr b { display: block; color: #fff; font-weight: 400; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeline .tr .sdt { color: #ff8a4a; font-family: var(--title); font-size: 9px; }
.endach { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--dim); align-items: center; }
.endach span.a { color: var(--gold); border: 2px solid #5a4620; padding: 2px 8px; background: #1a1408; }
.endrow { justify-content: flex-start; }
.endclock { margin-left: auto; color: var(--dimmer); font-size: 13px; }
@media (max-height: 760px) { .endpanel { padding: 14px 18px; } .award { min-height: 0; padding: 6px 8px; } .endpanel td, .endpanel th { padding: 4px 6px; } }

/* MODALS */
.modalpanel { width: min(880px, 96vw); max-height: 90vh; overflow: auto; position: relative; }
.close { position: absolute; right: 10px; top: 10px; }
.codexgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.codexgrid .ce { display: flex; gap: 8px; align-items: center; background: var(--panel2); border: 2px solid #2a231e; padding: 5px; font-size: 13px; }
.codexgrid .ce img { width: 32px; height: 32px; }
.codexgrid .ce.locked { opacity: 0.45; filter: grayscale(1) brightness(0.4); }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 15px; align-items: center; }
.keys kbd { font-size: 12px; padding: 1px 6px; }
.howto p { color: var(--dim); line-height: 1.45; font-size: 15px; }
.howto b { color: var(--text); font-weight: 400; }
.setgrid { display: grid; grid-template-columns: 200px 1fr 50px; gap: 8px 14px; align-items: center; font-size: 15px; }
.setgrid .sv { color: var(--gold); font-family: var(--title); font-size: 12px; text-align: right; }
.setgrid.binds { grid-template-columns: 200px 1fr; }
.setgrid input[type=range] { width: 100%; }
.setgrid button { justify-self: start; }
.bindbtn { min-width: 140px; justify-self: start; }
.bindbtn.wait { border-color: var(--gold); color: var(--gold); }
.padbox { background: var(--panel2); border: 2px solid #2a231e; padding: 8px 12px; font-size: 14px; color: var(--dim); }
.padbox b { color: var(--text); font-weight: 400; }
.ach { display: flex; gap: 10px; align-items: center; padding: 6px; background: var(--panel2); border: 2px solid #2a231e; margin-bottom: 4px; font-size: 14px; }
.ach.locked { opacity: 0.4; }
.ach b { color: var(--gold); font-weight: 400; }
.ach .prog { margin-left: auto; color: var(--dimmer); font-size: 12px; }
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 14px; }
.stats div { background: var(--panel2); border: 2px solid #2a231e; padding: 8px; text-align: center; }
.stats b { display: block; font-family: var(--title); font-size: 22px; color: var(--gold); font-weight: 400; }
.hist { width: 100%; border-collapse: collapse; font-size: 13px; } .hist td { padding: 3px 6px; border-bottom: 1px solid #2a231e; color: var(--dim); }
.escpanel { display: flex; flex-direction: column; gap: 8px; width: 320px; }

/* TUTORIAL */
.tut { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
.tutring { position: fixed; border: 3px solid var(--gold); box-shadow: 0 0 0 4px rgba(0,0,0,0.6), 0 0 24px rgba(242, 193, 78, 0.6); pointer-events: none; animation: pulse 0.7s infinite alternate; display: none; }
.tutcard { position: fixed; pointer-events: auto; width: 360px; background: rgba(16, 12, 20, 0.97); border: 2px solid var(--gold); box-shadow: 0 0 0 2px #000, 0 8px 30px rgba(0,0,0,0.7); padding: 12px 14px; font-size: 15px; line-height: 1.4; }
.tutcard.bottom { left: 50%; bottom: 120px; transform: translateX(-50%); width: 440px; text-align: center; }
.tutstep { font-family: var(--title); font-size: 10px; color: var(--gold); letter-spacing: 1px; margin-bottom: 4px; }
.tuttext b { color: var(--gold); font-weight: 400; }
.tuttext kbd { font-family: var(--title); font-size: 11px; background: #1a1614; border: 2px solid var(--edge); padding: 0 5px; color: #fff; }
.tutbtns { display: flex; gap: 6px; margin-top: 8px; justify-content: flex-end; }
.tutcard.bottom .tutbtns { justify-content: center; }
.tutcard.done { border-color: var(--green); }

/* GAMEPAD FOCUS + NET */
.padfocus { position: fixed; z-index: 90; pointer-events: none; border: 3px solid #fff3c4; box-shadow: 0 0 0 2px #000, 0 0 14px rgba(242, 193, 78, 0.9); transition: left 0.06s, top 0.06s, width 0.06s, height 0.06s; }
.reconnect { position: fixed; left: 50%; top: 0; transform: translateX(-50%); z-index: 95; background: #5a120c; border: 2px solid #ff5a3a; border-top: none; padding: 8px 18px; font-family: var(--title); font-size: 14px; color: #fff; box-shadow: 0 0 0 2px #000; display: flex; gap: 10px; align-items: center; }
.toast { position: fixed; left: 50%; bottom: 60px; transform: translateX(-50%); background: var(--panel); border: 2px solid var(--gold); padding: 10px 16px; font-size: 15px; z-index: 80; }
.loading { position: fixed; inset: 0; display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center; font-family: var(--title); font-size: 22px; color: var(--dim); background: rgba(11, 10, 13, 0.88); z-index: 99; }
.loading.boot { background: var(--bg); }
.spin { width: 24px; height: 24px; background: var(--gold); box-shadow: 0 0 16px rgba(242, 193, 78, 0.8); animation: spin 1s steps(8) infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading.hidden { display: none; }
