:root {
  --glass: rgba(20, 34, 26, .62);
  --line: rgba(220, 255, 225, .16);
  --fg: #eef6ea;
  --mut: #b3c8b0;
  --acc: #9be08a;
  --acc-fg: #10200f;
  --track: rgba(220, 255, 225, .2)
}

* {
  box-sizing: border-box
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #16241c;
  color: var(--fg);
  font-family: ui-rounded, "Avenir Next", "Nunito", "Segoe UI", system-ui, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none
}

canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: crosshair
}

.title {
  position: fixed;
  left: calc(env(safe-area-inset-left, 0px) + 18px);
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  pointer-events: none;
  text-shadow: 0 2px 12px rgba(0, 30, 10, .55)
}

.title h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.01em;
  color: #fff
}

.title p {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: #fff;
  opacity: .9;
  max-width: 34ch
}

#fps {
  position: fixed;
  right: calc(env(safe-area-inset-right, 0px) + 14px);
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  font-size: 12px;
  color: #fff;
  opacity: .85;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .6);
  font-variant-numeric: tabular-nums;
  pointer-events: none
}

#stats {
  display: none;
  position: fixed;
  right: calc(env(safe-area-inset-right, 0px) + 14px);
  top: calc(env(safe-area-inset-top, 0px) + 36px);
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 9px 12px;
  font-size: 11.5px;
  color: var(--mut);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: none;
  min-width: 220px
}

#stats div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  line-height: 1.55
}

#stats b {
  color: var(--fg);
  font-weight: 650;
  text-align: right;
  font-variant-numeric: tabular-nums
}

#panel {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  width: min(880px, calc(100% - 20px));
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 11px 14px;
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px 18px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, .3)
}

.ctl label {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--mut);
  margin-bottom: 1px;
  font-weight: 650
}

.ctl label span {
  color: var(--fg);
  font-variant-numeric: tabular-nums
}

input[type=range] {
  width: 100%;
  height: 22px;
  margin: 0;
  accent-color: var(--acc);
  touch-action: pan-x
}

.row {
  grid-column: 1/-1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between
}

.group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center
}

select,
button {
  font: inherit;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--fg);
  background: rgba(255, 255, 255, .08);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 13px;
  min-height: 34px;
  cursor: pointer
}

select option {
  color: #222
}

button:hover,
select:hover {
  background: rgba(255, 255, 255, .15)
}

button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 3px solid var(--acc);
  outline-offset: 2px
}

button[aria-pressed=true] {
  background: rgba(155, 224, 138, .25);
  border-color: rgba(155, 224, 138, .6)
}

button.go {
  background: var(--acc);
  color: var(--acc-fg);
  border-color: transparent
}

#toggle {
  display: none
}

#msg {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  text-align: center;
  background: #16241c;
  z-index: 9
}

#msg div {
  max-width: 44ch;
  line-height: 1.5
}

@media (max-width:720px) {
  #panel {
    grid-template-columns: 1fr 1fr;
    padding: 9px 12px
  }

  #panel.closed .ctl {
    display: none
  }

  #toggle {
    display: inline-block
  }

  .title p {
    display: none
  }
}

@media (prefers-reduced-motion:reduce) {
  * {
    transition: none !important
  }
}

/* ---- HUNGRY FROG ---- */
body[data-mode=menu] #panel,
body[data-mode=menu] .title,
body[data-mode=game] #panel,
body[data-mode=game] .title,
body[data-mode=menu] #modeBtn,
body[data-mode=game] #modeBtn {
  display: none !important
}

body:not([data-mode=game]) #hud {
  display: none
}

#modeBtn {
  position: fixed;
  left: calc(env(safe-area-inset-left, 0px) + 14px);
  top: calc(env(safe-area-inset-top, 0px) + 78px);
  background: var(--acc);
  color: var(--acc-fg);
  border-color: transparent;
  font-size: 14px
}

.ov {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  z-index: 5;
  pointer-events: none
}

.ov .card {
  pointer-events: auto
}

#menu {
  display: flex;
  background: radial-gradient(ellipse at 50% 45%, rgba(10, 30, 15, .05), rgba(8, 24, 14, .55))
}

.logo {
  font-size: clamp(46px, 9vw, 92px);
  font-weight: 900;
  letter-spacing: .01em;
  color: #fff;
  line-height: .95;
  margin: 0;
  text-shadow: 0 4px 0 #2d7a2a, 0 8px 28px rgba(0, 30, 10, .6);
  font-family: ui-rounded, "Arial Rounded MT Bold", "Nunito", "Avenir Next", system-ui, sans-serif
}

.sub {
  margin: 10px 0 22px;
  font-size: clamp(14px, 2.2vw, 19px);
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 30, 10, .7);
  font-weight: 650
}

.big {
  font: inherit;
  font-weight: 900;
  font-size: clamp(22px, 4vw, 32px);
  letter-spacing: .06em;
  padding: 14px 56px;
  border-radius: 999px;
  background: linear-gradient(#b8f08a, #7fd35f);
  color: #14310f;
  border: 0;
  box-shadow: 0 6px 0 #3f8f3a, 0 14px 30px rgba(0, 30, 10, .45);
  cursor: pointer;
  transition: transform .08s
}

.big:hover {
  transform: translateY(-2px)
}

.big:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #3f8f3a
}

