* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    /* iOS Safari aggressively boosts text size when rotating to landscape
       and doesn't reset when rotating back. Pin to 100% so font-size
       declarations are honoured exactly in both orientations. */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    overflow: hidden;
    font-family: "Geist", sans-serif;
    font-weight: 450;
    position: relative;
    background-color: #9b9183;
    /* How far below the visible viewport the table extends.
       Room mode: depth distance for the open animation + 60px links row.
       Flat mode: a longer scrollable area. */
    --table-extra: 660px;
}

body.flat-mode {
    --table-extra: 600px;
}

#info-float {
    position: fixed;
    max-width: 220px;
    background: #dfdcd8;
    border: 1.5px solid #595147;
    border-radius: 3px;
    padding: 8px 12px;
    z-index: 110;
    font-family: "Geist", sans-serif;
    font-size: 13px;
    font-weight: 450;
    color: #1b1916;
    line-height: 1.6;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    /* Match the floating-element drop shadow used by gifs and the video pad */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.25);
}

#info-float.visible {
    opacity: 1;
}

/* #info-toggle.info-off uses a dedicated icon (set by JS); no opacity tint. */

#bottom-frame-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: #7c7164;
    z-index: 200;
    transform: translateY(100%);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}
#bottom-frame-bar .copyright {
    color: #bfb8af;
    font-family: 'Geist', sans-serif;
    font-size: 11px;
    font-weight: 450;
    letter-spacing: 0.02em;
    pointer-events: none;
    user-select: none;
}

#right-panel {
    position: fixed;
    right: 6px;
    top: 30px;
    bottom: 0;
    width: 24px;
    background: #595147;
    border-radius: 0px 5px 5px 0px;
    z-index: 90;
    pointer-events: none;
}

/* Action icons box: matches the frame background so it looks part of the frame. */
#controls-bar {
    position: fixed;
    top: 23px;
    right: 4.5px;
    width: 24px;
    background: #7c7164;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 8px 2px;
    border: none;
    border-radius: 5px;
    z-index: 100;
}

.icon-button {
    width: 19.5px;
    height: 19.5px;
    padding: 2px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease;
    border-radius: 4px;
}

.icon-button:hover {
    transform: scale(1.07);
}

.icon-button:active:not(#drive-knob) {
    opacity: 0.6;
}

#lock-button img,
#add-video img,
#info-toggle img {
    transform: scale(1.3);
}

.icon-button img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

#view-toggle { display: none; }

#drive-knob {
    position: relative;
    cursor: grab;
}

#drive-knob:active {
    cursor: grabbing;
}

#drive-knob .knob-dial {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform-origin: center;
    pointer-events: none;
}

#drive-knob .knob-dial img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

#drive-knob .knob-indicator {
    display: none;
}

#frame-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #7c7164;
    padding: 30px 30px 0 30px;
    display: flex;
    flex-direction: column;
    z-index: 0;
}

/* Flat mode: hide the 3D room walls + neutralize perspective */
body.flat-mode .room-walls {
    display: none;
}
body.flat-mode #frame-inner {
    perspective: none;
}

/* Room mode: hide the real back-wall grid canvas — the fake .wall-back
   inside the perspective room takes over and renders as a smaller version
   of the table due to z-translation. The colored header row stays at the
   front (z=0) since flight lines on the ceiling jump off from its cells. */
body.room-mode #grid-canvas {
    display: none;
}
/* Make sure interactive layers (gifs, header colored cells, links) sit
   on top of the room walls. */
body.room-mode .room-walls {
    z-index: 1;
}
body.room-mode #table-scroll {
    z-index: 5;
    pointer-events: auto;
    background: transparent;
}
body.room-mode #table-content {
    background: transparent;
}
body.room-mode .links-section {
    z-index: 8;
}
body.room-mode .header-canvas {
    z-index: 20;
}
body.room-mode #gif-container {
    z-index: 10;
}
#frame-inner {
    position: relative;
    flex: 1;
    border: 2px solid #595147;
    border-radius: 5px 5px 0 0;
    border-bottom: none;
    overflow: visible;
    margin-bottom: 45px;
    clip-path: inset(0 -2px -100vh -2px round 5px 5px 0 0);
    background: #9b9183;
    /* 3D room perspective. Vanishing point at center of the frame. */
    --persp: 600px;
    --depth: 800px;
    /* Z-translation applied to the fake back wall. Animated 0 -> --depth
       during the room-opening animation; the four side walls stay static. */
    --back-z: var(--depth);
    --cell-w: 70px;
    --cell-h: 20px;
    /* Line thickness for the room. Back-line is thicker so that after
       perspective shrinks the back wall it still reads at ~1px. */
    --line-w: 1px;
    --back-line-w: 2px;
    /* Tiled squares pattern (set from JS so cell sizes follow the table). */
    --squares-bg: none;
    perspective: var(--persp);
    perspective-origin: 50% 50%;
}
/* Re-draw the top border above all transformed children so it never disappears during scroll. */
#frame-inner::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    height: 2px;
    background: #595147;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    pointer-events: none;
    z-index: 100;
}

