* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  color: #eee;
}

canvas { display: block; }
.hidden { display: none !important; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }

#objective {
  position: absolute; top: 18px; left: 20px;
  font-size: 14px; letter-spacing: 0.5px; color: #e8d9a8;
  background: rgba(0, 0, 0, 0.45); border-left: 3px solid #c8a24a;
  padding: 8px 14px; border-radius: 3px; text-shadow: 0 1px 2px #000;
}

#stats {
  position: absolute; top: 64px; left: 20px;
  display: flex; flex-direction: column; gap: 5px;
  background: rgba(0,0,0,0.4); padding: 10px 12px; border-radius: 4px;
}
.stat { display: flex; align-items: center; gap: 8px; }
.stat .label { font-size: 9px; letter-spacing: 1.5px; color: #b6ad98; width: 56px; }
.bar { width: 130px; height: 8px; background: rgba(255,255,255,0.12); border-radius: 3px; overflow: hidden; }
.fill { height: 100%; border-radius: 3px; transition: width 0.25s; }
.fill.health { background: #c0453a; }
.fill.stamina { background: #4f9d5f; }
.fill.hunger { background: #d69140; }
.fill.hunger.low { background: #d64040; animation: pulse 1.2s infinite; }
.stat.money { margin-top: 3px; }
#sar-amount { color: #d8c06a; font-size: 14px; font-weight: 600; letter-spacing: 1px; }
#key-badge { display: none; margin-left: 10px; font-size: 11px; color: #d8c06a; border: 1px solid #d8c06a; padding: 1px 6px; border-radius: 3px; }

#crosshair {
  position: absolute; top: 50%; left: 50%;
  width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px;
  border-radius: 50%; background: rgba(255,255,255,0.75);
  box-shadow: 0 0 4px rgba(0,0,0,0.9);
}

#detect {
  position: absolute; top: 14%; left: 50%; transform: translateX(-50%);
  font-size: 20px; font-weight: 700; letter-spacing: 4px;
  padding: 8px 22px; border-radius: 4px;
  text-shadow: 0 1px 3px #000;
}
#detect.suspicious { color: #f0d060; border: 1px solid rgba(240,208,96,0.6); background: rgba(40,32,0,0.5); }
#detect.detected { color: #ff5040; border: 1px solid rgba(255,80,64,0.7); background: rgba(50,8,4,0.55); animation: pulse 0.5s infinite; }

#prompt {
  position: absolute; bottom: 24%; left: 50%; transform: translateX(-50%);
  font-size: 16px; color: #fff; background: rgba(0,0,0,0.55);
  padding: 9px 18px; border-radius: 4px;
  border: 1px solid rgba(200,162,74,0.6);
  text-shadow: 0 1px 2px #000; display: none; white-space: nowrap;
}

/* inventory */
#inventory {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px; pointer-events: auto;
}
/* Hotbar slots: one consistent frame, the real rendered item picture inside,
   and clearly distinct empty / filled / selected states. */
.slot {
  width: 58px; height: 58px; border-radius: 6px;
  background: linear-gradient(180deg, rgba(30,32,38,0.82), rgba(10,11,14,0.88));
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.07), 0 2px 7px rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: #ddd; position: relative;
  cursor: pointer; transition: border-color 0.12s, box-shadow 0.12s, transform 0.12s;
}
.slot.empty { background: linear-gradient(180deg, rgba(18,19,22,0.55), rgba(8,9,11,0.6)); border-color: rgba(255,255,255,0.07); }
.slot:hover { border-color: rgba(255,255,255,0.34); }
.slot.sel {
  border-color: #e6cf7c; transform: translateY(-3px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 0 12px rgba(230,207,124,0.45), 0 3px 9px rgba(0,0,0,0.6);
}
.slot .slot-pic { position: absolute; inset: 3px 3px 12px 3px; display: flex; align-items: center; justify-content: center; }
.slot .slot-pic img { width: 100%; height: 100%; object-fit: contain; image-rendering: auto; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.8)); }
.slot .slot-name {
  position: absolute; bottom: 1px; left: 0; right: 0; text-align: center;
  font-size: 8px; letter-spacing: 1px; color: #9aa1ab; font-weight: 700;
}
.slot.sel .slot-name { color: #e6cf7c; }
.slot .k { position: absolute; top: 1px; left: 4px; font-size: 8px; color: #8d8570; }
.slot .c { position: absolute; bottom: 1px; right: 4px; font-size: 9px; color: #b6ad98; }
.slot .eq { position: absolute; top: 1px; right: 4px; font-size: 9px; color: #d8c06a; }

/* toasts */
#toasts {
  position: absolute; bottom: 80px; right: 22px;
  display: flex; flex-direction: column; gap: 6px; align-items: flex-end;
}
.toast {
  background: rgba(0,0,0,0.65); border-left: 3px solid #8d8570;
  color: #eee; font-size: 13px; padding: 8px 12px; border-radius: 3px;
  max-width: 300px; text-align: left; line-height: 1.35;
  transition: opacity 0.5s, transform 0.5s;
}
.toast.good { border-left-color: #4f9d5f; }
.toast.bad { border-left-color: #c0453a; }
.toast.sar { border-left-color: #d8c06a; }
.toast.dim { opacity: 0.75; }
.toast.out { opacity: 0; transform: translateX(20px); }

/* damage vignette */
#vignette {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(160,20,20,0.55) 100%);
}
#vignette.hit { animation: hitflash 0.5s ease-out; }
@keyframes hitflash { 0% { opacity: 1; } 100% { opacity: 0; } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

/* fade for level transitions */
#fade {
  position: fixed; inset: 0; background: #000; opacity: 0;
  pointer-events: none; transition: opacity 0.6s; z-index: 40;
}
#fade.on { opacity: 1; }

/* ---------- start overlay ---------- */
#start-overlay {
  position: fixed; inset: 0; z-index: 10;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; cursor: pointer; padding: 20px;
  background: radial-gradient(ellipse at center, rgba(10,8,5,0.88) 0%, rgba(0,0,0,0.97) 100%);
}
#start-overlay h1 {
  font-size: 46px; letter-spacing: 8px; color: #c8a24a;
  text-shadow: 0 0 24px rgba(200,162,74,0.35); margin-bottom: 10px;
}
#start-overlay h2 { font-size: 17px; font-weight: 400; letter-spacing: 2px; color: #bbb; margin-bottom: 30px; }
#start-overlay .flow { font-size: 13px; color: #8d8570; margin-bottom: 18px; max-width: 640px; line-height: 1.6; }
#start-overlay .controls { font-size: 13px; color: #ddd; margin-bottom: 10px; }
#start-overlay .controls.dim { font-size: 12px; color: #8d8570; margin-bottom: 34px; }
#start-overlay .click { font-size: 20px; letter-spacing: 4px; color: #fff; animation: blink 1.6s ease-in-out infinite; margin-top: 16px; }
.menu-row { display: flex; align-items: center; gap: 8px; margin: 6px 0 12px; }
.menu-label { font-size: 12px; color: #8d8570; letter-spacing: 1px; margin-right: 6px; }
.opt-btn {
  font-size: 12px; letter-spacing: 1px; padding: 6px 14px;
  background: transparent; color: #b6ad98; border: 1px solid rgba(200,162,74,0.4);
  border-radius: 3px; cursor: pointer;
}
.opt-btn:hover { background: rgba(200,162,74,0.12); }
.opt-btn.on { color: #14110c; background: #c8a24a; border-color: #c8a24a; }
.opt-btn.danger { margin-top: 26px; color: #b06050; border-color: rgba(176,96,80,0.5); }
.opt-btn.danger:hover { background: rgba(176,96,80,0.15); }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---------- dialog ---------- */
#dialog-overlay, #shop-overlay, #menu-overlay {
  position: fixed; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.55);
}
.dialog-card, .shop-card, .menu-card {
  background: #14110c; border: 1px solid rgba(200,162,74,0.5);
  border-radius: 6px; padding: 26px 30px; width: min(520px, 92vw);
  box-shadow: 0 12px 50px rgba(0,0,0,0.8);
}
.dialog-name { color: #c8a24a; letter-spacing: 3px; font-size: 15px; margin-bottom: 14px; }
.dialog-en { font-size: 16px; color: #eee; line-height: 1.5; margin-bottom: 8px; }
.dialog-ar { font-size: 16px; color: #cbbfa4; line-height: 1.7; margin-bottom: 20px; }
.dialog-buttons { display: flex; gap: 10px; }
.dialog-buttons button, #shop-close, #end-overlay button {
  font-size: 13px; letter-spacing: 1px; padding: 9px 18px;
  background: transparent; color: #c8a24a; border: 1px solid #c8a24a;
  border-radius: 3px; cursor: pointer;
}
.dialog-buttons button:hover, #shop-close:hover { background: rgba(200,162,74,0.15); }

/* ---------- shop ---------- */
.shop-card { width: min(560px, 94vw); }
.shop-title { color: #c8a24a; letter-spacing: 3px; font-size: 15px; margin-bottom: 14px; }
#shop-rows { max-height: 52vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.shop-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 4px; border: 1px solid transparent;
  cursor: pointer;
}
.shop-row:hover { background: rgba(255,255,255,0.04); }
.shop-row.sel { border-color: rgba(200,162,74,0.6); background: rgba(200,162,74,0.08); }
.sr-main { flex: 1; display: flex; flex-direction: column; }
.sr-main b { font-size: 14px; color: #eee; }
.sr-desc { font-size: 11.5px; color: #8d8570; margin-top: 2px; }
.sr-price { color: #d8c06a; font-size: 13px; white-space: nowrap; }
.sr-buy {
  font-size: 12px; padding: 5px 14px; background: transparent;
  color: #c8a24a; border: 1px solid #c8a24a; border-radius: 3px; cursor: pointer;
}
.sr-buy:hover { background: rgba(200,162,74,0.2); }
.shop-footer { display: flex; align-items: center; gap: 14px; }
#shop-sar { color: #d8c06a; font-size: 14px; font-weight: 600; flex: 1; }
#shop-sar.shake { animation: shake 0.3s; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.shop-hint { font-size: 11px; color: #8d8570; }

/* ---------- generic menu ---------- */
.menu-card { width: min(560px, 94vw); text-align: center; }
#menu-title { font-size: 28px; letter-spacing: 5px; color: #c8a24a; margin-bottom: 8px; }
#menu-sub { font-size: 13.5px; color: #b6ad98; line-height: 1.6; margin-bottom: 20px; }
#menu-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.menu-opt {
  padding: 12px 16px; border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px; cursor: pointer; text-align: left;
}
.menu-opt:hover { background: rgba(255,255,255,0.05); }
.menu-opt.sel { border-color: #c8a24a; background: rgba(200,162,74,0.1); }
.menu-opt.dis { opacity: 0.45; }
.mo-label { font-size: 15px; color: #eee; letter-spacing: 1px; }
.mo-desc { font-size: 12px; color: #8d8570; margin-top: 3px; line-height: 1.4; }
#menu-hint { font-size: 11px; color: #8d8570; }

/* ---- garage boss health bar ---- */
#boss-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: 26px;
  width: min(46vw, 520px);
  pointer-events: none;
  text-align: center;
}
#boss-bar .boss-name {
  font-size: 12px;
  letter-spacing: 3px;
  color: #e8d9b8;
  text-shadow: 0 2px 6px rgba(0,0,0,0.9);
  margin-bottom: 5px;
}
#boss-bar .boss-track {
  height: 11px;
  background: rgba(12,10,9,0.75);
  border: 1px solid rgba(220,180,120,0.35);
  border-radius: 3px;
  overflow: hidden;
}
#boss-bar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #8e2118, #d04b2c);
  transition: width 0.18s linear;
}

/* ---- held item readout + inventory help ---- */
#held-item {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 92px;
  font-size: 13px;
  letter-spacing: 1px;
  color: #efe3c8;
  text-shadow: 0 2px 6px rgba(0,0,0,0.95);
  pointer-events: none;
  white-space: nowrap;
}
#held-item .held-name { font-weight: 600; }
#held-item .held-empty { color: #8d8a80; opacity: 0.55; }
#held-item .held-on,
#held-item .held-off,
#held-item .held-hint {
  margin-left: 9px;
  font-size: 11px;
  letter-spacing: 2px;
  padding: 1px 6px;
  border-radius: 3px;
}
#held-item .held-on { color: #d8f0c0; background: rgba(60,110,50,0.5); }
#held-item .held-off { color: #cfcfcf; background: rgba(70,70,70,0.45); }
#held-item .held-hint { color: #d9c9a4; background: rgba(90,72,40,0.4); }
#inv-help {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 8px;
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(226,214,190,0.42);
  pointer-events: none;
  white-space: nowrap;
}
.slot .eq { margin-left: 3px; font-size: 10px; }

/* ---- vent puzzle tracker ---- */
#puzzle-tracker {
  position: fixed;
  right: 18px;
  top: 120px;
  min-width: 190px;
  padding: 9px 12px;
  background: rgba(10,12,14,0.72);
  border: 1px solid rgba(190,200,215,0.22);
  border-radius: 4px;
  pointer-events: none;
}
#puzzle-tracker .pz-title {
  font-size: 10px;
  letter-spacing: 2px;
  color: #9fb0c2;
  margin-bottom: 6px;
}
#puzzle-tracker .pz-row {
  font-size: 12px;
  color: rgba(214,222,232,0.55);
  padding: 2px 0;
}
#puzzle-tracker .pz-row.got { color: #9fe0a8; }

/* ---- cutscene subtitle (Arabic, RTL) ---- */
#subtitle {
  position: fixed;
  left: 50%;
  bottom: 22%;
  transform: translateX(-50%);
  font-size: 34px;
  line-height: 1.5;
  color: #f6ecd6;
  text-shadow: 0 3px 12px rgba(0,0,0,0.95), 0 0 26px rgba(0,0,0,0.8);
  padding: 10px 26px;
  background: rgba(8,7,6,0.55);
  border-radius: 6px;
  pointer-events: none;
  direction: rtl;
  unicode-bidi: isolate;
  white-space: nowrap;
}

