/* =========================================================
   Shape & Colour Sort - Stylesheet
   Bright, cheerful, kid-friendly UI.
   The game is drawn on <canvas>; this only styles the page,
   overlays, buttons and the small HUD.
   (Shares the look of the other games in this directory.)
   ========================================================= */

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

html, body { height: 100%; }

body {
  background: linear-gradient(180deg, #aee9ff 0%, #ffe1f0 55%, #fff4d6 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 tap */
}

/* Scales the canvas while keeping its 760x560 aspect ratio */
#game-wrapper {
  position: relative;
  width: min(95vw, 760px);
  aspect-ratio: 760 / 560;
  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: none; /* we handle drags ourselves */
  background: #bfe9ff;
}

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

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

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

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

.score-line {
  font-size: clamp(1.05rem, 3.2vw, 1.45rem);
  font-weight: bold;
  color: #2b3a4a;
}

/* ===== Start-screen chooser ===== */
.choose-label {
  font-size: clamp(0.85rem, 2.6vw, 1.05rem);
  font-weight: bold;
  color: #6b4f2a;
  margin-top: 0.3vh;
}

.option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.option-btn {
  font: inherit;
  font-weight: bold;
  font-size: clamp(0.85rem, 2.6vw, 1.05rem);
  color: #5a4a2a;
  background: #fff4dc;
  border: 3px solid transparent;
  border-radius: 12px;
  padding: 0.45em 0.9em;
  cursor: pointer;
  transition: transform 0.08s ease, border-color 0.08s ease;
}

.option-btn:hover { transform: translateY(-2px); }

.option-btn.selected {
  border-color: #ff7a59;
  background: #ffe2d6;
}

/* ===== Big friendly buttons ===== */
.big-button {
  font: inherit;
  font-size: clamp(1.05rem, 3.4vw, 1.4rem);
  font-weight: bold;
  color: #fff;
  background: #ff7a59;
  border: none;
  border-radius: 999px;
  padding: 0.6em 1.7em;
  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;
}

/* ===== Small HUD shown during play ===== */
#hud {
  position: absolute;
  top: 2.5%;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 4%;
  font-size: clamp(1rem, 3.5vw, 1.5rem);
  font-weight: bold;
  color: #2b3a4a;
  text-shadow: 1px 1px 0 #fff;
  pointer-events: none; /* never blocks drags 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; }

.hidden { display: none !important; }
