/* Coastal theme: deep sea-blue base, forest-moss highlights, driftwood wood accents */
:root {
  color-scheme: dark;
  --bg: #0e1d2a;
  --bg-deep: #172b3c;
  --card: #15283a;
  --ink: #e8eeec;
  --ink-soft: #92a7b2;
  --line: #29445a;
  --accent: #8fae6e;        /* forest moss: key colour */
  --accent-hover: #a5c283;
  --accent-ink: #101a0a;
  --sea: #5f9bb5;           /* secondary: sea blue */
  --sea-ink: #08161f;
  --hub: #0f202f;
  --rim: #58412e;           /* weathered wood */
  --peg: #dcc9a4;           /* sand */
  --pointer: #9bba78;
  --shadow: 0 1px 0 rgb(255 255 255 / 0.04) inset, 0 14px 34px -14px rgb(0 0 0 / 0.65);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--ink);
  line-height: 1.5;
  background:
    radial-gradient(900px 520px at 10% -8%, color-mix(in srgb, var(--sea) 26%, transparent), transparent 62%),
    radial-gradient(820px 520px at 100% 0%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 62%),
    radial-gradient(1200px 500px at 50% 112%, color-mix(in srgb, var(--sea) 14%, transparent), transparent 70%),
    var(--bg);
  background-repeat: no-repeat;
}

.app {
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 16px 28px;
}

/* ---------- masthead ---------- */

.masthead { text-align: center; margin-bottom: 36px; }

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

h1, h2 { font-family: var(--serif); font-weight: 600; margin: 0; letter-spacing: -0.01em; }

h1 {
  font-size: clamp(2.4rem, 7vw, 4rem);
  line-height: 1.05;
  font-variation-settings: "opsz" 144;
}

h1 em { font-style: italic; font-weight: 500; color: var(--accent); }

.lede { margin: 12px 0 0; color: var(--ink-soft); font-size: 1.05rem; }

/* ---------- layout ---------- */

.layout {
  display: grid;
  gap: 36px;
  grid-template-columns: 1fr;
  align-items: start;
}

@media (min-width: 920px) {
  .layout { grid-template-columns: minmax(0, 1fr) 430px; gap: 48px; }
}

/* ---------- wheel ---------- */

.stage { display: flex; flex-direction: column; align-items: center; }

.wheel-wrap {
  position: relative;
  width: min(100%, 540px);
  aspect-ratio: 1;
  padding-top: 0;
}

#wheel {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 24px 30px rgb(0 0 0 / 0.55));
  -webkit-tap-highlight-color: transparent;
}

.pointer {
  position: absolute;
  top: -3.2%;
  left: 50%;
  width: 8.4%;
  aspect-ratio: 44 / 56;
  z-index: 2;
  transform: translateX(-50%);
  transform-origin: 50% 34%;
  filter: drop-shadow(0 4px 4px rgb(0 0 0 / 0.5));
  pointer-events: none;
}

.hub {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 17%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 0;
  background: var(--hub);
  color: var(--ink);
  font: 600 clamp(0.7rem, 2.2vw, 0.95rem) var(--serif);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 0 0 5px var(--rim), 0 6px 16px rgb(0 0 0 / 0.55);
  transition: transform 0.2s ease, background 0.2s ease;
}

.hub:hover:not(:disabled) { transform: translate(-50%, -50%) scale(1.06); background: color-mix(in srgb, var(--hub) 78%, var(--accent)); }
.hub:active:not(:disabled) { transform: translate(-50%, -50%) scale(0.97); }
.hub:disabled { cursor: default; }

/* ---------- buttons ---------- */

.btn {
  font: 600 0.92rem var(--sans);
  padding: 10px 18px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s;
}

.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn.primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--accent) 70%, black);
}
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); }

.btn.big { margin-top: 30px; padding: 15px 44px; font-size: 1.1rem; font-family: var(--serif); letter-spacing: 0.01em; }

