/* the canvas is the page. cards float on top of it */

@font-face {
  font-family: 'Dosis';
  font-weight: 300;
  font-display: swap;
  src: url(../lib/fonts/dosis-300.woff2) format('woff2');
}

@font-face {
  font-family: 'Dosis';
  font-weight: 400;
  font-display: swap;
  src: url(../lib/fonts/dosis-400.woff2) format('woff2');
}

@font-face {
  font-family: 'Dosis';
  font-weight: 500;
  font-display: swap;
  src: url(../lib/fonts/dosis-500.woff2) format('woff2');
}

@font-face {
  font-family: 'Dosis';
  font-weight: 600;
  font-display: swap;
  src: url(../lib/fonts/dosis-600.woff2) format('woff2');
}

/* Chaos by Sigrid Liira (2018), SUVA Type Foundry. capitals and numbers only, used big */
@font-face {
  font-family: 'Chaos';
  font-display: block;
  src: url(../lib/fonts/chaos-regular.woff2) format('woff2');
}

@font-face {
  font-family: 'Space Mono';
  font-weight: 400;
  font-display: swap;
  src: url(../lib/fonts/space-mono-400.woff2) format('woff2');
}

@font-face {
  font-family: 'Space Mono';
  font-weight: 700;
  font-display: swap;
  src: url(../lib/fonts/space-mono-700.woff2) format('woff2');
}

@font-face {
  font-family: 'Syne';
  font-weight: 600;
  font-display: swap;
  src: url(../lib/fonts/syne-600.woff2) format('woff2');
}

@font-face {
  font-family: 'Syne';
  font-weight: 700;
  font-display: swap;
  src: url(../lib/fonts/syne-700.woff2) format('woff2');
}

@font-face {
  font-family: 'Syne';
  font-weight: 800;
  font-display: swap;
  src: url(../lib/fonts/syne-800.woff2) format('woff2');
}


:root {
  --board: #1c1c1b;
  --board-2: #232322;
  --chalk: #efe6cf;
  --chalk-dim: #a8a191;
  --white: #fafafa;
  --yellow: #e9c46a;
  --marker: #f5d36b;
  --paper: rgba(36, 36, 34, 0.9);
  --paper-solid: #252523;
  --ink: #e4dcc7;
  --ink-soft: #b3ac9b;
  --ink-faint: rgba(239, 230, 207, 0.09);
  --dark-text: #1c1c1b;
  --serif: 'Syne', 'Avenir Next', 'Trebuchet MS', sans-serif;
  --sans: 'Dosis', 'Avenir Next Condensed', 'Segoe UI', sans-serif;
  --display: 'Chaos', 'Syne', sans-serif;
  --mono: 'Space Mono', ui-monospace, Menlo, monospace;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--board);
  color: var(--chalk);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  font-weight: 400;
  letter-spacing: 0.01em;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

button {
  font: inherit;
  cursor: pointer;
}

/* ---------- the stage ---------- */

.stage {
  position: fixed;
  inset: 0;
}

.stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

/* ---------- top bar ---------- */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 12px 18px;
  z-index: 30;
  pointer-events: none;
  background: linear-gradient(rgba(28, 28, 27, 0.92), rgba(28, 28, 27, 0));
}

.topbar > * {
  pointer-events: auto;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--white);
  text-decoration: none;
  white-space: nowrap;
}

.wordmark svg {
  width: 22px;
  height: 22px;
}

/* the name in the loader's Chaos lettering, big enough to read, with a soft glow */
.logo {
  font-family: var(--display);
  font-weight: 400;
  font-size: 68px;
  line-height: 0;
  letter-spacing: 0.01em;
  margin: -6px 0;
  color: #ffe08a;
  text-shadow: 0 0 2px #ffe08a, 0 0 8px rgba(245, 211, 107, 0.7), 0 0 20px rgba(233, 196, 106, 0.4);
  animation: logo-glow 3.2s ease-in-out infinite;
}

