:root {
  --bg-primary: #000000;
  --surface: #10141b;
  --surface-strong: #171d27;
  --text-primary: #ffffff;
  --text-secondary: #d7e2ea;
  --text-muted: #a8b5bf;
  --focus-ring: #00d4ff;
  --focus-glow: rgba(0, 212, 255, 0.46);
  --sky-top: #155061;
  --sky-bottom: #0f3344;
  --ink: #533846;
  --bird-yellow: #f8b635;
  --bird-light: #fad88c;
  --pipe-main: #73bf2e;
  --pipe-light: #e4fd8b;
  --pipe-dark: #558023;
  --ground: #ded896;
  --ground-shadow: #d7a84c;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 600px;
  height: 600px;
  margin: 0;
  overflow: hidden;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  font: inherit;
}

#app,
.screen {
  width: 600px;
  height: 600px;
}

.screen {
  position: absolute;
  inset: 0;
}

.hidden {
  display: none !important;
}

.game-shell {
  width: 600px;
  height: 600px;
  padding: 8px;
}

.game-world {
  position: relative;
  width: 584px;
  height: 584px;
  overflow: hidden;
  border: 2px solid rgba(228, 253, 139, 0.5);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0)),
    linear-gradient(180deg, var(--sky-top), var(--sky-bottom));
  box-shadow: inset 0 0 0 2px rgba(83, 56, 70, 0.75);
}

.flap-control {
  position: absolute;
  inset: 0;
  z-index: 11;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.flap-control:focus {
  outline: none;
  border-color: rgba(0, 212, 255, 0.7);
  box-shadow: inset 0 0 24px rgba(0, 212, 255, 0.18);
  transform: none;
}

.flap-control:disabled {
  cursor: default;
}

.hud {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  z-index: 20;
  pointer-events: none;
}

.hud-panel {
  min-width: 112px;
  padding: 8px 12px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(16, 20, 27, 0.88);
}

.hud-label {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1;
}

.hud strong {
  display: block;
  margin-top: 3px;
  font-size: 24px;
  line-height: 1;
  letter-spacing: 0;
}

.cloud {
  position: absolute;
  width: 76px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  box-shadow:
    18px -10px 0 4px rgba(255, 255, 255, 0.16),
    40px -4px 0 2px rgba(255, 255, 255, 0.14);
  opacity: 0.9;
}

.cloud-a {
  top: 96px;
  left: 64px;
}

.cloud-b {
  top: 154px;
  left: 350px;
  transform: scale(0.82);
}

.cloud-c {
  top: 62px;
  left: 485px;
  transform: scale(0.68);
}

.bird {
  position: absolute;
  left: 128px;
  top: 210px;
  width: 64px;
  height: 48px;
  z-index: 12;
  pointer-events: none;
  transform-origin: 46px 28px;
  will-change: transform, top;
}

.bird-body {
  position: absolute;
  left: 8px;
  top: 12px;
  width: 40px;
  height: 30px;
  border: 3px solid var(--ink);
  border-radius: 50% 46% 42% 50%;
  background: linear-gradient(135deg, var(--bird-light) 0 34%, var(--bird-yellow) 35% 100%);
}

.bird-wing {
  position: absolute;
  left: 8px;
  top: 25px;
  width: 24px;
  height: 16px;
  border: 3px solid var(--ink);
  border-radius: 60% 40% 56% 44%;
  background: #e07f2d;
}

.bird-eye {
  position: absolute;
  left: 37px;
  top: 12px;
  width: 18px;
  height: 18px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: #ffffff;
}

.bird-eye::after {
  content: "";
  position: absolute;
  right: 3px;
  top: 5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink);
}

.bird-beak {
  position: absolute;
  left: 47px;
  top: 28px;
  width: 22px;
  height: 13px;
  border: 3px solid var(--ink);
  border-left: 0;
  border-radius: 0 12px 12px 0;
  background: #fd3800;
}

.bird.idle {
  animation: birdFloat 0.8s ease-in-out infinite;
}