.btn.accent { background: var(--sea); color: var(--sea-ink); }
.btn.accent:hover:not(:disabled) { background: color-mix(in srgb, var(--sea) 85%, black); }

.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); padding: 8px 14px; font-size: 0.85rem; }
.btn.ghost:hover:not(:disabled) { border-color: var(--ink-soft); background: color-mix(in srgb, var(--ink) 5%, transparent); }
.btn.ghost.danger:hover:not(:disabled) { color: var(--accent); border-color: var(--accent); }

.link {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: 500 0.85rem var(--sans); color: var(--ink-soft);
  text-decoration: underline; text-underline-offset: 3px;
}
.link:hover { color: var(--accent); }

:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; }

.status {
  min-height: 1.5em;
  margin: 14px 0 0;
  text-align: center;
  color: var(--ink-soft);
  font-style: italic;
  font-family: var(--serif);
}

/* ---------- history ---------- */

.history { width: min(100%, 540px); margin-top: 18px; }
.history[hidden] { display: none; }

.history-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.history-head h2 { font-size: 1rem; color: var(--ink-soft); font-weight: 500; font-style: italic; }

.history ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.history li {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px 5px 9px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.85rem;
  max-width: 100%;
}
.history li i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.history li span { overflow-wrap: anywhere; }

/* ---------- panel ---------- */

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 24px 22px 22px;
  box-shadow: var(--shadow);
}

.panel-head { display: flex; align-items: baseline; justify-content: space-between; }
.panel-head h2 { font-size: 1.5rem; }
.count { font-size: 0.85rem; color: var(--ink-soft); }
.hint { margin: 4px 0 16px; font-size: 0.88rem; color: var(--ink-soft); }

.opt-head,
.opt {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) 74px 54px 30px;
  column-gap: 8px;
  align-items: center;
}

.opt-head {
  padding: 0 10px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 4px;
}
.opt-head span:nth-child(3) { padding-left: 4px; }
.opt-head span:nth-child(4) { text-align: right; }

.options {
  list-style: none;
  margin: 0;
  padding: 0 2px 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(48vh, 420px);
  /* room above and below so the "who is editing" tag on the first/last row isn't clipped by the scroll area */
  padding-block: 10px;
  margin-block: -6px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.opt {
  position: relative;
  padding: 7px 10px 11px;
  background: color-mix(in srgb, var(--bg) 55%, var(--card));
  border-radius: 14px;
  border: 1px solid transparent;
  transition: border-color 0.15s, opacity 0.2s;
  animation: pop-in 0.28s ease both;
}
.opt:focus-within { border-color: var(--line); }
.opt.is-off { opacity: 0.55; }

@keyframes pop-in { from { opacity: 0; transform: translateY(6px) scale(0.98); } to { opacity: 1; transform: none; } }

.opt-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--dot, var(--line)); transition: background 0.2s; }
.opt.is-off .opt-dot { background: transparent; box-shadow: inset 0 0 0 2px var(--ink-soft); }

.opt input,
.opt textarea,
.add input {
  font: 500 0.95rem var(--sans);
  color: var(--ink);
  min-width: 0;
  width: 100%;
}

/* The name is a one-line-looking box that grows with its text, so long names are shown in full instead of cut off. */
.opt-name {
  display: block;
  background: transparent;
  border: 0;
  border-radius: 8px;
  padding: 5px 6px;
  line-height: 1.3;
  resize: none;
  overflow: hidden;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.opt-name:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.opt-name:focus { background: var(--card); }

.opt-weight,
.add input {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 5px 8px;
}
.opt-weight:focus, .add input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }

.opt-pct {
  text-align: right;
  font: 600 0.88rem var(--serif);
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}