@keyframes logo-glow {
  0%, 100% { text-shadow: 0 0 2px #ffe08a, 0 0 8px rgba(245, 211, 107, 0.6), 0 0 18px rgba(233, 196, 106, 0.3); }
  50% { text-shadow: 0 0 2px #ffe08a, 0 0 12px rgba(245, 211, 107, 0.85), 0 0 30px rgba(233, 196, 106, 0.5); }
}

@media (prefers-reduced-motion: reduce) {
  .logo,
  .loader .title h1 span {
    animation: none;
    opacity: 1;
  }
}

.sections {
  display: flex;
  gap: 2px;
}

.sections a {
  color: var(--chalk-dim);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 3px;
  white-space: nowrap;
}

.sections a:hover {
  color: var(--white);
}

.sections a.current {
  color: var(--white);
  background: rgba(239, 230, 207, 0.1);
  box-shadow: inset 0 -2px 0 var(--yellow);
}

.modes {
  display: flex;
  gap: 2px;
  margin-left: auto;
  padding: 3px;
  border: 1px solid rgba(239, 230, 207, 0.18);
  border-radius: 4px;
  background: rgba(28, 28, 27, 0.7);
}

.modes button {
  background: none;
  border: none;
  color: var(--chalk-dim);
  padding: 5px 11px;
  border-radius: 2px;
  white-space: nowrap;
}

.modes button:hover {
  color: var(--white);
}

.modes button.active {
  background: var(--yellow);
  color: var(--dark-text);
}

.ghost-btn {
  background: rgba(28, 28, 27, 0.7);
  color: var(--chalk-dim);
  border: 1px solid rgba(239, 230, 207, 0.18);
  border-radius: 4px;
  padding: 6px 10px;
  white-space: nowrap;
}

.ghost-btn:hover {
  color: var(--white);
  border-color: var(--yellow);
}

.modes + .ghost-btn {
  margin-left: 0;
}

.topbar .spacer {
  margin-left: auto;
}

kbd {
  font-family: var(--mono);
  font-size: 11px;
  padding: 0 4px;
  border: 1px solid currentColor;
  border-radius: 3px;
  opacity: 0.7;
}

/* ---------- cards ---------- */

.cards {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  transition: opacity 0.25s;
}

body.ui-hidden .cards {
  opacity: 0;
}

body.ui-hidden .cards .card {
  pointer-events: none;
}

.card {
  position: absolute;
  width: 300px;
  min-width: 220px;
  min-height: 46px;
  max-height: calc(100vh - 136px);
  display: flex;
  flex-direction: column;
  background: var(--paper);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--ink);
  border: 1px solid rgba(239, 230, 207, 0.08);
  border-radius: 10px;
  box-shadow: var(--shadow);
  pointer-events: auto;
  overflow: hidden;
  resize: both;
}

.card.wide {
  width: 380px;
}

.card.narrow {
  width: 260px;
}

.card.fit {
  width: auto;
  min-width: 280px;
  max-width: min(560px, calc(100vw - 36px));
}

/* the small version of a card */
.card.compact {
  transform: scale(0.78);
}

.card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px 8px;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.card-head:active {
  cursor: grabbing;
}

.card-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.01em;
  line-height: 1.2;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-head h2::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--yellow);
  transform: rotate(45deg);
  flex-shrink: 0;
}

.fold,
.shrink {
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  color: var(--ink-soft);
  border-radius: 3px;
  font-size: 14px;
  line-height: 1;
  transition: transform 0.2s;
}

.fold:hover,
.shrink:hover {
  background: var(--ink-faint);
  color: var(--ink);
}

.card.folded .fold {
  transform: rotate(-90deg);
}

.card.folded .card-body {
  display: none;
}

.card.folded {
  resize: none;
  height: auto !important;
}

.card.compact .shrink {
  color: var(--yellow);
}

.card-body {
  padding: 0 14px 14px;
  overflow-y: auto;
  overflow-x: hidden;
}

.card-body::-webkit-scrollbar {
  width: 6px;
}

.card-body::-webkit-scrollbar-thumb {
  background: var(--ink-faint);
  border-radius: 3px;
}

