.reflex-page {
  --reflex-danger: #dc2626;
  --reflex-hole: #ececec;
}

.reflex-layout {
  display: grid;
  gap: 24px;
  padding: 32px 0 80px;
}

.reflex-titlebar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.reflex-titlebar h1 {
  font-size: 48px;
}

.reflex-game {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--canvas);
  box-shadow: var(--shadow-md);
}

.reflex-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 13px;
  border-bottom: 1px solid var(--line);
}

.reflex-hint {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.reflex-actions,
.overlay-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.reflex-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  color: var(--text);
  background: var(--canvas);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.reflex-button:hover,
.reflex-button:focus-visible {
  transform: translateY(-1px);
  border-color: var(--hairline-strong);
  background: var(--canvas-soft);
}

.reflex-button.primary {
  color: var(--ink);
  border-color: var(--primary);
  background: var(--primary);
}

.reflex-button.primary:hover,
.reflex-button.primary:focus-visible {
  border-color: var(--primary-deep);
  background: var(--primary-deep);
}

.reflex-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 13px;
  border-bottom: 1px solid var(--line);
  background: var(--canvas-soft);
}

.reflex-stat {
  display: grid;
  gap: 2px;
  min-width: 92px;
}

.reflex-stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

.reflex-stat strong {
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
}

.reflex-status {
  flex: 1 1 180px;
  min-height: 24px;
  margin: 0;
  color: var(--muted);
  font-weight: 500;
  text-align: right;
}

.reflex-status.is-good {
  color: var(--primary-deep);
}

.reflex-status.is-alert {
  color: var(--reflex-danger);
}

.reflex-stage {
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--canvas-soft);
}

.reflex-board-area {
  position: relative;
  width: min(460px, 100%);
}

.reflex-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
}

.reflex-hole {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 0;
  background: var(--canvas);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.reflex-hole::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 14%;
  height: 12%;
  border-radius: 999px;
  background: var(--reflex-hole);
}

.reflex-target {
  position: absolute;
  left: 50%;
  bottom: 18%;
  display: grid;
  place-items: center;
  width: 56%;
  aspect-ratio: 1;
  border-radius: 999px;
  background: var(--primary);
  box-shadow:
    inset 0 -6px 0 rgba(0, 0, 0, 0.14),
    0 6px 16px rgba(62, 207, 142, 0.4);
  transform: translate(-50%, 130%) scale(0.6);
  transition: transform 140ms cubic-bezier(0.2, 0.9, 0.3, 1.3);
}

.reflex-target::after {
  content: "";
  width: 34%;
  aspect-ratio: 1;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
}

.reflex-hole.is-up .reflex-target {
  transform: translate(-50%, 0) scale(1);
}

.reflex-hole.is-bomb .reflex-target {
  background: #2b2b2b;
  box-shadow:
    inset 0 -6px 0 rgba(0, 0, 0, 0.3),
    0 6px 16px rgba(0, 0, 0, 0.28);
}

.reflex-hole.is-bomb .reflex-target::after {
  content: none;
}

.reflex-hole.is-hit .reflex-target {
  transform: translate(-50%, 0) scale(0.4);
  opacity: 0.4;
}

.reflex-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: rgba(28, 28, 28, 0.52);
  backdrop-filter: blur(8px);
}

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

.reflex-dialog {
  width: min(400px, 100%);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: clamp(18px, 3vw, 26px);
  background: var(--canvas);
  box-shadow: 0 22px 44px rgba(16, 19, 26, 0.26);
  text-align: center;
}

.reflex-dialog h2 {
  font-size: 32px;
}

.reflex-dialog p:not(.eyebrow) {
  color: var(--muted);
}

.overlay-actions {
  margin-top: 16px;
  justify-content: center;
}

@media (max-width: 720px) {
  .reflex-titlebar,
  .reflex-toolbar,
  .reflex-hud {
    align-items: flex-start;
    flex-direction: column;
  }

  .reflex-titlebar h1 {
    font-size: 34px;
  }

  .reflex-status {
    flex: 0 1 auto;
    width: 100%;
    text-align: left;
  }
}
