:root {
  --test: light-dark(oklch(100% 0 0), oklch(0% 0 0));
  --bg: light-dark(oklch(90.935% 0.00956 93.609), oklch(0% 0 0));
  --fg: light-dark(oklch(29.852% 0.00456 67.487), oklch(100% 0.00011 271.152));
  --bgBelow: light-dark(oklch(81.651% 0.01965 93.723), oklch(0% 0 0));
  --fgBelow: light-dark(oklch(42.611% 0.00511 55.962), oklch(100% 0.00011 271.152));
  --bgAbove: light-dark(oklch(95.977% 0.00652 106.783), oklch(0% 0 0));
  --fgAbove: light-dark(oklch(42.146% 0.009 80.644), oklch(100% 0.00011 271.152));
  --fgAccent: light-dark(oklch(53.329% 0.14263 252.504), oklch(78.082% 0.11694 225.348));
  --bgError: light-dark(oklch(41.046% 0.15945 29.262), oklch(64.202% 0.13772 31.601));
  --fgError: light-dark(oklch(81.938% 0.05794 39.988), oklch(26.182% 0.08471 22.502));
}

#variableColorTest {
  color: yellow;
  color: var(--test);
  background: black;
  background: var(--test);
  display: block;
  width: 100%;
  font-weight: 700;
  font-size: 1.5rem;
  font-size: light-dark(0.0rem, 0.0rem);
}

.right {
  text-align: right;
}

body {
  margin: 0;
  width: 100svw;
  height: 100svh;
  overflow: hidden;
  position: fixed;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 35px 1fr 35px;
  background: var(--bgBelow);
  color: var(--fgBelow);
  font-family: "Andika", sans-serif;
}

header {
  grid-column-start: 1;
  grid-column-end: 1;
  grid-row-start: 1;
  grid-row-end: 1;
  text-align: center;
  padding-top: 4px;
  text-wrap: nowrap;
  overflow-x: clip;
  position: relative;
}

h1 {
  margin: 0;
  font-weight: 700;
  font-size: 24px;
  line-height: 31px;
  animation: none;
  width: fit-content;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

@keyframes marquee {
    0% {transform: translateX(calc(-100% + 45svw));}
   10% {transform: translateX(calc(-100% + 45svw));}
   40% {transform: translateX(calc(0% - 45svw));}
   60% {transform: translateX(calc(0% - 45svw));}
   90% {transform: translateX(calc(-100% + 45svw));}
  100% {transform: translateX(calc(-100% + 45svw));}
}

h3 {
  font-weight: 400;
  font-size: 1.25rem;
  display: block;
  background: var(--fg);
  color: var(--bg);
  padding: 4px 12px;
  border-radius: 8px;
}

h4 {
  font-weight: 700;
  font-size: 1rem;
  color: var(--fgAbove);
  margin-block: 8px;
}

footer {
  grid-column-start: 1;
  grid-column-end: 1;
  grid-row-start: 3;
  grid-row-end: 3;
  text-align: center;
}

section {
  grid-column-start: 1;
  grid-column-end: 1;
  grid-row-start: 2;
  grid-row-end: 2;
  background: var(--bg);
  color: var(--fg);
  margin: 4px 16px;
  border-radius: 16px;
  padding: 8px;
  overflow: hidden;
  position: relative;
}

section > .firefoxScrollbarFix {
  position: absolute;
  inset: 0 8px;
  overflow-y: auto;
  scrollbar-gutter: stable both-edges;
}

/* Dimension icons */

img.icon {
  display: inline;
  vertical-align: center;
  width: auto;
  height: 1.5em;
}

img.icon.inv {
  filter: invert(100%);
}

@media (prefers-color-scheme: dark) {
  img.icon.inv {
    filter: invert(0%);
  }
}

/* List of question counts and diffs */

ul.labelList {
  margin: 0px;
  padding: 0px;
}

ul.labelList li {
  display: inline-block;
  margin: 0px;
  padding: 0px 4px 4px 0px;
}

ul.labelList li label {
  display: block;
  background: var(--bgAbove);
  color: var(--fgAbove);
  padding: 8px;
  border-radius: 8px;
}

ul.labelList li input[type="radio"] {
  margin: 0;
  margin-right: 4px;
}

/* Undo ugly default button and input styling */

button {
  font-family: inherit;
  font-weight: inherit;
  font-style: inherit;
  font-size: inherit;
  background: var(--fgAccent);
  color: var(--bgAbove);
  border: 2px outset var(--fgAccent);
  box-shadow: 0px 1px 4px rgb(from black r g b / 0.25);
  border-radius: 8px;
  transition: transform ease-out 500ms;
}

button:active {
  border: 2px inset var(--fgAccent);
  transform: scale(110%);
  transition: none;
}

button:disabled {
  background: var(--bgBelow);
  color: var(--fgBelow);
  border: 2px outset var(--bgBelow);
  box-shadow: none;
}

input[type="number"], input[type="text"] {
  font-family: inherit;
  font-weight: inherit;
  font-style: inherit;
  font-size: inherit;
  background: var(--bgAbove);
  color: var(--fgAbove);
  border: 2px inset var(--bg);
  border-radius: 4px;
  text-align: right;
}

input[type="number"]:disabled, input[type="text"]:disabled {
  background: var(--bg);
  color: var(--fg);
  border-color: var(--bg);
}

input[type="checkbox"], input[type="radio"] {
  accent-color: var(--fgAccent);
}

/* question page styling */
/* decorative music notes */
.soundVisualizer {
  width: 100%;
  height: 128px;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: stretch;
  gap: 8px;
}

.soundVisualizer .soundBox {
  flex: 0 1 128px;
  background: oklch(30.777% 0.064 266.859);
  border-radius: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.soundVisualizer .soundBox img {
  height: 80px;
  width: auto;
}

.soundVisualizer .soundBox:first-child img {
  animation: 2.5s linear 0s 1 running low-note;
  transform: scale(100%);
}
.soundVisualizer .soundBox:last-child img {
  animation: 2.5s linear 0s 1 running high-note;
  transform: scale(100%);
}
/* 0.0s / 2.5s = 0%
   0.8s / 2.5s = 32%
   1.8s / 2.5s = 72% */
@keyframes low-note {
    0% {transform: scale(100%);}
    1% {transform: scale(110%);}
   28% {transform: scale(100%);}
   72% {transform: scale(100%);}
   73% {transform: scale(110%);}
  100% {transform: scale(100%);}
}
@keyframes high-note {
    0% {transform: scale(100%);}
   32% {transform: scale(100%);}
   33% {transform: scale(110%);}
   50% {transform: scale(100%);}
   72% {transform: scale(100%);}
   73% {transform: scale(110%);}
  100% {transform: scale(100%);}
}

/* answer box layout */
#answerBox {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: stretch;
  gap: 16px;
  margin-block: 8px;
}

#answerDims {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  flex: 0 0 fit-content;
}