/* 3D room layer: holds the four walls + a fake back wall.
   Each wall hinges at one edge of the frame and rotates exactly 90° back,
   so its far edge meets the back wall (which sits at z = -depth).
   Perspective then naturally makes every wall-line that runs into depth
   converge toward the vanishing point. */
.room-walls {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    transform-style: preserve-3d;
}

.wall {
    position: absolute;
    background-color: #9b9183;
    backface-visibility: hidden;
}

.wall::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* Floor + ceiling: width = frame width, height = depth.
   - Vertical lines (left/top edges of cells, every cell-w) are the FLIGHT LINES
     coming from the boundaries of every colored cell in the top row.
   - Horizontal lines (every cell-h) are equally-spaced depth markers. */
.wall-floor, .wall-ceiling {
    background-image:
        var(--squares-bg),
        repeating-linear-gradient(0deg,  #595147 0, #595147 var(--line-w), transparent var(--line-w), transparent var(--cell-h)),
        repeating-linear-gradient(90deg, #595147 0, #595147 var(--line-w), transparent var(--line-w), transparent var(--cell-w));
}

/* Side walls: height = frame height (minus colored top row), width (= depth) = depth.
   - Horizontal lines (every cell-h) are flight lines coming from each row of
     the back wall (= each horizontal grid line of the back wall).
   - Vertical depth lines (every cell-h) line up with floor/ceiling depth markers
     so the wall grids meet exactly at every corner. */
.wall-left, .wall-right {
    background-image:
        repeating-linear-gradient(0deg,  #595147 0, #595147 var(--line-w), transparent var(--line-w), transparent var(--cell-h)),
        repeating-linear-gradient(90deg, #595147 0, #595147 var(--line-w), transparent var(--line-w), transparent var(--cell-h));
}

.wall-floor {
    left: 0; right: 0;
    bottom: 0;
    height: var(--depth);
    transform-origin: 50% 100%;
    transform: rotateX(90deg);
}
.wall-floor::after {
    background: linear-gradient(to top, rgba(0,0,0,0) 0%, rgba(0,0,0,0.55) 100%);
}

.wall-ceiling {
    left: 0; right: 0;
    top: var(--cell-h);
    height: var(--depth);
    transform-origin: 50% 0%;
    transform: rotateX(-90deg);
}
.wall-ceiling::after {
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.55) 100%);
}

.wall-left {
    top: var(--cell-h); bottom: 0;
    left: 0;
    width: var(--depth);
    transform-origin: 0% 50%;
    transform: rotateY(90deg);
}
.wall-left::after {
    background: linear-gradient(to right, rgba(0,0,0,0) 0%, rgba(0,0,0,0.55) 100%);
}

.wall-right {
    top: var(--cell-h); bottom: 0;
    right: 0;
    width: var(--depth);
    transform-origin: 100% 50%;
    transform: rotateY(-90deg);
}
.wall-right::after {
    background: linear-gradient(to left, rgba(0,0,0,0) 0%, rgba(0,0,0,0.55) 100%);
}

/* Fake back wall: a flat copy of the table grid, pushed back in z so
   perspective renders it as a smaller version of the table (with smaller cells).
   Lines on it line up with the flight lines coming in from all four walls. */
.wall-back {
    position: absolute;
    top: calc(var(--cell-h) - 1px);
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #9b9183;
    background-image:
        var(--squares-bg),
        repeating-linear-gradient(0deg,  #595147 0, #595147 var(--back-line-w), transparent var(--back-line-w), transparent var(--cell-h)),
        repeating-linear-gradient(90deg, #595147 0, #595147 var(--back-line-w), transparent var(--back-line-w), transparent var(--cell-w));
    transform: translateZ(calc(0px - var(--back-z)));
    backface-visibility: hidden;
}

/* Scrollable container for the table (native scrollbar hidden, custom one used) */
#table-scroll {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: scroll;
    overflow-x: hidden;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge legacy */
}

#table-scroll::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

/* The table itself.
   min-height = scroller height + room depth + floor section height → enough
   scroll for room-opening (phase 1) and room slide-up (phase 2). */
#table-content {
    position: relative;
    width: 100%;
    min-height: calc(100% + var(--depth, 800px) + var(--floor-h, 0px));
    background: #9b9183;
}

/* Grid Canvas (covers the full table) */
#grid-canvas {
    position: absolute;
    top: 20px;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* Header Row - fixed at the top of frame.
   During phase 2 (slide-up), it translates with room-walls and floor-section. */
.header-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 20px;
    z-index: 15;
    pointer-events: none;
    will-change: transform;
}

/* GIF Container - lives inside the table, scrolls with it */
#gif-container {
    position: absolute;
    top: 20px;
    left: 0;
    width: 100%;
    height: calc(100% - 20px);
    pointer-events: none;
    z-index: 2;
}
/* Individual GIF Items */
.gif-item {
    position: absolute;
    /* Default cursor is the page cursor; we only switch to grab when the
       pointer is over a non-transparent pixel (toggled by JS via .solid-hover). */
    cursor: default;
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    touch-action: none;
    transition: transform 0.3s ease;
    /* Subtle drop shadow so they appear to float just above the table */
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.25));
}