/* ---- door keypad ---- */
#keypad-overlay {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(4,4,5,0.72); z-index: 40;
}
#keypad-overlay .kp-card {
  background: #14161a; border: 1px solid rgba(200,210,225,0.28); border-radius: 8px;
  padding: 22px 26px; text-align: center; min-width: 280px;
}
#keypad-overlay .kp-title { font-size: 12px; letter-spacing: 3px; color: #9fb0c2; margin-bottom: 12px; }
#keypad-entry {
  font-size: 34px; letter-spacing: 10px; color: #7dffb0; background: #07120c;
  border: 1px solid rgba(80,200,130,0.35); border-radius: 4px; padding: 10px 14px; margin-bottom: 14px;
}
#keypad-overlay .kp-order { display: flex; gap: 8px; justify-content: center; margin-bottom: 14px; }
#keypad-overlay .kp-sq { width: 26px; height: 26px; border-radius: 3px; border: 1px solid rgba(255,255,255,0.25); }
#keypad-overlay .kp-hint { font-size: 11px; letter-spacing: 1px; color: rgba(220,215,200,0.55); }

/* ---- keypad buttons ---- */
#keypad-overlay .kp-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 12px;
}
#keypad-overlay .kp-btn {
  font: 600 18px/1 inherit; color: #e9e2d2; background: #23272d;
  border: 1px solid rgba(210,220,235,0.3); border-radius: 5px;
  padding: 12px 0; cursor: pointer; transition: background 0.1s, transform 0.05s;
}
#keypad-overlay .kp-btn:hover { background: #2f353d; }
#keypad-overlay .kp-btn:active { transform: translateY(1px); background: #3a424c; }
#keypad-overlay .kp-wide { font-size: 12px; letter-spacing: 1px; color: #e8b9a6; }
#keypad-overlay .kp-enter { font-size: 12px; letter-spacing: 1px; color: #a8e8b4; }
#keypad-status { min-height: 22px; font-size: 17px; letter-spacing: 3px; font-weight: 700; }
#keypad-status.ok { color: #6fe08a; }
#keypad-status.bad { color: #ff6a55; }

