:root {
  --panel-width: 50%;
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.55);

  --glass-bg: rgba(255, 255, 255, 0.10);
  --glass-border: rgba(255, 255, 255, 0.22);
  --glass-blur: 12px;

  --wrong: #b91f38;
  --right: #00d183;

  /* UPDATED: rainbows narrower */
  --bar-width: 2px;

  --load-ms: 5000ms;

  /* UPDATED: uniform button length WITHOUT changing height */
  --btn-min-w: 170px;

  /* Width of the content block that will be centered */
  --content-w: 520px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }

body {
  background: #000;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
}

.screen {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
}

/* LEFT VIDEO */
.media {
  width: calc(100% - var(--panel-width));
  height: 100%;
  background: #000;
  position: relative;
}

.media__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.1);
}

/* BACK ARROW */
.back {
  position: absolute;
  top: 22px;
  left: 22px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  text-decoration: none;
  z-index: 10;
}

/* PANEL */
.panel {
  width: var(--panel-width);
  height: 100%;
  background: #000;
  position: relative;
  padding: 220px 70px 60px 70px;

  /* Keep left text alignment */
  text-align: left;
}

/* UPDATED: Center a fixed-width content wrapper horizontally */
.panel .title,
.panel .subtitle,
.panel .options,
.panel .counter,
.panel .loading {
  max-width: var(--content-w);
  margin-left: auto;
  margin-right: auto;
}

/* Title (lighter font weight only) */
.title {
  margin-top: 0;
  margin-bottom: 0;
  font-size: 52px;
  line-height: 1.05;

  /* UPDATED: lighter */
  font-weight: 300;

  letter-spacing: -0.4px;
}

.subtitle {
  margin: 14px 0 24px 0;
  font-size: 12px;
  color: var(--muted);
}

/* OPTIONS
   UPDATED: grid centered as a block inside the centered wrapper
*/
.options {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, max-content);
  gap: 16px 16px;

  /* THIS centers the whole grid under the text */
  justify-content: center;

  /* keep items themselves left-aligned */
  justify-items: start;
  align-items: center;
}

/* BUTTONS (keep your original sizing, only add uniform width) */
.option-btn {
  appearance: none;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text);

  /* SAME as your original */
  padding: 12px 18px;
  border-radius: 999px;

  font-size: 14px;
  font-weight: 600;

  cursor: pointer;
  backdrop-filter: blur(var(--glass-blur));
  transition: border-color 120ms ease, background 120ms ease, opacity 220ms ease;
  white-space: nowrap;

  /* UPDATED: uniform length without changing height */
  min-width: var(--btn-min-w);

  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.option-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.option-btn.is-wrong {
  border-color: var(--wrong);
  box-shadow: 0 0 0 2px rgba(185, 31, 56, 0.35);
}

.option-btn.is-right {
  border-color: var(--right);
  box-shadow: 0 0 0 2px rgba(0, 209, 131, 0.35);
}

.option-btn.is-locked {
  pointer-events: none;
  opacity: 0.75;
}

/* Fade wrong options but keep layout so correct does not move */
.option-btn.is-faded {
  opacity: 0;
  pointer-events: none;
}

/* COUNTER (right aligned only) */
.counter {
  margin-top: 18px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  width: 100%;
  text-align: right;
}

/* LOADING: text + bar only */
.loading[hidden] { display: none; }

.loading {
  margin-top: 26px;
  width: 100%;
}

.loading__row {
  display: flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
}

.loading__bar {
  margin-top: 10px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
}

.loading__fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
}

.loading__fill.is-animating {
  animation: fillBar var(--load-ms) linear forwards;
}

@keyframes fillBar {
  from { width: 0%; }
  to { width: 100%; }
}

/* COLOR BARS */
.bars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

.bar {
  position: absolute;
  top: 0;
  width: var(--bar-width);
  height: 100%;
  background: linear-gradient(
    to bottom,
    #00ff66 0%,
    #00ff66 20%,
    #ffcc00 20%,
    #ffcc00 40%,
    #ff8800 40%,
    #ff8800 60%,
    #ff3333 60%,
    #ff3333 80%,
    #9933ff 80%,
    #9933ff 100%
  );
}

.bar--split { left: calc(100% - var(--panel-width)); }
.bar--right { right: 0; }

/* RESPONSIVE */
@media (max-width: 980px) {
  .screen { flex-direction: column; }
  .media { width: 100%; height: 48vh; }

  .panel {
    width: 100%;
    height: 52vh;
    padding: 72px 22px 28px 22px;
  }

  .panel .title,
  .panel .subtitle,
  .panel .options,
  .panel .counter,
  .panel .loading {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .title { font-size: 44px; }

  .options {
    grid-template-columns: repeat(2, max-content);
    justify-content: start;
  }

  .bar--split { left: 0; opacity: 0.35; }
}
