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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: radial-gradient(circle at top, #1b1f2b 0%, #05060a 55%, #020308 100%);
  color: #f5e6c8;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
}

#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: radial-gradient(circle at top, #2c2f3d 0%, #05060a 60%, #000000 100%);
}

/* MENU */

#menu {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, #1f2538 0%, #050509 55%, #000000 100%);
  z-index: 10;
}

#menu.hidden {
  display: none;
}

.menu-panel {
  background: linear-gradient(145deg, rgba(40, 33, 24, 0.95), rgba(16, 12, 8, 0.98));
  border-radius: 14px;
  border: 2px solid #b98b46;
  box-shadow:
    0 0 30px rgba(255, 191, 105, 0.35),
    0 0 120px rgba(74, 209, 255, 0.2);
  padding: 32px 40px;
  max-width: 520px;
  width: 90%;
  text-align: center;
}

.menu-panel h1 {
  font-size: 2.2rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 8px;
  color: #f5e6c8;
  text-shadow:
    0 0 8px rgba(255, 227, 171, 0.6),
    0 0 18px rgba(142, 229, 255, 0.7);
}

.menu-panel .tagline {
  font-size: 0.95rem;
  margin-bottom: 22px;
  color: #d1c2a0;
}

button {
  cursor: pointer;
  border: none;
  outline: none;
  padding: 10px 22px;
  margin: 6px 8px;
  border-radius: 999px;
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  background: radial-gradient(circle at 20% 0, #f6e1aa 0%, #c68b3b 25%, #7d4516 80%);
  color: #1b1008;
  box-shadow:
    0 0 12px rgba(255, 203, 112, 0.5),
    inset 0 0 6px rgba(41, 14, 0, 0.9);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow:
    0 0 20px rgba(255, 203, 112, 0.7),
    inset 0 0 6px rgba(30, 9, 0, 0.9);
}

button:active {
  transform: translateY(1px);
  box-shadow:
    0 0 10px rgba(255, 203, 112, 0.4),
    inset 0 0 4px rgba(7, 2, 0, 0.9);
}

#instructions {
  margin-top: 18px;
  text-align: left;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #e4d0aa;
}

#instructions ul {
  margin-left: 16px;
}

#instructions.hidden {
  display: none;
}

.jam-info {
  margin-top: 18px;
  font-size: 0.8rem;
  color: #a59879;
}

.jam-info a {
  color: #ffce74;
  text-decoration: none;
}

.jam-info a:hover {
  text-decoration: underline;
}

.hidden {
  display: none;
}

.mouse-visual {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.mouse-body {
  width: 70px;
  height: 110px;
  border-radius: 38px;
  border: 2px solid rgba(246, 223, 183, 0.9);
  background: radial-gradient(circle at 30% 0, rgba(255, 255, 255, 0.18), rgba(10, 7, 4, 0.9));
  position: relative;
  padding-top: 8px;
  box-sizing: border-box;
}

.mouse-wheel {
  position: absolute;
  top: 32px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(to bottom, #f7f2e6, #7b6b58);
}

.mouse-split {
  position: absolute;
  top: 14px;
  bottom: 10px;
  width: 50%;
  border-radius: 32px 0 26px 20px;
  background: radial-gradient(circle at 30% 10%, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.6));
}

.mouse-split-right {
  right: 0;
  border-radius: 0 32px 20px 26px;
}

.mouse-split-left {
  left: 0;
}

.mouse-label {
  display: flex;
  flex-direction: column;
  font-size: 0.8rem;
  color: #f3e0b4;
  max-width: 150px;
  position: relative;
}

.mouse-label-title {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mouse-label-sub {
  font-size: 0.72rem;
  opacity: 0.9;
}

.mouse-label-left {
  text-align: right;
  align-items: flex-end;
}

.mouse-label-left::after {
  content: "";
  position: absolute;
  top: 12px;
  right: -10px;
  width: 16px;
  border-top: 1px solid rgba(246, 223, 183, 0.9);
}

.mouse-label-right {
  text-align: left;
  align-items: flex-start;
}

.mouse-label-right::after {
  content: "";
  position: absolute;
  top: 12px;
  left: -10px;
  width: 16px;
  border-top: 1px solid rgba(246, 223, 183, 0.9);
}

.mouse-hint {
  font-size: 0.8rem;
  max-width: 320px;
  color: #e9d8b5;
  margin-top: 8px;
}

@media (max-width: 640px) {
  .mouse-visual {
    flex-direction: column;
    align-items: center;
  }
}

/* KOKPIT */

#cockpit {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 150px;
  background: radial-gradient(circle at 50% -100%, rgba(255, 226, 168, 0.14), transparent 60%),
    linear-gradient(to top, rgba(7, 4, 2, 0.96), rgba(12, 9, 6, 0.96));
  border-top: 2px solid #b98b46;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 10px 30px;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.75);
  pointer-events: none;
}

.gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 90px;
  padding: 8px 12px;
  border-radius: 12px;
  background: radial-gradient(circle at 30% 0, rgba(219, 180, 102, 0.35), rgba(46, 31, 16, 0.95));
  border: 1px solid rgba(255, 200, 132, 0.4);
  box-shadow:
    inset 0 0 10px rgba(0, 0, 0, 0.8),
    0 0 18px rgba(255, 187, 110, 0.5);
}

.gauge-small {
  min-width: 130px;
}

.gauge .label {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #f6dfb9;
  margin-bottom: 6px;
}

.gauge .value {
  font-family: "Consolas", "Fira Mono", monospace;
  font-size: 1.4rem;
  color: #98f8ff;
  text-shadow:
    0 0 10px rgba(106, 245, 255, 0.8),
    0 0 24px rgba(0, 215, 255, 0.9);
}

#power-bar {
  width: 100%;
  height: 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 229, 187, 0.7);
  background: linear-gradient(to right, #220909, #150f1e);
  overflow: hidden;
}

#power-level {
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, #5fffac, #fff776, #ff6b6b);
  box-shadow: 0 0 10px rgba(255, 240, 170, 0.9);
  transition: width 0.1s linear;
}

/* GAME OVER PANEL */

#game-over {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  background: radial-gradient(circle at center, rgba(10, 8, 4, 0.85), rgba(0, 0, 0, 0.95));
  z-index: 5;
}

#game-over.hidden {
  display: none;
}

.game-over-panel {
  background: linear-gradient(145deg, rgba(40, 24, 19, 0.95), rgba(18, 10, 6, 0.98));
  border-radius: 16px;
  border: 2px solid #d79a46;
  padding: 26px 32px;
  box-shadow:
    0 0 40px rgba(255, 191, 105, 0.65),
    0 0 110px rgba(74, 209, 255, 0.4);
  text-align: center;
}

.game-over-panel h2 {
  font-size: 1.6rem;
  margin-bottom: 14px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.game-over-panel p {
  margin: 4px 0;
}

@media (max-width: 768px) {
  #cockpit {
    height: 130px;
    padding: 8px 10px;
  }

  .gauge {
    min-width: 70px;
    padding: 6px 8px;
  }

  .gauge .value {
    font-size: 1.1rem;
  }
}
