:root {
  color-scheme: dark;
  --bg: #0a0f1c;
  --panel: #121b2c;
  --panel-2: #19253a;
  --line: #2b3a55;
  --text: #f7f9ff;
  --muted: #aab7cc;
  --cyan: #63e6d2;
  --blue: #76a9ff;
  --amber: #ffca66;
  --red: #ff7185;
  --green: #75dfa4;
  --purple: #bf91ff;
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgba(45, 212, 191, .11), transparent 35rem),
    radial-gradient(circle at 95% 10%, rgba(99, 102, 241, .13), transparent 32rem),
    var(--bg);
}

button, input, select, textarea { font: inherit; }
button, select, input[type="checkbox"] { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
a { color: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 58px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(10, 15, 28, .92);
  backdrop-filter: blur(16px);
}
.back-link { color: var(--muted); text-decoration: none; font-size: .9rem; }
.back-link:hover { color: var(--text); }
.brand { font-weight: 900; letter-spacing: .12em; font-size: .82rem; }
.sync-pill { justify-self: end; color: var(--muted); font-size: .82rem; }
.sync-pill::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: var(--green); }
.sync-pill.reconnecting::before { background: var(--amber); animation: pulse 1s infinite; }

#app { width: min(1180px, 100%); margin: 0 auto; padding: 28px 20px 70px; }
.hero { max-width: 760px; margin: 20px auto 26px; text-align: center; }
.eyebrow { color: var(--cyan); font-size: .82rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.hero h1 { margin: 8px 0 12px; font-size: clamp(2.2rem, 8vw, 4.4rem); line-height: .98; letter-spacing: -.05em; }
.hero p { margin: 0 auto; max-width: 680px; color: var(--muted); font-size: 1.05rem; line-height: 1.75; }
.system-note { margin-top: 12px !important; color: #d5dced !important; font-size: .92rem !important; }

.entry-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; max-width: 940px; margin: 0 auto; }
.card, .panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(25,37,58,.94), rgba(14,22,37,.96));
  box-shadow: 0 18px 55px rgba(0,0,0,.18);
}
.card { padding: 24px; }
.card h2, .panel h2, .panel h3 { margin: 0; }
.card h2 { font-size: 1.3rem; margin-bottom: 18px; }
.secure-note { max-width: 940px; margin: 18px auto 0; color: var(--muted); text-align: center; font-size: .9rem; }

