
/* ==========================================================
   Player stage
   ========================================================== */

.video-card {
  position: relative;
  padding: 12px;
  border-color: rgba(71, 85, 105, 0.58);
  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(59, 130, 246, 0.055),
      transparent 42%
    ),
    linear-gradient(
      145deg,
      rgba(15, 23, 42, 0.97),
      rgba(8, 15, 29, 0.96)
    );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.025),
    0 20px 60px rgba(0, 0, 0, 0.34);
}

.video-shell {
  min-height: clamp(300px, 42vw, 520px);
  overflow: hidden;
  border-radius: 16px;
  background:
    radial-gradient(
      circle at 50% 40%,
      rgba(30, 41, 59, 0.48),
      rgba(2, 6, 23, 0.92) 62%,
      #020617 100%
    );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    inset 0 0 48px rgba(0, 0, 0, 0.28),
    0 16px 42px rgba(0, 0, 0, 0.30);
}


/*
  The native video element has its own empty controls UI.
  Hide it while the stage is idle so it does not compete with
  the custom instruction state.
*/
.video-shell:not(.green):not(.red):not(.yellow) > #player {
  display: none;
}

/*
  Reinforce the two core game states without turning the idle
  player into a literal split screen.
*/
.video-shell:not(.green):not(.red):not(.yellow) {
  background:
    radial-gradient(
      circle at 50% 50%,
      rgba(30, 41, 59, 0.48),
      rgba(2, 6, 23, 0.92) 62%,
      #020617 100%
    );
}

#mediaSelection {
  scroll-margin-top: 20px;
}


/* ---------- Empty player state ---------- */

.player-empty-state {
  position: absolute;
  inset: 0;
  z-index: 2;

  display: grid;
  place-content: center;
  justify-items: center;

  padding: 32px;
  text-align: center;
  pointer-events: none;

  opacity: 1;
  visibility: visible;

  transition:
    opacity 180ms ease,
    visibility 180ms ease;
}

/*
  READY is useful once a light state exists, but adds visual noise
  while the player is still waiting for media.
*/
.video-shell:not(.green):not(.red):not(.yellow) #currentColorTag {
  display: none;
}

.player-empty-choose {
  display: grid;
  place-items: center;

  width: 74px;
  height: 74px;
  padding: 0;

  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 50%;

  color: #cbd5e1;
  background: rgba(30, 41, 59, 0.34);

  cursor: pointer;
  pointer-events: auto;
  text-decoration: none;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035);

  transition:
    color 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.player-empty-play {
  width: 0;
  height: 0;

  margin-left: 5px;

  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 16px solid #94a3b8;

  transition:
    border-left-color 160ms ease,
    transform 160ms ease;
}

.player-empty-choose:hover {
  border-color: rgba(148, 163, 184, 0.42);
  background: rgba(51, 65, 85, 0.48);
  transform: translateY(-1px);
}

.player-empty-choose:hover .player-empty-play {
  border-left-color: #e2e8f0;
  transform: scale(1.04);
}

.player-empty-choose:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}


/* ---------- Session rule legend ---------- */

.controls-card .control-feedback {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;

  flex: 1 1 0;
  min-width: 0;
  margin-left: 18px;
}

.session-rule-legend {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));

  flex: 0 1 330px;
  width: min(330px, 100%);
  max-width: 330px;
  min-width: 270px;

  overflow: hidden;

  border: 1px solid rgba(100, 116, 139, 0.18);
  border-radius: 10px;

  background: rgba(2, 6, 23, 0.18);

  white-space: nowrap;
}

.session-rule-pair {
  --otl-rule-accent: #94a3b8;

  position: relative;

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

  min-width: 0;
  padding: 11px 15px 12px;

  line-height: 1;
}

.session-rule-pair + .session-rule-pair {
  border-left: 1px solid rgba(100, 116, 139, 0.18);
}

.session-rule-pair-green {
  --otl-rule-accent: var(--green);

  background:
    linear-gradient(
      180deg,
      rgba(34, 197, 94, 0.22),
      rgba(34, 197, 94, 0.08)
    );
}

