/* The Supper Club Week. Spotlight: a dark atrium, one warm pool of light on the table and the grid.
   Square corners, hairline rules, flush-left serif type. Nothing bounces; light changes slowly. */

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

:root {
  --pad: 6px;
  --gap: 10px;
  --sl: max(var(--pad), env(safe-area-inset-left));
  --sr: max(var(--pad), env(safe-area-inset-right));
  --sb: max(var(--pad), env(safe-area-inset-bottom));
  --top: calc(var(--ac-status-h, 64px) + 8px);
  --hdr: 24px;
  /* Evenings down the left: three letters each, so the grid keeps the phone's width. */
  --lab: 30px;
  --logo-w: 64px;
  --act-h: 94px;
  --linen: #EFE9DC;
  --warm: 255 232 198;
  --rule: rgb(231 226 214 / 0.2);
  --rule-strong: rgb(231 226 214 / 0.78);
  --slow: 900ms;
}

html, body { margin: 0; height: 100%; }

body {
  min-height: 100dvh;
  overflow: hidden;
  background-color: var(--ak-bg);
  background-image: var(--ak-backdrop-layer, none), var(--ak-bg-art);
  background-size: cover, var(--ak-bg-size);
  background-position: center;
  color: var(--ak-ink);
  font-family: var(--ak-font-body);
}

/* The house lights: the edges of the atrium sit in shadow until the week is set. */
.house {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 72% 62% at 50% 46%, transparent 30%, rgb(3 6 12 / 0.62) 100%);
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse 90% 80% at 50% 40%, rgb(var(--warm) / 0.14), rgb(var(--warm) / 0.05) 70%);
}
:root.house-up .house { opacity: 0; }
:root.house-up body::after { opacity: 1; }

.play {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: var(--top) var(--sr) var(--sb) var(--sl);
  overflow-x: hidden;
  overflow-y: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.play[hidden] { display: none; }

/* ---------- Upright: the table, the L of squares across the phone's width, the controls, the clues ---------- */

.stage {
  /* --side-h is the clue panel's real height, measured by game.js; --msg-h is a check message in the top row. */
  --side-h: 200px;
  --head: clamp(
    52px,
    calc(100dvh - var(--top) - var(--sb) - var(--hdr) - 8 * 44px - var(--act-h) - var(--side-h) - 2 * var(--gap)),
    min(130px, 16dvh, calc((100dvw - var(--sl) - var(--sr) - var(--logo-w) - 8px) / 2.313))
  );
  --head-row: max(var(--head), var(--msg-h, 0px));
  /* All six clues always stay on screen: on a short phone the squares give a little before the clues do. */
  --c: max(var(--floor, 34px), min(
    64px,
    calc((100dvw - var(--sl) - var(--sr) - var(--lab)) / 8),
    calc((100dvh - var(--top) - var(--sb) - var(--head-row) - var(--hdr) - var(--act-h) - var(--side-h) - 2 * var(--gap)) / 8)
  ));
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  align-items: stretch;
  margin-block: auto;
}

.sheet {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: var(--lab) repeat(8, var(--c));
  grid-template-rows: var(--head-row) var(--hdr) repeat(8, var(--c)) var(--act-h);
}
.sheet > *,
.block > * {
  grid-row: var(--pr) / span var(--prs, 1);
  grid-column: var(--pc) / span var(--pcs, 1);
}
.block { display: contents; }
.sheet > .only-side { display: none; }

/* The pool of warm light that falls on the table and the grid. */
.sheet::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(closest-side, rgb(var(--warm) / 0.13), rgb(var(--warm) / 0.04) 70%, transparent);
}
.sheet.is-lit::before { opacity: 0.45; }

.head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  padding-bottom: 6px;
}
.logo {
  display: block;
  width: var(--logo-w);
  height: auto;
  max-height: 100%;
  object-fit: contain;
  flex: 0 0 auto;
}

