/* Concert Video Archive — single stylesheet, no build step, no external fonts. */

:root {
  color-scheme: light dark;
  --bg: #fbfaf8;
  --panel: #ffffff;
  --ink: #1b1a19;
  --muted: #6b6764;
  --line: #e4e0da;
  --accent: #8a2f2f;
  --accent-ink: #ffffff;
  --lock: #8a6d1f;
  --ok-bg: #e8f3ea;
  --ok-ink: #245c33;
  --err-bg: #fbeaea;
  --err-ink: #8a2020;
  --radius: 10px;
  --shadow: 0 1px 2px rgb(0 0 0 / 6%), 0 8px 24px rgb(0 0 0 / 5%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16151a;
    --panel: #1f1e24;
    --ink: #ece9e4;
    --muted: #a09a94;
    --line: #33313a;
    --accent: #d9736f;
    --accent-ink: #1a1013;
    --lock: #d6b25e;
    --ok-bg: #1c2f22;
    --ok-ink: #9fd6ae;
    --err-bg: #341c1c;
    --err-ink: #f0a5a0;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 10px 30px rgb(0 0 0 / 35%);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); }
a:hover { text-decoration: none; }

.wrap { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }

.skip {
  position: absolute; left: -9999px;
  background: var(--accent); color: var(--accent-ink); padding: .6rem 1rem;
}
.skip:focus { left: 1rem; top: 1rem; z-index: 10; }

/* Header / footer ---------------------------------------------------------- */

.site-head { border-bottom: 1px solid var(--line); background: var(--panel); }
.head-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 0; flex-wrap: wrap; }
.brand { font-weight: 650; font-size: 1.1rem; text-decoration: none; color: var(--ink); letter-spacing: -.01em; }
.head-nav { display: flex; align-items: center; gap: 1.1rem; font-size: .93rem; }
.head-nav a { text-decoration: none; }
.who { color: var(--muted); }

.site-foot { margin-top: 4rem; border-top: 1px solid var(--line); padding: 1.4rem 0; color: var(--muted); font-size: .87rem; }

main { padding-block: 2rem 1rem; }

/* Type --------------------------------------------------------------------- */

.page-title { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); line-height: 1.15; margin: 0 0 .4rem; letter-spacing: -.02em; }
.lede { color: var(--muted); margin: 0 0 1.6rem; max-width: 62ch; }
.event-desc { max-width: 70ch; }
.crumbs { font-size: .87rem; color: var(--muted); margin-bottom: .9rem; }
.crumbs a { text-decoration: none; }
.crumbs span { opacity: .5; margin-inline: .3rem; }
.empty { color: var(--muted); padding: 2rem 0; }

.event-block { margin-bottom: 3rem; }
.event-heading { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; font-size: 1.3rem; margin: 0 0 .2rem; }
.event-heading a { text-decoration: none; color: var(--ink); }
.event-heading a:hover { color: var(--accent); }
.year-chip { font-size: .78rem; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: .1rem .5rem; }

.age-heading { font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 1.5rem 0 .7rem; font-weight: 650; }
.age-heading .count { opacity: .6; font-weight: 400; }

/* Filters ------------------------------------------------------------------ */

.filters {
  display: flex; gap: .9rem; align-items: end; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem; margin-bottom: 2rem;
}
.filters label { display: flex; flex-direction: column; gap: .3rem; font-size: .8rem; color: var(--muted); }
.filter-search { flex: 1 1 16rem; }
select, input[type=text], input[type=search], input[type=email], input[type=password], input[type=number], input[type=date], textarea {
  font: inherit; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 7px;
  background: var(--bg); color: var(--ink); min-width: 9rem; width: 100%;
}
textarea { min-height: 5rem; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

button, .btn {
  font: inherit; cursor: pointer; text-decoration: none; display: inline-block;
  padding: .55rem 1.1rem; border-radius: 7px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink);
}
button:hover, .btn:hover { border-color: var(--muted); }
.btn-primary, button[type=submit] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover, button[type=submit]:hover { filter: brightness(1.08); }
.btn-disabled { opacity: .5; cursor: not-allowed; }
.btn-quiet { background: none; border: none; color: var(--muted); padding-inline: .2rem; }
.btn-danger { color: var(--err-ink); border-color: currentColor; background: none; }