#answerDims > div > label {
  display: inline-block;
  text-align: center;
  min-width: 32px;
}

#answerDims > div > input {
  display: inline-block;
  text-align: right;
  width: 64px;
}

.flexSpacer {
  flex: 1 0 0px;
}

#answerAssists {
  display: flex;
  flex-direction: column;
  justify-content: stretch;
}

/* answer up/down buttons */
.btnRoller {
  min-width: 32px;
  margin-left: 8px; /* for touch accessibility */
}

/* answer Shasavic harmonym */
#answerNoteName {
  text-align: left;
  font-style: italic;
  font-weight: bold;
  width: 8em;
}

#noteNamePopoverAnchor {
  width: 100%;
  height: 0px;
  overflow: visible;
  position: relative;
}

#noteNamePopover {
  position: absolute;
  right: 0;
  bottom: 0;
}

#noteNamePopoverBody {
  background: var(--bgError);
  border-radius: 8px;
  padding: 4px 8px;
  color: var(--fgError);
}

#noteNamePopoverTail {
  width: 0px;
  height: 0px;
  background: transparent;
  border: 8px solid transparent;
  border-bottom-width: 0px;
  border-top-color: var(--bgError);
  margin-left: auto;
  margin-right: 8px;
}

#answerSoundBoxes {
  width: fit-content;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 266px;
  gap: 8px;
}

@media screen and (min-width: 620px) {
  #answerSoundBoxes {
    grid-template-columns: repeat(2, 266px);
  }
}

.answerCaption {
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  gap: 8px;
}

.answerCaption .answerDims {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}

/* Results screen */
@property --pieAngle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@property --ratingColor {
  syntax: "<color>";
  inherits: false;
  initial-value: oklch(50% 0.23024 296.746);
}

#resultsPieChart {
  display: block;
  float: right;
  width: 200px;
  height: 200px;
  background: oklab(0% 0 0);
  background: conic-gradient(
    from 0turn at 50% 50%,
    var(--ratingColor) 0deg var(--pieAngle),
    oklch(10% 0.0 0) var(--pieAngle) 360deg
  );
  border-radius: 50%;
  overflow: clip;
  border: 4px solid oklab(0% 0 0);
  position: relative;
}

#resultsPieChart .clip {
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  inset: 40px;
  border-radius: 50%;
  font-size: 32px;
  font-weight: bold;
  background: oklab(0% 0 0);
  color: oklab(85% 0 0);
}

#resultsIncorrect .answerDims {
  display: inline-block;
  padding: 2px 4px;
  background: var(--bgAbove);
  color: var(--fgAbove);
  border-radius: 4px;
}

#resultsIncorrect .answerDims + .answerDims {
  margin-left: 8px;
}

#resultsIncorrect .answerDims > div {
  display: inline-block;
}