.table {
  position: relative;
  margin: 0;
  /* As tall as the row allows, but never wider than the room left beside the logo. */
  flex: 0 1 auto;
  min-width: 0;
  width: calc((var(--head-row) - 6px) * 2.313);
  height: auto;
  aspect-ratio: 384 / 166;
  container-type: inline-size;
}
.table-art { display: block; width: 100%; height: 100%; }
.plates { position: absolute; inset: 0; }

.plate {
  position: absolute;
  top: calc(20.1cqw - 10.5cqw);
  left: calc(var(--cx) - 10.5cqw);
  width: 21cqw;
  height: 21cqw;
}
.plate:nth-child(1) { --cx: 16.1cqw; }
.plate:nth-child(2) { --cx: 38.6cqw; }
.plate:nth-child(3) { --cx: 61.2cqw; }
.plate:nth-child(4) { --cx: 83.9cqw; }
.plate svg { display: block; width: 100%; height: 100%; opacity: 0; overflow: visible; }
.plate.is-set svg { opacity: 1; }
.plate-disc { fill: var(--linen); stroke: rgb(11 18 32 / 0.4); stroke-width: 1.2; }
.plate-well { fill: none; stroke: rgb(31 167 160 / 0.6); stroke-width: 1.2; }
.plate-initial { fill: var(--ak-bg); font-family: var(--ak-font-display); font-weight: 700; font-size: 46px; }
.plate-dish {
  fill: #7A2E1B;
  font-family: var(--ak-font-body);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.plaque {
  position: absolute;
  top: 20.4cqw;
  left: 50%;
  translate: -50% 0;
  height: 3.8cqw;
  color: #2B241C;
  font-size: max(7px, 3cqw);
  font-weight: 600;
  line-height: 3.8cqw;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Every label is written across, never turned on its side. */
.col-head,
.row-head {
  display: flex;
  min-width: 0;
  color: var(--ak-ink);
  font-size: clamp(9.5px, calc(var(--c) * 0.3), 15px);
  font-weight: 600;
  line-height: 1.1;
  white-space: nowrap;
}
.col-head { align-items: flex-end; justify-content: center; padding-bottom: 5px; }
.row-head { align-items: center; justify-content: flex-start; padding-left: 1px; }
/* Upright, the lower block's hosts sit in the grid's empty corner, flush left against the block. */
.host-head { padding-left: 10px; font-size: clamp(12px, calc(var(--c) * 0.32), 16px); }

.cell {
  position: relative;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background-color: var(--ak-surface);
  background-image:
    repeating-linear-gradient(0deg, rgb(231 226 214 / 0.035) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgb(231 226 214 / 0.03) 0 1px, transparent 1px 3px);
  box-shadow: inset -1px -1px 0 var(--rule);
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

/* The marks, as the look asks for them: a cross is a thin teal stroke, a dot a solid coral disc.
   They differ by shape before colour and sit quietly on the linen, like the grid's own rules. */
.cell::before,
.legend-mark::before {
  content: '';
  position: absolute;
  inset: 24%;
  opacity: 0;
}
.cell[data-mark="cross"]::before,
.legend-mark.is-cross::before {
  opacity: 1;
  background:
    linear-gradient(45deg, transparent calc(50% - 1.3px), var(--ak-accent) calc(50% - 1.3px) calc(50% + 1.3px), transparent calc(50% + 1.3px)),
    linear-gradient(-45deg, transparent calc(50% - 1.3px), var(--ak-accent) calc(50% - 1.3px) calc(50% + 1.3px), transparent calc(50% + 1.3px));
}
.cell[data-mark="dot"]::before,
.legend-mark.is-dot::before {
  opacity: 1;
  inset: 27%;
  border-radius: 50%;
  background: var(--ak-accent-2);
}
.cell.is-example::before { opacity: 0.9; }
.cell::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: rgb(var(--warm) / 0.32);
  opacity: 0;
}
.cell:focus-visible { outline: 3px solid var(--ak-focus); outline-offset: -3px; z-index: 3; }

/* A clue narrows the light onto the squares it speaks about. */
.sheet.is-lit .cell:not(.on) { filter: brightness(0.5) saturate(0.7); }
.cell.on { box-shadow: inset -1px -1px 0 var(--rule), inset 0 0 0 1px rgb(var(--warm) / 0.45), inset 0 0 calc(var(--c) * 0.4) rgb(var(--warm) / 0.2); }
.cell.key { box-shadow: inset 0 0 0 2px var(--linen), inset 0 0 calc(var(--c) * 0.4) rgb(var(--warm) / 0.25); }

/* A failed check points at the marks that cannot stand, and at the empty squares when unfinished. */
.cell.wrong { z-index: 2; }
.cell.wrong::after {
  inset: 2px;
  opacity: 1;
  background: none;
  border: 2px dashed var(--ak-accent-2);
}
.cell.open::after { opacity: 1; background: rgb(var(--warm) / 0.08); border: 1px dotted rgb(231 226 214 / 0.5); inset: 5px; }

/* A hint, and the first move, are lit softly: a light on the square, a fine linen rule round it. */
.cell.hinted,
.cell.invite { z-index: 2; box-shadow: inset 0 0 0 2px var(--linen); }
.cell.hinted::after,
.cell.invite::after { opacity: 0.7; background: radial-gradient(closest-side, rgb(var(--warm) / 0.45), transparent); }

.frame {
  pointer-events: none;
  z-index: 1;
  border: 2px solid var(--rule-strong);
  margin: -1px;
}
.sheet > .frame {
  grid-row: var(--pr) / span var(--prs);
  grid-column: var(--pc) / span var(--pcs);
}

/* ---------- The controls: one ruled line under the grid, in the grid's own language ---------- */

.act {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  padding-top: 8px;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  column-gap: 14px;
  row-gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--ak-ink-muted);
  font-size: 12px;
  line-height: 1.2;
}
.legend li { display: flex; align-items: center; gap: 6px; min-height: 20px; white-space: nowrap; }
.legend-mark {
  position: relative;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  border: 1px solid var(--rule);
  background: var(--ak-surface);
}
.legend-side { display: none; }

.act-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--rule);
}
.next {
  flex: 1 1 auto;
  align-self: center;
  min-width: 0;
  margin: 0;
  color: var(--ak-ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.check,
.hint,
.got-it {
  margin: 0;
  border-radius: 0;
  background: var(--ak-bg);
  color: var(--ak-ink);
  font-family: var(--ak-font-display);
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}
.check {
  flex: 0 0 auto;
  width: 116px;
  min-height: 52px;
  padding: 2px 10px 0;
  border: 1px solid var(--rule-strong);
  border-top: 3px solid var(--linen);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.1;
}
/* Every square filled: a soft light picks out the one thing left to do. */
.check.is-ready {
  border-color: var(--linen);
  box-shadow: 0 0 0 4px rgb(var(--warm) / 0.12), 0 0 24px rgb(var(--warm) / 0.2);
}
.hint {
  flex: 0 0 auto;
  min-width: 60px;
  min-height: 52px;
  padding: 0 10px;
  border: 1px solid var(--rule-strong);
  font-size: 17px;
  font-variant: small-caps;
  letter-spacing: 0.06em;
  text-transform: lowercase;
}
.hint:disabled { opacity: 0.45; cursor: default; }
.check:focus-visible,
.hint:focus-visible,
.clue:focus-visible,
.got-it:focus-visible { outline: 3px solid var(--ak-focus); outline-offset: 2px; }
@media (hover: hover) {
  .check:hover,
  .hint:not(:disabled):hover { background: var(--ak-surface); }
}

/* The week is set: the board closes, and only the result is left to read. */
.play.is-solved .cell { pointer-events: none; }
.play.is-solved .check,
.play.is-solved .hint,
.play.is-solved .legend { visibility: hidden; }

/* The help button in the same quiet, ruled language as the rest of the sheet. */
html body #activity-help.site-deeperpectives {
  border: 1px solid var(--rule-strong);
  border-radius: 0;
  background: var(--ak-bg);
  color: var(--ak-ink);
  box-shadow: none;
  font-weight: 600;
}

/* ---------- The clues ---------- */

.side {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  /* Upright the clues take the full width, so their height never depends on the squares' size. */
  width: min(560px, calc(100dvw - var(--sl) - var(--sr)));
  align-self: center;
}
.goal {
  margin: 0 0 4px;
  color: var(--ak-ink-muted);
  font-size: 14px;
  font-style: italic;
  line-height: 1.3;
}
.clues {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: minmax(52px, auto);
  column-gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--rule-strong);
}
.clues li { display: flex; border-bottom: 1px solid var(--rule); }
.clue {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 4px 6px 4px 0;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--ak-ink);
  font: inherit;
  font-size: 14px;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}
