/* TONIGHT — ATM click-through CRT. Isolated from town-gate / WATCH. */
.tonight {
  --tonight-accent: var(--gold);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(11.5rem, 34%);
  grid-template-rows: minmax(0, 1fr);
  width: 100%;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: contain;
  background: var(--void);
  border: 1px solid var(--hairline);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.45);
}

.tonight[data-room="oracle"] { --tonight-accent: var(--gold); }
.tonight[data-room="roast"] { --tonight-accent: var(--ember); }
.tonight[data-room="mimic"] { --tonight-accent: var(--teal); }
.tonight[data-room="lovedoctor"] { --tonight-accent: var(--rose); }
.tonight[data-room="starsong"] { --tonight-accent: var(--violet); }
.tonight[data-room="peeps"] { --tonight-accent: var(--parchment); }

.tonight-pane {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 6.75rem;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.tonight-still {
  container-type: size;
  --emblem: min(72cqmin, 24rem);
  position: relative;
  display: grid;
  place-items: center;
  justify-items: center;
  align-items: center;
  min-height: 0;
  overflow: hidden;
  background: #05040a;
  box-shadow: inset 0 0 0 1px var(--hairline);
}

.tonight[data-room="oracle"] .tonight-still {
  background: radial-gradient(ellipse at 50% 48%, rgba(212, 160, 60, 0.16), #05040a 70%);
}

.tonight[data-room="roast"] .tonight-still {
  background: radial-gradient(ellipse at 50% 72%, rgba(226, 112, 58, 0.22), #05040a 68%);
}

.tonight[data-room="mimic"] .tonight-still {
  background: radial-gradient(ellipse at 50% 40%, rgba(61, 220, 180, 0.14), #05040a 70%);
}

.tonight[data-room="lovedoctor"] .tonight-still {
  background: radial-gradient(ellipse at 50% 48%, rgba(255, 77, 136, 0.2), #05040a 68%);
}

.tonight[data-room="starsong"] .tonight-still {
  background: radial-gradient(ellipse at 50% 48%, rgba(196, 160, 255, 0.18), #05040a 70%);
}

.tonight-still__img,
.tonight-still__vid {
  grid-area: 1 / 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: 50% 50%;
  pointer-events: none;
  background: transparent;
}

.tonight-still__img[hidden],
.tonight-still__vid[hidden] {
  display: none;
}

.tonight-still[data-fit="cover"] .tonight-still__img,
.tonight-still[data-fit="cover"] .tonight-still__vid,
.tonight-still[data-emblem="peeps"] .tonight-still__img,
.tonight-still[data-emblem="peeps"] .tonight-still__vid {
  object-fit: cover;
  object-position: 50% 46%;
  padding: 0;
  border-radius: 0;
  filter: none;
  width: 100%;
  height: 100%;
}

.tonight[data-room="oracle"] .tonight-still__vid,
.tonight[data-room="starsong"] .tonight-still__vid {
  width: var(--emblem);
  height: var(--emblem);
  max-width: var(--emblem);
  max-height: var(--emblem);
  margin: auto;
  padding: 0;
  align-self: center;
  justify-self: center;
  object-fit: cover;
  object-position: 50% 46%;
  transform: none;
  border-radius: 50%;
  box-shadow:
    0 0 0 1.5px color-mix(in srgb, var(--tonight-accent) 50%, transparent),
    0 0 28px color-mix(in srgb, var(--tonight-accent) 40%, transparent);
}

.tonight[data-room="roast"] .tonight-still {
  isolation: isolate;
  overflow: hidden;
}

.tonight[data-room="roast"] .tonight-still__vid {
  width: var(--emblem);
  height: var(--emblem);
  max-width: var(--emblem);
  max-height: var(--emblem);
  margin: auto;
  padding: 0;
  border: 0;
  outline: none;
  box-shadow: none;
  align-self: center;
  justify-self: center;
  object-fit: contain;
  object-position: 50% 50%;
  transform: none;
  background: transparent;
  mix-blend-mode: screen;
  filter: contrast(1.35) brightness(1.12);
  -webkit-mask-image: radial-gradient(ellipse 72% 68% at 50% 50%, #000 42%, transparent 74%);
  mask-image: radial-gradient(ellipse 72% 68% at 50% 50%, #000 42%, transparent 74%);
}

.tonight[data-room="roast"] .tonight-scan {
  mix-blend-mode: normal;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.18), transparent 28%);
}

.tonight-heart,
.tonight-twins {
  display: none;
  position: relative;
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.tonight-still[data-emblem="heart"] .tonight-heart {
  display: grid;
  place-items: center;
}

.tonight-heart {
  --neon: #ff4d88;
  --neon-soft: #ffd2e0;
}

.tonight-heart::before {
  content: '';
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 77, 136, 0.2) 0%, transparent 62%);
  z-index: 0;
}

.tonight-heart__svg {
  position: relative;
  z-index: 1;
  width: var(--emblem);
  height: var(--emblem);
  margin: auto;
  overflow: visible;
  transform-origin: 50% 55%;
  filter:
    drop-shadow(0 0 8px #ff4d88)
    drop-shadow(0 0 24px rgba(255, 77, 136, 0.55));
  animation: tonight-heart-beat 0.94s ease-in-out infinite;
}

.tonight-heart__halo,
.tonight-heart__glow,
.tonight-heart__core {
  fill: none;
}

.tonight-heart__halo {
  stroke: #ff4d88;
  stroke-width: 9;
  opacity: 0.28;
}

.tonight-heart__glow {
  stroke: #ff4d88;
  stroke-width: 4.5;
  opacity: 0.65;
}

.tonight-heart__core {
  stroke: #ffd2e0;
  stroke-width: 2.4;
  stroke-linecap: round;
}

@keyframes tonight-heart-beat {
  0% { transform: scale(1); }
  12% { transform: scale(1.075); }
  24% { transform: scale(0.995); }
  36% { transform: scale(1.05); }
  50% { transform: scale(1); }
  100% { transform: scale(1); }
}

.tonight-still[data-emblem="twins"] .tonight-twins {
  display: grid;
  place-items: center;
  padding: 0;
}

.tonight-mirror {
  width: var(--emblem);
  height: var(--emblem);
  margin: auto;
  overflow: visible;
  transform-origin: 50% 50%;
  animation: tonight-mirror-flip 7.3s ease-in-out infinite;
}

.tonight-mirror path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tonight-mirror__bar[data-wing="a"] {
  stroke: var(--teal);
  stroke-width: 6;
  filter: drop-shadow(0 0 8px rgba(61, 220, 180, 0.55));
}

.tonight-mirror__bar[data-wing="b"] {
  stroke: var(--gold);
  stroke-width: 6;
  filter: drop-shadow(0 0 8px rgba(212, 160, 60, 0.5));
}

.tonight-mirror__axis-halo {
  stroke: var(--gold);
  stroke-width: 3.4;
  opacity: 0.35;
  animation: tonight-mirror-axis 7.3s linear infinite;
}

.tonight-mirror__axis-core {
  stroke: color-mix(in srgb, var(--gold) 42%, white);
  stroke-width: 1.6;
  animation: tonight-mirror-axis-core 7.3s linear infinite;
}

@keyframes tonight-mirror-flip {
  0%, 100% { transform: scaleX(1); }
  25% { transform: scaleX(0); }
  50% { transform: scaleX(-1); }
  75% { transform: scaleX(0); }
}

@keyframes tonight-mirror-axis {
  0%, 24.99% { stroke: var(--gold); }
  25%, 74.99% { stroke: var(--teal); }
  75%, 100% { stroke: var(--gold); }
}

@keyframes tonight-mirror-axis-core {
  0%, 24.99% { stroke: color-mix(in srgb, var(--gold) 42%, white); }
  25%, 74.99% { stroke: color-mix(in srgb, var(--teal) 42%, white); }
  75%, 100% { stroke: color-mix(in srgb, var(--gold) 42%, white); }
}

.tonight-still[data-emblem="heart"] .tonight-scan,
.tonight-still[data-emblem="twins"] .tonight-scan,
.tonight-still[data-emblem="void"] .tonight-scan {
  mix-blend-mode: normal;
  background: linear-gradient(180deg, rgba(232, 213, 163, 0.05), transparent 30%);
}

.tonight-scan {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(232, 213, 163, 0.06), transparent 22%, transparent 78%, rgba(0, 0, 0, 0.35)),
    repeating-linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.22) 0 1px,
      transparent 1px 3px
    );
  box-shadow: inset 0 0 36px rgba(0, 0, 0, 0.55);
  mix-blend-mode: multiply;
}

.tonight-copy {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 8px 12px 8px;
  border-top: 1px solid var(--hairline);
  background: rgba(9, 8, 15, 0.72);
}

.tonight-copy .receipt__mark {
  margin: 0;
  flex: 0 0 auto;
  font-size: clamp(13px, 2.2vw, 16px);
  letter-spacing: 0.16em;
  color: var(--brass);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tonight-title {
  margin: 2px 0 0;
  flex: 0 0 auto;
  font-family: var(--chrome);
  font-size: clamp(20px, 3.6vw, 30px);
  font-weight: 400;
  letter-spacing: 0.14em;
  line-height: 1.05;
  color: var(--tonight-accent);
  text-shadow: 0 0 14px color-mix(in srgb, var(--tonight-accent) 28%, transparent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tonight-body {
  margin: 4px 0 0;
  height: 2.76em;
  overflow: hidden;
  font-family: var(--prose);
  font-weight: 500;
  font-size: clamp(15px, 1.8vw, 19px);
  line-height: 1.38;
  color: var(--parchment);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.65);
}

.tonight-body p {
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.tonight-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border-left: 1px solid var(--hairline);
  background: rgba(9, 8, 15, 0.55);
  scrollbar-width: thin;
  scrollbar-color: var(--hairline) transparent;
}

.tonight-list li {
  margin: 0;
  padding: 0;
  min-width: 0;
}

.tonight-row {
  --row-accent: var(--gold);
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 7px 10px 7px 12px;
  font-family: var(--chrome);
  font-size: clamp(13px, 1.6vw, 16px);
  letter-spacing: 0.1em;
  line-height: 1.15;
  text-align: left;
  color: var(--parchment);
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  border: 0;
  border-bottom: 1px solid var(--hairline);
  border-left: 3px solid transparent;
  background: transparent;
}

.tonight-row[data-room="oracle"] { --row-accent: var(--gold); }
.tonight-row[data-room="roast"] { --row-accent: var(--ember); }
.tonight-row[data-room="mimic"] { --row-accent: var(--teal); }
.tonight-row[data-room="lovedoctor"] { --row-accent: var(--rose); }
.tonight-row[data-room="starsong"] { --row-accent: var(--violet); }
.tonight-row[data-room="peeps"] { --row-accent: var(--parchment); }

.tonight-row__ch {
  flex: 0 0 auto;
  letter-spacing: 0.14em;
  color: var(--brass);
  opacity: 0.78;
}

.tonight-row__name {
  min-width: 0;
  flex: 1 1 auto;
  color: var(--row-accent);
  overflow-wrap: anywhere;
}

.tonight-row.is-on,
.tonight-row[aria-pressed="true"] {
  color: var(--void);
  border-left-color: color-mix(in srgb, var(--row-accent) 80%, white);
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--row-accent) 88%, white),
    var(--row-accent) 55%,
    color-mix(in srgb, var(--row-accent) 72%, #2a1a0c)
  );
}

.tonight-row.is-on .tonight-row__name,
.tonight-row[aria-pressed="true"] .tonight-row__name,
.tonight-row.is-on .tonight-row__ch,
.tonight-row[aria-pressed="true"] .tonight-row__ch {
  color: var(--void);
  opacity: 0.82;
}

.tonight-row:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
}

@media (min-width: 721px) {
  .tonight-copy .receipt__mark {
    font-size: clamp(11px, 2cqi, 13px);
  }

  .tonight-title {
    font-size: clamp(16px, 3.2cqi, 22px);
  }

  .tonight-body {
    font-size: clamp(13px, 2.2cqi, 16px);
  }

  .tonight-row {
    font-size: clamp(12px, 2.2cqi, 14px);
    min-height: 38px;
    padding: 6px 10px 6px 12px;
  }
}

.machine[data-mode="tonight"] .receipt {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  pointer-events: auto;
}

@media (max-width: 720px) {
  .tonight {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) minmax(8.5rem, 46%);
    overflow: hidden;
  }

  .tonight-pane {
    grid-template-rows: minmax(0, 1fr) 6.5rem;
  }

  .tonight-still {
    min-height: 0;
  }

  .tonight-copy {
    padding: 7px 10px 8px;
  }

  .tonight-list {
    border-left: 0;
    border-top: 1px solid var(--hairline);
    overflow: auto;
  }

  .tonight-row {
    min-height: 48px;
    padding: 6px 10px;
  }
}

@media (hover: hover) and (pointer: fine) {
  .tonight-row:hover {
    background: color-mix(in srgb, var(--row-accent) 16%, transparent);
  }

  .tonight-row.is-on:hover,
  .tonight-row[aria-pressed="true"]:hover {
    filter: brightness(1.06);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tonight-scan {
    background: linear-gradient(180deg, rgba(232, 213, 163, 0.05), transparent 28%);
    mix-blend-mode: normal;
  }

  .tonight-heart__svg,
  .tonight-mirror {
    animation: none;
  }
}
