*, :before, :after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html, body {
  color: #e2e8f0;
  -webkit-font-smoothing: antialiased;
  background: #070b14;
  height: 100%;
  margin: 0;
  font: 500 14px / 1.45 system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Noto Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;
  overflow: hidden;
}

#view {
  touch-action: none;
  cursor: default;
  width: 100%;
  height: 100%;
  display: block;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
}

.perf {
  z-index: 20;
  pointer-events: none;
  height: 30px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  overflow: hidden;
}

.perf canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.perf-fps {
  z-index: 20;
  color: #4ade80;
  pointer-events: none;
  background: #0206178c;
  border-radius: 6px;
  padding: 2px 7px;
  font: 800 15px / 1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  position: fixed;
  top: 36px;
  left: 8px;
}

.perf-fps small {
  opacity: .7;
  letter-spacing: .04em;
  color: #e2e8f0;
  margin-left: 3px;
  font: 700 9px system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Noto Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;
}

#crosshair {
  z-index: 4;
  pointer-events: none;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  position: fixed;
  top: 50%;
  left: 50%;
}

#crosshair:before, #crosshair:after {
  content: "";
  background: #7cf7c2;
  position: absolute;
  box-shadow: 0 0 0 1px #02061799;
}

#crosshair:before {
  width: 2px;
  height: 22px;
  top: 0;
  left: 10px;
}

#crosshair:after {
  width: 22px;
  height: 2px;
  top: 10px;
  left: 0;
}

#crosshair.miss:before, #crosshair.miss:after {
  background: #f87171;
}

#hud {
  z-index: 4;
  pointer-events: none;
  justify-content: center;
  gap: 34px;
  display: flex;
  position: fixed;
  top: 6px;
  left: 0;
  right: 0;
}

#hud .stat {
  background: #02061780;
  border-radius: 8px;
  align-items: baseline;
  gap: 6px;
  padding: 4px 12px;
  display: flex;
}

#hud b {
  font-variant-numeric: tabular-nums;
  font: 800 22px / 1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

#hud small {
  letter-spacing: .09em;
  opacity: .6;
  font: 700 9px system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Noto Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;
}

#hud-time.low {
  color: #f87171;
}

#input-badge {
  z-index: 4;
  text-align: center;
  letter-spacing: .12em;
  color: #4ade80;
  opacity: .75;
  pointer-events: none;
  font: 700 10px / 1 ui-monospace, SFMono-Regular, Menlo, monospace;
  position: fixed;
  bottom: 10px;
  left: 0;
  right: 0;
}

#input-badge.warn {
  color: #fbbf24;
}

#overlay {
  z-index: 10;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  background: radial-gradient(120% 90% at 50% 0, #0f172ab8, #03060feb);
  justify-content: center;
  align-items: center;
  padding: 20px;
  display: flex;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
}

.panel {
  text-align: center;
  background: #080d1aeb;
  border: 1px solid #94a3b829;
  border-radius: 16px;
  width: min(560px, 100%);
  max-height: 100%;
  padding: 22px 24px 20px;
  overflow: auto;
  box-shadow: 0 24px 60px #00000080;
}

.panel h1 {
  letter-spacing: -.02em;
  margin: 0;
  font: 800 34px / 1.1 system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Noto Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;
}

.panel h2 {
  margin: 0 0 6px;
  font: 800 24px / 1.2 system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Noto Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;
}

.tag {
  color: #94a3b8;
  max-width: 44ch;
  margin: 8px auto 18px;
}

.modes {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
  display: grid;
}

.mode {
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  background: #0f172ab3;
  border: 1px solid #94a3b833;
  border-radius: 12px;
  padding: 12px 14px;
  display: block;
}

.mode:hover {
  border-color: #7cf7c273;
}

.mode[aria-pressed="true"] {
  background: #104e3e73;
  border-color: #34d399;
}

.mode b {
  margin-bottom: 3px;
  font-size: 15px;
  display: block;
}

.mode span {
  color: #94a3b8;
  font-size: 12px;
}

.row {
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 16px;
  margin-bottom: 12px;
  display: flex;
}

.row label {
  color: #94a3b8;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  display: flex;
}

.row input[type="number"], .row select {
  color: #e2e8f0;
  background: #020617cc;
  border: 1px solid #94a3b840;
  border-radius: 7px;
  width: 74px;
  padding: 5px 7px;
  font: 700 13px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.row select {
  width: 82px;
}

.toggles label {
  cursor: pointer;
}

.play {
  color: #04231a;
  letter-spacing: .01em;
  cursor: pointer;
  background: linear-gradient(#34d399, #10b981);
  border: 0;
  border-radius: 11px;
  width: 100%;
  margin: 6px 0 10px;
  padding: 12px 18px;
  font: 800 16px / 1 system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Noto Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;
}

.play:hover {
  filter: brightness(1.07);
}

.hint, .best {
  color: #64748b;
  margin: 4px 0 0;
  font-size: 12px;
}

.best {
  color: #94a3b8;
}

kbd {
  background: #020617b3;
  border: 1px solid #94a3b84d;
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 5px;
  font: 700 11px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.error {
  color: #f87171;
  margin-top: 10px;
  font-size: 12px;
}

.score {
  justify-content: center;
  align-items: baseline;
  gap: 8px;
  margin: 10px 0 14px;
  display: flex;
}

.score b {
  color: #7cf7c2;
  font-variant-numeric: tabular-nums;
  font: 800 52px / 1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.score small, .stats small {
  letter-spacing: .1em;
  color: #64748b;
  font: 700 9px system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Noto Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;
  display: block;
}

.stats {
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
  display: grid;
}

.stats b {
  font-variant-numeric: tabular-nums;
  font: 800 19px / 1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
  display: block;
}

