body {
    margin: 0;
    padding: 0;
    height: 100vh;
    background-color: #000;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: contain; /* fit within both width and height (letterbox if needed) */
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: sans-serif;
}

/* Background image will be applied dynamically after attempting to fetch prefix. */

/* Controls container */
.controls { display:flex; flex-direction: column; gap: 12px; align-items: center; }
.row { display:flex; align-items:center; gap: 12px; }
input[type="range"] { width: 240px; }
audio { display:none; }

/* Grayscale styling for volume slider */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 1rem;
    background: transparent; /* we'll draw the track via pseudo-elements */
}
input[type="range"]:focus { outline: none; }

/* WebKit (Chrome, Safari, Edge) */
input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    background: #9e9e9e; /* medium gray track */
    border-radius: 2px;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    margin-top: -8px; /* center thumb on 4px track (thumb 20px tall) */
    width: 20px; height: 20px;
    border-radius: 50%;
    background: #d6d6d6; /* medium-light gray thumb (default) */
    border: 1px solid #a6a6a6;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: background-color .15s ease-out, border-color .15s ease-out;
}
input[type="range"]:hover::-webkit-slider-thumb { background: #e0e0e0; border-color: #bdbdbd; } /* brighter on hover */
input[type="range"]:active::-webkit-slider-thumb { background: #c2c2c2; border-color: #8c8c8c; }
input[type="range"]:disabled::-webkit-slider-thumb { background: #bdbdbd; border-color: #9e9e9e; cursor: not-allowed; }
input[type="range"]:disabled::-webkit-slider-runnable-track { background: #7d7d7d; }

/* Firefox */
input[type="range"]::-moz-range-track {
    height: 4px;
    background: #9e9e9e;
    border-radius: 2px;
}
input[type="range"]::-moz-range-thumb {
    width: 20px; height: 20px;
    border-radius: 50%;
    background: #d6d6d6; /* default */
    border: 1px solid #a6a6a6;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: background-color .15s ease-out, border-color .15s ease-out;
}
input[type="range"]:hover::-moz-range-thumb { background: #e0e0e0; border-color: #bdbdbd; } /* brighter on hover */
input[type="range"]:active::-moz-range-thumb { background: #c2c2c2; border-color: #8c8c8c; }
input[type="range"]:disabled::-moz-range-thumb { background: #bdbdbd; border-color: #9e9e9e; cursor: not-allowed; }
input[type="range"]:disabled::-moz-range-track { background: #7d7d7d; }

/* IE / old Edge */
input[type="range"]::-ms-track {
    height: 4px;
    background: transparent;
    border-color: transparent;
    color: transparent;
}
input[type="range"]::-ms-fill-lower { background: #9e9e9e; border-radius: 2px; }
input[type="range"]::-ms-fill-upper { background: #9e9e9e; border-radius: 2px; }
input[type="range"]::-ms-thumb {
    width: 20px; height: 20px;
    border-radius: 50%;
    background: #d6d6d6; /* default */
    border: 1px solid #a6a6a6;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
    cursor: pointer;
}

/* Ensure slider accent (for browsers supporting accent-color) is gray */
input[type="range"] { accent-color: #bdbdbd; }

button#toggle {
    width: 5rem;
    height: 5rem;
    position: relative;
    background: none;
    border: none;
    color: #bdbdbd; /* slightly dimmer default */
    cursor: pointer;
}
button#toggle:hover { color: #e0e0e0; } /* brighter on hover */
button#toggle:active { color: #9e9e9e; } /* darker gray when pressed */
button#toggle:disabled { color: #757575; cursor: not-allowed; opacity: 0.8; }
button#toggle:focus-visible {
    outline: 2px solid #bdbdbd;
    outline-offset: 4px;
}
#toggle::before,
#toggle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transition: all 0.15s ease-out;
    background-color: currentColor;
}
/* Play icon (triangle) */
#toggle.play::before {
    width: 0; height: 0; border-style: solid;
    border-width: 1.2rem 0 1.2rem 2rem;
    border-color: transparent transparent transparent currentColor;
    background-color: transparent;
    transform: translate(-45%, -50%);
}
#toggle.play::after { content: none; }
/* Pause icon (two bars) */
#toggle.pause::before, #toggle.pause::after {
    width: 0.6rem; height: 2.4rem; border-radius: 2px;
}
#toggle.pause::before { transform: translate(-50%, -50%) translateX(-0.6rem); }
#toggle.pause::after { transform: translate(-50%, -50%) translateX(0.6rem); }
/* Fade behavior for controls */
.controls {
    transition: opacity 30s linear; /* slow fade when playing */
    opacity: 1;
}
.controls.fading {
    opacity: 0.08; /* barely visible */
}
/* When restoring instantly, we'll temporarily disable transition via a helper class */
.controls.instant {
    transition: none !important; /* immediate visibility change */
}
/* Authors button (bottom-right) */
.authors-btn {
    position: fixed;
    right: 16px;
    bottom: 16px;
    background: transparent;
    color: #bdbdbd;
    cursor: pointer;
    z-index: 1000;
    display: inline-grid;
    opacity: 1;
    transition: opacity 30s linear;
    border: 0;
    padding: 3px; /* halved from 6px */
    gap: 3px; /* halved from 6px */
    border-radius: 3px; /* halved from 6px */
}
/* 5-person layout: 2 on top, 3 on bottom */
.authors-btn.people5 {
    grid-template-columns: repeat(3, 16.5px); /* halved from 33px */
    grid-template-rows: repeat(2, 19px); /* halved from 38px */
}
.authors-btn.people5 .person {
    position: relative;
    width: 16.5px; /* halved from 33px */
    height: 19px; /* halved from 38px */
}
/* Place two on first row (columns 1-2), leave 3rd empty, three on second row (columns 1-3) */
.authors-btn.people5 .person:nth-child(1) { grid-column: 1; grid-row: 1; transform: translateX(50%);}
.authors-btn.people5 .person:nth-child(2) { grid-column: 2; grid-row: 1; transform: translateX(50%);}
.authors-btn.people5 .person:nth-child(3) { grid-column: 1; grid-row: 2; }
.authors-btn.people5 .person:nth-child(4) { grid-column: 2; grid-row: 2; }
.authors-btn.people5 .person:nth-child(5) { grid-column: 3; grid-row: 2; }
.authors-btn.fading { opacity: 0.08; }
.authors-btn.instant { transition: none !important; }
.authors-btn:hover { color: #e0e0e0; background: transparent; }
.authors-btn:active { color: #9e9e9e; }
.authors-btn:focus-visible { outline: 2px solid #bdbdbd; outline-offset: 3px; }

.authors-btn.person:after,
.authors-btn.people5 .person:after {
  content: '';
  display: block;
  position: absolute;
  box-sizing: border-box;
  top: 9.5px; /* halved from 19px */
  height: 6.5px; /* halved from 13px */
  width: 16.5px; /* halved from 33px */
  left: 50%; /* center shoulders horizontally to align with head */
  transform: translateX(-50%);
  border: 0px solid currentColor;
  border-radius: 5.5px 5.5px 0 0; /* halved from 11px */
  border-width: 2px 2px 0 2px; /* halved from 4px */
}
.authors-btn.person:before,
.authors-btn.people5 .person:before {
  content: '';
  display: block;
  box-sizing: border-box;
  position: absolute;
  top: 0;
  left: 50%; /* center horizontally */
  transform: translateX(-50%);
  height: 10px; /* halved from 20px */
  width: 10px; /* halved from 20px */
  border-radius: 50%;
  border: 2px solid currentColor; /* halved from 4px */
}

/* Backdrop + modal */
.authors-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}
.authors-backdrop.open { display: flex; }
.authors-modal {
    background: rgba(18,18,18,0.95);
    color: #e0e0e0;
    border: 1px solid #444;
    border-radius: 10px;
    padding: 16px 20px;
    width: min(90vw, 720px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    word-break: break-word;
}
.authors-modal h2 {
    margin: 0 0 10px 0;
    font-size: 1rem;
    font-weight: 600;
    color: #f0f0f0;
}
.authors-modal p { margin: 0 0 10px 0; line-height: 1.5; color: #cccccc; }
.authors-modal p:last-child { margin-bottom: 0; }
.authors-modal .close {
    position: absolute;
    top: 8px; right: 10px;
    background: none;
    border: none;
    color: #bdbdbd;
    cursor: pointer;
    font-size: 20px;
}
.authors-modal .close:hover { color: #ffffff; }
.authors-modal-wrap { position: relative; }