/* Exquisite Corpse's table: the folded sheet you draw on, the unfolding, the
   votes and the favorites (docs/exquisite-corpse.md; the mockups David
   approved, 2026-11-12). Structure on the room kit (room.css), colors from
   the look's tokens (exquisite-corpse.css). */

.felt.ecgame { min-height: calc(100dvh - 2 * var(--frame)); }
.ecgame .tablemain { display: flex; flex-direction: column; flex: 1; min-height: 0; gap: 10px; }
.ecgame .bar .titlerow { flex: 1 1 auto; }
/* (on the narrowest phones the title has 50px beside talk, and "Exquisite" alone is wider: it
   gives way on one line, as a table's title does there, rather than running under the smiley;
   the details check, 2026-11-21) */
@media (max-width: 360px) { .ecgame .bar:has(> .talk:not([hidden])) .titlerow .title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } }
.ecgame .bar .tools { flex-wrap: nowrap; align-items: center; }
.ecgame .watchbar:empty { display: none; }
@media (max-width: 760px) {
  .ecgame .bar .tools { display: none; }
  .ecgame .bar .more { display: inline-flex; min-width: 44px; font-size: 22px; text-decoration: none; }
}

.ecseatslot:empty { display: none; }
.ecseatslot .seatbar { margin: 0; }
.ecstage { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s4); }
.ecmain { min-width: 0; display: flex; flex-direction: column; gap: var(--s3); padding-bottom: var(--s4); }
.ecside { display: none; }
@media (min-width: 900px) {
  .ecstage { grid-template-columns: minmax(0, 1fr) clamp(240px, 22vw, 320px); align-items: start; }
  .ecside { display: flex; flex-direction: column; gap: var(--s3); position: sticky; top: 0; }
  .ecphone { display: none; }
}
.ecside .panel { display: flex; flex-direction: column; gap: var(--s2); }

.ectext { display: flex; flex-direction: column; gap: var(--s2); }
.ectext .kicker { margin: 0; }
.echead { font: var(--display-weight) var(--t-heading)/var(--lh-heading) var(--display); margin: 0; overflow-wrap: anywhere; text-wrap: balance; }
.ecbig { font: var(--display-weight) clamp(24px, 4vw, 30px)/1.15 var(--display); margin: 0; text-wrap: balance; }
.eclead { margin: 0; font-size: var(--t-lead); color: var(--soft); max-width: 40em; }
.ecsub { font: var(--display-weight) 17px/1.3 var(--display); margin: 0; }

/* who's done, who's voted: chips, as Bowl's roster */
.ecroster { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ecside .ecroster { flex-direction: column; align-items: stretch; }
.ecroster li { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 3px 12px 3px 4px; border-radius: 999px; background: var(--chip); border: var(--chip-edge); font-size: 15px; }
.ecroster li.gone { opacity: .55; }
.ecroster .eccheck { min-width: 24px; height: 24px; border-radius: 999px; display: grid; place-items: center; font: 800 13px/1 var(--ui-font); background: color-mix(in srgb, var(--soft) 16%, transparent); color: var(--soft); }
.ecroster li.done .eccheck { background: var(--good); color: var(--paper); }
.seatmark { flex: none; display: block; }

.bhostrow { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s2); padding-top: var(--s3); margin-top: var(--s2); border-top: 1px solid color-mix(in srgb, var(--ink) 12%, transparent); }
.bhostrow small { font-size: var(--t-note); }

.ecdock { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.ecdock .btn { flex: 1 1 auto; }
.ecvotedock { max-width: 480px; }
.ecvotedock .btn.quiet { flex: 0 0 auto; }
.echurry { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--s3); border-radius: var(--panel-radius); background: color-mix(in srgb, var(--turn) 55%, var(--paper)); font-weight: 700; }
.echurry .ecclock { font: 800 28px/1 var(--ui-font); font-variant-numeric: tabular-nums; min-width: 2.6em; }

