:root {
  --taskbar-h: 40px;
  --btn-red: #bf0f0f;
  --btn-green: #389122;
  --text: #fff;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  overflow: hidden;
  width: 100vw; height: 100vh;
  font-family: sans-serif;
  user-select: none;
  background: #000;
}

#desktop {
  position: fixed; inset: 0;
  background: #000 url("./assets/sprites/components/Bliss.png") center/cover no-repeat;
  overflow: hidden;
  cursor: default;
}

#gameLayer {
  position: fixed; inset: 0; z-index: 51;
  pointer-events: none;
}

#mainCanvas, #foodCanvas, #particleCanvas, #poopCanvas {
  position: absolute; inset: 0; pointer-events: none;
}
#poopCanvas { z-index: 58; }
#particleCanvas { z-index: 59; }
#mainCanvas { z-index: 70; }
#foodCanvas { z-index: 71; }

/* Dinner Machine */
#dinnerMachine {
  position: absolute; bottom: calc(var(--taskbar-h) + 10px); right: 10px;
  width: 200px; height: 200px;
  cursor: pointer; z-index: 65; pointer-events: auto;
  image-rendering: pixelated;
}
#dinnerMachine img { width: 100%; height: 100%; }

/* Buttons */
.ctrl-btn {
  position: absolute; left: 10px;
  width: 130px; height: 50px;
  border-radius: 10px;
  border: 2px solid;
  font-size: 14px; font-weight: bold; color: #fff;
  cursor: pointer; z-index: 65; pointer-events: auto;
  display: flex; align-items: center; justify-content: center;
  transition: filter .1s;
}
.ctrl-btn:hover { filter: brightness(1.2); }

#hitBtn {
  bottom: 70px;
  background: var(--btn-red);
  border-color: #ff5555;
}
#hitBtn.active {
  animation: btnPulse 0.9s ease-in-out infinite alternate;
  border-color: #ff8888;
}
#spongeBtn {
  bottom: 130px;
  background: var(--btn-green);
  border-color: #aaff77;
  display: none;
}
#spongeBtn.active {
  animation: btnPulseGreen 0.9s ease-in-out infinite alternate;
}

@keyframes btnPulse {
  from { background: #9a0a0a; } to { background: #df1010; }
}
@keyframes btnPulseGreen {
  from { background: #1a5010; } to { background: #44aa22; }
}

/* Fist cursor */
#fistCursor {
  position: fixed; pointer-events: none; z-index: 1000;
  width: 96px; height: 96px; display: none;
  transform: translate(-50%, -50%);
  transform-origin: center center;
}
#fistCursor img { width: 100%; height: 100%; }

/* Sponge cursor */
#spongeCursor {
  position: fixed; pointer-events: none; z-index: 1000;
  width: 128px; height: 128px; display: none;
  transform: translate(-50%, -50%);
}
#spongeCursor img { width: 100%; height: 100%; }

/* Combo score */
#comboScore {
  position: absolute; left: 30px; top: 30px; z-index: 72;
  display: none; width: 220px; height: 110px;
  background: rgba(13,13,13,0.82);
  border: 3px solid #ffd900;
  border-radius: 14px;
  padding: 10px 12px;
  text-align: center;
  pointer-events: none;
}
#comboScore.live { animation: comboPulse 1.5s ease-in-out infinite alternate; }
#comboScore.locked {
  background: rgba(13,13,13,0.65);
  border-color: #b3b3b3;
}
#comboScore .label {
  height: 20px; font-size: 15px; line-height: 20px;
  color: #ffd700; letter-spacing: 1px; text-transform: uppercase;
}
#comboScore .score {
  font-size: 58px; line-height: 1; font-weight: bold;
  background: linear-gradient(to bottom, #fff 60%, #ffd700);
  background-clip: text; -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
#comboScore.locked .label { color: #b3b3b3; }
#comboScore.locked .score {
  background: none; color: #e6e6e6;
  -webkit-text-fill-color: currentColor;
}
@keyframes comboPulse {
  from { border-color: #d9b900; }
  to { border-color: #ffe34d; }
}

/* Context menu */
#ctxMenu {
  position: fixed; z-index: 9999;
  background: #f5f2e8; border: 1px solid #aca899;
  border-radius: 2px; padding: 2px;
  box-shadow: 2px 4px 12px rgba(0,0,0,0.35);
  min-width: 200px; display: none;
}
#ctxMenu div {
  padding: 6px 24px; color: #111; cursor: pointer; font-size: 13px;
}
#ctxMenu div:hover { background: #316ac5; color: #fff; }
#ctxMenu hr { border: 0; border-top: 1px solid #d6d2c2; margin: 2px 4px; }

/* Taskbar */
#taskbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--taskbar-h);
  background: linear-gradient(to bottom, #3c8cf5 0%, #2673e8 12%, #1558d6 55%, #0d45b5 100%);
  border-top: 1px solid #78b4ff;
  display: flex; align-items: center;
  padding: 0 10px; gap: 10px; z-index: 50;
  box-shadow: 0 -1px 4px rgba(0, 34, 102, 0.55);
}
#trayIcon {
  width: 28px; height: 28px; cursor: pointer;
  border-radius: 4px; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.45);
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
#trayIcon img { width: 100%; height: 100%; }
#taskbarClock {
  margin-left: auto; color: #fff; font-size: 13px; white-space: nowrap;
  height: 100%; display: flex; align-items: center;
  padding: 0 12px; margin-right: -10px;
  background: linear-gradient(to bottom, #1768d5, #0c4db3);
  border-left: 1px solid rgba(255,255,255,0.25);
}
#taskbarTitle { color: #fff; font-size: 13px; text-shadow: 0 1px 2px #164b9b; }
