/* Entry 028 — Overrule me
   Series: Negotiated Interfaces.
   Scene art direction: a quiet warm room at dusk — deep umber and clay, one low
   lamp, painterly and out of focus. A single frosted-glass panel floats in the
   gloom: the negotiation itself. Your instruction, cool and plain, sits above the
   machine's counter, which speaks in a warm serif and owns the one accent — a
   clay-amber. Two parties, one lamp. Display serif: Spectral. UI sans: Space Grotesk.
   Design focus: a single component, given the whole frame and room to breathe. */

:root {
  --clay: #cc8a57;
  --clay-soft: #d8a781;
  --clay-deep: #a5673a;
  --on-dark: #f7eee7;
}

.table-scene {
  display: grid;
  place-items: center;
  min-height: 780px;
  padding: 116px 32px;
  border-color: rgba(24, 18, 14, 0.7);
  /* background-first: a real photograph (warm dark room, one low light) carries
     the mood; a soft scrim keeps the panel and type legible. */
  background-image:
    linear-gradient(176deg, rgba(18, 13, 10, 0.58) 0%, rgba(20, 15, 11, 0.30) 46%, rgba(12, 9, 7, 0.70) 100%),
    url("../../public/media/backgrounds/dark-warm-19-ruedi.jpg");
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
}

/* mid layer — the lamp's warm spill, blurred into the dark */
.lamp {
  position: absolute;
  z-index: 0;
  left: 62%;
  top: 30%;
  width: min(720px, 92%);
  height: 520px;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(58% 58% at 50% 50%, rgba(216, 167, 129, 0.22), transparent 72%);
  filter: blur(60px);
  pointer-events: none;
  transition: opacity 900ms ease;
}

/* ------------------------------------------------------------------ */
/* THE COMPONENT — one frosted-glass negotiation panel                 */
/* ------------------------------------------------------------------ */

.agent {
  position: relative;
  z-index: 2;
  width: min(600px, 100%);
  display: grid;
  gap: 22px;
  padding: 44px 44px 30px;
  border-radius: 20px;
  font-family: var(--ui-sans);
  /* warm frosted glass: a thin film of lamp-light over the photograph */
  background:
    linear-gradient(166deg, rgba(64, 48, 38, 0.30), rgba(20, 15, 11, 0.40));
  border: 1px solid rgba(216, 167, 129, 0.22);
  box-shadow:
    0 1px 0 rgba(247, 238, 231, 0.16) inset,
    0 0 0 1px rgba(10, 7, 5, 0.28),
    0 64px 130px rgba(8, 6, 4, 0.66),
    0 18px 54px rgba(120, 72, 40, 0.22);
  backdrop-filter: blur(28px) saturate(1.2);
  -webkit-backdrop-filter: blur(28px) saturate(1.2);
  color: var(--on-dark);
  transition: filter 700ms ease, transform 600ms cubic-bezier(0.2, 0.6, 0.2, 1);
}

/* --- your side of the table: cool, plain, no accent --- */
.agent-head { display: grid; gap: 10px; }

.you { margin: 0; display: grid; gap: 7px; }

.you-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(230, 220, 210, 0.44);
}

.you-text {
  font-family: var(--ui-sans);
  font-size: clamp(19px, 2.6vw, 24px);
  font-weight: 500;
  line-height: 1.28;
  color: #efe7df;
  text-wrap: balance;
}

.ctx {
  margin: 0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: rgba(216, 167, 129, 0.55);
}

/* hairline between the two sides of the table */
.reply {
  display: grid;
  gap: 12px;
  padding-top: 22px;
  border-top: 1px solid rgba(216, 167, 129, 0.18);
}

.stance-label {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--clay);
}

/* the machine's position — the hero. serif, warm, weighty, never pure white */
.stance {
  margin: 0;
  font-family: "Spectral", "Newsreader", Georgia, serif;
  font-weight: 400;
  font-size: clamp(26px, 4.1vw, 40px);
  line-height: 1.12;
  letter-spacing: 0.002em;
  color: var(--on-dark);
  text-wrap: balance;
}

.reason {
  margin: 0;
  max-width: 46ch;
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(15px, 1.7vw, 17.5px);
  line-height: 1.5;
  color: rgba(238, 224, 212, 0.72);
}

.stance.concede { color: var(--clay-soft); }

