:root {
  --game-size: 472px;
  --game-center-size: 220px;
  --push-size: 210px;
  --bg-color: #ffe6ff;
  --panel-bg: #cdd0d7;
  --inner-margin: 25px;
}

@import url("https://fonts.googleapis.com/css?family=Alfa+Slab+One|Squada+One|VT323|Oswald");

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-color);
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh; /* Use dynamic viewport height for modern mobile browsers */
  font-family: "Oswald", sans-serif;
  overflow: hidden; /* Prevent scrolling on mobile if not needed */
  touch-action: manipulation; /* Disable double-tap to zoom for faster clicks */
}

.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 650px;
  padding: 20px;
  position: relative;
}

.gamebodyouter {
  width: var(--game-size);
  height: var(--game-size);
  border-radius: 100%;
  position: relative;
  text-align: center;
  background-color: var(--panel-bg);
  box-shadow:
    5px 0px 10px -5px #635e61 inset,
    -5px 0px 10px -5px #635e61 inset,
    0px -5px 10px -2px #635e61 inset,
    0px 0px 1px 2px #635e61,
    0px 10px 20px 0px #494547;
  transition: transform 0.3s ease;
}

.gamebodyinner {
  position: relative;
  top: var(--inner-margin);
}

.gamebodycenter {
  width: var(--game-center-size);
  height: var(--game-center-size);
  position: absolute;
  border-radius: 100%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: var(--panel-bg);
  border: 8px solid #333;
  box-shadow:
    5px 0px 10px -5px #635e61 inset,
    -5px 0px 10px -5px #635e61 inset,
    0px -5px 10px -2px #635e61 inset,
    0px 0px 1px 2px #635e61;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.centerbrand {
  position: relative;
  width: 200px;
  height: 110px;
  background-color: #000000;
  border: 2px solid #333;
  border-radius: 200px 200px 0 0;
  z-index: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 10px;
}

.logo {
  width: 35px;
  height: 35px;
  margin-bottom: 2px;
}

.branding {
  font-family: "Squada One", cursive;
  color: #cccccc;
  font-size: 3.2em;
  margin: 0;
  line-height: 1;
}

.branding .small {
  font-family: "Alfa Slab One", cursive;
  font-size: 0.3em;
  color: #cccccc;
  position: relative;
  top: -12px;
  vertical-align: top;
}

.inline {
  display: inline-block;
}

.push {
  position: relative;
  width: var(--push-size);
  height: var(--push-size);
  background-color: grey;
  border: 9px solid #333;
  cursor: pointer;
}

.gamebodyrow {
  margin-bottom: -5px;
}

.gamebodycontrols {
  margin-top: 5px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
}

.topleft {
  border-top-left-radius: 100%;
}
.topright {
  border-top-right-radius: 100%;
}
.bottomright {
  border-bottom-right-radius: 100%;
}
.bottomleft {
  border-bottom-left-radius: 100%;
}

.red {
  background-color: #9f0f17;
  box-shadow: inset -5px -8px 23px 1px rgba(244, 138, 144, 1);
}
.green {
  background-color: #00a74a;
  box-shadow: inset -5px -8px 23px 1px rgba(102, 255, 171, 1);
}
.yellow {
  background-color: #cca707;
  box-shadow: inset -5px -8px 23px 1px #fbe584;
}
.blue {
  background-color: #094a8f;
  box-shadow: inset -5px -8px 23px 1px rgba(135, 189, 247, 1);
}

.yellow.light {
  background-color: #fed93f;
}
.blue.light {
  background-color: #1c8cff;
}
.red.light {
  background-color: #ff4c4c;
}
.green.light {
  background-color: #13ff7c;
}

.clickable {
  pointer-events: auto;
  cursor: pointer;
  touch-action: manipulation;
}

.unclickable {
  pointer-events: none;
}