.gif-item.solid-hover {
    cursor: grab;
}

.gif-item.solid-hover:active {
    cursor: grabbing;
}

.gif-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

/* Hover/active visual feedback only when over a solid pixel */
.gif-item.solid-hover {
    transform: scale(1.05);
}

.gif-item.solid-hover:active {
    transform: scale(0.98);
    transition: transform 0.05s ease;
}

/* Trigger pulse: brief scale-up applied on every activation (click or key)
   so the response feels instantaneous even on the rare frames where the
   image swap hasn't repainted yet. Outranks .solid-hover via animation. */
@keyframes gif-trigger-pulse {
    0%   { transform: scale(1.05); }
    40%  { transform: scale(1.10); }
    100% { transform: scale(1.05); }
}
.gif-item.trigger-pulse {
    animation: gif-trigger-pulse 180ms ease-out;
}

/*  section: 4-part grid layout. Sits BELOW the visible frame (top: 100%).
   In phase 2 of the room-open scroll, JS translateY's it up so its top edge
   stays glued to the bottom of the room (the near edge of the floor). */
.floor-section {
    position: absolute;
    top: 100%;
    left: -2px;
    right: -2px;
    margin-top: -2px;
    padding: 30px;
    background: #b3aba0;
    border-style: solid;
    border-width: 1.5px 2px 2px 2px;
    border-color: #595147;
    border-radius: 0 0 0 5px;
    z-index: 6;
    pointer-events: auto;
    will-change: transform;
    
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    align-items: start;
    font-size: 13px;
}

/* Footer copyright sits as a full-width row at the bottom of the floor grid. */
.site-footer {
    grid-column: 1 / -1;
    margin-top: 10px;
    padding-top: 14px;
    border-top: 1px solid #8a8175;
    color: #4c453d;
    font-size: 11px;
    font-weight: 450;
    text-align: center;
}

/* Individual floor parts */
.floor-part {
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: auto;
}

.floor-heading {
    font-size: 19px;
    font-weight: 700;
    color: #4c453d;
    margin: 0;
    padding: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Unify all body text in the bottom section to the title color.
   Exception: .btn-bandsintown keeps its original light text on dark
   background; only its hover state recolours (defined further below). */
.floor-section,
.floor-section a:not(.btn-bandsintown),
.bio,
.release-title,
.show-venue,
.show-venue a,
.show-location,
.contact-link {
    color: #4c453d;
}
/* Ensure pointer cursor on all clickable anchors in the floor section. */
.floor-section a {
    cursor: pointer;
}

/* Bio section */
.bio {
    line-height: 1.6;
    color: #1b1916;
    text-align: left;
    pointer-events: auto;
}

.bio p {
    margin: 0;
    padding: 0;
}

/* Releases section */
.releases-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.release-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.release-date {
    font-weight: 700;
    color: #4c453d;
}

.release-title {
    color: #1b1916;
}

/* Shows section */
#shows-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.show-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-left: 2px solid #595147;
    padding-left: 10px;
}

.show-date {
    font-weight: 700;
    color: #4c453d;
}

.show-venue {
    color: #1b1916;
}

.show-venue a {
    color: #1b1916;
    text-decoration: none;
    border-bottom: 1px dotted #595147;
    transition: color 0.08s ease, border-bottom-color 0.08s ease;
    cursor: pointer;
}

.show-venue a:hover,
.floor-section .show-venue a:hover {
    color: #dfdcd8;
    border-bottom-color: #dfdcd8;
    text-shadow: 0 0 0.5px currentColor;
}

.show-location {
    color: #595147;
}