.card p,
.card .sub {
  margin: 0 0 10px;
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.4;
}

.card p strong {
  color: var(--white);
  font-weight: 600;
}

.card h3 {
  margin: 14px 0 6px;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 700;
  color: var(--chalk);
  text-transform: lowercase;
  letter-spacing: 0.02em;
}

.card hr {
  border: none;
  border-top: 1px dashed rgba(239, 230, 207, 0.15);
  margin: 12px 0;
}

/* ---------- controls on paper ---------- */

div.row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0;
}

.label {
  font-size: 12px;
  color: var(--ink-soft);
  min-width: 52px;
}

.field {
  display: grid;
  grid-template-columns: 78px 1fr 46px;
  align-items: center;
  gap: 10px;
  margin: 3px 0;
}

.field label {
  font-size: 13px;
  color: var(--ink-soft);
}

.field output,
.value {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
  text-align: right;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 18px;
  background: transparent;
  margin: 0;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  background: linear-gradient(90deg, var(--yellow) var(--fill, 50%), rgba(239, 230, 207, 0.14) var(--fill, 50%));
}

input[type="range"]::-moz-range-track {
  height: 2px;
  background: rgba(239, 230, 207, 0.12);
}

input[type="range"]::-moz-range-progress {
  height: 2px;
  background: var(--yellow);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -6px;
  border-radius: 50%;
  background: var(--marker);
  border: 2px solid var(--paper-solid);
  cursor: ew-resize;
}

input[type="range"]::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--marker);
  border: 2px solid var(--ink);
  cursor: ew-resize;
}

.text-input,
select {
  background: rgba(239, 230, 207, 0.05);
  color: var(--ink);
  border: none;
  border-bottom: 1px solid rgba(239, 230, 207, 0.3);
  border-radius: 4px 4px 0 0;
  padding: 6px 4px;
  font-family: var(--mono);
  font-size: 13px;
  min-width: 0;
}

select {
  cursor: pointer;
  padding-right: 2px;
}

.text-input {
  width: 100%;
}

.text-input:focus,
select:focus {
  outline: none;
  background: rgba(245, 211, 107, 0.1);
  border-bottom-color: var(--yellow);
}

.text-input.bad {
  border-bottom-color: #b5452f;
  background: rgba(181, 69, 47, 0.08);
}

.input-row {
  display: flex;
  gap: 6px;
  align-items: center;
  margin: 6px 0;
}

