body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-main);
  height: 100%;
  height: 100dvh;
  overflow: hidden;
}

#reaction-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  padding: clamp(14px, 3vw, 24px);
  position: relative;
}

.reaction-pad {
  align-items: center;
  background: var(--pad-bg-idle);
  border: 2px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  flex: 1;
  flex-direction: column;
  font: inherit;
  justify-content: center;
  margin: 0 auto;
  max-height: calc(100dvh - 48px);
  max-width: 900px;
  min-height: 0;
  width: 100%;
  transition: background 200ms ease, border-color 200ms ease, transform 120ms ease, box-shadow 200ms ease;
}

.reaction-pad:active {
  transform: scale(0.99);
}

.reaction-pad.waiting {
  background: var(--pad-bg-waiting);
  border-color: var(--accent-yellow);
  box-shadow: 0 16px 40px var(--accent-yellow-glow);
}

.reaction-pad.active {
  background: var(--pad-bg-active);
  border-color: var(--accent-mint);
  box-shadow: 0 18px 45px var(--accent-mint-glow);
}

.reaction-pad.too-soon {
  background: var(--pad-bg-error);
  border-color: var(--accent-pink);
  box-shadow: 0 16px 40px var(--accent-pink-glow);
}

.reaction-pad span {
  font-size: clamp(1.4rem, min(5vw, 8vh), 3.4rem);
  font-weight: 900;
  letter-spacing: -0.5px;
}

.reaction-pad strong {
  font-size: clamp(2.8rem, min(10vw, 20vh), 6.5rem);
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  letter-spacing: -1px;
  margin-top: 14px;
}

.reaction-console {
  align-items: center;
  background: var(--bg-surface-translucent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
  display: flex;
  flex-direction: column;
  gap: 18px;
  left: 50%;
  margin: 0;
  max-width: 440px;
  padding: 32px 36px;
  position: absolute;
  text-align: center;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(90%, 440px);
  z-index: 3;
  color: var(--text-primary);
}

.reaction-console header h1 {
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.reaction-console header p {
  color: var(--text-muted);
  font-weight: 600;
  margin: 6px 0 10px;
}

.view-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.hidden {
  display: none !important;
}

.game-status-msg {
  align-items: center;
  display: flex;
  font-size: clamp(1.3rem, 3.5vw, 1.9rem);
  font-weight: 900;
  justify-content: center;
  min-height: 48px;
  letter-spacing: -0.2px;
  color: var(--text-primary);
}

#best {
  color: var(--text-primary);
  font-size: 1.05rem;
  font-weight: 800;
  background: var(--bg-card-subtle);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  align-self: center;
  border: 1px solid var(--border-subtle);
}

.start-button {
  align-self: center;
  background: linear-gradient(135deg, var(--accent-pink) 0%, #FA5252 100%);
  border: none;
  border-radius: var(--radius-full);
  box-shadow: 0 10px 24px var(--accent-pink-glow);
  color: white;
  cursor: pointer;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 900;
  min-height: 56px;
  padding: 12px 32px;
  transition: transform 180ms ease, box-shadow 180ms ease;
  width: min(300px, 80vw);
}

.start-button:hover,
.start-button:focus-visible {
  box-shadow: 0 14px 32px var(--accent-pink-glow);
  outline: none;
  transform: translateY(-3px);
}

.start-button:active {
  transform: translateY(1px) scale(0.98);
}

@media (max-width: 600px) {
  #reaction-app {
    padding: 14px;
  }
  .reaction-console {
    padding: 24px 20px;
  }
  .start-button {
    width: 100%;
  }
}