.chips { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.chip { font-size: .85rem; text-decoration: none; border: 1px solid var(--line); border-radius: 99px; padding: .25rem .8rem; color: var(--ink); }
.chip-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tag { font-size: .8rem; text-decoration: none; }

/* Cards -------------------------------------------------------------------- */

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.2rem; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.card-thumb { position: relative; display: block; aspect-ratio: 16 / 9; background: #0d0d10; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-thumb-empty { position: absolute; inset: 0; display: grid; place-items: center; color: #6a6a72; font-size: 2rem; }
.card-locked .card-thumb img { filter: grayscale(.85) brightness(.55); }

.badge { position: absolute; font-size: .72rem; padding: .15rem .45rem; border-radius: 5px; background: rgb(0 0 0 / 70%); color: #fff; }
.badge-dur { right: .45rem; bottom: .45rem; }
.badge-lock { left: .45rem; top: .45rem; background: var(--lock); color: #14100a; font-weight: 600; }
.badge-lock-sm { position: static; background: var(--lock); color: #14100a; font-weight: 600; }

.card-body { padding: .75rem .85rem .9rem; }
.card-title { font-size: 1rem; margin: 0 0 .15rem; line-height: 1.3; }
.card-title a { text-decoration: none; color: var(--ink); }
.card-title a:hover { color: var(--accent); }
.card-sub { margin: 0 0 .35rem; color: var(--muted); font-size: .87rem; }
.card-meta { margin: 0; font-size: .8rem; color: var(--muted); display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.card-meta a { text-decoration: none; }

/* Player ------------------------------------------------------------------- */

.player-wrap { background: #000; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 1.2rem; }
.player { display: block; width: 100%; max-height: 78vh; aspect-ratio: 16 / 9; background: #000; }

.actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.share-line { font-size: .85rem; color: var(--muted); display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.share-input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; max-width: 30rem; }

.details { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.2rem; font-size: .9rem; max-width: 34rem; }
.details dt { color: var(--muted); }
.details dd { margin: 0; }

/* Forms / flashes ---------------------------------------------------------- */

.unlock, .form-narrow {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.3rem; max-width: 34rem; box-shadow: var(--shadow); margin-bottom: 2rem;
}
.unlock h2, .form-narrow h2 { margin-top: 0; font-size: 1.15rem; }
.unlock-row { display: flex; gap: .5rem; }
.unlock-row input { flex: 1; }
.form-narrow label { display: block; margin-bottom: .9rem; font-size: .85rem; color: var(--muted); }
.form-narrow input { margin-top: .25rem; }

.link-inline { display: flex; gap: .3rem; align-items: center; margin-bottom: .3rem; }
.link-inline input { width: auto; min-width: 0; font-size: .82rem; padding: .3rem .4rem; }
.link-inline button { font-size: .82rem; padding: .3rem .7rem; }

.gate-ways { margin: 0 0 1.1rem; padding-left: 1.1rem; font-size: .92rem; color: var(--muted); }
.gate-ways li { margin-bottom: .35rem; }
.gate-ways strong { color: var(--ink); font-weight: 600; }
.gate-alt { margin: .8rem 0 0; font-size: .9rem; color: var(--muted); }

.flash { padding: .65rem .9rem; border-radius: 7px; margin: 0 0 1.2rem; font-size: .92rem; }
.flash-ok { background: var(--ok-bg); color: var(--ok-ink); }
.flash-err { background: var(--err-bg); color: var(--err-ink); }

/* Tables (admin) ----------------------------------------------------------- */

.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.wide { white-space: normal; min-width: 16rem; }

.admin-nav { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.8rem; padding-bottom: .8rem; border-bottom: 1px solid var(--line); font-size: .92rem; }
.admin-nav a { text-decoration: none; }
.admin-nav a.on { font-weight: 650; color: var(--ink); }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; }
.stat b { display: block; font-size: 1.7rem; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: .8rem; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; margin-bottom: 1.5rem; }
.form-grid label { display: block; font-size: .8rem; color: var(--muted); }
.form-grid label input, .form-grid label select, .form-grid label textarea { margin-top: .25rem; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-grid .check { display: flex; align-items: center; gap: .5rem; }
.form-grid .check input { width: auto; }
.hint { color: var(--muted); font-size: .8rem; margin: .3rem 0 0; }

/* Share-link page ----------------------------------------------------------
   s.php renders the player on its own, with no site header, nav or footer.
   Always dark: it is a viewing surface, not a document. */

/* The page is a fixed-height column: player on top taking whatever space is
   left, caption bar below at its natural height. The height must be definite
   (height, not min-height) or the percentage sizing below has nothing to
   resolve against and the video falls back to its intrinsic size — which for a
   1080p recording is far taller than the window. */
body.embed {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #0b0b0d;
  color: #ece9e4;
}

.embed-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1400px;
  margin-inline: auto;
}

/* min-height:0 lets this shrink below the video's intrinsic height; without it
   the flex item's automatic minimum size keeps the player too tall. */
.embed-player {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  display: flex;
  background: #000;
}

/* Fills the space it is given; object-fit letterboxes rather than distorts, so
   portrait and 4:3 recordings fit as happily as 16:9. */
.embed-player video {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #000;
}

.embed-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
  padding: .9rem 1.2rem 1.1rem;
}
.embed-title { margin: 0; font-size: 1.05rem; font-weight: 600; letter-spacing: -.01em; }
.embed-sub { margin: .15rem 0 0; font-size: .85rem; color: #9b968f; }

.embed-dl {
  flex: none;
  text-decoration: none;
  font-size: .9rem;
  padding: .5rem 1.05rem;
  border-radius: 7px;
  background: #ece9e4;
  color: #16151a;
  border: 1px solid transparent;
}
.embed-dl:hover { background: #fff; }

.embed-back { display: inline-block; font-size: .82rem; color: #9b968f; text-decoration: none; margin-bottom: .2rem; }
.embed-back:hover { color: #ece9e4; }

/* Event links show a listing instead of a player, so this page scrolls. */
.embed-list { display: block; overflow-y: auto; padding: 1.5rem 1.2rem 3rem; }
.embed-listhead { margin-bottom: 1.5rem; }
.embed-listhead .embed-title { font-size: 1.35rem; }
.embed-agehead {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .08em;
  color: #9b968f; margin: 1.6rem 0 .7rem; font-weight: 650;
}
.embed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1.1rem; }
.embed-card { text-decoration: none; color: inherit; display: block; }
.embed-card-thumb {
  position: relative; display: block; aspect-ratio: 16 / 9; background: #000;
  border-radius: 8px; overflow: hidden; margin-bottom: .5rem;
}
.embed-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.embed-card-empty { position: absolute; inset: 0; display: grid; place-items: center; color: #55555e; font-size: 1.6rem; }
.embed-card-title { display: block; font-size: .95rem; font-weight: 600; line-height: 1.3; }
.embed-card-sub { display: block; font-size: .82rem; color: #9b968f; margin-top: .1rem; }
.embed-card:hover .embed-card-title { text-decoration: underline; }

.embed-note { padding: 3rem 1.5rem; text-align: center; max-width: 34rem; }
.embed-note h1 { font-size: 1.25rem; margin: 0 0 .5rem; }
.embed-note p { color: #9b968f; margin: 0; }

@media (max-width: 560px) {
  .embed-bar { padding: .8rem 1rem 1rem; }
  .embed-dl { width: 100%; text-align: center; }
}

/* Chart -------------------------------------------------------------------- */

.chart { margin: 0 0 2rem; }
.chart figcaption { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .5rem; }
.chart-bars { display: flex; align-items: flex-end; gap: 1px; height: 120px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem; }
.chart-bar { position: relative; display: flex; align-items: flex-end; height: 100%; }
.chart-bar > span:first-child { width: 100%; background: var(--accent); border-radius: 2px 2px 0 0; min-height: 0; }
.chart-tip { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); font-size: .72rem; padding: .15rem .4rem; border-radius: 4px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s; }
.chart-bar:hover .chart-tip { opacity: 1; }
.chart-scale { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); margin: .35rem 0 0; }

@media (max-width: 640px) {
  .filters { flex-direction: column; align-items: stretch; }
  th, td { padding: .5rem .55rem; }
}
