:root { color-scheme: dark; }
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: #000;
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
main { min-height: 100vh; min-height: 100dvh; }
.terminal {
  height: 100vh;
  height: 100dvh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: #000;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) calc(86px + env(safe-area-inset-bottom)) env(safe-area-inset-left);
}
header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .18);
  color: #d8ffd8;
  font-size: 12px;
}
pre {
	margin: 0;
	padding: 0;
	overflow: hidden;
	white-space: pre;
	color: #fff;
	background: #000;
}
input { width: 100%; accent-color: #fff; }
p { margin: 0; padding: 4px 12px; color: #d8ffd8; font-size: 12px; }
.mode { color: #d8ffd8; }
button {
  position: fixed;
  z-index: 2;
  border: 1px solid #fff;
  background: #000;
  color: #fff;
  font: inherit;
  cursor: pointer;
}
button:hover,
button:focus-visible {
  background: rgba(255, 255, 255, .16);
  outline: 2px solid #fff;
  outline-offset: 4px;
}
#start-btn {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 16px 32px;
  font-size: 24px;
}

.controls {
  position: fixed;
  z-index: 3;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, .18);
  background: linear-gradient(to top, rgba(0, 0, 0, .94), rgba(0, 0, 0, .72));
  color: #d8ffd8;
  font-size: 13px;
  opacity: 1;
  transform: translateY(0);
  transition: opacity .22s ease, transform .22s ease;
}

body.controls-idle .controls {
  opacity: 0;
  pointer-events: none;
  transform: translateY(calc(100% + env(safe-area-inset-bottom) + 12px));
}

.controls button {
  position: static;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border-color: rgba(255, 255, 255, .72);
  background: rgba(0, 0, 0, .78);
  color: #fff;
}

.timeline {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 160px;
  gap: 8px;
}

.time {
  min-width: 38px;
  color: #d8ffd8;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.progress {
  position: relative;
  flex: 1 1 auto;
  height: 20px;
  min-width: 80px;
}

.progress::before,
.buffered,
.played {
  position: absolute;
  top: 50%;
  left: 0;
  height: 3px;
  border-radius: 999px;
  transform: translateY(-50%);
}

.progress::before {
  right: 0;
  content: '';
  background: rgba(255, 255, 255, .22);
}

.buffered {
  width: 0;
  background: rgba(216, 255, 216, .36);
}

.played {
  width: 0;
  background: #fff;
}

#seek {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 20px;
  margin: 0;
  opacity: .001;
  cursor: pointer;
}

.volume {
  width: 96px;
  min-width: 72px;
}

.stream-trigger {
  display: none;
}

@media (max-width: 640px) {
  .terminal {
    padding-bottom: calc(140px + env(safe-area-inset-bottom));
  }

  .controls {
    flex-wrap: wrap;
    gap: 8px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .timeline {
    order: -1;
    flex-basis: 100%;
  }

  .volume {
    flex: 1 1 90px;
  }
}