.btn-bandsintown {
    /* inline-flex with no width = box hugs its text; align-self:flex-start
       keeps it left-aligned inside the floor column instead of stretching. */
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    justify-content: center;
    height: 30px;
    padding: 0 12px;
    background: #4c453d;
    color: #bfb8af;
    text-decoration: none;
    font-weight: 700;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-bandsintown:hover {
    background: #dfdcd8;
    color: #4c453d;
}

/* Links Section: merged bottom rows of the table */
.links-section {
    position: relative;
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 0;
    background: transparent;
    z-index: 4;
}
.links-section-sep {
    margin-top: 8px;
}

/* Custom scrollbar inside the right panel, centered in the 24px zone.
   right: 6 + (24-8)/2 = 14px centres the 8px thumb in the panel.
   top is set dynamically via JS to sit just below the controls-bar.
   z-index: 101 ensures it sits above the panel (90) and controls-bar (100). */
#custom-scrollbar {
    position: fixed;
    top: 41px;  /* fallback; overridden by JS to right-panel.top + 11px */
    bottom: 11px;
    right: 14px;
    width: 8px;
    z-index: 101;
    border-radius: 0px 5px 5px 0px;
}

#custom-scrollbar-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: #9b9183;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s ease;
}

#custom-scrollbar-thumb:hover,
#custom-scrollbar-thumb.dragging {
    background: #dfdcd8;
}

.social-group,
.music-group {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    flex-wrap: nowrap;
    gap: 10px;
    justify-content: flex-start;
}

.social-links {
    list-style: none;
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 12px;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
}

.social-links li {
    margin: 0;
    flex: 0 0 auto;
}

.icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    flex-shrink: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
    text-decoration: none;
    color: #595147;
    font-size: 0.8em;
    font-weight: 800;
}

.icon-link img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.15s ease;
}

.icon-link:hover img {
    transform: scale(1.1);
}

.social-links a:not(.icon-link) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    padding: 0 12px;
    background: white;
    color: #595147;
    text-decoration: none;
    font-size: 0.8em;
    font-weight: 800;
    border-radius: 8px;
    border: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.social-links a:not(.icon-link):hover {
    background: #595147;
    color: white;
    transform: scale(1.05);
}

.contact-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.contact-links li { margin: 0; }
.contact-links strong,
.contact-link-item strong {
    font-weight: 700;
    color: #4c453d;
}
.contact-link-item {
    color: #4c453d;
    line-height: 1.6;
}
.contact-link {
    color: #1b1916;
    text-decoration: none;
    border-bottom: 1px dotted #595147;
    transition: color 0.08s ease, border-bottom-color 0.08s ease;
    cursor: pointer;
}
.floor-section a.contact-link:hover {
    color: #dfdcd8;
    border-bottom-color: #dfdcd8;
    text-shadow: 0 0 0.5px currentColor;
}

/* Lock Button — icon-button in controls bar, no extra positioning */
.lock-button.locked {
    opacity: 0.7;
}

/* Drive knob — sits inline in controls bar */
.knob {
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    cursor: ns-resize;
}

.knob-dial {
    position: relative;
    transform: rotate(0deg);
    transition: transform 0.05s linear;
}

.knob-indicator {
    display: none;
}



.knob-label {
    margin-top: 4px;
    font-size: 12px;
    font-weight: 800;
    color: #1b1916;
    text-shadow: 0 1px 2px rgba(255,255,255,0.6);
}

/* Video sampler pad */
.video-pad {
    position: absolute;
    top: 50px;
    left: 50px;
    z-index: 1000;
    pointer-events: auto;
    width: 270px;
    background: #7c7164;
    border: 2px solid #595147;
    border-radius: 6px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    font-family: 'Geist', sans-serif;
    color: #dfdcd8;
    cursor: move;
    touch-action: none;
}

