/* world.css, for the room: the browser world's stylesheet (the open-source repository, world/browser/world.css,
   SHA-256 bea45181ce598ac4b709e1f668a209f3bd69c6ad900bfc0851542a3b239f6f13), scoped by aiethics.global's tools/build.py (world_css)
   so that every rule reaches only inside #world. Built, not edited: change the source, copy it again
   (world_to_aiethics.py), and build. */

#world {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --ink: #1a1a1a;
  --ink-2: #52514e;
  --muted: #6f6e69;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.12);
  --focus: #2a78d6;
  --type-c: #2a78d6;
  --type-u: #1baf7a;
  --type-d: #eb6834;
  --ruined: #a9a8a2;
  --ruined-ink: #6f6e69;
  --on-type: #ffffff;
  --link: #52514e;
  --s1: #2a78d6;
  --s2: #eb6834;
  --boundary: #0b0b0b;
  --region: #898781;
  --tip-bg: #ffffff;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.10);
}

#world[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --ink: #f0efec;
  --ink-2: #c3c2b7;
  --muted: #9a9993;
  --grid: #2c2c2a;
  --axis: #4a4a46;
  --border: rgba(255, 255, 255, 0.12);
  --focus: #6da7ec;
  --type-c: #3987e5;
  --type-u: #199e70;
  --type-d: #d95926;
  --ruined: #4a4a46;
  --ruined-ink: #9a9993;
  --on-type: #ffffff;
  --link: #c3c2b7;
  --s1: #3987e5;
  --s2: #d95926;
  --boundary: #f0efec;
  --region: #9a9993;
  --tip-bg: #242423;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

#world, #world *, #world::before, #world *::before, #world::after, #world *::after { box-sizing: border-box; }

#world { -webkit-text-size-adjust: 100%; }

#world {
  color: var(--ink);
  font: 16px/1.5 var(--f);
  overflow-wrap: anywhere;
}

#world p { margin: 0 0 12px; }

#world b { font-weight: 650; }

#world .muted { color: var(--muted); }

#world button, #world select, #world input { font: inherit; color: inherit; }

#world button {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 14px;
  min-height: 36px;
  cursor: pointer;
}

#world button:hover { border-color: var(--ink-2); }

#world button.small { padding: 2px 10px; min-height: 30px; font-size: 1rem; }

#world button[aria-pressed="true"].small { background: var(--ink); color: var(--page); border-color: var(--ink); }

#world :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

#world select, #world input[type="number"] {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 8px;
  min-height: 34px;
}

#world .tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 16px; }

#world .tabs [role="tab"] {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  padding: 8px 10px;
  color: var(--ink-2);
}

#world .tabs [role="tab"][aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }

#world .world-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }

@media (min-width: 820px) {
  #world .world-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
}

#world .stage { display: flex; flex-direction: column; }

#world .stage svg#ring {
  order: -1;
  display: block;
  width: 100%;
  max-width: 520px;
  height: auto;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  touch-action: manipulation;
}

#world .runbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 6px; }

#world .runbar .speed { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 1rem; }

#world .runbar output { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--ink-2); }

#world .hint { color: var(--ink-2); font-size: 1rem; margin: 4px 0 6px; }

#world .key { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 1rem; color: var(--ink-2); }

#world .key li { display: inline-flex; align-items: center; gap: 6px; }

#world .key .dash { display: inline-block; width: 18px; border-top: 1.5px dashed var(--muted); }

#world .chip {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 4px;
  border-radius: 11px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--on-type);
  background: var(--ruined);
}

#world .chip.type-c { background: var(--type-c); }

#world .chip.type-u { background: var(--type-u); }

#world .chip.type-d { background: var(--type-d); }

#world .chip.ruined { color: var(--ruined-ink); background: var(--grid); }

#world tr.ruined .chip { background: var(--ruined); }

#world button.chip.op-type { min-width: 24px; height: 24px; min-height: 24px; border: 0; font: inherit; font-size: 1rem; font-weight: 700; cursor: pointer; }

#world #ring .link { stroke: var(--link); stroke-width: 2.5; stroke-linecap: round; }

#world #ring .ruinline { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }

#world #ring .corridor { stroke-width: 1.25; stroke-linejoin: round; }

#world #ring .corridor.type-c { fill: color-mix(in srgb, var(--type-c) 30%, transparent); stroke: var(--type-c); }

