/* Shared look for every photo visualizer. Generated pages add only their card font. */
:root { --gold: #D4AF37; --teal: #2ec4b6; --violet: #b48cff; --sunset: #E05A33; --pink: #ff5ea0; --plum: #241030;
  --glass: rgba(14, 8, 22, 0.74); --line: rgba(255, 255, 255, 0.14); --ui: 'DM Sans', system-ui, sans-serif; }
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: #000; overflow: hidden; color: #fff; font-family: var(--ui); }
body.idle { cursor: none; }
button { font-family: inherit; }

/* Stage for the calm looks (Soft, Plain); the WebGL canvas draws everything else. */
#stage { position: fixed; inset: 0; }
.layer { position: absolute; inset: 0; opacity: 0; transition: opacity 1.4s ease; overflow: hidden; }
.layer.on { opacity: 1; }
.fill { position: absolute; inset: -8%; background-size: cover; background-position: center; filter: blur(38px) saturate(1.5) brightness(0.55); }
.panes { position: absolute; inset: 0; display: grid; }
.panes > div { position: relative; overflow: hidden; }
.panes img, .panes video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.tri { grid-template-columns: 1fr 1fr 1fr; }
.tri > div:nth-child(odd) { transform: scaleX(-1); }
.kalei { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.kalei > div:nth-child(2) { transform: scaleX(-1); }
.kalei > div:nth-child(3) { transform: scaleY(-1); }
.kalei > div:nth-child(4) { transform: scale(-1, -1); }
.solo { place-items: center; }
.solo > div { height: 100%; aspect-ratio: var(--ar, 3 / 4); max-width: 100%; box-shadow: 0 0 120px rgba(0,0,0,0.7); }
.wide > div { width: 100%; height: 100%; aspect-ratio: auto; }
.zoom img { animation: zoom var(--dur, 8s) linear both; }
.tri.zoom img, .kalei.zoom img { animation-name: drift; }
@keyframes zoom { from { transform: scale(1.0); } to { transform: scale(1.09); } }
@keyframes drift { from { transform: scale(1.04) translateY(1.5%); } to { transform: scale(1.14) translateY(-1.5%); } }
body.fx1 #stage { animation: sway 16s ease-in-out infinite alternate; }
@keyframes sway { from { filter: hue-rotate(-14deg) saturate(1.2); } to { filter: hue-rotate(14deg) saturate(1.2); } }
#wash { position: fixed; inset: -60%; pointer-events: none; opacity: 0; transition: opacity 1s;
  background: conic-gradient(from 0deg, var(--sunset), var(--gold), var(--teal), var(--violet), var(--pink), var(--sunset));
  mix-blend-mode: soft-light; animation: spin 50s linear infinite; }
body.fx1 #wash { opacity: 0.45; }
@keyframes spin { to { transform: rotate(360deg); } }
#vig { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.55) 100%); }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: none; }
body.vj #gl { display: block; }
body.vj #stage { visibility: hidden; }
body.vj #wash, body.vj #vig { display: none; }

/* Title card and on-screen message */
#card { position: fixed; inset: 0; display: grid; place-items: center; text-align: center; pointer-events: none; opacity: 0; transition: opacity 0.9s; background: radial-gradient(ellipse at center, rgba(36,16,48,0.82), rgba(0,0,0,0.5) 70%); z-index: 5; }
#card.on { opacity: 1; }
#card h1 { font-family: var(--card-font, 'Shrikhand'), 'Bebas Neue', serif; font-weight: var(--card-weight, 400); font-size: var(--card-size, clamp(3.5rem, 19vw, 21rem)); line-height: 0.95; letter-spacing: 0.01em; text-transform: var(--card-case, none);
  background: linear-gradient(90deg, var(--sunset), var(--gold), var(--teal), var(--violet), var(--pink), var(--sunset)); background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: slide 9s linear infinite; filter: drop-shadow(0 6px 0 rgba(0,0,0,0.55)); padding: 0 0.1em; }
@keyframes slide { to { background-position: 300% 0; } }
#card p { font-family: 'Bebas Neue', sans-serif; letter-spacing: 0.22em; font-size: clamp(1.1rem, 3.4vw, 3.6rem); color: #f5ecd7; margin-top: 0.5em; text-shadow: 0 3px 0 rgba(0,0,0,0.6); }
#msg { position: fixed; left: 50%; bottom: 7vh; width: max-content; transform: translateX(-50%); max-width: 92vw; padding: 0.35em 1em; border-radius: 999px; background: rgba(36,16,48,0.88); border: 0.08em solid var(--gold);
  font-family: 'Bebas Neue', sans-serif; letter-spacing: 0.12em; font-size: clamp(1.3rem, 3.6vw, 4.2rem); line-height: 1.1; color: var(--gold); text-align: center; display: none; z-index: 6; }
