*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:      #07071a;
  --card:    #12122a;
  --border:  #252550;
  --purple:  #7c5cfc;
  --pink:    #fc5c7d;
  --green:   #43e97b;
  --orange:  #f7971e;
  --text:    #f0f0ff;
  --muted:   #6666aa;
  --glow-a:  rgba(124,  92, 252, 0.55);
  --glow-b:  rgba(252,  92, 125, 0.55);
  --glow-c:  rgba( 67, 233, 123, 0.55);
  --glow-d:  rgba(247, 151,  30, 0.55);
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  user-select: none;
}


/* ── Screens ── */
.screen {
  position: fixed; inset: 0;
  display: none; flex-direction: column;
  align-items: center; justify-content: center;
}
.screen.active { display: flex; }

/* ── Idle ── */
.idle-inner { text-align: center; animation: pulse 3s ease-in-out infinite; }
.idle-icon { font-size: 6rem; margin-bottom: 1.5rem; }
#screen-idle h1 {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 900;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.idle-sub { font-size: 1.5rem; color: var(--muted); margin-top: 1rem; }

/* ── Question screen ── */
#screen-question {
  padding: 1.5rem 2rem;
  gap: 1.5rem;
  background:
    radial-gradient(ellipse 60% 40% at 20% 20%, rgba(124,92,252,.07) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(252,92,125,.05) 0%, transparent 70%),
    var(--bg);
}

.q-header {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; max-width: 1300px;
}
.q-counter, .q-counter-right {
  font-size: 1.4rem; font-weight: 700; color: var(--muted);
  background: var(--card); border: 1px solid var(--border);
  padding: .4rem 1.4rem; border-radius: 50px;
  min-width: 90px; text-align: center;
}
.q-counter-right { opacity: 0; pointer-events: none; }

/* ── Waveform ── */
.waveform {
  display: flex; align-items: center; gap: 4px; height: 48px;
  opacity: 0; transition: opacity .4s;
}
.waveform.active { opacity: 1; }
.waveform b {
  display: block; width: 6px; border-radius: 3px;
  background: linear-gradient(to top, var(--purple), var(--pink));
  animation: wave .7s ease-in-out infinite alternate;
}
.waveform b:nth-child(1)  { height:16px; animation-delay:.00s }
.waveform b:nth-child(2)  { height:32px; animation-delay:.07s }
.waveform b:nth-child(3)  { height:20px; animation-delay:.14s }
.waveform b:nth-child(4)  { height:44px; animation-delay:.04s }
.waveform b:nth-child(5)  { height:28px; animation-delay:.11s }
.waveform b:nth-child(6)  { height:38px; animation-delay:.18s }
.waveform b:nth-child(7)  { height:22px; animation-delay:.02s }
.waveform b:nth-child(8)  { height:46px; animation-delay:.09s }
.waveform b:nth-child(9)  { height:18px; animation-delay:.16s }
.waveform b:nth-child(10) { height:36px; animation-delay:.06s }
.waveform b:nth-child(11) { height:26px; animation-delay:.13s }
.waveform b:nth-child(12) { height:42px; animation-delay:.20s }
.waveform b:nth-child(13) { height:14px; animation-delay:.03s }
.waveform b:nth-child(14) { height:30px; animation-delay:.10s }
.waveform b:nth-child(15) { height:40px; animation-delay:.17s }
.waveform b:nth-child(16) { height:22px; animation-delay:.05s }
.waveform b:nth-child(17) { height:34px; animation-delay:.12s }
.waveform b:nth-child(18) { height:18px; animation-delay:.19s }
.waveform b:nth-child(19) { height:48px; animation-delay:.08s }
.waveform b:nth-child(20) { height:24px; animation-delay:.15s }

/* ── Propositions ── */
.propositions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  width: 100%; max-width: 1300px;
  flex: 1;
  min-height: 0;
}

.prop {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 20px;
  padding: 1.5rem 2rem;
  display: flex; align-items: center; gap: 1.5rem;
  transition: border-color .3s, box-shadow .3s, opacity .4s, background .4s;
  animation: slideUp .5s ease backwards;
  overflow: hidden;
  position: relative;
}