/* ---- enemy health bars (screen-projected, always face the camera) ---- */
#enemy-bars { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.eb {
  position: absolute; transform: translate(-50%, -100%);
  pointer-events: none; text-align: center; will-change: transform, left, top;
}
.eb .eb-track {
  height: 5px; background: rgba(8,8,10,0.75);
  border: 1px solid rgba(210,215,225,0.35); border-radius: 2px; overflow: hidden;
}
.eb .eb-fill { height: 100%; width: 100%; background: linear-gradient(90deg,#7fce5a,#c9d94a); transition: width 0.09s linear; }
.eb.hurt .eb-fill { background: linear-gradient(90deg,#d9a13a,#e07a2c); }
.eb.crit .eb-fill { background: linear-gradient(90deg,#c33a24,#e04a2c); }
.eb-small { width: 46px; }
.eb-big { width: 150px; }
.eb-big .eb-track { height: 9px; border-color: rgba(240,200,160,0.55); }
.eb-name {
  font-size: 11px; letter-spacing: 2px; color: #f0d9b4;
  text-shadow: 0 2px 5px rgba(0,0,0,0.95); margin-bottom: 3px;
}
.eb-num {
  font-size: 10px; letter-spacing: 1px; color: #e8ddc8;
  text-shadow: 0 2px 5px rgba(0,0,0,0.95); margin-top: 2px;
}

/* ---- Spider King boss bar ---- */
#king-bar { position: fixed; left: 50%; transform: translateX(-50%); top: 24px; width: min(56vw, 640px); text-align: center; pointer-events: none; }
#king-bar .kb-name { font-size: 14px; letter-spacing: 6px; color: #ffd9a0; text-shadow: 0 2px 8px rgba(0,0,0,0.95); margin-bottom: 6px; }
#king-bar .kb-track { height: 15px; background: rgba(10,6,8,0.8); border: 1px solid rgba(255,190,140,0.5); border-radius: 3px; overflow: hidden; }
#king-bar-fill { height: 100%; width: 100%; background: linear-gradient(90deg,#8e1b14,#e0522c,#ffb03a); transition: width 0.1s linear; }
#king-bar-num { margin-top: 5px; font-size: 12px; letter-spacing: 3px; color: #f0dcc0; text-shadow: 0 2px 6px rgba(0,0,0,0.95); }

/* ---- developer admin panel ---- */
#admin-panel { position: fixed; inset: 0; z-index: 60; background: rgba(4,5,7,0.82); display: flex; align-items: center; justify-content: center; overflow: auto; }
#admin-panel .ad-card { background: #12151a; border: 1px solid rgba(190,205,225,0.3); border-radius: 8px; padding: 18px 22px; width: min(760px, 92vw); max-height: 88vh; overflow: auto; }
#admin-panel .ad-title { font-size: 12px; letter-spacing: 3px; color: #9fd0ff; margin-bottom: 12px; }
#admin-panel .ad-sec { font-size: 10px; letter-spacing: 3px; color: #8b93a0; margin: 14px 0 7px; border-top: 1px solid rgba(255,255,255,0.09); padding-top: 9px; }
#admin-panel .ad-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 7px; }
#admin-panel button { font: 600 12px/1 inherit; color: #e6ecf4; background: #202730; border: 1px solid rgba(200,215,235,0.28); border-radius: 4px; padding: 9px 6px; cursor: pointer; }
#admin-panel button:hover { background: #2b343f; }
#admin-panel button:active { transform: translateY(1px); }
#admin-panel .ad-note { margin-top: 14px; font-size: 10px; letter-spacing: 1px; color: rgba(220,228,240,0.4); }

/* ---- inventory screen ---- */
#inv-screen { position: fixed; inset: 0; z-index: 55; background: rgba(4,5,7,0.86); display: flex; align-items: center; justify-content: center; }
#inv-screen .iv-card { background: #12151a; border: 1px solid rgba(190,205,225,0.3); border-radius: 8px; padding: 16px 20px; width: min(860px, 94vw); max-height: 90vh; overflow: auto; }
#inv-screen .iv-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
#inv-screen .iv-title { font-size: 13px; letter-spacing: 4px; color: #ffd9a0; }
#inv-screen .iv-hint { font-size: 10px; letter-spacing: 1px; color: rgba(220,228,240,0.45); }
#inv-screen .iv-body { display: grid; grid-template-columns: 210px 1fr; gap: 18px; }
#inv-screen .iv-sec { font-size: 10px; letter-spacing: 3px; color: #8b93a0; margin: 10px 0 6px; }
#inv-screen .iv-equip { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
#inv-screen .iv-eq { height: 46px; border: 1px dashed rgba(180,195,215,0.3); border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 9px; letter-spacing: 1px; color: rgba(210,220,235,0.45); text-align: center; }
#inv-screen .iv-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; }
#inv-screen .iv-hot { grid-template-columns: repeat(6, 1fr); }
#inv-screen .iv-cell { position: relative; aspect-ratio: 1; background: #1b2027; border: 1px solid rgba(190,205,225,0.22); border-radius: 4px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
#inv-screen .iv-cell:hover { border-color: rgba(255,215,150,0.7); background: #232b34; }
#inv-screen .iv-cell.sel { border-color: #ffd08a; box-shadow: inset 0 0 0 1px rgba(255,208,138,0.5); }
#inv-screen .iv-cell.empty { cursor: default; opacity: 0.5; }
#inv-screen .iv-cell canvas, #inv-screen .iv-cell img.iv-icon { width: 84%; height: 84%; object-fit: contain; }
#inv-screen .iv-cell .iv-n { position: absolute; right: 2px; bottom: 1px; font-size: 10px; color: #ffe9c0; text-shadow: 0 1px 3px #000; }
#inv-screen .iv-cell .iv-k { position: absolute; left: 3px; top: 1px; font-size: 9px; color: rgba(220,230,245,0.5); }
#inv-screen .iv-stats { font-size: 11px; line-height: 1.7; color: #d8dfea; }
#inv-screen .iv-detail { margin-top: 12px; min-height: 34px; font-size: 12px; color: #d9d2c2; border-top: 1px solid rgba(255,255,255,0.08); padding-top: 9px; }
#inv-menu { position: fixed; background: #1b212a; border: 1px solid rgba(200,215,235,0.35); border-radius: 4px; padding: 4px; z-index: 60; }
#inv-menu button { display: block; width: 100%; text-align: left; font: 600 11px/1 inherit; color: #e6ecf4; background: none; border: 0; padding: 7px 14px; cursor: pointer; border-radius: 3px; }
#inv-menu button:hover { background: #2c3540; }
.iv-ghost { position: fixed; width: 48px; height: 48px; pointer-events: none; z-index: 70; opacity: 0.9; filter: drop-shadow(0 3px 8px rgba(0,0,0,0.8)); }
.iv-ghost canvas, .iv-ghost img.iv-icon { width: 100%; height: 100%; object-fit: contain; }
body.iv-dragging { cursor: grabbing; }
#inv-screen .iv-cell.iv-ok { outline: 1px solid rgba(120,230,150,0.55); }
#inv-screen .iv-eq.iv-ok { border-color: #6fe08a; border-style: solid; background: rgba(60,140,80,0.16); }
#inv-screen .iv-eq.iv-bad { border-color: rgba(230,90,70,0.6); background: rgba(140,50,40,0.13); }
#inv-screen .iv-eq { position: relative; flex-direction: column; gap: 2px; }
#inv-screen .iv-eq canvas, #inv-screen .iv-eq img.iv-icon { width: 30px; height: 30px; object-fit: contain; }
#inv-screen .iv-eqn { font-size: 8px; letter-spacing: 0; color: #cfe0f0; }
.fill.armor { background: linear-gradient(90deg,#3f7fd8,#63b4ff); }
#armor-num { margin-left: 7px; font-size: 10px; color: #bcd8f5; }

/* ---- Tier 2 merchant shop ---- */
#shop-screen { position: fixed; inset: 0; z-index: 58; background: rgba(4,5,7,0.88); display: flex; align-items: center; justify-content: center; }
#shop-screen .sh-card { background: #14161b; border: 1px solid rgba(210,190,140,0.35); border-radius: 8px; padding: 16px 20px; width: min(1000px, 95vw); max-height: 92vh; overflow: auto; }
#shop-screen .sh-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
#shop-screen .sh-title { font-size: 14px; letter-spacing: 4px; color: #ffd9a0; flex: 1; }
#sh-money { font-size: 13px; color: #ffe9a0; letter-spacing: 1px; }
#sh-close { font: 600 11px/1 inherit; color: #e6ecf4; background: #262d36; border: 1px solid rgba(200,215,235,0.3); border-radius: 4px; padding: 8px 12px; cursor: pointer; }
#shop-screen .sh-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
#shop-screen .sh-tab { font: 600 11px/1 inherit; color: #cfd8e4; background: #1e242c; border: 1px solid rgba(200,215,235,0.22); border-radius: 4px; padding: 8px 12px; cursor: pointer; }
#shop-screen .sh-tab.on { background: #3a4756; color: #fff2d6; border-color: rgba(255,215,150,0.6); }
#shop-screen .sh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
#shop-screen .sh-item { background: #1b2028; border: 1px solid rgba(190,205,225,0.2); border-radius: 6px; padding: 10px; display: flex; flex-direction: column; gap: 5px; }
#shop-screen .sh-pic { height: 92px; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 45%, rgba(255,225,180,0.10), rgba(0,0,0,0)); border-radius: 4px; }
#shop-screen .sh-pic img { width: 86px; height: 86px; object-fit: contain; }
#shop-screen .sh-name { font-size: 12px; font-weight: 700; color: #f2e8d4; }
#shop-screen .sh-price { font-size: 12px; color: #ffd98a; }
#shop-screen .sh-desc { font-size: 10px; line-height: 1.45; color: rgba(220,226,236,0.62); min-height: 28px; }
#shop-screen .sh-stats { font-size: 10px; color: #9fd0ff; }
#shop-screen .sh-buy { margin-top: 4px; font: 600 11px/1 inherit; color: #10250f; background: #7fce5a; border: 0; border-radius: 4px; padding: 8px; cursor: pointer; }
#shop-screen .sh-buy:disabled { background: #3a4048; color: #8b93a0; cursor: not-allowed; }
#shop-screen .sh-owned { color: #9fe0a8; font-size: 10px; }
#sh-msg { margin-top: 12px; min-height: 20px; font-size: 12px; letter-spacing: 1px; }
#sh-msg.ok { color: #8fe08a; } #sh-msg.bad { color: #ff7a66; }

/* ============================================================
   Chapter 5 — ocean HUD, gun readout, refill, dive warning
   ============================================================ */
.fill.oxy { background: linear-gradient(90deg,#1f9fb8,#63e3ff); }
#oxy-row.low .fill.oxy { background: linear-gradient(90deg,#c98a1e,#ffc44a); }
#oxy-row.crit .fill.oxy { background: linear-gradient(90deg,#c33a24,#ff6a3a); animation: oxypulse 0.6s ease-in-out infinite; }
@keyframes oxypulse { 0%,100% { opacity: 1; } 50% { opacity: 0.45; } }

#drown-vignette {
  position: fixed; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0) 28%, rgba(10,30,45,0.55) 62%, rgba(4,14,22,0.94) 100%);
  transition: opacity 0.25s linear;
}
#drown-vignette.on { opacity: 1; }
#drown-vignette.choking { animation: chokepulse 1.1s ease-in-out infinite; }
@keyframes chokepulse { 0%,100% { opacity: 0.8; } 50% { opacity: 1; } }

#ammo-readout {
  position: fixed; right: 26px; bottom: 96px; z-index: 6;
  font: 600 15px/1 "SF Mono", Menlo, monospace; color: #d8e4ea;
  letter-spacing: 1px; text-shadow: 0 2px 6px rgba(0,0,0,0.9);
  background: rgba(8,12,16,0.55); border: 1px solid rgba(140,180,200,0.22);
  border-radius: 6px; padding: 8px 12px; pointer-events: none;
}
#ammo-readout #ammo-mag { font-size: 26px; color: #fff; }
#ammo-readout #ammo-sep { opacity: 0.4; margin: 0 4px; }
#ammo-readout #ammo-res { opacity: 0.75; }
#ammo-readout #ammo-name { display: block; font-size: 10px; opacity: 0.55; letter-spacing: 2px; margin-top: 4px; }
#ammo-readout.empty #ammo-mag { color: #ff6a4a; }
#ammo-readout.reloading #ammo-name { color: #ffc44a; }

#refill-bar {
  position: fixed; left: 50%; bottom: 22%; transform: translateX(-50%); z-index: 8;
  width: 320px; text-align: center; pointer-events: none;
  background: rgba(6,14,18,0.78); border: 1px solid rgba(80,224,176,0.35);
  border-radius: 8px; padding: 12px 14px;
}
#refill-bar .rf-label { font: 600 11px/1 sans-serif; letter-spacing: 3px; color: #6fe6c0; margin-bottom: 8px; }
#refill-bar .rf-track { height: 9px; background: rgba(255,255,255,0.09); border-radius: 5px; overflow: hidden; }
#refill-bar #rf-fill { height: 100%; width: 0%; background: linear-gradient(90deg,#1f9fb8,#63ffd0); }
#refill-bar .rf-hint { font: 400 10px/1 sans-serif; letter-spacing: 1px; color: #8fa4ae; margin-top: 8px; }

#objective-list {
  position: fixed; right: 22px; top: 92px; z-index: 5; pointer-events: none;
  font: 500 12px/1.7 sans-serif; color: #c3d2da; text-shadow: 0 2px 5px rgba(0,0,0,0.9);
  max-width: 280px; text-align: right;
}
#objective-list .ol-item { opacity: 0.8; }
#objective-list .ol-item.done { opacity: 0.45; text-decoration: line-through; color: #7fce5a; }
#objective-list .ol-item.active { opacity: 1; color: #ffd88a; }

#ocean-warning {
  position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center;
  background: rgba(2,6,10,0.9); backdrop-filter: blur(3px);
}
#ocean-warning.hidden { display: none; }
#ocean-warning .ow-card {
  width: min(620px, 90vw); background: #0b1218; border: 1px solid rgba(120,190,215,0.3);
  border-radius: 10px; padding: 30px 34px; text-align: center;
  box-shadow: 0 30px 90px rgba(0,0,0,0.8);
}
#ocean-warning .ow-icon { font-size: 34px; color: #ff6a4a; margin-bottom: 10px; }
#ocean-warning .ow-title {
  font: 700 17px/1.5 sans-serif; color: #ff8a5a; letter-spacing: 0.5px; margin-bottom: 16px;
}
#ocean-warning .ow-body { font: 400 13px/1.75 sans-serif; color: #9fb4bf; }
#ocean-warning .ow-check { margin: 16px 0; text-align: left; display: inline-block; }
#ocean-warning .ow-check div { font: 500 12px/1.9 sans-serif; }
#ocean-warning .ow-check .ok { color: #7fce5a; }
#ocean-warning .ow-check .no { color: #d9803a; }
#ocean-warning .ow-note { font-size: 11px; color: #6d818b; margin-top: 6px; font-style: italic; }
#ocean-warning .ow-buttons { margin-top: 22px; display: flex; gap: 12px; justify-content: center; }
#ocean-warning button {
  font: 600 12px/1 sans-serif; letter-spacing: 1px; padding: 11px 20px; border-radius: 6px;
  border: 1px solid rgba(140,190,210,0.35); background: #16242e; color: #cfe0e8; cursor: pointer;
}
#ocean-warning #ow-go { background: #1d4a58; border-color: #3f9fb8; color: #d8f4ff; }
#ocean-warning button:hover { filter: brightness(1.25); }

/* the equipped-tank banner on the dive warning */
#ocean-warning .ow-tank {
  margin: 14px auto 4px; padding: 10px 14px; border-radius: 6px;
  font: 600 13px/1.5 sans-serif; letter-spacing: 0.4px; max-width: 420px;
}
#ocean-warning .ow-tank.ok  { background: rgba(46,122,74,0.22); border: 1px solid #4ea86e; color: #9fe6b4; }
#ocean-warning .ow-tank.no  { background: rgba(150,52,26,0.22); border: 1px solid #c9642e; color: #ffb98a; }

#oxy-debug {
  position: fixed; left: 22px; bottom: 130px; z-index: 9; pointer-events: none;
  font: 500 11px/1.55 "SF Mono", Menlo, monospace; color: #8fe0ff;
  background: rgba(4,10,14,0.78); border: 1px solid rgba(80,180,220,0.3);
  border-radius: 5px; padding: 8px 11px; letter-spacing: 0.3px;
}
#oxy-debug b { color: #fff; }

/* ============================================================
   Admin Spawn Menu — matches the existing .ad-* panel styling
   ============================================================ */