/* --- your moves --- */
.moves {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2px;
}

.chip {
  font-family: var(--ui-sans);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.005em;
  border-radius: 12px;
  padding: 12px 18px;
  cursor: pointer;
  color: rgba(240, 230, 220, 0.86);
  border: 1px solid rgba(216, 167, 129, 0.26);
  background: rgba(216, 167, 129, 0.06);
  transition: transform 170ms ease, background 200ms ease, border-color 200ms ease, color 200ms ease, box-shadow 200ms ease;
}

.chip:hover {
  transform: translateY(-2px);
  border-color: rgba(216, 167, 129, 0.5);
  color: var(--on-dark);
}

/* the machine's own recommendation — the warm, lit choice */
.chip.take {
  border-color: rgba(216, 167, 129, 0.4);
  background: linear-gradient(180deg, rgba(216, 167, 129, 0.22), rgba(165, 103, 58, 0.16));
  color: #fbf3ec;
  box-shadow: 0 10px 28px rgba(120, 72, 40, 0.26);
}

.chip.take:hover {
  box-shadow: 0 16px 36px rgba(120, 72, 40, 0.36);
}

/* overrule — a ghost. available, but it costs a note */
.chip.overrule {
  border-color: rgba(230, 220, 210, 0.16);
  background: transparent;
  color: rgba(232, 222, 212, 0.62);
}

.chip.overrule:hover {
  border-color: rgba(232, 222, 212, 0.4);
  color: rgba(247, 238, 231, 0.9);
}

.chip .cost {
  font-weight: 400;
  font-size: 11.5px;
  letter-spacing: 0;
  color: rgba(230, 220, 210, 0.42);
}

/* --- foot: the running relationship + advance --- */
.agent-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 4px;
  padding-top: 18px;
  border-top: 1px solid rgba(216, 167, 129, 0.14);
}

.tally {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: rgba(230, 220, 210, 0.5);
  font-variant-numeric: tabular-nums;
}

.tally b {
  font-weight: 600;
  color: rgba(247, 238, 231, 0.82);
}

.tally-sep { margin: 0 8px; opacity: 0.5; }

.advance {
  font-family: var(--ui-sans);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--clay-soft);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 2px;
  transition: color 180ms ease, transform 180ms ease;
}

.advance:hover { color: var(--on-dark); transform: translateX(2px); }

/* --- the standing record: honest lines, kept where it lost --- */
.record {
  margin-top: 2px;
  padding-top: 20px;
  border-top: 1px solid rgba(216, 167, 129, 0.14);
  animation: rise 560ms cubic-bezier(0.2, 0.6, 0.2, 1) both;
}

.record-head {
  margin: 0 0 12px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(230, 220, 210, 0.46);
}

.record ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 9px;
}

.record li {
  font-family: "Newsreader", Georgia, serif;
  font-size: 15px;
  line-height: 1.4;
  color: rgba(238, 224, 212, 0.8);
  animation: rise 460ms cubic-bezier(0.2, 0.6, 0.2, 1) both;
}

.record li .rec-mark { color: var(--clay); font-style: italic; }

/* resolved states quiet the lamp a touch */
.agent[data-state="agreed"] { filter: brightness(1.02); }
.agent[data-state="overruled"] { filter: brightness(0.95); }
.table-scene:has(.agent[data-state="overruled"]) .lamp { opacity: 0.6; }

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

.chip, .reply, .stance, .reason { animation: rise 380ms cubic-bezier(0.2, 0.6, 0.2, 1) both; }

@media (prefers-reduced-motion: reduce) {
  .record, .record li, .chip, .reply, .stance, .reason { animation: none; }
  .agent, .lamp, .advance { transition: none; }
}

/* --- photo attribution --- */
.scene-credit {
  position: absolute;
  right: 16px;
  bottom: 13px;
  z-index: 3;
  font-family: var(--ui-sans);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(240, 228, 216, 0.32);
  pointer-events: none;
}

/* --- small screens --- */
@media (max-width: 720px) {
  .table-scene { padding: 72px 16px; min-height: 0; }
  .agent { padding: 32px 24px 24px; border-radius: 18px; gap: 18px; }
  .chip { padding: 11px 15px; }
  .agent-foot { flex-direction: column; align-items: flex-start; gap: 10px; }
  .lamp { left: 50%; }
}
