:root {
  color: #ffffff;
  background: #05060a;
  font-family: Arial, Helvetica, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  min-height: 100%;
  padding: 12px;
  background: #130806;
}

body.is-boosting {
  background: #180a06;
}

.game-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  width: 100%;
  height: calc(100dvh - 24px);
  overflow: hidden;
  background:
    linear-gradient(rgba(3, 5, 8, 0.42), rgba(3, 5, 8, 0.56)),
    url("../assets/dark-rock-background.png") center / 620px 620px repeat,
    #05060a;
  border: 2px solid rgba(255, 214, 133, 0.42);
  border-radius: 8px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.42);
}

body.is-boosting .game-shell {
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 116, 35, 0.14), transparent 44%),
    linear-gradient(rgba(3, 5, 8, 0.28), rgba(3, 5, 8, 0.46)),
    url("../assets/dark-rock-background.png") center / 620px 620px repeat,
    #070912;
}

.game-stage {
  position: relative;
  min-width: 0;
  min-height: 360px;
  overflow: hidden;
  background:
    linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.22)),
    rgba(2, 5, 7, 0.54);
  border-right: 2px solid rgba(255, 214, 133, 0.42);
  box-shadow:
    inset 0 0 38px rgba(0, 0, 0, 0.56);
}

canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  cursor: default;
  touch-action: none;
}

button {
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.play-snake-game-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  min-width: min(310px, calc(100vw - 48px));
  min-height: 78px;
  padding: 0 32px;
  overflow: hidden;
  color: #fff7dc;
  background:
    linear-gradient(180deg, rgba(255, 116, 35, 0.92), rgba(104, 42, 12, 0.95)),
    #6b2e12;
  border: 2px solid rgba(255, 214, 133, 0.78);
  border-radius: 8px;
  box-shadow:
    0 0 0 4px rgba(0, 0, 0, 0.32),
    0 20px 55px rgba(0, 0, 0, 0.62),
    0 0 34px rgba(255, 116, 35, 0.44);
  font-size: clamp(1.35rem, 4vw, 2rem);
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.58);
  transition:
    top 180ms ease,
    left 180ms ease,
    min-width 180ms ease,
    min-height 180ms ease,
    padding 180ms ease,
    transform 180ms ease,
    box-shadow 160ms ease,
    background 160ms ease,
    font-size 180ms ease;
}

.play-snake-game-btn::before {
  content: "";
  position: absolute;
  inset: 5px;
  pointer-events: none;
  border: 1px solid rgba(255, 240, 190, 0.38);
  border-radius: 5px;
}

.play-snake-game-btn:hover {
  background:
    linear-gradient(180deg, rgba(255, 141, 51, 0.96), rgba(126, 51, 12, 0.98)),
    #7a3510;
  box-shadow:
    0 0 0 4px rgba(0, 0, 0, 0.32),
    0 24px 62px rgba(0, 0, 0, 0.66),
    0 0 42px rgba(255, 116, 35, 0.6);
}

.play-snake-game-btn:active {
  transform: translate(-50%, -48%);
}

.snake-game-panel .play-snake-game-btn {
  position: relative;
  top: auto;
  left: auto;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  margin: 0 0 22px;
  padding: 0 18px;
  transform: none;
  font-size: 1rem;
  background:
    linear-gradient(180deg, rgba(41, 56, 53, 0.94), rgba(18, 24, 23, 0.96)),
    #1d2826;
  border-color: rgba(255, 255, 255, 0.34);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.36);
}

.snake-game-panel .play-snake-game-btn:active {
  transform: translateY(1px);
}

.game-title {
  margin: 0 0 22px;
  color: #fff7dc;
  font-size: 1.55rem;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.58);
}

.score,
.high-score {
  margin: 0;
  color: white;
  font-size: 1.1rem;
}

#score {
  padding: 8px 10px;
  border: 2px black dotted;
  background: green;
}

#high-score {
  padding: 8px 10px;
  border: 2px black dotted;
  background: rgb(67, 66, 66);
}

.snake-game-panel {
  position: relative;
  min-width: 0;
  padding: 18px;
  z-index: 3;
  background:
    linear-gradient(180deg, rgba(43, 33, 25, 0.92), rgba(12, 15, 15, 0.95)),
    rgba(20, 18, 15, 0.92);
  border: 2px solid rgba(255, 214, 133, 0.38);
  border-width: 0 0 0 2px;
  border-radius: 0;
  box-shadow:
    inset 0 0 24px rgba(0, 0, 0, 0.36),
    0 18px 42px rgba(0, 0, 0, 0.34);
}

.game-feild {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.high-score-feild {
  display: flex;
  margin-top: 26px;
}

.boost-label {
  margin-top: 26px;
  color: rgba(255, 247, 220, 0.86);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.boost-meter {
  width: 100%;
  height: 14px;
  margin-top: 10px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 999px;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.36);
}

.boost-meter-fill {
  width: 100%;
  height: 100%;
  background: rgb(67, 190, 255);
  border-radius: inherit;
  transition: width 80ms linear, background 160ms ease, box-shadow 160ms ease;
}

.boost-meter-fill.ready {
  background: rgb(35, 217, 91);
  box-shadow: 0 0 12px rgba(35, 217, 91, 0.56);
}

.boost-meter-fill.active {
  background: rgb(255, 116, 35);
  box-shadow: 0 0 14px rgba(255, 116, 35, 0.72);
}

.boost-meter-fill.cooldown {
  background: rgb(67, 190, 255);
  box-shadow: 0 0 12px rgba(67, 190, 255, 0.52);
}

.game-note {
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.86rem;
  line-height: 1.35;
}

@media (max-width: 820px) {
  body {
    padding: 8px;
  }

  .game-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    height: calc(100dvh - 16px);
  }

  .game-stage {
    border-right: 0;
    border-bottom: 2px solid rgba(255, 214, 133, 0.42);
  }

  .snake-game-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 12px;
    border-width: 2px 0 0;
  }

  .game-title,
  .game-note {
    grid-column: 1 / -1;
  }

  .snake-game-panel .play-snake-game-btn,
  .boost-label,
  .boost-meter {
    grid-column: 1 / -1;
  }

  .high-score-feild,
  .boost-label,
  .game-note {
    margin-top: 0;
  }

  .game-note {
    font-size: 0.78rem;
  }
}