.session-rule-pair-yellow {
  --otl-rule-accent: var(--yellow);

  background:
    linear-gradient(
      180deg,
      rgba(245, 158, 11, 0.22),
      rgba(245, 158, 11, 0.08)
    );
}

.session-rule-pair-red {
  --otl-rule-accent: var(--red);

  background:
    linear-gradient(
      180deg,
      rgba(239, 68, 68, 0.22),
      rgba(239, 68, 68, 0.08)
    );
}

.session-rule-action {
  overflow: hidden;

  color:
    color-mix(
      in srgb,
      var(--otl-rule-accent) 88%,
      #ffffff 12%
    );

  background: transparent;
  box-shadow: none;
  filter: none;
  text-shadow: none;

  font-family: "Montserrat", sans-serif;
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: 0.25em;
  text-transform: uppercase;

  text-overflow: ellipsis;
}

.controls-card .session-timer-display {
  flex: 0 0 auto;
  margin-left: auto;
}

@media (max-width: 900px) {
  .controls-card .control-feedback {
    flex: 1 1 100%;
    justify-content: flex-start;
    margin-left: 0;
  }

  .session-rule-legend {
    width: min(360px, 100%);
    min-width: 0;
  }
}


@media (max-width: 560px) {
  .player-empty-state {
    padding: 22px;
  }

  .player-empty-choose {
    width: 62px;
    height: 62px;
    padding: 0;
  }

  .player-empty-play {
    margin-left: 4px;
    border-top-width: 8px;
    border-bottom-width: 8px;
    border-left-width: 13px;
  }

  .session-rule-pair {
    gap: 5px;
    padding-inline: 7px;
  }

  .session-rule-action {
    font-size: 0.75rem;
  }
}


/*
  The core player already applies the active light class to videoShell.
  Once playback starts, the empty-state layer disappears.
*/
.video-shell.green .player-empty-state,
.video-shell.red .player-empty-state,
.video-shell.yellow .player-empty-state {
  opacity: 0;
  visibility: hidden;
}


/* ==========================================================
   Keyboard shortcuts
   ========================================================== */

.controls-card .shortcut-help {
  display: flex;
  align-items: center;
  gap: 14px;

  margin-top: 14px;
  padding-top: 13px;

  border-top: 1px solid rgba(100, 116, 139, 0.18);

  color: #94a3b8 !important;
  font-size: 0.79rem !important;
  font-weight: 600;
  line-height: 1.35;
}

.shortcut-help-title {
  flex: 0 0 auto;

  color: #cbd5e1;
  font-size: 0.76rem;
  font-weight: 800;

  letter-spacing: 0.025em;
}

.shortcut-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  flex: 1 1 auto;

  gap: 8px 14px;

  min-width: 0;
}

.shortcut-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  color: #8492a6;
  white-space: nowrap;
}

.shortcut-keys {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.shortcut-help kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 25px;
  height: 24px;
  padding: 0 7px;

  border:
    1px solid rgba(148, 163, 184, 0.30);
  border-bottom-color:
    rgba(148, 163, 184, 0.42);

  border-radius: 6px;

  color: #dbe4f0;
  background:
    linear-gradient(
      180deg,
      rgba(51, 65, 85, 0.58),
      rgba(30, 41, 59, 0.58)
    );

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.055),
    0 1px 0 rgba(0, 0, 0, 0.42);

  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    monospace;

  font-size: 0.67rem;
  font-weight: 750;
  line-height: 1;
}


@media (max-width: 900px) {
  .controls-card .shortcut-help {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
  }

  .shortcut-list {
    gap: 8px 12px;
  }
}


@media (max-width: 560px) {
  .video-card {
    padding: 8px;
  }

  .video-shell {
    min-height: 220px;
    border-radius: 13px;
  }

  .player-empty-icon {
    width: 50px;
    height: 50px;
  }

  .player-empty-copy small {
    max-width: 270px;
  }

  .controls-card .shortcut-help {
    font-size: 0.76rem !important;
  }

  .shortcut-list {
    align-items: flex-start;
  }
}