.input-row .prefix {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.error {
  font-size: 12px;
  color: #a33b26;
  min-height: 0;
}

.error:not(:empty) {
  margin: 2px 0 6px;
}

.btn {
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(239, 230, 207, 0.25);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 13px;
}

.btn:hover:not(:disabled) {
  background: var(--marker);
  border-color: var(--marker);
  color: var(--dark-text);
}

.btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.btn.solid {
  background: var(--ink);
  color: var(--paper);
}

.btn.solid:hover {
  background: var(--marker);
}

.btn.square {
  width: 28px;
  padding: 4px 0;
  text-align: center;
}

.counter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.counter .value {
  min-width: 18px;
  text-align: center;
}

.play {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--yellow);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.play svg {
  width: 12px;
  height: 12px;
  fill: var(--dark-text);
}

.options {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.check input {
  accent-color: var(--yellow);
  width: 14px;
  height: 14px;
  margin: 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.chips button {
  background: transparent;
  border: 1px solid rgba(239, 230, 207, 0.21);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 14px;
  color: var(--ink);
}

.chips button:hover {
  border-color: var(--yellow);
  color: var(--white);
}

.chips button.active {
  background: var(--yellow);
  color: var(--dark-text);
  border-color: var(--yellow);
}

/* ---------- math on paper ---------- */

.eq {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 0;
  font-size: 14px;
  color: var(--white);
}

.eq.big {
  font-size: 17px;
}

.eq.small {
  font-size: 13px;
}

.eq .katex-display {
  margin: 4px 0;
  text-align: left;
}

.eq .katex-display > .katex {
  text-align: left;
}

/* highlighter pen */
.hl {
  background: linear-gradient(100deg, rgba(245, 211, 107, 0) 0%, rgba(245, 211, 107, 0.9) 4%, rgba(245, 211, 107, 0.85) 92%, rgba(245, 211, 107, 0) 100%);
  border-radius: 3px;
  padding: 0 2px;
  margin: 0 -2px;
  color: var(--dark-text);
}

.hl * {
  color: var(--dark-text) !important;
}

/* numbers you can drag */
[data-scrub] {
  cursor: ew-resize;
  border-bottom: 1.5px dotted var(--ink);
  border-radius: 2px;
  transition: background 0.15s;
}

[data-scrub]:hover,
body.scrubbing [data-scrub].dragging {
  background: rgba(245, 211, 107, 0.25);
  color: var(--white);
}

[data-scrub] {
  border-bottom-color: var(--yellow) !important;
}

body.scrubbing,
body.scrubbing * {
  cursor: ew-resize !important;
  user-select: none;
}

.callout {
  border-left: 3px solid var(--marker);
  background: rgba(239, 230, 207, 0.04);
  padding: 7px 10px;
  margin: 10px 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.callout strong {
  color: var(--ink);
  font-weight: 600;
}

.callout .btn {
  margin-top: 6px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 0;
  border-top: 1px solid var(--ink-faint);
  border-bottom: 1px solid var(--ink-faint);
  margin: 10px 0;
}

.stats div {
  padding: 6px 4px;
}

.stats span {
  display: block;
  font-size: 11px;
  color: var(--ink-soft);
}

.stats b {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 13px;
}

.stats b.yes {
  color: var(--dark-text);
  background: var(--marker);
  padding: 0 3px;
}

.table-wrap {
  overflow-x: auto;
}

.num-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.num-table th {
  text-align: left;
  font-weight: 500;
  font-size: 11px;
  color: var(--ink-soft);
  padding: 4px 5px;
  border-bottom: 1px solid rgba(239, 230, 207, 0.25);
}

.num-table td {
  padding: 4px 5px;
  border-bottom: 1px solid var(--ink-faint);
  vertical-align: middle;
}

.num-table td.n {
  font-family: var(--mono);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

.num-table tr.row:hover td {
  background: rgba(239, 230, 207, 0.05);
}

.num-table tr.active td {
  background: rgba(245, 211, 107, 0.14);
  color: var(--white);
}

.num-table tr.active td:first-child {
  box-shadow: inset 2px 0 0 var(--yellow);
}

.num-table tr.total td {
  border-bottom: none;
  color: var(--ink-soft);
}

.swatch {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  box-shadow: 0 0 0 1px rgba(28, 28, 27, 0.8);
}

/* little screens drawn inside a card */
.mini-canvas {
  width: 100%;
  height: 150px;
  display: block;
  border-radius: 6px;
  background: rgba(20, 20, 19, 0.7);
  border: 1px solid rgba(239, 230, 207, 0.06);
  margin-top: 6px;
}

/* ---------- equation log ---------- */

.log {
  list-style: none;
  margin: 0;
  padding: 0;
}

.log li {
  display: grid;
  grid-template-columns: 12px 16px 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  border-bottom: 1px solid var(--ink-faint);
  cursor: pointer;
}

.log li:hover {
  background: rgba(239, 230, 207, 0.05);
}

.log li.current {
  background: rgba(245, 211, 107, 0.14);
  box-shadow: inset 2px 0 0 var(--yellow);
}

.log li .tex {
  overflow: hidden;
  font-size: 13px;
  white-space: nowrap;
  mask-image: linear-gradient(90deg, #000 85%, transparent);
  -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
}

.log li button {
  display: grid;
  place-items: center;
  border: none;
  background: none;
  padding: 2px 4px;
  color: var(--ink-soft);
  font-size: 13px;
  border-radius: 3px;
}

.log li button:hover {
  background: var(--ink-faint);
  color: var(--ink);
}

.log li.hidden-overlay .tex {
  opacity: 0.45;
}

.log .num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-soft);
}

.log .now {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dark-text);
  background: var(--yellow);
  padding: 0 5px;
  border-radius: 3px;
}

.log-empty {
  font-size: 13px;
  color: var(--ink-soft);
  padding: 6px 0;
}

/* ---------- things floating on the board ---------- */

.readout {
  position: absolute;
  left: 50%;
  top: 62px;
  transform: translateX(-50%);
  z-index: 15;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--chalk);
  background: rgba(28, 28, 27, 0.85);
  border: 1px solid rgba(239, 230, 207, 0.15);
  padding: 5px 12px;
  border-radius: 999px;
  pointer-events: none;
  white-space: nowrap;
}

.readout:empty {
  display: none;
}

.readout b {
  color: var(--marker);
  font-weight: 500;
}


.probe {
  position: fixed;
  z-index: 25;
  pointer-events: none;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dark-text);
  background: var(--marker);
  padding: 2px 6px;
  border-radius: 2px;
  transform: translate(14px, 12px);
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.toast {
  position: fixed;
  left: 50%;
  top: 64px;
  transform: translate(-50%, -8px);
  z-index: 40;
  background: var(--yellow);
  color: var(--dark-text);
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 3px;
  box-shadow: var(--shadow);
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

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

/* ---------- small screens: canvas on top, cards stacked below ---------- */

@media (max-width: 820px) {
  .readout {
    top: 10px;
    max-width: calc(100% - 24px);
    white-space: normal;
    text-align: center;
  }

  body {
    overflow: auto;
  }

  .topbar {
    position: sticky;
    flex-wrap: wrap;
    gap: 8px 12px;
    background: var(--board);
  }

  .modes {
    margin-left: 0;
    overflow-x: auto;
    max-width: 100%;
  }

  .topbar .ghost-btn {
    display: none;
  }

  .help-btn {
    position: absolute;
    top: 12px;
    right: 14px;
  }

  .help {
    position: fixed;
    top: 54px;
  }

  .stage {
    position: relative;
    height: 62vh;
  }

  .cards {
    position: static;
    padding: 18px 12px 30px;
    display: flex;
    flex-direction: column;
    gap: 22px;
  }

  .card,
  .card.wide,
  .card.narrow {
    position: relative !important;
    inset: auto !important;
    width: 100%;
    max-height: none;
  }

  .card-head {
    cursor: default;
  }

  .card {
    resize: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: var(--paper-solid);
  }
}

/* ---------- scrollbars: thin, rounded, yellow on a dark track ---------- */

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(233, 196, 106, 0.55) rgba(20, 20, 19, 0.45);
}

::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: rgba(20, 20, 19, 0.45);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb {
  background: rgba(233, 196, 106, 0.55);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(245, 211, 107, 0.8);
}

::-webkit-scrollbar-corner {
  background: transparent;
}

.card-body::-webkit-scrollbar,
.eq::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar,
.modes::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

.stage {
  z-index: 1;
}

/* ---------- help: how to use this board ---------- */

.help-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(233, 196, 106, 0.5);
  background: rgba(28, 28, 27, 0.85);
  color: var(--yellow);
  font-family: var(--serif);
  font-weight: 800;
  font-size: 15px;
}

.help-btn:hover,
.help-btn.open {
  background: var(--yellow);
  color: var(--dark-text);
}

.help {
  position: fixed;
  right: 16px;
  top: 58px;
  z-index: 35;
  width: min(380px, calc(100vw - 32px));
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  background: var(--paper-solid);
  border: 1px solid rgba(239, 230, 207, 0.1);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 14px 16px 10px;
  color: var(--ink);
}

.help h4 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 700;
}