.clue-text { flex: 1 1 auto; min-width: 0; }
.clue-n {
  flex: 0 0 auto;
  min-width: 1.4em;
  padding-left: 6px;
  font-family: var(--ak-font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}
.clue[aria-pressed="true"] { border-left-color: var(--linen); background: var(--ak-surface); }
.clue.is-invite { border-left-color: var(--linen); }
.clue.is-broken { border-left: 5px solid var(--ak-accent-2); background: var(--ak-surface); }
.clue.is-broken .clue-n { color: var(--ak-accent-2); }
.clue.is-new { border-left: 3px dashed var(--ak-ink-muted); }
.clue.is-new .clue-text { font-style: italic; }

/* ---------- The worked step: it sits over the clues, never over the squares it shows ---------- */

.teach {
  position: absolute;
  inset: 0 0 auto 0;
  min-height: 100%;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 3px solid var(--linen);
  background: var(--ak-bg);
}
.teach[hidden] { display: none; }
.teach-label {
  margin: 0;
  color: var(--ak-ink-muted);
  font-size: 14px;
  font-variant: small-caps;
  letter-spacing: 0.08em;
  text-transform: lowercase;
}
.teach-text { margin: 0; color: var(--ak-ink); font-size: 18px; line-height: 1.35; }
.got-it {
  align-self: flex-start;
  min-width: 160px;
  min-height: 56px;
  margin-top: auto;
  padding: 0 24px;
  border: 2px solid var(--linen);
  font-size: 22px;
  font-weight: 700;
}

/* A narrow phone: the sheet runs nearly edge to edge so the squares keep their size. */
@media (orientation: portrait) and (max-width: 430px) {
  :root { --pad: 4px; }
}

/* A short upright phone: the check message is set a little smaller, and the goal line steps aside
   while it is up (it comes back on the next tap), so the squares and the six clues keep their room. */
@media (orientation: portrait) and (max-height: 720px) {
  html body #activity-chrome-toast.in-slot { font-size: 13px; padding: 6px 8px; }
  .play.has-msg .goal { display: none; }
}

/* A shorter upright phone has no room for a full row of controls under the grid, so they move into
   the grid's empty corner and the hosts' names join the evenings in the left column. */
@media (orientation: portrait) and (max-height: 819px) {
  :root { --lab: 40px; --act-h: 0px; }
  .sheet { grid-template-rows: var(--head-row) var(--hdr) repeat(8, var(--c)); }
  .sheet .host-head { grid-column: 1 / span 1; padding-left: 1px; font-size: clamp(9.5px, calc(var(--c) * 0.3), 15px); }
  .sheet .act { grid-row: 7 / span 4; grid-column: 6 / span 4; justify-content: flex-end; gap: 6px; padding: 6px 0 0 10px; }
  .legend-act { flex-direction: column; flex-wrap: nowrap; }
  .act-row { flex-wrap: wrap; row-gap: 6px; padding-top: 0; border-top: 0; }
  .next { flex: 1 1 100%; font-size: 12px; }
  .legend-act li:nth-child(3) { display: none; }
  .sheet .act { padding-top: 0; }
  /* While a message is up it already says what to do, so the line over the buttons steps aside. */
  .play.has-msg .next { display: none; }
  .check { flex: 1 1 0; width: auto; min-width: 0; min-height: 48px; padding: 2px 8px 0; font-size: 14px; }
  .hint { min-width: 50px; min-height: 48px; padding: 0 6px; font-size: 15px; }
  /* The opening sheet keeps both of its buttons on the first screen. */
  html body #activity-start.site-deeperpectives .ak-scene { padding: 12px 14px 14px; }
  html body #activity-start.site-deeperpectives .ak-scene-line { font-size: 19px; padding-left: 1.7em; }
  html body #activity-start .sc-table { font-size: 13px; padding-bottom: 6px; }
}

@media (orientation: portrait) and (max-width: 380px) {
  .legend { column-gap: 10px; font-size: 11px; }
  .check { width: 104px; font-size: 15px; }
  .hint { min-width: 54px; padding: 0 6px; font-size: 15px; }
  .next { font-size: 12px; }
}

/* A very short upright phone: the corner's controls set a size smaller so all of them fit. */
@media (orientation: portrait) and (max-height: 700px) {
  .legend li { min-height: 18px; }
  .next { font-size: 11px; line-height: 1.25; }
  .check { font-size: 13px; padding: 2px 6px 0; }
  .hint { min-width: 48px; font-size: 14px; }
  html body #activity-start.site-deeperpectives .ak-scene-line { font-size: 17px; }
  html body #activity-start .sc-table { font-size: 12px; }
}

/* Wider upright screens have room for the full evening names' column and larger type. */
@media (orientation: portrait) and (min-width: 481px) {
  :root { --lab: 52px; --logo-w: 88px; }
  .clue { font-size: 16px; }
  .legend { font-size: 13px; }
}

/* ---------- Sideways: the grid in one strip with its own room, the clues in a ruled column ---------- */

@media (orientation: landscape) {
  :root {
    --logo-w: 60px;
    --top: calc(var(--ac-status-h, 64px) + 4px);
    /* The hosts' names between the second block and the third. */
    --lab2: 50px;
  }
  .stage {
    --side-w: clamp(196px, 24vw, 340px);
    /* Sideways the width sets the squares; the table row takes whatever height they leave. */
    --cw: min(72px, calc((100dvw - var(--sl) - var(--sr) - var(--side-w) - 14px - var(--lab) - var(--lab2)) / 12));
    /* At least room for the next step over the check and the hint, beside the table. */
    --head: clamp(90px, calc(100dvh - var(--top) - var(--sb) - var(--hdr) - 4 * var(--cw)), 124px);
    --c: min(var(--cw), calc((100dvh - var(--top) - var(--sb) - var(--head-row) - var(--hdr)) / 4));
    flex-direction: row;
    align-items: flex-start;
    gap: 14px;
  }
  .sheet {
    grid-template-columns: var(--lab) repeat(8, var(--c)) var(--lab2) repeat(4, var(--c));
    grid-template-rows: var(--head-row) var(--hdr) repeat(4, var(--c));
  }
  .sheet > *,
  .block > * {
    grid-row: var(--lr) / span var(--lrs, 1);
    grid-column: var(--lc) / span var(--lcs, 1);
  }
  .sheet > .frame {
    grid-row: var(--lr) / span var(--lrs);
    grid-column: var(--lc) / span var(--lcs);
  }
  .sheet > .only-side { display: flex; }
  .host-head { grid-column: var(--lc) / span 1; padding-left: 8px; font-size: clamp(11px, calc(var(--c) * 0.29), 15px); }

  /* The next step over the check and the hint, set to the right of the table. */
  .act { justify-content: flex-end; gap: 6px; padding: 0 0 6px 14px; }
  .legend-act { flex-wrap: nowrap; }
  .legend-act li:nth-child(3) { display: none; }
  .act-row { flex-wrap: wrap; justify-content: flex-end; row-gap: 6px; padding-top: 0; border-top: 0; }
  .next { flex: 1 1 100%; align-self: auto; font-size: 12px; }
  .check { width: 112px; min-height: 48px; font-size: 15px; }
  .hint { min-height: 48px; }
  /* The message in the table's row already says what to do, so the line over the buttons steps aside. */
  .play.has-msg .next { visibility: hidden; }

  /* The clues get their own column behind a rule, with the two marks they are worked in. */
  .side {
    width: var(--side-w);
    align-self: flex-start;
    height: calc(100dvh - var(--top) - var(--sb));
    max-height: calc(var(--head-row) + var(--hdr) + 4 * var(--c) + 48px);
    padding-left: 12px;
    border-left: 1px solid var(--rule-strong);
  }
  .goal { display: none; }
  .clues { grid-template-columns: 1fr; grid-auto-rows: minmax(48px, 1fr); flex: 1 1 auto; }
  .clue { padding-block: 2px; font-size: 13.5px; line-height: 1.2; }
  .clue-n { font-size: 17px; min-width: 1.2em; }
}

/* A short sideways screen: the clue rows may close to 44px so the six of them and their marks fit. */
@media (orientation: landscape) and (max-height: 420px) {
  .clues { grid-auto-rows: minmax(44px, 1fr); }
  .clue { min-height: 44px; }
}

/* A narrow sideways phone: slimmer name columns, so the grid keeps what width there is. */
@media (orientation: landscape) and (max-width: 700px) {
  :root { --lab2: 44px; --lab: 28px; }
  .legend { column-gap: 10px; font-size: 11px; }
  .clue { font-size: 12.5px; }
  .check { width: 96px; font-size: 14px; }
}

/* A sideways phone with its browser bars showing: the six clues still fit in one column. */
@media (orientation: landscape) and (max-height: 380px) {
  .clues { grid-auto-rows: minmax(44px, 1fr); }
  .clue { min-height: 44px; font-size: 13px; }
  /* Room for the marks and the two buttons only; the first move stays lit on the grid itself. */
  .next { display: none; }
  .legend { font-size: 11px; }
  html body #activity-chrome-toast.in-slot { font-size: 12px; line-height: 1.25; padding: 5px 8px; }
}

/* A laptop or a tablet on its side: names written out in full, larger type, the goal over the clues. */
@media (orientation: landscape) and (min-height: 501px) {
  :root { --lab: 52px; --lab2: 72px; --logo-w: 96px; }
  .clue { font-size: 16px; }
  .legend { font-size: 13px; }
  .goal { display: block; }
  .side { height: auto; }
  .legend-act { display: none; }
  .legend-side { display: flex; margin-bottom: 4px; }
}

/* The site's message strip never blocks a tap: the tap reaches the square and clears the message. */
#activity-chrome-toast { pointer-events: none; }
/* A check message sits in the top row of the sheet, over the table, and the layout makes room for it,
   so it never covers a square, a label, a clue or a button. game.js sets its place and size. */
html body #activity-chrome-toast.in-slot {
  bottom: auto;
  right: auto;
  translate: none;
  max-width: none;
  padding: 8px 10px;
  border-top: 3px solid var(--ak-accent-2);
  font-size: 14px;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

/* ---------- The ending: a short verdict under the chrome's rule; the week in four strong lines ---------- */

#activity-chrome-ending .ac-line:nth-child(-n+4) {
  margin: 0 0 2px;
  color: var(--ak-ink);
  font-family: var(--ak-font-display);
  font-size: clamp(18px, 3.2vw, 24px);
  font-weight: 600;
}
#activity-chrome-ending .ac-line:nth-child(5) { margin-top: 10px; }
#activity-chrome-ending .ac-line:nth-child(6) {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--ak-outline);
  font-variant: small-caps;
  letter-spacing: 0.04em;
}