.ad-spawn { display: flex; flex-direction: column; gap: 7px; margin-bottom: 4px; }
.sp-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sp-tab {
  font: 600 11px/1 sans-serif; letter-spacing: 1px; padding: 6px 14px; border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.18); background: #1a1d22; color: #c3cad2; cursor: pointer;
}
.sp-tab.on { background: #2c4256; border-color: #5f9fc4; color: #dff0ff; }
.sp-search {
  flex: 1; min-width: 120px; font: 500 11px/1 sans-serif; padding: 6px 9px; border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.18); background: #12151a; color: #e2e8ee;
}
.sp-search:focus { outline: none; border-color: #5f9fc4; }
.sp-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 5px;
  max-height: 148px; overflow-y: auto; padding: 5px;
  background: rgba(0,0,0,0.32); border: 1px solid rgba(255,255,255,0.09); border-radius: 5px;
}
.sp-item {
  font: 500 11px/1.25 sans-serif; padding: 6px 8px; border-radius: 4px; cursor: pointer;
  border: 1px solid rgba(255,255,255,0.12); background: #171a1f; color: #ccd4dc; text-align: left;
}
.sp-item:hover { border-color: rgba(255,255,255,0.32); }
.sp-item.on { background: #2c4256; border-color: #5f9fc4; color: #dff0ff; }
.sp-item .sp-hp { display: block; font-size: 9px; opacity: 0.6; margin-top: 2px; }
.sp-item.sp-empty { grid-column: 1/-1; text-align: center; opacity: 0.5; cursor: default; border-style: dashed; }
.sp-sel { font: 500 11px/1 sans-serif; color: #9aa4ae; }
.sp-sel b { color: #ffd88a; }
.sp-opts label { font: 500 10px/1 sans-serif; color: #9aa4ae; display: flex; align-items: center; gap: 4px; }
.sp-opts input, .sp-opts select {
  font: 500 11px/1 sans-serif; padding: 5px 6px; border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.18); background: #12151a; color: #e2e8ee;
}
.sp-opts input { width: 54px; }
.sp-actions button {
  font: 600 10px/1 sans-serif; letter-spacing: 0.5px; padding: 7px 11px; border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.18); background: #1a1d22; color: #cdd5dd; cursor: pointer;
}
.sp-actions button:hover { filter: brightness(1.3); }
.sp-actions .sp-go { background: #2a5a36; border-color: #4e9a63; color: #dcf7e3; }
.sp-actions .sp-warn { background: #4a2020; border-color: #9a4a4a; color: #f7dcdc; }
.sp-msg { font: 500 11px/1.4 sans-serif; min-height: 15px; color: #9aa4ae; }
.sp-msg.ok { color: #8fe6a8; }
.sp-msg.bad { color: #ff9a7a; }

/* ============================================================
   Ocean boss health bars — one row per live boss, stacked
   ============================================================ */
#ocean-boss-bars {
  position: fixed; left: 50%; transform: translateX(-50%); top: 22px;
  width: min(58vw, 660px); pointer-events: none; z-index: 7;
  display: flex; flex-direction: column; gap: 9px;
}
#ocean-boss-bars.hidden { display: none; }
#ocean-boss-bars .obb { text-align: center; }
#ocean-boss-bars .obb-name {
  font: 700 13px/1 sans-serif; letter-spacing: 5px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.95); margin-bottom: 5px;
}
#ocean-boss-bars .obb-track {
  height: 13px; background: rgba(8,6,10,0.82);
  border: 1px solid rgba(255,190,160,0.42); border-radius: 3px; overflow: hidden;
}
#ocean-boss-bars .obb-fill { height: 100%; width: 100%; transition: width 0.1s linear; }
#ocean-boss-bars .obb-num {
  margin-top: 3px; font: 500 11px/1 sans-serif; letter-spacing: 2px;
  color: #f0dcc8; text-shadow: 0 2px 6px rgba(0,0,0,0.95);
}

/* ============================================================
   MAIN MENU — the first thing shown on launch
   ============================================================ */
#main-menu {
  position: fixed; inset: 0; z-index: 200; display: flex;
  align-items: center; justify-content: center;
  background: #05070a; overflow: hidden;
  -webkit-user-select: none; user-select: none;
}
#main-menu.hidden { display: none; }
#main-menu .mm-bg {
  position: absolute; inset: -10%;
  background:
    radial-gradient(ellipse at 50% 35%, rgba(80,120,150,0.16), transparent 62%),
    radial-gradient(ellipse at 20% 90%, rgba(180,120,60,0.10), transparent 55%),
    #05070a;
  animation: mmdrift 22s ease-in-out infinite alternate;
}
@keyframes mmdrift { from { transform: scale(1) translateY(0); } to { transform: scale(1.06) translateY(-14px); } }
#main-menu .mm-wrap {
  position: relative; width: min(560px, 92vw);
  padding: calc(env(safe-area-inset-top, 0px) + 18px) 20px calc(env(safe-area-inset-bottom, 0px) + 18px);
  text-align: center; max-height: 100vh; display: flex; flex-direction: column;
}
#main-menu .mm-title {
  font: 700 clamp(26px, 6vw, 46px)/1 "Helvetica Neue", sans-serif;
  letter-spacing: clamp(4px, 1.6vw, 12px); color: #e8cf8e;
  text-shadow: 0 4px 26px rgba(0,0,0,0.9); margin: 0 0 6px;
}
#main-menu .mm-sub {
  font: 400 12px/1.5 sans-serif; letter-spacing: 3px; color: #7d8b96;
  margin: 0 0 22px; text-transform: uppercase;
}
#main-menu .mm-page { display: flex; flex-direction: column; gap: 9px; min-height: 0; }
#main-menu .mm-page.hidden { display: none; }
#main-menu .mm-head {
  font: 700 12px/1 sans-serif; letter-spacing: 5px; color: #8fb4c8;
  margin-bottom: 8px; text-transform: uppercase;
}
#main-menu .mm-btn, #cos-detail .mm-btn, #bp-detail .mm-btn {
  font: 600 15px/1 sans-serif; letter-spacing: 3px; color: #dbe4ea;
  background: linear-gradient(180deg, rgba(32,40,50,0.9), rgba(14,18,24,0.94));
  border: 1px solid rgba(150,190,215,0.24); border-radius: 7px;
  padding: 15px 18px; cursor: pointer; text-align: center;
  transition: background 0.14s, border-color 0.14s, transform 0.1s, color 0.14s;
  touch-action: manipulation;
}
#main-menu .mm-btn:hover, #main-menu [data-nav].mm-focus, #cos-detail .mm-btn:hover, #bp-detail .mm-btn:hover {
  background: linear-gradient(180deg, rgba(52,74,94,0.95), rgba(24,34,44,0.95));
  border-color: #7fc0e0; color: #fff; transform: translateY(-2px);
}
#main-menu .mm-btn:active, #cos-detail .mm-btn:active { transform: translateY(0); }
#main-menu .mm-btn[disabled] { opacity: 0.32; cursor: not-allowed; }
#main-menu .mm-btn[disabled]:hover { transform: none; background: linear-gradient(180deg, rgba(32,40,50,0.9), rgba(14,18,24,0.94)); border-color: rgba(150,190,215,0.24); color: #dbe4ea; }
#main-menu .mm-quit { border-color: rgba(190,110,90,0.36); color: #e8b8a8; }
#main-menu .mm-back { border-color: rgba(255,255,255,0.16); color: #9fb0bc; }
#main-menu .mm-small { padding: 11px 14px; font-size: 12px; flex: 1; }
#main-menu .mm-actions { display: flex; gap: 8px; margin-top: 12px; }
#main-menu .mm-note {
  font: 400 13px/1.75 sans-serif; color: #9fb0bc; text-align: left;
  background: rgba(0,0,0,0.35); border: 1px solid rgba(255,255,255,0.09);
  border-radius: 7px; padding: 16px 18px; margin-bottom: 6px;
}
#main-menu .mm-scroll { overflow-y: auto; max-height: 52vh; padding-right: 4px; text-align: left; }
#main-menu .mm-sec {
  font: 700 10px/1 sans-serif; letter-spacing: 3px; color: #6f8fa4;
  margin: 14px 0 7px; text-transform: uppercase;
}
#main-menu .mm-row {
  display: flex; align-items: center; gap: 10px; padding: 7px 2px;
  font: 500 13px/1.3 sans-serif; color: #c3d0da;
}
#main-menu .mm-row > span { flex: 1; }
#main-menu .mm-row input[type=range] { flex: 1.1; min-width: 90px; accent-color: #7fc0e0; touch-action: manipulation; }
#main-menu .mm-row input[type=checkbox] { width: 20px; height: 20px; accent-color: #7fc0e0; }
#main-menu .mm-row select {
  flex: 1.1; font: 500 12px/1 sans-serif; padding: 7px 8px; border-radius: 5px;
  background: #12181e; color: #dbe4ea; border: 1px solid rgba(150,190,215,0.24);
}
#main-menu .mm-row [data-nav].mm-focus { outline: 2px solid #7fc0e0; outline-offset: 3px; border-radius: 4px; }
#main-menu .mm-val { min-width: 38px; text-align: right; font: 500 11px/1 monospace; color: #8fb4c8; font-style: normal; }
#main-menu .mm-msg { font: 500 11px/1.5 sans-serif; color: #8fe6a8; min-height: 16px; margin-top: 8px; }
#main-menu .mm-hint {
  margin-top: 18px; font: 400 10px/1.5 sans-serif; letter-spacing: 1.5px; color: #566670;
}
@media (max-height: 560px) {
  #main-menu .mm-title { margin-bottom: 2px; }
  #main-menu .mm-sub { margin-bottom: 12px; }
  #main-menu .mm-btn { padding: 11px 14px; }
  #main-menu .mm-scroll { max-height: 40vh; }
}

/* ---- multiplayer lobby ---- */
#main-menu .mm-row input[type=text] {
  flex: 1.1; font: 500 13px/1 sans-serif; padding: 9px 10px; border-radius: 5px;
  background: #12181e; color: #dbe4ea; border: 1px solid rgba(150,190,215,0.24);
}
#main-menu .mm-row input[type=text]:focus { outline: none; border-color: #7fc0e0; }
#main-menu .mp-tip { font-size: 11px; line-height: 1.7; }
#main-menu .mp-tip code {
  display: inline-block; margin: 4px 0; padding: 3px 7px; border-radius: 4px;
  background: #0c1116; color: #8fe6c0; font: 500 11px/1.4 monospace;
}
#main-menu .mp-status { font: 500 11px/1.6 sans-serif; color: #8fb4c8; margin-bottom: 8px; letter-spacing: 1px; }
#main-menu .mp-list {
  background: rgba(0,0,0,0.35); border: 1px solid rgba(255,255,255,0.09);
  border-radius: 7px; padding: 8px; min-height: 120px; text-align: left;
}
#main-menu .mp-p {
  display: flex; align-items: center; gap: 8px; padding: 8px 9px; border-radius: 5px;
  font: 500 13px/1 sans-serif; color: #cfd9e2; margin-bottom: 5px;
  background: rgba(255,255,255,0.035);
}
#main-menu .mp-p .mp-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
#main-menu .mp-p .mp-nm { flex: 1; }
#main-menu .mp-p .mp-host { font-size: 10px; letter-spacing: 1px; color: #e8cf8e; }
#main-menu .mp-p .mp-rdy { font-size: 10px; letter-spacing: 1px; }
#main-menu .mp-p .mp-rdy.yes { color: #8fe6a8; }
#main-menu .mp-p .mp-rdy.no  { color: #7d8b96; }
#main-menu .mp-p.me { border: 1px solid rgba(127,192,224,0.5); }
#main-menu #mp-ready.on { background: linear-gradient(180deg,#2a5a36,#183824); border-color:#4e9a63; color:#dcf7e3; }
#main-menu #mp-start[disabled] { opacity: 0.3; }

/* floating player name tags in-game */
#mp-tags { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 6; }
#mp-tags .mp-tag {
  position: absolute; transform: translate(-50%, -100%);
  font: 600 12px/1.2 sans-serif; text-align: center; white-space: nowrap;
  text-shadow: 0 2px 6px rgba(0,0,0,0.95);
}
#mp-tags .mp-tag .mp-hp {
  display: block; width: 62px; height: 4px; margin: 3px auto 0;
  background: rgba(0,0,0,0.55); border-radius: 2px; overflow: hidden;
}
#mp-tags .mp-tag .mp-hp i { display: block; height: 100%; background: #6fce5a; }

/* ---- multiplayer bots ---------------------------------------------------- */
.mp-bots { margin: 10px 0 4px; padding: 10px 12px; border: 1px solid #2a3138;
           border-radius: 6px; background: rgba(12,16,20,.55); }
