body.frogger-page {
  background: #02070a;
}

body.frogger-page canvas {
  touch-action: none;
}

body.frogger-page #hud {
  background: rgba(0, 10, 14, .9);
  border-bottom-color: #15708a;
}

body.frogger-page #hud span {
  color: #62f0c8;
}

body.frogger-page #hud .lives {
  color: #ffd16a;
  letter-spacing: 1px;
}

body.frogger-page #overlay {
  background:
    radial-gradient(circle at 35% 28%, rgba(0, 110, 130, .2), transparent 36%),
    radial-gradient(circle at 70% 66%, rgba(120, 55, 0, .18), transparent 34%),
    rgba(0, 0, 0, .9);
}

body.frogger-page #overlay h1 {
  color: #5ff0c8;
  text-shadow: 0 0 24px rgba(95, 240, 200, .75);
}

body.frogger-page #overlay .sub {
  color: #9cd8ff;
}

body.frogger-page #overlay .info b {
  color: #5ff0c8;
}

#btnStartMusic {
  position: fixed;
  top: 58px;
  right: 14px;
  z-index: 120;
  background: rgba(0, 16, 18, .82);
  border: 1px solid #245061;
  color: #9cd8ff;
  font-family: 'Courier New', monospace;
  font-size: 10px;
  padding: 5px 9px;
  cursor: pointer;
  letter-spacing: .04em;
  touch-action: manipulation;
}

#btnStartMusic:hover,
#btnStartMusic:active {
  background: #245061;
  color: #eaffff;
}

#btnStartMusic.off {
  border-color: #1a2a2f;
  color: #45636f;
}

#btnStartMusic.needs-gesture {
  border-color: #50d6b0;
  color: #d6fff4;
  box-shadow: 0 0 16px rgba(80, 214, 176, .28);
}

#lyricRain {
  position: fixed;
  top: 44px;
  right: 0;
  bottom: 0;
  width: min(34vw, 390px);
  z-index: 108;
  overflow: hidden;
  pointer-events: none;
  mask-image: linear-gradient(to bottom, transparent 0, #000 9%, #000 86%, transparent 100%);
}

.nuclear-lyric-chip {
  position: absolute;
  top: -96px;
  left: var(--left, 18px);
  max-width: min(310px, calc(100% - 30px));
  padding: 7px 10px 8px 28px;
  border: 1px solid rgba(80, 214, 176, .58);
  border-left: 3px solid rgba(80, 214, 176, .9);
  background: linear-gradient(90deg, rgba(0, 18, 14, .95), rgba(0, 36, 40, .7));
  color: #baffea;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  line-height: 1.35;
  box-shadow: 0 0 18px rgba(80, 214, 176, .25), inset 0 0 16px rgba(80, 214, 176, .08);
  text-shadow: 0 0 9px rgba(80, 214, 176, .7);
  animation: nuclearLyricFall var(--dur, 9s) linear forwards;
  transform: translateY(-96px) rotate(var(--rot, -2deg));
  will-change: transform, opacity;
}

.nuclear-lyric-chip::before {
  content: "☢";
  position: absolute;
  left: 8px;
  top: 7px;
  color: #50d6b0;
  font-size: 13px;
  text-shadow: 0 0 10px rgba(80, 214, 176, .9);
}

.nuclear-lyric-chip::after {
  content: attr(data-label);
  display: block;
  margin-top: 4px;
  color: rgba(156, 216, 255, .58);
  font-size: 8px;
  letter-spacing: .12em;
}

.nuclear-lyric-chip.section {
  border-color: rgba(255, 209, 106, .62);
  border-left-color: #ffd16a;
  color: #ffe6a6;
  text-transform: uppercase;
}

.nuclear-lyric-chip.section::before {
  content: "⚛";
  color: #ffd16a;
}

