:root {
  --bg: rgba(12, 12, 14, 0.6);
  --accent: #80ff00;
  --muted: #80ff00;
  --control-gap: 10px;
  --radius: 8px;
  --control-padding: 10px;
  font-family: Inter, system-ui, -Helvetica-system, "Helvetica UI", Helvetica, "Helvetica Neue", Helvetica;
  --mouse-default: rgb(128, 255, 0);
  /* lime green normally */
  --mouse-controls: rgb(255, 255, 255);
  /* white when over controls */
  --mouse-pressed: rgba(0, 0, 0, 0.85);
}

/* hide the OS cursor and use the custom mouse-ball instead */
html,
body {
  cursor: none;
}

/* FORCE: hide native OS cursor everywhere so only #mouse-ball is visible */
html,
body,
* {
  cursor: none !important;
}

/* Ensure interactive controls still receive pointer events (mouse-ball has pointer-events: none) */
.controls,
.controls * {
  pointer-events: auto;
  /* cursor is still none via the rule above */
}

/* make canvas (three.js renderer) hide cursor too */
canvas,
.three-canvas {
  cursor: none !important;
}

/* ensure controls don't show native cursor (circle will change instead) */
.controls,
.controls * {
  cursor: none !important;
}

/* ensure native cursor is hidden everywhere so only the mouse-ball is visible */
html,
body {
  cursor: none;
}


.controls {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 999;
  display: flex;
  gap: var(--control-gap);
  align-items: center;
  padding: var(--control-padding);
  border-radius: var(--radius);
  align-items: center;
  pointer-events: auto;
}

/* file input hide default button and style label-like */
.controls input[type="file"] {
  color: transparent;
  width: 36px;
  height: 36px;
  opacity: 0;
  position: relative;
}

.controls input[type="file"]::before {
  content: "🎵";
}

/* buttons */
.controls button {
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  color: #fff;
  padding: 6px 10px;
  cursor: pointer;
  font-weight: 600;
  transition: transform .12s ease, background .12s ease, box-shadow .12s ease;
}

.controls button:disabled {
  opacity: 0.45;
  cursor: default;
}

.controls button:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  border-color: rgba(255, 255, 255, 0.18);
}

/* select */
.controls select {
  background: var(--btn-bg);
  color: #fff;
  border: 1px solid var(--btn-border);
  padding: 6px 8px;
  border-radius: 6px;
  outline: none;
}

.controls select:focus {
  outline: none;
}

/* range styling (WebKit + fallback) */

.controls input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;

  cursor: pointer;
}

.controls input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

/* time label */
#timeLabel {
  font-size: 14px;
  color: var(--muted);
  margin-left: 6px;
  min-width: 84px;
  text-align: right;
}

/* file button: hides native input but shows a styled button + filename */
.file-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.file-btn input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
}

.file-btn .file-label {
  color: var(--accent);
  border: 1px solid var(--btn-border);
  padding: 6px 10px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
}

.file-btn .file-name {
  font-size: 12px;
  color: var(--muted);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* responsive: compact controls on small screens */
@media (max-width: 640px) {
  .controls {
    left: 8px;
    top: 8px;
    padding: 8px;
    gap: 6px;
    flex-wrap: nowrap;
  }

  .controls input[type="range"] {
    width: 110px;
  }

  #timeLabel {
    display: none;
  }
}

/* --- new: shape variants for controls --- */

/* Icon-only circular buttons (hide text, show simple circle) */
.controls.icon-only button {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  justify-content: center;
  gap: 0;
}

.controls.icon-only button .btn-text {
  display: none;
}

.controls.icon-only button .icon {
  width: 20px;
  height: 20px;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Square small buttons */
.controls.square button {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 8px;
  justify-content: center;
  gap: 0;
}

.controls.square button .btn-text {
  display: none;
}


/* small responsive tweak */
@media (max-width: 520px) {

  .controls.icon-only button,
  .controls.square button {
    width: 40px;
    height: 40px;
  }
}

/* mouse ball (no shadow) */
#mouse-ball {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--mouse-default);
  transform: translate(-50%, -50%);
  pointer-events: none;
  /* don't block clicks */
  z-index: 10000;
  transition: background .12s linear, transform .08s ease, width .08s ease, height .08s ease;
  will-change: left, top;
}

/* change color when pointer is over controls */
body.over-controls #mouse-ball {
  background: var(--mouse-controls);
  transform: translate(-50%, -50%) scale(1.03);
}

/* change color/size when pressing inside controls */
body.controls-pressed #mouse-ball {
  background: var(--mouse-pressed);
  transform: translate(-50%, -50%) scale(0.6);
}

/* keep existing touch hide rule */
@media (hover: none) and (pointer: coarse) {
  #mouse-ball {
    display: none;
  }
}

/* force hide native cursor for all elements inside the page */
html,
body,
* {
  cursor: none !important;
}

/* keep pointer events available for interactive controls */
.controls,
.controls * {
  pointer-events: auto;
  cursor: none !important;
}

/* explicit slider thumb rules (WebKit + Firefox) */
.controls input[type="range"],
.controls input[type="range"]::-webkit-slider-thumb,
.controls input[type="range"]::-moz-range-thumb {
  cursor: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

/* inputs/selects/buttons (some browsers may set their own cursor) */
.controls input,
.controls select,
.controls button,
.file-btn,
.file-btn * {
  cursor: none !important;
}

/* seek wrapper and rolling dot */
.seek-wrap {
  position: relative;
  width: 220px;
  height: 18px;
  display: inline-block;
  margin-left: 12px;
  vertical-align: middle;
}

.seek-wrap input[type="range"] {
  position: absolute;
  left: 0;
  right: 0;
  top: 6px;
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent, #80ff00), #a6ff66);
  outline: none;
}

/* hide native thumb so we use custom dot */
.seek-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 0;
  height: 0;
  border: 0;
  background: transparent;
}

.seek-wrap input[type="range"]::-moz-range-thumb {
  width: 0;
  height: 0;
  border: 0;
  background: transparent;
}

/* rolling dot */
.seek-dot {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%) rotate(0deg);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--mouse-default, #80ff00);
  border: none;
  box-sizing: border-box;
  pointer-events: auto;
  touch-action: none;
  transition: background .08s linear, transform .08s linear;
  transform-origin: 50% 50%;
}

body.over-controls .seek-dot {
  background: var(--mouse-controls, #fff);
}

/* smaller on mobile */
@media (max-width:520px) {
  .seek-wrap {
    width: 140px;
  }

  .seek-dot {
    width: 14px;
    height: 14px;
  }
}