@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* Palette and typography from dauia.com. */
:root {
  color-scheme: dark;
  --bg: #0c0f0f;
  --panel: #171c1c;
  --surface-2: #1d2323;
  --edge: rgba(255,255,255,.09);
  --text: #f4f6f5;
  --muted: #9aa3a1;
  --blue: #6c8cff;
  --mint: #8affd1;
  --mono: 'JetBrains Mono', monospace;
  --sans: 'Space Grotesk', system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px var(--sans); -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; }
button { cursor: pointer; color: inherit; border: 0; }
button:disabled { opacity: .4; cursor: not-allowed; }
button, a, textarea { transition: background .2s, border-color .2s, color .2s; }
button:focus-visible, a:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--mint); outline-offset: 4px; }
a { color: inherit; text-decoration: none; }
p { line-height: 1.65; }
header { max-width: 1320px; margin: auto; min-height: 88px; padding: 16px 5vw; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; gap: 12px; align-items: center; font-size: 19px; font-weight: 600; letter-spacing: .1em; }
.brand img { display: block; object-fit: contain; }
nav { display: flex; gap: 24px; align-items: center; }
.nav { background: transparent; padding: 12px 0; color: var(--muted); font-size: 13px; border-bottom: 1px solid transparent; }
.nav:hover, .nav.active { color: var(--text); border-color: var(--blue); }
.landing { min-height: calc(100svh - 88px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 36px 24px 88px; }
.hero-logo { display: block; object-fit: contain; margin-bottom: 28px; }
.landing h1 { font-size: clamp(64px,8vw,108px); font-weight: 500; line-height: .96; letter-spacing: -.065em; margin: 0; }
.landing h1 em { font-style: normal; color: var(--mint); }
.session-length { margin: 28px 0; color: var(--muted); font-size: 14px; }
.session-length span { margin-inline: 8px; }
.start-actions { display: flex; flex-direction: column; gap: 10px; min-width: 210px; }
.primary, .secondary { min-height: 48px; padding: 13px 20px; border: 1px solid transparent; border-radius: 6px; font-size: 14px; font-weight: 500; display: inline-flex; justify-content: center; align-items: center; gap: 24px; }
.primary { color: #0b0e0e; background: var(--blue); }
.primary:hover:not(:disabled) { background: var(--mint); }
.secondary { background: var(--surface-2); border-color: var(--edge); }
.secondary:hover:not(:disabled) { border-color: var(--muted); }
.text-button { padding: 12px 4px; min-height: 44px; background: transparent; color: var(--muted); font-size: 12px; }
.text-button:hover { color: var(--text); }
.eyebrow { font: 11px/1.6 var(--mono); letter-spacing: .08em; color: var(--mint); }
.muted { color: var(--muted); }
.mission { max-width: 1200px; margin: auto; padding: 24px 5vw 40px; }
.mission-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 24px; }
.mission-heading h1 { font-size: 32px; font-weight: 500; letter-spacing: -.045em; margin: 0; }
.round-counter { font: 12px var(--mono); color: var(--muted); white-space: nowrap; }
.stepper { display: flex; align-items: center; gap: 20px; color: var(--muted); font-size: 12px; margin-bottom: 26px; }
.stepper span { display: flex; align-items: center; gap: 9px; }
.stepper b { width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid var(--edge); border-radius: 50%; font: 10px var(--mono); }
.stepper .current { color: var(--text); }
.stepper .current b { background: var(--blue); color: var(--bg); }
.stepper .done b { border-color: var(--mint); color: var(--mint); }
.stepper i { font-style: normal; color: #4c5753; }
.workspace { display: grid; grid-template-columns: 210px minmax(0,1fr); align-items: start; gap: 24px; }
.panel { background: var(--panel); border: 1px solid var(--edge); border-radius: 12px; }
.machine-panel { padding: 24px 20px; }
.machine-panel > img { display: block; margin: 0 auto 18px; object-fit: contain; }
.machine-panel h2 { text-align: center; margin: 0; font-size: 19px; font-weight: 500; }
.ai-state { text-align: center; color: var(--muted); font-size: 12px; margin: 8px 0 24px; }
.module-list { display: flex; flex-direction: column; gap: 17px; padding-top: 22px; border-top: 1px solid var(--edge); }
.mint { --wire: #8affd1; }.blue { --wire: #6c8cff; }.amber { --wire: #e6bf6e; }.pink { --wire: #e897b6; }.violet { --wire: #b3a0fa; }.red { --wire: #f08e7e; }
.module { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.module i { width: 5px; height: 5px; border-radius: 50%; background: var(--wire); }
.module small { margin-left: auto; color: var(--muted); font: 9px var(--mono); }
.module.cut { color: var(--muted); text-decoration: line-through; }
.module.cut small { color: #f08e7e; }
.main-stage { min-width: 0; }
.panel-top { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--edge); font-size: 14px; }
.panel-top > span:last-child { font: 10px var(--mono); color: var(--muted); }
.team-tabs { display: grid; grid-template-columns: repeat(3,1fr); border-bottom: 1px solid var(--edge); }
.team-tabs button { display: flex; align-items: center; justify-content: center; gap: 10px; min-width: 0; background: transparent; border-bottom: 2px solid transparent; padding: 16px 10px; color: var(--muted); font-size: 12px; }
.team-tabs button.selected { color: var(--mint); border-color: var(--mint); background: #8affd106; }
.team-tabs small { font: 10px var(--mono); color: var(--muted); }
.chat-log { height: 270px; overflow-y: auto; padding: 22px; scrollbar-color: #43504a transparent; }
.chat-empty { max-width: 520px; padding: 14px 8px; }
.chat-empty > span { font-size: 52px; line-height: 1; color: var(--mint); }
.chat-empty p { font-size: 23px; line-height: 1.5; margin: 0; letter-spacing: -.025em; }
.message { margin-bottom: 18px; max-width: 94%; padding: 14px 16px; border: 1px solid var(--edge); border-radius: 8px; background: #8affd106; }
.message.user { margin-left: auto; background: #6c8cff0b; }
.message-label { font: 10px var(--mono); color: var(--mint); }
.message-label > span { margin-left: 8px; color: var(--muted); }
.message p { font-size: 14px; margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-bottom { padding: 18px 22px; border-top: 1px solid var(--edge); }
.suggestions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.suggestions button { font-size: 12px; padding: 9px 11px; border: 1px solid var(--edge); border-radius: 6px; color: var(--muted); background: transparent; text-align: left; }
.suggestions button:hover:not(:disabled) { border-color: var(--mint); color: var(--text); }
#chat-form { display: flex; align-items: center; gap: 8px; padding: 6px; border: 1px solid #ffffff2e; border-radius: 8px; background: var(--bg); }
textarea { width: 100%; resize: vertical; padding: 14px; color: var(--text); border: 1px solid #ffffff2e; border-radius: 6px; background: var(--bg); font-size: 15px; line-height: 1.5; }
#question { border: 0; background: transparent; resize: none; min-width: 0; padding: 8px; }
.send { width: 44px; height: 44px; flex-shrink: 0; background: var(--blue); color: var(--bg); border-radius: 6px; font-size: 23px; }
.action-bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 20px; }
.stage-card { padding: 32px; }
.stage-card h2 { font-size: 34px; line-height: 1.15; font-weight: 500; letter-spacing: -.045em; margin: 15px 0 24px; }
.stage-card .lead { font-size: 18px; line-height: 1.65; color: #e2e8e5; }
.stage-card > p:not(.lead) { color: var(--muted); }
.stage-card > .primary { margin-top: 22px; }
.stage-card > .text-button { margin-left: 16px; }
.stage-card label { display: block; font-size: 13px; margin: 26px 0 12px; }
.brief-rules { display: flex; gap: 30px; padding: 26px 0 0; margin-top: 24px; border-top: 1px solid var(--edge); }
.brief-rules span { display: flex; align-items: center; gap: 10px; }
.brief-rules b { font: 11px var(--mono); color: var(--mint); }
.archive { border-left: 2px solid var(--mint); background: #8affd106; padding: 22px; margin: 26px 0; }
.archive-top { font: 11px/1.6 var(--mono); color: var(--mint); }
.archive blockquote { margin: 18px 0 0; font-size: 18px; line-height: 1.7; }
.archive b { color: var(--mint); font-weight: 500; }
.archive p { margin-bottom: 0; }
.hypothesis { border-left: 2px solid #ffffff2e; padding-left: 18px; }
.hypothesis > span { color: var(--muted); font-size: 12px; }
.hypothesis p { white-space: pre-wrap; overflow-wrap: anywhere; }
.wire-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 26px 0 18px; }
.wire-card { min-width: 0; padding: 20px; border: 1px solid color-mix(in srgb,var(--wire) 35%,transparent); border-radius: 8px; background: var(--bg); }
.wire-card h3 { font-size: 23px; font-weight: 500; margin: 10px 0 22px; letter-spacing: -.035em; overflow-wrap: anywhere; }
.wire-card p { font-size: 13px; color: var(--muted); margin-bottom: 0; }
.wire-card b { display: block; font-weight: 500; color: var(--text); margin-bottom: 4px; }
.wire-illustration { display: flex; align-items: center; height: 36px; margin-bottom: 10px; }
.wire-illustration i { height: 2px; flex: 1; background: var(--wire); }
.wire-illustration span { color: var(--wire); padding: 0 12px; font-size: 25px; }
.ballot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--edge); }
.ballot > strong { font: 11px var(--mono); }
.ballot > div { display: flex; gap: 7px; }
.ballot button { font-size: 12px; padding: 10px 12px; min-height: 42px; border: 1px solid #ffffff2e; border-radius: 5px; background: transparent; }
.ballot button.selected { color: var(--mint); border-color: var(--mint); background: #8affd10b; }
.consequence { text-align: center; }
.cut-symbol { font-size: 45px; color: var(--wire); margin: 8px 0 20px; }
.consequence blockquote { margin: 24px 0; font-size: 21px; line-height: 1.65; color: var(--wire); }
.consequence-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; text-align: left; border-top: 1px solid var(--edge); margin-top: 28px; padding-top: 10px; }
.consequence-facts p { font-size: 14px; color: var(--muted); }
.consequence-facts span { display: block; color: var(--text); margin-bottom: 8px; }
.session-footer { display: flex; justify-content: flex-end; margin-top: 10px; }
.restart-confirm { padding: 22px; }
.restart-confirm button { margin-right: 12px; }
.ending-path { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 28px 0; }
.ending-path span { border: 1px solid #8affd133; background: #8affd106; border-radius: 5px; color: var(--mint); padding: 9px 12px; font-size: 12px; }
.ending-path i { color: var(--muted); font-style: normal; }
.ending h3 { font-size: 25px; font-weight: 500; letter-spacing: -.03em; margin-bottom: 12px; }
.history { margin-top: 28px; font-size: 13px; overflow-wrap: anywhere; }
summary { cursor: pointer; color: var(--muted); }
.tree-page { max-width: 1320px; margin: auto; padding: 40px 5vw; }
.tree-page h1, .rules-page h1 { font-size: 44px; font-weight: 500; letter-spacing: -.045em; line-height: 1.15; margin: 16px 0 30px; }
.tree-legend { display: flex; gap: 24px; font-size: 12px; color: var(--muted); margin-bottom: 28px; }
.tree-legend span:first-child { color: var(--mint); }
.tree-scroll { overflow-x: auto; padding: 26px 8px 36px; border-block: 1px solid var(--edge); margin-bottom: 30px; }
.tree-root { font: 12px var(--mono); color: var(--mint); border: 1px solid var(--mint); padding: 14px 24px; width: max-content; margin: 0 auto 28px; }
.tree, .tree ul { display: flex; list-style: none; margin: 0; padding: 0; justify-content: center; }
.tree { min-width: 1100px; }
.tree li { flex: 1; min-width: 0; text-align: center; position: relative; padding: 24px 4px 0; }
.tree li:before { content: ''; position: absolute; left: 0; right: 0; top: 0; border-top: 1px solid #43504a; }
.tree li:after { content: ''; position: absolute; left: 50%; top: 0; height: 24px; border-left: 1px solid #43504a; }
.tree-node { display: inline-block; position: relative; padding: 12px; margin-bottom: 24px; border: 1px solid #43504a; background: var(--panel); border-radius: 5px; font-size: 12px; }
.tree-node > span { margin-right: 5px; }
.tree .chosen > .tree-node, .tree-leaf.chosen > span { border-color: var(--mint); color: var(--mint); background: #8affd10b; }
.tree .missed { color: var(--muted); }
.tree-leaf > span { display: block; min-height: 66px; border: 1px solid var(--edge); border-radius: 5px; padding: 12px 7px; font-size: 12px; line-height: 1.5; }
.tree-leaf small { display: block; margin-top: 10px; font-size: 10px; color: var(--muted); }
.rules-page { max-width: 670px; margin: auto; padding: 50px 24px; }
.rules { list-style: none; counter-reset: rule; padding: 0; margin: 30px 0; }
.rules li { counter-increment: rule; position: relative; padding: 22px 0 22px 46px; border-bottom: 1px solid var(--edge); }
.rules li:before { content: '0' counter(rule); position: absolute; left: 0; top: 27px; font: 12px var(--mono); color: var(--mint); }
.rules h2 { margin: 0 0 8px; font-size: 21px; font-weight: 500; }
.rules p { margin: 0; color: var(--muted); }
.rules-page > .primary { margin-top: 16px; }
.game-details { margin-top: 36px; font-size: 12px; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%,20px); max-width: min(90vw,600px); padding: 16px 22px; background: var(--surface-2); border: 1px solid #8affd166; border-radius: 8px; z-index: 100; opacity: 0; pointer-events: none; transition: .2s; font-size: 14px; box-shadow: 0 8px 40px #0008; }
#toast.visible { opacity: 1; transform: translate(-50%,0); }
@media (max-width: 900px) {
  .workspace { grid-template-columns: 170px minmax(0,1fr); gap: 18px; }
  .machine-panel { padding-inline: 14px; }
  .stage-card { padding: 25px; }
  .ballot { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 650px) {
  header { min-height: 76px; padding: 14px 20px; gap: 15px; flex-wrap: wrap; }
  .brand { font-size: 16px; gap: 8px; }
  .brand img { width: 36px; height: 36px; }
  nav { gap: 18px; }
  .nav { font-size: 12px; }
  .landing { min-height: calc(100svh - 76px); padding-bottom: 76px; }
  .hero-logo { width: 96px; height: 96px; margin-bottom: 26px; }
  .landing h1 { font-size: clamp(60px,16vw,88px); }
  .mission { padding: 20px 20px 32px; }
  .mission-heading { gap: 12px; align-items: flex-start; }
  .mission-heading h1 { font-size: 26px; }
  .round-counter { font-size: 10px; padding-top: 7px; }
  .stepper { justify-content: space-between; gap: 8px; font-size: 11px; }
  .stepper span { gap: 5px; }.stepper i { display: none; }
  .stepper b { width: 22px; height: 22px; font-size: 9px; }
  .workspace { grid-template-columns: 1fr; gap: 16px; }
  .machine-panel { display: grid; grid-template-columns: 44px 1fr; gap: 0 12px; padding: 14px 16px; }
  .machine-panel > img { width: 44px; height: 44px; grid-row: 1/3; margin: 0; }
  .machine-panel h2 { text-align: left; font-size: 16px; align-self: end; }
  .machine-panel .ai-state { text-align: left; font-size: 11px; margin: 5px 0 0; }
  .module-list { grid-column: 1/-1; flex-direction: row; flex-wrap: wrap; gap: 12px; margin-top: 14px; padding-top: 14px; }
  .module { font-size: 10px; gap: 5px; }.module small { display: none; }
  .stage-card { padding: 22px; }
  .stage-card h2 { font-size: 29px; }
  .stage-card .lead { font-size: 16px; }
  .stage-card > .text-button { margin-left: 0; display: block; }
  .brief-rules { justify-content: space-between; gap: 12px; font-size: 13px; }
  .brief-rules span { gap: 7px; }
  .team-tabs button { font-size: 11px; gap: 7px; padding: 14px 6px; }
  .team-tabs small { font-size: 9px; }
  .chat-log { height: 250px; padding: 18px; }
  .chat-empty p { font-size: 20px; }
  .chat-bottom { padding: 16px; }
  .suggestions button { font-size: 11px; }
  textarea { font-size: 16px; }
  .action-bar { gap: 14px; }.action-bar .text-button { font-size: 11px; text-align: left; }
  .archive { padding: 18px; }.archive blockquote { font-size: 16px; }
  .wire-choices { gap: 10px; }.wire-card { padding: 14px; }
  .wire-card h3 { font-size: 21px; }.wire-card p { font-size: 12px; }
  .ballot > div { width: 100%; flex-wrap: wrap; }.ballot button { flex: 1; padding: 10px 8px; font-size: 11px; }
  .consequence blockquote { font-size: 18px; }.consequence-facts { gap: 16px; }
  .tree-page { padding: 26px 20px; }.tree-page h1, .rules-page h1 { font-size: 36px; }
  .tree-legend { gap: 16px; font-size: 11px; }.rules-page { padding-top: 30px; }
}
@media (max-width: 380px) {
  header { gap: 8px; } nav { gap: 12px; }.brand span { display: none; }
  .wire-choices, .consequence-facts { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { animation: none!important; transition: none!important; scroll-behavior: auto!important; }
}
