* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Courier New', Courier, monospace;
}

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;

  /* tiled background */
  background-image: url('/assets/tiled.png');
  background-repeat: repeat;
  background-position: 0 0;
  background-size: 128px 128px;
  background-attachment: fixed; /* lock the tile so it doesn't scroll */
  background-color: #1e3a8a; /* fallback color if image missing */

  color: #ffffff;
}

.hidden {
  display: none !important;
}

.screen {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Add a subtle panel behind the main menu to keep text readable over the tile */
#main-menu > div {
  background: rgba(0, 0, 0, 0.18);
  padding: 22px;
  border-radius: 10px;
  backdrop-filter: blur(4px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.45);
}

/* Main Menu */
#main-menu h1, #win-screen h1 {
  font-size: 3.5rem;
  margin-bottom: 2rem;

  /* strengthened title styling for contrast */
  padding: 6px 12px;
  background: rgba(0,0,0,0.25);
  border-radius: 6px;
  text-shadow: 4px 4px 0 rgba(0,0,0,0.6);
}

.menu-buttons button, #btn-restart {
  background-color: #2563eb;
  color: #ffffff;
  border: 2px solid #ffffff;
  padding: 0.75rem 1.5rem;
  font-size: 1.2rem;
  margin: 0.5rem;
  cursor: pointer;
  font-weight: bold;
}

.menu-buttons button:hover, #btn-restart:hover {
  background-color: #1d4ed8;
}

/* Game View Structure */
#game-screen {
  justify-content: flex-start;
}

#canvas-container {
  width: 100vw;
  height: calc(100vh - 120px);
  background-color: #222222;
}

#gameCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Bottom Fixed Typing HUD */
#typing-hud {
  width: 100vw;
  height: 120px;
  background-color: #1a1a1a;
  border-top: 3px solid #444444;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

#text-display {
  font-size: 1.8rem;
  letter-spacing: 2px;
}

#typed-text {
  color: #ffffff;
}

#remaining-text {
  color: #666666;
}

/* small corner unmute button - less obtrusive */
#btn-unmute {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 9999;
  padding: 4px 6px;
  font-size: 12px;
  background: rgba(31, 127, 255, 0.85);
  color: #fff;
  border-radius: 6px;
  border: 0;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
#btn-unmute[disabled] { opacity: 0.65; cursor: default; }

/* preview canvas styling (if present in index) */
#menuPreview {
  margin-left: 12px;
  border-radius: 6px;
  background: #081226;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

/* responsive: hide preview on very small screens and make menu readable */
@media (max-width: 640px) {
  #menuPreview { display: none; }
  #main-menu > div { padding: 14px; }
  #main-menu h1 { font-size: 2.2rem; }
  .menu-buttons button, #btn-restart { padding: 0.5rem 1rem; font-size: 1rem; }
  #text-display { font-size: 1.2rem; }
}