body {
  margin: 0;
  overflow: hidden;
  background-color: #000;
  font-family:
    "-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", sans-serif;
}

#container {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: transparent;
}

#input_video {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  z-index: 0;
  opacity: 1;
  filter: none;
  background: transparent;
  transition: opacity 3s ease;
}

#output_canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

#ui-layer {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
  padding: 40px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: opacity 0.5s;
}

.hud-text {
  color: rgba(255, 255, 255, 0.9);
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 500;
  font-family: "SF Mono", monospace;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}
.highlight {
  color: #fff;
  font-weight: 700;
  text-shadow: 0 0 15px rgba(255, 255, 255, 1);
}

#aim-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 180px;
  height: 180px;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  box-shadow: 0 0 25px rgba(200, 255, 255, 0.3);
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

#charge-text {
  position: absolute;
  top: 48%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  color: #fff;
  font-weight: 700;
  letter-spacing: 4px;
  opacity: 1;
  text-shadow: 0 0 25px rgba(255, 255, 255, 1);
  transition: opacity 0.3s;
}

#loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 11px;
  letter-spacing: 3px;
  z-index: 20;
  font-weight: 600;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

.fade-out {
  opacity: 0 !important;
}
.black-void {
  background: #000000 !important;
}

[hidden] {
  display: none !important;
}
* {
  box-sizing: border-box;
}
button,
input {
  font: inherit;
}
button {
  border: 1px solid #d6faff;
  background: #d6faff;
  color: #03191b;
  border-radius: 999px;
  padding: 11px 18px;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.2s;
}
button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #fff;
}
button:focus-visible,
input:focus-visible {
  outline: 3px solid #74e9fa;
  outline-offset: 4px;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button.secondary {
  background: #0b151bd9;
  color: #e9fbff;
  border-color: #a5c4d144;
}
button.secondary:hover:not(:disabled),
button[aria-pressed="true"] {
  background: #23434dcc;
  border-color: #99eaf6;
}
.panel {
  position: absolute;
  z-index: 30;
  width: min(560px, calc(100% - 40px));
  padding: 34px;
  border-radius: 22px;
  color: #eaf8fc;
  border: 1px solid #b7e9ff2b;
  background: #061016e8;
  backdrop-filter: blur(18px);
  box-shadow: 0 22px 90px #0008;
}
#welcome {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-height: calc(100dvh - 50px);
  overflow-y: auto;
}
.eyebrow {
  color: #91d5e3;
  font-size: 10px;
  letter-spacing: 2.4px;
  margin: 0 0 22px;
}
h1 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.12;
  font-weight: 500;
  letter-spacing: -1.3px;
  margin: 0 0 20px;
}
h2 {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 550;
}
.panel p {
  line-height: 1.65;
  font-size: 14px;
  color: #b8cbd3;
}
.panel p.fine-print {
  font-size: 11px;
  color: #86a0ad;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 22px 0 16px;
}
#status {
  margin: 15px 0 0;
  min-height: 22px;
  font-size: 12px;
  color: #99eaf6;
}
#toolbar {
  position: absolute;
  z-index: 35;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: max-content;
  max-width: calc(100% - 24px);
  flex-wrap: wrap;
}
#toolbar button {
  font-size: 12px;
  padding: 9px 14px;
}
#session-label {
  color: #b5dae2;
  font-size: 9px;
  letter-spacing: 1.4px;
  padding: 8px;
}
.guide {
  top: 70px;
  right: 24px;
  width: min(380px, calc(100% - 40px));
  max-height: calc(100dvh - 180px);
  overflow-y: auto;
  padding: 24px;
}
.guide p {
  font-size: 12px;
}
dl {
  margin: 22px 0;
}
dt {
  color: #dceff5;
  font-size: 12px;
  margin-top: 16px;
}
dd {
  color: #8bd7e6;
  font-size: 12px;
  margin: 5px 0 0;
}
#preview-controls {
  position: absolute;
  bottom: 94px;
  z-index: 25;
  left: 50%;
  transform: translateX(-50%);
  width: min(560px, calc(100% - 32px));
  color: #ceeef6;
  text-align: center;
}
#preview-controls .actions {
  justify-content: center;
  margin: 10px 0;
}
#preview-controls button {
  padding: 8px 14px;
  font-size: 11px;
}
#scale-control {
  font-size: 11px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}
#scale-slider {
  accent-color: #8ce6f3;
  width: 180px;
}
#runtime-status {
  position: absolute;
  top: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  color: #a9d7e0;
  font-size: 11px;
  max-width: min(600px, 70%);
  text-align: center;
  margin: 0;
}
@media (max-width: 600px) {
  #ui-layer {
    padding: 20px;
  }
  .panel {
    padding: 24px;
  }
  #toolbar {
    bottom: 16px;
    gap: 6px;
  }
  #session-label {
    display: none;
  }
  #preview-controls {
    bottom: 80px;
  }
  #runtime-status {
    top: 48px;
    max-width: 85%;
  }
  .guide {
    top: 70px;
    right: 20px;
  }
}
