/* Draw Together — the sheet, the toolbar, the guess row, the gallery.
   Everything else (buttons, pack cards, chips, HUD, result blocks) comes from base.css. */

/* ---- START preview ------------------------------------------------------------------------- */
.dw-preview { display: flex; flex-direction: column; gap: 12px; width: 80%; }
.dw-preview__sheet {
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--r8);
  box-shadow: var(--shadow-1); padding: 8px; aspect-ratio: 5 / 3; display: grid; place-items: center;
}
.dw-preview__ink svg { width: 100%; height: auto; display: block; }
/* Two name pills on the sheet. White on --pink measured 2.44:1 and on --blue 2.64 — the identity
   hues are tuned to read as identity on a big surface, not to carry 11px type. The pill keeps the
   full hue, because that IS which person this is; what changes is the label, from white to the
   sheet's own ink. That is 7.28:1 on pink and 6.72 on blue, and it lifts rather than falls in dark
   where both hues get lighter (8.5 / 8.3).
   The ink is the literal light-register value, not var(--ink), on purpose: this sheet is paper —
   .dw-sheet is #fff in both themes and so are the strokes drawn on it — so nothing printed on it
   flips with the theme. */
.dw-preview__badge { position: absolute; top: 8px; height: 20px; padding: 0 8px; border-radius: 999px; font: 700 11px/20px var(--mono); color: #17181C; }
.dw-preview__badge.pink { left: 8px; background: var(--pink); }
.dw-preview__badge.blue { left: 58px; background: var(--blue); }
.dw-preview__swatches { display: flex; gap: 8px; justify-content: center; }
.dw-preview__swatches i { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }

/* ---- PACK / ROUNDS ------------------------------------------------------------------------- */
.dw-pack .pack__grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.dw-set { padding-top: 48px; gap: 24px; }

/* ---- the round ----------------------------------------------------------------------------- */
.dw-play { gap: 14px; padding: 16px 0 24px; }
.dw-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; width: 100%; }
.dw-round { font: 700 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); text-align: left; }
.dw-prompt { text-align: center; }
.dw-timer {
  justify-self: end; display: inline-flex; align-items: center; height: 44px; padding: 0 16px;
  border-radius: var(--r8); border: 1px solid var(--line); background: var(--paper-raised);
  font-size: 22px; font-weight: 700; letter-spacing: .06em;
}
.dw-timer.is-low { color: var(--red); border-color: var(--red); }

/* The sheet keeps its 1280×880 shape, but its WIDTH is capped by the room left under the toolbar and
   the guess row — otherwise a wide desktop pushes the prompt and the clock off the top of the screen,
   which are the two things you need while you draw. */
