:root {
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Roboto Mono", Menlo, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", monospace;
  --round: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --gothic: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;

  --page: #08080a;
  --text: rgba(246, 239, 227, 0.9);
  --text-70: rgba(246, 239, 227, 0.68);
  --text-45: rgba(246, 239, 227, 0.42);
  --text-32: rgba(246, 239, 227, 0.32);
  --accent: #e9bd7c;
  --accent-soft: rgba(233, 189, 124, 0.5);
  --accent-text: #e9bd7c;
  --on-accent: #17130c;
  --btn-bg: rgba(255, 255, 255, 0.055);
  --btn-bg-hover: rgba(255, 255, 255, 0.11);
  --btn-border: rgba(255, 255, 255, 0.09);
  --panel: rgba(20, 20, 24, 0.92);
  --line: rgba(255, 255, 255, 0.085);
  --card: rgba(255, 255, 255, 0.028);
  --radius: 999px;
  --font-ui: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  background: var(--page);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  font-family: var(--font-ui);
  transition: background 0.5s ease;
}

.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

canvas {
  position: absolute;
  inset: 0;
  display: block;
}

/* ---------- page frame ---------- */
.top {
  position: relative;
  z-index: 40;
  border-bottom: 1px solid var(--line);
}

.top-inner {
  display: flex;
  align-items: center;
  gap: 22px;
  height: 56px;
}

.topnav {
  display: flex;
  gap: 20px;
  margin-left: auto;
}

.topnav a {
  font-size: 12px;
  color: var(--text-45);
  text-decoration: none;
  transition: color 0.2s;
}

.topnav a:hover {
  color: var(--accent);
}

.topnav a[aria-current="page"] {
  position: relative;
  color: var(--accent);
}

.topnav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -7px;
  height: 1px;
  background: var(--accent-soft);
}

.topnote {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-32);
  white-space: nowrap;
}

.langs {
  position: relative;
  display: flex;
  align-items: center;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px 5px 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  line-height: 1;
  color: var(--text-45);
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.lang-btn:hover,
.langs.open .lang-btn {
  color: var(--text);
  background: var(--btn-bg);
  border-color: var(--line);
}

.lang-btn svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lang-globe {
  width: 13px;
  height: 13px;
  opacity: 0.75;
}

.lang-caret {
  width: 9px;
  height: 9px;
  opacity: 0.7;
  transition: transform 0.2s ease;
}

.langs.open .lang-caret {
  transform: rotate(180deg);
}

.lang-btn:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 2px;
}

.lang-menu {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 40;
  min-width: 156px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: 0 20px 44px -18px rgba(0, 0, 0, 0.85);
}

.lang-menu[hidden] {
  display: none;
}

.lang-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 9px;
  border-radius: 7px;
  font-size: 12.5px;
  color: var(--text-70);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}

.lang-menu a:hover,
.lang-menu a:focus-visible {
  color: var(--text);
  background: var(--btn-bg-hover);
  outline: none;
}

.lang-menu a[aria-current="page"] {
  color: var(--text);
}

.lang-check {
  width: 13px;
  height: 13px;
  flex: none;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero {
  padding-top: 54px;
  padding-bottom: 34px;
}

.hero h1 {
  font-size: clamp(30px, 4.6vw, 52px);
  line-height: 1.04;
  letter-spacing: -0.025em;
  font-weight: 600;
}

.claim {
  margin-top: 16px;
  font-size: clamp(17px, 1.7vw, 22px);
  line-height: 1.3;
  letter-spacing: -0.012em;
  font-weight: 500;
  color: var(--text);
}

.lede {
  max-width: 62ch;
  margin-top: 12px;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-70);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
  list-style: none;
}

.chips li {
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-45);
}

/* ---------- the timer stage ---------- */
.stage {
  position: relative;
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  height: clamp(420px, 62vh, 760px);
  height: clamp(420px, 62svh, 760px);
  overflow: hidden;
  background: var(--page);
  isolation: isolate;
  --hud-bottom: max(24px, env(safe-area-inset-bottom));
  --hud-gap: 9px;
}