.video-url {
    width: 100%;
    box-sizing: border-box;
    padding: 4px 8px;
    border: none;
    border-radius: 0;
    background: #b3aba0;
    color: #1b1916;
    font-size: 8px;
    font-family: inherit;
    outline: none;
    height: 18px;
}
.video-url::placeholder { color: rgba(42,36,26,0.55); }
.video-url:hover { background: #dfdcd8; }
.video-url:focus { background: #b3aba0; }

.video-layout {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 14px;
    grid-template-rows: 18px 160px 10px 18px;
    row-gap: 6px;
    column-gap: 10px;
}
.video-layout::after {
    content: '';
    position: absolute;
    top: 24px;
    bottom: 0;
    right: 19px;
    width: 1px;
    background: #1b1916;
    pointer-events: none;
    display: none;
}


.video-stage {
    position: relative;
    height: 160px;
    background: #1a1a1a;
    border-radius: 3px;
    overflow: hidden;
}

.video-stage-placeholder {
    position: absolute;
    inset: 0;
    /* Sit above the YT overlay (z:2) so the explainer stays visible while a
       URL is loaded but not yet playing. Solid black background hides the
       loaded video frame underneath until the user triggers playback. */
    z-index: 3;
    background: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    gap: 8px;
    padding: 12px 5px 12px 5px;
    font-family: 'Geist', sans-serif;
    font-size: 10px;
    font-weight: 450;
    color: #dfdcd8;
    line-height: 1.7;
    pointer-events: none;
}

/* Persistent "URL not valid" overlay shown when the user pastes anything
   that isn't a recognized YouTube URL. Sits above the instructional
   placeholder (z:4) and stays visible regardless of the info-toggle state.
   Hidden via the [hidden] attribute, cleared on next paste / input clear. */
.video-stage-error {
    position: absolute;
    inset: 0;
    z-index: 4;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Geist', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #dfdcd8;
    pointer-events: none;
}
.video-stage-error[hidden] { display: none; }
/* Footnote inside the mobile placeholder explaining iOS audio limitations. */
.ph-note {
    font-size: 9px;
    font-weight: 450;
    line-height: 1.4;
    color: #9b9183;
    font-style: italic;
    padding: 0 5px;
}
.ph-list {
    display: grid;
    grid-template-columns: 14px 1fr;
    column-gap: 5px;
    row-gap: 1px;
    align-items: start;
    width: 100%;
}
.ph-num {
    text-align: right;
    line-height: 1.7;
    flex-shrink: 0;
}
.ph-text {
    line-height: 1.7;
}
.ph-sub {
    padding-left: 0;
}
.ph-mini-scrub {
    display: block;
    margin-top: 3px;
    margin-left: 15px;
    margin-bottom: 2px;
    width: 44px;
    height: 3px;
    background: linear-gradient(to right, #bfb8af 28%, #4c453d 28%);
    border-radius: 2px;
    position: relative;
}
.ph-mini-dot {
    position: absolute;
    width: 7px;
    height: 7px;
    background: #dfdcd8;
    border-radius: 50%;
    top: 50%;
    left: 28%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.25);
}
.ph-mini-tc {
    display: block;
    margin-top: 3px;
    margin-left: 15px;
    width: fit-content;
    font-size: 7px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
    color: #1b1916;
    background: #b3aba0;
    padding: 1px 4px;
    border-radius: 1px;
    cursor: ns-resize;
}
.video-el,
.video-yt {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border: 0;
}
.video-yt-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: transparent;
}

.video-el { pointer-events: none; }
.video-yt iframe { width: 100%; height: 100%; border: 0; background: #000; pointer-events: none; }
.video-el[hidden],
.video-yt[hidden] { display: none; }


.video-scrub {
    grid-column: 1;
    grid-row: 3;
    align-self: center;
    width: 100%;
    height: 10px;
    -webkit-appearance: none;
    appearance: none;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    touch-action: none;
}
.video-scrub::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #dfdcd8;
    border: 1px solid #1b1916;
    cursor: pointer;
}
.video-scrub::-moz-range-thumb {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #dfdcd8;
    border: 1px solid #1b1916;
    cursor: pointer;
}

.video-time {
    font-size: 8px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #1b1916;
    background: #b3aba0;
    height: 18px;
    min-width: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border-radius: 0;
    text-align: center;
    cursor: ns-resize;
    user-select: none;
    flex-shrink: 0;
    letter-spacing: 0.08em;
    transition: background 0.1s;
    touch-action: none;
}
.video-time:hover,
.video-time.dragging {
    background: #dfdcd8;
}


.video-vol-label {
    grid-column: 2;
    grid-row: 4;
    height: 18px;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #1b1916;
    background: #b3aba0;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    width: 100%;
}


.video-meter-wrap {
    grid-column: 2;
    grid-row: 2 / 4;
    position: relative;
    cursor: ns-resize;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}
.video-meter-bars {
    position: absolute;
    inset: 0;
    display: flex;
    gap: 2px;
}
.video-meter-bar {
    flex: 1;
    background: #595147;
    position: relative;
    overflow: hidden;
    border-radius: 2px;
}
.video-meter-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #bfb8af;
    height: 0%;
}
.video-fader-knob {
    position: absolute;
    left: 50%;
    /* translate(-50%,-50%) so the knob stays centred on its `top` value
       regardless of its width/height (different on desktop vs mobile). */
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: #dfdcd8;
    border: 1px solid #1b1916;
    border-radius: 50%;
    cursor: ns-resize;
    touch-action: none;
    z-index: 2;
}