@media (prefers-reduced-motion: reduce) {
  .player-empty-state {
    transition: none;
  }
}


/* Clip reporting */

.otl-clip-report-item {
  margin-left: auto;
}

.otl-clip-report-item[hidden] {
  display: none !important;
}

.otl-clip-report-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;

  min-height: 34px;
  padding: 5px 9px;

  border: 1px solid rgba(239, 68, 68, 0.42);
  border-radius: 9px;

  color: #fca5a5;
  background: rgba(127, 29, 29, 0.16);

  font-size: 0.78rem;
  font-weight: 750;

  opacity: 1;
  box-shadow: none;

  transition:
    color 150ms ease,
    border-color 150ms ease,
    background 150ms ease;
}

.otl-clip-report-button:hover {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.72);
  background: rgba(127, 29, 29, 0.28);
  filter: none !important;
}

.otl-clip-report-button:active {
  transform: none !important;
}

.otl-clip-report-flag {
  color: #ef4444;
  font-size: 1rem;
  line-height: 1;
}

.otl-clip-report-dialog {
  width: min(420px, calc(100vw - 28px));
  padding: 0;

  border: 1px solid rgba(100, 116, 139, 0.48);
  border-radius: 16px;

  color: var(--text);
  background:
    linear-gradient(
      145deg,
      rgba(17, 24, 39, 0.99),
      rgba(8, 15, 29, 0.99)
    );

  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.68);
}

.otl-clip-report-dialog::backdrop {
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(3px);
}

.otl-clip-report-form {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.otl-clip-report-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.otl-clip-report-heading h2 {
  margin: 0 0 4px;
  font-size: 1.02rem;
}

.otl-clip-report-heading p {
  font-size: 0.84rem;
}

.otl-clip-report-close {
  flex: 0 0 auto;

  min-width: 32px;
  min-height: 32px;
  padding: 0;

  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 9px;

  color: #94a3b8;
  background: rgba(30, 41, 59, 0.52);

  font-size: 1.2rem;
  line-height: 1;
}

.otl-clip-report-reasons {
  display: grid;
  gap: 8px;

  margin: 0;
  padding: 0;

  border: 0;
}

.otl-clip-report-option {
  display: flex;
  align-items: center;
  gap: 10px;

  padding: 11px 12px;

  border: 1px solid rgba(100, 116, 139, 0.28);
  border-radius: 11px;

  background: rgba(2, 6, 23, 0.28);

  cursor: pointer;
}

.otl-clip-report-option:hover {
  border-color: rgba(148, 163, 184, 0.46);
}

.otl-clip-report-option input {
  width: 17px;
  height: 17px;
  margin: 0;

  accent-color: #64748b;
}

.otl-clip-report-details {
  display: grid;
  gap: 7px;

  color: #cbd5e1;
  font-size: 0.82rem;
  font-weight: 700;
}

.otl-clip-report-details[hidden] {
  display: none;
}

.otl-clip-report-details textarea {
  min-height: 86px;
  max-height: 180px;
}

.otl-clip-report-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.otl-clip-report-cancel,
.otl-clip-report-submit {
  min-height: 38px;
  padding: 8px 12px;

  border-radius: 10px;

  font-size: 0.82rem;
}

.otl-clip-report-cancel {
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: #cbd5e1;
  background: rgba(30, 41, 59, 0.62);
}

.otl-clip-report-submit {
  color: #e2e8f0;
  background: #334155;
}

@media (max-width: 900px) {
  .otl-clip-report-item {
    margin-left: 0;
  }
}

@media (max-width: 560px) {
  .otl-clip-report-key {
    display: none;
  }

  .otl-clip-report-button {
    min-width: 0;
    justify-content: center;
  }
}


/* Clip reporting: enhanced states */

.otl-clip-report-option.is-selected {
  border-color: rgba(239, 68, 68, 0.68);
  background: rgba(127, 29, 29, 0.18);
  box-shadow:
    inset 0 0 0 1px rgba(239, 68, 68, 0.10);
}

.otl-clip-report-option.is-selected span {
  color: #fee2e2;
}

.otl-clip-report-theater-button {
  border: 1px solid rgba(239, 68, 68, 0.48) !important;
  color: #fecaca !important;
  background: rgba(127, 29, 29, 0.34) !important;
}

.otl-clip-report-fullscreen-button {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 30;

  display: none;

  min-height: 36px;
  padding: 7px 10px;

  border: 1px solid rgba(239, 68, 68, 0.58);
  border-radius: 10px;

  color: #fecaca;
  background: rgba(69, 10, 10, 0.78);

  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.38);

  backdrop-filter: blur(8px);
}