.prop::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent 60%, rgba(255,255,255,.03));
  pointer-events: none;
}

.prop:nth-child(1) { animation-delay: .05s; }
.prop:nth-child(2) { animation-delay: .12s; }
.prop:nth-child(3) { animation-delay: .19s; }
.prop:nth-child(4) { animation-delay: .26s; }

/* Letter badges */
.letter {
  font-size: clamp(1.8rem, 3.5vw, 3rem);
  font-weight: 900;
  width: clamp(54px, 6vw, 80px);
  height: clamp(54px, 6vw, 80px);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: #fff;
}

#prop-A .letter { background: linear-gradient(135deg, #7c5cfc, #b09aff); }
#prop-B .letter { background: linear-gradient(135deg, #fc5c7d, #ff9ab3); }
#prop-C .letter { background: linear-gradient(135deg, #43e97b, #89f5ae); }
#prop-D .letter { background: linear-gradient(135deg, #f7971e, #ffd200); }

.prop-text {
  font-size: clamp(1.2rem, 2.5vw, 2rem);
  font-weight: 600;
  line-height: 1.3;
}

/* Playing state */
.prop.playing {
  animation: glow 2s ease-in-out infinite;
}
#prop-A.playing { border-color: var(--purple); box-shadow: 0 0 30px var(--glow-a); }
#prop-B.playing { border-color: var(--pink);   box-shadow: 0 0 30px var(--glow-b); }
#prop-C.playing { border-color: var(--green);  box-shadow: 0 0 30px var(--glow-c); }
#prop-D.playing { border-color: var(--orange); box-shadow: 0 0 30px var(--glow-d); }

/* Reveal states */
.prop.correct {
  border-color: var(--green);
  background: rgba(67, 233, 123, .12);
  box-shadow: 0 0 50px rgba(67, 233, 123, .5);
  animation: correctPop .5s cubic-bezier(.34,1.56,.64,1) forwards !important;
}
.prop.wrong {
  opacity: .2;
  filter: grayscale(1);
  animation: none !important;
}

/* ── Progress bar ── */
.progress-wrap {
  width: 100%; max-width: 1300px;
  height: 10px;
  background: var(--card);
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.progress-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--purple), var(--pink));
  border-radius: 5px;
  transform-origin: left;
  transition: width .1s linear;
}

/* ── Reveal overlay (transition auto) ── */
.reveal-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(7,7,26,.92);
  backdrop-filter: blur(8px);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1.5rem;
  animation: fadeIn .35s ease;
}
.reveal-overlay.hidden { display: none; }
.reveal-overlay.fade-out { animation: fadeOut .5s ease forwards; }

.rev-icon {
  font-size: 7rem;
  animation: revBounce .5s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 30px rgba(124,92,252,.8));
}
.rev-label {
  font-size: clamp(1.8rem, 5vw, 3.5rem);
  font-weight: 900;
  color: #fff;
  text-align: center;
  letter-spacing: -.01em;
}

/* ── End screen ── */
.end-inner { text-align: center; }
.trophy { font-size: 8rem; animation: bounce 1s ease-in-out infinite alternate; }
#screen-end h1 {
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 900;
  margin-top: 1rem;
  background: linear-gradient(135deg, var(--orange), #ffd200);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
#screen-end p { font-size: 1.3rem; color: var(--muted); margin-top: .8rem; }

/* ── Keyframes ── */
@keyframes wave {
  from { transform: scaleY(.25); }
  to   { transform: scaleY(1); }
}

@keyframes glow {
  0%, 100% { filter: brightness(1); }
  50%       { filter: brightness(1.15); }
}

@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

@keyframes correctPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.04); }
  100% { transform: scale(1); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.015); }
}

@keyframes bounce {
  from { transform: translateY(0); }
  to   { transform: translateY(-18px); }
}

@keyframes revBounce {
  from { transform: scale(1) rotate(-5deg); }
  to   { transform: scale(1.15) rotate(5deg); }
}
@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
