/* Базовые правила (раньше — критический inline-стиль в <head>) */
:root {
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
body {
  margin: 0;
  font:
    14px/1.4 system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
}
img {
  max-width: 100%;
}
[hidden] {
  display: none !important;
}

/* Layout: a coach's desk — motion strip on top, one big "say it" field, then the breakdown as a chain of links per argument; signal-card colours (green / yellow / red) are the only state language */
:root {
  /* Arena: dark scoreboard, two team colours, amber scoreboard digits */
  --bg: #0a0d14;
  --surface: #121723;
  --surface-2: #192030;
  --ink: #eef2fa;
  --muted: #8d97ad;
  --line: #252e42;
  --hair: #2c3650;
  --gov: #3d8bff;
  --opp: #ff4d5e;
  --pop: #ffb627;
  --pop-ink: #1a1204;
  --brand: #121723;
  --brand-ink: #eef2fa;
  --accent: #ffb627;
  --accent-ink: #1a1204;
  --shadow: transparent;
  --green: #36d67e;
  --yellow: #ffb627;
  --red: #ff4d5e;
  --green-bg: #0f2a1d;
  --yellow-bg: #2e2410;
  --red-bg: #2e1218;
  --soft: #1a2132;
  --f-logo: "Russo One", "Arial Black", Impact, sans-serif;
  --f-display: "Russo One", "Golos Text", system-ui, sans-serif;
  --f-body: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
html,
body {
  overflow-x: clip;
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.5;
}
.wrap {
  max-width: 900px;
  margin: 0 auto;
  padding-block: 16px 56px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: grid;
  gap: 16px;
}
header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
h1 {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.5rem;
  margin: 0;
}
h2 {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
h3 {
  font-family: var(--f-display);
  font-size: 1.15rem;
  margin: 0;
  text-wrap: balance;
}
.seg {
  display: inline-flex;
  background: var(--soft);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.seg button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 600 0.9rem var(--f-body);
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
}
.seg button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  display: grid;
  gap: 12px;
  min-width: 0;
}
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.between {
  justify-content: space-between;
}
.btn {
  font: 600 0.92rem var(--f-body);
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn.big {
  padding: 13px 20px;
  font-size: 1rem;
}
.btn.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  padding: 6px 10px;
  font-size: 0.85rem;
}
.btn:disabled {
  opacity: 0.45;
  cursor: default;
}
button:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
select {
  font: 500 0.9rem var(--f-body);
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  max-width: 100%;
}
.motion {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(1.15rem, 3vw, 1.5rem);
  line-height: 1.3;
  text-wrap: balance;
  margin: 0;
}
.tag {
  font: 600 0.72rem var(--f-body);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.tag.gov {
  color: var(--gov);
}
.tag.opp {
  color: var(--opp);
}
.tag.cat {
  color: var(--muted);
}
.note {
  font-size: 0.85rem;
  color: var(--muted);
}
textarea {
  width: 100%;
  resize: vertical;
  font: 400 1.02rem/1.55 var(--f-body);
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
}
#speech {
  min-height: 190px;
}
.mic {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--soft);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.88rem;
}
.mic svg {
  flex: none;
  margin-top: 2px;
  color: var(--accent);
}
.mic b {
  font-weight: 600;
}
.live {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}
.clock {
  font-family: var(--f-mono);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 2rem;
  line-height: 1;
}
.clock.big {
  font-size: clamp(3.2rem, 12vw, 5.4rem);
  letter-spacing: -0.02em;
}
.clock.over {
  color: var(--red);
}
.stat {
  font-family: var(--f-mono);
  font-size: 0.85rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--red);
  display: inline-block;
  animation: pulse 1.2s infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.25;
  }
}
/* results */
.score {
  display: flex;
  gap: 16px;
  align-items: center;
}
.ring {
  --p: 0;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--soft) 0);
}
.ring span {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--surface);
  display: grid;
  place-items: center;
  font: 700 1.3rem var(--f-mono);
}
.verdict {
  font-family: var(--f-display);
  font-size: 1.1rem;
  line-height: 1.4;
  margin: 0;
}
.arg {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  display: grid;
  gap: 10px;
}
.chain {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
@media (max-width: 620px) {
  .chain {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.link {
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 0.85rem;
  display: grid;
  gap: 2px;
  min-width: 0;
}
.link b {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.link.s-ok {
  background: var(--green-bg);
}
.link.s-ok b {
  color: var(--green);
}
.link.s-weak {
  background: var(--yellow-bg);
}
.link.s-weak b {
  color: var(--yellow);
}
.link.s-no {
  background: var(--red-bg);
}
.link.s-no b {
  color: var(--red);
}
.kv {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 12px;
  font-size: 0.93rem;
}
.kv dt {
  color: var(--muted);
  font-weight: 500;
}
.kv dd {
  margin: 0;
}
.checks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.checks li {
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.checks li::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 2px;
  flex: none;
  transform: translateY(-1px);
}
.checks li.y::before {
  background: var(--green);
}
.checks li.n::before {
  background: var(--red);
}
.focus {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 12px;
  font-weight: 500;
}
.stream {
  white-space: pre-wrap;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}
.err {
  color: var(--red);
  font-size: 0.9rem;
}
details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.88rem;
}
.hist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}
.hist button {
  width: 100%;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  text-align: left;
  padding: 8px 10px;
  border-radius: 9px;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: 400 0.9rem var(--f-body);
}
.hist button:hover {
  background: var(--soft);
}
.hist .sc {
  font: 700 0.95rem var(--f-mono);
  text-align: center;
  border-radius: 6px;
  padding: 2px 0;
}
.hist .t {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* round */
.signal {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}
.card {
  width: 18px;
  height: 26px;
  border-radius: 3px;
  background: var(--line);
  flex: none;
}
.signal[data-s="protected"] .card,
.signal[data-s="over"] .card {
  background: var(--red);
}
.signal[data-s="open"] .card {
  background: var(--green);
}
.signal[data-s="last"] .card {
  background: var(--yellow);
}
.bar {
  height: 6px;
  background: var(--soft);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
}
.bar .mark {
  position: absolute;
  top: 0;
  width: 2px;
  height: 100%;
  background: var(--muted);
  opacity: 0.5;
}
ol.speeches {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 3px;
}
ol.speeches button {
  width: 100%;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  padding: 8px 10px;
  border-radius: 9px;
  cursor: pointer;
  font: 500 0.92rem var(--f-body);
}
ol.speeches li.cur button {
  border-color: var(--accent);
  background: var(--soft);
}
ol.speeches li.done button {
  color: var(--muted);
}
ol.speeches .n,
ol.speeches .t {
  font-family: var(--f-mono);
  font-size: 0.8rem;
  color: var(--muted);
}
.sd {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
}
.tips {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 3px;
}
.team {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
@media (max-width: 560px) {
  .team {
    grid-template-columns: minmax(0, 1fr);
  }
}
.team label {
  display: grid;
  gap: 4px;
}
input[type="text"] {
  font: 500 0.95rem var(--f-body);
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  width: 100%;
  min-width: 0;
}
input[type="text"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.who {
  font-size: 0.8rem;
  color: var(--muted);
  margin-left: 6px;
}
header .seg {
  flex-wrap: wrap;
}
.fmtwrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
}
.fmtwrap .seg button {
  position: relative;
}
.tip {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  max-width: calc(100vw - 32px);
  background: var(--ink);
  color: var(--bg);
  font: 400 0.82rem/1.45 var(--f-body);
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  z-index: 20;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition:
    opacity 0.15s,
    transform 0.15s;
  pointer-events: none;
  white-space: normal;
}
.tip b {
  display: block;
  margin-bottom: 3px;
  font-weight: 600;
}
.fw {
  position: relative;
  display: inline-flex;
}
.fw .tip {
  pointer-events: auto;
  top: calc(100% + 6px);
}
.fw .tip::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -10px;
  height: 10px;
}
@media (hover: hover) {
  .fw:hover .tip {
    opacity: 1;
    visibility: visible;
    transform: none;
  }
}
.fw:focus-within .tip {
  opacity: 1;
  visibility: visible;
  transform: none;
}
@media (hover: none) {
  .fw .tip {
    display: none;
  }
}
.info {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font: 700 0.9rem var(--f-body);
  cursor: pointer;
  flex: none;
}
.pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  max-width: calc(100vw - 32px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  z-index: 30;
  display: grid;
  gap: 8px;
  font-size: 0.88rem;
}
.pop p {
  margin: 0;
}
.filters {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 12px;
  align-items: start;
}
@media (max-width: 520px) {
  .filters {
    grid-template-columns: minmax(0, 1fr);
  }
}
.filters .note {
  padding-top: 5px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  font: 500 0.84rem var(--f-body);
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.case {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.case.open {
  border-color: var(--accent);
}
.case-h {
  width: 100%;
  display: grid;
  gap: 4px;
  text-align: left;
  padding: 14px 16px;
  background: transparent;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  font: 400 0.9rem var(--f-body);
}
.case-t {
  font-family: var(--f-display);
  font-size: 1.12rem;
  font-weight: 700;
}
.case-b {
  display: grid;
  gap: 12px;
  padding: 0 16px 16px;
}
.tabhint {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 70ch;
}
.rgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}
.rcell {
  background: var(--soft);
  border-radius: 10px;
  padding: 10px 12px;
  display: grid;
  gap: 2px;
}
.tablewrap {
  overflow-x: auto;
}
.rt {
  border-collapse: collapse;
  width: 100%;
  min-width: 520px;
  font-size: 0.9rem;
}
.rt th {
  text-align: left;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}
.rt td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.rt td.num {
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.rt .tips {
  font-size: 0.86rem;
}
.gloss {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px 18px;
  margin: 0;
}
.gl dt {
  font-weight: 600;
}
.gl dd {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.hacks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
.hack {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  display: grid;
  gap: 8px;
  align-content: start;
  min-width: 0;
}
.say {
  margin: 0;
  font-family: var(--f-display);
  font-size: 1.02rem;
  background: var(--soft);
  border-radius: 10px;
  padding: 10px 12px;
  user-select: text;
}
.wrapseg {
  flex-wrap: wrap;
  justify-self: start;
}
.lgq {
  display: grid;
  gap: 10px;
}
.q {
  font-family: var(--f-display);
  font-size: 1.12rem;
  line-height: 1.45;
  margin: 0;
  text-wrap: pretty;
}
.opts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
@media (max-width: 560px) {
  .opts {
    grid-template-columns: minmax(0, 1fr);
  }
}
.opt {
  text-align: left;
  font: 500 0.93rem var(--f-body);
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
}
.opt:hover:not(:disabled) {
  border-color: var(--accent);
}
.opt:disabled {
  cursor: default;
}
.opt.right {
  background: var(--green-bg);
  border-color: var(--green);
  color: var(--ink);
}
.opt.wrong {
  background: var(--red-bg);
  border-color: var(--red);
  color: var(--ink);
}
.drills {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
@media (max-width: 700px) {
  .drills {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 420px) {
  .drills {
    grid-template-columns: minmax(0, 1fr);
  }
}
.drill {
  display: grid;
  gap: 3px;
  align-content: start;
  text-align: left;
  padding: 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  font: 400 0.85rem var(--f-body);
}
.drill b {
  font-size: 0.95rem;
  font-weight: 600;
}
.drill span:not(.stat) {
  color: var(--muted);
}
.drill:hover,
.drill[aria-pressed="true"] {
  border-color: var(--accent);
}
.drill[aria-pressed="true"] {
  background: var(--soft);
}
.task {
  font-family: var(--f-display);
  font-size: 1.05rem;
  line-height: 1.5;
  background: var(--soft);
  border-radius: 10px;
  padding: 12px 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.rubric {
  display: grid;
  gap: 8px;
}
.rb {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 56px;
  gap: 10px;
  align-items: center;
  font-size: 0.9rem;
}
.rb .bar i {
  transition: none;
}
.rb .v {
  font: 600 0.85rem var(--f-mono);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
@media (prefers-reduced-motion: reduce) {
  .dot {
    animation: none;
  }
}

/* ===== Arena skin ===== */
body {
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(61, 139, 255, 0.16), transparent 60%),
    radial-gradient(1200px 500px at 90% -10%, rgba(255, 77, 94, 0.14), transparent 60%), var(--bg);
  background-attachment: fixed;
}
.brandbar {
  position: relative;
  overflow: visible;
  background: linear-gradient(180deg, #151b2a, #10141f);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.brandbar::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 18px;
  pointer-events: none;
  background: linear-gradient(90deg, var(--gov), transparent 30%, transparent 70%, var(--opp));
  opacity: 0.18;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  position: relative;
}
.mascot {
  width: 68px;
  height: 62px;
  flex: none;
  overflow: visible;
}
.m-body {
  fill: var(--pop);
  stroke: #1a1204;
  stroke-width: 4;
  stroke-linejoin: round;
}
.m-brow,
.m-mouth,
.m-arm {
  stroke: #1a1204;
  stroke-width: 4;
  stroke-linecap: round;
  fill: none;
}
.m-arm {
  stroke: var(--pop);
  stroke-width: 5;
}
.m-eye {
  fill: #1a1204;
}
.m-glint {
  fill: #fff;
}
.m-grin {
  fill: #1a1204;
}
.m-oh {
  fill: #1a1204;
  stroke: none;
}
.m-grin,
.m-flat,
.m-oh,
.m-wink,
.m-brows2,
.m-hearts {
  display: none;
}
.m-wink {
  stroke: #1a1204;
  stroke-width: 4;
  stroke-linecap: round;
  fill: none;
}
.m-heart {
  fill: #ff4d5e;
  stroke: #1a1204;
  stroke-width: 2;
}
.m-eyes,
.m-brows,
.m-brows2,
.m-mouth {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.25s;
}
.mascot[data-mood="wink"] .r {
  display: none;
}
.mascot[data-mood="wink"] .m-wink {
  display: inline;
}
.mascot[data-mood="fire"] .m-brows {
  display: none;
}
.mascot[data-mood="fire"] .m-brows2 {
  display: inline;
}
.mascot[data-mood="fire"] .m-smirk {
  display: none;
}
.mascot[data-mood="fire"] .m-grin {
  display: inline;
}
.mascot[data-mood="wow"] .m-smirk {
  display: none;
}
.mascot[data-mood="wow"] .m-oh {
  display: inline;
}
.mascot[data-mood="wow"] .m-brows {
  transform: translateY(-5px);
}
.mascot[data-mood="wow"] .m-eye {
  stroke: #1a1204;
  stroke-width: 2.5;
}
.mascot[data-mood="love"] .m-eyes {
  display: none;
}
.mascot[data-mood="love"] .m-hearts {
  display: inline;
}
.mascot[data-mood="love"] .m-smirk {
  display: none;
}
.mascot[data-mood="love"] .m-grin {
  display: inline;
}
.mascot[data-mood="worried"] .m-brows {
  transform: rotate(-8deg);
}
.brand .mascot {
  cursor: pointer;
}
.mascot .m-all {
  transform-box: fill-box;
  transform-origin: 50% 55%;
}
.brand .mascot[data-mood="think"] {
  animation: none;
}
.brand .mascot .m-eyes {
  animation: blink 4.6s infinite;
}
@keyframes blink {
  0%,
  93%,
  100% {
    transform: scaleY(1);
  }
  95% {
    transform: scaleY(0.1);
  }
}
.brand .mascot.spin .m-all {
  animation: spin360 1s cubic-bezier(0.45, -0.35, 0.4, 1.35);
}
@keyframes spin360 {
  from {
    transform: rotate(0);
  }
  to {
    transform: rotate(360deg);
  }
}
.brand .mascot.m-pop .m-all {
  animation: popm 0.35s ease;
}
@keyframes popm {
  50% {
    transform: translateY(-4px) scale(1.06);
  }
}
.mascot[data-mood="happy"] .m-smirk,
.mascot[data-mood="think"] .m-smirk,
.mascot[data-mood="worried"] .m-smirk {
  display: none;
}
.mascot[data-mood="happy"] .m-grin {
  display: inline;
}
.mascot[data-mood="think"] .m-flat {
  display: inline;
}
.mascot[data-mood="worried"] .m-oh {
  display: inline;
}
.mascot[data-mood="think"] .m-eye,
.mascot[data-mood="think"] .m-glint {
  transform: translate(3px, -4px);
}
.mascot[data-mood="think"] .m-all {
  animation: bob 1.2s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
.brand .mascot {
  transform: rotate(-6deg);
}
.brand {
  isolation: isolate;
}
.brand::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 50%;
  width: 84px;
  height: 84px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 182, 39, 0.28), transparent 65%);
  z-index: -1;
  pointer-events: none;
}
@keyframes bob {
  50% {
    transform: translateY(-4px) rotate(4deg);
  }
}
.logo {
  font-family: var(--f-logo);
  font-size: clamp(1.9rem, 6vw, 2.7rem);
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-transform: uppercase;
}
.logo span {
  color: var(--pop);
  text-shadow: 0 0 18px rgba(255, 182, 39, 0.6);
}
.tagline {
  margin: 4px 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}
.brandbar .seg {
  background: #0a0d14;
  border: 1px solid var(--line);
}
.brandbar .seg button {
  color: var(--muted);
}
.brandbar .seg button[aria-pressed="true"] {
  background: var(--pop);
  color: var(--pop-ink);
  box-shadow: none;
}
.brandbar .info {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}
/* two-level nav */
.nav {
  display: grid;
  gap: 10px;
}
.groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 4px;
  gap: 4px;
  background: #05070c;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.group {
  font: 400 clamp(0.85rem, 2.6vw, 1.05rem) var(--f-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 11px 8px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s;
}
.group:hover {
  color: var(--ink);
}
.group[aria-pressed="true"] {
  background: var(--pop);
  color: var(--pop-ink);
  box-shadow: 0 0 22px rgba(255, 182, 39, 0.35);
}
.nav {
  gap: 12px;
}
.subrow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
}
.stile {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s,
    transform 0.15s;
}
.stile svg {
  width: 34px;
  height: 34px;
  flex: none;
  padding: 7px;
  border-radius: 10px;
  background: var(--soft);
  stroke: var(--muted);
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.stile b {
  display: block;
  font: 400 1rem var(--f-display);
  letter-spacing: 0.01em;
}
.stile small {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 1px;
}
.stile:hover {
  border-color: var(--hair);
  transform: translateY(-1px);
}
.stile[aria-pressed="true"] {
  border-color: var(--pop);
  background: linear-gradient(180deg, rgba(255, 182, 39, 0.12), rgba(255, 182, 39, 0.03));
}
.stile[aria-pressed="true"] svg {
  background: var(--pop);
  stroke: var(--pop-ink);
}
@media (max-width: 480px) {
  .subrow {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .stile {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
/* surfaces */
.panel,
.case,
.hack {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: none;
}
.case.open {
  border-color: var(--pop);
}
h2 {
  color: var(--muted);
  font-family: var(--f-body);
  font-weight: 600;
  letter-spacing: 0.1em;
}
h3,
.speaker,
.case-t {
  font-family: var(--f-display);
  font-weight: 400;
  letter-spacing: 0.01em;
}
.motion {
  font-family: var(--f-display);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.3;
  font-size: clamp(1.2rem, 3.2vw, 1.6rem);
}
.q,
.task,
.say,
.verdict {
  font-family: var(--f-body);
  font-weight: 500;
}
.btn {
  border: 1px solid var(--hair);
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 600;
}
.btn:hover:not(:disabled) {
  border-color: var(--muted);
}
.btn.primary {
  background: var(--pop);
  color: var(--pop-ink);
  border-color: var(--pop);
  box-shadow: 0 0 0 0 rgba(255, 182, 39, 0);
  transition: box-shadow 0.2s;
}
.btn.primary:hover:not(:disabled) {
  box-shadow: 0 0 18px rgba(255, 182, 39, 0.35);
}
.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--pop);
}
.seg {
  background: #0a0d14;
  border: 1px solid var(--line);
}
.seg button[aria-pressed="true"] {
  background: var(--surface-2);
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--pop);
}
.chip {
  border: 1px solid var(--hair);
  background: var(--surface-2);
  color: var(--ink);
}
.chip[aria-pressed="true"] {
  background: var(--pop);
  color: var(--pop-ink);
  border-color: var(--pop);
}
.tag {
  border-width: 1px;
}
textarea,
input[type="text"],
select {
  border: 1px solid var(--hair);
  background: #0c1019;
  color: var(--ink);
}
textarea:focus,
input[type="text"]:focus {
  border-color: var(--pop);
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 182, 39, 0.18);
}
.opt,
.drill {
  border: 1px solid var(--hair);
  background: var(--surface-2);
}
.drill:hover,
.drill[aria-pressed="true"] {
  border-color: var(--pop);
}
.clock {
  color: var(--ink);
}
.clock.big,
#recClock,
#d2Clock,
#prepClock {
  font-family: var(--f-mono);
  font-weight: 700;
  color: var(--pop);
  text-shadow: 0 0 22px rgba(255, 182, 39, 0.45);
}
.clock.over {
  color: var(--red) !important;
  text-shadow: 0 0 22px rgba(255, 77, 94, 0.5) !important;
}
.bar {
  background: #0c1019;
}
.bar i {
  background: var(--pop);
  box-shadow: 0 0 10px var(--pop);
}
.ring span {
  background: var(--surface);
}
.focus {
  border-left: 3px solid var(--pop);
  background: var(--soft);
  border-radius: 0 10px 10px 0;
  padding: 10px 12px;
}
.mic,
.rcell,
.say,
.task {
  background: var(--soft);
}
.arg {
  border: 1px solid var(--hair);
  background: #0f1420;
}
.tabhint {
  color: var(--muted);
}
.speak {
  display: flex;
  gap: 12px;
  align-items: center;
}
.speak .mascot {
  width: 52px;
  height: 48px;
}
.bubble {
  background: var(--soft);
  border: 1px solid var(--hair);
  border-radius: 14px;
  padding: 8px 12px;
  font-weight: 600;
}
.tag.gov {
  color: var(--gov);
}
.tag.opp {
  color: var(--opp);
}
.tip {
  background: #eef2fa;
  color: #0a0d14;
}
.pop {
  background: var(--surface-2);
}
.ficon {
  width: 30px;
  height: 15px;
  flex: none;
  vertical-align: middle;
}
.fmtwrap .seg button,
.fbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
@media (max-width: 480px) {
  .ficon {
    width: 24px;
    height: 12px;
  }
  .fmtwrap .seg button {
    padding: 7px 9px;
  }
}
.legend-teams {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--muted);
}
.gi {
  display: none;
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 1.9;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.rlink {
  color: var(--pop);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.85rem;
}
.rlink:hover {
  text-decoration: underline;
}
.tip .rlink {
  display: inline-block;
  margin-top: 6px;
  color: #9a5b00;
}
.chips a.chip {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.speechcards {
  display: grid;
  gap: 8px;
}
.spc {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  display: grid;
  gap: 6px;
}
.spc-h {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.spc-h b {
  font-weight: 600;
  flex: 1;
  min-width: 0;
}
.spc-n {
  font: 700 0.8rem var(--f-mono);
  color: var(--muted);
  width: 18px;
}
.spc-t {
  font: 600 0.82rem var(--f-mono);
  color: var(--pop);
}
.spc .tips {
  font-size: 0.87rem;
  color: var(--muted);
}
.rsec {
  scroll-margin-top: 16px;
}
.rsec.flash {
  border-color: var(--pop);
  box-shadow: 0 0 0 3px rgba(255, 182, 39, 0.25);
}
.sheet-top {
  position: sticky;
  top: -18px;
  margin: -18px -18px 0;
  padding: 12px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  z-index: 1;
}
.fgrid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.fgrid button {
  justify-content: center;
}
.tabhint {
  display: none;
}
.howto {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #0c1019;
}
.howto summary {
  cursor: pointer;
  color: var(--pop);
  font-weight: 600;
  font-size: 0.9rem;
}
.howto[open] {
  display: grid;
  gap: 10px;
}
.howto .mic {
  margin-top: 8px;
}
.sideseg button {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.15;
  padding: 6px 14px;
}
.sideseg button small {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.8;
}
.dtopic {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 6px;
  font-size: 0.92rem;
}
.dtopic .btn.ghost {
  padding: 2px 6px;
}
.fmtlabel {
  font: 600 0.76rem var(--f-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.fmtpanel .fmtwrap {
  flex-wrap: wrap;
  gap: 10px;
}
.fmtpanel .seg {
  background: #0a0d14;
  border: 1px solid var(--line);
}
.fmtpanel .seg button {
  color: var(--muted);
}
.fmtpanel .seg button[aria-pressed="true"] {
  background: var(--pop);
  color: var(--pop-ink);
  box-shadow: none;
}
.fmtpanel .info {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}
.fmtpanel .pop {
  left: 0;
  right: auto;
}
.arsw {
  justify-self: start;
}
.arsw button {
  padding: 9px 16px;
}
.fmtpanel .tip {
  left: 0;
  right: auto;
}
.ptiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.ptl {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 2px;
  align-content: start;
}
.ptl b {
  font: 700 2rem var(--f-mono);
  color: var(--pop);
  line-height: 1.1;
}
.ptl span {
  font-weight: 600;
}
.ptl small {
  color: var(--muted);
  font-size: 0.8rem;
}
.ptl small.up {
  color: var(--green);
}
.ptl small.down {
  color: var(--red);
}
.cal {
  display: grid;
  gap: 6px;
}
.cds {
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  gap: 4px;
}
.cd {
  aspect-ratio: 1;
  border-radius: 4px;
  background: var(--soft);
  border: 1px solid var(--line);
  max-width: 100%;
}
.cd.on {
  background: rgba(255, 182, 39, 0.45);
  border-color: var(--pop);
}
.cd.hot {
  background: var(--pop);
}
.pchart svg {
  width: 100%;
  height: auto;
  display: block;
}
.pbar {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 80px;
  gap: 10px;
  align-items: center;
  font-size: 0.9rem;
}
.pbar .pv {
  font: 600 0.82rem var(--f-mono);
  text-align: right;
  color: var(--muted);
}
@media (max-width: 560px) {
  .ptiles {
    grid-template-columns: minmax(0, 1fr);
  }
  .ptl {
    grid-template-columns: auto 1fr;
    align-items: baseline;
    column-gap: 10px;
  }
  .ptl small {
    grid-column: 1/-1;
  }
  .pbar {
    grid-template-columns: 110px minmax(0, 1fr) 64px;
  }
}
ol.speeches li.noted .n::after {
  content: " ✎";
  color: var(--pop);
}
.rnote {
  display: grid;
  gap: 6px;
}
.vwin {
  border-radius: 14px;
  padding: 14px 16px;
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  background: var(--soft);
}
.vwin b {
  font: 400 1.6rem var(--f-display);
}
.vwin.sd-gov b {
  color: var(--gov);
}
.vwin.sd-opp b {
  color: var(--opp);
}
.clash {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: start;
  background: var(--soft);
  border-radius: 12px;
  padding: 10px 12px;
}
.clash p {
  grid-column: 1/-1;
}
.spk {
  display: flex;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}
.spk.best {
  border-color: var(--pop);
}
.aisw {
  gap: 8px;
}
.hello {
  position: absolute;
  left: 62px;
  top: 50%;
  z-index: 3;
  background: #f4f6fb;
  color: #0a0d14;
  font: 600 0.95rem var(--f-body);
  padding: 8px 14px;
  border-radius: 16px;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  opacity: 0;
  transform: translate(-8px, -50%) scale(0.6);
  transform-origin: left center;
  transition:
    opacity 0.25s ease,
    transform 0.35s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.hello::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 50%;
  margin-top: -7px;
  border: 7px solid transparent;
  border-left: 0;
  border-right-color: #f4f6fb;
}
.hello.show {
  opacity: 1;
  transform: translate(0, -50%) scale(1);
}
@media (max-width: 640px) {
  .hello {
    left: 52px;
    font-size: 0.85rem;
    padding: 7px 11px;
  }
}
/* ===== Phone ===== */
@media (max-width: 640px) {
  .wrap {
    padding-block: 12px calc(96px + env(safe-area-inset-bottom, 0px));
    gap: 14px;
  }
  .brandbar {
    padding: 12px;
    border-radius: 16px;
    gap: 12px;
  }
  .brand {
    gap: 10px;
  }
  .brand .mascot {
    width: 50px;
    height: 46px;
  }
  .logo {
    font-size: 1.9rem;
  }
  .tagline {
    font-size: 0.8rem;
  }
  .fmtwrap {
    width: 100%;
    flex-wrap: wrap;
    row-gap: 6px;
  }
  .fmtlabel {
    flex-basis: 100%;
  }
  .fmtwrap .seg {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .fw {
    display: flex;
  }
  .fmtwrap .seg button {
    flex: 1;
    flex-direction: column;
    gap: 3px;
    padding: 7px 4px;
    font-size: 0.82rem;
    justify-content: center;
  }
  .ficon {
    width: 26px;
    height: 13px;
  }
  .pop {
    right: 0;
    left: auto;
  }
  .groups {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    border-radius: 0;
    border-width: 1px 0 0;
    gap: 0;
    padding: 6px max(10px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px))
      max(10px, env(safe-area-inset-left, 0px));
    background: rgba(10, 13, 20, 0.94);
    backdrop-filter: blur(10px);
  }
  .group {
    flex-direction: column;
    gap: 3px;
    border-radius: 12px;
    padding: 7px 4px;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
  }
  .gi {
    display: block;
  }
  .group[aria-pressed="true"] {
    box-shadow: none;
  }
  .nav {
    gap: 0;
  }
  .subrow {
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  }
  .stile {
    padding: 10px;
    gap: 6px;
  }
  .stile svg {
    width: 30px;
    height: 30px;
    padding: 6px;
  }
  .stile small {
    display: none;
  }
  .tabhint {
    display: block;
    font-size: 0.85rem;
    margin: 0;
  }
  .panel {
    padding: 14px;
    border-radius: 14px;
  }
  .row > .btn.big {
    flex: 1 1 auto;
  }
  .live {
    gap: 10px;
  }
  .sheet {
    place-items: end center;
    padding: 0;
  }
  .sheet-card {
    border-radius: 20px 20px 0 0;
    max-height: 90vh;
    padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  }
  .hacks {
    grid-template-columns: minmax(0, 1fr);
  }
  .speak .mascot {
    width: 44px;
    height: 40px;
  }
}
/* phrases */
.phtop {
  gap: 10px;
}
.tpl summary {
  cursor: pointer;
  color: var(--pop);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 4px 4px;
}
.tpl[open] {
  display: grid;
  gap: 6px;
}
.phbar {
  display: flex;
  gap: 8px;
}
.phbar input {
  flex: 1;
  min-width: 0;
}
#phFav[aria-pressed="true"] {
  background: var(--pop);
  color: var(--pop-ink);
  border-color: var(--pop);
}
.phcats {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.phcats .chip {
  white-space: nowrap;
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.cnt {
  font: 600 0.72rem var(--f-mono);
  opacity: 0.65;
}
.phwrap {
  display: grid;
  gap: 14px;
}
.phg {
  display: grid;
  gap: 6px;
}
.phg h3 {
  font-size: 0.95rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  padding-left: 4px;
}
.phg.mine {
  background: linear-gradient(180deg, rgba(255, 182, 39, 0.1), transparent);
  border: 1px solid var(--pop);
  border-radius: 16px;
  padding: 12px;
}
.phg.mine h3 {
  color: var(--pop);
}
.phl {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.ph {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 8px 10px 14px;
  font-size: 1rem;
  line-height: 1.45;
}
.ph:hover {
  border-color: var(--hair);
}
.pt {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.slot {
  display: inline-block;
  padding: 0 7px;
  margin: 0 1px;
  border-radius: 6px;
  background: rgba(255, 182, 39, 0.14);
  color: var(--pop);
  font-size: 0.9em;
  border: 1px dashed rgba(255, 182, 39, 0.45);
}
.pa {
  display: flex;
  gap: 2px;
  flex: none;
}
.ib {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.ib svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.9;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ib:hover {
  background: var(--soft);
  color: var(--ink);
}
.ib.on {
  color: var(--pop);
}
.ib.on svg {
  fill: var(--pop);
}
.ib.done {
  color: var(--green);
}
.phn {
  font: 700 0.9rem var(--f-mono);
  color: var(--pop);
  width: 22px;
  flex: none;
}
.cheat .ph {
  font-size: 1.2rem;
  padding: 14px 8px 14px 14px;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(90px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  padding: 9px 16px;
  border-radius: 999px;
  font-weight: 600;
  z-index: 60;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
@media (min-width: 641px) {
  .toast {
    bottom: 24px;
  }
}
@media (max-width: 640px) {
  .phbar {
    flex-direction: row;
  }
  #phFav {
    padding: 8px 10px;
    font-size: 0.85rem;
    white-space: nowrap;
  }
  .ph {
    font-size: 0.97rem;
  }
  .ib {
    width: 40px;
    height: 40px;
  }
}
.mpanel {
  gap: 14px;
}
.mhead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.mtools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.mbody {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #0c1019;
  border: 1px solid var(--line);
}
.mbody .tag {
  justify-self: start;
}
.mhelp summary {
  font-size: 0.85rem;
  color: var(--pop);
  cursor: pointer;
  width: max-content;
}
.mside {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.sideseg button {
  min-width: 150px;
}
.sideseg button.sd-gov[aria-pressed="true"] {
  background: var(--gov);
  color: #fff;
  box-shadow: none;
}
.sideseg button.sd-opp[aria-pressed="true"] {
  background: var(--opp);
  color: #fff;
  box-shadow: none;
}
@media (max-width: 640px) {
  .mtools {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .mtools select {
    grid-column: 1/-1;
  }
  .mtools .btn {
    padding: 10px 6px;
    justify-content: center;
  }
  .mtools .dicebtn {
    gap: 5px;
    font-size: 0.88rem;
  }
  .mtools .dice {
    width: 16px;
    height: 16px;
  }
  .mside .seg {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .sideseg button {
    min-width: 0;
    font-size: 0.85rem;
    padding: 6px 8px;
  }
  .mside {
    display: grid;
    gap: 6px;
  }
  .mside .seg {
    width: 100%;
  }
}
.ticker {
  overflow: hidden;
  border-radius: 12px;
  background: #07090f;
  border: 1px solid var(--line);
  padding: 9px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.ticker-in {
  display: flex;
  gap: 22px;
  width: max-content;
  animation: tick 110s linear infinite;
  font: 400 0.95rem var(--f-display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pop);
  text-shadow: 0 0 10px rgba(255, 182, 39, 0.55);
  white-space: nowrap;
}
.ticker-in i {
  font-style: normal;
  color: var(--opp);
  text-shadow: 0 0 10px rgba(255, 77, 94, 0.6);
}
.ticker-in span:nth-of-type(4n + 2),
.ticker-in span:nth-of-type(4n + 4) {
  color: var(--ink);
  text-shadow: 0 0 8px rgba(238, 242, 250, 0.35);
}
@keyframes tick {
  to {
    transform: translateX(-50%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ticker-in {
    animation: none;
  }
}
.tagline {
  transition:
    opacity 0.3s,
    transform 0.3s;
}
.tagline.out {
  opacity: 0;
  transform: translateY(4px);
}
.motto {
  display: block;
  font: 400 0.82rem var(--f-display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pop);
  margin-bottom: 2px;
}
@media (max-width: 640px) {
  .ticker {
    padding: 7px 0;
  }
  .ticker-in {
    font-size: 0.8rem;
    gap: 16px;
  }
}
.rtick {
  display: grid;
  gap: 6px;
}
.rtick-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ticker.big {
  padding: 14px 0;
}
.ticker.big .ticker-in {
  font: 500 1.1rem var(--f-body);
  letter-spacing: 0;
  text-transform: none;
  gap: 28px;
  color: var(--ink);
  text-shadow: none;
  animation-name: tick2;
}
.ticker.big .ticker-in span:nth-of-type(n) {
  color: var(--ink);
  text-shadow: none;
}
.ticker.big .ticker-in i {
  color: var(--pop);
  text-shadow: 0 0 8px rgba(255, 182, 39, 0.6);
}
@keyframes tick2 {
  to {
    transform: translateX(-50%);
  }
}
.ticker.big:hover .ticker-in,
.ticker-in.paused {
  animation-play-state: paused;
}
@media (prefers-reduced-motion: reduce) {
  .ticker.big {
    overflow-x: auto;
    -webkit-mask-image: none;
    mask-image: none;
  }
}
.foot {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.foot details {
  display: grid;
  gap: 10px;
}
.foot summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.88rem;
}
.foot details[open] {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}
.dice {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  flex: none;
}
.dice circle {
  fill: currentColor;
  stroke: none;
}
.dice.sm {
  width: 13px;
  height: 13px;
}
.dicebtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.dicebtn:active .dice {
  transform: rotate(90deg);
}
.tag.src {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.tag.src[data-src="random"] {
  color: var(--pop);
}
.tag.src[data-src="own"] {
  color: var(--green);
}
.tag.src[data-src="pick"] {
  color: var(--gov);
}
/* rules sheet */
.sheet[hidden],
[hidden] {
  display: none !important;
}
.sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px))
    max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: rgba(5, 7, 12, 0.72);
  backdrop-filter: blur(4px);
}
.sheet-card {
  width: min(760px, 100%);
  max-height: 100%;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--pop);
  border-radius: 18px;
  padding: 18px;
  display: grid;
  gap: 12px;
}
.sheet-card .x {
  justify-self: end;
}
@media (prefers-reduced-motion: reduce) {
  .mascot[data-mood="think"],
  .brand .mascot .m-all,
  .brand .mascot .m-eyes {
    animation: none !important;
  }
}