.video-shell:fullscreen
  .otl-clip-report-fullscreen-button,
.video-shell:-webkit-full-screen
  .otl-clip-report-fullscreen-button {
  display: inline-flex;
}

.otl-clip-report-fullscreen-button[hidden],
.otl-clip-report-theater-button[hidden] {
  display: none !important;
}

@media (max-width: 560px) {
  .otl-clip-report-fullscreen-button {
    top: 10px;
    right: 10px;
  }

  .otl-clip-report-fullscreen-button
    .otl-clip-report-key {
    display: none;
  }
}


/* Clip reporting: theater-only refinement */

.otl-clip-report-heading h2 {
  font-size: 1.22rem;
  line-height: 1.2;
}

.otl-clip-report-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.otl-clip-report-rail-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 54px;
  height: 54px;
  padding: 0;

  border: 1px solid rgba(239, 68, 68, 0.46);
  border-radius: 14px;

  color: #f87171;
  background: rgba(127, 29, 29, 0.24);

  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.28);

  transition:
    color 150ms ease,
    border-color 150ms ease,
    background 150ms ease,
    transform 150ms ease;
}

.otl-clip-report-rail-button:hover {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.78);
  background: rgba(127, 29, 29, 0.40);
}

.otl-clip-report-rail-button:active {
  transform: scale(0.98);
}

.otl-clip-report-rail-button[hidden] {
  display: none !important;
}

.otl-clip-report-rail-button
  .otl-clip-report-flag {
  color: #ef4444;
  font-size: 1.65rem;
  line-height: 1;
}

@media (max-width: 560px) {
  .otl-clip-report-rail-button {
    width: 48px;
    height: 48px;
    border-radius: 12px;
  }

  .otl-clip-report-rail-button
    .otl-clip-report-flag {
    font-size: 1.45rem;
  }
}


/* Clip reporting: shortcut + fullscreen refinement */

.otl-clip-report-shortcut[hidden] {
  display: none !important;
}

.otl-clip-report-shortcut-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  min-height: 24px;
  padding: 0;

  border: 0;
  border-radius: 6px;

  color: #8492a6;
  background: transparent;

  font-size: inherit;
  font-weight: inherit;

  box-shadow: none;
}

.otl-clip-report-shortcut-button:hover {
  color: #fca5a5;
  background: transparent;
  filter: none !important;
}

.otl-clip-report-shortcut-button:active {
  transform: none !important;
}

.otl-clip-report-shortcut-button
  kbd {
  border-color: rgba(239, 68, 68, 0.40);
  color: #fca5a5;
}



/* Clip report close-button alignment */

.otl-clip-report-heading {
  align-items: center;
}

.otl-clip-report-heading > div {
  min-width: 0;
}

.otl-clip-report-close {
  display: grid;
  place-items: center;

  flex: 0 0 44px;

  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;

  margin: 0;
  padding: 0;

  line-height: 0;
}

.otl-clip-report-close svg {
  display: block;

  width: 20px;
  height: 20px;

  overflow: visible;

  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
}


/* Clip report final heading composition */

.otl-clip-report-form {
  position: relative;
}

.otl-clip-report-heading {
  display: block;
  padding-top: 10px;
  padding-right: 42px;
  margin-bottom: -3px;
}

.otl-clip-report-heading h2 {
  margin: 0;
}

