:root {
  --hud-gold-1: #fff3a3;
  --hud-gold-2: #ffd343;
  --hud-gold-3: #f09d11;
  --hud-stroke: #8a4c00;
  --hud-shadow: rgba(71, 28, 0, 0.55);
  --hud-blue: #55d8ff;
  --hud-green: #5eb21a;
  --hud-green-dark: #2e7c15;
  --text-dark: #2b1100;
}

* {
  box-sizing: border-box;
}

html,
body,
.shell {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: linear-gradient(180deg, #dff6ff, #8ec5ec);
  color: #fff7dc;
  font-family: "Arial Black", "Trebuchet MS", Verdana, sans-serif;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

.hud {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 2;
  pointer-events: none;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 26px 34px;
}

.hud--top {
  top: 0;
}

.hud--bottom {
  bottom: 0;
  align-items: flex-end;
}

.score-panel,
.banana-panel {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px 6px;
  border: 3px solid #ad6a00;
  border-radius: 12px;
  background:
    linear-gradient(180deg, #ffea63, #ebb022 56%, #c67d07);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.55),
    0 5px 0 rgba(111, 56, 0, 0.6);
}

.score-panel__label,
.banana-panel__value,
.score-panel__value,
.time-panel__title,
.time-panel__value,
.time-panel__fraction,
.speed-panel,
.stage-panel {
  font-weight: 900;
  -webkit-text-stroke: 3px var(--hud-stroke);
  paint-order: stroke fill;
  text-shadow:
    0 3px 0 var(--hud-shadow),
    0 0 10px rgba(255, 236, 162, 0.3);
  letter-spacing: 0.04em;
}

.score-panel__label {
  font-size: clamp(1rem, 1.5vw, 1.45rem);
  color: #b7f01d;
}

.score-panel__value {
  font-size: clamp(1.7rem, 2.7vw, 3rem);
  color: var(--hud-gold-2);
  line-height: 1;
}

.banana-panel {
  min-width: 110px;
  justify-content: center;
}

.banana-panel__icon {
  font-size: 1.45rem;
  filter: drop-shadow(0 2px 0 rgba(111, 56, 0, 0.55));
}

.banana-panel__value {
  font-size: clamp(1.6rem, 2.4vw, 2.6rem);
  color: var(--hud-gold-2);
  line-height: 1;
}

.time-panel {
  position: absolute;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  width: min(118px, 16vw);
  min-height: 92px;
  display: grid;
  place-items: center;
  padding: 6px 8px 8px;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffe774, #eba727 56%, #bb6e07);
  border: 3px solid #a46000;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.45),
    0 3px 0 rgba(111, 56, 0, 0.65);
}

.time-panel__title {
  position: absolute;
  top: 4px;
  font-size: clamp(0.78rem, 1vw, 1rem);
  color: var(--hud-blue);
  transform: none;
}

.time-panel__value {
  margin-top: 6px;
  font-size: clamp(2rem, 3.1vw, 2.8rem);
  line-height: 1;
  color: #ffbf27;
}

.time-panel__fraction {
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  font-size: clamp(0.95rem, 1.3vw, 1.2rem);
  line-height: 1;
  color: #ffbf27;
}

.bottom-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.meters-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.speed-panel {
  font-size: clamp(1.6rem, 2.4vw, 2.2rem);
  color: #ffffff;
  -webkit-text-stroke: 2px #707070;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.5);
  text-transform: lowercase;
}

.speed-panel span {
  font-size: 1.35em;
  color: #ffffff;
}

.fps-panel {
  font-size: clamp(1rem, 1.5vw, 1.3rem);
  color: #dff6ff;
  font-weight: 900;
  letter-spacing: 0.04em;
  -webkit-text-stroke: 2px #355d72;
  paint-order: stroke fill;
  text-shadow: 0 3px 0 rgba(8, 34, 48, 0.5);
  text-transform: lowercase;
}

.fps-panel span {
  font-size: 1.2em;
}

.stage-panel {
  font-size: clamp(2rem, 3vw, 3rem);
  color: var(--hud-gold-2);
  line-height: 1;
}

.stage-panel::before {
  content: "S";
  display: inline-grid;
  place-items: center;
  width: 1.1em;
  height: 1.1em;
  margin-right: 10px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffe884, #d89916);
  color: #ffffff;
  -webkit-text-stroke: 2px #976100;
  font-size: 0.72em;
  vertical-align: middle;
}

.status {
  margin-top: 4px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.32);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: #fff7d4;
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 0.92rem;
  letter-spacing: 0.03em;
}

.minimap-frame {
  position: relative;
  width: min(250px, 30vw);
  aspect-ratio: 1;
  border-radius: 50%;
  padding: 18px;
  background:
    radial-gradient(circle at 30% 24%, #fff0a6, transparent 36%),
    linear-gradient(180deg, #ffdd72, #ce890f 68%, #a46000);
  border: 6px solid #a46000;
  box-shadow:
    inset 0 4px 0 rgba(255, 255, 255, 0.4),
    0 6px 0 rgba(111, 56, 0, 0.65);
}

.minimap {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  display: block;
  background: radial-gradient(circle at 50% 46%, rgba(255, 255, 255, 0.12), transparent 52%);
}

.minimap::after {
  content: "";
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.18);
}

.minimap__player {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  margin-top: -8px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, #d5fdff, #73caf1 48%, #1b668b 100%);
  border: 2px solid #ffffff;
  box-shadow:
    0 0 0 3px rgba(23, 80, 109, 0.35),
    0 4px 8px rgba(0, 0, 0, 0.25);
}

.menu {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top, rgba(255, 240, 170, 0.26), transparent 36%),
    linear-gradient(180deg, rgba(166, 223, 255, 0.25), rgba(6, 22, 38, 0.72));
}

.menu--hidden {
  display: none;
}

.menu__panel {
  width: min(540px, 100%);
  padding: 28px;
  border-radius: 28px;
  border: 3px solid rgba(255, 224, 114, 0.7);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent),
    rgba(23, 61, 106, 0.68);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(16px);
}

.menu__eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: #fff391;
  font-size: 0.72rem;
}

