:root {
  color-scheme: dark;
  --bg: #0d1416;
  --bg-deep: #080d0f;
  --panel: rgba(21, 31, 34, 0.92);
  --panel-soft: rgba(27, 40, 43, 0.78);
  --line: rgba(183, 220, 215, 0.13);
  --line-strong: rgba(183, 220, 215, 0.24);
  --text: #edf4ef;
  --muted: #94a7a4;
  --faint: #677b78;
  --teal: #72d0bf;
  --teal-dark: #173e39;
  --amber: #e6b66a;
  --amber-dark: #4b351b;
  --red: #e5847f;
  --red-dark: #4b2424;
  --blue: #82b8de;
  --blue-dark: #21384b;
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
  --font-sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-serif: "Noto Serif SC", "Songti SC", STSong, SimSun, serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg-deep);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 2%, rgba(36, 89, 81, 0.2), transparent 34rem),
    radial-gradient(circle at 92% 18%, rgba(105, 70, 35, 0.13), transparent 30rem),
    linear-gradient(145deg, #0c1214 0%, #10191c 48%, #0b1113 100%);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
[role="radio"]:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

.ambient {
  position: fixed;
  z-index: -2;
  width: 34rem;
  height: 34rem;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  opacity: 0.3;
}

.ambient-one {
  top: 16%;
  left: -18rem;
  background: #287164;
}

.ambient-two {
  right: -18rem;
  bottom: 5%;
  background: #7b5026;
}

.grid-noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.12;
  background-image:
    linear-gradient(rgba(180, 218, 212, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(180, 218, 212, 0.08) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  padding: 12px max(22px, env(safe-area-inset-right)) 12px max(22px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
  background: rgba(8, 13, 15, 0.68);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  color: var(--amber);
  font-family: var(--font-serif);
  font-size: 22px;
}

.brand-mark::before,
.brand-mark i {
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(230, 182, 106, 0.58);
  content: "";
  transform: rotate(45deg);
}

.brand-mark i {
  inset: 1px;
  border-color: rgba(230, 182, 106, 0.16);
}

.brand-mark b {
  position: relative;
  z-index: 1;
  font-weight: 500;
}

.brand > span:last-child {
  display: grid;
  gap: 2px;
}

.brand strong {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.brand small {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.25em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-actions a,
.header-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease, transform 180ms ease;
}

.header-actions a:hover,
.header-actions button:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}

.header-actions .round-button {
  width: 38px;
  padding: 0;
  color: var(--amber);
  font-weight: 700;
}

.header-actions .home-link {
  color: var(--text);
}

.app-shell {
  width: min(1500px, calc(100% - 38px));
  margin: 0 auto;
  padding: 48px 0 72px;
}

.intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin: 0 auto 30px;
  padding: 0 4px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--amber);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.intro h1 {
  max-width: 820px;
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(34px, 4vw, 58px);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: 0.03em;
}

.intro > div:first-child > p:last-child {
  max-width: 760px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.mode-pill {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 9px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 12px;
}

.mode-pill span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 15px rgba(114, 208, 191, 0.72);
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 410px);
  align-items: start;
  gap: 22px;
}

.play-card,
.evidence-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(24, 35, 38, 0.96), rgba(14, 22, 24, 0.96));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.play-card {
  min-width: 0;
}

.session-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 82px;
  padding: 17px 22px;
  border-bottom: 1px solid var(--line);
}

.session-identity,
.session-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.domain-symbol {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(230, 182, 106, 0.26);
  border-radius: 14px;
  color: var(--amber);
  background: rgba(230, 182, 106, 0.08);
  font-family: var(--font-serif);
  font-size: 22px;
}

.session-identity > div {
  display: grid;
  gap: 4px;
}

.session-identity small,
.surface-meta small,
.surface-stats small,
.save-status small,
.evidence-title small {
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.session-identity strong {
  font-size: 15px;
  font-weight: 600;
}

.session-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.session-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--faint);
}

.session-state.is-playing i {
  background: var(--teal);
  box-shadow: 0 0 12px rgba(114, 208, 191, 0.66);
}

.session-state.is-finished i {
  background: var(--amber);
  box-shadow: 0 0 12px rgba(230, 182, 106, 0.5);
}

.session-actions button,
.secondary-button,
.primary-button,
.finished-panel button {
  min-height: 39px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  transition: 170ms ease;
}

