:root {
  color: #f8fafc;
  background: #151827;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
}

#app {
  display: grid;
  place-items: center;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 182, 193, 0.18), rgba(40, 42, 72, 0.72)),
    #151827;
}

#game-shell {
  position: relative;
  width: min(100vw - 32px, 1280px);
  aspect-ratio: 16 / 9;
  max-height: calc(100vh - 32px);
  overflow: hidden;
  border: 4px solid #32243e;
  background: #86c4e8;
  image-rendering: pixelated;
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.hud {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 4;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  pointer-events: none;
}

.score-panel {
  min-width: 178px;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 8px 9px;
  border: 3px solid #ffe2ad;
  background:
    linear-gradient(180deg, rgba(111, 46, 68, 0.92), rgba(48, 26, 54, 0.9)),
    #4c2443;
  box-shadow:
    0 4px 0 rgba(52, 25, 48, 0.78),
    inset 0 0 0 2px rgba(255, 138, 171, 0.3);
}

.score-emblem {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 2px solid #fff2c9;
  background:
    radial-gradient(circle at 45% 42%, #fff4a5 0 18%, #ffb1c8 19% 47%, #cc3d66 48% 100%);
  color: #fff7fb;
  font-size: 20px;
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 1px 0 #8a2338;
}

.score-copy {
  display: grid;
  gap: 1px;
}

.score-copy span {
  color: #ffdce8;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 1px 0 #24172a;
}

.score-copy strong {
  color: #fff7c7;
  font-size: 28px;
  font-weight: 950;
  line-height: 1;
  text-shadow:
    0 2px 0 #8a2338,
    2px 0 0 rgba(36, 23, 42, 0.65);
}

.hud-mini {
  display: flex;
  gap: 6px;
}

.hud-pill {
  min-width: 74px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 9px;
  border: 2px solid rgba(255, 226, 173, 0.78);
  background: rgba(34, 24, 52, 0.82);
  box-shadow: 0 3px 0 rgba(36, 23, 42, 0.58);
  text-shadow: 0 1px 0 #24172a;
}

.hud-pill span {
  color: #ffdce8;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.hud-pill strong {
  font-size: 16px;
  line-height: 1;
}

.menu,
.result {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(21, 24, 39, 0.16), rgba(21, 24, 39, 0.62)),
    rgba(15, 17, 30, 0.18);
}

.menu-content,
.result-content {
  width: min(520px, 100%);
  text-align: center;
  text-shadow: 0 2px 0 #2a1931;
}

.menu-kicker {
  margin: 0 0 6px;
  color: #ffe3ef;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: #fff7fb;
  font-size: clamp(42px, 9vw, 82px);
  line-height: 0.95;
}

.menu-copy {
  margin: 16px auto 22px;
  max-width: 430px;
  color: #fff3f8;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
}

button {
  min-width: 160px;
  height: 48px;
  border: 0;
  border-bottom: 5px solid #8a3050;
  background: #ff7aa8;
  color: #33172a;
  cursor: pointer;
  font: inherit;
  font-size: 18px;
  font-weight: 900;
}

button:hover {
  background: #ff96ba;
}

button:active {
  transform: translateY(3px);
  border-bottom-width: 2px;
}

.result {
  background: rgba(21, 24, 39, 0.55);
}

.result-content p {
  margin: 0 0 10px;
  color: #fff7fb;
  font-size: clamp(34px, 7vw, 66px);
  font-weight: 950;
}

.result-content strong {
  display: block;
  margin-bottom: 22px;
  color: #ffe3ef;
  font-size: 24px;
}

.is-hidden {
  display: none;
}

@media (max-width: 720px) {
  #app {
    padding: 0;
  }

  #game-shell {
    width: 100vw;
    max-height: 100vh;
    border: 0;
  }

  .hud {
    top: 6px;
    left: 6px;
    right: auto;
    gap: 5px;
    transform: scale(0.84);
    transform-origin: top left;
  }

  .score-panel {
    min-width: 150px;
    height: 50px;
    padding: 6px 10px 7px 7px;
  }

  .score-emblem {
    width: 32px;
    height: 32px;
    font-size: 17px;
  }

  .score-copy strong {
    font-size: 23px;
  }

  .hud-mini {
    flex-direction: column;
    gap: 4px;
  }

  .hud-pill {
    min-width: 0;
    width: 84px;
    height: 27px;
    flex: none;
    gap: 5px;
    padding: 0 7px;
  }

  .hud-pill span {
    font-size: 10px;
  }

  .hud-pill strong {
    font-size: 13px;
  }

  .menu-copy {
    font-size: 16px;
  }
}
