/* Super Hexagon–style overlay */

.hex-root {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #000;
  color: #fff;
  font-family: var(--font-body);
  overflow: clip;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.hex-root[hidden] {
  display: none !important;
}

.hex-root canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: none;
}

.hex-hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: var(--space-lg);
}

.hex-time {
  justify-self: center;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 5.5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.9;
  margin: 0;
  text-shadow: 0 0 24px currentColor;
}

.hex-best {
  justify-self: center;
  margin: var(--space-xs) 0 0;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.7;
}

.hex-hint {
  justify-self: center;
  font-size: var(--text-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.55;
  text-align: center;
}

.hex-panel {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: oklch(0% 0 0 / 0.28);
  pointer-events: auto;
  cursor: auto;
}

.hex-panel[hidden] {
  display: none !important;
}

.hex-card {
  text-align: center;
  padding: var(--space-xl);
}

.hex-card h2 {
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 6.5rem);
  font-style: normal;
  font-weight: 700;
  letter-spacing: -0.05em;
  margin: 0;
  line-height: 0.85;
}

.hex-card p {
  margin: var(--space-md) 0 var(--space-xl);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: var(--text-sm);
  opacity: 0.8;
}

.hex-card button {
  min-height: 2.75rem;
  padding: 0 var(--space-xl);
  border: var(--rule-hair) solid currentColor;
  border-radius: var(--radius-pill);
  background: transparent;
  color: inherit;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}

.hex-card button:hover,
.hex-card button.is-hover {
  background: #fff;
  color: #000;
}

.hex-card button:focus-visible,
.hex-card button.is-focus {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.hex-card button:active,
.hex-card button.is-active {
  transform: translateY(1px);
}

.hex-card button:disabled,
.hex-card button.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.hex-card button[aria-busy="true"],
.hex-card button.is-loading {
  opacity: 0.7;
}

.hex-card button[data-state="error"],
.hex-card button.is-error {
  border-color: #f66;
  color: #f66;
}

.hex-card button[data-state="success"],
.hex-card button.is-success {
  border-color: #6f6;
  color: #6f6;
}

.hex-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
}

.hex-root.is-menu canvas {
  cursor: auto;
}

body.hex-open {
  overflow: hidden;
}

.hex-over-time {
  font-family: var(--font-display);
  font-size: clamp(2rem, 7vw, 4rem);
  font-weight: 700;
  margin: var(--space-md) 0 0;
}

@media (prefers-reduced-motion: reduce) {
  .hex-card button:active,
  .hex-card button.is-active {
    transform: none;
  }
}
