.hf-game {
  --hf-game-ink: #173e35;
  --hf-game-lime: #d8f582;
  --hf-game-paper: #f7f8f2;
  --hf-game-mint: #e1ecd9;
  --hf-game-sky: #d7e7f5;
  --hf-game-muted: #536b61;
  --hf-game-border: rgba(23, 62, 53, .25);
  --hf-game-display: "Archivo Black", "Arial Black", sans-serif;
  --hf-game-body: "DM Sans", Arial, sans-serif;
  --hf-game-mono: "IBM Plex Mono", "Courier New", monospace;
  color: var(--hf-game-ink);
  background: var(--hf-game-paper);
  border: 1px solid var(--hf-game-ink);
  border-radius: 18px;
  overflow: hidden;
  font-family: var(--hf-game-body);
  font-size: 16px;
  line-height: 1.45;
}

.hf-game *,
.hf-game *::before,
.hf-game *::after { box-sizing: border-box; }
.hf-game [hidden] { display: none !important; }
.hf-game button {
  font-family: var(--hf-game-body);
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}
.hf-game button:focus-visible,
.hf-game-stage:focus-visible { outline: 3px solid var(--hf-game-ink); outline-offset: -6px; }
.hf-game button:focus-visible { outline-offset: 4px; }

.hf-game-topbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 26px;
  border-bottom: 1px solid var(--hf-game-ink);
  background: var(--hf-game-paper);
}
.hf-game-brand { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.hf-game-brand-icon {
  display: grid;
  place-items: center;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border: 1px solid var(--hf-game-ink);
  border-radius: 50%;
  background: var(--hf-game-lime);
  font-family: var(--hf-game-body);
  font-size: 30px;
  font-weight: 500;
  line-height: 1;
}
.hf-game-eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--hf-game-muted);
  font-family: var(--hf-game-mono);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: -.025em;
  line-height: 1.3;
}
.hf-game-name {
  margin: 0;
  font-family: var(--hf-game-display);
  font-size: clamp(19px, 2vw, 24px);
  font-weight: 400;
  letter-spacing: -.05em;
  line-height: 1.08;
}
.hf-game-hud { display: flex; align-items: center; gap: 28px; }
.hf-game-stat { min-width: 70px; }
.hf-game-stat > span {
  display: block;
  margin-bottom: 6px;
  color: var(--hf-game-muted);
  font-family: var(--hf-game-mono);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: -.025em;
  line-height: 1.2;
  white-space: nowrap;
}
.hf-game-stat output {
  display: block;
  font-family: var(--hf-game-display);
  font-size: 25px;
  font-weight: 400;
  letter-spacing: -.05em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.hf-game-stat output span { margin-left: 3px; font-family: var(--hf-game-mono); font-size: 14px; font-weight: 400; letter-spacing: 0; }
.hf-game-pause {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 14px;
  color: var(--hf-game-ink);
  background: transparent;
  border: 1px solid var(--hf-game-border);
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.hf-game-pause:hover:not(:disabled) { background: var(--hf-game-mint); border-color: var(--hf-game-ink); }
.hf-game-pause:disabled { opacity: .4; cursor: default; }
.hf-game-pause-icon { font-family: system-ui, sans-serif; font-size: 18px; line-height: 1; }

.hf-game-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 1;
  min-height: 400px;
  max-height: 520px;
  overflow: hidden;
  background: var(--hf-game-sky);
  isolation: isolate;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}
.hf-game[data-state="running"] .hf-game-stage { cursor: pointer; touch-action: none; }
.hf-game-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.hf-game-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(215, 231, 245, .18);
  pointer-events: none;
}
.hf-game-overlay-card {
  width: min(370px, 100%);
  padding: 28px;
  border: 1px solid var(--hf-game-ink);
  border-radius: 16px;
  background: var(--hf-game-paper);
  text-align: center;
}
.hf-game-overlay-tag {
  display: block;
  margin-bottom: 12px;
  color: var(--hf-game-muted);
  font-family: var(--hf-game-mono);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: -.03em;
  line-height: 1.3;
}
.hf-game-overlay-title {
  margin: 0 0 12px;
  font-family: var(--hf-game-display);
  font-size: clamp(25px, 3vw, 30px);
  font-weight: 400;
  letter-spacing: -.055em;
  line-height: 1.1;
}
.hf-game-overlay-copy { margin: 0 auto 22px; max-width: 280px; color: var(--hf-game-muted); font-size: 16px; font-weight: 400; line-height: 1.5; }
.hf-game-start {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid var(--hf-game-ink);
  border-radius: 10px;
  color: var(--hf-game-lime);
  background: var(--hf-game-ink);
  font-weight: 700;
  line-height: 1.35;
  cursor: pointer;
  pointer-events: auto;
  transition: background .15s ease, color .15s ease;
}
.hf-game-start:hover:not(:disabled) { background: #245a4b; }
.hf-game-start:active:not(:disabled) { background: #0d3028; }
.hf-game-start:disabled { opacity: .45; cursor: default; }
.hf-game-overlay-hint {
  display: block;
  margin-top: 18px;
  color: var(--hf-game-muted);
  font-family: var(--hf-game-mono);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: -.035em;
  line-height: 1.4;
}
.hf-game-restart {
  display: block;
  margin: 14px auto 0;
  min-height: 36px;
  padding: 5px 10px;
  border: 0;
  color: var(--hf-game-muted);
  background: transparent;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
  pointer-events: auto;
}
.hf-game-restart:hover { color: var(--hf-game-ink); }
.hf-game-result { margin: -2px 0 22px; }
.hf-game-result-score {
  display: block;
  font-family: var(--hf-game-display);
  font-size: 44px;
  font-weight: 400;
  letter-spacing: -.06em;
  line-height: 1;
}
.hf-game-result-caption { display: block; margin-top: 7px; color: var(--hf-game-muted); font-family: var(--hf-game-mono); font-size: 14px; line-height: 1.4; }
.hf-game-flight-hint {
  position: absolute;
  left: 50%;
  bottom: 24px;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 9px 14px;
  border: 1px solid var(--hf-game-border);
  border-radius: 8px;
  background: var(--hf-game-paper);
  color: var(--hf-game-ink);
  font-family: var(--hf-game-mono);
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.hf-game-flight-hint-visible { opacity: 1; }

.hf-game-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 26px;
  border-top: 1px solid var(--hf-game-ink);
  background: var(--hf-game-paper);
}
.hf-game-footer p { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--hf-game-muted); font-size: 16px; line-height: 1.45; }
.hf-game-footer p > span:last-child { margin-left: 6px; }
.hf-game-key {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--hf-game-border);
  border-radius: 5px;
  color: var(--hf-game-ink);
  background: var(--hf-game-mint);
  font-family: var(--hf-game-mono);
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -.03em;
}
.hf-game-key-arrow { min-width: 28px; }
.hf-game-footer-note { color: var(--hf-game-muted); font-family: var(--hf-game-mono); font-size: 14px; letter-spacing: -.035em; white-space: nowrap; }
.hf-game-sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

