:root,
:root[data-palette='iris'] {
  --bg: #141626;
  --panel: #1d2037;
  --text: #ececf6;
  --muted: #a2a6bd;
  --faint: #868da9;
  --line: #2b2f49;
  --accent: #a99bff;
  --correct: #aebcff;
  --error: #ff7e92;
  --error-bg: #562c43;
  --key-case: #464061;
  --key-plate: #191d30;
  --key-color: #5d668b;
  --key-modifier: #393f63;
  --key-accent: #9383c7;
  --key-text: #e9e8ff;
}
:root[data-palette='forest'] {
  --bg: #101e1b;
  --panel: #172b25;
  --text: #e3f2e9;
  --muted: #9db7aa;
  --faint: #8ca79a;
  --line: #294539;
  --accent: #83d6ac;
  --correct: #b4e8c9;
  --error: #ff8995;
  --error-bg: #502d35;
  --key-case: #3b5547;
  --key-plate: #13231c;
  --key-color: #527965;
  --key-modifier: #304f3e;
  --key-accent: #8fba9e;
  --key-text: #e8fff0;
  --key-light: #a4e6bb;
}
:root[data-palette='gold'] {
  --bg: #111215;
  --panel: #1b1c20;
  --text: #f0eade;
  --muted: #b1aaa0;
  --faint: #9c968c;
  --line: #36332b;
  --accent: #e6bd6b;
  --correct: #ead29a;
  --error: #ff8590;
  --error-bg: #502b33;
  --key-case: #504531;
  --key-plate: #151619;
  --key-color: #47464a;
  --key-modifier: #27292e;
  --key-accent: #b38f4f;
  --key-text: #f6ecd6;
  --key-light: #ffe0a0;
}
:root[data-theme='light'] {
  --bg: #f1f2fc;
  --panel: #e6e8f8;
  --text: #2b2a43;
  --muted: #70728c;
  --faint: #7c7f99;
  --line: #d4d7ed;
  --accent: #6a4fc8;
  --correct: #4d5fc0;
  --error: #c33c5e;
  --error-bg: #f8dce6;
  --key-case: #8589b4;
  --key-plate: #9ca3c8;
  --key-color: #dae0f6;
  --key-modifier: #b9c0e3;
  --key-accent: #aba1dc;
  --key-text: #303352;
}
.palette-control {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: var(--muted);
}
.palette-control select {
  font: 13px var(--sans);
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 6px;
  padding: 8px 29px 8px 12px;
  max-width: 170px;
}
.site-header > .theme-toggle {
  margin-left: -45px;
}
.typing-main {
  padding-top: 28px;
}
.site-header {
  height: 82px;
  padding-top: 25px;
}
.page-heading {
  margin-bottom: 24px;
}
.page-heading h1 {
  font-size: 28px;
}
.controls {
  margin-bottom: 23px;
}
.live-stats {
  margin: 16px 0;
}
.practice-bottom {
  margin-top: 10px;
}
.scene-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 22px;
  gap: 15px;
  color: var(--muted);
  font-size: 12px;
}
.scene-toolbar button {
  color: var(--accent);
  font-size: 12px;
  padding: 7px 0;
}
.scene-caption {
  display: flex;
  gap: 14px;
  align-items: center;
}
.scene-caption span:first-child {
  font: 12px var(--mono);
  letter-spacing: 0.1em;
}
.keyboard-scene {
  height: 300px;
  width: 100%;
  position: relative;
  touch-action: pan-y;
  overflow: hidden;
  cursor: pointer;
}
.keyboard-scene canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.keyboard-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 20px;
}
.test-actions {
  margin-top: 0;
}
.shortcuts {
  margin-top: 22px;
}
.method-note {
  margin: 15px 0 28px;
}
.practice:has(.running) ~ .shortcuts,
.practice:has(.running) .scene-toolbar {
  opacity: 0.5;
}
.scene-toolbar,
.shortcuts {
  transition: opacity 0.25s;
}
.home-main {
  padding-top: 65px;
}
.brand-icon,
.heading-cursor {
  color: var(--accent);
}
@media (min-width: 1400px) {
  .typing-main {
    padding-top: 38px;
  }
  .controls {
    margin-bottom: 25px;
  }
  .test-actions {
    margin-top: 0;
  }
  .keyboard-scene {
    height: 320px;
  }
}
@media (max-width: 800px) {
  .site-header {
    gap: 28px;
  }
  .palette-control {
    gap: 0;
  }
  .palette-control > span {
    display: none;
  }
  .site-header > .theme-toggle {
    margin-left: 0;
  }
  .keyboard-scene {
    height: 240px;
  }
  .scene-caption span + span {
    display: none;
  }
  .typing-main {
    padding-top: 28px;
  }
}
@media (max-width: 560px) {
  .site-header {
    flex-wrap: wrap;
    height: auto;
    gap: 18px 22px;
    padding-top: 23px;
  }
  .site-header nav {
    height: 44px;
  }
  .palette-control {
    order: 4;
    margin: 0;
    width: 100%;
  }
  .palette-control > span {
    display: inline;
    margin-right: 12px;
  }
  .palette-control select {
    flex: 1;
    max-width: none;
  }
  .site-header > .theme-toggle {
    margin-left: auto;
  }
  .typing-main {
    padding-top: 28px;
  }
  .controls {
    margin-bottom: 24px;
  }
  .keyboard-scene {
    height: 180px;
  }
  .scene-toolbar {
    margin-top: 16px;
    font-size: 12px;
  }
  .page-heading {
    margin-bottom: 20px;
  }
}
