*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #07140c;
  --card: rgba(10, 32, 18, 0.86);
  --text: #f3ffef;
  --muted: #9fc4a8;
  --accent: #7dff4a;
  --gold: #ffd60a;
  --hit: #ff453a;
  --line: rgba(180, 255, 190, 0.16);
}

html,
body {
  min-height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background: #041008;
  -webkit-font-smoothing: antialiased;
}

.top {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem 0.4rem;
}

.brand {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

h1 {
  font-size: 1.7rem;
  letter-spacing: -0.05em;
  font-weight: 650;
}

.lede {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 46rem;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem 1.5rem;
}

.stage {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  background: #07180e;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  user-select: none;
}

.sky {
  position: relative;
  height: min(72vh, 700px);
  min-height: 520px;
  overflow: hidden;
  background:
    radial-gradient(1100px 420px at 50% -8%, #1f6a32 0%, transparent 58%),
    radial-gradient(700px 280px at 80% 20%, rgba(125, 255, 74, 0.16), transparent 60%),
    linear-gradient(180deg, #062010 0%, #0b2a16 42%, #12381c 78%, #184422 100%);
}

.stars span {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #d9ffc8;
  opacity: 0.7;
  animation: twinkle 3.4s ease-in-out infinite;
}

.aurora {
  position: absolute;
  inset: 0 0 30% 0;
  background: linear-gradient(180deg, rgba(125, 255, 74, 0.16), transparent 70%);
  pointer-events: none;
}

.inbounds {
  position: absolute;
  inset: 0 0 18% 0;
  z-index: 3;
}

.inbound {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.28rem;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 3;
}

.inbound.pop {
  animation: pop-out 0.38s ease forwards;
}

.stage:focus {
  outline: none;
}

.pod {
  width: 28px;
  height: 36px;
  border-radius: 50% 50% 46% 48%;
  background: linear-gradient(180deg, #d8ff9a, #62e04a 48%, #1f9a38);
  box-shadow: 0 0 16px rgba(98, 224, 74, 0.55);
  position: relative;
}

.pod::before,
.pod::after {
  content: "";
  position: absolute;
  top: 11px;
  width: 6px;
  height: 7px;
  border-radius: 50%;
  background: #143018;
}

.pod::before {
  left: 6px;
}

.pod::after {
  right: 6px;
}

.inbound.drop .pod {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  clip-path: none;
  background: radial-gradient(circle at 35% 30%, #f6ffc4, #7dff4a 42%, #2f9e3a);
  box-shadow: 0 0 18px rgba(125, 255, 74, 0.5);
}

.inbound.boss .pod {
  width: 68px;
  height: 24px;
  border-radius: 980px;
  clip-path: none;
  background: linear-gradient(180deg, #e8ffc4, #4ade80 55%, #166534);
  box-shadow: 0 0 22px rgba(74, 222, 128, 0.55);
}

.inbound.boss .pod::before,
.inbound.boss .pod::after {
  top: 7px;
  width: 8px;
  height: 8px;
  background: #7dff4a;
}

.inbound.boss .pod::before {
  left: 18px;
}

.inbound.boss .pod::after,
.inbound.mothership .pod::after {
  right: 18px;
}

.inbound.mothership .pod {
  width: 92px;
  height: 32px;
  border-radius: 980px;
  clip-path: none;
  background: linear-gradient(180deg, #f3ffd2, #7dff4a 40%, #1f8a32 78%, #0d3b18);
  box-shadow: 0 0 28px rgba(125, 255, 74, 0.7);
}

.inbound.mothership .pod::before,
.inbound.mothership .pod::after {
  top: 10px;
  width: 10px;
  height: 10px;
  background: #fff6a8;
}

.inbound.mothership .pod::before {
  left: 24px;
}

.hearts {
  display: flex;
  gap: 0.1rem;
  font-size: 0.78rem;
  line-height: 1;
  color: #ff4d6d;
  text-shadow: 0 1px 2px #000;
}

.hearts .gone {
  color: rgba(255, 255, 255, 0.28);
}

.inbound.mothership .hearts {
  font-size: 0.95rem;
  gap: 0.14rem;
}

.inbound.heart-pop .hearts {
  animation: heart-pop 0.28s ease;
}

.word {
  font-size: 1.12rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: lowercase;
  color: #e8edff;
  text-shadow: 0 1px 2px #000;
  background: rgba(7, 11, 24, 0.72);
  border-radius: 8px;
  padding: 0.18rem 0.48rem;
  white-space: nowrap;
}

.inbound.boss .word,
.inbound.mothership .word {
  font-size: 1.02rem;
  letter-spacing: 0.06em;
}

.glyph.done {
  color: var(--accent);
}

.glyph.next {
  color: #06240c;
  background: var(--accent);
  border-radius: 4px;
  padding: 0 0.08em;
}

.inbound.locked {
  z-index: 5;
  filter: drop-shadow(0 0 10px rgba(125, 255, 74, 0.6));
}

.inbound.locked .word {
  outline: 2px solid var(--accent);
}

.inbound.warn .pod {
  box-shadow: 0 0 18px rgba(255, 69, 58, 0.8);
}

.ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 22%;
  z-index: 2;
  pointer-events: none;
}

.shield-arc {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 38%;
  height: 28px;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  border: 2px solid rgba(125, 255, 74, 0.45);
  box-shadow: 0 0 18px rgba(125, 255, 74, 0.22);
  opacity: 0.85;
  transition: border-color 0.2s ease, opacity 0.2s ease;
}

.buddy {
  position: absolute;
  left: 50%;
  bottom: 22%;
  z-index: 4;
  width: 108px;
  transform: translateX(-50%);
  animation: buddy-bob 2.6s ease-in-out infinite;
}

.buddy svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.28));
}

.buddy-glow {
  fill: rgba(125, 255, 74, 0.28);
}

.buddy-body {
  fill: #62e04a;
  stroke: #1f8a32;
  stroke-width: 2;
}

.buddy-belly {
  fill: #c8ff8a;
}

.buddy-arm {
  fill: #4ade4a;
  stroke: #1f8a32;
  stroke-width: 1.5;
}

.buddy-wave {
  transform-origin: 98px 78px;
  animation: buddy-wave 1.4s ease-in-out infinite;
}

.buddy-eye {
  fill: #fff;
}

.buddy-pupil {
  fill: #143018;
}

.buddy-shine {
  fill: #fff;
}

.buddy-cheek {
  fill: #ff9aa8;
}

.buddy-ant {
  stroke: #2f9e3a;
  stroke-width: 3;
  stroke-linecap: round;
}

.buddy-ant-tip {
  fill: #b8ff4a;
  stroke: #1f8a32;
  stroke-width: 1.5;
}

.buddy-smile,
.buddy-frown {
  fill: none;
  stroke: #143018;
  stroke-width: 3.5;
  stroke-linecap: round;
}

.buddy-frown {
  display: none;
}

.buddy.cheer {
  animation: buddy-cheer 0.42s ease;
}

.buddy.ouch {
  animation: buddy-ouch 0.35s ease;
}

.buddy.ouch .buddy-smile {
  display: none;
}

.buddy.ouch .buddy-frown {
  display: block;
}

.stage.hurt .shield-arc {
  border-color: var(--hit);
  box-shadow: 0 0 22px rgba(255, 69, 58, 0.35);
}

.farm {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 140px;
}

.radio,
.aim-dock,
.banner {
  position: absolute;
  z-index: 4;
  pointer-events: none;
}

.banner {
  left: 50%;
  top: 1rem;
  transform: translateX(-50%);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #143018;
  background: #b8ff4a;
  border-radius: 980px;
  padding: 0.32rem 0.9rem;
  box-shadow: 0 4px 0 #4a8a20;
}

.type-catch {
  position: absolute;
  inset: 0;
  z-index: 9;
  opacity: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  outline: none;
  font-size: 16px;
}

.radio {
  left: 1rem;
  bottom: 0.7rem;
  font-size: 0.78rem;
  font-weight: 650;
  color: #d4f5c8;
  text-shadow: 0 1px 2px #000;
}

.aim-dock {
  right: 1rem;
  bottom: 0.65rem;
  font-size: 1.05rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  color: var(--accent);
  text-shadow: 0 1px 2px #000;
  text-transform: lowercase;
}

.hud {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.85rem 1.1rem;
  padding: 0.7rem 0.95rem 0.55rem;
  background: #0d2414;
  border-top: 1px solid var(--line);
}

.hud-block span,
.hud-shield span {
  display: block;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.hud-block strong {
  display: block;
  font-size: 1.28rem;
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.hud-shield {
  flex: 1;
  min-width: 8rem;
}

.shield-track {
  margin-top: 0.28rem;
  height: 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.shield-track i {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #30d158, var(--accent));
  transition: width 0.2s ease, background 0.2s ease;
}

.shield-track i.low {
  background: linear-gradient(90deg, #ff453a, #ffd60a);
}

.hud-actions {
  display: flex;
  gap: 0.4rem;
}

.lesson {
  padding: 0.45rem 0.95rem 0.65rem;
  background: #0d2414;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(4, 18, 8, 0.42);
  overflow: auto;
}

.overlay.hidden,
.hidden {
  display: none !important;
}

.overlay-card {
  width: min(100%, 440px);
  background: rgba(10, 36, 18, 0.9);
  border: 1px solid rgba(125, 255, 74, 0.22);
  border-radius: 22px;
  padding: 1rem 1.1rem 1.15rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
}

.score-brand {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.overlay h2 {
  font-size: 1.45rem;
  letter-spacing: -0.03em;
  margin: 0.15rem 0 0.35rem;
}

.overlay-copy,
.score-run {
  color: var(--muted);
  margin-bottom: 0.8rem;
  line-height: 1.4;
}

.nights {
  display: grid;
  gap: 0.55rem;
}

.night-btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  text-align: left;
  border: none;
  border-radius: 16px;
  padding: 0.75rem 0.85rem;
  color: #fff;
  cursor: pointer;
  background: #163820;
}

.night-btn strong {
  display: block;
  font-size: 1.02rem;
}

.night-btn span {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.8rem;
  opacity: 0.88;
}

.night-btn.watch {
  background: linear-gradient(90deg, #1f9d3a 0%, #62e04a 42%, #b8ff4a);
  color: #06240c;
}

.night-btn:hover {
  filter: brightness(1.08);
}

.board-list {
  list-style: none;
  max-height: 9rem;
  overflow: auto;
  margin-bottom: 0.7rem;
}

.board-list li {
  display: grid;
  grid-template-columns: 1.4rem 1fr auto;
  gap: 0.4rem;
  padding: 0.28rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
}

.board-form input {
  width: 100%;
  border: 1px solid var(--line);
  background: #082010;
  color: var(--text);
  border-radius: 12px;
  padding: 0.55rem 0.7rem;
  font: inherit;
  margin-bottom: 0.45rem;
}

.board-status {
  min-height: 1.2rem;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.55rem;
}

.score-actions {
  display: grid;
  gap: 0.45rem;
}

.btn-play,
.btn-ghost {
  border: none;
  border-radius: 12px;
  padding: 0.62rem 0.8rem;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.btn-play {
  background: var(--gold);
  color: #1d1d1f;
  box-shadow: 0 4px 0 #b89600;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.pause-card {
  position: absolute;
  inset: 0;
  z-index: 13;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  background: rgba(4, 18, 8, 0.55);
}

.pause-card p {
  font-size: 1.6rem;
  font-weight: 650;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.25;
  }
  50% {
    opacity: 0.95;
  }
}

@keyframes pop-out {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.4);
    opacity: 0;
  }
}

@keyframes heart-pop {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.35);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes buddy-bob {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(-7px);
  }
}

@keyframes buddy-wave {
  0%,
  100% {
    transform: rotate(8deg);
  }
  50% {
    transform: rotate(-28deg);
  }
}

@keyframes buddy-cheer {
  0%,
  100% {
    transform: translateX(-50%) scale(1);
  }
  40% {
    transform: translateX(-50%) translateY(-14px) scale(1.08);
  }
}

@keyframes buddy-ouch {
  0%,
  100% {
    transform: translateX(-50%) rotate(0);
  }
  30% {
    transform: translateX(-50%) rotate(-10deg);
  }
  60% {
    transform: translateX(-50%) rotate(8deg);
  }
}

@media (max-width: 720px) {
  .sky {
    min-height: 460px;
    height: min(68vh, 580px);
  }

  .hud-block strong {
    font-size: 1.05rem;
  }

  .aim-dock {
    font-size: 0.88rem;
  }

  .radio {
    max-width: 48%;
  }
}