.bird.flapping .bird-wing {
  animation: wingBeat 0.22s steps(2, end) infinite;
}

.bird.tap-pulse .bird-body {
  animation: tapPulse 120ms ease-out;
}

.bird.up {
  transform: rotate(-20deg);
}

.bird.down {
  transform: rotate(28deg);
}

.bird.crashed {
  transform: rotate(88deg);
}

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

@keyframes wingBeat {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(18deg) translateY(3px);
  }
}

@keyframes tapPulse {
  0% {
    filter: brightness(1.55);
  }
  100% {
    filter: brightness(1);
  }
}

.pipe-pair {
  position: absolute;
  top: 0;
  left: 584px;
  width: 96px;
  height: 508px;
  z-index: 8;
  pointer-events: none;
  will-change: left;
}

.pipe {
  position: absolute;
  width: 96px;
  display: flex;
  align-items: center;
}

.pipe-top {
  top: 0;
  flex-direction: column;
}

.pipe-bottom {
  bottom: 0;
  flex-direction: column;
}

.pipe-body,
.pipe-cap {
  margin: 0 auto;
  background:
    linear-gradient(90deg,
      var(--pipe-main) 0 4%,
      var(--pipe-light) 4% 9%,
      var(--pipe-main) 9% 25%,
      #7ac535 25% 31%,
      var(--pipe-main) 31% 88%,
      var(--pipe-dark) 88% 96%,
      #7ac535 96% 100%);
  border-left: 4px solid var(--ink);
  border-right: 4px solid var(--ink);
}

.pipe-body {
  flex: 1 1 auto;
  width: 78px;
  min-height: 0;
}

.pipe-cap {
  width: 96px;
  height: 34px;
  flex: 0 0 34px;
  border-top: 4px solid var(--ink);
  border-bottom: 4px solid var(--ink);
}

.ground {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 584px;
  height: 76px;
  background: var(--ground);
  border-top: 4px solid var(--ink);
  z-index: 15;
  pointer-events: none;
  box-shadow: inset 0 8px 0 var(--ground-shadow);
}

.ground-stripes {
  height: 18px;
  border-top: 4px solid var(--pipe-light);
  border-bottom: 4px solid var(--pipe-dark);
  background: repeating-linear-gradient(-55deg, #73bf2e 0 10px, #9ce659 10px 20px);
  background-size: 28px 100%;
}

.ground.moving .ground-stripes {
  animation: moveStripes 1s linear infinite;
}

@keyframes moveStripes {
  to {
    background-position: -56px 0;
  }
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.28);
}

.overlay.hidden {
  display: none !important;
}

.overlay-panel {
  width: 420px;
  padding: 22px;
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(16, 20, 27, 0.92);
  text-align: center;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.overlay h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
}

.overlay p {
  margin: 10px auto 18px;
  max-width: 330px;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.35;
}

.primary-action {
  border: 2px solid transparent;
  color: var(--text-primary);
  background: var(--surface-strong);
  border-radius: 8px;
  cursor: pointer;
}

.primary-action {
  width: 100%;
  min-height: 88px;
  font-size: 20px;
  font-weight: 700;
  background: #f8b635;
  color: #20151b;
}

.focusable {
  transition:
    transform 475ms cubic-bezier(0.6, 0, 0.4, 1),
    border-color 300ms cubic-bezier(0.4, 0.04, 0.5, 1),
    box-shadow 300ms cubic-bezier(0.4, 0.04, 0.5, 1);
}

.focusable .content {
  opacity: 0.84;
}

.focusable:focus {
  outline: none;
  border-color: var(--focus-ring);
  box-shadow: 0 0 18px var(--focus-glow);
  transform: scale(calc(1 - 8 / 88));
}

.focusable:focus .content {
  opacity: 1;
}

.focusable:active {
  transform: scale(0.92);
}

.flap-control.focusable:focus,
.flap-control.focusable:active {
  transform: none;
}