#msg.on { display: block; }
@media (prefers-reduced-motion: reduce) { body #stage, #wash, .zoom img, #card h1 { animation: none !important; } }

/* ── Dock ─────────────────────────────────────────────────────── */
#dock { position: fixed; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20;
  width: min(1240px, calc(100vw - 24px)); display: flex; flex-direction: column; gap: 7px; padding: 8px 10px 9px;
  background: var(--glass); -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 18px 50px rgba(0,0,0,0.5); transition: opacity 0.45s, transform 0.45s; }
body.idle #dock { opacity: 0; transform: translate(-50%, 24px); pointer-events: none; }
body.panel-open #dock { left: calc((100vw - min(400px, 100vw)) / 2); width: min(1240px, calc(100vw - min(400px, 100vw) - 24px)); }
#dock .cap { display: flex; align-items: baseline; gap: 10px; padding: 0 4px; font-size: 0.78rem; color: rgba(255,255,255,0.62); white-space: nowrap; overflow: hidden; }
#dock .cap b { font: 400 1.05rem 'Bebas Neue', sans-serif; letter-spacing: 0.1em; color: var(--gold); }
#dock .cap span:not(.capr) { overflow: hidden; text-overflow: ellipsis; }
#dock .cap { align-items: center; }
#dock .tripper { margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: 9px; font: 700 0.66rem var(--ui); letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255,255,255,0.7); }
#dock .tripper input { width: clamp(110px, 22vw, 300px); height: 8px; -webkit-appearance: none; appearance: none; border-radius: 999px; outline: none; cursor: pointer;
  background: linear-gradient(90deg, #7a7a7a, #2ec4b6 25%, #D4AF37 50%, #ff5ea0 75%, #b400ff); }
#dock .tripper input::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid #14100a; box-shadow: 0 0 10px rgba(255,255,255,0.7); }
#dock .tripper input::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid #14100a; }
#dock .cap .drift { flex: none; margin-left: 8px; padding: 3px 9px; min-height: 0; font-size: 0.85rem; line-height: 1.2; }
#dock .tripper b { min-width: 9.5ch; font: 700 0.78rem var(--ui); letter-spacing: 0; text-transform: none; color: var(--gold); font-variant-numeric: tabular-nums; }
#dock kbd, #panel kbd { font: 700 0.68rem ui-monospace, Menlo, monospace; background: rgba(255,255,255,0.14); border-radius: 4px; padding: 1px 5px; color: rgba(255,255,255,0.85); }

#dock .looks { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 1px; scroll-snap-type: x proximity; }
#dock .looks::-webkit-scrollbar { display: none; }
.look { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 5px 13px 5px 5px; border-radius: 12px; cursor: pointer; scroll-snap-align: start;
  font: 700 0.83rem var(--ui); color: #fff; background: rgba(255,255,255,0.06); border: 1px solid var(--line); transition: background 0.2s, border-color 0.2s, box-shadow 0.2s; }
.look:hover { background: rgba(255,255,255,0.12); }
.look .sw { width: 26px; height: 26px; border-radius: 8px; flex: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18); }
.look.on { background: rgba(212,175,55,0.2); border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset, 0 0 18px rgba(212,175,55,0.25); }
.look.calm { color: rgba(255,255,255,0.75); }
.look.auto .sw { background: conic-gradient(var(--pink), var(--gold), var(--teal), var(--violet), var(--pink)); }
.look.auto.on { border-color: var(--teal); background: rgba(46,196,182,0.2); box-shadow: 0 0 0 1px var(--teal) inset, 0 0 18px rgba(46,196,182,0.3); }
.look.auto.on .sw { animation: spin 3s linear infinite; }

#dock .bar { display: flex; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none; }
#dock .bar::-webkit-scrollbar { display: none; }
#dock .grp { display: flex; align-items: center; gap: 4px; padding-left: 8px; border-left: 1px solid var(--line); flex: none; }
#dock .spacer { flex: 1; }
.ib { height: 34px; min-width: 34px; padding: 0 11px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; flex: none;
  font: 700 0.82rem var(--ui); color: #fff; background: rgba(255,255,255,0.08); border: 1px solid var(--line); cursor: pointer; text-decoration: none; white-space: nowrap; }
.ib:hover, .ib:focus-visible { background: rgba(255,255,255,0.16); outline: none; border-color: rgba(255,255,255,0.3); }
.ib.on { background: rgba(46,196,182,0.3); border-color: var(--teal); }
.ib.home { background: linear-gradient(90deg, rgba(224,90,51,0.32), rgba(212,175,55,0.32)); border-color: rgba(212,175,55,0.55); }
.ib.more { background: rgba(212,175,55,0.24); border-color: rgba(212,175,55,0.6); }
.beat { display: inline-flex; align-items: center; gap: 6px; padding: 0 6px 0 2px; font-variant-numeric: tabular-nums; }
.beat i { width: 11px; height: 11px; border-radius: 50%; background: var(--gold); opacity: 0.25; transition: opacity 0.05s; }
.beat i.on { opacity: 1; box-shadow: 0 0 12px var(--gold); }
.beat b { font-size: 1rem; min-width: 2ch; text-align: right; }
.beat small { font-size: 0.65rem; letter-spacing: 0.1em; color: rgba(255,255,255,0.55); }
.sl { display: inline-flex; align-items: center; gap: 7px; font: 700 0.66rem var(--ui); letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255,255,255,0.6); padding: 0 4px; }
.sl input { width: 84px; accent-color: var(--gold); }
.seg { display: inline-flex; padding: 2px; gap: 2px; border-radius: 11px; background: rgba(255,255,255,0.06); border: 1px solid var(--line); }
.seg button { height: 30px; padding: 0 10px; border-radius: 8px; border: 0; background: none; color: rgba(255,255,255,0.8); font: 700 0.78rem var(--ui); cursor: pointer; white-space: nowrap; }
.seg button:hover { background: rgba(255,255,255,0.1); }
.seg button.on { background: var(--gold); color: #14100a; }
@media (max-width: 760px) {
  #dock { padding: 7px 7px 8px; gap: 6px; border-radius: 16px; }
  #dock #capTip, #dock .tripper span { display: none; }
  #dock .tripper b { min-width: 0; }
  .look { padding-right: 10px; font-size: 0.78rem; }
  .look .sw { width: 22px; height: 22px; }
}

/* ── Panel (☰ More) ───────────────────────────────────────────── */
#panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 100vw); z-index: 30; overflow-y: auto; padding: 18px 18px 40px;
  background: rgba(12,6,18,0.92); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-left: 1px solid rgba(212,175,55,0.35);
  transform: translateX(105%); transition: transform 0.3s ease; font: 500 0.88rem var(--ui); color: rgba(255,255,255,0.9); }
#panel.open { transform: none; }
#panel h2 { font: 400 1.6rem 'Bebas Neue', sans-serif; letter-spacing: 0.08em; color: var(--gold); display: flex; justify-content: space-between; align-items: center; }
#panel h2 button { font: 700 1.1rem system-ui; background: none; border: 0; color: #fff; cursor: pointer; padding: 4px 8px; }
#panel h3 { font: 700 0.68rem var(--ui); letter-spacing: 0.16em; text-transform: uppercase; color: rgba(255,255,255,0.55); margin: 20px 0 8px; }
#panel p.hint { color: rgba(255,255,255,0.6); font-size: 0.78rem; margin: 6px 0 0; line-height: 1.45; }
#panel .lookgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
#panel .lookgrid button { display: grid; grid-template-columns: 30px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; text-align: left;
  padding: 7px; border-radius: 11px; background: rgba(255,255,255,0.06); border: 1px solid var(--line); color: #fff; cursor: pointer; }
#panel .lookgrid .sw { grid-row: span 2; width: 30px; height: 30px; border-radius: 8px; }
#panel .lookgrid b { font-size: 0.84rem; }
#panel .lookgrid small { font-size: 0.68rem; color: rgba(255,255,255,0.55); line-height: 1.25; }
#panel .lookgrid button.on { border-color: var(--gold); background: rgba(212,175,55,0.2); }
#panel .chips { display: flex; flex-wrap: wrap; gap: 6px; }
#panel .chips button, #panel .chips a { font: 700 0.8rem var(--ui); color: #fff; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.22);
  border-radius: 999px; padding: 6px 11px; cursor: pointer; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
#panel .chips button:hover, #panel .chips a:hover { border-color: var(--gold); }
#panel .chips .on { background: rgba(212,175,55,0.35); border-color: var(--gold); }
#panel .row { display: flex; align-items: center; gap: 10px; margin: 4px 0; }
#panel .lab { width: 84px; font-size: 0.8rem; color: rgba(255,255,255,0.75); }
#panel input[type=range] { flex: 1; accent-color: var(--gold); }
#panel .val { min-width: 64px; text-align: right; font-variant-numeric: tabular-nums; color: var(--gold); font-weight: 700; font-size: 0.82rem; }
#panel .keys2 { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; font-size: 0.8rem; color: rgba(255,255,255,0.75); }
#panel .big { display: block; text-align: center; margin-top: 4px; padding: 10px 14px; border-radius: 12px; text-decoration: none; color: #14100a; font-weight: 700;
  background: linear-gradient(90deg, #E05A33, #D4AF37, #2ec4b6); }
#panel .loops a { font-weight: 500; }

/* Chat panel and DJ player sit above the dock */
body.vjui #live, body.vjui #djp { bottom: calc(150px + env(safe-area-inset-bottom)); }
@media (max-width: 760px) { body.vjui #live, body.vjui #djp { bottom: calc(128px + env(safe-area-inset-bottom)); } }

/* Loop chips: play in the visualizer, small download link beside */
#panel .loopchip { display: inline-flex; border-radius: 999px; overflow: hidden; border: 1px solid rgba(255,255,255,0.22); }
#panel .chips .loopchip button { border: 0; border-radius: 0; background: rgba(255,255,255,0.1); }
#panel .chips .loopchip .dl { border: 0; border-left: 1px solid rgba(255,255,255,0.18); border-radius: 0; padding: 6px 9px; background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.7); }