.opt-remove {
  width: 28px; height: 28px;
  border: 0; border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  font-size: 1.2rem; line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.opt-remove:hover { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }

.opt-bar {
  grid-column: 1 / -1;
  display: block;
  height: 3px;
  margin-top: 7px;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  border-radius: 3px;
  overflow: hidden;
}
.opt-bar i {
  display: block; height: 100%; width: 0;
  background: var(--dot, var(--line));
  border-radius: 3px;
  transition: width 0.35s cubic-bezier(.3,.8,.3,1), background 0.2s;
}

.options:empty::before {
  content: "No options yet. Add a few below.";
  display: block;
  padding: 22px 10px;
  text-align: center;
  color: var(--ink-soft);
  font-style: italic;
  font-family: var(--serif);
}

.add { display: grid; grid-template-columns: minmax(0, 1fr) 74px auto; gap: 8px; margin-top: 14px; }
.add input { padding: 10px 12px; }

.tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.toggles { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; padding-top: 18px; border-top: 1px dashed var(--line); }

.switch { display: flex; align-items: center; gap: 12px; font-size: 0.92rem; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track {
  position: relative; flex: none;
  width: 38px; height: 22px;
  border-radius: 999px;
  background: var(--line);
  transition: background 0.2s;
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--card);
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.3);
  transition: transform 0.2s cubic-bezier(.3,.8,.3,1.2);
}
.switch input:checked + .track { background: var(--sea); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2.5px solid var(--accent); outline-offset: 2px; }

.panel[inert] { opacity: 0.6; transition: opacity 0.2s; }

.foot { margin-top: 36px; text-align: center; font-size: 0.8rem; color: var(--ink-soft); }

/* ---------- result dialog ---------- */

dialog {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  max-width: min(92vw, 440px);
  width: 100%;
  overflow: visible;
}
dialog::backdrop { background: rgb(4 12 20 / 0.62); backdrop-filter: blur(3px); animation: fade 0.25s ease; }
dialog[open] .result-card { animation: card-in 0.45s cubic-bezier(.2,1.2,.3,1) both; }

@keyframes fade { from { opacity: 0; } }
@keyframes card-in { from { opacity: 0; transform: translateY(18px) scale(0.88) rotate(-1.5deg); } }

.result-card {
  position: relative;
  overflow: hidden;
  text-align: center;
  background: var(--card);
  border-radius: 28px;
  padding: 44px 28px 28px;
  box-shadow: 0 30px 60px -20px rgb(0 0 0 / 0.5);
}
.result-swatch { position: absolute; inset: 0 0 auto 0; height: 12px; background: var(--dot, var(--accent)); }
.result-card h2 {
  font-size: clamp(2rem, 8vw, 2.9rem);
  line-height: 1.1;
  margin: 6px 0 8px;
  overflow-wrap: anywhere;
  font-variation-settings: "opsz" 144;
}
.result-chance { margin: 0; color: var(--ink-soft); }
.result-note { margin: 10px 0 0; font-size: 0.85rem; color: var(--ink-soft); font-style: italic; }
.result-note[hidden] { display: none; }
.result-actions { display: flex; justify-content: center; gap: 10px; margin-top: 26px; flex-wrap: wrap; }

/* ---------- sharing: send dialog + play mode ---------- */

.big-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 14px; }

.btn.send-btn {
  display: block;
  width: 100%;
  background: color-mix(in srgb, var(--sea) 20%, var(--card));
  border-color: color-mix(in srgb, var(--sea) 55%, transparent);
  color: var(--ink);
}
.btn.send-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--sea) 32%, var(--card)); }

#send { max-width: min(92vw, 560px); }
.send-card {
  background: var(--card);
  border-radius: 24px;
  padding: 28px 24px 22px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 30px 60px -20px rgb(0 0 0 / 0.5);
}
#send[open] .send-card { animation: card-in 0.4s cubic-bezier(.2,1.1,.3,1) both; }
.send-card h2 { font-size: 1.6rem; }
.send-card h3 { font: 600 1rem var(--serif); margin: 0; }
.send-intro { margin: 8px 0 18px; color: var(--ink-soft); font-size: 0.92rem; }
.send-note {
  margin: -6px 0 16px; padding: 10px 12px; border-radius: 12px; font-size: 0.85rem;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.send-note[hidden] { display: none; }

.field { margin-bottom: 14px; }
.field label, .lookup label { display: block; margin-bottom: 6px; font-size: 0.85rem; font-weight: 600; }
.opt-label { font-weight: 400; color: var(--ink-soft); }
.send-card input[type="text"], .send-card textarea {
  width: 100%;
  font: 500 0.95rem var(--sans);
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  resize: vertical;
}
.send-card input[type="text"]:focus, .send-card textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

#send-out { margin-top: 22px; }
#send-out[hidden] { display: none; }
.send-out-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }

