:root {
  color-scheme: dark;
  font:
    14px/1.45 system-ui,
    sans-serif;
  color: #f3ece0;
  background: #120d0a;
  --panel: #1e1612f0;
  --raised: #2b211b;
  --line: #4a3a2e;
  --muted: #b3a493;
  --gold: #f2c46d;
  --ink-on-gold: #2a1c08;
  --string-0: #6cb6ff;
  --string-1: #5ad19a;
  --string-2: #ffb454;
  --string-3: #ff7a7a;
}
[hidden] {
  display: none !important;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
}
body {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  background: #120d0a;
  -webkit-tap-highlight-color: transparent;
}
button,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
.label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted);
}
kbd {
  display: inline-block;
  padding: 0 5px;
  border: 1px solid #6a5848;
  border-bottom-width: 2px;
  border-radius: 4px;
  font:
    600 11px/1.5 ui-monospace,
    Menlo,
    monospace;
  color: #fff;
  background: #2b211b;
}

/* The bar */
.bar {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: max(10px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px
    max(16px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
  background: #17110d;
  z-index: 5;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
  font-size: 20px;
  font-weight: 850;
  letter-spacing: -0.5px;
}
.logo {
  font-size: 26px;
  color: var(--gold);
  line-height: 1;
}
.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-left: auto;
}
.seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #1e1612;
}
.seg button {
  min-height: 36px;
  padding: 6px 12px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--muted);
}
.seg button[aria-checked='true'] {
  background: var(--raised);
  color: #fff;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px #6a5848;
}
.key-pick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
select {
  min-height: 36px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #1e1612;
}
.primary,
.ghost,
.icon {
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #1e1612;
}
.primary {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--ink-on-gold);
  font-weight: 750;
}
.primary.big {
  min-height: 48px;
  padding: 10px 28px;
  font-size: 17px;
}
.ghost:hover,
.icon:hover {
  background: var(--raised);
}
.icon {
  width: 38px;
  padding: 0;
  font-size: 18px;
}
.menu {
  position: absolute;
  top: 100%;
  right: max(16px, env(safe-area-inset-right));
  display: grid;
  gap: 10px;
  min-width: 220px;
  margin-top: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 16px 40px #000a;
}
.menu label {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* The stage */
.stage {
  position: relative;
  flex: 1;
  min-height: 0;
}
#cello {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.loading {
  position: absolute;
  bottom: 16px;
  left: 50%;
  translate: -50% 0;
  padding: 6px 14px;
  border-radius: 99px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  pointer-events: none;
  transition: opacity 0.6s;
}
.loading.gone {
  opacity: 0;
}
.hint {
  position: absolute;
  bottom: max(14px, env(safe-area-inset-bottom));
  left: 16px;
  right: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  pointer-events: none;
}
.hint.show {
  color: var(--gold);
  font-weight: 700;
}
.loading:not(.gone) ~ .hint {
  visibility: hidden;
}

/* The song guide */
.guide {
  position: absolute;
  top: 12px;
  left: 50%;
  translate: -50% 0;
  width: min(920px, calc(100% - 32px));
  padding: 10px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 12px 30px #0008;
}
.guide.miss {
  animation: shake 0.3s;
}
@keyframes shake {
  25% {
    translate: calc(-50% - 6px) 0;
  }
  75% {
    translate: calc(-50% + 6px) 0;
  }
}
.guide-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.guide-head .ghost {
  min-height: 32px;
  padding: 4px 10px;
}
.spacer {
  flex: 1;
}
.notes {
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: hidden;
}
.notes li {
  flex: none;
  display: grid;
  place-items: center;
  width: calc(28px + var(--beats) * 16px);
  min-width: 44px;
  height: 52px;
  border-radius: 10px;
  border: 1px solid var(--line);
  border-bottom: 4px solid var(--hue, var(--line));
  background: #2a201a;
  transition: opacity 0.2s;
}
.notes li b {
  font-size: 17px;
  line-height: 1;
}
.notes li span {
  font-size: 10px;
  color: var(--muted);
}
.notes li.past {
  opacity: 0.3;
}
.notes li.now {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink-on-gold);
  box-shadow: 0 0 18px #f2c46d66;
}
.notes li.now span {
  color: var(--ink-on-gold);
}
.progress {
  height: 4px;
  margin-top: 10px;
  border-radius: 2px;
  background: #3a2e25;
  overflow: hidden;
}
.progress div {
  height: 100%;
  width: 0;
  background: var(--gold);
  transition: width 0.25s;
}

/* Overlays */
.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: #0a0705c4;
  backdrop-filter: blur(3px);
  z-index: 10;
}
.card {
  width: min(440px, 100%);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 24px 60px #000c;
  text-align: center;
}
.card.wide {
  width: min(620px, 100%);
  text-align: left;
}
.card h1,
.card h2 {
  margin: 4px 0 8px;
}
.card .primary,
.card .ghost {
  margin: 6px 4px 0;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.big-logo {
  font-size: 64px;
  line-height: 1;
  color: var(--gold);
}
.how {
  margin: 14px 0 18px;
  padding-left: 18px;
  text-align: left;
}
.how li {
  margin: 6px 0;
}
body.touch .keyboard-only,
body:not(.touch) .touch-only {
  display: none;
}
.song-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.song {
  display: grid;
  grid-template-columns: 1fr auto auto;
  grid-template-areas: 'title level stars' 'by level stars';
  align-items: center;
  gap: 2px 14px;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #241b16;
  text-align: left;
}
.song:hover {
  border-color: var(--gold);
}
.song-title {
  grid-area: title;
  font-weight: 700;
}
.song-by {
  grid-area: by;
}
.song-level {
  grid-area: level;
  color: var(--muted);
  letter-spacing: 2px;
}
.song-stars {
  grid-area: stars;
  color: var(--gold);
  font-size: 16px;
}
.stars {
  margin: 8px 0;
  font-size: 44px;
  color: var(--gold);
  letter-spacing: 6px;
}

@media (max-width: 700px) {
  .bar {
    gap: 8px;
  }
  .controls {
    margin-left: 0;
    width: 100%;
  }
  .key-pick .label {
    display: none;
  }
  .seg button {
    padding: 6px 9px;
  }
  .notes li {
    height: 46px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .guide.miss {
    animation: none;
  }
}