@keyframes nuclearLyricFall {
  0% {
    opacity: 0;
    transform: translateY(-96px) rotate(var(--rot, -2deg));
  }
  8%, 82% {
    opacity: .95;
  }
  100% {
    opacity: 0;
    transform: translateY(calc(100vh + 130px)) rotate(var(--rot-end, 4deg));
  }
}

body.frogger-page .gbtn {
  border-color: #50d6b0;
  color: #50d6b0;
}

body.frogger-page .gbtn:hover {
  background: #50d6b0;
  color: #00120f;
}

body.frogger-page .gbtn.sec {
  border-color: #245061;
  color: #79a8b8;
}

body.frogger-page .gbtn.sec:hover {
  background: #245061;
  color: #eaffff;
}

body.frogger-page #btnMobileFS {
  border-color: #15708a;
  color: #7ecbff;
  background: rgba(0, 12, 18, .78);
}

body.frogger-page #btnMobileFS:hover,
body.frogger-page #btnMobileFS:active {
  background: #7ecbff;
  color: #001018;
}

body.frogger-page #mobileFSTip {
  border-color: #15708a;
  color: #b8ecff;
  background: rgba(0, 14, 20, .94);
}

#froggerPad {
  position: fixed;
  left: 12px;
  bottom: 14px;
  z-index: 152;
  display: none;
  grid-template-columns: repeat(3, 42px);
  grid-template-rows: repeat(3, 42px);
  gap: 5px;
  padding: 7px;
  border: 1px solid rgba(80, 214, 176, .35);
  background: rgba(0, 12, 14, .62);
  box-shadow: 0 0 18px rgba(80, 214, 176, .16);
  touch-action: none;
}

.frogger-pad-btn,
.frogger-pad-center {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(80, 214, 176, .52);
  background: rgba(0, 24, 22, .82);
  color: #85ffe1;
  font-family: 'Courier New', monospace;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  touch-action: manipulation;
}

.frogger-pad-btn:active,
.frogger-pad-btn.pressed {
  background: #50d6b0;
  color: #00120f;
  box-shadow: 0 0 18px rgba(80, 214, 176, .62);
}

.frogger-pad-center {
  border-color: rgba(255, 209, 106, .34);
  color: rgba(255, 209, 106, .7);
  background: rgba(28, 22, 4, .56);
}

.frogger-pad-btn.up { grid-column: 2; grid-row: 1; }
.frogger-pad-btn.left { grid-column: 1; grid-row: 2; }
.frogger-pad-center { grid-column: 2; grid-row: 2; }
.frogger-pad-btn.right { grid-column: 3; grid-row: 2; }
.frogger-pad-btn.down { grid-column: 2; grid-row: 3; }

body.frogger-playing #froggerPad {
  display: none;
}

@media (max-width: 720px), (pointer: coarse) {
  body.frogger-page #hud {
    font-size: 10px;
  }

  body.frogger-page #hud > div:nth-child(2) {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.frogger-page #overlay h1 {
    font-size: 2rem;
  }

  body.frogger-page #overlay .info {
    font-size: .76rem;
    line-height: 1.9;
    padding: 0 12px;
  }

  #btnStartMusic {
    top: 50px;
    right: 8px;
    font-size: 9px;
    padding: 4px 7px;
  }

  #lyricRain {
    top: 44px;
    width: min(48vw, 210px);
    opacity: .72;
  }

  .nuclear-lyric-chip {
    max-width: calc(100% - 18px);
    padding: 6px 8px 7px 24px;
    font-size: 9px;
  }

  body.frogger-playing #froggerPad {
    display: grid;
  }

  #froggerPad {
    left: max(8px, env(safe-area-inset-left));
    bottom: max(12px, env(safe-area-inset-bottom));
    grid-template-columns: repeat(3, 38px);
    grid-template-rows: repeat(3, 38px);
    gap: 4px;
    padding: 6px;
  }

  .frogger-pad-btn,
  .frogger-pad-center {
    width: 38px;
    height: 38px;
    font-size: 15px;
  }
}
