/* Turkey Run — page and HUD styling. Warm autumn palette, chunky readable type. */
* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: #2b1d12;
  font-family: "Trebuchet MS", "Segoe UI", Verdana, sans-serif;
  overflow: hidden;
}

#stage {
  position: relative;
  width: 1280px;
  height: 720px;
  margin: 0 auto;
  top: 50%;
  transform: translateY(-50%) scale(var(--stage-scale, 1));
  transform-origin: center center;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.6);
  border-radius: 8px;
  overflow: hidden;
}

canvas#game {
  display: block;
  width: 1280px;
  height: 720px;
  background: #f7c873;
}

.hidden { display: none !important; }

/* ---- HUD ---- */
#hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 20px;
  pointer-events: none;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45), 0 0 12px rgba(0, 0, 0, 0.35);
  z-index: 5;
}

.hud-left, .hud-right { display: flex; flex-direction: column; gap: 4px; }
.hud-right { text-align: right; }
.hud-center { text-align: center; }

.hud-label {
  font-size: 12px;
  letter-spacing: 2px;
  opacity: 0.85;
  margin-right: 8px;
}

.hud-score span:last-child, .hud-dist span:last-child,
.hud-hearts span:last-child, .hud-corn span:last-child {
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
}

#hud-stage {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 4px;
  background: rgba(43, 29, 18, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  padding: 6px 18px;
  display: inline-block;
}

#hud-combo {
  margin-top: 8px;
  font-size: 24px;
  font-weight: 900;
  color: #ffd94a;
  animation: combo-pop 0.25s ease-out;
}

@keyframes combo-pop {
  from { transform: scale(1.6); }
  to { transform: scale(1); }
}

#hud-hearts { color: #ff5a5a; letter-spacing: 2px; }

/* ---- Overlays ---- */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(43, 29, 18, 0.45);
  z-index: 10;
}

.panel {
  background: rgba(255, 248, 232, 0.97);
  border: 4px solid #8a5a2b;
  border-radius: 20px;
  padding: 30px 44px 26px;
  text-align: center;
  max-width: 640px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  color: #3a2410;
}

.title-kicker {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 4px;
  color: #b3541e;
}

.panel h1 {
  font-size: 64px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #7a3b06;
  line-height: 1.05;
  margin: 6px 0 10px;
  text-shadow: 0 3px 0 #ffd94a;
}

.title-sub {
  font-size: 19px;
  line-height: 1.45;
  color: #5a3a1a;
  margin-bottom: 16px;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 16px;
  color: #3a2410;
  background: #f3e2b8;
  border-radius: 12px;
  padding: 12px 18px;
  margin-bottom: 18px;
}

.controls b { color: #7a3b06; }

.big-btn {
  font-family: inherit;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #fff;
  background: linear-gradient(#e2701d, #b3541e);
  border: none;
  border-radius: 999px;
  padding: 14px 34px;
  cursor: pointer;
  box-shadow: 0 5px 0 #7a3b06, 0 8px 18px rgba(0, 0, 0, 0.35);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.big-btn:hover { transform: translateY(-2px); }
.big-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #7a3b06; }
.big-btn:focus-visible { outline: 4px solid #ffd94a; outline-offset: 3px; }

.title-tip {
  margin-top: 16px;
  font-size: 14px;
  color: #7a5a34;
}

.end-stats {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin: 6px 0 20px;
  font-size: 18px;
}

.end-stats > div { display: flex; flex-direction: column; gap: 2px; }
.end-stats .hud-label { margin: 0; color: #b3541e; }
.end-stats span:last-child { font-size: 30px; font-weight: 900; color: #7a3b06; }

/* ---- Toast (stage change banner) ---- */
#toast {
  position: absolute;
  top: 110px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(43, 29, 18, 0.8);
  color: #ffd94a;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 3px;
  padding: 10px 26px;
  border-radius: 999px;
  border: 2px solid #ffd94a;
  z-index: 6;
  pointer-events: none;
  animation: toast-in 0.3s ease-out;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) scale(0.8); }
  to { opacity: 1; transform: translateX(-50%) scale(1); }
}