.otl-clip-report-close {
  position: absolute;
  top: 12px;
  right: 12px;

  display: grid;
  place-items: center;

  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  flex: none;

  margin: 0;
  padding: 0;

  border-radius: 9px;
}

.otl-clip-report-close svg {
  width: 16px;
  height: 16px;
  stroke-width: 3;
}


/* ==========================================================
   CONTROL BAR COMPOSITION
   ========================================================== */

/*
  Semantic groups:
    left   = session controls
    center = light meanings
    right  = view controls

  Equal 1fr side columns keep the light legend mathematically
  centered in the entire card.
*/

.session-action-controls,
.view-controls {
  display: contents;
}


@media (min-width: 1280px) {
  .controls-card .controls {
    display: grid !important;

    grid-template-columns:
      auto
      minmax(0, 1fr)
      auto;

    align-items: center;

    column-gap: 28px;
    row-gap: 0;
  }

  .controls-card
  .session-action-controls {
    grid-column: 1;

    display: flex;
    align-items: center;
    justify-self: start;

    gap: 10px;
  }

  .controls-card
  .control-feedback {
    grid-column: 2;

    display: flex;
    align-items: center;
    justify-content: center;
    justify-self: center;

    flex: none;

    width: 100%;
    min-width: 0;
    max-width: none;

    margin: 0;
    padding: 0;
  }

  .controls-card
  .session-rule-legend {
    width: 430px;
    max-width: 32vw;
  }

  .controls-card
  .view-controls {
    grid-column: 3;

    display: flex;
    align-items: center;
    justify-self: end;

    gap: 10px;
  }
}


/* ---------- Disabled controls ---------- */

.controls-card #startBtn:disabled {
  opacity: 1;

  color: #8f9bae;

  background:
    linear-gradient(
      135deg,
      rgba(37, 99, 235, 0.34),
      rgba(29, 78, 216, 0.28)
    );

  box-shadow: none;
}

.controls-card #playPauseBtn:disabled {
  opacity: 1;

  color: #9b8e7a;

  background:
    linear-gradient(
      135deg,
      rgba(217, 119, 6, 0.34),
      rgba(180, 83, 9, 0.28)
    );

  box-shadow: none;
}

.controls-card #skipBtn:disabled {
  opacity: 1;

  color: #9988af;

  background:
    linear-gradient(
      135deg,
      rgba(139, 92, 246, 0.34),
      rgba(109, 40, 217, 0.28)
    );

  box-shadow: none;
}

.controls-card #endBtn:disabled {
  opacity: 1;

  color: #a78e96;

  background:
    linear-gradient(
      135deg,
      rgba(220, 38, 38, 0.34),
      rgba(185, 28, 28, 0.28)
    );

  box-shadow: none;
}


/* ---------- Shortcut / timer strip ---------- */

.controls-card .shortcut-help {
  display: flex;
  align-items: center;

  gap: 16px;

  margin-top: 13px;
  padding-top: 11px;

  border-top:
    1px solid
    rgba(100, 116, 139, 0.20);

  color: #7f8da3 !important;

  font-size: 0.76rem !important;
  line-height: 1.3;
}

.controls-card
.shortcut-help-title {
  flex: 0 0 auto;

  color: #aeb9ca;

  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.controls-card
.shortcut-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;

  flex: 0 1 auto;

  gap: 7px 16px;

  min-width: 0;
}

.controls-card
.shortcut-item {
  gap: 5px;

  color: #7f8da3;
}

.controls-card
.shortcut-keys {
  gap: 3px;
}

.controls-card
.shortcut-help kbd {
  min-width: 24px;
  height: 22px;

  padding: 0 6px;

  border-radius: 6px;

  font-size: 0.64rem;
}


/*
  The session timer now occupies the far-right side of the
  secondary information strip instead of competing with the
  primary control row.
*/

.controls-card
.shortcut-help
.session-timer-display {
  flex: 0 0 auto;

  min-width: 132px;
  min-height: 36px;

  margin: 0 0 0 auto !important;

  padding: 7px 13px;

  gap: 8px;

  font-size: 0.78rem;
}