/* ---------- Motion: slow light, a mark settling, the plates set in order ---------- */

@media (prefers-reduced-motion: no-preference) {
  :root:not(.ac-still) .house,
  :root:not(.ac-still) body::after { transition: opacity 2400ms ease; }
  :root:not(.ac-still) .sheet::before { transition: opacity var(--slow) ease; }
  :root:not(.ac-still) .cell { transition: filter var(--slow) ease, box-shadow var(--slow) ease; }
  :root:not(.ac-still) .cell.settle::before { animation: mark-in 420ms cubic-bezier(0.22, 1, 0.36, 1) both; }
  :root:not(.ac-still) .cell.settle:not(.wrong):not(.open):not(.invite)::after { animation: warm-off 1100ms ease-out both; }
  :root:not(.ac-still) .cell.invite::after { animation: breathe 2600ms ease-in-out infinite alternate; }
  :root:not(.ac-still) .check.is-ready { transition: box-shadow var(--slow) ease; }
  :root:not(.ac-still) .plate svg { transition: opacity var(--slow) ease; }
  :root:not(.ac-still) .plate.just-set svg { animation: plate-in 900ms cubic-bezier(0.22, 1, 0.36, 1) both; }
  :root:not(.ac-still) .plate.glow svg { animation: plate-glow 1600ms ease-out both; }
  :root:not(.ac-still) .clue { transition: background-color var(--slow) ease, border-color var(--slow) ease; }
}
:root.ac-still .plate.glow svg,
.plate.glow svg { filter: drop-shadow(0 0 6px rgb(var(--warm) / 0.75)); }

