:root {
  --bg: #120b1b;
  --panel: #21162e;
  --accent: #ff5f6d;
  --good: #5af281;
  --warn: #ffd166;
  --text: #f8f5ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: radial-gradient(circle at top, #2a1638, var(--bg));
  color: var(--text);
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.app {
  width: min(90vw, 900px);
  min-height: 620px;
  background: rgba(17, 10, 24, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.screen {
  display: none;
  min-height: 620px;
  padding: 40px 24px;
  text-align: center;
}

.screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

h1 {
  font-size: clamp(2.5rem, 4vw, 4rem);
  margin-bottom: 16px;
}

p {
  font-size: 1.2rem;
  margin: 8px 0 24px;
}

button {
  background: linear-gradient(135deg, var(--accent), #ff8a5b);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 14px 28px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(255, 95, 109, 0.35);
}

button:hover {
  filter: brightness(1.05);
}

.hud {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  width: min(760px, 90%);
  margin: 0 auto 24px;
  font-size: 1.1rem;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
}

.game-panel {
  width: min(760px, 90%);
  min-height: 420px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.08);
}

.mini-game {
  width: 100%;
  display: grid;
  place-items: center;
  gap: 24px;
}

.hidden {
  display: none;
}

#reaction-text {
  font-size: clamp(2.2rem, 5vw, 4rem);
  letter-spacing: 0.06em;
}

.bar-wrap {
  width: min(80%, 560px);
  height: 26px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.18);
}

.bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--good), #7ee7cf);
  border-radius: inherit;
  transition: width 0.05s linear;
}

#time-left {
  font-size: 1.5rem;
  font-weight: 700;
}

#end-screen {
  background: rgba(20, 10, 20, 0.92);
}

#end-message {
  font-size: 1.4rem;
}