@media (max-width: 800px) {
  .hf-game-topbar { flex-wrap: wrap; gap: 22px; padding: 20px; }
  .hf-game-hud { gap: 24px; margin-left: auto; }
  .hf-game-brand { gap: 12px; }
  .hf-game-brand-icon { flex-basis: 42px; width: 42px; height: 42px; font-size: 28px; }
  .hf-game-name { font-size: 21px; }
  .hf-game-stat output { font-size: 24px; }
  .hf-game-pause { min-width: 44px; padding: 10px; }
  .hf-game-pause-label { display: none; }
  .hf-game-footer { padding: 16px 20px; }
  .hf-game-footer-note { display: none; }
}

@media (max-width: 560px) {
  .hf-game { border-radius: 18px; }
  .hf-game-topbar { gap: 20px; padding: 20px 18px; }
  .hf-game-brand { flex: 1 1 100%; }
  .hf-game-name { font-size: 22px; }
  .hf-game-hud { display: grid; grid-template-columns: 1fr 1fr auto; width: 100%; gap: 16px; }
  .hf-game-stat { min-width: 0; }
  .hf-game-stat output { font-size: 26px; }
  .hf-game-stage { aspect-ratio: 4 / 5; min-height: 430px; max-height: 520px; }
  .hf-game-overlay { padding: 18px; }
  .hf-game-overlay-card { max-width: 340px; padding: 24px 22px; }
  .hf-game-overlay-title { font-size: 28px; }
  .hf-game-overlay-copy { margin-bottom: 20px; }
  .hf-game-footer { justify-content: center; padding: 17px 16px; }
  .hf-game-footer p { justify-content: center; flex-wrap: wrap; gap: 8px; text-align: center; }
  .hf-game-footer p > span:last-child { flex-basis: 100%; margin: 2px 0 0; }
}

@media (max-width: 365px) {
  .hf-game-topbar { padding: 18px 14px; }
  .hf-game-brand-icon { display: none; }
  .hf-game-name { font-size: 21px; }
  .hf-game-hud { gap: 10px; }
  .hf-game-overlay { padding: 14px; }
  .hf-game-overlay-card { padding: 24px 18px; }
  .hf-game-overlay-title { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .hf-game *, .hf-game *::before, .hf-game *::after { transition: none !important; }
}
