/* =====================================================================
   Game-style module bay. Loaded after style.css and overrides its plain
   web look. Pixel bevels: light top-left edge, dark bottom-right edge,
   notched corners, recessed sockets.
   ===================================================================== */
:root {
  --notch: polygon(4px 0, calc(100% - 4px) 0, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 0 calc(100% - 4px), 0 4px);
  --metal-hi: #4a5596;
  --metal: #232a52;
  --metal-lo: #0c0f26;
  --ink: #05060f;
}
.k-dmg { --kc: #ff6b78; --kd: #9b2234; --kb: #4a1726; --hi: rgba(255, 170, 180, .22); }
.k-burn { --kc: #ffae5c; --kd: #a8561a; --kb: #4a2a12; --hi: rgba(255, 210, 150, .22); }
.k-shield { --kc: #7cc0ff; --kd: #2b5a9e; --kb: #16294a; --hi: rgba(180, 220, 255, .22); }
.k-heal { --kc: #7be6a3; --kd: #227a4a; --kb: #143a2a; --hi: rgba(170, 255, 200, .22); }
.k-stun { --kc: #c7a6ff; --kd: #5f3fa8; --kb: #2c2050; --hi: rgba(220, 200, 255, .22); }
.k-hp { --kc: #ffd95e; --kd: #a07a14; --kb: #42360f; --hi: rgba(255, 235, 160, .22); }
.k-haste { --kc: #ff8fe0; --kd: #9c2f84; --kb: #42163c; --hi: rgba(255, 190, 240, .22); }

/* the whole lower half: a dark machined panel */
#panel {
  gap: 6px; padding-top: 10px; border-top: 0;
  background:
    radial-gradient(130% 55% at 50% 0%, #1d2450 0%, rgba(29, 36, 80, 0) 70%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 4px),
    #10132a;
  box-shadow: inset 0 3px 0 #3a4480, inset 0 6px 0 var(--ink);
}

/* top row: chunky pixel plates and buttons */
#topRow { gap: 6px; flex-basis: 42px; }
.chip, #choiceBtn, #menuBtn, #vsBtn {
  clip-path: var(--notch);
  border: 0;
  background: linear-gradient(180deg, #2c356a 0%, var(--metal) 55%, #1a2045 100%);
  box-shadow: inset 0 0 0 2px var(--ink), inset 3px 3px 0 var(--metal-hi), inset -3px -3px 0 var(--metal-lo);
}
.chip { padding: 0 10px 0 9px; gap: 7px; font-size: 10px; text-shadow: 2px 2px 0 var(--ink); }
.coin, .corei { filter: drop-shadow(1px 1px 0 var(--ink)); }
#choiceBtn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  color: #cfe0ff; font-size: 11px; letter-spacing: 1px; text-shadow: 2px 2px 0 var(--ink);
}
#choiceBtn.has {
  color: #fff; animation: none;
  background: linear-gradient(180deg, #33d8ff 0%, #139bc4 50%, #0c6e90 100%);
  box-shadow: inset 0 0 0 2px var(--ink), inset 3px 3px 0 #a8f3ff, inset -3px -3px 0 #07506a;
}
#choiceBtn.has b {
  min-width: 18px; padding: 4px 5px; background: var(--gold); color: var(--ink);
  box-shadow: inset -2px -2px 0 #b98a22; animation: blip 1s steps(2) infinite;
}
@keyframes blip { 50% { transform: translateY(-2px); } }
#menuBtn { flex-basis: 54px; font-size: 7px; color: #cfe0ff; text-shadow: 1px 1px 0 var(--ink); }
#choiceBtn:active, #menuBtn:active {
  transform: translateY(2px);
  box-shadow: inset 0 0 0 2px var(--ink), inset 3px 3px 0 var(--metal-lo), inset -3px -3px 0 var(--metal-hi);
}

/* bay title strip */
.bayHead {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 0 4px;
  font-family: var(--px); font-size: 7px; color: var(--accent); text-shadow: 1px 1px 0 var(--ink);
}
.bayHead::before { content: ""; width: 8px; height: 8px; background: var(--accent); box-shadow: 2px 2px 0 var(--ink); }
.bayHead::after { content: ""; flex: 1; height: 2px; background: repeating-linear-gradient(90deg, #3a4480 0 6px, transparent 6px 10px); order: 1; }
.bayHead i { order: 2; font-style: normal; color: var(--dim); }

/* the bay: a thick metal frame around recessed sockets */
#bagWrap { padding: 10px; }
#bag {
  background: var(--metal-lo); outline: 0;
  background-image: none;
  box-shadow:
    0 0 0 3px var(--ink),
    0 0 0 6px #2f3870,
    0 0 0 8px #48539a,
    0 0 0 10px var(--ink),
    0 10px 0 10px rgba(0, 0, 0, .45);
}
.sock {
  position: absolute; pointer-events: none;
  background: #0b0e24;
  box-shadow: inset 0 0 0 2px #070818, inset 3px 3px 0 #05060f, inset -2px -2px 0 #1c2350;
}
.sock::after {        /* small rivet in each socket corner */
  content: ""; position: absolute; left: 5px; top: 5px; width: 2px; height: 2px; background: #252d5c;
}

/* module plates */
.item .ic {
  border: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--kc) 30%, var(--kb)) 0%, var(--kb) 70%);
}
.item .ic::after {      /* cooldown charge rising from the bottom */
  background: linear-gradient(0deg, color-mix(in srgb, var(--kc) 40%, transparent), color-mix(in srgb, var(--kc) 12%, transparent));
  box-shadow: 0 -2px 0 color-mix(in srgb, var(--kc) 85%, white);
}
.item .icon { filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, .55)); }
.item .lv {
  left: 4px; top: 4px; padding: 2px 3px 1px; font-size: 6px; letter-spacing: 0;
  background: var(--ink); color: var(--gold); text-shadow: none; box-shadow: 0 0 0 1px var(--gold);
}
.item .fast {
  right: 4px; top: 4px; padding: 2px 3px 1px; font-size: 6px;
  background: var(--ink); color: #ff9be4; text-shadow: none; box-shadow: 0 0 0 1px #ff9be4;
}
.item.fire .ic { animation: fireGlow .18s steps(2); }
@keyframes fireGlow { from { filter: brightness(1.8); } }
.item:not(.dragging):hover .ic { filter: brightness(1.15); }
.item.ghost { filter: drop-shadow(0 8px 0 rgba(0, 0, 0, .55)); }
.hl.ok { background: rgba(88, 214, 141, .28); outline: 0; box-shadow: inset 0 0 0 3px #58d68d; }
.hl.bad { background: rgba(255, 77, 94, .28); outline: 0; box-shadow: inset 0 0 0 3px #ff4d5e; }
.hl.merge { background: rgba(255, 210, 63, .32); outline: 0; box-shadow: inset 0 0 0 3px var(--gold); }

/* spare tray and sell zone */
#benchRow { height: 70px; gap: 6px; }
#benchBox {
  position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column;
  clip-path: var(--notch);
  background: #0b0e24;
  box-shadow: inset 0 0 0 2px var(--ink), inset 3px 3px 0 #05060f, inset -3px -3px 0 #232b5e;
}
#benchBox > small { padding: 7px 9px 0; font-family: var(--px); font-size: 6px; color: var(--dim); }
#benchBox > small i { font-style: normal; color: var(--text); }
#bench { flex: 1; border: 0; background: none; padding: 0 9px; }
#bench:empty::before { content: "Bought modules wait here"; font-size: 15px; color: #4a5490; }
#bench.over { background: rgba(255, 210, 63, .12); }
#sell {
  flex: 0 0 62px; flex-direction: column; gap: 5px; border: 0;
  clip-path: var(--notch);
  background: repeating-linear-gradient(135deg, #3a1220 0 6px, #2a0c18 6px 12px);
  box-shadow: inset 0 0 0 2px var(--ink), inset 3px 3px 0 #7a3040, inset -3px -3px 0 #1a0710;
  color: #ff9aa8; text-shadow: 1px 1px 0 var(--ink);
}
#sell b { font-weight: 400; font-size: 9px; }
#sell small { font-size: 5px; color: #c97a88; }
#sell.over { border: 0; color: #fff; background: repeating-linear-gradient(135deg, #8a2234 0 6px, #5a1424 6px 12px); }

/* info strip under the bay: a small framed readout */
#hint {
  flex: 0 0 42px; display: flex; flex-direction: column; justify-content: center; gap: 2px;
  padding: 0 10px; text-align: left; font-size: 15px; line-height: 1.05;
  clip-path: var(--notch);
  background: #0b0e24; box-shadow: inset 0 0 0 2px var(--ink), inset 0 2px 0 #232b5e;
}
#hint.on { box-shadow: inset 0 0 0 2px var(--ink), inset 5px 0 0 var(--kc); padding-left: 13px; }
#hint em { font-style: normal; font-family: var(--px); font-size: 6px; color: var(--kc); }
#hint b { font-family: var(--px); font-size: 8px; font-weight: 400; color: var(--text); }
#hint span { color: var(--dim); }
#hint span i { font-style: normal; font-family: var(--px); font-size: 6px; color: #ff9be4; }

