:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #080a0d;
  color: #f6f8fb;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #080a0d;
}

body {
  min-width: 320px;
}

#playerCanvas {
  display: block;
  width: 100vw;
  height: 100vh;
  background: #080a0d;
}

.hud {
  position: fixed;
  top: 14px;
  left: 50%;
  z-index: 5;
  width: min(920px, calc(100vw - 24px));
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(8, 10, 13, 0.78);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
  transition: opacity 180ms ease, transform 180ms ease;
}

.hud.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -8px);
}

.hud-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
}

.hud-main {
  flex: 1 1 390px;
}

.hud-data {
  flex: 0 1 285px;
}

.hud-export {
  flex: 1 1 320px;
  justify-content: flex-end;
}

.loop-name {
  min-width: 130px;
  max-width: 230px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.9rem;
  font-weight: 750;
  letter-spacing: 0;
}

button,
select,
input,
.download-link {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.09);
  color: #f6f8fb;
  font: inherit;
  font-size: 0.86rem;
  line-height: 1;
}

button,
.download-link {
  padding: 0 12px;
  cursor: pointer;
}

button:hover,
button:focus-visible,
.download-link:hover,
.download-link:focus-visible {
  border-color: rgba(81, 218, 255, 0.76);
  background: rgba(81, 218, 255, 0.17);
  outline: none;
}

button:disabled {
  cursor: wait;
  opacity: 0.56;
}

select,
input {
  padding: 0 9px;
}

select {
  max-width: 190px;
}

input {
  width: 86px;
}

label,
#frameReadout,
#phaseReadout,
#exportStatus {
  color: rgba(246, 248, 251, 0.78);
  font-size: 0.82rem;
  white-space: nowrap;
}

#exportStatus {
  min-width: 88px;
}

.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.download-link[hidden] {
  display: none;
}

.webgl-error {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #080a0d;
  color: #f6f8fb;
  font-size: 1rem;
}

.webgl-error[hidden] {
  display: none;
}

@media (max-width: 760px) {
  .hud {
    align-items: stretch;
  }

  .hud-row,
  .hud-export {
    flex: 1 1 100%;
    justify-content: flex-start;
  }

  .loop-name {
    min-width: 100%;
    max-width: 100%;
  }

  button,
  select,
  input,
  .download-link {
    font-size: 0.8rem;
  }
}
