@import url('https://fonts.googleapis.com/css2?family=DotGothic16&display=swap');

html,
body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  touch-action: manipulation;

  background:
    radial-gradient(circle at top,
      #eff7b7 0%,
      #cfe27a 55%,
      #8cab47 100%);

  font-family: monospace;
}

.hidden {
  display: none !important;
}

.screen {
  width: 100vw;
  height: 100vh;
}

/* TITLE */

#titleScreen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 26px;
  box-sizing: border-box;
}

#titleImage {
  width: min(430px, 92vw);
  image-rendering: pixelated;
  user-select: none;
  -webkit-user-drag: none;
}

#guideText {
  margin-top: 26px;
  text-align: center;
  font-family: "DotGothic16", monospace;
  color: #1f3312;
  font-size: 17px;
  line-height: 1.9;
}

button {
  font-family: "DotGothic16", monospace;
  border: 4px solid #1f3312;
  box-shadow: 4px 4px 0 #2d5016;
  touch-action: manipulation;
}

button:active {
  transform: translate(4px, 4px);
  box-shadow: none;
}

#startBtn {
  margin-top: 24px;
  padding: 13px 24px;
  background: #5f9c3c;
  color: #f6ffd8;
  font-size: 22px;
}

/* GAME */

#gameScreen {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

#backTitleBtn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 20;
  padding: 7px 10px;
  background: #f6ffd8;
  color: #1f3312;
  font-size: 13px;
  box-shadow: 3px 3px 0 #2d5016;
}

#hud {
  width: min(430px, 100vw);
  padding: 44px 18px 6px;
  box-sizing: border-box;
  text-align: center;
}

#roundText {
  font-family: "DotGothic16", monospace;
  font-size: 28px;
  color: #1f3312;
  text-shadow: 2px 2px #e6f2b2;
}

#cucumberStage {
  position: relative;
  width: min(72vw, 290px);
  height: min(58vh, 450px);
  margin-top: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
}

#cucumber {
  position: absolute;
  z-index: 1;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

#meterOverlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

#perfectZone {
  position: absolute;
  top: 50%;
  left: -12%;
  width: 124%;
  height: 38px;
  transform: translateY(-50%);
  background: rgba(214, 51, 51, 0.88);
  border-top: 3px solid #1f3312;
  border-bottom: 3px solid #1f3312;
  box-sizing: border-box;

  display: flex;
  align-items: center;
  justify-content: center;

  font-family: "DotGothic16", monospace;
  font-size: 24px;
  color: white;
  letter-spacing: 2px;
  text-shadow: 2px 2px #1f3312;

  animation: pushBlink 0.5s infinite alternate;
}

@keyframes pushBlink {
  from {
    opacity: 0.6;
  }

  to {
    opacity: 1;
  }
}

#cursor {
  position: absolute;
  left: -16%;
  width: 132%;
  height: 12px;
  background: white;
  border: 3px solid #1f3312;
  box-sizing: border-box;
  top: 0;
}

#tapButton {
  margin-top: 16px;
  width: min(84vw, 320px);
  height: 76px;
  background: #c94141;
  color: #fff7d4;
  font-size: 30px;
}

/* RESULT */

#resultScreen {
  overflow-y: auto;
}

#resultInner {
  width: min(420px, 92vw);
  margin: 0 auto;
  padding: 22px 0 36px;
  text-align: center;
}

#resultTitle {
  margin: 0 0 8px;
  font-family: "DotGothic16", monospace;
  font-size: 38px;
  line-height: 1.15;
  color: #1f3312;
  text-shadow: 3px 3px #dceca3;
}

#resultKappa {
  display: block;
  width: min(54vw, 210px);
  image-rendering: pixelated;
  margin: 0 auto;
}

#resultScore {
  font-family: "DotGothic16", monospace;
  font-size: 26px;
  color: #1f3312;
  line-height: 1.35;
  margin: 4px 0 4px;
}

#resultSummary {
  font-family: "DotGothic16", monospace;
  font-size: 17px;
  color: #1f3312;
  line-height: 1.45;
  margin: 0 0 12px;
}

#resultButtons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;

  width: 100%;
  max-width: 360px;
  margin: 8px auto 0;

  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.45s ease;
}

#resultButtons.hidden {
  display: grid !important;
  opacity: 0;
  pointer-events: none;
}

#resultButtons button {
  width: 100%;
  min-height: 56px;
  padding: 8px 6px;
  font-size: 17px;
  line-height: 1.2;
}

#shareBtn {
  background: #111 !important;
  color: #fff !important;
}

#registerScoreBtn {
  background: #fff3a6 !important;
  color: #1f3312 !important;
}

#restartBtn {
  background: #5f9c3c !important;
  color: #f6ffd8 !important;
}

#homeBtn {
  background: #c94141 !important;
  color: #fff7d4 !important;
}