.links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.links li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px 8px 14px;
  background: color-mix(in srgb, var(--bg) 55%, var(--card));
  border-radius: 14px;
}
.links .who { font-weight: 600; overflow-wrap: anywhere; }
.links .btn { padding: 6px 12px; font-size: 0.8rem; }
.links .res {
  grid-column: 1 / -1;
  font: 600 1rem var(--serif);
  color: var(--accent);
  padding: 2px 0 2px;
}
.links .res[hidden] { display: none; }

.lookup { margin-top: 24px; padding-top: 18px; border-top: 1px dashed var(--line); }
.lookup-row { display: flex; gap: 8px; }
.lookup-out { min-height: 1.4em; margin: 8px 0 0; font: 600 1rem var(--serif); color: var(--accent); overflow-wrap: anywhere; }

.options.viewer[hidden], .make-own[hidden] { display: none; }
.options.viewer { max-height: none; margin-top: 14px; }
.opt.ro { grid-template-columns: 14px minmax(0, 1fr) auto; padding: 10px 14px 12px 12px; }
.opt.ro .opt-label-ro { font-weight: 500; overflow-wrap: anywhere; }

.make-own { margin: 18px 0 0; text-align: center; font-size: 0.9rem; }
.make-own a { color: var(--accent); font-weight: 600; text-underline-offset: 3px; }

body.play .edit-only, body.play .foot { display: none; }
body.play .toggles { margin-top: 18px; padding-top: 14px; }

/* ---------- live rooms ---------- */

.side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.live-bar {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 14px 18px 16px;
  box-shadow: var(--shadow);
}
.live-bar[hidden] { display: none; }
.live-top { display: flex; align-items: center; gap: 10px; }
.live-top strong { font: 600 1rem var(--serif); flex: 1; }