.stage:fullscreen {
  width: 100vw;
  max-width: none;
  height: 100dvh;
}

/* melt the canvas into the page above and below, per skin */
.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  box-shadow:
    inset 0 46px 48px -34px var(--page),
    inset 0 -46px 48px -34px var(--page);
}

/* once the stage is narrower than the window, soften its sides too */
@media (min-width: 1360px) {
  .stage::after {
    box-shadow:
      inset 0 46px 48px -34px var(--page),
      inset 0 -46px 48px -34px var(--page),
      inset 64px 0 72px -52px var(--page),
      inset -64px 0 72px -52px var(--page);
  }
}

.stage::backdrop {
  background: var(--page);
}

body.board-mode {
  overflow: hidden;
}

body.board-mode .stage {
  position: fixed;
  inset: 0;
  z-index: 100;
  max-width: none;
  margin-inline: 0;
  height: 100dvh;
}

.exit {
  position: absolute;
  top: 14px;
  left: 14px;
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  font-size: 13px;
  z-index: 7;
}

body.board-mode .exit {
  display: flex;
}

/* ---------- content ---------- */
.section {
  padding-top: 92px;
}

.section + .section {
  margin-top: 92px;
  padding-top: 72px;
  border-top: 1px solid var(--line);
}

.section h2 {
  font-size: clamp(22px, 2.6vw, 30px);
  letter-spacing: -0.015em;
  font-weight: 600;
  max-width: 24ch;
}

.section-lede {
  margin-top: 10px;
  max-width: 60ch;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-70);
}

.grid {
  display: grid;
  gap: 14px;
  margin-top: 30px;
}

.features,
.uses,
.steps {
  grid-template-columns: repeat(3, 1fr);
}

.card,
.steps li {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

.card h3,
.steps h3 {
  font-size: 14.5px;
  font-weight: 600;
  margin-bottom: 8px;
}

.card p,
.steps p {
  font-size: 13.5px;
  line-height: 1.68;
  color: var(--text-70);
}

/* ---------- portal: the two tool cards ---------- */
.tools {
  grid-template-columns: repeat(2, 1fr);
}

.tools .card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 26px;
}

.tools .card h3 {
  font-size: 19px;
  margin-bottom: 4px;
}

.tools .card p {
  flex-grow: 1;
}

.tool-kicker {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--accent-text);
  margin-bottom: 6px;
}

.tool-cta {
  margin-top: 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent-text);
}

.tool-cta:hover {
  text-decoration: underline;
}

.tool-quick {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-45);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tool-quick a {
  color: var(--text-70);
  border-bottom: 1px solid var(--line);
  padding-bottom: 1px;
}

.tool-quick a:hover {
  color: var(--accent-text);
  border-color: var(--accent-soft);
}

.section-more {
  margin-top: 26px;
}

.ghost-link {
  font-size: 13.5px;
  color: var(--accent-text);
}

.ghost-link:hover {
  text-decoration: underline;
}

.steps {
  list-style: none;
  display: grid;
  gap: 14px;
  margin-top: 30px;
}

.steps .num {
  display: block;
  margin-bottom: 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--accent-text);
}

code,
kbd {
  font-family: var(--mono);
  font-size: 0.92em;
  color: var(--accent-text);
}

kbd {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--btn-bg);
  color: var(--text-70);
  font-size: 0.86em;
}

/* ---------- shortcuts ---------- */
.keys {
  width: 100%;
  margin-top: 26px;
  border-collapse: collapse;
  font-size: 14px;
}

.keys th,
.keys td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.keys th {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-32);
}

.keys td:first-child {
  width: 128px;
}

/* ---------- faq ---------- */
.faq {
  margin-top: 26px;
  border-top: 1px solid var(--line);
}

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 2px;
  font-size: 14.5px;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  color: var(--text-32);
}

.faq details[open] summary::after {
  content: "–";
}

.faq p {
  max-width: 72ch;
  padding: 0 2px 18px;
  font-size: 13.5px;
  line-height: 1.72;
  color: var(--text-70);
}

