/* Global reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
}
body {
  margin: 0;
  font-family: sans-serif;
  background: #e6e6e6;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.game-root {
  height: 100vh;               /* 🔒 fixed vertical space */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  max-width: 600px;            /* desktop/tablet */
  margin: 0 auto;
  padding: 12px;
  box-sizing: border-box;
}
/* Info section */
.info-section {
  margin: 20px;
  max-width: 900px;
  width: 90%;
}
.info-box {
  padding: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  text-align: left;
}
.info-box h1 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.8rem;
  text-align: center;
}
.info-box h2 {
  margin-top: 0;
  font-size: 1.2rem;
}
ul {
  margin: 0;
  padding-left: 20px;
}
/* Turn indicator */
#p1-glows {
  margin-top: 15px;
  font-weight: bold;
  text-align: center;
  font-size: 1.1rem;
  background-Color: lightsalmon;
  color: #333;
}
/* Turn indicator */
#p2-glows {
  margin-top: 15px;
  font-weight: bold;
  text-align: center;
  font-size: 1.1rem;
  background-Color: lightsalmon;
  color: #333;
}
/* Turn indicator */
#turn-indicator {
  margin-top: 15px;
  font-weight: bold;
  text-align: center;
  font-size: 1.1rem;
/*color: #333;*/
  color: white; /* default text color */
}
/* Turn indicator */
.turn-container {
  display: flex;
  justify-content: center;   /* center all HUD boxes horizontally */
  gap: 3rem;                 /* space between them */
  margin-bottom: 1rem;
  margin-top: 1rem;
}
.hud-box {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 12px;       /* rounded corners */
  padding: 0.4em 1em;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); /* button-like shadow */
  font-weight: bold;
  font-size: 1rem;
  min-width: 8ch;            /* ensure small consistent width */
  text-align: center;
}
/* Game grid */
.grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: repeat(6, minmax(0, 1fr));
  width: 420px;
  height: 420px;
  border: 2px solid #444;
  box-sizing: border-box;
  flex: 0 0 auto;
}
.cell {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border: 1px solid #444;
  font-size: 40px;
  line-height: 1;        /* 🔒 critical */
  overflow: hidden;     /* 🔒 content cannot influence size */
}
.door-orange-top {
  border-top: 9px solid orange !important;
}
.door-red-bottom {
  border-bottom: 9px solid red !important;
}
.door-blue-left {
  border-left: 9px solid blue !important;
}
.door-purple-right {
  border-right: 9px solid purple !important;
}
.centerTile-orange {
  border: 5px solid orange !important;
}
.centerTile-red {
  border: 5px solid red !important;
}
.centerTile-blue {
  border: 5px solid blue !important;
}
.centerTile-purple {
  border: 5px solid purple !important;
}
.corner {
  border: 3px solid gold !important;
  box-shadow: 0 0 10px gold;
  animation: cornerGlow 0.75s infinite alternate;
}
@keyframes cornerGlow {
from {
  box-shadow: 0 0 5px gold, 0 0 10px gold;
}
to {
  box-shadow: 0 0 20px gold, 0 0 40px gold;
}
}
.G {
background-color: lightgreen; }
.B {
background-color: lightblue; }
.p1 {
  font-size: 4em; /* bigger solid black circle */
}
.p2 {
  font-size: 4em; /* bigger solid blue circle */
}
/* Fullscreen overlay */
#overlay {
  position: fixed;
  inset: 0; /* shorthand for top/right/bottom/left: 0 */
  background: rgba(0,0,0,0.5); /* semi-transparent backdrop */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000; /* ensure it's above everything */
  overflow-y: auto;   /* <-- add this */
}
/* Centered box */
.overlay-content {
  background: rgba(255,255,255,0.9);
  padding: 30px 50px;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.overlay-content h1 {
  margin: 0 0 20px;
  font-size: 2rem;
}
/* target the UL inside the overlay-content (class) */
.overlay-content ul {
  text-align: left;         /* left-align bullet + text */
  margin: 0 auto;           /* keep the list block centered within overlay */
  padding-left: 1.25em;     /* space for bullets */
  list-style-position: outside;
  max-width: 48ch;          /* optional: keep line length readable */
}
/* optional: add spacing between items */
.overlay-content ul li {
  margin-bottom: 0.6em;
}
#begin-btn {
  padding: 10px 20px;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  background: #0077ff;
  color: white;
  cursor: pointer;
}
#begin-btn:hover {
  background: #005fcc;
}
#begin-btn-1Player {
  padding: 10px 20px;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  background: #0077ff;
  color: white;
  cursor: pointer;
}
#begin-btn-1Player:hover {
  background: #005fcc;
}
#begin-btn-2Player {
  padding: 10px 20px;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  background: #0077ff;
  color: white;
  cursor: pointer;
}
#begin-btn-2Player:hover {
  background: #005fcc;
}
.reset-container {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}
#reset-btn {
  background: darkred;
  color: white;
  font-size: 1.1rem;
  font-weight: bold;
  padding: 0.6em 1.2em;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 3px 6px rgba(0,0,0,0.3);
  transition: background 0.3s ease;
}
#reset-btn:hover {
  background: darkred;
}
#reset-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
/* Match controls width to grid width */
.controls-container {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  width: var(--grid-width, 60vmin); /* fallback if var not set */
  margin-left: auto;
  margin-right: auto;
}
.controls-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px; /* space between buttons */
}
/* D-pad layout */
.dpad .row {
  display: flex;
  justify-content: center;
  gap: 10px;
}
.dpad button {
  width: 50px;
  height: 50px;
  font-size: 1.2rem;
  background-color: #444;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
/* Glow & Camouflage */
.abilities button {
  width: 100px;
  padding: 10px;
  font-size: 1rem;
/*background-color: #666;*/
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
/* Attack & Reset */
.actions button {
  width: 100px;
  padding: 10px;
  font-size: 1rem;
/* background-color: #c33;*/
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
button {
  transition: opacity 0.5s ease, transform 0.1s ease;
}
/* Active press feedback */
button:active {
  opacity: 0.6;
  transform: scale(0.95);
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
/* Camouflage button: green theme */
.btn-camouflage {
  background: #2e7d32;
  color: white;
}
.btn-camouflage:active {
  opacity: 0.6;
  transform: scale(0.95);
}
.btn-camouflage.pressed {
  transition: opacity 0.5s ease, transform 0.1s ease;
}
/* Glow button: blue theme */
.btn-glow {
  background: #1565c0;
  color: white;
}
.btn-glow:active {
  opacity: 0.6;
  transform: scale(0.95);
}
.btn-glow.pressed {
  transition: opacity 0.5s ease, transform 0.1s ease;
}
/* Attack button: orange theme */
.btn-attack {
  background: darkorange;
  color: white;
}
.btn-attack:active {
  opacity: 0.6;
  transform: scale(0.95);
}
.btn-attack.pressed {
  transition: opacity 0.5s ease, transform 0.1s ease;
}
.hud-box {
  font-size: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}
#p1-glows,
#p2-glows,
#turn-indicator {
  font-size: 0.9rem;
  flex-wrap: wrap;
  padding: 4px 8px;
  min-width: auto;
}
.turn-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
}
.reset-container button {
  font-size: 0.8rem;
  padding: 5px 10px;
}
.controls-container {
  flex-direction: column;
  align-items: center;
  margin-top: 0;
  padding-top: 0;
}
.controls-section {
  margin: 8px 0;
}
.controls-container button {
  font-size: 1.2rem;
  padding: 5px 7px;
  min-width: 50px;
  min-height: 50px;
}
.abilities button,
.actions button {
  min-width: 120px;
}
}
/* begin media query stuff */
/* Always the same */
.controls-container {
  width: 75vmin;
  margin-top: 10px;
}
.controls-container button {
  font-size: 1.2rem;
  padding: 8px 14px;
}
.abilities button{
  font-size: 1.1rem;
  padding: 8px 14px;
}
/* reset button dealt with separately at the #btn reset above */
/* Phones only */
@media (max-width: 600px) {
.grid {
  width: clamp(220px, 70vmin, 320px);
  height: clamp(220px, 70vmin, 320px);
}
.cell {
  font-size: clamp(26px, 5.5vmin, 40px);
  line-height: 1;
}
.p1,
.p2 {
  font-size: 4em;     /* optional boost */
}
.hud-box,
.reset-container button {
  font-size: 0.9rem;
  padding: 6px 12px;
  min-width: 90px;
}
}