.session-actions button:hover,
.secondary-button:hover,
.finished-panel button:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.07);
}

.soup-surface {
  position: relative;
  margin: 22px;
  overflow: hidden;
  border: 1px solid rgba(230, 182, 106, 0.21);
  border-radius: 22px;
  background:
    radial-gradient(circle at 82% 18%, rgba(230, 182, 106, 0.13), transparent 18rem),
    linear-gradient(135deg, rgba(77, 54, 30, 0.38), rgba(18, 31, 32, 0.88));
}

.soup-surface::after {
  position: absolute;
  top: -78px;
  right: -48px;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(230, 182, 106, 0.08);
  border-radius: 50%;
  content: "";
  box-shadow: 0 0 0 38px rgba(230, 182, 106, 0.025), 0 0 0 76px rgba(230, 182, 106, 0.018);
}

.surface-meta {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(230, 182, 106, 0.13);
}

.surface-meta > span {
  color: var(--amber);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.surface-content {
  position: relative;
  z-index: 1;
  min-height: 220px;
  padding: 46px 8% 34px;
}

.quote-mark {
  position: absolute;
  top: 19px;
  left: 5%;
  color: rgba(230, 182, 106, 0.3);
  font-family: Georgia, serif;
  font-size: 74px;
  line-height: 1;
}

.surface-content h2 {
  max-width: 790px;
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(25px, 3vw, 40px);
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: 0.06em;
}

.surface-content p {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.surface-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid rgba(230, 182, 106, 0.13);
}

.surface-stats > div {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  border-right: 1px solid rgba(230, 182, 106, 0.1);
}

.surface-stats > div:last-child {
  border-right: 0;
}

.surface-stats strong {
  color: var(--amber);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.suggestion-strip {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 0 22px 20px;
}

.suggestion-strip > span {
  flex: 0 0 auto;
  padding-top: 8px;
  color: var(--faint);
  font-size: 11px;
}

.suggestion-strip > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.suggestion-strip button {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.022);
  font-size: 11px;
  cursor: pointer;
  transition: 160ms ease;
}

.suggestion-strip button:hover:not(:disabled) {
  color: var(--teal);
  border-color: rgba(114, 208, 191, 0.34);
  background: rgba(114, 208, 191, 0.07);
}

.suggestion-strip button:disabled {
  cursor: default;
  opacity: 0.45;
}

.history-section {
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 16px;
}

.section-heading .eyebrow {
  margin-bottom: 5px;
  color: var(--teal);
}

.section-heading h2,
.evidence-title h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.section-heading > span {
  color: var(--faint);
  font-size: 11px;
}

.history-list {
  min-height: 250px;
  max-height: 430px;
  padding: 0 22px 22px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(114, 208, 191, 0.25) transparent;
}

.empty-history {
  display: grid;
  place-items: center;
  min-height: 220px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--faint);
  text-align: center;
}

.empty-history span {
  margin-bottom: -10px;
  color: rgba(114, 208, 191, 0.38);
  font-size: 42px;
}

.empty-history strong {
  color: var(--muted);
  font-size: 14px;
}

.empty-history p {
  max-width: 350px;
  margin: -12px 20px 0;
  font-size: 12px;
  line-height: 1.6;
}

.history-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.history-item:last-child {
  border-bottom: 0;
}

.history-index {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--faint);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.history-copy {
  min-width: 0;
}

.history-copy p {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.history-copy small {
  display: block;
  margin-top: 4px;
  color: var(--faint);
  font-size: 10px;
}

.answer-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.answer-chip.yes {
  color: var(--teal);
  border-color: rgba(114, 208, 191, 0.28);
  background: rgba(114, 208, 191, 0.08);
}

.answer-chip.no {
  color: var(--red);
  border-color: rgba(229, 132, 127, 0.26);
  background: rgba(229, 132, 127, 0.08);
}

.answer-chip.unknown {
  color: var(--blue);
  border-color: rgba(130, 184, 222, 0.25);
  background: rgba(130, 184, 222, 0.08);
}

.answer-chip.correct {
  color: var(--amber);
  border-color: rgba(230, 182, 106, 0.32);
  background: rgba(230, 182, 106, 0.1);
}

.composer {
  margin: 0 22px 22px;
  padding: 17px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: rgba(7, 13, 15, 0.55);
  transition: border-color 160ms ease, opacity 160ms ease;
}

.composer:focus-within {
  border-color: rgba(114, 208, 191, 0.52);
}

.composer.is-disabled {
  opacity: 0.58;
}

.composer > label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.composer textarea {
  display: block;
  width: 100%;
  min-height: 62px;
  padding: 4px 0;
  resize: vertical;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 15px;
  line-height: 1.65;
}

.composer textarea::placeholder {
  color: #536764;
}

.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 9px;
}