.video-close {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    height: 100%;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.video-close:hover {
    background: transparent;
}

.video-pad-row {
    grid-column: 1;
    grid-row: 4;
    display: flex;
    flex-direction: row;
    gap: 6px;
    align-items: center;
}

@keyframes blink-key {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.video-key {
    flex: 0 0 auto;
    width: 54px;
    height: 18px;
    padding: 0;
    border: none;
    outline: none;
    background: #b3aba0;
    color: #1b1916;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.08em;
    cursor: pointer;
    font-family: 'Geist', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    overflow: hidden;
    transition: background 0.1s;
    -webkit-tap-highlight-color: transparent;
}
.video-key:focus {
    outline: none;
    box-shadow: none;
}
.video-key:hover {
    background: #dfdcd8;
}
.video-key.binding {
    background: #e5ad3e;
    color: #1b1916;
    animation: blink-key 0.7s ease-in-out infinite;
}
.video-key.binding:hover {
    background: #e5ad3e;
}
.video-key.mapped {
    background: #e5ad3e;
    color: #1b1916;
}
.video-key.mapped:hover {
    background: #edc06a;
}

.video-trigger {
    flex: 1;
    height: 18px;
    padding: 0 8px;
    border: none;
    background: #b3aba0;
    color: #1b1916;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.08em;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    font-family: 'Geist', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.1s;
}
.video-trigger:hover {
    background: #dfdcd8;
}
.video-trigger.active {
    background: #e5ad3e;
    color: #1b1916;
}
.video-trigger.active:hover {
    background: #e5ad3e;
}

/* Mobile Responsiveness */
/* The "get updated on new shows" button must never wrap.
   Its intrinsic width (Geist 700, ~13px) is ~215px with padding.
   Floor col width = (viewport - 124px - 3×30px gap) / 4.
   For col ≥ 220px: viewport ≥ 1098px → switch at 1100px.
   - 4 cols: viewport > 1100px
   - 2 cols: viewport 460–1100px
   - 1 col: viewport ≤ 460px */
@media (max-width: 1100px) {
    .floor-section {
        grid-template-columns: repeat(2, 1fr);
        row-gap: 19px;
    }
}

@media (max-width: 540px) {
    .floor-section {
        grid-template-columns: 1fr;
        column-gap: 12px;
        row-gap: 44px;
        padding: 12px 8px;
    }
    /* On mobile (single-column floor) center social/music icon rows */
    .social-group,
    .music-group {
        justify-content: center;
        width: 100%;
    }
    .social-links {
        justify-content: center;
        width: 100%;
    }
}

/* Touch devices: disable hover effects that only make sense with a cursor */
@media (hover: none) {
    .icon-button:hover {
        transform: none;
    }
}

/* Preload images - prevents flickering */
.gif-item.preloaded {
    opacity: 1;
}

/* ── Mobile toast hints ────────────────────────────────────────────────────── */
/* Replaces the cursor-following hover float on touch devices.
   Matches the desktop #info-float appearance (light box, dark border).        */
#info-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 220px;
    background: #dfdcd8;
    border: 1.5px solid #595147;
    border-radius: 3px;
    padding: 8px 12px;
    font-size: 13px;
    font-family: 'Geist', sans-serif;
    font-weight: 450;
    color: #1b1916;
    line-height: 1.6;
    /* Allow long hints to wrap onto two (or more) lines instead of being
       clipped or overflowing the toast box. */
    white-space: normal;
    word-wrap: break-word;
    text-align: center;
    opacity: 0;
    transition: opacity 0.15s;
    pointer-events: none;
    z-index: 9999;
    /* Match the floating-element drop shadow used by gifs and the video pad */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.25);
}
#info-toast.visible { opacity: 1; }

/* ── Welcome modal ─────────────────────────────────────────────────────────── */
/* Auto-shown 10s after page load (once per session). Same look-and-feel as the
   info-float boxes (light box, dark border, drop-shadow). Closing icon top-right
   matches the video sampler close button. */
.welcome-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(310px, calc(100vw - 48px));
    background: #dfdcd8;
    border: 1.5px solid #595147;
    border-radius: 3px;
    padding: 8px 12px;
    z-index: 200;
    font-family: "Geist", sans-serif;
    color: #1b1916;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.25);
    cursor: move;
    user-select: none;
}
/* Once JS has set explicit left/top (after show()), drop the centring
   translate. Transition is gated behind .with-transition (added a frame
   later in JS) so the initial position swap doesn't animate. */
.welcome-modal.positioned { transform: none; }
.welcome-modal.positioned.with-transition { transition: transform 0.2s ease; }
.welcome-modal.visible { opacity: 1; }
/* Hover scale-up matches the gif items. */
.welcome-modal.positioned:hover { transform: scale(1.05); }

