.instructions-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease-in-out;
  padding: 15px;
  box-sizing: border-box;
}
.instructions-container .instructions-content {
  width: 100%;
  max-width: 850px;
  max-height: 100%;
  background: rgba(0, 0, 0, 0.9);
  border: 4px solid #ffff00;
  border-radius: 0;
  padding: 20px;
  text-align: center;
  color: #ffffff;
  box-shadow: 0 4px 0 #ffff00;
  image-rendering: pixelated;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.instructions-container .content-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
}
.instructions-container .content-wrapper h1 {
  color: #ffff00;
  font-size: 2.2em;
  margin: 0 0 15px 0;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  animation: glow 2s ease-in-out infinite alternate;
}
.instructions-container .content-wrapper h2 {
  color: #ff6600;
  font-size: 1.4em;
  margin: 0 0 8px 0;
}
.instructions-container .content-wrapper h3 {
  color: #00ffff;
  font-size: 1em;
  margin: 8px 0 5px 0;
}
.instructions-container .content-wrapper p {
  font-size: 0.95em;
  line-height: 1.3;
  margin: 5px 0;
}

.game-objective,
.game-items,
.levels-info,
.lives-info,
.controls-info {
  margin: 5px 0;
  padding: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 0;
  flex-shrink: 0;
  image-rendering: pixelated;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  width: 100%;
  max-width: 600px;
}

.item-row {
  margin: 8px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.item-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 5px 0;
}

.pickups-grid {
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  flex-wrap: nowrap;
  padding: 0 10px;
}

.pickup-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px dashed rgba(255, 255, 255, 0.3);
  border-radius: 0;
  transition: transform 0.3s ease;
  flex: 1;
  min-width: 0;
  max-width: none;
  image-rendering: pixelated;
}
.pickup-item:hover {
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.6);
}
.pickup-item span {
  font-size: 0.8em;
  font-weight: bold;
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.item-image {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
  filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.5));
}
.item-image.small {
  width: 24px;
  height: 24px;
}

.start-game-button {
  padding: 12px 30px;
  font-size: 1.2em;
  font-weight: bold;
  color: #000;
  cursor: pointer;
  margin-top: 15px;
  transition: all 0.3s ease;
  animation: pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
.start-game-button:hover {
  transform: scale(1.05);
}
.start-game-button:active {
  transform: translateX(2px) translateY(2px);
}

.row.counters.top-counters {
  background: rgba(0, 0, 0, 0.9);
  border: 3px dashed #ffff00;
  border-radius: 0;
  margin: 5px;
  padding: 8px 12px;
  display: flex;
  justify-content: center;
  box-sizing: border-box;
  image-rendering: pixelated;
}

.item-counters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 4px;
}
.item-counters .counter-icon {
  width: 28px;
  height: 28px;
  image-rendering: pixelated;
}
.item-counters .counter-number {
  font-size: 14px;
  font-weight: bold;
  color: #ffff00;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  margin-left: 3px;
  margin-right: 8px;
}
.item-counters .counter-separator {
  width: 1px;
  height: 24px;
  background: #ffff00;
  opacity: 0.4;
  margin: 0 2px;
  flex-shrink: 0;
}

.row.bottom-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 15px;
  margin: 5px;
  background: rgba(0, 0, 0, 0.8);
  border: 3px dashed #ffff00;
  border-radius: 0;
  image-rendering: pixelated;
}
.row.bottom-info .score-section {
  display: flex;
  gap: 30px;
}
.row.bottom-info .score-section .score-item {
  text-align: center;
}
.row.bottom-info .score-section .score-item span {
  display: block;
  color: #ffffff;
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 2px;
}
.row.bottom-info .score-section .score-item div {
  color: #ffff00;
  font-size: 16px;
  font-weight: bold;
}

