@font-face {
  font-family: "Maple Mono NF CN";
  src: url("./MapleMono-NF-CN-Medium.ttf") format("truetype");
}

:root {
  --color-primary: #00bcd4;
  --color-secondary: #2196f3;
  --color-tertiary: #00e5ff;
  --color-quaternary: #536dfe;
  --color-surface: #0a0e17;
  --brightness: 1;
}

* {
  box-sizing: border-box;
}

:root {
  font-size: 60%;
}

body {
  width: 100vw;
  height: 100vh;
  display: grid;
  place-items: center;
  background-color: #060b14;
  color: var(--color-primary);
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 188, 212, 0.015) 2px,
    rgba(0, 188, 212, 0.015) 4px
  );
}

#output {
  position: relative;
  text-align: center;
  border-radius: 2rem;
  font-family: "Maple Mono NF CN", "SF Mono", "Fira Code", "Cascadia Code", monospace;
  overflow: hidden;
  filter: drop-shadow(
      0 0 8rem color-mix(in srgb, var(--color), transparent 20%)
    )
    brightness(var(--brightness));
  transition: filter 0.3s linear;
  white-space: nowrap;
  background: black;
}

#output div,
#output span {
  white-space: nowrap;
}

#input,
#prerender {
  display: none;
  position: absolute;
  left: 0;
  top: 0;
}

.screen {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  z-index: 100;
  background: rgba(6, 11, 20, 0.92);
  backdrop-filter: blur(12px);
}

.screen.active {
  display: grid;
}

.selection-card,
.settings-card {
  background: var(--color-surface);
  border: 2px solid var(--color-primary);
  border-radius: 16px;
  padding: 40px 48px;
  text-align: center;
  box-shadow: 0 0 40px rgba(0, 188, 212, 0.15),
              0 8px 32px rgba(0, 0, 0, 0.5);
  max-width: 560px;
  width: 90%;
}

.selection-card h2,
.settings-card h2 {
  margin: 0 0 8px;
  font-size: 28px;
  color: var(--color-tertiary);
  letter-spacing: 2px;
}

.subtitle {
  margin: 0 0 32px;
  color: rgba(0, 229, 255, 0.6);
  font-size: 14px;
}

.file-upload-zone {
  margin-bottom: 20px;
}

.file-upload-zone input[type="file"] {
  display: none;
}

.file-upload-zone label {
  display: block;
  padding: 28px 24px;
  border: 2px dashed var(--color-primary);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  color: rgba(0, 188, 212, 0.7);
  font-size: 14px;
}

.file-upload-zone label:hover {
  border-color: var(--color-tertiary);
  background: rgba(0, 188, 212, 0.06);
  color: var(--color-tertiary);
}

.upload-icon {
  display: block;
  font-size: 36px;
  margin-bottom: 8px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 16px 0;
  color: rgba(0, 188, 212, 0.3);
  font-size: 12px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(0, 188, 212, 0.15);
}

.btn-primary,
.btn-secondary,
.btn-control {
  display: inline-block;
  padding: 14px 40px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  letter-spacing: 1px;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.btn-primary {
  background: var(--color-primary);
  color: #0a0e17;
  margin-top: 24px;
  box-shadow: 0 0 20px rgba(0, 188, 212, 0.3);
}

.btn-primary:hover {
  background: var(--color-tertiary);
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(0, 229, 255, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: transparent;
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
  width: 100%;
}

.btn-secondary:hover {
  background: rgba(0, 188, 212, 0.1);
  border-color: var(--color-tertiary);
  color: var(--color-tertiary);
}

#playback-controls {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: none;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  background: rgba(10, 14, 23, 0.88);
  border: 1px solid rgba(0, 188, 212, 0.25);
  border-radius: 12px;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5),
              0 0 30px rgba(0, 188, 212, 0.08);
}

#playback-controls.visible {
  display: flex;
}

.ctrl-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--color-primary);
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  flex-shrink: 0;
}

.ctrl-icon-btn:hover {
  background: rgba(0, 188, 212, 0.12);
  border-color: rgba(0, 188, 212, 0.3);
  color: var(--color-tertiary);
}

.ctrl-group {
  display: flex;
  align-items: center;
  gap: 5px;
}

.ctrl-label {
  font-size: 12px;
  color: var(--color-primary);
  opacity: 0.7;
  flex-shrink: 0;
  width: 14px;
  text-align: center;
}

.ctrl-group input[type="range"] {
  width: 64px;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: rgba(0, 188, 212, 0.15);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 1.5px solid var(--color-tertiary);
  cursor: pointer;
  box-shadow: 0 0 6px rgba(0, 188, 212, 0.4);
}

input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 1.5px solid var(--color-tertiary);
  cursor: pointer;
  box-shadow: 0 0 6px rgba(0, 188, 212, 0.4);
}

#start-play-btn {
  margin-top: 20px;
}

#tweakpane-container {
  display: flex;
  justify-content: center;
  margin: 16px 0;
  min-height: 200px;
}

#tweakpane-container .tp-dfwv {
  position: relative !important;
  inset: auto !important;
}

a.labs-follow-me {
  left: 2rem;
  right: 2rem;
  bottom: 1rem;
  top: unset;
  text-align: center;
}

:root {
  --tp-base-background-color: var(--color-surface);
  --tp-base-shadow-color: hsla(0, 0%, 0%, 0.3);
  --tp-button-background-color: var(--color-secondary);
  --tp-button-background-color-active: hsl(207, 90%, 60%);
  --tp-button-background-color-focus: hsl(207, 90%, 55%);
  --tp-button-background-color-hover: hsl(207, 90%, 50%);
  --tp-button-foreground-color: #fff;
  --tp-container-background-color: hsla(207, 90%, 60%, 0.08);
  --tp-container-background-color-active: hsla(207, 90%, 60%, 0.25);
  --tp-container-background-color-focus: hsla(207, 90%, 60%, 0.15);
  --tp-container-background-color-hover: hsla(207, 90%, 60%, 0.1);
  --tp-container-foreground-color: hsla(207, 90%, 85%, 1);
  --tp-groove-foreground-color: hsla(207, 90%, 60%, 0.1);
  --tp-input-background-color: hsla(207, 90%, 60%, 0.08);
  --tp-input-background-color-active: hsla(207, 90%, 60%, 0.25);
  --tp-input-background-color-focus: hsla(207, 90%, 60%, 0.15);
  --tp-input-background-color-hover: hsla(207, 90%, 60%, 0.1);
  --tp-input-foreground-color: var(--color-primary);
  --tp-label-foreground-color: hsla(207, 90%, 80%, 0.7);
  --tp-monitor-background-color: rgba(0, 0, 0, 0.3);
  --tp-monitor-foreground-color: hsla(207, 90%, 75%, 0.7);
}