@keyframes mark-in { from { opacity: 0; scale: 0.9; } to { opacity: 1; scale: 1; } }
@keyframes warm-off { from { opacity: 1; } to { opacity: 0; } }
@keyframes breathe { from { opacity: 0.35; } to { opacity: 0.85; } }
@keyframes plate-in { from { opacity: 0; filter: brightness(1.5); } to { opacity: 1; filter: none; } }
@keyframes plate-glow {
  from { filter: drop-shadow(0 0 0 rgb(var(--warm) / 0)); }
  to { filter: drop-shadow(0 0 6px rgb(var(--warm) / 0.75)); }
}

/* ---------- The opening scene (start.js draws it; this only arranges and numbers it) ---------- */

/* The scene reads as the argument sheet: the title over its rule, the week named plainly, then the
   lines numbered I, II, III down a quiet backing that lets the atrium show round it. */
html body #activity-start.site-deeperpectives .ak-scene {
  padding: 20px 22px 24px;
  background: color-mix(in srgb, var(--ak-bg) 86%, transparent);
}
html body #activity-start .sc-table {
  align-self: stretch;
  margin: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--ak-outline);
  color: var(--ak-ink-muted);
  font-size: 14px;
  font-variant: small-caps;
  letter-spacing: 0.06em;
  line-height: 1.4;
  text-transform: lowercase;
}
/* The typed lines keep their finished width from the first frame, so game.js can hold their height
   and the buttons below never move while the lines type in. */
