/* date.css — the Date Creator. Only what base.css does not already give: the slide stage (which is
   a full-bleed coloured panel, unlike every other scene in the product), the editor's two columns,
   and the date bar that sits under an embedded game. Everything else is a base.css class. */

/* ── the library ───────────────────────────────────────────────────────────────────────────── */
.date-lib { max-width: var(--col-wide); }
.date-tpls { margin-bottom: 28px; }
.date-tpl--blank { border-style: dashed; }

.date-mine { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 10px; }
.date-mine__row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r8);
  background: var(--paper-raised);
}
.date-mine__meta { flex: 1 1 220px; min-width: 0; }
.date-mine__title { font-weight: 700; }
.date-mine__sub { color: var(--ink-faint); font-size: 13px; margin-top: 2px; }
.date-mine__acts { display: flex; gap: 6px; flex-wrap: wrap; }
.date-join { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.date-join .code { margin: 8px 0 12px; }

/* ── the slide stage ───────────────────────────────────────────────────────────────────────── */
/* The one screen in Sunny that is not on paper: the slide IS the background, so the stage paints
   itself from the document rather than from a token, and flips its ink for the dark grounds. */
.date-stage {
  --slide-bg: var(--grad-soft);
  background: var(--slide-bg);
  border-radius: var(--r16);
  padding: 22px 20px 26px;
  min-height: min(74vh, 640px);
  display: flex; flex-direction: column; gap: 18px;
  box-shadow: var(--shadow-1);
}
.date-stage.is-dark { color: #FFFFFF; }
.date-stage.is-dark .date-count,
.date-stage.is-dark .date-cap { color: rgba(255, 255, 255, .78); }
.date-stage.is-dark .date-rail__pip { background: rgba(255, 255, 255, .3); }
.date-stage.is-dark .date-rail__pip.is-now { background: #FFFFFF; }
.date-stage.is-dark .date-rail__pip.is-done { background: rgba(255, 255, 255, .6); }

.date-top { display: flex; align-items: center; gap: 12px; }
.date-count { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; color: var(--ink-soft); white-space: nowrap; }
.date-rail { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0; flex: 1; flex-wrap: wrap; }
.date-rail__pip { width: 22px; height: 4px; border-radius: 2px; background: rgba(23, 24, 28, .18); }
.date-rail__pip.is-done { background: rgba(23, 24, 28, .4); }
.date-rail__pip.is-now { background: var(--ink); width: 30px; }
.date-rail__pip--act { border-bottom: 2px solid var(--pink); }

.date-body { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 16px; }
.date-eyebrow { margin: 0; }
.date-heading { font-size: clamp(26px, 5vw, 44px); line-height: 1.15; margin: 0; max-width: 22ch; }
.date-text { font-size: clamp(15px, 2.2vw, 19px); line-height: 1.6; margin: 0; max-width: 46ch; white-space: pre-wrap; }
.date-figure { margin: 0; max-width: min(100%, 460px); }
.date-img { width: 100%; height: auto; border-radius: var(--r8); display: block; }
.date-cap { font-size: 13px; color: var(--ink-soft); margin-top: 6px; }

.date-actions { display: flex; align-items: center; justify-content: center; gap: 10px; }
.date-actions .btn-lg { min-width: min(300px, 70vw); }

/* ── the date bar, under an embedded game ──────────────────────────────────────────────────── */
/* Deliberately not fixed to the viewport: an embedded game owns the screen, and a floating bar over
   somebody's photobooth countdown would be the product talking over itself. It sits at the end of
   the scene, which is where a person looks when a game has finished. */
.date-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 26px auto 0; max-width: var(--col);
  padding: 12px 14px;
  border: 1px solid var(--line); border-top: 3px solid var(--blue);
  border-radius: var(--r8);
  background: var(--paper-raised);
}
.date-bar__left { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.date-bar__who { font-weight: 700; font-size: 14px; }
.date-bar__where { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; color: var(--ink-faint); }
.date-bar__hint { font-size: 12px; color: var(--blue-label); }
.date-bar__go.is-done { background: var(--grad); color: var(--on-ink); border-color: transparent; }

.date-notwired { text-align: center; }
.date-notwired__emoji { font-size: 44px; }

/* ── the ending ────────────────────────────────────────────────────────────────────────────── */
.date-over { text-align: center; display: grid; gap: 16px; justify-items: center; }
.date-over__mark { font-size: 52px; }
.date-over__played { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; min-width: min(340px, 88vw); }
.date-over__row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r8); background: var(--paper-raised); }
.date-over__name { flex: 1; text-align: left; font-weight: 600; }
.date-over__state { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }
.date-over__state.is-done { color: var(--green); }

/* ── the editor ────────────────────────────────────────────────────────────────────────────── */
.date-ed { max-width: var(--col-wide); }
.date-ed__top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.date-ed__title { flex: 1 1 240px; font-size: 20px; font-weight: 700; }
.date-ed__status { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); min-width: 90px; }

.date-ed__cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 860px) { .date-ed__cols { grid-template-columns: minmax(0, 1fr); } }

.date-ed__list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.date-ed__row { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: var(--r8); background: var(--paper-raised); padding: 4px 6px 4px 4px; }
.date-ed__row.is-selected { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-tint); }
.date-ed__pick { flex: 1; display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 8px; text-align: left; cursor: pointer; min-width: 0; color: inherit; font: inherit; }
.date-ed__chip { width: 22px; height: 22px; border-radius: var(--r4); border: 1px solid var(--line); flex: none; }
.date-ed__n { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); flex: none; }
.date-ed__label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.date-ed__kind { flex: none; }
.date-ed__tools { display: flex; gap: 2px; }
.date-ed__tool { min-width: 32px; height: 32px; border: 1px solid var(--line); border-radius: var(--r4); background: var(--paper); cursor: pointer; color: inherit; }
.date-ed__tool[disabled] { opacity: .35; cursor: default; }
.date-ed__tool--danger:hover { border-color: var(--red); color: var(--red); }
.date-ed__add { flex: 1; }

.date-ed__pane { display: grid; gap: 10px; }
.date-ed__label { display: grid; gap: 4px; font-size: 12px; color: var(--ink-soft); }
.date-ed__text { resize: vertical; }
.date-ed__swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.date-ed__swatch { width: 46px; height: 34px; border-radius: var(--r4); border: 2px solid var(--line); cursor: pointer; }
.date-ed__swatch.is-on { border-color: var(--ink); box-shadow: var(--shadow-1); }
.date-ed__acts { display: flex; gap: 6px; flex-wrap: wrap; }
.date-ed__act { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r8); background: var(--paper-raised); cursor: pointer; font: inherit; color: inherit; }
.date-ed__act.is-on { border-color: var(--pink); background: var(--pink-tint); color: var(--on-pink-tint); }
.date-ed__act-name { font-size: 13px; }

.date-ed__preview { border-radius: var(--r8); padding: 22px 18px; min-height: 130px; display: grid; gap: 8px; align-content: center; text-align: center; border: 1px solid var(--line); }
.date-ed__preview.is-dark { color: #FFFFFF; }
.date-ed__prev-heading { font-size: 20px; font-weight: 700; }
.date-ed__prev-text { font-size: 13px; line-height: 1.5; white-space: pre-wrap; }

.date-ed__go { margin-top: 22px; display: flex; justify-content: center; }
.date-ed__go .btn-lg { min-width: min(340px, 80vw); }
