/* =========================================================
   Dino Jump - Stylesheet
   Bright, cheerful, kid-friendly UI.
   The game itself is drawn on <canvas>; this file only
   styles the page, overlays, buttons and the score HUD.
   ========================================================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  /* Soft sky-blue gradient background */
  background: linear-gradient(180deg, #aee9ff 0%, #d8f6ff 60%, #eafff0 100%);
  font-family: "Trebuchet MS", "Comic Sans MS", Verdana, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  color: #2b3a4a;
  -webkit-tap-highlight-color: transparent; /* no blue flash on mobile tap */
}

/* The wrapper scales the canvas while keeping its aspect ratio */
#game-wrapper {
  position: relative;
  width: min(92vw, 800px);
  aspect-ratio: 8 / 3;            /* matches 800 x 300 canvas */
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 80, 120, 0.25);
  background: #fff;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: manipulation;     /* better, faster taps on mobile */
}

/* ===== Overlays (start / game over) ===== */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4%;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(2px);
  gap: 2vh;
}

.overlay h1 {
  font-size: clamp(1.6rem, 5vw, 3rem);
  color: #ff7a59;
  text-shadow: 2px 2px 0 #fff;
}

.subtitle {
  font-size: clamp(0.9rem, 2.6vw, 1.3rem);
  color: #3a7d44;
  font-weight: bold;
}

.hint {
  font-size: clamp(0.8rem, 2.2vw, 1.05rem);
  color: #5a6b7a;
}

.score-line {
  font-size: clamp(1rem, 3vw, 1.5rem);
  font-weight: bold;
  color: #2b3a4a;
}

/* ===== Big friendly buttons ===== */
.big-button {
  font: inherit;
  font-size: clamp(1rem, 3vw, 1.4rem);
  font-weight: bold;
  color: #fff;
  background: #ff7a59;
  border: none;
  border-radius: 999px;
  padding: 0.6em 1.6em;
  cursor: pointer;
  box-shadow: 0 6px 0 #d85a3c;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.big-button:hover {
  background: #ff8c70;
}

.big-button:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #d85a3c;
}

/* ===== Score HUD shown during play ===== */
#hud {
  position: absolute;
  top: 3%;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 4%;
  font-size: clamp(1rem, 3.5vw, 1.6rem);
  font-weight: bold;
  color: #2b3a4a;
  text-shadow: 1px 1px 0 #fff;
  pointer-events: none; /* never blocks taps to the canvas */
}

/* Small "back to the games hub" chip (bottom-left, clear of the HUD) */
.menu-link {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 10;
  font-weight: bold;
  font-size: clamp(0.75rem, 2.2vw, 0.95rem);
  text-decoration: none;
  color: #2b3a4a;
  background: rgba(255, 255, 255, 0.85);
  padding: 0.35em 0.8em;
  border-radius: 999px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.menu-link:hover { background: #fff; }

/* Utility class to show / hide screens */
.hidden {
  display: none !important;
}