/* ---------- footer ---------- */
.foot {
  margin-top: 92px;
  padding: 28px 0 44px;
  border-top: 1px solid var(--line);
}

.foot-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--text-32);
}

section[id] {
  scroll-margin-top: 24px;
}

.brand {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--text-45);
  user-select: none;
  text-decoration: none;
  white-space: nowrap;
}

a.brand:hover {
  color: var(--text);
}

.nojs {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(540px, 88vw);
  padding: 26px 28px;
  border-radius: 16px;
  background: rgba(18, 18, 22, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(246, 239, 227, 0.78);
  font-size: 14px;
  line-height: 1.6;
}

.nojs h2 {
  font-size: 16px;
  font-weight: 600;
  color: #f2c98a;
  margin-bottom: 10px;
}

.nojs p + p {
  margin-top: 10px;
}

.nojs code {
  font-family: var(--mono);
  font-size: 12.5px;
  color: #f2c98a;
}

.brand span {
  color: var(--accent);
  opacity: 0.8;
}

/* ---------- style switch ---------- */
.skins {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  max-width: min(920px, calc(100% - 24px));
  gap: 3px;
  padding: 4px;
  border-radius: var(--radius);
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  backdrop-filter: blur(10px);
  z-index: 5;
  opacity: 1;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.stage.idle .skins,
.stage.idle .skins button {
  opacity: 0;
  pointer-events: none;
}

.stage.idle .skins {
  visibility: hidden;
}

.skins button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  white-space: nowrap;
  border-radius: var(--radius);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-45);
  font-size: 11.5px;
  letter-spacing: 0.02em;
}

.skins button span {
  display: none;
}

.skins button.on span {
  display: inline;
}

.skins button svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.skins button:hover {
  background: var(--btn-bg-hover);
  color: var(--text);
}

.skins button.on {
  background: var(--accent);
  color: var(--on-accent);
  border-color: transparent;
}

.skins button.on svg {
  stroke-width: 1.5;
}



.hud {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--hud-bottom);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  z-index: 4;
}

/* the clock moves; the control row stays put */
.time {
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  bottom: calc(var(--hud-bottom) + var(--controls-h, 42px) + var(--hud-gap));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

body[data-timepos="top"] .time {
  bottom: auto;
  top: 58px;
}

body[data-timepos="center"] .time {
  bottom: auto;
  top: 50%;
  transform: translateY(-50%);
}

body[data-timepos="bottom-left"] .time {
  right: auto;
  left: 26px;
  align-items: flex-start;
}

body[data-timepos="bottom-right"] .time {
  left: auto;
  right: 26px;
  align-items: flex-end;
}

.readout {
  font-family: var(--mono);
  font-size: var(--time-size, 30px);
  font-weight: 300;
  letter-spacing: 0.09em;
  font-variant-numeric: tabular-nums;
  color: var(--time-color, var(--text));
  text-shadow: 0 0 22px color-mix(in srgb, var(--accent) 24%, transparent);
  transition: color 0.4s;
}

.readout.over {
  color: #ff6f57;
  text-shadow: 0 0 22px rgba(255, 111, 87, 0.32);
}

.readout.tick {
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.55;
  }
}

.label {
  font-size: clamp(10.5px, calc(var(--time-size, 30px) * 0.34), 18px);
  text-transform: uppercase;
  letter-spacing: 0.34em;
  color: var(--text-32);
  min-height: 13px;
}

.controls {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
  pointer-events: auto;
  opacity: 1;
  transition: opacity 0.45s ease, transform 0.45s ease, visibility 0.45s ease;
}

.dur,
.utils {
  display: flex;
  align-items: center;
  gap: 4px;
}

.controls.idle,
.controls.idle button,
.controls.idle .modeseg {
  opacity: 0;
  pointer-events: none;
}

.controls.idle {
  visibility: hidden;
  transform: translateY(10px);
}

.presets {
  display: flex;
  gap: 4px;
}

button {
  font-family: inherit;
  font-size: 12px;
  color: var(--btn-text, var(--text-70));
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  border-radius: var(--radius);
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.12s, opacity 0.45s ease;
  backdrop-filter: blur(8px);
}

