:root {
  --bg: #6ab800; /* page background for contrast */
  --container-bg: #082f08; /* behind canvas so gaps look nice while resizing */
  --wall-color: #222;
  --path-color: #fff;
  --goal-color: #2196f3;
  --player-color: #6ab800;
  --eye-color: #fff;
}
html,
body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  font-family: "Lilita One", sans-serif;
  color: #fff;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.logo {
  display: block;
  margin: 0 auto 20px;
  max-width: 100%;
  height: auto;
}

@media (max-width: 767px) {
  
  .logo {
    max-width: 200px;
  }
}

#maze-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 20px auto;
  aspect-ratio: 1;
  border: 8px solid rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

#maze,
#maze-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

#maze-grid {
  display: grid;
  grid-template-columns: repeat(21, 1fr);
  grid-template-rows: repeat(21, 1fr);
  z-index: 2;
  pointer-events: none;
}

.maze-cell {
  background-size: cover;
  background-position: center;
  image-rendering: pixelated; /* Optional: crisp pixels */
}

/* Image backgrounds */
.wall {
  background-image: url('images/wall.png');
}
.outerwall {
  background-image: url('images/outerwall.png');
}
.path {
  background-image: url('images/path.png');
}
.player {
  background-image: url('images/player.png');
}
.goal {
  background-image: url('images/goal.png');
}

.player.up {
  transform: rotate(0deg);
}

.player.right {
  transform: rotate(90deg);
}

.player.down {
  transform: rotate(180deg);
}

.player.left {
  transform: rotate(270deg);
}

.dpad {
  position: relative;       /* stays in-flow, centered by your parent */
  margin: 0 auto;
  width: 144px;
  height: 144px;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;              /* sit above the maze UI if needed */
  touch-action: manipulation;
}

.dbutton {
  position: absolute;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 8px;
  background-color: #202124;
  background-position: 9px 9px;
  background-repeat: no-repeat;
  background-size: 30px 30px;
  cursor: pointer;
  box-shadow:
    inset -2px 2px 4px rgba(255, 255, 255, 0.6),
    inset 2px -2px 4px rgba(0, 0, 0, 0.8);
  transition: box-shadow 0.15s ease;
}

/* Active / pressed look: swap the lighting direction */
.dbutton:active,
.dbutton.active {
  background-position: 10px 8px;
  box-shadow:
    inset -2px 2px 4px rgba(0, 0, 0, 0.8),
    inset 2px -2px 4px rgba(255, 255, 255, 0.6);
}

/* Positioning each direction */
.d-up {
  background-image: url('images/d-up.png');
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

.d-down {
  background-image: url('images/d-down.png');
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}

.d-left {
  background-image: url('images/d-left.png');
  left: 0;
  top: 50%;
  transform: translateY(-50%);
}

.d-right {
  background-image: url('images/d-right.png');
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.hint {
  color: #fff;
  text-align: center;
  margin: 30px auto 0;
  max-width: 500px;
  text-shadow: -2px 2px 2px rgba(0,0,0,0.5);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap; /* prevent line breaks */
  border: 0;
}

/* Optional: for focusable elements (e.g., links) */
.sr-only-focusable:active,
.sr-only-focusable:focus {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}


.popup {
  background: rgba(0,0,0,0.4);
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  width: 100dvw;
  height: 100vh;
  height: 100dvh;
  justify-content: center;
  align-content: center;
  align-items: center;
  z-index: 20;
}

.popup-inner {
  max-width: 500px;
  width: 90%;
  background: #fff;
  color: #333;
  font-family: Helvetica,Arial,sans-serif;
  position: relative;
  padding: 20px;
  border-radius: 5px;
}

.popup.is-open {
  display: flex;  
}

.popup-close {
  background: #333;
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  font-weight: bold;
  width: 40px;
  height: 40px;
  position: absolute;
  right: -20px;
  top: -20px;
}

.popup h2 {
  color: #FE7600;
  font-family: "Lilita One", sans-serif;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.05);
}

.popup p {
  margin-bottom: 0.5rem;
}

.popup .disclaimer {
  font-size: 11px;
}

#mc_embed_signup form {
  margin: 0 !important;
}