.pause-button-container {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 10;
  visibility: hidden;
  opacity: 0;
}
.pause-button-container button {
  background: none;
  border: none;
  color: #ffffff;
  cursor: pointer;
  outline: none;
  padding: 0;
  transition: all 0.2s ease;
}
.pause-button-container button:active {
  transform: scale(0.9);
}
.pause-button-container button .material-icons {
  font-size: 40px;
}

.sound-button-container {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 10;
  visibility: hidden;
  opacity: 0;
}
.sound-button-container button {
  background: none;
  border: none;
  color: #ffffff;
  cursor: pointer;
  outline: none;
  padding: 0;
  transition: all 0.2s ease;
}
.sound-button-container button:active {
  transform: scale(0.9);
}
.sound-button-container button .material-icons {
  font-size: 40px;
}

body.game-active .pause-button-container,
body.game-active .sound-button-container {
  visibility: visible;
  opacity: 1;
}

@keyframes glow {
  from {
    text-shadow: 0 0 10px #ffff00, 0 0 20px #ffff00, 0 0 30px #ffff00;
  }
  to {
    text-shadow: 0 0 20px #ffff00, 0 0 30px #ffff00, 0 0 40px #ffff00;
  }
}
@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}
@media (max-width: 1024px) {
  .pause-button-container button .material-icons,
  .sound-button-container button .material-icons {
    font-size: 60px;
  }
  .instructions-container {
    padding: 15px 20px !important;
    align-items: center;
    justify-content: center;
  }
  .instructions-container .instructions-content {
    padding: 10px !important;
    border-radius: 12px;
    justify-content: flex-start;
    max-height: calc(100dvh - 30px);
    overflow-y: auto;
    margin: 0 !important;
  }
  .instructions-container .content-wrapper {
    max-width: 600px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
  }
  .instructions-container .content-wrapper h1 {
    font-size: 2.2em;
    margin: 0 0 10px 0;
  }
  .instructions-container .content-wrapper h2 {
    font-size: 1.6em;
    margin: 0 0 6px 0;
  }
  .instructions-container .content-wrapper h3 {
    font-size: 1.3em;
    margin: 6px 0 4px 0;
  }
  .instructions-container .content-wrapper p {
    font-size: 1.1em;
    line-height: 1.4;
    margin: 2px 0;
  }
  .content-wrapper .main-content {
    gap: 8px;
    padding: 10px 0;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    margin: 10px 0;
    justify-content: space-around;
  }
  .content-wrapper .game-objective,
  .content-wrapper .game-items,
  .content-wrapper .levels-info {
    margin: 3px 0;
    padding: 8px 12px;
  }
  .content-wrapper .item-row {
    margin: 3px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .content-wrapper .item-group {
    gap: 10px;
    margin: 3px 0;
  }
  .content-wrapper .pickups-grid {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    gap: 8px;
    max-width: 100%;
    margin: 8px auto !important;
    flex-wrap: nowrap;
    padding: 0 5px;
  }
  .content-wrapper .pickup-item {
    padding: 6px;
    gap: 3px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    flex: 1;
    min-width: 0;
  }
  .content-wrapper .pickup-item span {
    font-size: 0.75em;
    font-weight: bold;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
  }
  .content-wrapper .item-image {
    width: 28px;
    height: 28px;
  }
  .content-wrapper .item-image.small {
    width: 20px;
    height: 20px;
  }
  .content-wrapper .start-game-button {
    padding: 15px 40px;
    font-size: 1.6em;
    margin-top: 12px;
    border-radius: 25px;
    box-shadow: 0 6px 25px rgba(255, 102, 0, 0.5);
    transform: scale(1.05);
  }
  .item-counters {
    gap: 8px;
  }
  .item-counters .counter {
    font-size: 13px;
    padding: 4px 8px;
    min-width: 60px;
  }
}
@media (max-width: 768px) {
  .pause-button-container button .material-icons,
  .sound-button-container button .material-icons {
    font-size: 70px;
  }
  .instructions-container {
    padding: 12px 15px !important;
  }
  .instructions-container .instructions-content {
    padding: 10px !important;
    border-radius: 10px;
    max-height: calc(100dvh - 24px);
  }
  .instructions-container .content-wrapper {
    max-width: 450px;
    margin: 0 auto;
    padding: 10px 15px;
    gap: 6px;
  }
  .instructions-container .content-wrapper h1 {
    font-size: 2.4em;
    margin: 0 0 8px 0;
  }
  .instructions-container .content-wrapper h2 {
    font-size: 1.8em;
    margin: 0 0 5px 0;
  }
  .instructions-container .content-wrapper h3 {
    font-size: 1.4em;
    margin: 4px 0 3px 0;
  }
  .instructions-container .content-wrapper p {
    font-size: 1.2em;
    line-height: 1.3;
    margin: 1px 0;
  }
  .content-wrapper .main-content {
    gap: 2px;
    padding: 5px 0;
    margin: 5px 0;
  }
  .content-wrapper .game-objective,
  .content-wrapper .game-items,
  .content-wrapper .levels-info {
    margin: 2px 0;
    padding: 6px 10px;
  }
  .content-wrapper .item-row {
    margin: 1px 0;
  }
  .content-wrapper .item-group {
    gap: 8px;
    margin: 2px 0;
  }
  .content-wrapper .pickups-grid {
    gap: 6px;
    max-width: 100%;
    margin: 6px auto !important;
    justify-content: space-around;
    padding: 0 5px;
  }
  .content-wrapper .pickup-item {
    padding: 4px;
    gap: 2px;
    flex: 1;
    min-width: 0;
  }
  .content-wrapper .pickup-item span {
    font-size: 0.65em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
  }
  .content-wrapper .item-image {
    width: 22px;
    height: 22px;
  }
  .content-wrapper .item-image.small {
    width: 16px;
    height: 16px;
  }
  .content-wrapper .start-game-button {
    padding: 12px 35px;
    font-size: 1.7em;
    margin-top: 10px;
  }
}
@media (max-height: 600px) {
  .instructions-container .instructions-content {
    padding: 8px !important;
  }
  .instructions-container .content-wrapper {
    padding: 10px 15px;
  }
  .instructions-container .content-wrapper h1 {
    font-size: 1.8em;
    margin: 0 0 6px 0;
  }
  .instructions-container .content-wrapper h2 {
    font-size: 1.3em;
    margin: 0 0 4px 0;
  }
  .instructions-container .content-wrapper h3 {
    font-size: 1.1em;
    margin: 3px 0 2px 0;
  }
  .instructions-container .content-wrapper p {
    font-size: 1em;
    margin: 2px 0;
  }
  .game-objective,
  .game-items,
  .levels-info {
    margin: 2px 0;
    padding: 4px;
  }
  .pickups-grid {
    max-width: 280px;
  }
  .start-game-button {
    padding: 8px 25px;
    font-size: 1.2em;
    margin-top: 6px;
  }
}
.ghost-expand-effect {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 9999;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  image-rendering: pixelated;
  animation: ghostExpand 1s ease-out forwards;
}

@keyframes ghostExpand {
  0% {
    width: 50px;
    height: 50px;
    opacity: 0.6;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 0.4;
  }
  100% {
    width: 100vw;
    height: 100vh;
    opacity: 0;
    transform: translate(-50%, -50%) scale(3);
  }
}
@keyframes slideInFromTop {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes slideInFromBottom {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes slideInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes slideInFromRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}
.animate-slide-top {
  animation: slideInFromTop 1.8s ease-out forwards;
}

.animate-slide-bottom {
  animation: slideInFromBottom 1.8s ease-out forwards;
}

.animate-slide-left {
  animation: slideInFromLeft 1.8s ease-out forwards;
}

.animate-slide-right {
  animation: slideInFromRight 1.8s ease-out forwards;
}

.animate-scale {
  animation: scaleIn 1.8s ease-out forwards;
}

.animate-bounce {
  animation: bounceIn 2.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.delay-100 {
  animation-delay: 0.3s;
  opacity: 0;
}

.delay-200 {
  animation-delay: 0.6s;
  opacity: 0;
}

.delay-300 {
  animation-delay: 0.9s;
  opacity: 0;
}

.delay-400 {
  animation-delay: 1.2s;
  opacity: 0;
}

.delay-500 {
  animation-delay: 1.5s;
  opacity: 0;
}

.delay-600 {
  animation-delay: 1.8s;
  opacity: 0;
}

.delay-700 {
  animation-delay: 2.1s;
  opacity: 0;
}

.delay-800 {
  animation-delay: 2.4s;
  opacity: 0;
}

.delay-900 {
  animation-delay: 2.7s;
  opacity: 0;
}

.delay-1000 {
  animation-delay: 3s;
  opacity: 0;
}

.delay-1100 {
  animation-delay: 3.3s;
  opacity: 0;
}

.delay-1200 {
  animation-delay: 3.6s;
  opacity: 0;
}

.delay-1300 {
  animation-delay: 3.9s;
  opacity: 0;
}

.delay-1400 {
  animation-delay: 4.2s;
  opacity: 0;
}

.delay-1500 {
  animation-delay: 4.5s;
  opacity: 0;
}

.delay-1600 {
  animation-delay: 4.8s;
  opacity: 0;
}

.delay-1700 {
  animation-delay: 5.1s;
  opacity: 0;
}

.delay-1800 {
  animation-delay: 5.4s;
  opacity: 0;
}
.ghost {
  margin: 0;
  position: absolute;
  z-index: 2;
}
* {
  font-family: "Press Start 2P", sans-serif;
  cursor: default !important;
}

button,
a,
.clickable {
  cursor: pointer !important;
}

body {
  margin: 0;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
}

.overflow-mask {
  background-color: #000;
  color: #fff;
  display: flex;
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  justify-content: center;
  margin: 0;
  overflow: hidden;
  position: relative;
  touch-action: manipulation;
}

.backdrop {
  position: absolute;
  visibility: hidden;
}

.fps-display {
  position: absolute;
  right: 10px;
  top: 10px;
  visibility: hidden;
}

.preload-div {
  align-items: baseline;
  bottom: 0;
  display: flex;
  flex-wrap: wrap-reverse;
  position: absolute;
  visibility: hidden;
}

.paused-text {
  align-items: center;
  display: flex;
  font-size: 50px;
  height: 100%;
  justify-content: center;
  left: 0;
  position: absolute;
  user-select: none;
  visibility: hidden;
  width: 100%;
  z-index: 1;
}

.game-ui {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  visibility: hidden;
  opacity: 0;
}
.game-ui .one-up {
  animation: blink 0.6s infinite;
}
@keyframes blink {
  0% {
    opacity: 0;
  }
  49% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
}
.game-ui .row {
  display: flex;
}
.game-ui .top ._25 {
  width: 25%;
}
.game-ui .top ._50 {
  width: 50%;
}
.game-ui .top .column :first-child {
  text-align: center;
}
.game-ui .top .column :not(:first-child) {
  margin-right: calc(50% - 3em);
  text-align: right;
}
.game-ui .bottom {
  justify-content: space-between;
}
.game-ui .bottom .extra-lives {
  align-items: flex-start;
  display: flex;
}
.game-ui .bottom .fruit-display {
  display: flex;
  flex-direction: row-reverse;
}

.loading-cover {
  background: #ffdf00;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  position: fixed;
  top: 0;
  bottom: 0;
  width: 50vw;
  z-index: 4;
  margin: 0;
  padding: 0;
  visibility: hidden;
}

.left {
  left: 0;
  transition: left 0.5s 0.5s;
}

.right {
  right: 0;
  transition: right 0.5s 0.5s;
}

.main-menu-container {
  align-items: center;
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: center;
  left: 0;
  opacity: 0;
  position: absolute;
  transition: opacity 0.25s;
  visibility: hidden;
  width: 100%;
  z-index: 5;
  background-color: #ffdf00;
}

.brent-ward-logo {
  position: absolute;
  top: 2rem;
  left: 3rem;
}
.brent-ward-logo img {
  height: 2rem;
}

.logo {
  width: 800px;
  max-width: 80vw;
  margin-bottom: 2rem;
}

.game-start {
  background-color: #fcc73f;
  color: #231f20;
  cursor: pointer;
  font-size: 48px;
  outline: none;
  padding: 16px;
}
.game-start:active {
  transform: translateX(4px) translateY(4px);
}
.game-start:disabled {
  cursor: default;
}

@media only screen and (max-width: 1024px) {
  .main-menu-container .logo {
    margin-bottom: 4rem !important;
  }
  .main-menu-container .game-start {
    font-size: 36px;
    padding: 20px 32px;
    margin-top: 0 !important;
  }
}
.loading-background {
  background-color: #ffdf00;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-container {
  background-color: #000;
  height: 48px;
  position: relative;
  transition: opacity 0.5s 1s;
  width: 500px;
  z-index: 5;
  opacity: 1;
  visibility: visible;
}

@media only screen and (max-width: 600px) {
  .loading-container {
    transform: scale(0.5);
  }
}
.loading-pacman {
  animation: loading-animation 0.3s steps(4) infinite;
  background-color: #000;
  background-image: url("../app/style/graphics/spriteSheets/characters/pacman/pacman_right.svg");
  background-size: 192px;
  height: 48px;
  position: absolute;
  transition: left 1s;
  width: 48px;
  z-index: 6;
}

@keyframes loading-animation {
  100% {
    background-position: -192px;
  }
}
.loading-dot-mask {
  background-color: #000;
  height: 48px;
  left: 0;
  position: absolute;
  top: 0;
  transition: width 1s;
  z-index: -1;
}

.loading-dot {
  background-image: url("../app/style/graphics/spriteSheets/pickups/pacdot.svg");
  background-size: 12px 12px;
  height: 12px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  z-index: -2;
}

._5 {
  left: 5%;
}

._10 {
  left: 10%;
}

._15 {
  left: 15%;
}

._20 {
  left: 20%;
}

._25 {
  left: 25%;
}

._30 {
  left: 30%;
}

._35 {
  left: 35%;
}

._40 {
  left: 40%;
}

._45 {
  left: 45%;
}

._50 {
  left: 50%;
}

._55 {
  left: 55%;
}

._60 {
  left: 60%;
}

._65 {
  left: 65%;
}

._70 {
  left: 70%;
}

._75 {
  left: 75%;
}

._80 {
  left: 80%;
}

._85 {
  left: 85%;
}

._90 {
  left: 90%;
}

._95 {
  left: 95%;
}

.error-message {
  color: #231f20;
  opacity: 0;
  position: absolute;
  top: 30vh;
  transition: opacity 0.5s;
  visibility: hidden;
  width: 50vw;
  z-index: 4;
}
.error-message .error-pacman {
  animation: error-animation 1.5s steps(12) infinite;
  background-image: url("../app/style/graphics/spriteSheets/characters/pacman/pacman_error.svg");
  background-size: 576px;
  height: 48px;
  margin-left: 10px;
  width: 48px;
  z-index: 6;
}
@keyframes error-animation {
  100% {
    background-position: -576px;
  }
}
.error-message .header {
  display: flex;
  font-size: 50px;
  margin-bottom: 30px;
}
.error-message .body {
  color: white;
  font-size: 20px;
  line-height: 1.25;
}
.maze-cover {
  background: #000;
  height: 100%;
  position: absolute;
  visibility: hidden;
  width: 100%;
  z-index: 4;
}

.maze {
  margin: 0 auto;
  position: relative;
}

.maze-img {
  position: absolute;
  user-select: none;
  width: 100%;
}

.maze-adornos-img {
  position: absolute;
  user-select: none;
  width: 100%;
  z-index: 3;
}

.maze-row {
  display: flex;
}

.dot-container {
  height: 100%;
  position: absolute;
  width: 100%;
}
.pacman {
  margin: 0;
  position: absolute;
  z-index: 1;
}
.power-pellet {
  animation: blink 0.3s infinite;
}

@keyframes blink {
  0% {
    opacity: 0;
  }
  49% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
}
.joystick-container {
  display: none;
  position: relative;
  z-index: 10;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 20px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  width: fit-content;
}
.joystick-container .joystick-base {
  position: relative;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(0, 255, 255, 0.15) 0%, rgba(0, 255, 255, 0.25) 100%);
  border: 6px solid rgba(0, 255, 255, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.4), inset 0 0 45px rgba(0, 255, 255, 0.1);
}
.joystick-container .joystick-stick {
  position: absolute;
  width: 90px;
  height: 90px;
  background: radial-gradient(circle, rgba(0, 255, 255, 0.8) 0%, rgba(0, 255, 255, 0.5) 100%);
  border: 6px solid rgba(0, 255, 255, 0.9);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.1s ease-out;
  box-shadow: 0 0 22px rgba(0, 255, 255, 0.6), inset 0 0 15px rgba(255, 255, 255, 0.3);
  z-index: 2;
}
.joystick-container .joystick-stick:active {
  background: radial-gradient(circle, rgba(255, 255, 0, 0.9) 0%, rgba(255, 255, 0, 0.6) 100%);
  border-color: rgb(255, 255, 0);
  box-shadow: 0 0 38px rgba(255, 255, 0, 0.8), inset 0 0 22px rgba(255, 255, 255, 0.4);
}
.joystick-container .joystick-glow {
  position: absolute;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  border-radius: 50%;
  z-index: 1;
}
.joystick-container .joystick-glow.active {
  opacity: 1;
}
.joystick-container .joystick-glow-up {
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 70px;
  background: radial-gradient(circle, rgba(255, 255, 0, 0.6) 0%, transparent 70%);
  box-shadow: 0 -22px 45px rgba(255, 255, 0, 0.6);
}
.joystick-container .joystick-glow-down {
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 70px;
  background: radial-gradient(circle, rgba(255, 255, 0, 0.6) 0%, transparent 70%);
  box-shadow: 0 22px 45px rgba(255, 255, 0, 0.6);
}
.joystick-container .joystick-glow-left {
  left: -15px;
  top: 50%;
  transform: translateY(-50%);
  width: 70px;
  height: 70px;
  background: radial-gradient(circle, rgba(255, 255, 0, 0.6) 0%, transparent 70%);
  box-shadow: -22px 0 45px rgba(255, 255, 0, 0.6);
}
.joystick-container .joystick-glow-right {
  right: -1px;
  top: 50%;
  transform: translateY(-50%);
  width: 70px;
  height: 70px;
  background: radial-gradient(circle, rgba(255, 255, 0, 0.6) 0%, transparent 70%);
  box-shadow: 22px 0 45px rgba(255, 255, 0, 0.6);
}
.joystick-container .joystick-toast {
  position: absolute;
  bottom: -50px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 12px;
  font-family: "Press Start 2P", cursive;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 100;
  pointer-events: none;
}
.joystick-container .joystick-toast.show {
  opacity: 1;
  visibility: visible;
}

@media screen and (max-width: 768px) {
  body.game-active .joystick-container {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
}
@media (hover: none) and (pointer: coarse) {
  body.game-active .joystick-container {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
}

@media screen and (min-width: 1025px) {
  .joystick-container {
    display: none !important;
  }
}