/* ════════════════════════════════════════════════════════════════════
   screens.css — layouts for the four screens + responsive behavior.
   ════════════════════════════════════════════════════════════════════ */

/* ── top bar (shared) ── */
.topbar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1.4rem;
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg0) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-spacer { flex: 1; }
.brand { display: flex; align-items: center; gap: 0.45rem; font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; }
.brand-flame {
  width: 1.35em;
  height: 1.35em;
  color: var(--accent);
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 60%, transparent));
}

/* ════════ HOME ════════ */
.home-main { max-width: 1060px; margin: 0 auto; padding: 1.6rem 1.4rem 3rem; }

.hero { text-align: center; padding: 3.2rem 1rem 2.6rem; }
.hero-title { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 750; }
.hero-title em { font-family: var(--serif); color: var(--accent); }
.hero-sub { max-width: 36rem; margin: 0.9rem auto 1.6rem; font-size: 1.05rem; }

.welcome-card { margin-bottom: 2rem; }
.welcome-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.welcome-head h2 { font-size: 1.2rem; }

.how-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.1rem; }
.how-step { display: flex; gap: 0.8rem; align-items: flex-start; }
.how-step p { font-size: 0.9rem; margin-top: 0.2rem; }
.how-num {
  width: 2rem; height: 2rem; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 16%, var(--card));
  color: var(--accent);
  font-weight: 750;
}
.how-prompts { margin-top: 1.3rem; padding-top: 1.1rem; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-start; }

.prompt-chip {
  text-align: left;
  font-size: 0.9rem;
  color: var(--dim);
  background: var(--bg1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 0.55rem 0.9rem;
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
  font-family: var(--serif);
  font-style: italic;
}
.prompt-chip:hover { border-color: var(--accent); color: var(--text); transform: translateY(-1px); }

.section-title { font-size: 1.25rem; margin-bottom: 1rem; }
.saves-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.1rem; }

.save-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 1.15rem 1.15rem 1rem;
  overflow: hidden;
  transition: transform 0.16s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.16s ease, border-color 0.16s ease;
}
.save-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-strong); }
/* procedural cover art band across the top of the card */
.save-cover {
  margin: -1.15rem -1.15rem 0.4rem;
  height: 92px;
  overflow: hidden;
}
.save-cover svg { width: 100%; height: 100%; display: block; }
.save-card:hover .save-cover svg { transform: scale(1.04); }
.save-cover svg { transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
.save-title { font-family: var(--serif); font-size: 1.18rem; margin-top: 0.3rem; }
.save-tagline { font-size: 0.88rem; color: var(--dim); font-style: italic; }
.save-meta { font-size: 0.84rem; }
.save-actions { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 0.8rem; }
.save-card.ended .save-title::after { content: " ✓"; color: var(--good); }

.new-card {
  align-items: center;
  justify-content: center;
  text-align: center;
  border-style: dashed;
  border-color: var(--line-strong);
  background: transparent;
  min-height: 180px;
  font-weight: 600;
  gap: 0.2rem;
}
.new-card:hover { border-color: var(--accent); }
.new-card-plus { font-size: 2.2rem; color: var(--accent); line-height: 1; }

.home-foot { text-align: center; margin-top: 3rem; }

/* ════════ ACCESS GATE ════════ */
.gate { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.gate-card { width: 100%; max-width: 22rem; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 0.85rem; }
.gate-flame { width: 3rem; height: 3rem; }
.gate-title { font-family: var(--serif); font-size: 2rem; }
.gate-card .text-input { text-align: center; }
.gate-card .btn-big { width: 100%; }
.gate-err { color: var(--danger); min-height: 1.2em; }

/* ════════ SETUP ════════ */
.setup-body { max-width: 860px; margin: 0 auto; padding: 1.8rem 1.4rem 7rem; }
.step-title { font-size: 1.5rem; margin-bottom: 0.5rem; }
.step-title + .dim { margin-bottom: 1.4rem; }

.step-dots { display: flex; gap: 0.35rem; }
.step-dot {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--faint);
  padding: 0.3em 0.8em;
  border-radius: 999px;
  cursor: default;
}
.step-dot.done { color: var(--dim); cursor: pointer; }
.step-dot.done:hover { background: var(--card); }
.step-dot.active { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }

.preset-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.1rem; margin-top: 1.6rem; }
.preset-card {
  position: relative;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 1.4rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  transition: transform 0.16s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.16s ease, box-shadow 0.16s ease;
}
.preset-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow); }
.preset-card h3 { font-size: 1.3rem; }
.preset-card .dim { font-size: 0.9rem; }
.preset-badge {
  position: absolute;
  top: -0.7rem;
  right: 1rem;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2em 0.75em;
  border-radius: 999px;
}