.controls-card
.shortcut-help
#sessionTime {
  font-size: 1.05rem;
}


/* ---------- Responsive fallback ---------- */

@media (max-width: 1279px) {
  .session-action-controls,
  .view-controls {
    display: contents;
  }
}


@media (max-width: 900px) {
  .controls-card
  .shortcut-help
  .session-timer-display {
    align-self: flex-start;

    margin-left: 0 !important;
  }
}

/* ---------- Premium control palette ---------- */

/*
  Keep Green / Amber / Signal Red exclusive to the light bar.

  Controls use a separate family:
  cobalt / indigo / violet / raspberry / graphite / cyan-blue.
*/


/* Start — cobalt */
.controls-card #startBtn:not(:disabled) {
  color: #f8fafc;

  background:
    linear-gradient(
      135deg,
      #1e40af,
      #1e3a8a
    );

  box-shadow:
    0 8px 22px rgba(37, 99, 235, 0.24);
}


/* Pause — indigo */
.controls-card #playPauseBtn:not(:disabled) {
  color: #f8fafc;

  background:
    linear-gradient(
      135deg,
      #3730a3,
      #312e81
    );

  box-shadow:
    0 8px 22px rgba(79, 70, 229, 0.23);
}


/* Skip — violet */
.controls-card #skipBtn:not(:disabled) {
  color: #f8fafc;

  background:
    linear-gradient(
      135deg,
      #6b21a8,
      #581c87
    );

  box-shadow:
    0 8px 22px rgba(139, 92, 246, 0.23);
}


/* End — raspberry */
.controls-card #endBtn:not(:disabled) {
  color: #fff7fb;

  background:
    linear-gradient(
      135deg,
      #9d174d,
      #831843
    );

  box-shadow:
    0 8px 22px rgba(219, 39, 119, 0.22);
}


/* Theater — graphite */
.controls-card #theaterBtn {
  color: #f1f5f9;

  background:
    linear-gradient(
      135deg,
      #1f4e5f,
      #183b4a
    );

  box-shadow:
    0 8px 22px rgba(15, 23, 42, 0.28);
}


/* Fullscreen — cyan-blue */
.controls-card #fullscreenBtn {
  color: #f0f9ff;

  background:
    linear-gradient(
      135deg,
      #155e75,
      #164e63
    );

  box-shadow:
    0 8px 22px rgba(8, 145, 178, 0.22);
}


/* Disabled colors retain the same identities. */

.controls-card #startBtn:disabled {
  opacity: 1;
  color: #8e9bb0;

  background:
    linear-gradient(
      135deg,
      rgba(37, 99, 235, 0.31),
      rgba(29, 78, 216, 0.25)
    );

  box-shadow: none;
}

.controls-card #playPauseBtn:disabled {
  opacity: 1;
  color: #9290b0;

  background:
    linear-gradient(
      135deg,
      rgba(79, 70, 229, 0.31),
      rgba(67, 56, 202, 0.25)
    );

  box-shadow: none;
}

.controls-card #skipBtn:disabled {
  opacity: 1;
  color: #9b8caf;

  background:
    linear-gradient(
      135deg,
      rgba(139, 92, 246, 0.31),
      rgba(124, 58, 237, 0.25)
    );

  box-shadow: none;
}

.controls-card #endBtn:disabled {
  opacity: 1;
  color: #aa8d9d;

  background:
    linear-gradient(
      135deg,
      rgba(219, 39, 119, 0.31),
      rgba(190, 24, 93, 0.25)
    );

  box-shadow: none;
}


/* ---------- True player-centered legend ---------- */