/* ── your part: the sheet, with the edges beside it peeking past the folds */
.ecdraw { display: flex; flex-direction: column; gap: var(--s3); }
.ecleft { display: contents; }
.ecleft .echurry { order: 0; }
.ecleft .ectext { order: 1; }
.ecdraw > .ecsheet { order: 2; }
.ecleft .draw-tray { order: 3; }
.ecleft .ecdock { order: 4; }
.ecleft .ecphone { order: 5; display: flex; flex-direction: column; gap: var(--s2); }
/* (the side card has them from 900px: without this, the rule above won and a laptop showed the roster and Hurry up twice) */
@media (min-width: 900px) { .ecleft .ecphone { display: none; } }
@media (min-width: 900px) {
  .ecdraw { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--s4); align-items: start; }
  .ecleft { display: flex; flex-direction: column; gap: var(--s3); }
  .ecleft .draw-tray { justify-content: flex-start; }
}
.ecsheet { position: relative; align-self: center; justify-self: center; width: min(100%, 640px); background: var(--paper); box-shadow: var(--paper-shadow); border-radius: 3px; }
@media (min-width: 900px) {
  /* (as tall as the window leaves it: the part and its two strips) */
  .ecsheet { width: min(100%, calc((100dvh - 220px) * 4 / 3), 680px); }
}
.ecpad { width: 100%; }
.ecpad .draw-frame { height: auto; }
.ecpad .draw-canvas { border: 0; border-radius: 0; width: 100% !important; height: auto !important; }
.ecpad .draw-hint { width: 100% !important; height: auto !important; opacity: .5; background: var(--paper-back); border: 0; border-radius: 0; }
.ecpad .draw-hint.above { border-bottom: 1.5px dashed var(--crease); }
.ecpad .draw-hint.below { border-top: 1.5px dashed var(--crease); }
.ecsheet:not(.top) .ecpad .draw-frame::before, .ecsheet:not(.bottom) .ecpad .draw-frame::after { content: ""; display: block; width: 100%; height: 10px; background: var(--paper-back); }
.ecsheet:not(.top) .ecpad .draw-frame:has(.draw-hint.above)::before, .ecsheet:not(.bottom) .ecpad .draw-frame:has(.draw-hint.below)::after { display: none; }
.ecsheet .ecpartname { position: absolute; right: 10px; top: 18px; z-index: 1; font: 700 12px/1 var(--ui-font); letter-spacing: .08em; text-transform: uppercase; color: var(--soft); pointer-events: none; }
.ecsheet .ecedgehint { position: absolute; left: 10px; z-index: 1; font: 700 12px/1 var(--ui-font); color: var(--soft); pointer-events: none; }
.ecsheet .ecedgehint.top { top: 18px; }
.ecsheet .ecedgehint.bottom { bottom: 18px; }
.ecsheet.sent .draw-canvas { opacity: .92; }

