.flappy-code {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 20px;
}

.flappy-code button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #e5e7eb;
  border-radius: 50%;
  background: #f3f4f6;
  color: #9ca3af;
  font: 500 15px/1 'Inter', sans-serif;
  cursor: pointer;
  transition: color 150ms, background 150ms, border-color 150ms;
}

.flappy-code button:hover,
.flappy-code button.is-entered {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #2563eb;
}

.flappy-code button:focus-visible,
.flappy-dialog button:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 3px;
}

.flappy-dialog {
  box-sizing: border-box;
  width: min(448px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 22px;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fff;
  color: #374151;
  box-shadow: 0 24px 80px #11182733;
  font-family: 'Inter', sans-serif;
}

.flappy-dialog::backdrop {
  background: #11182799;
}

.flappy-header,
.flappy-scores {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flappy-eyebrow {
  margin: 0 0 4px;
  color: #6b7280;
  font-size: 12px;
}

.flappy-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
}

.flappy-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.flappy-scores {
  margin: 18px 0 10px;
  color: #6b7280;
  font-size: 13px;
}

.flappy-scores strong {
  margin-left: 5px;
  color: #1d4ed8;
  font-variant-numeric: tabular-nums;
}

.flappy-stage {
  position: relative;
  width: min(100%, 400px, calc((100dvh - 230px) * 5 / 6));
  min-width: 180px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #eff6ff;
}

#flappy-canvas {
  display: block;
  width: 100%;
  height: auto;
  touch-action: none;
}

.flappy-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: #eff6ffcc;
  text-align: center;
}

.flappy-overlay[hidden] {
  display: none;
}

#flappy-message {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.flappy-action {
  border: 0;
  border-radius: 8px;
  padding: 10px 20px;
  background: #2563eb;
  color: #fff;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.flappy-action:hover {
  background: #1d4ed8;
}

#flappy-instructions {
  margin: 14px 0 0;
  color: #6b7280;
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}

@media (max-width: 480px) {
  .flappy-code {
    gap: 3px;
  }

  .flappy-code button {
    width: 22px;
    height: 22px;
    font-size: 13px;
  }

  .flappy-dialog {
    padding: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .flappy-code button {
    transition: none;
  }
}
