/* Run the Table. Always dark: it is a room with a lamp over a table. */
:root {
  --bg: #0b0e13; --bg-2: #10151d; --surface: #141a24; --surface-2: #1b2230; --line: rgba(255, 255, 255, .1);
  --text: #eef1f6; --muted: #a4adbb; --accent: #f0ab4d; --accent-ink: #1a1206;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --disp: "Bricolage Grotesque", var(--sans);
  --r: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--bg); color: var(--text); font: 400 16px/1.5 var(--sans); -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
a { color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: 999px; border: 1px solid transparent; background: var(--accent); color: var(--accent-ink);
  font: 600 15px/1 var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn.ghost { background: rgba(255, 255, 255, .06); color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: rgba(255, 255, 255, .12); }
.btn .dur { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.icon-btn {
  width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(255, 255, 255, .05); color: var(--text); cursor: pointer; padding: 0;
}
.icon-btn:hover { background: rgba(255, 255, 255, .12); }
.icon-btn svg { width: 22px; height: 22px; }
#soundBtn .cross { display: none; }
#soundBtn[aria-pressed="false"] .cross { display: inline; }
#soundBtn[aria-pressed="false"] .wave { display: none; }

/* Ball chips: a solid, a stripe (white with a band), or the 8. */
.chip {
  --c: #888; flex: none; width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .45), transparent 42%), var(--c);
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, .35);
}
.chip.stripe { background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .5), transparent 42%), linear-gradient(#f4f1e8 0 22%, var(--c) 22% 78%, #f4f1e8 78%); }
.chip b { width: 58%; height: 58%; border-radius: 50%; background: #fbfaf5; color: #111; display: grid; place-items: center; font: 700 12px/1 var(--sans); }

/* ---- Header ---- */
.bar {
  display: flex; align-items: center; gap: 10px; flex: none;
  padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
  background: rgba(11, 14, 19, .92); border-bottom: 1px solid var(--line); position: relative; z-index: 5;
}
.brand { margin: 0; display: flex; align-items: center; gap: 9px; font: 750 19px/1 var(--disp); letter-spacing: -.01em; flex: 1; min-width: 0; white-space: nowrap; }
.brand .chip { width: 26px; height: 26px; }
.brand .chip b { font-size: 10px; }
.bar-end { display: flex; gap: 8px; }
#viewBtn { padding: 0 14px; }
@media (max-width: 440px) {
  .brand { font-size: 15px; }
  .brand .chip { display: none; }
  #viewBtn { padding: 0 11px; font-size: 13.5px; }
  .bar { gap: 6px; }
  .bar-end { gap: 5px; }
}
@media (max-width: 359px) { .brand-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }

/* ---- Views: the list by default; html.play shows the table ---- */
main { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.table { display: none; }
html.play:not(.browsing) body { height: 100vh; height: 100dvh; overflow: hidden; }
html.play:not(.browsing) .browse { display: none; }
html.play:not(.browsing) .table { display: grid; }
html:not(.gl) #viewBtn, html:not(.js) #viewBtn { display: none; }

/* ---- The list ---- */
.browse { padding: 28px max(16px, env(safe-area-inset-right)) max(40px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.browse-in { max-width: 1120px; margin: 0 auto; }
.eyebrow { margin: 0 0 6px; font: 600 12px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.browse h2 { margin: 0 0 10px; font: 750 clamp(26px, 4.4vw, 40px)/1.1 var(--disp); letter-spacing: -.02em; }
.lede { margin: 0 0 22px; color: var(--muted); max-width: 64ch; }
.nogl-note, .reduced-note { display: none; margin: -8px 0 22px; color: var(--muted); }
html.nogl .nogl-note { display: block; }
html.reduced.gl:not(.play) .reduced-note { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.blist { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.bitem { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.bhead { display: flex; gap: 12px; align-items: center; }
.bitem h3 { margin: 0; font: 700 18px/1.2 var(--disp); }
.tagline { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.bitem .shot { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); }
.blurb { margin: 0; }
.links { margin: auto 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.bitem.contact { margin-bottom: 18px; border-color: rgba(240, 171, 77, .35); background: linear-gradient(135deg, rgba(240, 171, 77, .08), transparent 60%), var(--surface); }
.foot { color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); padding-top: 14px; }

/* ---- The table ---- */
.table { flex: 1; min-height: 0; grid-template-rows: 1fr auto; position: relative; }
.stage {
  position: relative; min-height: 0; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none;
  background: radial-gradient(ellipse 70% 60% at 50% 45%, #1f2a33 0%, #10161d 55%, #07090c 100%);
}
.stage:focus { outline: none; }
.stage:focus-visible { outline: 2px solid rgba(240, 171, 77, .55); outline-offset: -2px; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.status {
  position: absolute; top: 10px; left: max(12px, env(safe-area-inset-left)); display: flex; gap: 12px;
  font: 600 13px/1 var(--sans); color: var(--muted); font-variant-numeric: tabular-nums; pointer-events: none;
}
.status span { background: rgba(8, 10, 14, .62); padding: 7px 10px; border-radius: 999px; }
.hint, .toast {
  position: absolute; left: 50%; transform: translateX(-50%); margin: 0; max-width: min(92%, 560px); text-align: center;
  pointer-events: none; font: 500 14px/1.35 var(--sans); padding: 8px 14px; border-radius: 12px; transition: opacity .3s;
}
.hint { bottom: 8px; color: #dfe5ee; background: rgba(8, 10, 14, .6); }
.hint:empty, .toast:empty { opacity: 0; }
.toast { top: 46px; background: rgba(240, 171, 77, .95); color: var(--accent-ink); font-weight: 600; }

.power {
  position: absolute; right: max(10px, env(safe-area-inset-right)); top: 50%; transform: translateY(-50%);
  width: 52px; height: clamp(150px, 46%, 300px); display: flex; flex-direction: column; align-items: center; gap: 6px;
  cursor: grab; touch-action: none; border-radius: 16px;
}
.power-track { position: relative; flex: 1; width: 22px; border-radius: 11px; background: rgba(8, 10, 14, .7); border: 1px solid rgba(255, 255, 255, .16); overflow: hidden; }
.power-fill { position: absolute; left: 0; right: 0; top: 0; height: calc(var(--p, .4) * 100%); background: linear-gradient(#5bd18b, #f0ab4d 60%, #ef5a4a); opacity: .9; }
.power-grip { position: absolute; left: -1px; right: -1px; height: 10px; top: calc(var(--p, .4) * (100% - 10px)); background: #fff; border-radius: 5px; box-shadow: 0 2px 6px rgba(0, 0, 0, .5); }
.power-label { font: 600 11px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.power.pulling { cursor: grabbing; }

.hud {
  display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap;
  padding: 8px max(12px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: rgba(11, 14, 19, .96); border-top: 1px solid var(--line);
}
.spin { flex: none; width: 64px; height: 64px; border-radius: 50%; cursor: crosshair; touch-action: none; }
.spin-face {
  position: relative; display: block; width: 100%; height: 100%; border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #fff, #e7e3d8 55%, #b9b4a8); box-shadow: inset 0 -4px 10px rgba(0, 0, 0, .25);
}
.spin-face::before, .spin-face::after { content: ""; position: absolute; background: rgba(0, 0, 0, .14); }
.spin-face::before { left: 50%; top: 12%; bottom: 12%; width: 1px; }
.spin-face::after { top: 50%; left: 12%; right: 12%; height: 1px; }
.spin-dot { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #d12a2a; box-shadow: 0 0 0 2px rgba(255, 255, 255, .8); left: calc(50% + var(--sx, 0) * 32%); top: calc(50% - var(--sy, 0) * 32%); }
.fine {
  flex: 1 1 100px; min-width: 88px; max-width: 460px; height: 44px; border-radius: 12px; position: relative; overflow: hidden;
  cursor: ew-resize; touch-action: none; border: 1px solid rgba(255, 255, 255, .14); background: #0f141b;
}
.fine-ribs { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .2) 0 2px, transparent 2px 10px); background-position: var(--fx, 0) 0; mask: linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent); -webkit-mask: linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent); }
.fine-label { position: absolute; inset: 0; display: grid; place-items: center; font: 600 12px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
#placeBtn { padding: 0 12px; font-size: 14px; }
#placeBtn[aria-pressed="true"] { background: #fff; color: #111; }
.tray-wrap { flex: 1 1 100%; min-width: 0; display: flex; align-items: center; min-height: 44px; order: -1; margin-bottom: -4px; }
.tray-empty { margin: 0; color: var(--muted); font-size: 14px; }
.tray { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.tray::-webkit-scrollbar { display: none; }
.tray button { width: 44px; height: 44px; border-radius: 50%; border: 0; padding: 5px; background: transparent; cursor: pointer; display: grid; place-items: center; }
.tray button .chip { width: 34px; height: 34px; }
.tray button:hover .chip { transform: scale(1.08); }
.tray li { animation: tray-in .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes tray-in { from { transform: translateY(8px) scale(.6); opacity: 0; } }

/* Wide and landscape: one HUD row, the tray at the end. */
@media (min-width: 760px), (orientation: landscape) and (max-height: 560px) {
  .tray-wrap { flex: 1 1 200px; order: 0; justify-content: flex-end; }
  .tray-empty { text-align: right; }
}
@media (orientation: landscape) and (max-height: 560px) {
  .bar { padding-top: max(6px, env(safe-area-inset-top)); padding-bottom: 6px; }
  .hud { padding-top: 6px; padding-bottom: max(6px, env(safe-area-inset-bottom)); }
  .spin { width: 48px; height: 48px; }
  .status { top: 6px; }
  .toast { top: 38px; }
}

/* The aim camera's switch: bottom-left of the table, out of the way of the power bar. */
.cam-btn { position: absolute; z-index: 2; left: max(10px, env(safe-area-inset-left)); bottom: 8px; background: rgba(8, 10, 14, .62); }
.cam-btn[aria-pressed="true"] { background: rgba(240, 171, 77, .92); color: #1a1206; border-color: transparent; }
.stage:has(#camBtn:not([hidden])) .hint { max-width: calc(100% - 132px); }

/* Phones held upright: the tray of pocketed balls floats over the top-right of the table, so
   the controls under it are one row and the table gets the height back. */
@media (max-width: 600px) and (orientation: portrait) {
  .tray-wrap {
    position: absolute; z-index: 3; top: 4px; right: max(8px, env(safe-area-inset-right)); max-width: calc(100% - 200px);
    min-height: 0; margin: 0; order: 0; flex: none; justify-content: flex-end;
  }
  .tray-empty { display: none; }
  .tray { padding: 0 2px; }
  .hud { flex-wrap: nowrap; padding-top: 8px; }
  .toast { top: 54px; }
}

.help {
  position: absolute; z-index: 4; inset: auto 50% 50% auto; transform: translate(50%, 50%); width: min(92vw, 460px);
  max-height: 90%; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
}
.help h2 { margin: 0 0 8px; font: 700 20px/1.2 var(--disp); }
.help ul { margin: 0 0 10px; padding-left: 18px; }
.help li, .help p { font-size: 14.5px; }

/* ---- Reveal card ---- */
.card { padding: 0; border: 0; background: transparent; color: var(--text); width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: visible; }
.card::backdrop { background: rgba(4, 6, 10, .55); }
.card[open] { animation: card-in .32s cubic-bezier(.2, .8, .2, 1); }
@keyframes card-in { from { transform: translateX(40px); opacity: 0; } }
@media (max-width: 600px) { @keyframes card-in { from { transform: translateY(40px); opacity: 0; } } }
.card-in { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: auto; max-height: calc(100dvh - 24px); box-shadow: 0 30px 90px rgba(0, 0, 0, .65); }
.card-x { position: absolute; top: 10px; right: 10px; z-index: 2; background: rgba(8, 10, 14, .7); }
.card .shot { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.card-body { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 10px; }
.card .bhead { padding-right: 44px; }
.card h2 { margin: 0; font: 750 24px/1.15 var(--disp); letter-spacing: -.01em; }
.card .eyebrow { margin: 0 0 3px; }
.card .icon { width: 40px; height: 40px; border-radius: 10px; margin-left: auto; flex: none; }
.card .tagline { font-size: 15px; }
.card .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.card .contact-hero { padding: 26px 20px 4px; display: grid; justify-items: center; text-align: center; gap: 6px; }
.card .contact-hero .chip { width: 64px; height: 64px; }
.card .contact-hero .chip b { font-size: 20px; }

html.reduced *, html.reduced *::before, html.reduced *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Small screens: the hint stays on one line below the table, the HUD on two rows. */
@media (max-width: 600px), (orientation: landscape) and (max-height: 560px) {
  .hint { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: calc(100% - 24px); padding: 6px 10px; bottom: 5px; }
}
@media (max-width: 400px) {
  .spin { width: 56px; height: 56px; }
  .fine { min-width: 72px; }
  #placeBtn { padding: 0 10px; font-size: 13px; }
  .hud { gap: 8px 10px; }
}