button:hover {
  background: var(--btn-bg-hover);
  color: var(--text);
}

button:active {
  transform: scale(0.97);
}

.presets button {
  padding: 8px 11px;
  min-width: 38px;
}

.presets button.on {
  color: var(--on-accent);
  background: var(--accent);
  border-color: transparent;
  font-weight: 600;
}

/* countdown / count-up switch, first thing in the controls row */
.modeseg {
  display: flex;
  gap: 0;
  margin-right: 8px;
  border: 1px solid var(--btn-border);
  border-radius: var(--radius);
  overflow: hidden;
  pointer-events: auto;
}

.modeseg button {
  border: none;
  border-radius: 0;
  padding: 8px 13px;
  background: transparent;
}

.modeseg button + button {
  border-left: 1px solid var(--btn-border);
}

.modeseg button.on {
  color: var(--on-accent);
  background: var(--accent);
  font-weight: 600;
}

/* count-up has no duration, no finish line and no next round */
#board[data-mode="up"] .dur,
#board[data-mode="up"] .nudge,
#board[data-mode="up"] #repeat {
  display: none;
}

button.primary {
  color: var(--on-accent);
  background: var(--accent);
  border-color: transparent;
  font-weight: 600;
  padding: 9px 22px;
  letter-spacing: 0.02em;
}

button.primary:hover {
  background: var(--accent);
  filter: brightness(1.06);
  color: var(--on-accent);
}

#sound,
#bell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
}

#sound svg,
#bell svg,
#skinopts svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linejoin: round;
  stroke-linecap: round;
}

#sound .slash {
  display: none;
}

#sound[aria-pressed="false"] .wave {
  opacity: 0;
}

#sound[aria-pressed="false"] .slash {
  display: inline;
}

#repeat[aria-pressed="true"] {
  color: var(--on-accent);
  background: var(--accent);
  border-color: transparent;
  font-weight: 600;
}

.nudge {
  display: flex;
  border: 1px solid var(--btn-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.nudge button {
  border: none;
  border-radius: 0;
  padding: 8px 10px;
  background: transparent;
}

.nudge button + button {
  border-left: 1px solid var(--btn-border);
}

/* ---------- settings panel ---------- */
.skinpanel {
  position: absolute;
  left: 50%;
  bottom: calc(max(24px, env(safe-area-inset-bottom)) + 62px);
  transform: translateX(-50%);
  width: min(340px, calc(100vw - 32px));
  max-height: min(470px, calc(100svh - 230px));
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: 0 20px 44px -18px rgba(0, 0, 0, 0.85);
  z-index: 8;
}

.skinpanel[hidden] {
  display: none;
}

.opt-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 0;
}

.opt-row + .opt-row {
  border-top: 1px solid var(--line);
}

.opt-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-45);
}

.opt-seg {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.opt-seg button {
  padding: 4px 9px;
  font-size: 11px;
  color: var(--text-70);
  border: 1px solid transparent;
  background: var(--btn-bg);
  border-radius: 8px;
}

.opt-seg button.on {
  background: var(--accent);
  color: var(--on-accent);
}

.opt-slider {
  display: flex;
  align-items: center;
  gap: 8px;
}

.opt-slider input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
}

.opt-val {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-70);
  min-width: 14px;
  text-align: right;
}

.opt-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.opt-foot button {
  padding: 4px 10px;
  font-size: 11px;
}

.opt-tabs {
  display: flex;
  gap: 5px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.opt-tab {
  padding: 4px 10px;
  font-size: 11px;
  color: var(--text-70);
  background: var(--btn-bg);
  border: 1px solid transparent;
  border-radius: 8px;
}

.opt-tab.on {
  background: var(--accent);
  color: var(--on-accent);
}

.opt-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-70);
  cursor: pointer;
}

.opt-check input {
  accent-color: var(--accent);
}

