/* Exploding Seed Pods — style.css
   Kid-friendly, bright, touch-first. Overlays sit on top of the game canvas. */

:root {
  --you: #3ba7ff;
  --boulder: #b98a4a;
  --sun: #ffd15c;
  --pink: #ff9ec2;
  --deep: #3a1550;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  width: 100%; height: 100%; overflow: hidden;
  background: #3a1550;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-user-select: none; user-select: none;
  position: fixed;
}

#game { display: block; width: 100vw; height: 100vh; touch-action: none; }

.hidden { display: none !important; }

/* ---------- HUD ---------- */
#hud {
  position: fixed; inset: 0; pointer-events: none;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
}
.hudRow {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 8px; padding: 10px 12px;
}
.chip {
  pointer-events: none;
  display: flex; align-items: center; gap: 8px;
  background: rgba(20, 8, 30, 0.55);
  border-radius: 16px; padding: 8px 14px;
  color: #fff; font-size: 15px; font-weight: 600;
  backdrop-filter: blur(4px);
  border: 2px solid transparent;
}
.chip.you { border-color: var(--you); }
.chip.boulder { border-color: var(--boulder); }
.chip .ico { font-size: 22px; }
.chip .lbl { display: none; }
.chip .stat { opacity: 0.92; white-space: nowrap; }
.chip .stat b { color: var(--sun); font-size: 17px; }

.center { text-align: center; color: #fff; }
.turn {
  display: inline-block;
  font-size: 18px; font-weight: 800; letter-spacing: 0.3px;
  padding: 6px 16px; border-radius: 14px;
  background: rgba(20, 8, 30, 0.55);
  backdrop-filter: blur(4px);
}
.turn.you { color: #fff; box-shadow: 0 0 0 2px var(--you) inset; }
.turn.boulder { color: #fff; box-shadow: 0 0 0 2px var(--boulder) inset; }
.center .meta { margin-top: 6px; font-size: 13px; opacity: 0.9; }
.center .meta b { color: var(--sun); }

.hudBtns {
  position: fixed; right: 12px; bottom: 12px;
  display: flex; gap: 10px; pointer-events: auto;
  padding-bottom: env(safe-area-inset-bottom);
}
.iconBtn {
  width: 54px; height: 54px; border-radius: 50%;
  border: none; font-size: 24px; font-weight: 800;
  background: rgba(20, 8, 30, 0.62); color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; backdrop-filter: blur(4px);
  box-shadow: 0 3px 10px rgba(0,0,0,0.3);
  transition: transform 0.08s;
}
.iconBtn:active { transform: scale(0.9); }

/* ---------- Overlays ---------- */
.overlay {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 10;
}
.titleCard, .tutCard, .goCard {
  text-align: center; color: #fff; max-width: 560px; width: 100%;
  padding: 28px 26px;
}

.gameTitle {
  font-size: clamp(42px, 9vw, 84px); line-height: 0.92;
  font-weight: 900; letter-spacing: 1px;
  color: #fff;
  text-shadow: 0 4px 0 #c0392b, 0 8px 22px rgba(0,0,0,0.4);
}
.gameTitle span { color: var(--sun); text-shadow: 0 4px 0 #d98b1a, 0 8px 22px rgba(0,0,0,0.4); }
.tagline { margin: 18px 0 26px; font-size: clamp(15px, 3.5vw, 20px); line-height: 1.45; opacity: 0.96; }
.credit { margin-top: 20px; font-size: 15px; opacity: 0.85; font-style: italic; }

.bigBtn {
  border: none; cursor: pointer;
  font-size: clamp(22px, 5vw, 30px); font-weight: 900;
  color: #3a1550; background: linear-gradient(#ffe08a, var(--sun));
  padding: 16px 44px; border-radius: 44px;
  box-shadow: 0 6px 0 #d98b1a, 0 10px 24px rgba(0,0,0,0.35);
  transition: transform 0.08s, box-shadow 0.08s;
}
.bigBtn:active { transform: translateY(4px); box-shadow: 0 2px 0 #d98b1a, 0 6px 14px rgba(0,0,0,0.35); }

/* tutorial */
.tutCard { background: rgba(30, 12, 46, 0.82); border-radius: 28px; backdrop-filter: blur(6px); }
.tutDiagram { width: 200px; height: 120px; margin: 0 auto 12px; }
.tutDiagram svg { width: 100%; height: 100%; background: rgba(255,255,255,0.08); border-radius: 18px; }
.tutCard h2 { font-size: clamp(24px, 5vw, 32px); margin-bottom: 10px; }
.tutCard p { font-size: clamp(15px, 3.6vw, 19px); line-height: 1.45; margin-bottom: 18px; opacity: 0.95; }
.dots { display: flex; gap: 10px; justify-content: center; margin-bottom: 20px; }
.dot { width: 11px; height: 11px; border-radius: 50%; background: rgba(255,255,255,0.3); }
.dot.on { background: var(--sun); transform: scale(1.2); }

/* game over */
.goCard { background: rgba(30, 12, 46, 0.82); border-radius: 28px; backdrop-filter: blur(6px); }
.goTitle { font-size: clamp(34px, 8vw, 64px); font-weight: 900; text-shadow: 0 4px 0 rgba(0,0,0,0.25); }
.goTitle.win { color: var(--sun); }
.goTitle.lose { color: var(--pink); }
.goTitle.tie { color: #fff; }
.goSub { margin: 16px 0 8px; font-size: clamp(15px, 3.6vw, 20px); }
.goHigh { margin-bottom: 22px; font-size: clamp(15px, 3.6vw, 20px); opacity: 0.9; }
.goHigh.newrec {
  color: var(--sun); font-weight: 800; opacity: 1;
  animation: pop 0.7s ease-in-out infinite alternate;
}
@keyframes pop { from { transform: scale(1); } to { transform: scale(1.08); } }

@media (orientation: portrait) {
  .tagline::after {
    content: "\A(Tip: turn your device sideways for the best view!)";
    white-space: pre; font-size: 0.8em; opacity: 0.8;
  }
}
