.fbd-game {
  --fbd-blue: #70d6ff;
  --fbd-deep-blue: #38a3d1;
  --fbd-yellow: #ffd166;
  --fbd-orange: #f77f00;
  --fbd-green: #2ecc71;
  --fbd-dark: #17324d;
  max-width: 560px;
  margin: 2rem auto;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.fbd-game * {
  box-sizing: border-box;
}

.fbd-game__stage {
  position: relative;
  width: min(100%, 420px);
  height: min(var(--fbd-height, 640px), 82vh);
  min-height: 420px;
  margin: 0 auto;
  overflow: hidden;
  border: 8px solid #fff;
  border-radius: 28px;
  background: linear-gradient(#70d6ff 0%, #9be7ff 60%, #b7efc5 60%, #8bd67c 100%);
  box-shadow: 0 24px 60px rgba(13, 42, 70, 0.28), inset 0 0 0 2px rgba(23, 50, 77, 0.12);
  touch-action: manipulation;
  user-select: none;
}

.fbd-game__canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.fbd-game__hud {
  position: absolute;
  inset: 18px 18px auto 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  pointer-events: none;
  color: #fff;
  text-shadow: 0 3px 0 rgba(23, 50, 77, 0.32);
}

.fbd-game__score {
  font-size: clamp(2.4rem, 9vw, 4.8rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.06em;
}

.fbd-game__best {
  margin-top: 0.2rem;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  background: rgba(23, 50, 77, 0.28);
  font-weight: 800;
  font-size: 0.9rem;
  backdrop-filter: blur(5px);
}

.fbd-game__panel {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(calc(100% - 42px), 330px);
  transform: translate(-50%, -50%);
  padding: 1.35rem;
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 42px rgba(23, 50, 77, 0.25);
  color: var(--fbd-dark);
  text-align: center;
  backdrop-filter: blur(8px);
}

.fbd-game__panel.is-hidden {
  display: none;
}

.fbd-game__panel h2 {
  margin: 0 0 0.55rem;
  color: var(--fbd-dark);
  font-size: clamp(1.6rem, 5vw, 2.25rem);
  line-height: 1;
}

.fbd-game__panel p {
  margin: 0.45rem 0;
}

.fbd-game__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 0.8rem;
  padding: 0.7rem 1.15rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--fbd-yellow), var(--fbd-orange));
  box-shadow: 0 5px 0 #b95b00, 0 10px 22px rgba(247, 127, 0, 0.32);
  color: #442300;
  cursor: pointer;
  font-weight: 900;
}

.fbd-game__button:focus-visible {
  outline: 3px solid #17324d;
  outline-offset: 3px;
}

.fbd-game__button:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #b95b00, 0 6px 16px rgba(247, 127, 0, 0.25);
}

.fbd-game__controls {
  color: rgba(23, 50, 77, 0.72);
  font-size: 0.82rem;
}

@media (max-width: 480px) {
  .fbd-game {
    margin: 1rem auto;
  }

  .fbd-game__stage {
    border-width: 5px;
    border-radius: 22px;
  }
}