.custom input {
  font-family: var(--mono);
  font-size: 12px;
  width: 7.5rem;
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.custom input::placeholder {
  color: var(--text-32);
}

.custom input:focus {
  border-color: var(--accent-soft);
  background: var(--btn-bg-hover);
}

.custom input.on {
  border-color: var(--accent);
}

.custom input.bad {
  border-color: #c45a4a;
}

.toast {
  position: absolute;
  left: 50%;
  bottom: calc(max(24px, env(safe-area-inset-bottom)) + 108px);
  transform: translate(-50%, 8px);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--text-70);
  background: var(--panel);
  border: 1px solid var(--btn-border);
  padding: 7px 14px;
  border-radius: var(--radius);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 6;
}

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

/* ---------- terminal skin ---------- */
body[data-skin="code"] {
  --page: #020806;
  --text: rgba(214, 255, 233, 0.92);
  --text-70: rgba(150, 255, 198, 0.7);
  --text-45: rgba(120, 240, 170, 0.42);
  --text-32: rgba(110, 230, 160, 0.34);
  --accent: #39ff88;
  --accent-soft: rgba(57, 255, 136, 0.5);
  --accent-text: #39ff88;
  --on-accent: #03170d;
  --btn-bg: rgba(57, 255, 136, 0.06);
  --btn-bg-hover: rgba(57, 255, 136, 0.14);
  --btn-border: rgba(57, 255, 136, 0.24);
  --panel: rgba(3, 18, 11, 0.95);
  --line: rgba(57, 255, 136, 0.15);
  --card: rgba(57, 255, 136, 0.035);
  --radius: 7px;
  --font-ui: var(--mono);
  font-family: var(--mono);
}

body[data-skin="code"] .brand,
body[data-skin="code"] .readout,
body[data-skin="code"] .label,
body[data-skin="code"] button,
body[data-skin="code"] .skins,
body[data-skin="code"] .custom input {
  font-family: var(--mono);
}

body[data-skin="code"] .readout {
  letter-spacing: 0.16em;
  text-shadow: 0 0 18px rgba(57, 255, 136, 0.45);
}

body[data-skin="code"] .label {
  letter-spacing: 0.32em;
}

body[data-skin="code"] .brand span {
  color: #39ff88;
}

body[data-skin="code"] .skins button.on,
body[data-skin="code"] .presets button.on,
body[data-skin="code"] .modeseg button.on,
body[data-skin="code"] button.primary {
  box-shadow: 0 0 18px rgba(57, 255, 136, 0.28);
}

/* ---------- cute skin ---------- */
body[data-skin="cute"] {
  --page: #f7ecff;
  --text: #6b5a74;
  --text-70: rgba(107, 90, 116, 0.82);
  --text-45: rgba(107, 90, 116, 0.6);
  --text-32: rgba(107, 90, 116, 0.5);
  --accent: #ff9ec7;
  --accent-soft: rgba(255, 158, 199, 0.6);
  --accent-text: #cf4a87;
  --on-accent: #6b3350;
  --btn-bg: rgba(255, 255, 255, 0.66);
  --btn-bg-hover: rgba(255, 255, 255, 0.95);
  --btn-border: rgba(107, 90, 116, 0.16);
  --panel: rgba(255, 255, 255, 0.95);
  --line: rgba(107, 90, 116, 0.14);
  --card: rgba(255, 255, 255, 0.7);
  --font-ui: var(--round);
  font-family: var(--round);
}

body[data-skin="cute"] .readout {
  font-family: var(--round);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.85);
}

body[data-skin="cute"] .readout.over {
  color: #f4689b;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.9);
}

body[data-skin="cute"] .label {
  letter-spacing: 0.26em;
  font-weight: 600;
}

body[data-skin="cute"] button {
  font-family: var(--round);
  font-weight: 600;
  box-shadow: 0 2px 0 rgba(107, 90, 116, 0.1);
}

body[data-skin="cute"] .brand span {
  color: #ff8fbe;
}

body[data-skin="cute"] .toast {
  color: #6b5a74;
}