.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-soft); flex: none; }
.live-dot.on { background: var(--accent); box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); animation: live-pulse 2.2s ease-out infinite; }
@keyframes live-pulse { 70% { box-shadow: 0 0 0 9px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.live-rtt { font-size: 0.75rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

.peers { list-style: none; margin: 12px 0 10px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.peer {
  display: flex; align-items: center; gap: 9px; min-width: 0;
  padding: 5px 10px 5px 5px;
  background: color-mix(in srgb, var(--bg) 55%, var(--card));
  border-radius: 14px;
  transition: opacity 0.3s;
}
.peer.is-away { opacity: 0.6; }
.peer .avatar {
  position: relative; flex: none;
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--c, var(--sea));
  color: #101810; font: 700 0.8rem var(--sans);
}
/* status dot: moss = active, amber = idle, hollow = away */
.peer .avatar::after {
  content: ""; position: absolute; right: -2px; bottom: -2px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--card);
}
.peer.is-idle .avatar::after { background: #d4a24c; }
.peer.is-away .avatar::after { background: var(--card); box-shadow: inset 0 0 0 2px var(--ink-soft); }
.peer .who { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.peer .who strong { font-size: 0.86rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.peer .who small { font-size: 0.72rem; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.peer.is-editing .who small { color: var(--accent); }
.peer.pulse .avatar { animation: avatar-ring 0.9s ease-out; }
@keyframes avatar-ring {
  from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c, var(--sea)) 80%, transparent); }
  to { box-shadow: 0 0 0 13px transparent; }
}
.peers-more { grid-column: 1 / -1; font-size: 0.8rem; color: var(--ink-soft); padding: 0 4px; }

.react-bar { display: flex; gap: 6px; }
.react-bar button {
  flex: 1; min-height: 44px; /* comfortable touch target */
  font-size: 1.25rem; line-height: 1;
  background: color-mix(in srgb, var(--bg) 55%, var(--card));
  border: 1.5px solid transparent; border-radius: 14px; cursor: pointer;
  transition: transform 0.12s, border-color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.react-bar button:hover { border-color: var(--line); }
.react-bar button:active { transform: scale(0.88); background: color-mix(in srgb, var(--accent) 22%, var(--card)); }

.activity { list-style: none; margin: 10px 0 12px; padding: 0; display: flex; flex-direction: column; gap: 3px; min-height: 1.2em; }
.activity li { font-size: 0.8rem; color: var(--ink-soft); overflow-wrap: anywhere; animation: feed-in 0.35s ease both; }
.activity:empty { display: none; }
.activity li:first-child { color: var(--ink); }
.activity li:nth-child(2) { opacity: 0.75; }
.activity li:nth-child(n+3) { opacity: 0.5; }
@keyframes feed-in { from { opacity: 0; transform: translateY(-4px); } }

/* emoji that float up over the wheel */
.reactions { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 3; border-radius: 50%; }
.reactions .float {
  position: absolute; bottom: 4%;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  animation: float-up 2.4s cubic-bezier(.2,.7,.3,1) forwards;
}
.reactions .float span { font-size: clamp(1.8rem, 7vw, 2.6rem); filter: drop-shadow(0 4px 6px rgb(0 0 0 / 0.5)); }
.reactions .float small {
  font: 600 0.68rem var(--sans); padding: 1px 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--card) 85%, transparent); color: var(--ink);
}
@keyframes float-up {
  0% { transform: translateY(0) scale(0.5); opacity: 0; }
  12% { transform: translateY(-14px) scale(1.15); opacity: 1; }
  100% { transform: translateY(-62vmin) translateX(calc(var(--drift, 0) * 1px)) scale(1); opacity: 0; }
}

/* a row flashes in the colour of whoever just changed it */
.opt.flash { animation: row-flash 1.2s ease-out; }
@keyframes row-flash { from { background-color: color-mix(in srgb, var(--c, var(--sea)) 38%, transparent); } }

.live-row { display: flex; gap: 8px; }
.live-row input {
  flex: 1; min-width: 0;
  font: 500 0.9rem var(--sans); color: var(--ink);
  background: var(--bg); border: 1.5px solid var(--line); border-radius: 999px; padding: 7px 14px;
}
.live-row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }

/* a small tag on the row somebody else is editing */
.opt[data-editor] { border-color: var(--sea); }
.opt[data-editor]::after {
  content: attr(data-editor);
  position: absolute; right: 14px; top: -9px;
  max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 1px 9px; border-radius: 999px;
  background: var(--sea); color: var(--sea-ink);
  font: 600 0.68rem var(--sans);
}

body.live .solo-only, body.live #clear-history, body.live .foot { display: none; }

/* ---------- confetti + toast ---------- */

#confetti {
  display: none;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
  pointer-events: none;
}
#confetti.on { display: block; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 100;
  transform: translate(-50%, 20px);
  max-width: min(90vw, 520px);
  text-align: center;
  overflow-wrap: anywhere;
  padding: 10px 18px;
  border-radius: 18px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.88rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- small screens ---------- */

@media (max-width: 480px) {
  .app { padding-top: 28px; }
  .masthead { margin-bottom: 26px; }
  .panel { padding: 20px 14px 18px; border-radius: 20px; }
  .opt-head, .opt { grid-template-columns: 12px minmax(0, 1fr) 62px 46px 28px; column-gap: 6px; }
  .opt { padding-left: 8px; padding-right: 6px; }
  .add { grid-template-columns: minmax(0, 1fr) 62px auto; }
  .btn.big { width: 100%; max-width: 360px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