.welcome-title {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.6;
    text-align: center;
    color: #1b1916;
    margin-bottom: 6px;
}
.welcome-body {
    font-size: 13px;
    font-weight: 450;
    line-height: 1.6;
    text-align: left;
    color: #1b1916;
}
.welcome-close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.welcome-close img {
    width: 19.5px;
    height: 19.5px;
    transform: rotate(45deg);
    pointer-events: none;
    display: block;
    transition: filter 0.15s;
}
.welcome-close:hover img {
    /* #4c453d × 1.64 ≈ #7c7164 */
    filter: brightness(1.64);
}

.releases-table {
    width: 100%;
    border-collapse: collapse;
    border: none;
    font-size: 13px;
    font-weight: 450;
    line-height: 1.15;
    color: #4c453d;
}
.releases-table th,
.releases-table td {
    border: none;
    padding: 2px 8px 2px 0;
    vertical-align: middle;
    white-space: nowrap;
    text-align: left;
    color: #4c453d;
}
.releases-table thead th {
    font-weight: 600;
    font-size: 12px;
    padding-bottom: 4px;
    letter-spacing: 0.01em;
}
.releases-table tbody td {
    font-weight: 450;
}
/* Live rows behave as links (wired up in JS via data-href). */
.releases-table tr.release-row[data-href] {
    cursor: pointer;
}
.releases-table tr.release-row[data-href]:hover td:not(.rt-icon) {
    color: #dfdcd8;
    text-shadow: 0 0 0.5px currentColor;
    transition: color 0.08s ease;
}
.releases-table td.rt-icon,
.releases-table th.rt-icon {
    padding-right: 0;
    width: 36px;
}
.releases-table td.rt-icon { text-align: right; }
.releases-table th.rt-icon { text-align: left; }
.releases-table td.rt-icon img {
    height: 30px;
    width: auto;
    display: inline-block;
    vertical-align: middle;
    pointer-events: none;
}
/* Not-live releases: greyed + blurred to read as "coming soon, not actionable".
   Also unselectable so the obscured titles/dates can't be copied out of the DOM
   (the underlying text is still in the HTML source, but this discourages casual
   leaking via copy/paste). */
/* Not-live releases: greyed + blurred to read as "coming soon, not actionable".
   Also unselectable so the obscured titles/dates can't be copied out of the DOM
   (the underlying text is still in the HTML source, but this discourages casual
   leaking via copy/paste).
   Blur is applied to the whole <tr> (instead of each <td>) so the soft halo
   stays continuous across cells rather than getting clipped at every cell
   edge. */
.releases-table .release-row.not-live {
    filter: blur(5px);
}
.releases-table .release-row.not-live td {
    color: #4c453d;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
}
.releases-table .release-row.not-live td.rt-icon img {
    /* Slightly less blur on the icon since it's already inside the row blur,
       and full opacity bump matches what we had. */
    opacity: 0.85;
}

/* ── Mailing list modal ───────────────────────────────────────────────────── */
.mailing-modal {
    width: min(320px, calc(100vw - 48px));
    cursor: default;
}
.mailing-modal.positioned:hover { transform: none; }
.mailing-body {
    margin-bottom: 12px;
}
.mailing-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
/* Honeypot: visually hidden but in flow so autofill doesn't flag it */
.mailing-hp {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}
.mailing-field {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.mailing-tooltip {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: #dfdcd8;
    border: 1.5px solid #595147;
    border-radius: 3px;
    padding: 5px 9px;
    font-family: "Geist", sans-serif;
    font-size: 12px;
    color: #1b1916;
    white-space: nowrap;
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
.mailing-tooltip::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    bottom: 100%;
    left: 12px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid #595147;
}
.mailing-tooltip::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    bottom: calc(100% - 1.5px);
    left: 13px;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 4px solid #dfdcd8;
}
.mailing-input {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
    font-family: "Geist", sans-serif;
    font-size: 13px;
    color: #1b1916;
    background: #f0ede9;
    border: 1.5px solid #595147;
    border-radius: 3px;
    outline: none;
    transition: border-color 0.1s ease;
}
.mailing-input:focus {
    border-color: #4c453d;
}
.mailing-input::placeholder {
    color: #9b9183;
}
.mailing-actions {
    display: flex;
    justify-content: flex-end;
}
.mailing-submit {
    padding: 5px 14px;
    font-family: "Geist", sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #dfdcd8;
    background: #4c453d;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.08s ease, color 0.08s ease;
}
.mailing-submit:hover {
    background: #e5ad3e;
    color: #4c453d;
}
.mailing-submit:disabled {
    opacity: 0.6;
    cursor: default;
}
.mailing-status {
    font-size: 12px;
    color: #4c453d;
    min-height: 1em;
    text-align: center;
}
.mailing-status.error {
    color: #b04040;
}