/* ---------- halloween skin ---------- */
body[data-skin="hallow"] {
  --page: #0a0510;
  --text: #f7e8d2;
  --text-70: rgba(247, 232, 210, 0.72);
  --text-45: rgba(247, 232, 210, 0.46);
  --text-32: rgba(247, 232, 210, 0.34);
  --accent: #ff8a3d;
  --accent-soft: rgba(255, 138, 61, 0.5);
  --accent-text: #ffa160;
  --on-accent: #2a0c02;
  --btn-bg: rgba(255, 138, 61, 0.07);
  --btn-bg-hover: rgba(255, 138, 61, 0.16);
  --btn-border: rgba(255, 138, 61, 0.22);
  --panel: rgba(18, 8, 20, 0.95);
  --line: rgba(255, 138, 61, 0.17);
  --card: rgba(255, 138, 61, 0.035);
  --font-ui: var(--gothic);
}

body[data-skin="hallow"] .readout {
  font-family: var(--gothic);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-shadow: 0 0 26px rgba(255, 138, 61, 0.42), 0 0 60px rgba(255, 90, 20, 0.24);
}

body[data-skin="hallow"] .readout.over {
  color: #ffd47e;
  text-shadow: 0 0 26px rgba(255, 190, 90, 0.5);
}

body[data-skin="hallow"] .label {
  font-family: var(--gothic);
  letter-spacing: 0.3em;
  font-style: italic;
}

body[data-skin="hallow"] button,
body[data-skin="hallow"] .custom input {
  font-family: var(--font-ui);
  letter-spacing: 0.02em;
}

body[data-skin="hallow"] .brand span {
  color: #ff9a4d;
}

body[data-skin="hallow"] .skins button.on,
body[data-skin="hallow"] .presets button.on,
body[data-skin="hallow"] .modeseg button.on,
body[data-skin="hallow"] button.primary {
  box-shadow: 0 0 20px rgba(255, 138, 61, 0.3);
}

/* ---------- kids skin ---------- */
body[data-skin="kids"] {
  --page: #e9f6ff;
  --text: #24314f;
  --text-70: rgba(36, 49, 79, 0.8);
  --text-45: rgba(36, 49, 79, 0.58);
  --text-32: rgba(36, 49, 79, 0.46);
  --accent: #ff6b6b;
  --accent-soft: rgba(255, 107, 107, 0.55);
  --accent-text: #d8443f;
  --on-accent: #ffffff;
  --btn-bg: rgba(255, 255, 255, 0.72);
  --btn-bg-hover: #ffffff;
  --btn-border: rgba(36, 49, 79, 0.14);
  --panel: rgba(255, 255, 255, 0.96);
  --line: rgba(36, 49, 79, 0.12);
  --card: rgba(255, 255, 255, 0.66);
  --font-ui: var(--round);
  font-family: var(--round);
}

body[data-skin="kids"] .readout {
  font-family: var(--round);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.85);
}

body[data-skin="kids"] .readout.over {
  color: #d8443f;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.9);
}

body[data-skin="kids"] .label {
  font-weight: 700;
  letter-spacing: 0.24em;
}

body[data-skin="kids"] button {
  font-family: var(--round);
  font-weight: 600;
  box-shadow: 0 2px 0 rgba(36, 49, 79, 0.08);
}

body[data-skin="kids"] .brand span {
  color: #ff6b6b;
}

body[data-skin="kids"] .toast {
  color: #24314f;
}

body[data-skin="kids"] .skins button.on,
body[data-skin="kids"] .presets button.on,
body[data-skin="kids"] .modeseg button.on,
body[data-skin="kids"] button.primary {
  box-shadow: 0 4px 0 rgba(216, 68, 63, 0.28);
}

/* ---------- cozy skin ---------- */
body[data-skin="cozy"] {
  --page: #150c08;
  --text: #f7e7d1;
  --text-70: rgba(247, 231, 209, 0.72);
  --text-45: rgba(247, 231, 209, 0.46);
  --text-32: rgba(247, 231, 209, 0.34);
  --accent: #ffb066;
  --accent-soft: rgba(255, 176, 102, 0.5);
  --accent-text: #ffc089;
  --on-accent: #2a1508;
  --btn-bg: rgba(255, 176, 102, 0.07);
  --btn-bg-hover: rgba(255, 176, 102, 0.15);
  --btn-border: rgba(255, 176, 102, 0.2);
  --panel: rgba(24, 14, 9, 0.95);
  --line: rgba(255, 176, 102, 0.15);
  --card: rgba(255, 176, 102, 0.035);
  --font-ui: var(--round);
  font-family: var(--round);
}

