:root {
  --green: #29f50a;
  --text: #f2f5f0;
  --muted: #adb7a9;
  --card: rgb(6 9 6 / .86);
  --line: rgb(41 245 10 / .28);
  --live: #ff3048;
  --header: 78px;
  --player: 0px;
  --tabs: 0px;
  color-scheme: dark;
  font: 16px/1.55 Arial, Helvetica, sans-serif;
  color: var(--text);
  background: #000;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header) + 12px);
}
*, ::before, ::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html:not(.js) .js-only { display: none !important; }
body { margin: 0; padding-bottom: calc(var(--player) + var(--tabs)); }
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1;
  background: #07090a url('img/background.jpg') center / cover;
}
h1, h2, h3, p { margin: 0 0 12px; }
h2 { font-size: 28px; line-height: 1.15; overflow-wrap: anywhere; }
h3 { font-size: 15px; color: var(--green); text-transform: uppercase; letter-spacing: .06em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: var(--green); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; left: 8px; top: -100px; z-index: 100; padding: 12px; background: #000; }
.skip:focus { top: 8px; }
.muted { color: var(--muted); }

/* Header */
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--header);
  display: flex; align-items: center; gap: 24px;
  padding: 0 max(16px, calc(50% - 580px));
  background: #000; box-shadow: 0 0 30px rgb(0 128 0 / .8);
}
.brand img { display: block; width: auto; height: 62px; }
.sections { display: flex; gap: 4px; margin-left: auto; }
.sections a {
  display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 12px;
  color: var(--text); text-decoration: none;
}
.sections a:hover, .sections a[aria-current] { color: var(--green); }
.sections a[aria-current] { box-shadow: inset 0 -2px var(--green); }
.sections .home-link { display: none; }
.status {
  display: flex; align-items: center; gap: 7px; min-height: 44px; min-width: 96px; justify-content: center;
  color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 700;
}
.dot { width: 10px; height: 10px; border-radius: 50%; background: #5d665a; }
.live .status { color: #fff; }
.live .dot { background: var(--live); box-shadow: 0 0 10px var(--live); }

/* Layout */
main { max-width: 1192px; margin: 0 auto; padding: 24px 16px 8px; }
.card { margin-bottom: 20px; padding: 24px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; }
.hero .card { margin: 0; display: flex; flex-direction: column; justify-content: center; min-height: 260px; }
.eyebrow { margin-bottom: 8px; color: var(--green); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.hero h2 { font-size: 38px; }
.latest { border-color: var(--green); box-shadow: inset 0 0 50px rgb(41 245 10 / .09); }
.live .stream { border-color: var(--live); }
.live #stream-label { color: #ff6b7c; }
.stream-media { position: relative; margin: -8px -8px 16px; aspect-ratio: 16 / 9; background: #000; overflow: hidden; border-radius: 10px; }
.stream-media img, .stream-media iframe { display: block; width: 100%; height: 100%; border: 0; object-fit: cover; }
.heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0 16px; }
.about { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 8px 36px; }
.email { display: inline-flex; align-items: center; min-height: 44px; overflow-wrap: anywhere; }

/* Buttons and fields */
.buttons { display: flex; flex-wrap: wrap; gap: 9px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 20px;
  color: var(--text); background: #182016; border: 1px solid #3a4936; border-radius: 24px;
  font-weight: 700; text-decoration: none;
}
.button:hover { border-color: var(--green); }
.button.primary { color: #021000; background: var(--green); border-color: var(--green); }
.button.big { align-self: flex-start; min-height: 54px; padding: 0 30px; font-size: 18px; }
.social-twitch { background: #5b2ca8; }
.social-youtube { background: #a51414; }
.social-discord { background: #3c45a5; }
.more { display: flex; margin: 16px auto 0; }
.tag { display: inline-block; padding: 1px 7px; color: #021000; background: var(--green); border-radius: 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0; }
.tools { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 14px; }
.tools input, .tools select {
  min-height: 44px; width: 320px; max-width: 100%; padding: 0 14px;
  background: #0d120c; border: 1px solid #3a4936; border-radius: 22px;
}
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { min-height: 44px; min-width: 52px; padding: 0 14px; background: #0d120c; border: 1px solid #3a4936; border-radius: 22px; }
.chip[aria-pressed='true'] { color: #021000; background: var(--green); border-color: var(--green); }

/* Mixes */
.mix { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #202a1e; }
.js .mix-list:not(.expanded) .mix.extra { display: none; }
.mix-play { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; min-height: 66px; padding: 8px 6px; color: var(--text); text-decoration: none; }
.mix-text { min-width: 0; }
.mix-title { display: block; line-height: 1.3; overflow-wrap: anywhere; }
.mix small { display: block; color: var(--muted); font-size: 13px; }
.mix-play:hover .mix-title, .mix.current .mix-title { color: var(--green); }
.play-icon { position: relative; flex: none; display: block; width: 40px; height: 40px; border: 2px solid var(--green); border-radius: 50%; }
.play-icon::before {
  content: ''; position: absolute; left: 14px; top: 10px;
  border: solid transparent; border-width: 8px 0 8px 12px; border-left-color: var(--green);
}
.playing .play-icon::before { left: 11px; top: 11px; width: 14px; height: 14px; box-sizing: border-box; border: solid var(--green); border-width: 0 4px; }
.small-button {
  flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 10px;
  color: var(--muted); background: none; border: 1px solid #2c3829; border-radius: 22px; font-size: 13px; text-decoration: none;
}
.small-button:hover { color: var(--green); border-color: var(--green); }
.empty { padding: 24px 0; color: var(--muted); text-align: center; }

/* Photobooth */
.board ol { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.board li { max-width: 100%; }
.person { display: flex; align-items: center; gap: 9px; min-height: 44px; max-width: 100%; padding: 0 14px; background: #111a0f; border: 1px solid #2c3829; border-radius: 10px; }
.person b { color: var(--green); }
.person span { overflow-wrap: anywhere; }
.person em { color: var(--muted); font-style: normal; }
html:not(.js) .person { pointer-events: none; }
.photos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.js .photos:not(.filtered) .photo.extra { display: none; }
.photo a { display: block; height: 100%; color: var(--text); background: #0d120c; border-radius: 10px; overflow: hidden; text-decoration: none; }
.photo img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.caption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 8px; padding: 6px 9px; font-size: 12px; }
.caption .by { min-width: 0; overflow-wrap: anywhere; }
.caption time { color: var(--muted); }

/* Commands and rig */
.command-columns { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px 36px; }
.command-group { margin-bottom: 18px; }
.commands { display: flex; flex-wrap: wrap; gap: 8px; }
.copy { min-height: 44px; min-width: 64px; padding: 0 12px; background: #0d120c; border: 1px solid #2c3829; border-radius: 8px; font-family: Consolas, monospace; }
.copy:hover { color: var(--green); border-color: var(--green); }
html:not(.js) .copy { pointer-events: none; }
.synced { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 8px; }
.synced li { min-width: 0; padding: 10px; background: #0d120c; border: 1px solid #202a1e; border-radius: 10px; }
.command-name { display: block; font-weight: 700; overflow-wrap: anywhere; }
.permissions { display: block; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.triggers { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.triggers .copy, .triggers code { max-width: 100%; overflow-wrap: anywhere; }
.triggers code { padding: 10px; color: var(--muted); }
.synced-time { font-size: 13px; }
.redeems li { display: flex; gap: 14px; padding: 7px 0; border-bottom: 1px solid #202a1e; }
.redeems b { flex: none; min-width: 52px; color: var(--green); text-align: right; }
.rig { margin-top: 16px; border-top: 1px solid #202a1e; }
.rig summary { min-height: 50px; padding: 14px 0 8px; color: var(--green); font-weight: 700; cursor: pointer; }
.rig dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 28px; }
.rig dt { color: var(--muted); font-size: 13px; }
.rig dd { margin: 0; overflow-wrap: anywhere; }
.footer { padding: 14px; color: var(--muted); background: #000; text-align: center; font-size: 13px; }

/* Player */
.has-player { --player: 82px; }
.player {
  position: fixed; left: 0; right: 0; bottom: var(--tabs); z-index: 30; height: 82px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.5fr) 110px; align-items: center; gap: 20px;
  padding: 0 max(16px, calc(50% - 580px));
  background: #000; border-top: 1px solid var(--green); box-shadow: 0 0 30px rgb(0 128 0 / .6);
}
.player-title { min-width: 0; line-height: 1.3; }
.player-title strong, .player-title small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.player-title small { color: var(--muted); }
.player-buttons { display: flex; align-items: center; gap: 4px; }
.player-buttons button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; background: none; border: 0; }
.icon-previous, .icon-next { width: 16px; height: 16px; background: var(--text); }
.icon-previous { clip-path: polygon(0 0, 20% 0, 20% 45%, 100% 0, 100% 100%, 20% 55%, 20% 100%, 0 100%); }
.icon-next { clip-path: polygon(100% 0, 80% 0, 80% 45%, 0 0, 0 100%, 80% 55%, 80% 100%, 100% 100%); }
.seek { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.seek input { flex: 1; min-width: 0; }
input[type='range'] { height: 32px; accent-color: var(--green); }
.volume { width: 100%; }

/* Photo viewer */
.lightbox {
  width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; border: 0; padding: 56px 12px 8px;
  color: var(--text); background: rgb(0 0 0 / .96);
}
.lightbox[open] { display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.lightbox img { width: 100%; height: 100%; min-height: 0; object-fit: contain; touch-action: pan-y pinch-zoom; }
.lightbox button { width: 52px; height: 52px; background: none; border: 0; font-size: 36px; }
.lightbox-close { position: absolute; right: 6px; top: 2px; }
.lightbox-bar { display: flex; align-items: center; justify-content: center; gap: 12px; }
.lightbox-bar p { margin: 0; min-width: 0; text-align: center; font-size: 14px; }
.lightbox-bar a { display: block; padding: 12px; }
html:has(.lightbox[open]) { overflow: hidden; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--player) + var(--tabs) + 16px); z-index: 50; transform: translateX(-50%);
  margin: 0; max-width: calc(100% - 32px); padding: 10px 18px;
  color: #021000; background: var(--green); border-radius: 22px; font-weight: 700;
}
.toast:empty { display: none; }

@media (max-width: 1000px) {
  .photos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .player { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.2fr); }
  .volume { display: none; }
  .topbar { gap: 10px; }
  .sections a { padding: 0 8px; }
}

/* Phones: tabs at the bottom, player above them */
@media (max-width: 760px) {
  :root { --header: 62px; --tabs: calc(54px + env(safe-area-inset-bottom, 0px)); }
  .has-player { --player: 104px; }
  .brand img { height: 48px; }
  .topbar { padding: 0 10px; }
  .status { margin-left: auto; }
  .sections {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; height: var(--tabs); margin: 0; gap: 0;
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #000; border-top: 1px solid #202a1e;
  }
  .sections a, .sections .home-link { display: flex; padding: 0; font-size: 12px; }
  .sections a[aria-current] { box-shadow: inset 0 3px var(--green); }
  main { padding: 12px 10px 4px; }
  .card { padding: 18px 14px; margin-bottom: 12px; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 12px; margin-bottom: 12px; }
  .hero .card { min-height: 0; }
  .hero h2 { font-size: 27px; }
  /* Newest mix first, unless the stream is live */
  .latest { order: -1; }
  .live .latest { order: 1; }
  .stream .buttons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stream .button { padding: 0 4px; font-size: 14px; }
  #watch { grid-column: 1 / -1; }
  h2 { font-size: 24px; }
  .tools input, .tools select { width: 100%; font-size: 16px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; padding-bottom: 4px; }
  .chip { flex: none; }
  .mix { flex-wrap: wrap; gap: 0 8px; padding-bottom: 2px; }
  .mix-play { flex-basis: 100%; min-height: 56px; padding-bottom: 0; }
  .mix .small-button { border: 0; }
  .mix .share { margin-left: 50px; }
  .photos { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .about, .command-columns, .rig dl { grid-template-columns: minmax(0, 1fr); }
  .rig dd a { display: flex; align-items: center; min-height: 44px; }
  .about p a { display: inline-flex; align-items: center; min-height: 44px; }
  .player {
    height: 104px; padding: 4px 10px; gap: 0 8px;
    grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 54px 42px;
  }
  .seek { grid-column: 1 / -1; }
  input[type='range'] { height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
}