/* Floor variant: same row structure as the modal, just tighter. */
.floor-releases {
    min-width: 0;
    /* Padding gives the blur halo of `.release-row.not-live` room to fade
       out instead of being clipped at the column edge. overflow stays
       visible so the halo isn't clipped vertically either. */
    padding: 6px 6px 6px 0;
    margin: -6px -6px -6px 0;
}
.floor-releases-table {
    /* Belt-and-suspenders: if the table somehow can't shrink enough on a
       very narrow viewport, fix the layout so cell widths are predictable
       and don't burst the column. */
    table-layout: auto;
}
.floor-releases-table th,
.floor-releases-table td {
    padding: 3px 8px 3px 0;
    font-size: 12px;
    line-height: 1.25;
    white-space: nowrap;
}
.floor-releases-table thead th { font-size: 11px; }
.floor-releases-table td.rt-icon,
.floor-releases-table th.rt-icon { width: 32px; }
.floor-releases-table td.rt-icon img { height: 24px; }

/* Tighten the release table on narrow phones so it always fits a single column
   of the floor section without wrapping or horizontal scroll. */
@media (max-width: 540px) {
    .floor-releases-table th,
    .floor-releases-table td {
        padding: 3px 6px 3px 0;
        font-size: 11px;
    }
    .floor-releases-table thead th { font-size: 10px; }
    .floor-releases-table td.rt-icon,
    .floor-releases-table th.rt-icon { width: 26px; }
    .floor-releases-table td.rt-icon img { height: 20px; }
}

/* Never show the cursor-follow info float on touch-primary devices */
@media (hover: none) {
    #info-float { display: none !important; }
}

/* ── Mobile layout: horizontal top controls bar ─────────────────────────────── */
/* On mobile the vertical right-side controls bar moves to a horizontal        */
/* strip at the top of the frame. Icons scale up to match .icon-link (30px).   */
@media (max-width: 768px) {
    #frame-wrapper {
        padding-top: 38px; /* controls bar height on mobile */
    }
    #controls-bar {
        top: 0;
        left: 0;
        right: 0;
        bottom: auto;
        width: auto;
        height: 38px;
        flex-direction: row;
        justify-content: flex-end;
        align-items: center;
        gap: 14px;
        padding: 0 24px;
        border-radius: 0;
    }
    .icon-button {
        /* Match .icon-link (social link) size on mobile */
        width: 30px;
        height: 30px;
    }
    /* The scale(1.3) override was compensating for the small 19.5px button size;
       at 30px the SVGs fill the button naturally. */
    #lock-button img,
    #add-video img,
    #info-toggle img {
        transform: none;
    }
    /* Drive knob: match sibling icon-buttons. */
    #drive-knob {
        width: 30px;
        height: 30px;
    }
    /* The knob.svg artwork (a solid circle) fills its viewBox edge-to-edge,
       while the other action icons (lock, plus, question) have built-in
       whitespace padding inside their viewBox. At the same container size,
       the knob therefore reads as visually larger. Compensate by scaling
       the rendered IMG (not the dial — the dial's transform is reserved
       for the JS-driven rotation) down to match the visual footprint. */
    #drive-knob .knob-dial {
        inset: 0;
        width: auto;
        height: auto;
    }
    #drive-knob .knob-dial img {
        transform: scale(0.87);
        transform-origin: center;
    }
    /* iOS zooms in on any input with font-size < 16px. Fix by using 16px as
       the actual font-size and scaling the element down to appear as the
       original 8px design size (16px × 0.5 = 8px). The input shrinks visually
       but the browser never triggers auto-zoom. */
    .video-url {
        font-size: 16px;
        transform: scale(0.5);
        transform-origin: top left;
        width: 200%; /* compensate for the 0.5 scale so it still fills the grid cell */
        height: 36px; /* 18px × 2 to compensate for scale */
    }
}

/* ── Mobile video pad ───────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .video-pad {
        width: min(240px, 90vw);
    }
    .video-stage {
        height: 110px;
    }
    .video-layout {
        grid-template-rows: 18px 110px 20px 18px;
    }
    /* Taller scrub track on mobile for easier grabbing */
    .video-scrub {
        height: 20px;
        border-radius: 5px;
    }
    .video-scrub::-webkit-slider-thumb {
        width: 20px;
        height: 20px;
    }
    .video-scrub::-moz-range-thumb {
        width: 20px;
        height: 20px;
    }
    /* Match the timeline scrubber thumb size on mobile (20px) */
    .video-fader-knob {
        width: 20px;
        height: 20px;
    }
    /* Play and map-key buttons are replaced by hold-on-stage on mobile */
    .video-trigger,
    .video-key {
        display: none;
    }
}