.composer-footer > span {
  color: var(--faint);
  font-size: 10px;
}

.composer-footer > div {
  display: flex;
  gap: 8px;
}

.composer-footer button {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: 160ms ease;
}

.guess-button {
  border: 1px solid rgba(230, 182, 106, 0.24);
  color: var(--amber);
  background: rgba(230, 182, 106, 0.07);
}

.ask-button {
  border: 1px solid var(--teal);
  color: #09211e;
  background: var(--teal);
  font-weight: 700;
}

.ask-button span {
  margin-left: 7px;
}

.composer-footer button:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

button:disabled,
textarea:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.finished-panel {
  margin: 0 22px 22px;
  padding: 28px;
  border: 1px solid rgba(230, 182, 106, 0.3);
  border-radius: 20px;
  background:
    radial-gradient(circle at 82% 16%, rgba(230, 182, 106, 0.13), transparent 14rem),
    rgba(65, 45, 24, 0.25);
}

.finished-panel[hidden] {
  display: none;
}

.finished-panel h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 500;
}

.finished-panel .answer-name {
  margin: 18px 0 7px;
  color: var(--amber);
  font-family: var(--font-serif);
  font-size: 22px;
}

.finished-panel > p:not(.eyebrow):not(.answer-name) {
  max-width: 720px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.finished-panel button {
  margin-top: 8px;
}

.evidence-card {
  position: sticky;
  top: 18px;
}

.save-status {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 14, 16, 0.32);
}

.save-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(114, 208, 191, 0.23);
  border-radius: 13px;
  color: var(--teal);
  background: rgba(114, 208, 191, 0.06);
}

.save-status > div:nth-child(2) {
  min-width: 0;
}

.save-status strong {
  display: block;
  margin-top: 3px;
  font-size: 13px;
}

.save-status p {
  margin: 4px 0 0;
  color: var(--faint);
  font-size: 9px;
  line-height: 1.4;
}

.lock-chip {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--faint);
  font-size: 9px;
}

.lock-chip.is-owner {
  color: var(--teal);
  border-color: rgba(114, 208, 191, 0.25);
  background: rgba(114, 208, 191, 0.05);
}

.lock-chip.is-readonly {
  color: var(--amber);
  border-color: rgba(230, 182, 106, 0.25);
  background: rgba(230, 182, 106, 0.05);
}

.evidence-section {
  padding: 19px 18px;
  border-bottom: 1px solid var(--line);
}

.evidence-title {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 12px;
}

.evidence-title > div {
  display: grid;
  gap: 3px;
}

.answer-dot {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid;
  border-radius: 11px;
  font-size: 11px;
  font-weight: 800;
}

.answer-dot.yes {
  color: var(--teal);
  border-color: rgba(114, 208, 191, 0.27);
  background: rgba(114, 208, 191, 0.07);
}

.answer-dot.no {
  color: var(--red);
  border-color: rgba(229, 132, 127, 0.27);
  background: rgba(229, 132, 127, 0.07);
}

.answer-dot.unknown {
  color: var(--blue);
  border-color: rgba(130, 184, 222, 0.27);
  background: rgba(130, 184, 222, 0.07);
}

.evidence-list {
  display: grid;
  gap: 7px;
  max-height: 170px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.evidence-list li:not(.empty-record) {
  position: relative;
  padding: 9px 10px 9px 25px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.018);
  font-size: 11px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.evidence-list li:not(.empty-record)::before {
  position: absolute;
  top: 14px;
  left: 11px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  content: "";
  background: var(--faint);
}

.yes-section .evidence-list li::before { background: var(--teal); }
.no-section .evidence-list li::before { background: var(--red); }
.unknown-section .evidence-list li::before { background: var(--blue); }

.empty-record {
  padding: 8px 0;
  color: var(--faint);
  font-size: 10px;
  font-style: italic;
}

.record-tools {
  padding: 18px;
}

.section-heading.compact {
  padding: 0 0 9px;
}

.record-tools > p {
  margin: 0 0 13px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tool-grid button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 11px;
  cursor: pointer;
  transition: 160ms ease;
}

.tool-grid button span {
  margin-right: 5px;
  color: var(--teal);
}

.tool-grid button:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.055);
}