.menu h1 {
  margin: 0;
  font-size: clamp(2.4rem, 7vw, 4.8rem);
  line-height: 0.9;
  color: #fff7d4;
}

.menu__copy {
  margin: 16px 0 22px;
  max-width: 34ch;
  font-size: 1.05rem;
  line-height: 1.5;
  color: #fff1cb;
}

.level-picker {
  display: grid;
}

.level-card {
  border: 3px solid rgba(255, 233, 128, 0.55);
  border-radius: 24px;
  padding: 20px 22px;
  background:
    linear-gradient(135deg, rgba(255, 222, 104, 0.32), rgba(92, 216, 255, 0.18)),
    rgba(255, 255, 255, 0.05);
  color: #fffceb;
  text-align: left;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.level-card:hover,
.level-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255, 233, 128, 0.9);
  outline: none;
}

.level-card__title,
.level-card__subtitle,
.level-card__meta {
  display: block;
}

.level-card__title {
  font-size: 1.5rem;
  font-weight: 800;
}

.level-card__subtitle {
  margin-top: 2px;
  color: #fff391;
}

.level-card__meta {
  margin-top: 12px;
  color: #ffe9c4;
  font-size: 0.92rem;
}

@media (max-width: 900px) {
  .hud {
    padding: 20px 18px;
  }

  .time-panel {
    width: min(110px, 20vw);
    top: 18px;
  }

  .minimap-frame {
    width: min(180px, 28vw);
    padding: 14px;
  }
}

@media (max-width: 700px) {
  .hud {
    padding: 14px;
  }

  .score-panel,
  .banana-panel {
    padding: 6px 10px;
    border-width: 3px;
  }

  .score-panel__label {
    display: none;
  }

  .time-panel {
    width: 96px;
    min-height: 78px;
    padding-top: 8px;
  }

  .time-panel__title {
    top: 4px;
  }

  .bottom-left {
    gap: 4px;
  }

  .status {
    max-width: min(56vw, 260px);
    font-size: 0.8rem;
  }

  .minimap-frame {
    width: 138px;
    padding: 10px;
  }
}