.dw-frame {
  position: relative; background: #fff; border: 2px solid var(--ink);
  border-radius: var(--r8); box-shadow: var(--shadow-1); overflow: hidden;
  width: min(100%, max(320px, calc((100vh - 400px) * 1.4545)));
  margin-inline: auto;
}
.dw-play[data-step="idle"] .dw-frame { border-color: var(--line); }
.dw-frame--still { border-color: var(--line); max-width: 720px; margin: 0 auto; }
.dw-sheet { display: block; width: 100%; height: auto; touch-action: none; cursor: crosshair; background: #fff; }
.dw-play[data-step="idle"] .dw-sheet { cursor: default; }
.dw-names { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; pointer-events: none; z-index: 2; }
.dw-name { height: 22px; padding: 0 10px; border-radius: 999px; font: 700 11px/22px var(--mono); color: var(--on-ink); background: var(--ink-faint); }
.dw-name.pink { background: var(--pink); color: var(--on-pink); }
.dw-name.blue { background: var(--blue); color: var(--on-blue); }

/* ---- toolbar ------------------------------------------------------------------------------- */
.dw-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; width: 100%; }
.dw-swatches, .dw-sizes { display: flex; gap: 8px; align-items: center; }
.dw-swatch {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; padding: 0;
  box-shadow: inset 0 0 0 1px rgba(23, 24, 28, .10); cursor: pointer;
}
.dw-swatch[aria-pressed="true"] { border-color: var(--ink); transform: scale(1.08); }
.dw-size {
  width: 34px; height: 34px; border-radius: var(--r8); border: 1px solid var(--line);
  background: var(--paper-raised); display: grid; place-items: center; padding: 0; cursor: pointer;
}
.dw-size i { display: block; min-width: 4px; min-height: 4px; border-radius: 50%; background: var(--ink); }
.dw-size[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.dw-tool {
  width: 40px; height: 40px; border-radius: var(--r8); border: 1px solid var(--line);
  background: var(--paper-raised); font-size: 18px; cursor: pointer;
}
.dw-tool[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.dw-undo, .dw-clear { min-height: 40px; padding: 0 14px; }

/* ---- the guess row ------------------------------------------------------------------------- */
.dw-guess { display: flex; flex-direction: column; gap: 10px; align-items: center; width: 100%; }
.dw-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.dw-chip {
  min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--paper-raised); font-size: 15px; font-weight: 600; cursor: pointer;
}
.dw-chip:hover:not(:disabled) { border-color: var(--ink-faint); }
.dw-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.dw-chip:disabled { opacity: .5; cursor: not-allowed; }

.dw-foot { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.dw-secret { font-size: 13px; }

/* ---- REVEAL -------------------------------------------------------------------------------- */
.dw-reveal { gap: 18px; }
.dw-reveal__cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; width: 100%; }
.dw-card {
  text-align: left; padding: 16px; border-radius: var(--r8); border: 1px solid var(--line);
  background: var(--paper-raised); display: flex; flex-direction: column; gap: 8px;
}
.dw-card.pink { border-color: var(--pink); }
.dw-card.blue { border-color: var(--blue); }
.dw-card__prompt { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.dw-card__guess { font-size: 14px; }
.dw-card__verdict { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dw-card__pts { margin-left: auto; font-weight: 700; }

/* ---- RESULT -------------------------------------------------------------------------------- */
.dw-result { gap: 12px; }
.dw-result__emoji { font-size: 56px; line-height: 1; }
.dw-result__band { font-size: 22px; font-weight: 800; }
.dw-result__score { font-size: 15px; color: var(--ink-soft); }
.dw-reads { width: 100%; max-width: 460px; display: flex; flex-direction: column; gap: 8px; }
.dw-read { padding: 10px 14px; border-radius: var(--r8); border: 1px solid var(--line); background: var(--paper-raised); }
.dw-read.pink { border-color: var(--pink); }
.dw-read.blue { border-color: var(--blue); }
.dw-gallery { width: 100%; display: flex; flex-direction: column; gap: 22px; margin-top: 8px; }
.dw-gallery__row { display: flex; flex-direction: column; gap: 8px; }
.dw-gallery__head { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; text-align: left; }
.dw-gallery__prompt { font-size: 15px; font-weight: 700; }
.dw-gallery__prompt.pink { color: #C2255C; }
.dw-gallery__prompt.blue { color: #1E5FBF; }
.dw-gallery__img {
  display: block; width: 100%; height: auto; aspect-ratio: 1280 / 880; object-fit: cover;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r8);
}
.dw-gallery__img--lost { display: grid; place-items: center; color: var(--ink-faint); font-size: 14px; }

/* ---- phones -------------------------------------------------------------------------------- */
@media (max-width: 720px) {
  .dw-play { gap: 10px; }
  .dw-top { grid-template-columns: 1fr auto; row-gap: 4px; }
  .dw-prompt { grid-column: 1 / -1; order: 3; font-size: 20px; }
  .dw-timer { height: 36px; font-size: 18px; padding: 0 12px; }
  .dw-frame { width: 100%; }
  /* one row of colours, one row of everything else — "clear" must not wrap onto a line of its own */
  .dw-tools { gap: 6px; }
  .dw-swatches { width: 100%; justify-content: space-between; }
  .dw-swatch { width: 32px; height: 32px; }
  .dw-sizes { gap: 6px; }
  .dw-size { width: 32px; height: 32px; }
  .dw-tool { width: 36px; height: 36px; font-size: 16px; }
  .dw-undo, .dw-clear { min-height: 36px; padding: 0 10px; font-size: 14px; }
  .dw-chips { flex-direction: column; align-items: stretch; }
  .dw-chip { min-height: 42px; font-size: 14px; }
  .dw-reveal__cards { grid-template-columns: 1fr; }
  .dw-preview { width: 92%; }
}

/* ---------- room for the activity bar (docs/R2-INTERFACE.md S5) ----------
   These top paddings exist to hold a scene off the top of the WINDOW. With the 44px bar there,
   the bar already does that, and the two together push the first line of a scene ~9%% of an
   iPhone's screen down before anything is said. Trimmed by 20px, so the gap a person sees is the
   gap that was designed. Nothing moves on a page with no bar. */
body.has-activitybar .dw-set { padding-top: 28px; }