/* shop sheet in the same style */
.sheet {
  border-top: 0;
  background: linear-gradient(180deg, #1b2148, #10132a 40%);
  box-shadow: inset 0 3px 0 var(--accent), inset 0 6px 0 var(--ink);
}
.card {
  border: 0; clip-path: var(--notch);
  background: linear-gradient(180deg, #252d5c, #161b3a);
  box-shadow: inset 0 0 0 2px var(--ink), inset 3px 3px 0 var(--metal-hi), inset -3px -3px 0 var(--metal-lo);
}
.card:hover { box-shadow: inset 0 0 0 2px var(--ink), inset 0 0 0 4px var(--kc); }
.card .tag { border: 0; background: var(--kb); box-shadow: 0 0 0 1px var(--kc); }
.card .price {
  border: 0; clip-path: var(--notch);
  background: linear-gradient(180deg, #33d8ff, #0c6e90);
  box-shadow: inset 0 0 0 2px var(--ink), inset 2px 2px 0 #a8f3ff, inset -2px -2px 0 #07506a;
  text-shadow: 1px 1px 0 var(--ink);
}
.card.poor .price { background: #161b3a; box-shadow: inset 0 0 0 2px var(--ink); }
.sheet .row button {
  border: 0; clip-path: var(--notch);
  background: linear-gradient(180deg, #2c356a, #1a2045);
  box-shadow: inset 0 0 0 2px var(--ink), inset 3px 3px 0 var(--metal-hi), inset -3px -3px 0 var(--metal-lo);
}

/* small icon buttons in the top row: upgrades, leaderboard, options */
#topRow .icon {
  position: relative; flex: 0 0 38px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 0; clip-path: var(--notch);
  background: linear-gradient(180deg, #2c356a 0%, var(--metal) 55%, #1a2045 100%);
  box-shadow: inset 0 0 0 2px var(--ink), inset 3px 3px 0 var(--metal-hi), inset -3px -3px 0 var(--metal-lo);
}
#topRow .icon img { width: 24px; height: 24px; image-rendering: pixelated; pointer-events: none; }
#topRow .icon:active {
  transform: translateY(2px);
  box-shadow: inset 0 0 0 2px var(--ink), inset 3px 3px 0 var(--metal-lo), inset -3px -3px 0 var(--metal-hi);
}
#upgBtn.ready {
  background: linear-gradient(180deg, #33d8ff 0%, #139bc4 50%, #0c6e90 100%);
  box-shadow: inset 0 0 0 2px var(--ink), inset 3px 3px 0 #a8f3ff, inset -3px -3px 0 #07506a;
}
#upgBtn.ready::after {             /* "something to buy" pip */
  content: ""; position: absolute; right: 5px; top: 5px; width: 6px; height: 6px;
  background: var(--gold); box-shadow: 0 0 0 1px var(--ink);
  animation: blip 1s steps(2) infinite;
}

/* top strip: stage number and one progress bar (kills, then boss timer) */
#hud { gap: 8px; align-items: center; }
#floorBox { display: flex; align-items: baseline; gap: 5px; }
#floorBox small { margin: 0; }

/* health bars over VOLT and the boss */
#bars { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.ob {
  position: absolute; left: 0; top: 0; height: 6px; width: 30px; margin-left: -15px;
  background: #05060f; box-shadow: 0 0 0 1px #05060f, 0 0 0 2px rgba(255, 255, 255, .18);
}
.ob.boss { width: 64px; margin-left: -32px; height: 7px; }
.ob i { display: block; height: 100%; background: #58d68d; box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35); }
.ob.low i { background: #ff4d5e; }
.ob.boss i { background: #ff4fd8; }
.ob u { position: absolute; left: 0; top: 0; height: 2px; width: 0; background: #8cc4ff; }