/* ── a corpse: every part, joined, who drew each on it */
.eccorpse { position: relative; display: flex; flex-direction: column; background: var(--paper); box-shadow: var(--paper-shadow); border-radius: 3px; width: var(--corpse-w, 280px); max-width: 100%; }
.eccorpse .ecpart { position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; padding: 0; border: 0; background: transparent; font: inherit; color: inherit; }
button.ecpart { cursor: pointer; }
.eccorpse .ecpart + .ecpart { border-top: 1.5px dashed var(--crease); }
.eccorpse .ecpart + .ecpart::before { content: ""; position: absolute; inset: 0 0 auto; height: 6px; background: linear-gradient(var(--crease-shade), transparent); z-index: 1; }
.eccorpse .ecink { position: absolute; inset: 0; }
.eccorpse .ecink .draw-frame { height: 100%; }
.eccorpse .ecink .draw-canvas { border: 0; border-radius: 0; width: 100% !important; height: 100% !important; }
.eccorpse .ecpart.folded { background: repeating-linear-gradient(135deg, var(--paper-back) 0 10px, color-mix(in srgb, var(--paper-back) 70%, var(--crease)) 10px 11px); }
.eccorpse .ecpart.folded .ecink { visibility: hidden; }
.eccorpse .ecpart::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.eccorpse .ecpart.drawing::after { box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--turn) 90%, transparent); }
.eccorpse .ecpart.fav::after { box-shadow: inset 0 0 0 5px var(--turn); }
.eccorpse .ecpart.picked::after { box-shadow: inset 0 0 0 4px var(--ink); }
.eccorpse .ecpart.mine::after { content: "Yours"; inset: 6px 6px auto auto; font: 700 11px/1 var(--ui-font); letter-spacing: .06em; text-transform: uppercase; color: var(--soft); background: var(--paper-back); padding: 3px 6px; border-radius: 3px; }
button.ecpart:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.eccorpse .ectag { position: absolute; left: 6px; bottom: 6px; z-index: 3; display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px 3px 4px; border-radius: 999px; background: color-mix(in srgb, var(--paper) 92%, transparent); border: 1px solid var(--rail); font: 700 12px/1.2 var(--ui-font); color: var(--ink); max-width: calc(100% - 12px); }
.eccorpse .ectag span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* the unfolding: the names beside the corpse on a laptop, on it on a phone */
.ecreveal { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: var(--s3); }
.ecrevleft { order: 2; width: 100%; }
.ecnames { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ecnames.beside { display: none; }
.ecname { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.ecname .ecwhat { font: 700 11px/1 var(--ui-font); letter-spacing: .08em; text-transform: uppercase; color: var(--soft); min-width: 44px; }
.ecname.waiting { opacity: .55; }
.ecnext { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); }
.ecnext small { font-size: var(--t-note); flex: 1 1 14em; }
@media (min-width: 900px) {
  .ecreveal { grid-template-columns: 1fr auto 1fr; align-items: stretch; justify-items: stretch; }
  .ecrevleft { order: 0; display: flex; flex-direction: column; justify-content: flex-end; padding-bottom: var(--s3); }
  .ecrevleft .ecnext { flex-direction: column; align-items: flex-start; }
  .ecreveal .eccorpse { justify-self: center; }
  .ecreveal .ectag { display: none; }
  .ecnames.beside { display: flex; justify-content: space-around; gap: 0; }
}

/* the gallery: every corpse side by side */
.ecgallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); justify-content: start; align-items: start; }
.ecgallery figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: var(--s2); min-width: 0; }
.ecgallery figcaption { font-size: var(--t-note); color: var(--soft); text-align: center; }
.ecpickbox { display: block; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 3px; }
.ecpickbox[aria-pressed="true"] .eccorpse { box-shadow: 0 0 0 4px var(--ink), var(--paper-shadow); }
.ecpickbox:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }

/* the favorites */
.ecfavs { display: flex; flex-wrap: wrap; gap: var(--s4); justify-content: flex-start; }
.ecfav { display: flex; flex-direction: column; align-items: center; gap: var(--s2); text-align: center; max-width: 100%; }
.ecribbon { display: inline-block; padding: 6px 14px; border-radius: 999px; background: var(--turn); color: var(--turn-ink); font: 800 13px/1 var(--ui-font); letter-spacing: .06em; text-transform: uppercase; }
.ecmedals { margin: 0; font-size: var(--t-note); max-width: 40em; }
.ecmedals:empty { display: none; }


/* Your corpses (games/templates/exquisite-corpse/gallery.html) */
.ec-kept { grid-template-columns: repeat(auto-fill, minmax(132px, 200px)); margin: var(--s3) 0; }
.ec-kept .eccorpse { width: 100%; }
.ec-kept figcaption { display: flex; align-items: center; justify-content: center; gap: var(--s2); flex-wrap: wrap; }