.prompt-input { font-family: var(--serif); font-size: 1.05rem; line-height: 1.6; }
.examples { display: flex; flex-direction: column; align-items: flex-start; gap: 0.45rem; margin-top: 1.2rem; }

.backdrop-row { display: flex; align-items: center; gap: 0.45rem; margin-top: 0.55rem; }
.chip-backdrop { border-color: color-mix(in srgb, #c97f43 60%, transparent); color: #c97f43; }
html:not(.light) .chip-backdrop { color: #e8a558; }

.gallery-head { margin: 1.4rem 0 0.7rem; }
.world-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.8rem; }
.world-card {
  position: relative;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 0.9rem 1rem;
  transition: transform 0.14s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.14s ease, box-shadow 0.14s ease;
}
.world-card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow-soft); }
.world-tag {
  align-self: flex-start;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  padding: 0.12em 0.55em;
  border-radius: 999px;
}
.world-title { font-family: var(--serif); font-size: 1.08rem; }
.world-hook { font-size: 0.85rem; line-height: 1.4; }

/* featured world: a full-width marquee card with its own western warmth */
.world-card.world-featured {
  grid-column: 1 / -1;
  position: relative;
  padding: 1.3rem 1.4rem 1.2rem;
  gap: 0.4rem;
  border-color: color-mix(in srgb, #c97f43 60%, transparent);
  background: linear-gradient(115deg, color-mix(in srgb, #b06f3a 15%, var(--card)), var(--card) 60%);
  overflow: hidden;
}
.world-card.world-featured::after {
  content: "";
  position: absolute;
  right: 0; bottom: 0;
  width: 320px; height: 100%;
  pointer-events: none;
  opacity: 0.16;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='700' height='240' viewBox='0 0 700 240'%3E%3Cg fill='%23b06f3a'%3E%3Cpath d='M0 240 L0 178 L28 172 L40 120 L52 116 L60 70 L120 70 L128 114 L142 120 L150 170 L190 178 L230 240 Z'/%3E%3Cpath d='M450 240 L450 196 L470 192 L478 148 L530 148 L538 190 L560 196 L575 240 Z'/%3E%3Cpath d='M0 240 L0 230 Q175 222 350 230 Q525 238 700 228 L700 240 Z'/%3E%3C/g%3E%3Cg stroke='%23b06f3a' fill='none' stroke-linecap='round'%3E%3Cpath d='M331 240 V108' stroke-width='20'/%3E%3Cpath d='M303 172 v-26' stroke-width='13'/%3E%3Cpath d='M303 150 q0 24 28 26' stroke-width='13'/%3E%3Cpath d='M359 152 v-18' stroke-width='12'/%3E%3Cpath d='M359 138 q0 22 -28 24' stroke-width='12'/%3E%3Cpath d='M628 240 V160' stroke-width='14'/%3E%3Cpath d='M609 196 v-16' stroke-width='9'/%3E%3Cpath d='M609 182 q0 16 19 18' stroke-width='9'/%3E%3C/g%3E%3C/svg%3E") right bottom / auto 100% no-repeat;
}
.world-card.world-featured:hover { border-color: #c97f43; }
.world-featured .world-title { font-size: 1.45rem; }
.world-featured .world-hook { font-size: 0.95rem; max-width: 46rem; }
.world-star {
  align-self: flex-start;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #7d4517; /* dark enough to read on the card's warm-tinted corner */
  background: color-mix(in srgb, #c97f43 18%, transparent);
  padding: 0.14em 0.6em;
  border-radius: 999px;
}
html:not(.light) .world-star { color: #e8a558; }

.party-size-row { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; margin: 1rem 0 1.4rem; }
.party-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.1rem; }
.character-card { position: relative; }
.char-num { position: absolute; top: 1rem; right: 1.1rem; font-size: 0.78rem; font-weight: 700; color: var(--faint); letter-spacing: 0.06em; text-transform: uppercase; }
.class-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.pointbuy { display: flex; flex-direction: column; gap: 0.3rem; margin-top: 0.5rem; }
.pb-row { display: flex; align-items: center; justify-content: space-between; padding: 0.25rem 0; }
.pb-label { font-size: 0.92rem; font-weight: 550; }
.pb-controls { display: flex; align-items: center; gap: 0.55rem; }
.pb-btn {
  width: 1.7rem; height: 1.7rem;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  font-weight: 700;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.pb-btn:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.pb-value { font-weight: 750; font-variant-numeric: tabular-nums; width: 2ch; text-align: center; }
.points-left { display: inline-block; font-size: 0.82rem; font-weight: 700; color: var(--accent); margin-bottom: 0.2rem; }
.points-left.zero { color: var(--good); }

.settings-list { display: flex; flex-direction: column; }
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.4rem;
  padding: 1rem 0.2rem;
  border-bottom: 1px solid var(--line);
}
.setting-info { max-width: 30rem; }
.setting-info p { margin-top: 0.15rem; }

.setup-foot {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.6rem calc(1rem + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg0) 86%, transparent);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  z-index: 20;
}

/* creating interstitial */
.creating {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  text-align: center;
  padding: 2rem;
}
.creating-flame {
  width: 4rem;
  height: 4rem;
  color: var(--accent);
  animation: flicker 1.6s ease-in-out infinite;
  filter: drop-shadow(0 0 24px color-mix(in srgb, var(--accent) 70%, transparent));
}
@keyframes flicker {
  0%, 100% { transform: scale(1) rotate(-2deg); }
  50% { transform: scale(1.12) rotate(2deg); }
}
.creating-line { font-family: var(--serif); font-style: italic; font-size: 1.05rem; }

/* ════════ TITLE SCREEN ════════ */
.title-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 2rem 1.4rem;
}
.title-glow {
  position: absolute;
  inset: -20%;
  background: radial-gradient(closest-side at 50% 38%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%);
  pointer-events: none;
}
/* procedural cover art fading down from the top of the title screen */
.title-cover {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 46vh;
  pointer-events: none;
  opacity: 0.55;
  -webkit-mask-image: linear-gradient(to bottom, black 20%, transparent 95%);
  mask-image: linear-gradient(to bottom, black 20%, transparent 95%);
}
.title-cover svg { width: 100%; height: 100%; display: block; }
.title-inner { position: relative; max-width: 44rem; display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.title-eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  animation: riseIn 0.7s 0.1s both cubic-bezier(0.2, 0.8, 0.2, 1);
}
.title-name {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  animation: riseIn 0.7s 0.25s both cubic-bezier(0.2, 0.8, 0.2, 1);
}
.title-tagline { font-size: 1.15rem; font-style: italic; color: var(--dim); font-family: var(--serif); animation: riseIn 0.7s 0.4s both cubic-bezier(0.2, 0.8, 0.2, 1); }
.title-rule { width: 70px; height: 2px; background: var(--accent); border-radius: 2px; margin: 0.4rem 0; animation: riseIn 0.7s 0.5s both; }
.title-intro { color: var(--dim); line-height: 1.7; animation: riseIn 0.7s 0.6s both; display: flex; flex-direction: column; gap: 0.45rem; }
.title-party { display: flex; flex-wrap: wrap; gap: 0.45rem; justify-content: center; animation: riseIn 0.7s 0.72s both; }
.title-begin { margin-top: 0.8rem; animation: riseIn 0.7s 0.85s both; }
.title-screen .small { animation: riseIn 0.7s 1s both; }
@keyframes riseIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

/* ════════ PLAY ════════ */
.play { height: 100vh; display: flex; flex-direction: column; animation: none; }
.play .topbar { flex-shrink: 0; }
.play-title { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
.play-title strong { font-family: var(--serif); font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scene-chip {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--dim);
  background: var(--card);
  border: 1px solid var(--line);
  padding: 0.2em 0.7em;
  border-radius: 999px;
  white-space: nowrap;
}
.saved-badge { font-size: 0.8rem; font-weight: 600; color: var(--good); opacity: 0; transition: opacity 0.4s ease; }
.saved-badge.show { opacity: 1; }

.play-main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  min-height: 0;
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
}

.feed-col { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.feed-scroll { flex: 1; overflow-y: auto; padding: 1.6rem 2rem 0.6rem; scroll-behavior: smooth; }
.feed { max-width: 44rem; margin: 0 auto; display: flex; flex-direction: column; gap: 1rem; }

/* feed entries */
.entry { animation: entryIn 0.45s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes entryIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.entry-intro { text-align: center; padding: 0.6rem 0 1rem; border-bottom: 1px solid var(--line); }
.intro-title { font-family: var(--serif); font-size: 1.5rem; }

.entry-dm { position: relative; font-family: var(--serif); font-size: 1.13rem; line-height: 1.75; }
.entry-dm .dm-text { display: flex; flex-direction: column; gap: 0.8em; }
/* keep the first line clear of the speaker button tucked in the corner */
.entry-dm .dm-text > p:first-child { padding-right: 2.2rem; }

/* per-entry read-aloud button: tucked at the top-right, revealed on hover
   (always visible while that passage is being read) */
.tts-btn {
  position: absolute;
  top: -0.2rem;
  right: -0.4rem;
  width: 2rem;
  height: 2rem;
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease;
}
.entry-dm:hover .tts-btn,
.entry-dm:focus-within .tts-btn,
.entry-dm.speaking .tts-btn { opacity: 1; }
/* touch devices have no hover — keep the button visible so it's reachable */
@media (hover: none) { .tts-btn { opacity: 0.7; } }
.tts-btn:hover { color: var(--accent); }
.entry-live .tts-btn { display: none; } /* nothing to replay until it's finished */
.tts-icon-stop { display: none; }
.entry-dm.speaking .tts-icon-play { display: none; }
.entry-dm.speaking .tts-icon-stop { display: inline-flex; }
.entry-dm.speaking .tts-btn { color: var(--accent); }
/* fetching the online voice clip — gentle pulse until audio starts */
.entry-dm.tts-loading .tts-btn { animation: ttsPulse 1s ease-in-out infinite; }
@keyframes ttsPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
/* a soft accent rail marks the passage currently being read */
.entry-dm.speaking { box-shadow: -0.7rem 0 0 -0.55rem var(--accent); }
/* read-along: the sentence being spoken right now lights up */
.tts-sent { transition: background-color 0.25s ease, color 0.25s ease; border-radius: 3px; }
.tts-sent.tts-current {
  background: color-mix(in srgb, var(--accent) 24%, transparent);
  color: var(--text);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.entry-player { align-self: flex-end; max-width: 85%; text-align: right; margin: 0.4rem 0; }
.entry-player .player-name { font-size: 0.76rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); display: block; margin-bottom: 0.2rem; }
.entry-player p {
  display: inline-block;
  background: color-mix(in srgb, var(--accent) 12%, var(--card));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: var(--r-md) var(--r-md) 4px var(--r-md);
  padding: 0.55rem 0.9rem;
  font-size: 0.97rem;
  text-align: left;
}

.entry-roll {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  font-weight: 550;
  color: var(--dim);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 0.6rem 0.9rem;
}
.entry-roll.good { border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.entry-roll.bad { border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.roll-die-icon { width: 1.35em; height: 1.35em; color: var(--accent); }
.roll-nat { font-size: 0.7rem; font-weight: 800; color: #ffd54a; border: 1px solid currentColor; padding: 0.1em 0.5em; border-radius: 999px; }
.roll-nat.low { color: var(--danger); }

.entry-system {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  padding: 0.3rem 0;
}
.entry-death { color: var(--danger); }

.entry-end { text-align: center; padding: 1.6rem 1rem; border-top: 1px solid var(--line); }
.entry-end h3 { font-family: var(--serif); font-size: 1.6rem; margin-bottom: 0.4rem; }
.end-actions { display: flex; gap: 0.7rem; justify-content: center; margin-top: 1rem; }

.entry-writing { display: flex; align-items: center; gap: 0.7rem; padding: 0.4rem 0; }
.writing-dots { display: inline-flex; gap: 4px; }
.writing-dots i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: dotPulse 1.2s ease-in-out infinite;
}
.writing-dots i:nth-child(2) { animation-delay: 0.18s; }
.writing-dots i:nth-child(3) { animation-delay: 0.36s; }
@keyframes dotPulse {
  0%, 100% { opacity: 0.25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

/* composer */
.composer-area {
  flex-shrink: 0;
  padding: 0.6rem 2rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-width: calc(44rem + 4rem);
  width: 100%;
  margin: 0 auto;
}
.suggest-row, .actor-row { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; }
.suggest-label { flex-shrink: 0; }
.chip-suggest { color: var(--dim); background: var(--bg1); }
.chip-suggest:hover { color: var(--text); border-color: var(--accent); }
.chip-actor.active { font-weight: 700; }

.roll-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: color-mix(in srgb, var(--accent) 10%, var(--card));
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: var(--r-md);
  padding: 0.8rem 1rem;
  animation: rollPulse 2.4s ease-in-out infinite;
}
@keyframes rollPulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 25%, transparent); }
  50% { box-shadow: 0 0 22px 2px color-mix(in srgb, var(--accent) 25%, transparent); }
}
.roll-banner-text { display: flex; flex-direction: column; gap: 0.1rem; }
.btn-roll { flex-shrink: 0; }

.composer { position: relative; display: flex; align-items: flex-end; gap: 0.55rem; }
.composer-input { flex: 1; min-height: 2.9rem; max-height: 140px; padding: 0.72rem 1rem; border-radius: var(--r-lg); }
.send-btn { height: 2.9rem; }
.dice-btn { height: 2.9rem; width: 2.9rem; border: 1px solid var(--line-strong); background: var(--card); font-size: 1.25rem; border-radius: var(--r-lg); }
.dice-btn:hover { border-color: var(--accent); }

/* party panel */
.party-panel {
  border-left: 1px solid var(--line);
  overflow-y: auto;
  background: color-mix(in srgb, var(--bg1) 60%, transparent);
}
.party-panel-inner { padding: 1.3rem 1.1rem 2rem; display: flex; flex-direction: column; gap: 0.9rem; }
.panel-title { font-size: 0.95rem; letter-spacing: 0.03em; text-transform: uppercase; color: var(--dim); }

.char-card { padding: 1rem; }
.char-card.dead { opacity: 0.55; filter: grayscale(0.7); }
.char-head { display: flex; align-items: center; gap: 0.7rem; }
.avatar {
  width: 2.4rem; height: 2.4rem;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 20%, var(--card-2));
  color: var(--accent);
  font-weight: 800;
  font-size: 1.05rem;
}
.char-id { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.edit-btn { opacity: 0; transition: opacity 0.15s ease; }
.char-card:hover .edit-btn { opacity: 1; }
.char-details { margin-top: 0.6rem; font-size: 0.86rem; }
.char-details summary { cursor: pointer; color: var(--dim); font-weight: 600; }
.char-details ul { margin-top: 0.3rem; color: var(--dim); }
.gear-list { margin-top: 0.4rem; font-size: 0.88rem; color: var(--dim); }

/* sheet editor */
.edit-grid { display: flex; flex-direction: column; gap: 0.7rem; }
.edit-row { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; }
.edit-row label { font-size: 0.9rem; font-weight: 600; flex-shrink: 0; }
.edit-row input { max-width: 110px; }
.edit-row-tall { flex-direction: column; align-items: stretch; }

/* ── responsive ── */
.party-toggle { display: none; }
@media (max-width: 900px) {
  .play-main { grid-template-columns: 1fr; }
  .party-toggle { display: inline-flex; }
  .party-panel {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: min(340px, 88vw);
    z-index: 40;
    background: var(--bg1);
    box-shadow: var(--shadow);
    transform: translateX(105%);
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .play-main.party-open .party-panel { transform: none; }
  .feed-scroll, .composer-area { padding-left: 1rem; padding-right: 1rem; }
}
@media (max-width: 640px) {
  .topbar { padding: 0.6rem 0.8rem; flex-wrap: wrap; }
  .hero { padding-top: 2rem; }
}