#world #ring .corridor.type-u { fill: color-mix(in srgb, var(--type-u) 30%, transparent); stroke: var(--type-u); }

#world #ring .corridor.type-d { fill: color-mix(in srgb, var(--type-d) 30%, transparent); stroke: var(--type-d); }

#world #ring .corridor.ruined { fill: color-mix(in srgb, var(--ruined) 35%, transparent); stroke: var(--ruined); }

#world #ring .node { cursor: pointer; outline: none; }

#world #ring .node .hit { fill: transparent; }

#world #ring .node .dot { stroke: var(--surface); stroke-width: 3; }

#world #ring .node.type-c .dot { fill: var(--type-c); }

#world #ring .node.type-u .dot { fill: var(--type-u); }

#world #ring .node.type-d .dot { fill: var(--type-d); }

#world #ring .node.ruined .dot { fill: var(--ruined); }

#world #ring .node .letter { fill: var(--on-type); font-weight: 700; font-size: calc(16px * var(--u, 1)); pointer-events: none; }

#world #ring .node.ruined .letter { fill: var(--ruined-ink); }

#world #ring .node .name, #world #ring .names .name { fill: var(--ink-2); font-size: calc(16px * var(--u, 1)); pointer-events: none; font-variant-numeric: tabular-nums; }

#world #ring .node:hover .dot, #world #ring .node:focus-visible .dot { stroke: var(--focus); }

#world .sliders { display: grid; gap: 14px; margin-bottom: 16px; }

#world .slider-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }

#world .slider-head label { font-weight: 600; }

#world .slider-head output { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--ink-2); }

#world .slider input[type="range"] { width: 100%; margin: 6px 0 0; accent-color: var(--ink); height: 28px; }

#world .slider-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }

#world .slider-row input[type="range"] { flex: 1; min-width: 0; margin: 0; }

#world button.step { min-width: 44px; min-height: 44px; padding: 0; font-size: 1.375rem; line-height: 1; flex: none; }

#world .slider.wide { max-width: 560px; }

#world .seed-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

#world .seed-row label { font-weight: 600; }

#world .seed-row input { width: 8em; }

#world .table-wrap { overflow-x: auto; max-width: 100%; }

#world table { border-collapse: collapse; width: 100%; font-size: 1rem; font-variant-numeric: tabular-nums; }

#world caption { text-align: left; color: var(--ink-2); padding-bottom: 6px; caption-side: top; }

#world th, #world td { text-align: left; padding: 4px 8px 4px 0; border-bottom: 1px solid var(--grid); }

#world th { color: var(--ink-2); font-weight: 600; }

#world tr.ruined td { color: var(--ruined-ink); }

#world .clocks { margin: 28px 0 8px; }

#world .clocks .sub { color: var(--ink-2); font-size: 1rem; }

#world .clock { padding: 8px 0 4px; border-top: 1px solid var(--grid); max-width: 640px; }

#world .clock-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 1rem; }

#world .clock-name { font-weight: 600; }

#world .clock-val { font-variant-numeric: tabular-nums; }

#world .clock-sub { font-size: 1rem; color: var(--muted); font-variant-numeric: tabular-nums; }

#world .clock-bar { display: block; width: 100%; max-width: 480px; height: auto; margin-top: 4px; }

#world .clock-bar .track { stroke: var(--grid); stroke-width: 8; stroke-linecap: round; }

#world .clock-bar .tick { stroke: var(--axis); stroke-width: 1.5; }

#world .clock-bar .tick.bound { stroke: var(--ink); stroke-width: 2; }

#world .clock-bar .tick-label { fill: var(--muted); font-size: 16px; }

#world .clock-bar .bar.type-c { fill: var(--type-c); }

#world .clock-bar .bar.type-u { fill: var(--type-u); }

#world .clock-bar .bar.type-d { fill: var(--type-d); }

#world .clock-bar .end-mark { stroke: var(--ink); stroke-width: 2; fill: none; stroke-linecap: round; }

#world .numbers { color: var(--ink-2); }

#world .readout { margin: 10px 0 16px; padding: 10px 12px; border-left: 3px solid var(--axis); background: var(--surface); border-radius: 0 8px 8px 0; }

#world .readout[data-side="pair"] { border-left-color: var(--s1); }