.tool-grid .reveal-button {
  grid-column: 1 / -1;
  color: var(--red);
  border-color: rgba(229, 132, 127, 0.16);
  background: rgba(229, 132, 127, 0.035);
}

.tool-grid .reveal-button span {
  color: var(--red);
}

.privacy-note {
  display: block;
  margin-top: 11px;
  color: var(--faint);
  font-size: 9px;
  line-height: 1.5;
}

.modal {
  width: min(760px, calc(100% - 28px));
  max-height: min(88vh, 820px);
  max-height: min(88dvh, 820px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  color: var(--text);
  background: linear-gradient(145deg, #172326, #0f1719);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.62);
}

.modal::backdrop {
  background: rgba(2, 6, 7, 0.78);
  backdrop-filter: blur(10px);
}

.modal form {
  position: relative;
  padding: 31px;
}

.dialog-close {
  position: absolute;
  top: 17px;
  right: 17px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  font-size: 21px;
  cursor: pointer;
}

.modal h2 {
  margin: 0;
  padding-right: 40px;
  font-family: var(--font-serif);
  font-size: clamp(27px, 4vw, 38px);
  font-weight: 500;
}

.dialog-lead {
  max-width: 620px;
  margin: 13px 0 22px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.domain-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.domain-option {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 11px;
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.018);
  cursor: pointer;
  transition: 170ms ease;
}

.domain-option:hover,
.domain-option.is-selected {
  border-color: rgba(114, 208, 191, 0.42);
  background: rgba(114, 208, 191, 0.07);
}

.domain-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.domain-option > span:first-of-type {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(230, 182, 106, 0.22);
  border-radius: 12px;
  color: var(--amber);
  background: rgba(230, 182, 106, 0.05);
  font-family: var(--font-serif);
  font-size: 20px;
}

.domain-option > span:nth-of-type(2) {
  display: grid;
  gap: 4px;
}

.domain-option strong {
  font-size: 13px;
}

.domain-option small {
  color: var(--faint);
  font-size: 9px;
  line-height: 1.45;
}

.domain-option .radio-mark {
  width: 14px;
  height: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px #142023;
}

.domain-option.is-selected .radio-mark {
  border-color: var(--teal);
  background: var(--teal);
}

.replace-warning {
  margin: 15px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(230, 182, 106, 0.18);
  border-radius: 10px;
  color: var(--amber);
  background: rgba(230, 182, 106, 0.05);
  font-size: 10px;
}

.replace-warning[hidden] {
  display: none;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 22px;
}

.primary-button {
  border-color: var(--teal);
  color: #08221e;
  background: var(--teal);
  font-weight: 700;
}

.primary-button:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.full-button {
  width: 100%;
  margin-top: 20px;
}

.guess-dialog {
  width: min(540px, calc(100% - 28px));
}

.guess-dialog label {
  display: block;
  margin: 18px 0 7px;
  color: var(--muted);
  font-size: 11px;
}

.guess-dialog input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  outline: 0;
  color: var(--text);
  background: rgba(4, 9, 10, 0.5);
}

.guess-dialog input:focus {
  border-color: var(--teal);
}

.rule-list {
  display: grid;
  gap: 9px;
  margin-top: 22px;
}

.rule-list article {
  display: grid;
  grid-template-columns: 39px 1fr;
  gap: 13px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.018);
}

.rule-list article > span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: var(--amber);
  background: rgba(230, 182, 106, 0.07);
  font-size: 10px;
  font-weight: 700;
}

.rule-list h3 {
  margin: 1px 0 5px;
  font-size: 13px;
}

.rule-list p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  max-width: min(520px, calc(100% - 28px));
  padding: 11px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text);
  background: rgba(15, 24, 26, 0.96);
  box-shadow: 0 14px 50px rgba(0, 0, 0, 0.36);
  font-size: 11px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 18px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.is-error {
  color: #ffd2d0;
  border-color: rgba(229, 132, 127, 0.32);
  background: rgba(61, 27, 27, 0.96);
}