body[data-skin="cozy"] .readout {
  font-family: var(--gothic);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-shadow: 0 0 26px rgba(255, 170, 90, 0.38), 0 0 60px rgba(255, 130, 50, 0.2);
}

body[data-skin="cozy"] .readout.over {
  color: #ffd6a0;
  text-shadow: 0 0 26px rgba(255, 200, 130, 0.45);
}

body[data-skin="cozy"] .label {
  font-family: var(--gothic);
  font-style: italic;
  letter-spacing: 0.28em;
}

body[data-skin="cozy"] button,
body[data-skin="cozy"] .custom input {
  font-family: var(--round);
}

body[data-skin="cozy"] .brand span {
  color: #ffb066;
}

body[data-skin="cozy"] .toast {
  color: #f7e7d1;
}

body[data-skin="cozy"] .skins button.on,
body[data-skin="cozy"] .presets button.on,
body[data-skin="cozy"] .modeseg button.on,
body[data-skin="cozy"] button.primary {
  box-shadow: 0 0 20px rgba(255, 160, 80, 0.28);
}

@media (max-width: 900px) {
  .topnote {
    display: none;
  }
}

@media (max-width: 720px) {
  .topnav {
    display: flex;
    gap: 12px;
    margin-left: 0;
  }
  .topnav a {
    font-size: 11.5px;
  }
  .topnav a[aria-current="page"]::after {
    bottom: -5px;
  }
  .langs {
    margin-left: auto;
  }
  .lang-btn {
    padding: 5px 6px;
  }
  .lang-name,
  .lang-caret {
    display: none;
  }
  .top-inner {
    gap: 14px;
    height: 50px;
  }
  .hero {
    padding-top: 28px;
    padding-bottom: 18px;
  }
  .hero h1 {
    max-width: none;
    font-size: clamp(28px, 7.6vw, 40px);
  }
  .lede {
    margin-top: 12px;
    font-size: 14.5px;
  }
  .stage {
    height: clamp(380px, 54vh, 560px);
    height: clamp(380px, 54svh, 560px);
  }
  .skins {
    top: 10px;
    flex-wrap: nowrap;
    padding: 3px;
    max-width: calc(100vw - 16px);
    overflow-x: auto;
  }
  .skins button span {
    display: none;
  }
  .skins button {
    padding: 7px 9px;
  }
  .stage {
    --hud-bottom: max(14px, env(safe-area-inset-bottom));
    --hud-gap: 7px;
  }
  .controls {
    flex-wrap: wrap;
    justify-content: center;
    max-width: 94%;
    gap: 6px;
  }
  button,
  .custom input {
    padding: 7px 11px;
    font-size: 11.5px;
  }
  .section {
    padding-top: 64px;
  }
  .section + .section {
    margin-top: 64px;
    padding-top: 52px;
  }
  .features,
  .uses,
  .steps {
    grid-template-columns: 1fr;
  }
  .tools {
    grid-template-columns: 1fr;
  }
  .foot {
    margin-top: 64px;
  }
}

@media (max-width: 720px) and (max-height: 700px) {
  .hero {
    padding-top: 18px;
    padding-bottom: 14px;
  }
  .hero h1 {
    font-size: 26px;
  }
  .lede {
    margin-top: 10px;
    font-size: 13.5px;
  }
  .chips {
    margin-top: 14px;
  }
  .stage {
    height: 380px;
  }
}
/* ---------- skin guide links in the footer ---------- */
.foot-skins {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  width: 100%;
  font-size: 12px;
}

.foot-skins a {
  color: var(--text-45);
}

.foot-skins a:hover {
  color: var(--accent);
  text-decoration: none;
}