.instruct {
  width: 100%;
  max-width: 480px;
  min-height: 500px;
  border-radius: 5%;
  position: relative;
  margin: auto;
  padding: 26px 20px;
  background-color: var(--panel-bg);
  box-shadow:
    5px 0px 10px -5px #635e61 inset,
    -5px 0px 10px -5px #635e61 inset,
    0px -5px 10px -2px #635e61 inset,
    0px 0px 1px 2px #635e61,
    0px 10px 20px 0px #494547;
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.instruct p {
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 20px;
}

.brandingbackside {
  font-family: "Squada One", cursive;
  color: grey;
  font-size: 2.2em;
}

.instruct ul {
  text-align: left;
  padding-left: 20px;
  margin: 15px 0;
  max-width: 90%;
}

.instruct ul li {
  color: black;
  font-size: 12px;
  margin-bottom: 5px;
}

.highlight {
  font-family: "Squada One", cursive;
  color: grey;
  font-size: 1.6em;
  border-bottom: 2px solid grey;
  margin-bottom: 10px;
  display: inline-block;
}

#cheatsheet {
  position: fixed;
  bottom: 10px;
  right: 10px;
  color: rgba(0, 0, 0, 0.1);
  font-size: 10px;
}

#cheatsheet:hover {
  color: grey;
}

.iconsmall {
  width: 20px;
  height: 20px;
  border: 1px solid #444;
  border-radius: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 5px auto;
}

.iconback {
  width: 60px;
  height: 60px;
  font-size: 40px;
  border-top: 2px solid #00a74a;
  border-right: 2px solid #9f0f17;
  border-bottom: 2px solid #094a8f;
  border-left: 2px solid #cca707;
  border-radius: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
}

.round-btn {
  width: 20px;
  height: 20px;
  background-color: yellow;
  border-radius: 100%;
  border: 4px solid #444;
  box-shadow: 0px 2px 3px #222;
  margin: 0 auto;
}

.round-btn:active {
  box-shadow: 0 1px 1px #292929;
  transform: translateY(1px);
}

.count {
  font-family: "VT323", monospace;
  color: #dc0d29;
  font-size: 2em;
  width: 50px;
  background-color: #32050c;
  border: 4px solid #222;
  border-radius: 10px;
  margin: 0 auto;
}

.led {
  width: 9px;
  height: 9px;
  background-color: #32050c;
  border-radius: 100%;
  border: 2px solid #222;
  margin: 5px auto;
}

.led-on {
  background-color: #dc0d29;
  box-shadow: 0 0 5px #dc0d29;
}

.led-off {
  color: #430710;
}

.full-red {
  background-color: #fc0102;
}

.label {
  color: #222;
  font-family: "Oswald", sans-serif;
  font-size: 0.7em;
  font-weight: normal;
  margin: 3px 0;
  text-transform: uppercase;
}

.display,
.btn-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Responsive adjustments for iPhone */
@media screen and (max-width: 500px) {
  .container {
    padding: 10px;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .gamebodyouter {
    transform: scale(0.85);
    transform-origin: center;
    margin-top: -5dvh; /* Offset to counteract the visual weight of the bottom UI bar on iPhone */
  }

  .instruct {
    transform: scale(0.85);
    min-height: auto;
    border-radius: 20px;
    padding: 30px 15px;
  }

  .instruct ul {
    max-width: 100%;
  }
}

@media screen and (max-width: 380px) {
  .gamebodyouter {
    transform: scale(0.75);
    margin-top: -2dvh;
  }
}

@media screen and (max-height: 700px) {
  .gamebodyouter {
    transform: scale(0.75);
    margin-top: -2dvh;
  }
}

/* Animation classes from animate.css (simplified or ensuring availability) */
.animated {
  animation-duration: 0.5s;
  animation-fill-mode: both;
}

@keyframes shake {
  from,
  to {
    transform: translate3d(0, 0, 0);
  }
  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translate3d(-10px, 0, 0);
  }
  20%,
  40%,
  60%,
  80% {
    transform: translate3d(10px, 0, 0);
  }
}

.shake {
  animation-name: shake;
}