html body #activity-start .ak-scene-lines { align-self: stretch; counter-reset: part; }
html body #activity-start .ak-scene-line {
  position: relative;
  padding-left: 2.1em;
  counter-increment: part;
}
html body #activity-start .ak-scene-line::before {
  content: counter(part, upper-roman);
  position: absolute;
  left: 0;
  top: 0.32em;
  color: var(--ak-ink-muted);
  font-size: 0.62em;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* Sideways, from a phone up to a laptop: the lines sit on the left and the two ways in on the right,
   so both buttons are on the first screen without scrolling. */
@media (orientation: landscape) and (max-height: 820px) {
  html body #activity-start.site-deeperpectives .ak-scene {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "head head" "table table" "lines actions";
    align-items: end;
    column-gap: 32px;
    row-gap: 10px;
    width: min(100%, 860px);
    padding: 14px 20px 16px;
  }
  html body #activity-start.site-deeperpectives .ak-scene .ak-head { grid-area: head; }
  html body #activity-start .sc-table { grid-area: table; padding-bottom: 6px; font-size: 13px; }
  html body #activity-start.site-deeperpectives .ak-scene-lines { grid-area: lines; max-width: 46ch; gap: 6px; }
  html body #activity-start.site-deeperpectives .ak-scene-line { font-size: clamp(16px, 4.6dvh, 24px); line-height: 1.3; }
  html body #activity-start.site-deeperpectives .ak-scene-actions { grid-area: actions; align-items: flex-start; }
}