.mp-bots-row { display: flex; gap: 8px; }
.mp-bots-row .mm-btn { flex: 1; }
.mp-bots .mm-row { margin-top: 8px; }
.mp-bots .mp-tip { margin-top: 8px; font-size: 11px; line-height: 1.5; opacity: .72; }
.mp-p .mp-bot { font-size: 10px; letter-spacing: .12em; padding: 1px 6px; border-radius: 3px;
                background: #2c3a2c; color: #9fd88f; border: 1px solid #3d5540; }
.mp-p .mp-bot.hard   { background: #3a2a2a; color: #e59a8a; border-color: #5a3d3a; }
.mp-p .mp-bot.easy   { background: #26323c; color: #8fb8d8; border-color: #38505f; }
.mp-p.is-bot .mp-nm  { opacity: .85; }
#mp-tags .mp-tag.bot-tag { font-style: italic; }

/* ---- online multiplayer -------------------------------------------------- */
.mp-modes { display: flex; gap: 8px; margin-bottom: 12px; }
.mp-mode { flex: 1; padding: 9px 6px; font: inherit; font-size: 12px; letter-spacing: .1em;
           color: #8d97a2; background: #14181d; border: 1px solid #2a3138; border-radius: 5px;
           cursor: pointer; }
.mp-mode:hover { color: #c8d2dc; border-color: #3d4650; }
.mp-mode.on { color: #0d1116; background: #9fb4c6; border-color: #9fb4c6; }
.mp-codebar { margin: 6px 0 10px; padding: 9px 12px; border: 1px solid #37464f;
              border-radius: 5px; background: rgba(16,26,32,.7); font-size: 12px;
              letter-spacing: .12em; color: #8fb8d8; }
.mp-codebar b { font-size: 19px; letter-spacing: .3em; color: #d8e8f4; margin-left: 8px; }
.mp-codehint { display: block; margin-top: 4px; font-size: 10px; letter-spacing: .06em;
               color: #6a7681; }

/* ---- boss introduction cinematic ---------------------------------------- */
#boss-intro { position: fixed; inset: 0; pointer-events: none; z-index: 60; }
#boss-intro.hidden { display: none; }
#boss-intro .bi-bar { position: absolute; left: 0; right: 0; height: 0;
  background: #000; transition: height .55s cubic-bezier(.22,.61,.36,1); }
#boss-intro .bi-top { top: 0; }
#boss-intro .bi-bottom { bottom: 0; }
#boss-intro.on .bi-bar { height: 11vh; }
#boss-intro .bi-plate { position: absolute; left: 0; right: 0; bottom: 15vh;
  text-align: center; opacity: 0; transform: translateY(14px);
  transition: opacity .4s ease, transform .5s cubic-bezier(.22,.61,.36,1); }
#boss-intro.show-name .bi-plate { opacity: 1; transform: translateY(0); }
#boss-intro .bi-sub { font-size: 11px; letter-spacing: .42em; color: #c8people;
  color: #b98a7a; text-transform: uppercase; margin-bottom: 8px; }
#boss-intro .bi-name { font-size: clamp(26px, 5vw, 52px); letter-spacing: .16em;
  color: #f2e6e0; text-shadow: 0 0 26px rgba(255,70,50,.55), 0 3px 10px rgba(0,0,0,.9); }
#boss-intro .bi-rule { width: 0; height: 2px; margin: 14px auto 0;
  background: linear-gradient(90deg, transparent, #ff4a3a, transparent);
  transition: width .7s cubic-bezier(.22,.61,.36,1); }
#boss-intro.show-name .bi-rule { width: min(420px, 60vw); }
body.boss-intro-cine #crosshair,
body.boss-intro-cine #held-item,
body.boss-intro-cine #inv-help { opacity: 0; transition: opacity .3s ease; }

/* ---- gold (premium currency) -------------------------------------------- */
.mm-gold { margin: 6px auto 14px; display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border: 1px solid #6b551f; border-radius: 999px;
  background: linear-gradient(180deg, rgba(60,46,14,.55), rgba(28,22,8,.55));
  font-size: 12px; letter-spacing: .18em; color: #d9bd6a; }
.mm-gold .mm-gold-pip { color: #ffc63a; text-shadow: 0 0 10px rgba(255,180,50,.8); }
.mm-gold b { font-size: 15px; letter-spacing: .06em; color: #ffd97a; }
#toasts .gold-toast { color: #ffd97a; text-shadow: 0 0 12px rgba(255,170,40,.7); }

/* ---- shop ---------------------------------------------------------------- */
#mm-shop { max-width: 780px; }
.shop-bal { text-align: center; font-size: 12px; letter-spacing: .18em; color: #d9bd6a;
  margin-bottom: 12px; }
.shop-bal b { font-size: 17px; color: #ffd97a; margin-left: 8px; }
.shop-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.shop-tab { flex: 1; padding: 9px 6px; font: inherit; font-size: 12px; letter-spacing: .12em;
  color: #8d97a2; background: #14181d; border: 1px solid #2a3138; border-radius: 5px; cursor: pointer; }
.shop-tab:hover { color: #c8d2dc; border-color: #3d4650; }
.shop-tab.on { color: #0d1116; background: #9fb4c6; border-color: #9fb4c6; }
.shop-sec.hidden { display: none; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px; margin-bottom: 14px; }
.shop-card { border: 1px solid #2a3138; border-radius: 7px; background: rgba(14,18,23,.72);
  padding: 10px; text-align: center; cursor: pointer; transition: border-color .15s, transform .12s; }
.shop-card:hover { border-color: #55636f; transform: translateY(-2px); }
.shop-card.owned { cursor: default; opacity: .72; }
.shop-card.owned:hover { transform: none; border-color: #2a3138; }
.shop-card canvas { width: 84px; height: 84px; display: block; margin: 0 auto 8px;
  border-radius: 6px; background: #0a0d11; }
.shop-name { font-size: 12px; color: #d5dde5; letter-spacing: .06em; margin-bottom: 3px; }
.shop-kind { font-size: 9px; letter-spacing: .16em; color: #6d7883; text-transform: uppercase; }
.shop-rar { display: inline-block; margin: 6px 0 4px; font-size: 9px; letter-spacing: .18em;
  padding: 2px 8px; border-radius: 3px; border: 1px solid; }
.rar-common    { color: #9fb0bd; border-color: #3f4a55; background: #1a2027; }
.rar-rare      { color: #74b6f0; border-color: #2f5b80; background: #131f2b; }
.rar-epic      { color: #c08cf0; border-color: #5a3f80; background: #1d1630; }
.rar-legendary { color: #ffc63a; border-color: #806018; background: #2a2008; }
.shop-price { font-size: 13px; color: #ffd97a; letter-spacing: .06em; }
.shop-price.sar { color: #8fe0a8; }
.shop-price.owned-tag { color: #7fd08a; font-size: 11px; letter-spacing: .14em; }
.shop-daily-head { display: flex; justify-content: space-between; align-items: baseline;
  font-size: 10px; letter-spacing: .22em; color: #7b8792; margin: 4px 0 8px;
  border-bottom: 1px solid #232a31; padding-bottom: 5px; }
.shop-timer { color: #d9bd6a; letter-spacing: .1em; font-size: 12px; }
.shop-note { font-size: 11px; line-height: 1.55; opacity: .75; margin-bottom: 12px; }
.shop-state { font-size: 11px; color: #b98a7a; letter-spacing: .06em; text-align: center; }

/* ---- cosmetic cards & detail preview ------------------------------------- */
.shop-card img.cos-pic { width: 100%; max-width: 150px; aspect-ratio: 1; display: block;
  margin: 0 auto 8px; border-radius: 6px; background:
  radial-gradient(circle at 40% 32%, #2b3640 0%, #0a0d11 72%); }
.shop-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.shop-card .cos-equipped { display: inline-block; margin-top: 4px; font-size: 9px;
  letter-spacing: .16em; color: #7fd08a; }

#cos-detail { position: fixed; inset: 0; z-index: 320;   /* above the main menu (200) */ display: flex; align-items: center;
  justify-content: center; background: rgba(4,6,9,.82); backdrop-filter: blur(3px); }
#cos-detail.hidden { display: none; }
.cd-card { position: relative; width: min(880px, 94vw); max-height: 92vh; overflow: auto;
  border: 1px solid #333d47; border-radius: 10px; padding: 22px;
  background: linear-gradient(180deg, #12171d, #0a0d11); }
.cd-close { position: absolute; top: 12px; right: 14px; font: inherit; font-size: 11px;
  letter-spacing: .1em; color: #9fb0bd; background: #1a2027; border: 1px solid #2f3941;
  border-radius: 5px; padding: 5px 12px; cursor: pointer; }
.cd-body { display: flex; gap: 24px; flex-wrap: wrap; }
.cd-stage { flex: 0 0 440px; max-width: 100%; }
.cd-stage canvas { width: 100%; height: auto; border-radius: 9px; border: 1px solid #232b33;
  background: radial-gradient(circle at 42% 34%, #2f3b46 0%, #080b0e 74%); }
.cd-info { flex: 1 1 260px; min-width: 240px; }
.cd-name { font-size: 25px; letter-spacing: .06em; color: #eef3f8; margin-bottom: 4px; }
.cd-kind { font-size: 10px; letter-spacing: .2em; color: #7b8792; text-transform: uppercase; }
.cd-desc { margin: 12px 0; font-size: 12px; line-height: 1.6; color: #a9b5c0; }
.cd-price { font-size: 20px; color: #ffd97a; letter-spacing: .05em; margin: 14px 0 12px; }
.cd-price.owned { color: #7fd08a; font-size: 15px; letter-spacing: .14em; }
.cd-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cd-colours { margin: 12px 0; }
.cd-clabel { font-size: 9px; letter-spacing: .22em; color: #7b8792; margin-bottom: 7px; }
.cd-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.cd-sw { width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  border: 2px solid #2f3941; transition: transform .12s, border-color .12s; }
.cd-sw:hover { transform: scale(1.12); }
.cd-sw.on { border-color: #ffd97a; box-shadow: 0 0 12px rgba(255,200,80,.55); }

.cos-display { margin-top: 8px; font-size: 9px; letter-spacing: .16em; color: #8a93a0;
  border: 1px dashed #39424c; border-radius: 4px; padding: 5px 8px; }
.cos-display.hidden { display: none; }

/* lobby cosmetic effect */
.lobby-fx { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.lobby-fx i { position: absolute; bottom: -8px; border-radius: 50%; opacity: .75;
  animation: lobbyRise linear infinite; }
@keyframes lobbyRise { from { transform: translateY(0) translateX(0); opacity: 0; }
  12% { opacity: .8; } 88% { opacity: .6; }
  to { transform: translateY(-104vh) translateX(24px); opacity: 0; } }

/* scrollable, smooth cosmetic pages */
#mm-personal, #mm-shop { max-height: 84vh; overflow-y: auto; scroll-behavior: smooth;
  scrollbar-width: thin; }
.shop-card.mm-focus { border-color: #ffd97a; box-shadow: 0 0 0 2px rgba(255,217,122,.35);
  transform: translateY(-2px); }

/* ---- simplified multiplayer lobby ---------------------------------------- */
.mp-joinbox { margin: 4px 0 12px; padding: 12px; border: 1px solid #37464f; border-radius: 6px;
  background: rgba(14,22,28,.6); }
.mp-joinbox.hidden { display: none; }
.mp-joinlabel { font-size: 10px; letter-spacing: .2em; color: #8fb8d8; margin-bottom: 8px; }
#mp-code { width: 100%; box-sizing: border-box; text-align: center; font: inherit;
  font-size: 26px; letter-spacing: .34em; text-transform: uppercase; padding: 10px;
  color: #eaf2f8; background: #0c1116; border: 1px solid #2f3941; border-radius: 6px;
  margin-bottom: 10px; }
.mp-adv { margin: 10px 0; border-top: 1px solid #232a31; padding-top: 8px; }
.mp-adv summary { cursor: pointer; font-size: 10px; letter-spacing: .18em; color: #6d7883; }
.mp-adv[open] summary { color: #9fb0bd; }
#mp-codebar { text-align: center; }
.mp-codelabel { font-size: 9px; letter-spacing: .2em; color: #7b8792; margin-bottom: 6px; }
#mp-codebar b { display: block; font-size: 40px; letter-spacing: .34em; color: #ffd97a;
  text-shadow: 0 0 22px rgba(255,190,60,.45); margin: 2px 0 8px; }
#mp-copy { padding: 5px 16px; }

/* inventory hand cosmetic row */
.iv-hands { margin-top: 10px; padding-top: 10px; border-top: 1px solid #232a31; text-align: center; }
.iv-hands-label { font-size: 9px; letter-spacing: .2em; color: #6d7883; margin-bottom: 6px; }
.iv-hands img { width: 74px; height: 74px; border-radius: 6px; background: #0a0d11; display: block; margin: 0 auto 4px; }
.iv-hands-none { width: 74px; height: 74px; border-radius: 6px; margin: 0 auto 4px;
  border: 1px dashed #333c45; }
.iv-hands-name { font-size: 11px; color: #b9c4ce; }

/* ---- badges ------------------------------------------------------------- */
#mm-badges { max-height: 84vh; overflow-y: auto; scroll-behavior: smooth; }
.bd-card { text-align: center; }
.bd-card canvas { width: 96px; height: 96px; display: block; margin: 0 auto 8px; }
.bd-card.locked canvas { filter: grayscale(1) brightness(.45); }
.bd-desc { font-size: 10px; line-height: 1.5; color: #93a0ab; margin: 4px 0 6px; }
.bd-state { font-size: 9px; letter-spacing: .16em; }
.bd-state.on { color: #7fd08a; }
.bd-state.off { color: #77808a; }
.bd-date { font-size: 9px; color: #6d7883; margin-top: 2px; }
.bd-flex { margin-top: 8px; }
.bd-flex.on { color: #ffd97a; border-color: #806018; }
#mp-list .mp-badges { display: inline-flex; gap: 3px; margin-left: 6px; vertical-align: middle; }
#mp-list .mp-badges canvas { width: 18px; height: 18px; }

/* inventory character preview */
.iv-prev { margin-bottom: 10px; }
.iv-prev canvas { width: 100%; max-width: 240px; height: auto; display: block; margin: 0 auto;
  border-radius: 8px; border: 1px solid #232b33;
  background: radial-gradient(circle at 44% 32%, #2c3742 0%, #080b0e 74%); }

/* ---- cosmetic shop: card grid -------------------------------------------- */
.cs-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.cs-tab { padding: 7px 13px; font: inherit; font-size: 11px; letter-spacing: .12em;
  color: #8d97a2; background: #12161b; border: 1px solid #262d34; border-radius: 4px;
  cursor: pointer; transition: color .12s, border-color .12s, background .12s; }
.cs-tab:hover { color: #d5dde5; border-color: #3d4650; }
.cs-tab.on { color: #0d1116; background: #d9bd6a; border-color: #d9bd6a; }
.cs-tab.mm-focus { outline: 2px solid rgba(255,217,122,.5); outline-offset: 1px; }

.cs-head { display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 1px solid #232a31; padding-bottom: 6px; margin-bottom: 12px;
  font-size: 13px; letter-spacing: .24em; color: #cdd6de; }
.cs-sub { font-size: 11px; letter-spacing: .1em; color: #d9bd6a; }

.cs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(208px, 1fr));
  gap: 14px; margin-bottom: 16px; }

.cs-card { position: relative; border-radius: 9px; overflow: hidden; cursor: pointer;
  border: 1px solid #262d34; background: #0d1116;
  transition: transform .14s cubic-bezier(.22,.61,.36,1), border-color .14s, box-shadow .14s; }
.cs-card:hover, .cs-card.mm-focus { transform: translateY(-4px); border-color: var(--rar); 
  box-shadow: 0 10px 26px rgba(0,0,0,.55), 0 0 0 1px var(--rar); }
.cs-art { position: relative; aspect-ratio: 1; display: block; width: 100%;
  background: radial-gradient(circle at 50% 38%, var(--rarSoft) 0%, #06080b 76%); }
.cs-art img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cs-rar-strip { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--rar); }
.cs-body { padding: 10px 11px 12px; }
.cs-name { font-size: 13px; color: #eef3f8; letter-spacing: .04em; margin-bottom: 2px; }
.cs-for { font-size: 9.5px; letter-spacing: .14em; color: #7f8b96; text-transform: uppercase; }
.cs-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 9px; }
.cs-rar { font-size: 8.5px; letter-spacing: .18em; color: var(--rar); }
.cs-price { font-size: 14px; color: #ffd97a; letter-spacing: .03em; }
.cs-price .cs-pip { color: #ffc63a; margin-right: 4px; }
.cs-owned { font-size: 10px; letter-spacing: .16em; color: #7fd08a; }
.cs-tagrow { position: absolute; top: 8px; left: 8px; display: flex; gap: 5px; }
.cs-tag { font-size: 8px; letter-spacing: .16em; padding: 3px 7px; border-radius: 3px;
  background: rgba(6,9,12,.8); border: 1px solid #2f3941; color: #b6c1cb; }
.cs-tag.eq { color: #7fd08a; border-color: #34553c; }

/* ---- gold packs ---------------------------------------------------------- */
#gp-detail { position: fixed; inset: 0; z-index: 320; display: flex; align-items: center;
  justify-content: center; background: rgba(4,6,9,.82); backdrop-filter: blur(3px); }
#gp-detail.hidden { display: none; }
.gp-card .cs-art { background: radial-gradient(circle at 50% 40%, var(--rarSoft) 0%, #06080b 76%); }
.gp-best { box-shadow: 0 0 0 1px rgba(255,198,58,.35); }
.gp-amount { font-size: 16px; color: #ffd97a; }
.gp-bonus { font-size: 10.5px; color: #8fe0a8; letter-spacing: .05em; margin-top: 2px; }
.gp-incl-name { font-size: 10.5px; color: #c08cf0; margin-top: 3px; }
.gp-incl-name span { color: #7f8b96; font-size: 9px; letter-spacing: .12em; }
.gp-sar { font-size: 14px; color: #8fe0a8; letter-spacing: .03em; }
.cs-tag.best { color: #ffc63a; border-color: #806018; background: rgba(42,32,8,.9); }
.gp-incl { position: absolute; right: 8px; bottom: 10px; width: 40%; max-width: 84px;
  border-radius: 6px; border: 1px solid #3a3020; background: rgba(6,9,12,.75); }
.gp-breakdown { margin: 10px 0; font-size: 12px; color: #a9b5c0; line-height: 1.7; }
.gp-bestflag { display: inline-block; font-size: 9px; letter-spacing: .2em; color: #ffc63a;
  border: 1px solid #806018; background: #2a2008; border-radius: 3px; padding: 3px 9px; margin-bottom: 8px; }
.gp-included { margin: 12px 0; padding: 12px; border: 1px solid #3a3048; border-radius: 7px;
  background: rgba(20,14,30,.5); text-align: center; }
.gp-incl-label { font-size: 9px; letter-spacing: .2em; color: #8a7fa0; margin-bottom: 8px; }
.gp-included img { width: 110px; height: 110px; display: block; margin: 0 auto 6px;
  border-radius: 6px; background: #0a0d11; }

/* ---- locker -------------------------------------------------------------- */
.iv-prev { position: relative; }
.iv-prev canvas { width: 100%; max-width: 300px; cursor: grab; }
.iv-prev canvas:active { cursor: grabbing; }
.iv-prev-hint { text-align: center; font-size: 9px; letter-spacing: .18em; color: #5d6771; margin-top: 4px; }
.lk-cats { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.lk-cat { padding: 6px 11px; font: inherit; font-size: 10px; letter-spacing: .1em; color: #8d97a2;
  background: #12161b; border: 1px solid #262d34; border-radius: 4px; cursor: pointer; }
.lk-cat:hover { color: #d5dde5; border-color: #3d4650; }
.lk-cat.on { color: #0d1116; background: #d9bd6a; border-color: #d9bd6a; }
.lk-cat .lk-n { opacity: .6; margin-left: 5px; }
.lk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 9px;
  max-height: 340px; overflow-y: auto; scroll-behavior: smooth; padding-right: 4px; }
.lk-item { border: 1px solid #262d34; border-radius: 7px; background: #0d1116; cursor: pointer;
  overflow: hidden; transition: transform .12s, border-color .12s, box-shadow .12s; }
.lk-item:hover, .lk-item.mm-focus { transform: translateY(-3px); border-color: var(--rar);
  box-shadow: 0 0 0 1px var(--rar); }
.lk-item.eq { border-color: #4d7a55; }
.lk-item img { width: 100%; aspect-ratio: 1; object-fit: contain; display: block;
  background: radial-gradient(circle at 50% 38%, var(--rarSoft) 0%, #06080b 76%); }
.lk-meta { padding: 7px 8px 8px; }
.lk-name { font-size: 11px; color: #e6edf4; margin-bottom: 2px; }
.lk-for { font-size: 8.5px; letter-spacing: .1em; color: #7f8b96; text-transform: uppercase; }
.lk-rar { font-size: 8px; letter-spacing: .16em; color: var(--rar); margin-top: 4px; display: block; }
.lk-eq { font-size: 8px; letter-spacing: .16em; color: #7fd08a; }
.lk-empty { font-size: 11px; color: #77808a; padding: 14px 0; }

/* ---- save slots ---------------------------------------------------------- */
#mm-slots { max-width: 700px; }
.sl-bal { text-align: center; font-size: 11px; letter-spacing: .18em; color: #d9bd6a; margin-bottom: 14px; }
.sl-bal b { font-size: 16px; color: #ffd97a; margin-left: 8px; }
.sl-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.sl-slot { display: flex; align-items: center; gap: 14px; padding: 13px 15px;
  border: 1px solid #262d34; border-radius: 8px; background: rgba(13,17,22,.72); text-align: left; }
.sl-slot.empty { border-style: dashed; }
.sl-slot.active { border-color: #d9bd6a; box-shadow: 0 0 0 1px rgba(217,189,106,.3); }
.sl-num { font-size: 22px; color: #7f8b96; width: 30px; text-align: center; }
.sl-slot.active .sl-num { color: #ffd97a; }
.sl-info { flex: 1; min-width: 0; }
.sl-title { font-size: 14px; color: #e6edf4; margin-bottom: 3px; }
.sl-mode { display: inline-block; font-size: 8.5px; letter-spacing: .16em; padding: 2px 7px;
  border-radius: 3px; margin-left: 8px; border: 1px solid; }
.sl-mode.single { color: #9fb0bd; border-color: #3f4a55; }
.sl-mode.multi { color: #74b6f0; border-color: #2f5b80; }
.sl-line { font-size: 10.5px; color: #86929d; letter-spacing: .04em; }
.sl-actions { display: flex; gap: 7px; flex-shrink: 0; }
.sl-actions .mm-btn { padding: 7px 13px; font-size: 10px; }
.sl-del { color: #e08a7a; border-color: #5a3a34; }
.sl-players { font-size: 10px; color: #74b6f0; margin-top: 3px; }

/* multiplayer save-slot gate */
.mpg { margin: 10px 0; padding: 11px 13px; border: 1px solid #2f3941; border-radius: 6px;
  background: rgba(12,18,24,.6); }
.mpg.hidden { display: none; }
.mpg-head { font-size: 9px; letter-spacing: .2em; color: #74b6f0; margin-bottom: 8px; }
.mpg-row { display: flex; justify-content: space-between; font-size: 12px; padding: 3px 0; }
.mpg-name { color: #d5dde5; }
.mpg-state { font-size: 9px; letter-spacing: .14em; }
.mpg-state.rdy { color: #7fd08a; }
.mpg-state.wait { color: #d9bd6a; }
.mpg-state.off { color: #e08a7a; }
.mpg-warn { margin-top: 8px; font-size: 10.5px; color: #e0a08a; line-height: 1.5; }
.mpg-ok { margin-top: 8px; font-size: 10.5px; color: #7fd08a; }

.sl-confirm { display:flex; align-items:center; gap:10px; flex-wrap:wrap; padding:11px 14px;
  border:1px solid #5a3a34; border-radius:7px; background:rgba(40,16,12,.5); font-size:11px; color:#e0b0a4; }
.sl-confirm span { flex:1; min-width:200px; }
.sl-slot { cursor:pointer; }

.sl-locked { margin-top:4px; font-size:9.5px; letter-spacing:.12em; color:#e0a08a; }
.sl-slot .sl-locked::before { content:"\\1F512  "; }

.mm-account { text-align:center; font-size:11px; letter-spacing:.1em; color:#8d97a2; margin-bottom:8px; }
.mm-account b { color:#d9bd6a; }
.mm-account .mm-btn { padding:4px 10px; font-size:9px; margin-left:8px; }
.mp-asyou { text-align:center; font-size:12px; letter-spacing:.08em; color:#8d97a2; margin-bottom:14px; }
.mp-asyou b { color:#d9bd6a; font-size:15px; }

.cd-chips { display:flex; gap:6px; flex-wrap:wrap; }
.cd-chip { padding:6px 11px; font:inherit; font-size:10px; letter-spacing:.08em; color:#8d97a2;
  background:#12161b; border:1px solid #262d34; border-radius:4px; cursor:pointer; }
.cd-chip:hover { color:#d5dde5; border-color:#3d4650; }
.cd-chip.on { color:#0d1116; background:#d9bd6a; border-color:#d9bd6a; }
.cd-sw.sauce { border-radius:6px; }
.cd-chip { border-left-width:1px; }

/* the buddy part picker: a row of category tabs over a grid of options */
.cd-spud { margin-top:14px; border-top:1px solid #222932; padding-top:12px; }
.cd-spud-tabs { display:flex; flex-wrap:wrap; gap:4px; margin-bottom:10px; }
.cd-spud-tab { padding:5px 9px; font:inherit; font-size:9px; letter-spacing:.1em; color:#7c868f;
  background:transparent; border:1px solid transparent; border-bottom:2px solid transparent;
  border-radius:3px 3px 0 0; cursor:pointer; }
.cd-spud-tab:hover { color:#d5dde5; background:#161b21; }
.cd-spud-tab.on { color:#d9bd6a; border-bottom-color:#d9bd6a; background:#12161b; }
.cd-spud .cd-chips { max-height:132px; overflow-y:auto; padding:2px; }
.cd-spud-acts { display:flex; gap:8px; margin-top:12px; }
.cd-spud-acts .mm-btn { flex:1; padding:7px 10px; font-size:9.5px; }
.cd-spud .mm-msg { margin-top:8px; font-size:10px; min-height:13px; }

/* ---- Season 1: Cartoon Chaos -------------------------------------------- */
/* Loud on purpose: the pass is the one screen in the game allowed to be bright. */
#main-menu .mm-btn.mm-bpbtn {
  background: linear-gradient(180deg, rgba(154,79,240,0.95), rgba(255,47,106,0.9));
  border-color: rgba(255,210,74,0.7); color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.55);
}
#main-menu .mm-btn.mm-bpbtn:hover { filter: brightness(1.12); }
#mm-bp { max-width: 1180px; }
.bp-head { text-align:center; padding: 6px 0 10px; }
.bp-season { font-size:10px; letter-spacing:.32em; color:#c9a2ff; }
.bp-title {
  font-size: 42px; font-weight: 900; letter-spacing: .06em; line-height: 1.05; margin: 2px 0 6px;
  background: linear-gradient(92deg, #ffd24a, #ff5fa2 45%, #4ad8ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 rgba(0,0,0,0.5));
}
.bp-tierbig { font-size:13px; letter-spacing:.2em; color:#8d97a2; }
.bp-tierbig b { font-size:26px; color:#ffd24a; margin:0 4px; }
.bp-tierbig em { font-style:normal; font-size:12px; color:#66707a; }
.bp-xpwrap { max-width: 520px; margin: 8px auto 0; }
.bp-xpbar { height:12px; border-radius:8px; background:#141920; border:1px solid #2b333c; overflow:hidden; }
.bp-xpbar i { display:block; height:100%; border-radius:8px;
  background: linear-gradient(90deg, #4ad8ff, #ffd24a); transition: width .35s ease; }
.bp-xptext { font-size:10.5px; letter-spacing:.1em; color:#8d97a2; margin-top:5px; }

.bp-prem { display:flex; align-items:center; justify-content:center; gap:14px; flex-wrap:wrap;
  margin: 10px auto 6px; padding:10px 16px; max-width:760px; border-radius:10px;
  background: linear-gradient(100deg, rgba(154,79,240,0.22), rgba(255,47,106,0.16));
  border:1px solid rgba(200,150,255,0.34); }
.bp-prem.on { background: linear-gradient(100deg, rgba(60,190,120,0.18), rgba(74,216,255,0.14));
  border-color: rgba(120,230,170,0.4); }
.bp-prem b { font-size:12px; letter-spacing:.2em; color:#ffd24a; }
.bp-prem.on b { color:#8fe8b0; }
.bp-prem span { font-size:11px; color:#c3ccd6; }

.bp-tabs { display:flex; gap:8px; justify-content:center; margin:10px 0 6px; }
.bp-tab { padding:7px 20px; font:inherit; font-size:11px; letter-spacing:.16em; cursor:pointer;
  color:#8d97a2; background:#12161b; border:1px solid #262d34; border-radius:6px; }
.bp-tab:hover { color:#e6edf3; }
.bp-tab.on { color:#12080a; background:linear-gradient(180deg,#ffd24a,#ffab2a); border-color:#ffd24a; font-weight:700; }

.bp-body { margin-top: 4px; }
.bp-strip { display:flex; gap:8px; overflow-x:auto; overflow-y:hidden; padding:10px 4px 14px;
  scroll-behavior:smooth; }
.bp-strip::-webkit-scrollbar { height:10px; }
.bp-strip::-webkit-scrollbar-thumb { background:#3a444f; border-radius:6px; }
.bp-col { flex:0 0 132px; display:flex; flex-direction:column; align-items:center; gap:5px; }
.bp-col.bp-major .bp-num { color:#ffd24a; border-color:#ffd24a; }
.bp-col.bp-now .bp-num { background:#ffd24a; color:#12080a; border-color:#ffd24a; font-weight:800; }
.bp-num { width:30px; height:22px; line-height:20px; text-align:center; font-size:11px;
  border:1px solid #39424c; border-radius:5px; color:#98a2ac; }
.bp-cell { position:relative; width:132px; height:132px; padding:0; cursor:pointer;
  background:#11151a; border:2px solid #262d34; border-radius:10px; overflow:hidden;
  display:flex; flex-direction:column; align-items:center; justify-content:flex-start; }
.bp-cell:hover { border-color:#6ad2ff; transform:translateY(-2px); }
.bp-cell.bp-p { border-color:#7a4ac0; }
.bp-cell.bp-final { border-color:#ffd24a; box-shadow:0 0 16px rgba(255,210,74,0.35); }
.bp-cell.rar-legendary { background:linear-gradient(180deg,#3a2a06,#11151a); }
.bp-cell.rar-epic      { background:linear-gradient(180deg,#2a1240,#11151a); }
.bp-cell.rar-rare      { background:linear-gradient(180deg,#0d2438,#11151a); }
.bp-img { width:100%; height:88px; object-fit:contain; background:transparent; }
.bp-nm { font-size:9px; letter-spacing:.04em; color:#d6dee6; padding:0 5px; text-align:center;
  line-height:1.15; max-height:22px; overflow:hidden; }
.bp-badge { position:absolute; top:4px; left:4px; font-size:7.5px; letter-spacing:.12em;
  padding:2px 5px; border-radius:4px; background:rgba(0,0,0,0.62); color:#cfd8e0; }
.bp-cell.bp-ready  .bp-badge { background:#2f8f4a; color:#eafff0; }
.bp-cell.bp-claimed .bp-badge { background:#2b3a48; color:#8fb4cc; }
.bp-cell.bp-locked { opacity:0.5; }
.bp-cell.bp-premium .bp-badge { background:#7a4ac0; color:#f2e6ff; }
.bp-legend { display:flex; gap:14px; justify-content:center; font-size:9.5px; letter-spacing:.14em; color:#7c868f; }
.bp-lp { color:#c9a2ff; } .bp-lf { color:#8fd8ff; }

.bp-qhead { display:flex; justify-content:space-between; align-items:baseline;
  margin:14px 2px 6px; border-bottom:1px solid #222932; padding-bottom:4px; }
.bp-qhead b { font-size:12px; letter-spacing:.2em; color:#ffd24a; }
.bp-qhead span { font-size:10px; color:#8d97a2; }
.bp-qgrid { display:grid; grid-template-columns:repeat(auto-fill,minmax(250px,1fr)); gap:8px; }
.bp-q { background:#11151a; border:1px solid #242b33; border-radius:8px; padding:9px 11px; }
.bp-q.bp-qdone { border-color:#2f8f4a; background:linear-gradient(180deg,rgba(47,143,74,0.14),#11151a); }
.bp-qtop { display:flex; justify-content:space-between; font-size:11.5px; color:#e6edf3; }
.bp-qtop span { font-size:9.5px; letter-spacing:.1em; color:#ffd24a; }
.bp-qdone .bp-qtop span { color:#8fe8b0; }
.bp-qdesc { font-size:10px; color:#8d97a2; margin:3px 0 6px; }
.bp-qbar { height:6px; border-radius:4px; background:#0c1015; border:1px solid #232a32; overflow:hidden; }
.bp-qbar i { display:block; height:100%; background:linear-gradient(90deg,#4ad8ff,#ffd24a); }
.bp-qnum { font-size:9px; color:#7c868f; margin-top:3px; text-align:right; }
.bp-qtot { text-align:center; font-size:10px; letter-spacing:.14em; color:#8d97a2; margin:12px 0 2px; }
.bp-actions { display:flex; gap:10px; justify-content:center; margin-top:12px; }
.bp-actions .mm-btn { min-width:170px; }

#bp-detail { position:fixed; inset:0; z-index:60; display:flex; align-items:center; justify-content:center;
  background:rgba(4,6,9,0.82); }
#bp-detail.hidden { display:none; }
.bpd-card { position:relative; width:min(940px,94vw); background:#0e1218;
  border:2px solid #7a4ac0; border-radius:14px; padding:18px; }
.bpd-body { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:20px; }
.bpd-stage { background:radial-gradient(circle at 50% 42%, #1c2430, #0a0d12);
  border:1px solid #242b33; border-radius:10px; display:flex; align-items:center; justify-content:center;
  min-height:340px; }
.bpd-stage img { width:100%; max-height:400px; object-fit:contain; }
.bpd-info { display:flex; flex-direction:column; gap:8px; }
.bpd-state { font-size:11px; letter-spacing:.16em; margin-top:4px; }
.bpd-state.ready { color:#8fe8b0; } .bpd-state.claimed { color:#8fb4cc; }
.bpd-state.locked { color:#8d97a2; } .bpd-state.premium { color:#c9a2ff; }
.bpd-acts { display:flex; gap:8px; flex-wrap:wrap; margin-top:8px; }
#bp-detail .mm-btn { padding:9px 16px; font-size:10px; }
@media (max-width:820px) { .bpd-body { grid-template-columns:1fr; } .bp-title { font-size:30px; } }

/* ---- emote wheel ---------------------------------------------------------- */
#emote-wheel { position:fixed; inset:0; z-index:55; display:flex; align-items:center;
  justify-content:center; background:rgba(4,6,9,0.45); }
#emote-wheel.hidden { display:none; }
.ew-ring { position:relative; width:min(460px,80vmin); height:min(460px,80vmin);
  border-radius:50%; background:radial-gradient(circle, rgba(12,16,22,0.9), rgba(6,9,13,0.55));
  border:2px solid rgba(120,190,235,0.28); }
.ew-slot { position:absolute; transform:translate(-50%,-50%); width:104px; padding:8px 6px;
  font:inherit; cursor:pointer; color:#e6edf3; background:rgba(14,20,27,0.94);
  border:1px solid #2b333c; border-radius:8px; display:flex; flex-direction:column; gap:2px; }
.ew-slot:hover { border-color:#6ad2ff; color:#fff; }
.ew-slot.ew-empty { opacity:0.42; cursor:default; }
.ew-num { font-size:9px; letter-spacing:.16em; color:#ffd24a; }
.ew-name { font-size:10.5px; line-height:1.15; }
.ew-hint { position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); text-align:center; }
.ew-hint b { display:block; font-size:12px; letter-spacing:.24em; color:#ffd24a; }
.ew-hint span { font-size:10px; letter-spacing:.1em; color:#8d97a2; }
.cd-emote { margin-top:12px; border-top:1px solid #222932; padding-top:10px;
  display:flex; flex-direction:column; gap:8px; }
.cd-emote .mm-btn { align-self:flex-start; padding:7px 14px; font-size:9.5px; }

/* ---- quests ---------------------------------------------------------------- */
#main-menu .mm-btn.mm-qbtn {
  background: linear-gradient(180deg, rgba(74,216,255,0.22), rgba(20,40,54,0.94));
  border-color: rgba(120,220,255,0.5);
}
#mm-quests { max-width: 940px; }
.q-head { text-align:center; padding: 4px 0 8px; }
.q-season { font-size:9.5px; letter-spacing:.3em; color:#c9a2ff; }
.q-title { font-size:34px; font-weight:900; letter-spacing:.14em; margin:2px 0 4px;
  background: linear-gradient(92deg,#4ad8ff,#ffd24a); -webkit-background-clip:text;
  background-clip:text; color:transparent; filter: drop-shadow(0 2px 0 rgba(0,0,0,0.5)); }
.q-tierline { font-size:11px; letter-spacing:.2em; color:#8d97a2; }
.q-tierline b { font-size:20px; color:#ffd24a; margin:0 4px; }
.q-tierline em { font-style:normal; font-size:11px; color:#66707a; }
.q-xpwrap { max-width:460px; margin:7px auto 0; }
.q-xpbar { height:10px; border-radius:6px; background:#141920; border:1px solid #2b333c; overflow:hidden; }
.q-xpbar i { display:block; height:100%; border-radius:6px;
  background:linear-gradient(90deg,#4ad8ff,#ffd24a); transition: width .6s cubic-bezier(.2,.9,.3,1); }
.q-xptext { font-size:10px; letter-spacing:.1em; color:#8d97a2; margin-top:4px; }
.q-tabs { display:flex; gap:6px; justify-content:center; flex-wrap:wrap; margin:12px 0 8px; }
.q-tab { padding:8px 18px; font:inherit; font-size:10.5px; letter-spacing:.14em; cursor:pointer;
  color:#8d97a2; background:#12161b; border:1px solid #262d34; border-radius:6px; }
.q-tab:hover { color:#e6edf3; }
.q-tab.on { color:#0d1116; background:linear-gradient(180deg,#4ad8ff,#2aa8d8); border-color:#4ad8ff; font-weight:700; }
.q-tab.q-tablocked::after { content:" \1F512"; opacity:.75; }
.q-timerbar { display:flex; justify-content:space-between; align-items:baseline;
  border-bottom:1px solid #222932; padding:0 4px 5px; margin-bottom:9px; min-height:18px; }
.q-timerbar span { font-size:11px; letter-spacing:.2em; color:#ffd24a; }
.q-timerbar b { font-size:11px; letter-spacing:.14em; color:#8fd8ff; font-variant-numeric: tabular-nums; }
.q-list { display:grid; grid-template-columns:repeat(auto-fill,minmax(268px,1fr)); gap:9px; }
.q-card { background:#11151a; border:1px solid #242b33; border-left-width:4px; border-radius:8px; padding:10px 12px; }
.q-card.q-easy   { border-left-color:#5aa86a; }
.q-card.q-medium { border-left-color:#4ad8ff; }
.q-card.q-hard   { border-left-color:#ff9a3a; }
.q-card.q-set    { border-left-color:#c08cf0; }
.q-card.q-done   { border-color:#2f8f4a; border-left-color:#2f8f4a;
  background:linear-gradient(180deg,rgba(47,143,74,0.16),#11151a); }
.q-top { display:flex; justify-content:space-between; align-items:baseline; gap:8px; }
.q-top b { font-size:11.5px; letter-spacing:.1em; color:#e6edf3; }
.q-xp { font-size:10px; letter-spacing:.08em; color:#ffd24a; white-space:nowrap; }
.q-desc { font-size:10.5px; color:#8d97a2; margin:4px 0 8px; }
.q-barwrap { display:flex; align-items:center; gap:8px; }
.q-bar { flex:1; height:7px; border-radius:4px; background:#0c1015; border:1px solid #232a32; overflow:hidden; }
.q-bar i { display:block; height:100%; background:linear-gradient(90deg,#4ad8ff,#ffd24a); transition:width .4s ease; }
.q-num { font-size:10px; color:#98a2ac; font-variant-numeric:tabular-nums; }
.q-tick { margin-top:6px; font-size:9.5px; letter-spacing:.16em; color:#8fe8b0; }
.q-foot { grid-column:1/-1; text-align:center; font-size:10px; letter-spacing:.12em; color:#7c868f; margin-top:6px; }
.q-locked { grid-column:1/-1; text-align:center; padding:26px 18px; border-radius:10px;
  background:linear-gradient(100deg,rgba(154,79,240,0.18),rgba(255,47,106,0.12));
  border:1px solid rgba(200,150,255,0.3); }
.q-locked b { display:block; font-size:14px; letter-spacing:.22em; color:#ffd24a; margin-bottom:8px; }
.q-locked p { font-size:11px; color:#c3ccd6; max-width:520px; margin:0 auto 8px; }
.q-locked .q-fair { color:#8fe8b0; }
.q-actions { display:flex; gap:10px; justify-content:center; margin-top:14px; }
.q-actions .mm-btn { min-width:170px; }

/* the completion moment */
#quest-pop { position:fixed; left:50%; top:16%; transform:translateX(-50%); z-index:70; pointer-events:none; }
#quest-pop.hidden { display:none; }
.qp-inner { min-width:320px; text-align:center; padding:16px 30px; border-radius:12px;
  background:linear-gradient(180deg,rgba(18,24,32,0.97),rgba(10,14,19,0.97));
  border:2px solid #ffd24a; box-shadow:0 0 34px rgba(255,210,74,0.35); }
.qp-title { font-size:20px; font-weight:900; letter-spacing:.2em; color:#ffd24a; }
.qp-name { font-size:12px; letter-spacing:.16em; color:#e6edf3; margin-top:4px; }
.qp-xp { font-size:13px; letter-spacing:.1em; color:#8fd8ff; margin-top:6px; }
.qp-bar { height:6px; margin-top:10px; border-radius:4px; background:#0c1015; overflow:hidden; }
.qp-bar i { display:block; height:100%; width:0; background:linear-gradient(90deg,#4ad8ff,#ffd24a); }
#quest-pop.qp-show .qp-inner { animation: qpIn .42s cubic-bezier(.2,1.4,.4,1) both; }
#quest-pop.qp-show .qp-bar i { animation: qpFill 1.5s .25s cubic-bezier(.2,.9,.3,1) both; }
@keyframes qpIn { 0% { opacity:0; transform:translateY(-16px) scale(.86); }
                  100% { opacity:1; transform:translateY(0) scale(1); } }
@keyframes qpFill { from { width:0; } to { width:100%; } }
@media (max-width:700px) { .q-title { font-size:26px; } }

/* ---- touch controls ------------------------------------------------------- */
/* Present only on a touchscreen device; a desktop build never creates them. */
#touch-ui { position:fixed; inset:0; z-index:40; pointer-events:none;
  -webkit-user-select:none; user-select:none; -webkit-touch-callout:none; }
#touch-ui.hidden { display:none; }
#touch-ui * { -webkit-tap-highlight-color: transparent; }
.tc-look { position:absolute; right:0; top:0; width:58%; height:100%; pointer-events:auto; }
.tc-stick { position:absolute; left:max(18px, env(safe-area-inset-left)); bottom:max(22px, env(safe-area-inset-bottom));
  width:min(34vw,168px); aspect-ratio:1; border-radius:50%; pointer-events:auto;
  background:radial-gradient(circle, rgba(20,28,38,0.42), rgba(10,14,20,0.24));
  border:2px solid rgba(150,200,235,0.28); touch-action:none; }
.tc-knob { position:absolute; left:50%; top:50%; width:40%; height:40%; margin:-20% 0 0 -20%;
  border-radius:50%; background:rgba(150,205,240,0.42); border:2px solid rgba(200,230,255,0.6); }
.tc-btn { position:absolute; pointer-events:auto; font:inherit; font-size:11px; letter-spacing:.08em;
  color:#e6edf3; background:rgba(14,20,28,0.62); border:2px solid rgba(150,200,235,0.34);
  border-radius:50%; width:64px; height:64px; display:flex; align-items:center; justify-content:center;
  touch-action:none; }
.tc-btn.tc-on { background:rgba(74,216,255,0.42); border-color:#8fe0ff; color:#04121a; }
.tc-pad { position:absolute; right:max(14px, env(safe-area-inset-right));
  bottom:max(20px, env(safe-area-inset-bottom)); width:236px; height:190px; }
.tc-pad .tc-btn { position:absolute; }
.tc-use    { right:78px; bottom:96px; width:76px; height:76px; font-size:13px;
             background:rgba(74,216,255,0.26); border-color:#6ad2ff; }
.tc-hit    { right:0;    bottom:58px; }
.tc-item   { right:150px; bottom:44px; }
.tc-jump   { right:74px; bottom:14px; }
.tc-crouch { right:4px;  bottom:132px; font-size:9px; }
.tc-reload { right:152px; bottom:126px; font-size:9px; }
.tc-side { position:absolute; right:max(12px, env(safe-area-inset-right)); top:max(64px, env(safe-area-inset-top));
  display:flex; flex-direction:column; gap:9px; }
.tc-side .tc-btn { position:relative; width:52px; height:52px; font-size:19px; }
.tc-run { left:max(20px, env(safe-area-inset-left)); bottom:calc(min(34vw,168px) + 34px);
  width:58px; height:58px; font-size:10px; }
@media (max-height: 460px) {
  .tc-stick { width:min(26vw,124px); }
  .tc-btn { width:54px; height:54px; font-size:10px; }
  .tc-use { width:64px; height:64px; }
}
/* phones and tablets: keep the menus readable rather than desktop-sized */
@media (pointer: coarse) {
  #main-menu { font-size: 15px; }
  #main-menu .mm-btn { padding: 14px 16px; font-size: 12px; }
  .q-list, .bp-strip { -webkit-overflow-scrolling: touch; }
  .bp-col { flex-basis: 116px; }
  .cd-card, .bpd-card { width: 96vw; }
  .bpd-body, .cd-body { grid-template-columns: 1fr; }
}