.help ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.help li span {
  font-size: 14.5px;
  line-height: 1.35;
}

.help li {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 10px;
  padding: 5px 0;
  border-top: 1px solid var(--ink-faint);
  font-size: 14px;
}

.help li b {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 11px;
  color: var(--yellow);
  padding-top: 2px;
}

.help .sample {
  border-bottom: 1.5px dotted var(--yellow);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--white);
}

.help .credit {
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-soft);
}

/* the "you can drag this" nudge that shows up on the first card */
.tip {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 0 0 10px;
  padding: 7px 9px;
  border-radius: 6px;
  background: rgba(233, 196, 106, 0.1);
  color: var(--chalk);
  font-size: 14px;
}

.tip::before {
  content: "↔";
  color: var(--yellow);
  font-family: var(--mono);
}

/* ---------- loader ---------- */

.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--board);
  display: grid;
  place-items: center;
  transition: opacity 0.6s ease, visibility 0.6s;
}

.loader.done {
  opacity: 0;
  visibility: hidden;
}

.loader canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.loader .title {
  position: relative;
  text-align: center;
  pointer-events: none;
}

.loader .title h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(80px, 16vw, 260px);
  line-height: 1;
  color: #ffe08a;
  letter-spacing: 0.04em;
}

.loader .title p {
  margin: 14px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--chalk-dim);
}

