:root {
  color-scheme: dark;
  --bg: #16120f;
  --panel: #251c17;
  --panel-2: #32261d;
  --gold: #f4b739;
  --text: #fff7e8;
  --muted: #d7c2a4;
  --line: rgba(255, 255, 255, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  display: grid;
  place-items: center;
  padding: 18px;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 22% 18%, rgba(67, 136, 175, 0.24), transparent 27%),
    radial-gradient(circle at 78% 20%, rgba(214, 132, 44, 0.18), transparent 25%),
    linear-gradient(145deg, #101a1f 0%, #17110e 54%, #24140f 100%);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

button {
  border: 0;
  color: #28180b;
  background: linear-gradient(180deg, #ffe38b, var(--gold));
  box-shadow: 0 5px 0 #9e6717, 0 10px 24px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

button:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #9e6717, 0 7px 18px rgba(0, 0, 0, 0.24);
}

.game-shell {
  width: min(100%, 1040px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 12px;
}

h1 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 3rem);
  line-height: 1;
  letter-spacing: 0;
}

p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: clamp(0.95rem, 2vw, 1.05rem);
}

.stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.stats span {
  min-width: 106px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(24, 18, 14, 0.72);
  text-align: center;
  color: var(--muted);
}

.stats strong {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-size: 1.45rem;
}

.stage-wrap {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.38);
}

canvas {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  background: #1f1714;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(circle at 50% 34%, rgba(244, 183, 57, 0.2), transparent 28%),
    rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(2px);
}

.overlay.hidden {
  display: none;
}

.menu {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(88%, 340px);
  max-height: calc(100% - 24px);
  padding: 18px 18px 20px;
  border: 1px solid rgba(255, 232, 165, 0.26);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(49, 37, 28, 0.96), rgba(20, 14, 11, 0.96));
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.42);
  text-align: center;
}

.menu-badge {
  padding: 6px 10px;
  border: 1px solid rgba(244, 183, 57, 0.34);
  border-radius: 999px;
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h2 {
  margin: 0;
  font-size: clamp(1.15rem, 3.6vw, 1.6rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.menu-items {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
}

.menu-items img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.25));
}

.diamond-icon,
.coin-icon,
.eagle-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.25));
}

.diamond-icon {
  transform: rotate(45deg);
  border: 3px solid #d7fbff;
  background: #77d8ff;
}

.coin-icon {
  border: 3px solid #fff2a8;
  border-radius: 50%;
  background: #f7c348;
  color: #9b6414;
  font-size: 1.4rem;
  font-weight: 900;
}

.eagle-icon {
  position: relative;
}

.eagle-icon::before {
  content: "";
  width: 42px;
  height: 28px;
  border: 2px solid #f3d29a;
  border-radius: 50% 50% 42% 42%;
  background: #86512b;
  transform: skewX(-8deg);
}

.eagle-icon::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #f4f0de;
}

.volume-control {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 800;
}

.volume-control input {
  width: 100%;
  accent-color: var(--gold);
  cursor: pointer;
}

.volume-control strong {
  min-width: 42px;
  color: var(--text);
  text-align: right;
}

#startButton {
  min-width: 150px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 8px;
  font-size: 1.05rem;
}

@media (max-width: 680px) {
  body {
    padding: 10px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .stats {
    width: 100%;
    justify-content: stretch;
  }

  .stats span {
    flex: 1;
  }

  .menu {
    gap: 10px;
    padding: 14px 14px 16px;
  }

  .volume-control {
    grid-template-columns: 1fr auto;
  }

  .volume-control input {
    grid-column: 1 / -1;
  }
}