.how {
  margin-top: 20px;
  font-size: 13px;
  letter-spacing: .18em;
  color: #fff;
  opacity: .92;
  text-shadow: 0 2px 8px rgba(0, 30, 10, .8);
  font-weight: 700
}

.sec {
  font: inherit;
  font-weight: 750;
  font-size: 14px;
  margin-top: 14px;
  padding: 9px 22px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .35);
  color: #fff
}

#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  font-family: ui-rounded, "Nunito", "Avenir Next", system-ui, sans-serif;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 25, 10, .65)
}

.hud-top {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0 16px
}

.hud-top .lbl {
  display: block;
  font-size: 10.5px;
  letter-spacing: .2em;
  opacity: .85;
  font-weight: 800
}

.hud-top b {
  font-size: clamp(22px, 4vw, 34px);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1.05
}

.hud-center {
  text-align: center;
  position: absolute;
  left: 50%;
  transform: translateX(-50%)
}

.hud-center b {
  font-size: clamp(30px, 6vw, 48px)
}

#hCombo {
  font-size: 13px;
  font-weight: 850;
  letter-spacing: .12em;
  margin-top: 1px
}

#hud.hot #hCombo {
  color: #ffe26a
}

#comboBar {
  width: 120px;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .22);
  margin: 5px auto 0;
  overflow: hidden
}

#comboBar i {
  display: block;
  height: 100%;
  background: #ffe26a;
  transform-origin: left;
  transform: scaleX(0);
  transition: transform .08s linear
}

.hud-right {
  text-align: right;
  margin-top: 16px;
  opacity: .95
}

.hud-left {
  margin-top: 0
}

#hTimeBox.low b {
  color: #ff9d8a;
  animation: pulse .5s infinite alternate
}

@keyframes pulse {
  to {
    transform: scale(1.15)
  }
}

.hud-bottom {
  position: absolute;
  left: calc(env(safe-area-inset-left, 0px) + 14px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
  display: flex;
  gap: 8px;
  pointer-events: auto
}

.hud-bottom button {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  font-size: 16px;
  background: rgba(20, 34, 26, .5)
}

#banner {
  position: fixed;
  left: 0;
  right: 0;
  top: 34%;
  text-align: center;
  font-weight: 900;
  font-size: clamp(46px, 11vw, 110px);
  color: #fff;
  letter-spacing: .03em;
  text-shadow: 0 5px 0 #2d7a2a, 0 10px 30px rgba(0, 30, 10, .6);
  pointer-events: none;
  opacity: 0;
  z-index: 4;
  font-family: ui-rounded, "Arial Rounded MT Bold", "Nunito", system-ui, sans-serif
}

#banner.on {
  animation: ban var(--d, 1s) ease-out forwards
}

@keyframes ban {
  0% {
    opacity: 0;
    transform: scale(.5)
  }

  15% {
    opacity: 1;
    transform: scale(1.08)
  }

  30% {
    transform: scale(1)
  }

  80% {
    opacity: 1
  }

  100% {
    opacity: 0;
    transform: scale(1.15)
  }
}

#comboMsg {
  position: fixed;
  left: 0;
  right: 0;
  top: 19%;
  text-align: center;
  font-weight: 900;
  font-size: clamp(24px, 5vw, 40px);
  color: #ffe26a;
  text-shadow: 0 3px 0 #8a5a00, 0 6px 18px rgba(0, 0, 0, .45);
  pointer-events: none;
  opacity: 0;
  z-index: 4;
  font-family: ui-rounded, "Arial Rounded MT Bold", "Nunito", system-ui, sans-serif
}

#comboMsg.on {
  animation: cm 1.1s ease-out forwards
}

@keyframes cm {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(.6)
  }

  20% {
    opacity: 1;
    transform: translateY(0) scale(1.1)
  }

  35% {
    transform: scale(1)
  }

  85% {
    opacity: 1
  }

  100% {
    opacity: 0;
    transform: translateY(-14px)
  }
}

#hint {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 22%;
  text-align: center;
  font-weight: 800;
  font-size: clamp(18px, 3.2vw, 26px);
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 25, 10, .8);
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s;
  z-index: 4
}

#hint.on {
  opacity: 1
}

#pops {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  overflow: hidden
}

.pop {
  position: absolute;
  transform: translate(-50%, -50%);
  font-weight: 900;
  font-size: 26px;
  color: #fff;
  text-shadow: 0 2px 0 #2d7a2a, 0 4px 12px rgba(0, 0, 0, .4);
  animation: pop .95s ease-out forwards;
  font-family: ui-rounded, "Nunito", system-ui, sans-serif
}

.pop.big {
  font-size: 36px;
  color: #ffe26a;
  text-shadow: 0 2px 0 #8a5a00, 0 4px 14px rgba(0, 0, 0, .4)
}