.loader .credit {
  position: absolute;
  bottom: 18px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 12px;
  color: rgba(239, 230, 207, 0.35);
}

/* ---------- the guide strip: a quiet line of hints along the bottom ---------- */

.guide {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 18;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 2px 10px;
  padding: 8px 60px 10px;
  font-size: 13.5px;
  color: rgba(239, 230, 207, 0.42);
  pointer-events: none;
}

.guide span {
  white-space: nowrap;
}

.guide b {
  font-weight: 500;
  color: rgba(233, 196, 106, 0.75);
  margin-right: 5px;
}

.guide i {
  font-style: normal;
  color: rgba(239, 230, 207, 0.18);
}

.guide .keys b {
  font-family: var(--mono);
  font-size: 11px;
  border: 1px solid rgba(233, 196, 106, 0.35);
  border-radius: 50%;
  width: 17px;
  height: 17px;
  display: inline-grid;
  place-items: center;
  margin: 0 4px 0 6px;
}

@media (max-width: 820px) {
  .guide {
    position: static;
    justify-content: flex-start;
    padding: 10px 14px;
  }

  .guide i,
  .guide .keys {
    display: none;
  }

  .guide span {
    white-space: normal;
  }
}

/* ---------- about + credits, tucked into the help panel ---------- */

.help .about h4 {
  margin: 10px 0 4px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--yellow);
}

.help .about h4:first-child {
  margin-top: 0;
}

.help .about {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--ink-faint);
}

.help .about p {
  margin: 0 0 4px;
  font-size: 14px;
}

.help .about a {
  color: var(--yellow);
  text-decoration: none;
  border-bottom: 1px solid rgba(233, 196, 106, 0.4);
}

.help .about a:hover {
  border-bottom-color: var(--yellow);
}

/* ---------- loader title: letters light up one by one ---------- */

.loader .title h1 span {
  display: inline-block;
  opacity: 0;
  animation: letter-in 0.9s ease forwards, glow 2.4s ease-in-out infinite;
}

@keyframes letter-in {
  0% { opacity: 0; transform: translateY(14px) scale(0.92); filter: blur(8px); }
  60% { opacity: 1; filter: blur(0); }
  100% { opacity: 1; transform: none; filter: blur(0); }
}

@keyframes glow {
  0%, 100% {
    text-shadow: 0 0 6px rgba(245, 211, 107, 0.9), 0 0 18px rgba(245, 211, 107, 0.6), 0 0 42px rgba(233, 196, 106, 0.45), 0 0 90px rgba(233, 196, 106, 0.25);
  }
  50% {
    text-shadow: 0 0 10px rgba(255, 228, 140, 1), 0 0 28px rgba(245, 211, 107, 0.8), 0 0 70px rgba(233, 196, 106, 0.6), 0 0 140px rgba(233, 196, 106, 0.35);
  }
}

.loader .bar {
  width: min(320px, 60vw);
  height: 2px;
  margin: 22px auto 0;
  background: rgba(239, 230, 207, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.loader .bar div {
  height: 100%;
  width: 0;
  background: var(--yellow);
  box-shadow: 0 0 12px var(--yellow);
}