/*
  Center the light legend against the full controls row,
  independent of the unequal left/right button groups.
*/
@media (min-width: 1280px) {
  .controls-card .controls {
    position: relative;
  }

  .controls-card .session-action-controls,
  .controls-card .view-controls {
    flex-shrink: 0;
  }

  .controls-card .control-feedback {
    position: absolute;

    /* Span the ENTIRE grid, not just column 2. */
    grid-column: 1 / -1;
    grid-row: 1;

    left: 50%;
    top: 50%;

    width: 600px;
    min-width: 0;
    max-width: 600px;

    margin: 0;
    padding: 0;

    transform: translate(-50%, -50%);
  }

  .controls-card .session-rule-legend {
    flex: none;

    width: 600px;
    max-width: 600px;
    min-width: 600px;
  }
}

/* ---------- True player-centered legend end ---------- */

/* ---------- Central light bar ---------- */

@media (min-width: 1280px) {
  /*
    Keep all three top groups on the same row.
  */
  .controls-card .session-action-controls,
  .controls-card .control-feedback,
  .controls-card .view-controls {
    grid-row: 1;
  }

  /*
    Give the game's central signal more visual authority.
  */
  .controls-card .session-rule-legend {
    flex: 0 1 600px;

    width: min(600px, 100%);
    max-width: 600px;
    min-width: 0;

    font-size: 1.18rem;
    font-weight: 850;
    line-height: 1;
  }
}

/* ---------- Flat secondary controls ---------- */

/*
  Start keeps its subtle glow as the primary session action.
  All other controls use flat shadows so their color provides
  identity without competing for attention.
*/
.controls-card #playPauseBtn:not(:disabled),
.controls-card #skipBtn:not(:disabled),
.controls-card #endBtn:not(:disabled),
.controls-card #theaterBtn,
.controls-card #fullscreenBtn {
  box-shadow: none;
}

/* ---------- Flat secondary controls end ---------- */


/* ---------- Optical control-label alignment ---------- */

/*
  Keep control boxes in place while nudging their labels 1px upward.
  Asymmetric vertical padding preserves the total vertical padding.
*/
.controls-card #startBtn,
.controls-card #playPauseBtn,
.controls-card #skipBtn,
.controls-card #endBtn,
.controls-card #theaterBtn,
.controls-card #fullscreenBtn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  padding-top: 10px !important;
  padding-bottom: 12px !important;
}

/* ---------- Optical control-label alignment end ---------- */

/* ---------- Premium control palette end ---------- */

/* ==========================================================
   CONTROL BAR COMPOSITION END
   ========================================================== */

/* ---------- Reserved session timer space ---------- */

/*
  Keep the timer's footprint in the shortcut strip even before
  a session begins. Starting a session therefore changes only
  visibility/content, not the dimensions of the lower row.
*/
.controls-card
.shortcut-help
.session-timer-display[hidden] {
  display: inline-flex !important;

  visibility: hidden;
  opacity: 0;

  pointer-events: none;
}

/* ---------- Reserved session timer space end ---------- */

/* ---------- Live rule legend glow ---------- */

/*
  Live light-state treatment:

  - No colored outline around the legend.
  - No outer glow around the whole legend.
  - The active segment provides the primary illumination.
  - A very faint internal color atmosphere spreads through the bar.
*/

.session-rule-legend {
  position: relative;
  isolation: isolate;

  --otl-legend-ambient: transparent;
  --otl-legend-ambient-x: 50%;
}


/*
  Internal ambient wash.

  This stays clipped inside the legend and does not alter its border.
*/
.session-rule-legend::after {
  content: "";

  position: absolute;
  inset: 0;

  z-index: 0;

  pointer-events: none;

  background:
    radial-gradient(
      ellipse 72% 150%
      at var(--otl-legend-ambient-x) 50%,
      var(--otl-legend-ambient) 0%,
      transparent 72%
    );

  transition: background 180ms ease;
}


/*
  Keep segments above the ambient layer.
*/
.session-rule-pair {
  position: relative;
  z-index: 1;

  transition:
    background 160ms ease,
    box-shadow 160ms ease,
    filter 160ms ease;
}

.session-rule-action {
  transition:
    filter 160ms ease,
    text-shadow 160ms ease;
}


/* ==========================================================
   GREEN / STROKE
   ========================================================== */