.field { display: grid; gap: 8px; margin-bottom: 16px; }
.field > span, .field > label { font-weight: 750; color: #dce5f5; }
.field small { color: var(--muted); line-height: 1.45; }
input[type="text"], input[type="number"], select, textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid #40506d;
  border-radius: 12px;
  padding: 10px 12px;
  background: #0c1423;
  color: var(--text);
  font-size: 1rem;
}
textarea { min-height: 86px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus, button:focus-visible, summary:focus-visible { outline: 3px solid rgba(99,230,210,.35); outline-offset: 2px; }
.inline-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.check-line { display: flex; align-items: flex-start; gap: 10px; line-height: 1.45; margin: 2px 0 18px; }
.check-line input { width: 20px; height: 20px; flex: 0 0 auto; }

.btn {
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px 16px;
  color: #07131d;
  background: var(--cyan);
  font-weight: 850;
  line-height: 1.2;
}
.btn:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.btn.secondary { color: var(--text); background: #23314a; border-color: #3a4a67; }
.btn.warning { color: #261700; background: var(--amber); }
.btn.danger { color: #fff; background: #9d2c40; }
.btn.ghost { color: var(--muted); background: transparent; border-color: var(--line); }
.btn.small { min-height: 36px; padding: 7px 11px; font-size: .86rem; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.button-row .btn { flex: 0 1 auto; }

.game-shell { display: grid; gap: 16px; }
.room-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(18,27,44,.88);
}
.room-code { font-weight: 900; letter-spacing: .14em; color: var(--cyan); }
.phase-chip { display: inline-flex; align-items: center; min-height: 30px; padding: 5px 10px; border-radius: 999px; background: rgba(118,169,255,.13); color: #bcd3ff; font-size: .82rem; font-weight: 800; }
.game-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr); gap: 16px; align-items: start; }
.main-stack, .side-stack { display: grid; gap: 16px; }
.panel { padding: 20px; }
.panel-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.panel-header p { margin: 5px 0 0; color: var(--muted); line-height: 1.55; }
.muted { color: var(--muted); }
.notice { padding: 13px 14px; border-radius: 12px; color: #dbe6f9; background: rgba(118,169,255,.1); border: 1px solid rgba(118,169,255,.25); line-height: 1.55; }
.notice.warning { color: #ffe8b5; background: rgba(255,202,102,.09); border-color: rgba(255,202,102,.28); }
.notice.danger { color: #ffd3da; background: rgba(255,113,133,.1); border-color: rgba(255,113,133,.3); }

.player-list { display: grid; gap: 9px; }
.player-row { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 12px; background: rgba(10,15,28,.45); }
.player-row .name { min-width: 0; flex: 1; font-weight: 800; overflow-wrap: anywhere; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #60708b; flex: 0 0 auto; }
.status-dot.on { background: var(--green); }
.mini-chip { display: inline-flex; padding: 4px 8px; border-radius: 999px; color: var(--muted); background: rgba(255,255,255,.06); font-size: .76rem; font-weight: 750; }
.mini-chip.ready { color: #bdf8d2; background: rgba(117,223,164,.11); }
.mini-chip.host { color: #ffdf99; background: rgba(255,202,102,.11); }

.question-card { padding: 24px; border: 1px solid rgba(99,230,210,.3); border-radius: var(--radius); background: linear-gradient(145deg, rgba(31,63,72,.52), rgba(18,27,44,.95)); }
.scenario { color: var(--cyan); font-weight: 800; margin-bottom: 10px; }
.question { margin: 0; font-size: clamp(1.45rem, 4vw, 2.35rem); line-height: 1.35; letter-spacing: -.02em; }
.follow-up { margin-top: 16px; padding: 12px 14px; border-left: 4px solid var(--amber); background: rgba(255,202,102,.08); color: #ffe8b5; line-height: 1.5; }
.speaker-hero { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; margin-top: 16px; padding: 16px; border-radius: 15px; background: #0c1423; border: 1px solid #354763; }
.speaker-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; color: #07131d; background: var(--cyan); font-size: 1.5rem; }
.speaker-name { font-size: 1.35rem; font-weight: 900; }
.speaker-label { color: var(--muted); font-size: .82rem; margin-bottom: 2px; }
.timer { min-width: 76px; text-align: right; font-variant-numeric: tabular-nums; font-size: 1.5rem; font-weight: 900; color: var(--amber); }
.timer.urgent { color: var(--red); }

.order-list { display: flex; flex-wrap: wrap; gap: 8px; }
.order-chip { display: inline-flex; gap: 7px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: rgba(255,255,255,.03); font-size: .86rem; }
.order-chip.current { color: #07131d; border-color: var(--cyan); background: var(--cyan); font-weight: 850; }
.order-chip.done { color: #b6c0d1; opacity: .7; text-decoration: line-through; }
.round-track { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 16px; }
.round-step { height: 6px; border-radius: 999px; background: #26344d; }
.round-step.done { background: var(--green); }
.round-step.current { background: var(--cyan); box-shadow: 0 0 16px rgba(99,230,210,.35); }

.role-card { border-color: rgba(191,145,255,.4); }
.role-title { font-size: 2rem; margin: 6px 0; font-weight: 950; }
.role-title.wolf { color: #ff8996; }
.role-title.jester { color: #ffdc73; }
.role-title.villager { color: #78e5a6; }
.team-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.team-chip { padding: 7px 10px; border-radius: 999px; color: #ffd6dd; background: rgba(255,113,133,.1); border: 1px solid rgba(255,113,133,.3); }

.wolf-tasks { margin-top: 22px; }
.meeting-footer { margin-top: 20px; }
.wolf-task-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 14px; align-items: start; }
.wolf-task-grid .task-card + .task-card { margin-top: 0; }
.wolf-task-grid h3 { color: #ffd2da; margin: 0 0 14px; }
.task-tools { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.task-tools summary { cursor: pointer; color: var(--cyan); font-weight: 700; min-height: 32px; }
.task-context, .saved-note { line-height: 1.5; font-size: .9rem; }
.topic-context { line-height: 1.6; color: #c7d5e7; }
.task-card { padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(10,15,28,.54); }
.task-card + .task-card { margin-top: 12px; }
.task-title-row { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.task-title { font-weight: 900; color: #ffd2da; }
.task-condition { margin: 8px 0 12px; color: #dce5f5; line-height: 1.55; }
.task-form { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.target-grid { display: grid; gap: 7px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 8px 0 12px; }
.target-check { display: flex; gap: 8px; align-items: center; padding: 9px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.03); }
.target-check input { width: 18px; height: 18px; }
.claim-box { padding: 11px; border-radius: 11px; background: rgba(117,223,164,.08); border: 1px solid rgba(117,223,164,.25); color: #d5f8e2; line-height: 1.5; }

.meeting-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.meeting-slot { padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.025); }
.meeting-slot strong { display: block; margin-bottom: 4px; }
.meeting-slot span { color: var(--muted); font-size: .86rem; }

.vote-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 16px 0; }
.vote-choice { position: relative; }
.vote-choice input { position: absolute; opacity: 0; pointer-events: none; }
.vote-choice label { display: flex; align-items: center; min-height: 54px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); font-weight: 800; cursor: pointer; }
.vote-choice input:checked + label { color: #07131d; border-color: var(--cyan); background: var(--cyan); }
.vote-choice input:focus-visible + label { outline: 3px solid rgba(99,230,210,.4); outline-offset: 2px; }
.submission-grid { display: flex; flex-wrap: wrap; gap: 8px; }

.role-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.reveal-player { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); }
.reveal-player.wolf { border-color: rgba(255,113,133,.4); background: rgba(255,113,133,.07); }
.reveal-player strong { display: block; margin-bottom: 3px; }
.history-list { display: grid; gap: 10px; }
.history-item { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); }
.result-hero { padding: 28px 20px; text-align: center; border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(145deg, rgba(31,63,72,.55), rgba(18,27,44,.96)); }
.result-hero h1 { margin: 4px 0 8px; font-size: clamp(2rem, 7vw, 3.8rem); }
.result-hero p { margin: 0; color: var(--muted); }

.host-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(92vw, 520px); padding: 13px 16px; border: 1px solid rgba(255,113,133,.45); border-radius: 12px; color: #fff; background: #6f2333; box-shadow: 0 16px 45px rgba(0,0,0,.38); text-align: center; }
.empty { color: var(--muted); text-align: center; padding: 28px; }

@keyframes pulse { 50% { opacity: .35; } }

@media (max-width: 820px) {
  #app { padding: 18px 14px 56px; }
  .site-header { grid-template-columns: 1fr auto; }
  .brand { display: none; }
  .entry-grid, .game-grid { grid-template-columns: 1fr; }
  .side-stack { order: initial; }
  .speaker-hero { grid-template-columns: auto 1fr; }
  .timer { grid-column: 1 / -1; text-align: left; padding-left: 64px; }
}

@media (max-width: 520px) {
  .hero { margin-top: 8px; }
  .hero h1 { font-size: 2.65rem; }
  .card, .panel { padding: 16px; }
  .inline-fields, .meeting-grid, .vote-grid, .role-grid, .target-grid { grid-template-columns: 1fr; }
  .button-row { display: grid; grid-template-columns: 1fr; }
  .button-row .btn { width: 100%; }
  .room-bar { align-items: stretch; }
  .room-bar .button-row { width: 100%; }
  .question-card { padding: 18px; }
  .question { font-size: 1.45rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

/* The existing play.html card embeds the same UI and permission-checked actions. */
.embedded-card-root { min-width: 0; }
.embedded-card .site-header { position: static; padding: 8px; }
.embedded-card .back-link, .embedded-card .brand { display: none; }
.embedded-card #app { width: 100%; padding: 8px; margin: 0; }
.embedded-card .game-grid, .embedded-card .entry-grid { display: block; }
.embedded-card .panel, .embedded-card .card { margin-bottom: 12px; }
.embedded-card .room-bar { flex-wrap: wrap; }
.embedded-card #host-connection { margin: 8px; }
/* The open response interval is a separate phase, not another formal turn. */
.question-card.free-talk { border: 2px solid #56cfba; background: #133432; }
.free-talk .speaker-name { color: #8bf1d8; }

/* Free-chat edition is additive: saved turn-based rooms keep their layout. */
.v3-shell { display: grid; gap: 16px; }
.v3-play-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(290px, .8fr); gap: 16px; align-items: start; }
.v3-play-grid:not(:has(> aside)) { grid-template-columns: 1fr; }
.v3-topic .panel-header { align-items: center; }
.v3-topic .timer { padding: 0; grid-column: auto; font-size: clamp(1.5rem, 4vw, 2.2rem); }
.v3-topic p { line-height: 1.6; }
.v3-entry-prompts { padding-left: 22px; line-height: 1.65; color: #dce5f5; }
.v3-controls { margin-top: 16px; }
.v3-host-card p { margin: 7px 0 12px; }
.v3-host-card small { display: block; margin-top: 10px; }
.v3-settings h2 { margin-bottom: 20px; }
.v3-settings > .notice { margin: 18px 0; }
.v3-settings details { margin: 18px 0; }
.v3-settings summary, .v3-rules summary, .v3-restart summary, .v3-topic-library summary { cursor: pointer; padding: 6px 0; }
.v3-settings details[open] > summary { margin-bottom: 16px; }
.v3-professions { min-width: 0; margin: 16px 0; padding: 14px; border: 1px solid var(--line); border-radius: 14px; }
.v3-professions legend { font-weight: 850; padding: 0 6px; }
.v3-profession { display: flex; gap: 12px; align-items: start; padding: 13px 0; border-top: 1px solid var(--line); cursor: pointer; }
.v3-profession input { flex: 0 0 auto; width: 20px; height: 20px; margin-top: 3px; }
.v3-profession > span { display: grid; gap: 5px; line-height: 1.5; }
.v3-profession small { color: var(--muted); }
.v3-topic-library > .field { margin-top: 18px; }
.v3-topic-list { max-height: 650px; overflow-y: auto; padding-right: 5px; display: grid; gap: 14px; }
.v3-topic-option { padding: 18px; border: 1px solid var(--line); border-radius: 12px; }
.v3-topic-option[hidden] { display: none; }
.v3-topic-option h3 { margin: 8px 0; line-height: 1.5; }
.v3-topic-option li, .v3-rules li { line-height: 1.6; margin-bottom: 8px; }
.v3-topic-option .btn { margin-top: 12px; }
.v3-followup-list { display: grid; gap: 10px; margin-top: 12px; }
.v3-followup-list article { display: flex; gap: 14px; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding: 10px 0; }
.v3-followup-list p { flex: 1; line-height: 1.5; margin: 0; }
.v3-followup-list .btn { flex: 0 0 auto; }
.v3-private > h3 { margin-top: 20px; }
.v3-task-list { display: grid; gap: 12px; }
.v3-task { margin: 12px 0; }
.v3-task .task-condition { margin: 0 0 18px; font-size: 1.15rem; }
.v3-reward { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); line-height: 1.55; }
.v3-restart { box-shadow: none; background: transparent; }
.v3-restart .button-row { margin-top: 14px; }
.v4-private-layout { display: grid; gap: 14px; min-width: 0; }
.v4-role-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 20px; }
.v4-role-header h2 { margin: 4px 0 0; font-size: 1.55rem; }
.v4-role-header p { margin: 5px 0 0; color: var(--muted); }
.v5-role-wolf { border-left: 4px solid #ff8996; }
.v5-role-jester { border-left: 4px solid #ffdc73; }
.v5-role-villager { border-left: 4px solid #78e5a6; }
.v5-task-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 18px; font-size: .88rem; margin: 8px 0 12px; }
.v5-task-rules summary { cursor: pointer; color: var(--muted); }
.v5-task-rules[open] { flex-basis: 100%; }
.v5-task-rules ul { margin: 10px 0 0; padding-left: 20px; line-height: 1.6; color: var(--muted); }
.v5-room-info { margin: 18px 0; color: var(--muted); font-size: .85rem; }
.v5-room-info summary { cursor: pointer; }
.v5-room-info dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 12px 0; }
.v5-room-info dd { margin: 0; overflow-wrap: anywhere; }
.v6-wolf-roles .field { margin-top: 16px; }
.v6-wolf-roles small { color: var(--muted); }
.v6-ability form { display: grid; gap: 14px; margin-top: 16px; min-width: 0; }
.v6-ability select, .v6-ability textarea { width: 100%; min-width: 0; }
.v6-ability textarea { resize: vertical; }
.v6-ability .v4-task-toolbar { flex-wrap: wrap; }
.v6-ability details { font-size: .85rem; color: var(--muted); }
.v6-ability details[open] { flex-basis: 100%; }
.v6-ability summary, .v6-secret-direction summary { cursor: pointer; }
.v6-secret-direction { border-left: 3px solid var(--amber); }
.v6-secret-direction .task-condition { font-size: 1.15rem; line-height: 1.5; }
.v6-secret-direction details { color: var(--muted); font-size: .85rem; margin-top: 16px; }
.v6-temporary-topic { border-color: var(--amber); }
.v6-temporary-clock { font-size: 1.3rem; color: var(--amber); font-variant-numeric: tabular-nums; white-space: nowrap; }
.v4-topic-label { display: block; color: var(--muted); font-size: .88rem; margin-top: 4px; }
.v4-topic-full .question { overflow-wrap: anywhere; line-height: 1.45; font-size: clamp(1.25rem, 3.5vw, 2.05rem); }
.v4-topic-full .eyebrow { margin-bottom: 9px; }
.v4-active-followup { color: #ffdda0; border-left: 3px solid var(--amber); padding-left: 14px; }
.v4-original-topic { margin-top: 16px; color: var(--muted); line-height: 1.6; }
.v4-original-topic summary, .v4-chat-clock summary, .v4-meeting summary { cursor: pointer; }
.v4-original-topic p { color: var(--text); }
.v4-task-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.v4-task-toolbar h3 { font-size: 1.05rem; }
.v4-task-rule { line-height: 1.5; margin: 10px 0; font-size: .9rem; }
.v4-private-tasks .v3-task-list { gap: 10px; }
.v4-private-tasks .v3-task { margin: 8px 0; }
.v4-private-tasks .task-condition { font-size: 1.15rem; line-height: 1.55; }
.v4-reward-panel .v3-reward { margin-top: 0; padding-top: 0; border: 0; }
.v4-chat-clock { margin-top: 18px; font-size: .9rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }
.v4-chat-clock > div { display: flex; gap: 10px 18px; flex-wrap: wrap; align-items: baseline; margin-top: 12px; }
.v4-chat-clock strong { color: var(--text); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.v4-chat-clock p { margin-bottom: 0; }
.v4-talk-controls .v3-controls { margin-top: 0; }
.v4-gentle-reminder { border-color: var(--line); color: var(--muted); background: var(--panel); }
.v4-speaker-focus { display: flex; justify-content: space-between; align-items: center; gap: 16px; background: #0c1423; border: 1px solid var(--line); padding: 18px; border-radius: 14px; margin-top: 14px; }
.v4-speaker-focus.mine { border: 2px solid var(--cyan); }
.v4-speaker-focus > div:first-child { display: grid; gap: 6px; }
.v4-speaker-focus strong { font-size: 1.6rem; overflow-wrap: anywhere; }
.v4-speaker-focus span, .v4-speaker-focus small { color: var(--muted); }
.v4-speaker-focus .timer { padding: 0; white-space: nowrap; }
.v4-meeting-order { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.v4-meeting-order .mini-chip.active { background: var(--cyan); color: #07131d; }
.v4-meeting details { margin: 16px 0; }
.v4-meeting form { margin-top: 15px; }
.v4-end-meeting { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 16px; }
.v4-end-meeting + small { display: block; margin-top: 12px; }
.v4-task-example { margin-bottom: 16px; font-size: .9rem; color: var(--muted); }
.v4-exhausted h3 { margin: 0; }
.v4-exhausted .button-row { margin-top: 16px; }
.v3-rules { line-height: 1.6; }
.v3-shell .role-grid, .v3-shell .history-list { margin-top: 18px; }
.v3-shell .result-hero { margin-bottom: 0; }
@media (max-width: 820px) {
  .v3-play-grid { grid-template-columns: 1fr; }
  .v3-topic .panel-header { flex-wrap: wrap; }
  .v4-role-header { flex-wrap: wrap; padding: 16px; }
  .v4-task-toolbar { flex-wrap: wrap; }
}
.embedded-card .v3-play-grid { grid-template-columns: 1fr; }
@media (max-width: 520px) {
  .v3-followup-list article { display: block; }
  .v3-followup-list .btn { margin-top: 10px; width: 100%; }
}
/* A directed player's mandatory read notice lives inside their private card. */
body.v6-direction-notice-open { overflow: hidden; }
.v6-direction-backdrop { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom)); background: rgba(4, 9, 18, .88); backdrop-filter: blur(5px); }
.v6-direction-dialog { width: min(100%, 500px); max-height: calc(100dvh - 40px); overflow-y: auto; padding: clamp(22px, 6vw, 34px); border: 2px solid #ffd36a; border-radius: 22px; background: #172132; box-shadow: 0 20px 80px #0009; }
.v6-direction-dialog h2 { margin: 8px 0 18px; color: #ffdc73; font-size: clamp(1.5rem, 6vw, 2rem); }
.v6-direction-text { font-size: clamp(1.25rem, 5vw, 1.65rem); font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; }
.v6-direction-dialog .button-row { margin-top: 24px; justify-content: space-between; }
.v6-direction-dialog [data-direction-notice-close] { min-width: 140px; font-variant-numeric: tabular-nums; }
.v6-direction-reading-note { font-size: .8rem; margin: 14px 0 0; }
.v6-direction-reopen { position: fixed; right: 14px; bottom: max(14px, env(safe-area-inset-bottom)); z-index: 30; background: #ffd36a; color: #142033; box-shadow: 0 4px 22px #0007; }
.v6-secret-direction > summary { font-weight: 700; color: #ffdc73; }
.v6-secret-direction > summary + .v4-task-toolbar { margin-top: 18px; }
.v7-task-cooperation { margin: 0; font-size: .74rem; line-height: 1.4; text-align: right; overflow-wrap: anywhere; }
.v7-task-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-items: start; }
.v7-task-actions .btn { width: 100%; min-width: 0; min-height: 44px; padding: 8px 10px; font-size: .86rem; line-height: 1.3; white-space: normal; }
.v7-task-actions > .btn { align-self: start; min-height: 48px; font-size: .95rem; }
.v7-task-support { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.v7-task-support .btn { font-size: .8rem; font-weight: 500; color: var(--muted); background: transparent; border-color: #2b3a55; }
.v7-task-support [aria-pressed="true"] { border-color: #62728c; color: var(--muted); }

/* Illustrated private cards: the image is a compact role cue, never a second
   screen of rules. Public host panels do not receive any of these camp styles. */
.v8-private-card { --camp-color: #78e5a6; --camp-glow: rgba(120,229,166,.12); gap: 10px; }
.v8-camp-wolf { --camp-color: #ff8996; --camp-glow: rgba(255,137,150,.12); }
.v8-camp-jester { --camp-color: #ffdc73; --camp-glow: rgba(255,220,115,.12); }
.v8-private-card > .v4-role-header { padding: 12px 16px; gap: 12px; min-width: 0; background: radial-gradient(ellipse at 0 0, var(--camp-glow), transparent 70%), linear-gradient(140deg, #18263c, #101a2b); border-color: var(--line); border-left-color: var(--camp-color); }
.v8-role-identity { display: flex; align-items: center; gap: 16px; min-width: 0; flex: 1; }
.v8-role-portrait { flex: 0 0 auto; width: 88px; height: 110px; padding: 3px; overflow: hidden; border: 1px solid var(--camp-color); border-radius: 13px; background: #091120; box-shadow: 0 4px 18px #0004; }
.v8-role-portrait img { display: block; width: 100%; height: 100%; border-radius: 9px; object-fit: cover; object-position: center 35%; }
.v8-role-copy { min-width: 0; }
.v8-role-copy .eyebrow { color: var(--muted); font-size: .72rem; letter-spacing: .08em; }
.v8-role-copy .role-title { margin: 6px 0 0; font-size: clamp(1.35rem, 4.5vw, 1.8rem); line-height: 1.2; overflow-wrap: anywhere; }
.v8-private-card .question-card { padding: 18px; border-color: #3b566b; background: linear-gradient(135deg, #172d3c, #131e32); }
.v8-private-card .question-card .panel-header { margin-bottom: 10px; }
.v8-private-card .question-card .scenario { font-size: .8rem; margin-bottom: 0; }
.v8-private-card .question { font-size: clamp(1.2rem, 3.5vw, 1.8rem); line-height: 1.45; }
.v8-private-card .v4-private-tasks { padding: 16px; border-top: 2px solid var(--camp-color); }
.v8-private-card .v4-task-toolbar h3 { color: #dce5f5; }
.v8-private-card .team-list { margin: 8px 0 10px; gap: 6px; }
.v8-private-card .team-chip { padding: 4px 9px; font-size: .8rem; }
.v8-private-card .v3-task-list { counter-reset: task; gap: 10px; }
.v8-private-card .v3-task { position: relative; margin: 0; border: 1px solid #3b4358; border-radius: 12px; background: linear-gradient(150deg, #202a3d, #131d2e); box-shadow: 0 4px 12px #0002; }
.v8-private-card .v3-task::before { counter-increment: task; content: counter(task, decimal-leading-zero); display: block; color: var(--camp-color); font-size: .68rem; font-weight: 800; letter-spacing: .12em; margin-bottom: 7px; }
.v8-private-card .v3-task .task-condition { margin: 0 0 12px; font-size: 1.05rem; line-height: 1.5; }
.v8-private-card .v4-task-example { margin: 0 0 12px; }
.v8-private-card .v4-task-example summary { color: var(--muted); font-size: .78rem; cursor: pointer; }
.v8-private-card .v4-task-example p { color: var(--muted); line-height: 1.5; }
.v8-private-card .v7-task-actions { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.v8-private-card .v7-task-actions > .btn { background: #64e0ca; color: #0a1d26; }
.v8-private-card .v6-ability, .v8-private-card .v4-reward-panel { padding: 16px; }
.v8-private-card .v6-ability { border-top: 2px solid var(--camp-color); }
.v8-private-card .v4-role-header > .btn { flex: 0 0 auto; }
@media (max-width: 520px) {
  .v8-private-card > .v4-role-header { padding: 10px 12px; flex-wrap: nowrap; }
  .v8-role-identity { gap: 12px; }
  .v8-role-portrait { width: 72px; height: 90px; }
  .v8-private-card .question-card, .v8-private-card .v4-private-tasks { padding: 14px; }
  .v8-private-card .v4-role-header > .btn { min-width: 0; padding: 10px; font-size: .82rem; }
  .v8-private-card .v4-role-header > .mini-chip { font-size: .72rem; }
  .v8-private-card .v4-task-toolbar { flex-wrap: nowrap; gap: 8px; }
  .v8-private-card .v4-task-toolbar h3 { font-size: .95rem; }
  .v8-private-card .v4-task-toolbar > .btn { min-width: 0; padding: 8px; font-size: .75rem; }
}