.noscript {
  position: fixed;
  inset: auto 20px 20px;
  z-index: 120;
  padding: 14px;
  border: 1px solid var(--red);
  border-radius: 12px;
  color: #ffd6d4;
  background: #3d1d1d;
  text-align: center;
}

@media (max-width: 1120px) {
  .game-layout {
    grid-template-columns: minmax(0, 1fr) 340px;
  }

  .header-actions > a:not(.home-link) {
    display: none;
  }

  .surface-content {
    min-height: 200px;
  }
}

@media (max-width: 900px) {
  .app-shell {
    width: min(100% - 24px, 760px);
    padding-top: 34px;
  }

  .intro {
    align-items: flex-start;
  }

  .mode-pill {
    display: none;
  }

  .game-layout {
    grid-template-columns: 1fr;
  }

  .evidence-card {
    position: static;
  }

  .evidence-section {
    padding: 17px;
  }

  .evidence-list {
    max-height: 210px;
  }
}

@media (max-width: 620px) {
  .site-header {
    min-height: 66px;
    padding: 10px max(13px, env(safe-area-inset-right)) 10px max(13px, env(safe-area-inset-left));
  }

  .brand-mark {
    flex-basis: 38px;
    width: 38px;
    height: 38px;
  }

  .brand strong {
    font-size: 14px;
  }

  .brand small {
    font-size: 7px;
  }

  .header-actions .home-link {
    width: 38px;
    padding: 0;
    font-size: 0;
  }

  .header-actions .home-link::before {
    content: "⌂";
    font-size: 17px;
  }

  .app-shell {
    width: calc(100% - 16px);
    padding: 26px 0 max(44px, env(safe-area-inset-bottom));
  }

  .intro {
    margin-bottom: 20px;
    padding: 0 6px;
  }

  .intro h1 {
    font-size: 32px;
  }

  .intro > div:first-child > p:last-child {
    margin-top: 13px;
    font-size: 12px;
  }

  .play-card,
  .evidence-card {
    border-radius: 21px;
  }

  .session-header {
    align-items: flex-start;
    min-height: 74px;
    padding: 14px;
  }

  .session-actions {
    align-items: flex-end;
    flex-direction: column-reverse;
    gap: 6px;
  }

  .session-state {
    font-size: 9px;
  }

  .session-actions button {
    min-height: 34px;
    padding: 0 11px;
    font-size: 11px;
  }

  .domain-symbol {
    width: 40px;
    height: 40px;
  }

  .soup-surface {
    margin: 13px;
    border-radius: 17px;
  }

  .surface-meta {
    padding: 13px 14px;
  }

  .surface-content {
    min-height: 190px;
    padding: 40px 7% 28px;
  }

  .surface-content h2 {
    font-size: 25px;
    line-height: 1.5;
  }

  .surface-stats > div {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 2px;
    min-height: 61px;
  }

  .suggestion-strip {
    display: block;
    padding: 0 14px 15px;
    overflow: hidden;
  }

  .suggestion-strip > span {
    display: block;
    padding: 0 0 7px;
  }

  .suggestion-strip > div {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 3px;
    scrollbar-width: none;
  }

  .suggestion-strip button {
    flex: 0 0 auto;
  }

  .section-heading {
    padding: 19px 16px 13px;
  }

  .history-list {
    max-height: 390px;
    padding: 0 14px 16px;
  }

  .history-item {
    grid-template-columns: 29px minmax(0, 1fr);
    gap: 9px;
  }

  .answer-chip {
    grid-column: 2;
    justify-self: start;
    min-width: 58px;
    min-height: 29px;
    font-size: 10px;
  }

  .composer {
    margin: 0 13px 13px;
    padding: 14px;
  }

  .composer-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .composer-footer > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .composer-footer button {
    padding: 0 10px;
    font-size: 11px;
  }

  .finished-panel {
    margin: 0 13px 13px;
    padding: 22px;
  }

  .save-status {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .lock-chip {
    grid-column: 2;
    justify-self: start;
  }

  .domain-grid {
    grid-template-columns: 1fr;
  }

  .modal form {
    padding: 25px 18px 20px;
  }

  .dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .dialog-actions button {
    width: 100%;
  }
}

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