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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #7ec8ee;
  font-family: "Fredoka", system-ui, sans-serif;
  color: #3a2a18;
}

#view {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#fx {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 8;
}

.hidden { display: none !important; }

.screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(110, 180, 230, 0.18), rgba(40, 70, 40, 0.28));
  pointer-events: auto;
}

.panel, .title-card {
  background: linear-gradient(180deg, #fff8e8, #f3e2c0);
  border: 4px solid #6b4226;
  border-radius: 28px;
  box-shadow: 0 10px 0 #4a2c14, 0 18px 40px rgba(0, 0, 0, 0.28);
  padding: 36px 40px 32px;
  text-align: center;
  max-width: 560px;
  width: calc(100% - 40px);
}

.panel.wide { max-width: 920px; }

h1 {
  font-family: "Luckiest Guy", "Fredoka", sans-serif;
  font-size: clamp(56px, 10vw, 96px);
  letter-spacing: 2px;
  color: #f4f0de;
  -webkit-text-stroke: 6px #5a3214;
  paint-order: stroke fill;
  text-shadow: 0 8px 0 #3d220e;
  line-height: 0.95;
  animation: bob 2.6s ease-in-out infinite;
}

.win-title {
  font-size: clamp(36px, 6vw, 64px);
  margin-bottom: 10px;
}

h2 {
  font-family: "Luckiest Guy", "Fredoka", sans-serif;
  font-size: 40px;
  color: #5a3214;
  margin-bottom: 8px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 3px;
  font-weight: 600;
  color: #c45c1a;
  margin-bottom: 6px;
}

.tag, .sub, .fine {
  color: #6a4a2c;
  font-size: 18px;
  line-height: 1.45;
  margin: 8px 0 18px;
}

.fine { font-size: 14px; margin: 16px 0 0; opacity: 0.85; }

.btn-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-col { display: flex; flex-direction: column; gap: 10px; align-items: center; }

.btn {
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  font-size: 18px;
  border: 3px solid #5a3214;
  background: #f0d9a0;
  color: #3a2a18;
  padding: 12px 22px;
  border-radius: 16px;
  box-shadow: 0 5px 0 #5a3214;
  cursor: pointer;
  min-width: 160px;
}

.btn:hover { transform: translateY(1px); box-shadow: 0 4px 0 #5a3214; }
.btn:active { transform: translateY(5px); box-shadow: 0 0 0 #5a3214; }
.btn.primary { background: #7ed957; }
.btn:disabled { opacity: 0.45; cursor: default; box-shadow: 0 5px 0 #5a3214; transform: none; }

.how-list {
  text-align: left;
  margin: 8px 0 22px;
  padding-left: 8px;
  list-style: none;
}

.how-list li {
  margin: 10px 0;
  padding-left: 12px;
  border-left: 4px solid #8fd14f;
  line-height: 1.4;
  color: #4a3420;
}

.breed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 16px 0 22px;
}

.breed-card {
  border: 3px solid #6b4226;
  border-radius: 18px;
  background: #fffaf0;
  padding: 12px 10px 14px;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 4px 0 #6b4226;
}

.breed-card:hover { background: #fff3d6; }
.breed-card.selected {
  background: #d8f5a2;
  box-shadow: 0 0 0 3px #3f8c2a, 0 4px 0 #6b4226;
}

.breed-card h3 { font-size: 16px; margin-bottom: 4px; color: #5a3214; }
.breed-card p { font-size: 12px; color: #6a4a2c; line-height: 1.35; margin-bottom: 8px; }
.stat { font-size: 11px; display: flex; justify-content: space-between; gap: 6px; }
.pips { letter-spacing: 1px; color: #c45c1a; font-weight: 700; }

#hud {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.hud-top, .hud-bottom {
  position: absolute;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}

.hud-top { top: 14px; align-items: flex-start; }
.hud-bottom { bottom: 14px; }

.hud-panel {
  background: rgba(255, 246, 224, 0.92);
  border: 3px solid #6b4226;
  border-radius: 16px;
  padding: 10px 14px;
  box-shadow: 0 4px 0 rgba(74, 44, 20, 0.35);
  pointer-events: none;
}

.kicker { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: #c45c1a; font-weight: 700; }
.objective { font-weight: 600; font-size: 16px; }
.sheep-count, .timer { font-size: 20px; font-weight: 700; }
.breed-chip { font-weight: 700; font-size: 16px; align-self: flex-end; }

.bark-wrap { min-width: 200px; }
.bark-label, .stamina-label { font-size: 11px; font-weight: 700; letter-spacing: 1px; }
.stamina-label { margin-top: 6px; color: #6a4a2c; }
.bark-bar, .stamina-bar {
  height: 12px;
  background: #e6d3a8;
  border: 2px solid #6b4226;
  border-radius: 8px;
  overflow: hidden;
  margin-top: 4px;
}
#bark-fill { height: 100%; width: 100%; background: #5dade2; }
#stamina-fill { height: 100%; width: 100%; background: #7ed957; }

#minimap {
  width: 168px;
  height: 168px;
  border: 4px solid #6b4226;
  border-radius: 18px;
  background: #8fce6a;
  box-shadow: 0 4px 0 rgba(74, 44, 20, 0.35);
}

#toast {
  position: absolute;
  top: 92px;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Luckiest Guy", sans-serif;
  font-size: 28px;
  color: #fff8e8;
  -webkit-text-stroke: 4px #5a3214;
  paint-order: stroke fill;
  text-shadow: 0 4px 0 #3d220e;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

#toast.show { opacity: 1; }

#pause-hint {
  position: absolute;
  top: 16px;
  right: 200px;
  font-size: 12px;
  font-weight: 600;
  color: #fff8e8;
  text-shadow: 0 1px 2px #3d220e;
}

.mute {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 30;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 3px solid #5a3214;
  background: #fff6e0;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 0 #5a3214;
}

.stars { font-size: 36px; letter-spacing: 6px; margin: 8px 0 12px; color: #e6a317; }

.pop {
  position: absolute;
  font-family: "Luckiest Guy", sans-serif;
  font-size: 18px;
  color: #fff8e8;
  -webkit-text-stroke: 3px #5a3214;
  paint-order: stroke fill;
  pointer-events: none;
  animation: floatup 0.9s ease-out forwards;
  white-space: nowrap;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes floatup {
  0% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -48px); }
}

@media (max-width: 720px) {
  .hud-bottom { flex-wrap: wrap; }
  #minimap { width: 120px; height: 120px; }
  #pause-hint { display: none; }
}