.session-rule-legend.active-green {
  --otl-legend-ambient: rgba(34, 197, 94, 0.09);
  --otl-legend-ambient-x: 16.666%;
}

.session-rule-legend.active-green
.session-rule-pair-green {
  z-index: 2;

  background:
    linear-gradient(
      180deg,
      rgba(34, 197, 94, 0.43),
      rgba(34, 197, 94, 0.15)
    );

  box-shadow:
    inset 0 0 28px rgba(34, 197, 94, 0.30),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 18px rgba(34, 197, 94, 0.16);

  filter:
    saturate(1.08)
    brightness(1.05);
}

.session-rule-legend.active-green
.session-rule-pair-green
.session-rule-action {
  background: transparent !important;
  box-shadow: none !important;
  filter: none;

  text-shadow:
    0 0 7px rgba(74, 222, 128, 0.48),
    0 0 14px rgba(34, 197, 94, 0.22);
}


/* ==========================================================
   YELLOW / SLOW
   ========================================================== */

.session-rule-legend.active-yellow {
  --otl-legend-ambient: rgba(245, 158, 11, 0.085);
  --otl-legend-ambient-x: 50%;
}

.session-rule-legend.active-yellow
.session-rule-pair-yellow {
  z-index: 2;

  background:
    linear-gradient(
      180deg,
      rgba(245, 158, 11, 0.42),
      rgba(245, 158, 11, 0.15)
    );

  box-shadow:
    inset 0 0 28px rgba(245, 158, 11, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 18px rgba(245, 158, 11, 0.15);

  filter:
    saturate(1.07)
    brightness(1.05);
}

.session-rule-legend.active-yellow
.session-rule-pair-yellow
.session-rule-action {
  background: transparent !important;
  box-shadow: none !important;
  filter: none;

  text-shadow:
    0 0 7px rgba(251, 191, 36, 0.46),
    0 0 14px rgba(245, 158, 11, 0.20);
}


/* ==========================================================
   RED / STOP
   ========================================================== */

.session-rule-legend.active-red {
  --otl-legend-ambient: rgba(239, 68, 68, 0.09);
  --otl-legend-ambient-x: 83.333%;
}

.session-rule-legend.active-red
.session-rule-pair-red {
  z-index: 2;

  background:
    linear-gradient(
      180deg,
      rgba(239, 68, 68, 0.43),
      rgba(239, 68, 68, 0.15)
    );

  box-shadow:
    inset 0 0 28px rgba(239, 68, 68, 0.30),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 18px rgba(239, 68, 68, 0.16);

  filter:
    saturate(1.08)
    brightness(1.05);
}

.session-rule-legend.active-red
.session-rule-pair-red
.session-rule-action {
  background: transparent !important;
  box-shadow: none !important;
  filter: none;

  text-shadow:
    0 0 7px rgba(248, 113, 113, 0.48),
    0 0 14px rgba(239, 68, 68, 0.22);
}


@media (prefers-reduced-motion: reduce) {
  .session-rule-legend::after,
  .session-rule-pair,
  .session-rule-action {
    transition: none;
  }
}

/* ---------- Live rule legend glow end ---------- */

/* ---------- Legend text glow clipping fix ---------- */

/*
  The base legend text uses overflow:hidden for ellipsis behavior.
  That clips text-shadow to the text element's rectangle and creates
  a visible box around illuminated labels.

  These labels are short enough that clipping is unnecessary.
*/
.session-rule-legend .session-rule-action {
  overflow: visible;
  text-overflow: clip;
}

/* ---------- Legend text glow clipping fix end ---------- */

/* ---------- Cross-platform rule-label alignment ---------- */

/*
  Use one loaded font and let each equal-width segment center its own label.
  The -1px Y adjustment is retained as a font-specific optical correction.
*/
.session-rule-legend .session-rule-pair {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.session-rule-legend .session-rule-action {
  width: 100% !important;
  display: block !important;
  text-align: center !important;
  transform: translateY(-1px) scaleX(1.12) !important;
  transform-origin: center center !important;
}

/* ---------- Cross-platform rule-label alignment end ---------- */