#world .readout[data-side="defector"] { border-left-color: var(--s2); }

#world .readout[data-side="equal"] { border-left-color: var(--ink); }

#world .chart { margin: 0 0 20px; }

#world .chart figcaption { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; font-size: 1rem; color: var(--ink-2); margin-bottom: 6px; }

#world .chart figcaption b { color: var(--ink); }

#world .legend-item { display: inline-flex; align-items: center; gap: 6px; }

#world .sw { display: inline-block; width: 16px; height: 0; border-top: 3px solid var(--ink-2); vertical-align: middle; margin-right: 4px; }

#world .sw.s1 { border-top-color: var(--s1); }

#world .sw.s2 { border-top-color: var(--s2); }

#world .sw.dashed { border-top-style: dashed; }

#world .chart-box { position: relative; }

#world .chart-box svg {
  display: block;
  width: 100%;
  height: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  touch-action: pan-y;
}

#world #chart-lifetimes { max-width: 760px; cursor: crosshair; }

#world .chart-box .grid { stroke: var(--grid); stroke-width: 1; }

#world .chart-box .axis { stroke: var(--axis); stroke-width: 1; }

#world .chart-box .tick-label { fill: var(--muted); font-size: 16px; font-variant-numeric: tabular-nums; }

#world .chart-box .axis-title { fill: var(--ink-2); font-size: 16px; }

#world .chart-box .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }

#world .chart-box .line.s1 { stroke: var(--s1); }

#world .chart-box .line.s2 { stroke: var(--s2); }

#world .chart-box .line.dashed { stroke-dasharray: 6 4; }

#world .chart-box .pt { stroke: var(--surface); stroke-width: 2; }

#world .chart-box .pt.s1 { fill: var(--s1); }

#world .chart-box .pt.s2 { fill: var(--s2); }

#world .chart-box .value { fill: var(--ink); font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }

#world .chart-box .direct { fill: var(--ink-2); font-size: 16px; font-weight: 600; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }

#world .chart-box .boundary { stroke: var(--boundary); stroke-width: 1.25; stroke-dasharray: 4 4; }

#world .chart-box .boundary-label { fill: var(--ink); font-size: 16px; font-weight: 700; }

#world .chart-box .region { fill: var(--region); font-size: 16px; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }

#world .chart-box .marker { stroke: var(--ink-2); stroke-width: 1.5; }

#world .chart-box .hover-line { stroke: var(--muted); stroke-width: 1; }

#world .chart-box .hit-area { fill: transparent; }

#world .tip {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  background: var(--tip-bg);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 6px 10px;
  font-size: 1rem;
  line-height: 1.4;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

#world .tip[hidden] { display: none; }

#world .numbers-table { margin-top: 8px; max-width: 480px; }

#world .numbers-table summary { cursor: pointer; color: var(--ink-2); font-size: 1rem; }

#world .scenes { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }

@media (min-width: 720px) {
  #world .scenes { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

#world .scene-clocks { margin-top: 6px; }

#world .scene-clocks .muted { font-size: 1rem; }

#world .plain-words { margin: 32px 0; }

#world .plain-words:empty { display: none; }

#world .foot { padding-top: 16px; padding-bottom: 32px; color: var(--muted); font-size: 1rem; }

@media (prefers-reduced-motion: reduce) {
  #world, #world * { scroll-behavior: auto !important; }
}

/* ---- the room: the site's own rules, answered inside the world ---- */
/* the world's own width, as on its own page (1040px less its two 16px sides), out of the site's 760px column */
#world { margin-inline: calc(50% - min(504px, 50vw - clamp(16px, 4vw, 40px))); }
/* .page table, thead, tbody, tr, th and td turn into blocks under 560px, and .page thead th into capitals */
#world table { display: table; }
#world thead { display: table-header-group; position: static; width: auto; height: auto; overflow: visible; clip: auto; }
#world tbody { display: table-row-group; }
#world tr { display: table-row; }
#world th, #world td { display: table-cell; width: auto; vertical-align: middle; }
#world th { text-transform: none; letter-spacing: normal; }
/* a clock's bar is an SVG rect of the class bar; .bar is also the site's header */
#world .clock-bar .bar { position: static; inset: auto; z-index: auto; display: inline; padding: 0; border: 0; background: none;
  -webkit-backdrop-filter: none; backdrop-filter: none; }