@keyframes pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -30%) scale(.5)
  }

  15% {
    opacity: 1;
    transform: translate(-50%, -70%) scale(1.15)
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -190%) scale(1)
  }
}

#over,
#pauseOv {
  background: rgba(8, 24, 14, .38);
  z-index: 6
}

#over h2,
#pauseOv h2 {
  margin: 0 0 6px;
  font-size: clamp(30px, 6vw, 56px);
  font-weight: 900;
  color: #fff;
  text-shadow: 0 3px 0 #2d7a2a, 0 8px 24px rgba(0, 30, 10, .6)
}

.stats3 {
  display: flex;
  gap: 26px;
  margin: 14px 0 20px;
  justify-content: center
}

.stats3 div {
  font-size: 11px;
  letter-spacing: .18em;
  color: #d8f0d0;
  font-weight: 800
}

.stats3 b {
  display: block;
  font-size: clamp(28px, 5vw, 44px);
  color: #fff;
  letter-spacing: 0;
  line-height: 1.1
}

#rNew {
  display: none;
  color: #ffe26a;
  font-weight: 900;
  letter-spacing: .14em;
  font-size: 13px;
  margin-bottom: 4px
}

#pauseOv .card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center
}

#pauseOv .big {
  font-size: 20px;
  padding: 10px 44px
}

#over .card,
#menu .card {
  display: flex;
  flex-direction: column;
  align-items: center
}

#msg {
  z-index: 20
}

.camctl {
  position: absolute;
  right: calc(env(safe-area-inset-right, 0px) + 14px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
  display: flex;
  gap: 8px;
  align-items: center;
  pointer-events: auto;
  background: rgba(20, 34, 26, .55);
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 18px;
  padding: 8px 10px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px)
}

.camctl .cclabel {
  font-size: 10.5px;
  letter-spacing: .2em;
  font-weight: 900;
  color: #fff;
  opacity: .9;
  margin-right: 2px
}

.camctl button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  width: 46px;
  height: 50px;
  padding: 3px 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .35);
  color: #fff;
  cursor: pointer;
  touch-action: none;
  font: inherit
}

.camctl button kbd {
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  background: #fff;
  color: #14310f;
  border-radius: 6px;
  padding: 0 7px;
  line-height: 1.35;
  box-shadow: 0 2px 0 #9bd88a
}

.camctl button i {
  font-style: normal;
  font-size: 16px;
  line-height: 1
}

.camctl button:hover {
  background: rgba(255, 255, 255, .26)
}

.camctl button.down {
  background: var(--acc);
  color: #14310f;
  transform: translateY(2px)
}

@media (max-width:720px) {
  .camctl .cclabel {
    display: none
  }

  .camctl button {
    width: 42px;
    height: 46px
  }
}

.keys {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
  display: flex;
  gap: 14px;
  align-items: center;
  background: rgba(20, 34, 26, .55);
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 18px;
  padding: 8px 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px)
}

.kgrp {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
  color: #fff
}

.kgrp small {
  font-weight: 600;
  opacity: .8;
  font-size: 10.5px
}

.kcol {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px
}

.krow {
  display: flex;
  gap: 3px
}

.keys kbd {
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  min-width: 28px;
  text-align: center;
  background: #fff;
  color: #14310f;
  border-radius: 7px;
  padding: 3px 6px;
  box-shadow: 0 3px 0 #9bd88a;
  transition: transform .05s
}

.keys kbd.wide {
  padding: 3px 12px
}

.keys kbd.down {
  background: var(--acc);
  transform: translateY(3px);
  box-shadow: 0 0 0 #9bd88a
}

@media (hover:none),
(max-width:980px) {
  .keys {
    display: none
  }
}

/* ---- Phones / tablets: message only, the game is not loaded ---- */
#mobileMsg {
  display: none
}

html.is-mobile body {
  background: radial-gradient(ellipse at 50% 30%, #2d6a3a, #10241a 70%);
  overflow: auto;
  touch-action: auto;
  -webkit-user-select: auto;
  user-select: auto
}

html.is-mobile body>*:not(#mobileMsg):not(script) {
  display: none !important
}

html.is-mobile #mobileMsg {
  display: flex;
  position: fixed;
  inset: 0;
  align-items: center;
  justify-content: center;
  padding: 28px;
  text-align: center;
  z-index: 50
}

.mm-card {
  max-width: 420px;
  color: #fff;
  font-family: ui-rounded, "Nunito", "Avenir Next", system-ui, sans-serif
}

.mm-frog {
  font-size: 64px;
  line-height: 1;
  margin-bottom: 10px
}

.mm-card h1 {
  margin: 0 0 14px;
  font-size: clamp(34px, 10vw, 52px);
  font-weight: 900;
  letter-spacing: .02em;
  text-shadow: 0 3px 0 #2d7a2a, 0 8px 24px rgba(0, 30, 10, .5)
}

.mm-card p {
  margin: 6px 0;
  font-size: 16px;
  line-height: 1.5;
  opacity: .9
}

.mm-card .mm-big {
  margin-top: 16px;
  font-size: 20px;
  font-weight: 800;
  opacity: 1;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 18px;
  padding: 14px 18px
}