/* Highlights -- CS2-Clipkatalog
   Farben und Typografie folgen der Bildsprache des Spiels: gedaempftes
   Blaugrau wie die HUD-Flaechen, CT-Blau fuer Struktur, T-Amber fuer alles,
   was auffallen soll. Eine Schriftfamilie in zwei Breiten. */

:root {
  --ink:      #0f171e;
  --ink-2:    #131e27;
  --panel:    #18242f;
  --panel-hi: #20303d;
  --rule:     #2a3b4a;
  --rule-soft:#21313f;

  --text:     #dde5ec;
  --dim:      #8da0ae;
  --dimmer:   #65798a;

  --ct:       #7fb1de;   /* CT-Blau   -- Struktur, Navigation */
  --t:        #e5ac44;   /* T-Amber   -- Hervorhebung, Fokus */
  --hot:      #e35b40;   /* Killfeed  -- Clutch, Ninja */
  --cool:     #57b79b;   /* Trickshot -- Smoke, Wallbang */

  --pad:      clamp(1rem, 4vw, 2.75rem);
  --maxw:     1560px;
  --radius:   3px;

  --sans:  "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --cond:  "Barlow Condensed", "Barlow", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-underline-offset: 3px;
}

h1, h2, h3 { margin: 0; font-family: var(--cond); font-weight: 700; line-height: 1.05; }

a { color: var(--ct); }

button, select, input { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--t);
  outline-offset: 2px;
  border-radius: 2px;
}

.tabular { font-variant-numeric: tabular-nums; }


/* ---------- Masthead ---------------------------------------------------- */

.masthead {
  border-bottom: 1px solid var(--rule);
  background:
    repeating-linear-gradient(115deg,
      rgba(127,177,222,.045) 0 1px, transparent 1px 9px),
    linear-gradient(180deg, var(--ink-2), var(--ink));
}

.masthead__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(1.75rem, 5vw, 3.25rem) var(--pad) clamp(1.25rem, 3vw, 2rem);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem 2rem;
}

.wordmark {
  font-size: clamp(2.75rem, 7.5vw, 5.5rem);
  font-weight: 800;
  letter-spacing: -.02em;
  text-transform: uppercase;
  color: var(--text);
}

.masthead__sub {
  margin: .35rem 0 0;
  color: var(--dim);
  font-size: .95rem;
}

.tally {
  display: flex;
  flex-wrap: wrap;
  gap: 0 clamp(1.25rem, 3vw, 2.5rem);
  margin: 0;
  padding: 0;
}

.tally div { display: flex; flex-direction: column-reverse; }

.tally dt {
  font-size: .78rem;
  letter-spacing: .04em;
  color: var(--dimmer);
}

.tally dd {
  margin: 0;
  font-family: var(--cond);
  font-weight: 700;
  font-size: 1.9rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}


/* ---------- Scoreboard --------------------------------------------------- */

.roster {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(1.75rem, 4vw, 2.75rem) var(--pad) clamp(1.5rem, 3vw, 2.25rem);
}

.roster__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem 1.5rem;
  margin-bottom: .9rem;
}

.roster__head h2 { font-size: 1.5rem; font-weight: 600; }

.roster__hint { margin: 0; color: var(--dimmer); font-size: .88rem; }

.roster__scroll { overflow-x: auto; }

.board {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.board th {
  font-family: var(--cond);
  font-weight: 600;
  font-size: .95rem;
  color: var(--dim);
  text-align: right;
  padding: 0 .55rem .5rem;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}

.board th.board__name { text-align: left; padding-left: .75rem; }

.board th[data-sort] { cursor: pointer; user-select: none; }
.board th[data-sort]:hover { color: var(--text); }
.board th[aria-sort] { color: var(--t); }

.board td {
  padding: .3rem .55rem;
  text-align: right;
  border-bottom: 1px solid var(--rule-soft);
  font-size: .95rem;
  color: var(--dim);
  white-space: nowrap;
}

.board td:first-child { text-align: left; padding: 0; }

.board tr:last-child td { border-bottom: 0; }

.board td.is-zero { color: #4a5c6b; }

.board__player {
  position: relative;
  display: block;
  width: 100%;
  padding: .55rem .75rem;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
  font-family: var(--cond);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: .01em;
  color: var(--text);
}

/* Der Balken hinter dem Namen zeigt den Anteil an allen Clips --
   dieselbe Leseart wie die Schadensuebersicht am Rundenende. */
.board__bar {
  position: absolute;
  inset: 3px auto 3px 0;
  background: currentColor;
  opacity: .16;
  pointer-events: none;
  border-left: 2px solid currentColor;
}

.board__player span { position: relative; }

.board__player:hover { color: #fff; }
.board__player:hover .board__bar { opacity: .3; }

.board tr.is-on .board__player { color: #fff; }
.board tr.is-on .board__bar { opacity: .34; }


/* ---------- Filterleiste -------------------------------------------------- */

.controls {
  position: sticky;
  top: 0;
  z-index: 20;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: rgba(15, 23, 30, .93);
  backdrop-filter: blur(10px);
}

.controls__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: .7rem var(--pad);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: .65rem .9rem;
}

.seg { display: flex; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }

.seg__btn {
  padding: .42rem .85rem;
  background: none;
  border: 0;
  border-right: 1px solid var(--rule);
  color: var(--dim);
  font-family: var(--cond);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
}

.seg__btn:last-child { border-right: 0; }
.seg__btn:hover { color: var(--text); background: var(--panel); }
.seg__btn.is-on { color: var(--ink); background: var(--t); }

.field { display: flex; flex-direction: column; gap: .2rem; }
.field--grow { flex: 1 1 13rem; min-width: 10rem; }

.field > span { font-size: .75rem; color: var(--dimmer); letter-spacing: .03em; }

.field select,
.field input {
  padding: .38rem .55rem;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  color: var(--text);
  min-width: 8.5rem;
}

.field input { width: 100%; min-width: 0; }
.field select:hover, .field input:hover { border-color: #3a5063; }

.reset {
  padding: .38rem .7rem;
  background: none;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  color: var(--dim);
  cursor: pointer;
}

.reset:hover { color: var(--text); border-color: var(--t); }

.controls__count {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad) .55rem;
  font-size: .82rem;
  color: var(--dimmer);
  font-variant-numeric: tabular-nums;
}


/* ---------- Katalog ------------------------------------------------------- */

.catalog {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(1.25rem, 3vw, 2.25rem) var(--pad) 4rem;
}

.group { margin-bottom: clamp(2.25rem, 5vw, 3.75rem); }

.group__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .3rem 1.25rem;
  padding-bottom: .45rem;
  margin-bottom: 1.1rem;
  border-bottom: 2px solid var(--rule);
}

.group__name {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 700;
  letter-spacing: .005em;
}

.group__name .dot {
  display: inline-block;
  width: .62em;
  height: .62em;
  margin-right: .42em;
  border-radius: 50%;
  background: currentColor;
  vertical-align: baseline;
}

.group__stat { color: var(--dim); font-size: .92rem; font-variant-numeric: tabular-nums; }

.sub { margin-bottom: 1.6rem; }

.sub__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .25rem .8rem;
  padding: .3rem 0 .45rem .7rem;
  margin-bottom: .75rem;
  border-left: 3px solid currentColor;
}

.sub__title {
  font-family: var(--cond);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--text);
}

.sub__date, .sub__count {
  font-size: .85rem;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.sub__count { margin-left: auto; }

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


/* ---------- Clipkarte ----------------------------------------------------- */

.card {
  display: flex;
  flex-direction: column;
  padding: 0;
  background: var(--panel);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  color: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .12s ease, background-color .12s ease;
}

.card:hover { background: var(--panel-hi); border-color: currentColor; }

.card__shot {
  display: block;
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0b1219;
}

.card__shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .9;
  transition: opacity .12s ease;
}

.card:hover .card__shot img { opacity: 1; }

.card__round,
.card__time {
  position: absolute;
  bottom: 0;
  padding: .1rem .38rem;
  font-family: var(--cond);
  font-weight: 600;
  font-size: .86rem;
  font-variant-numeric: tabular-nums;
  background: rgba(8, 13, 18, .82);
  color: var(--text);
}

.card__round { left: 0; border-top: 2px solid currentColor; color: currentColor; }
.card__time  { right: 0; }

.card__body { display: block; padding: .55rem .65rem .6rem; }

.card__label {
  display: block;
  margin: 0;
  font-weight: 600;
  font-size: .96rem;
  line-height: 1.25;
  color: var(--text);
  overflow-wrap: anywhere;
}

.card__who {
  display: block;
  margin: .15rem 0 0;
  font-family: var(--cond);
  font-size: 1rem;
  color: currentColor;
}

.card__meta {
  display: block;
  margin: .3rem 0 0;
  font-size: .8rem;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.card--reel .card__shot img { opacity: .55; }
.card--reel:hover .card__shot img { opacity: .8; }

.empty {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 3rem var(--pad) 5rem;
  color: var(--dim);
}


/* ---------- Abspieler ----------------------------------------------------- */

.viewer {
  width: min(1180px, 94vw);
  max-height: 92vh;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--ink-2);
  color: var(--text);
  overflow: hidden;
}

.viewer::backdrop { background: rgba(6, 10, 14, .88); }

.viewer__stage { position: relative; background: #000; }

.viewer__stage video {
  display: block;
  width: 100%;
  max-height: 64vh;
  background: #000;
}

.viewer__nav,
.viewer__close {
  position: absolute;
  background: rgba(10, 16, 22, .6);
  border: 1px solid rgba(160, 185, 205, .22);
  color: var(--text);
  cursor: pointer;
  line-height: 1;
}

.viewer__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 2.4rem;
  height: 3.4rem;
  font-size: 2rem;
}

.viewer__nav--prev { left: .5rem; }
.viewer__nav--next { right: .5rem; }
.viewer__close { top: .5rem; right: .5rem; width: 2.1rem; height: 2.1rem; font-size: 1.35rem; }

.viewer__nav:hover, .viewer__close:hover { background: var(--t); color: var(--ink); border-color: var(--t); }
.viewer__nav[disabled] { opacity: .25; cursor: default; }
.viewer__nav[disabled]:hover { background: rgba(10, 16, 22, .6); color: var(--text); }

/* Liegt ueber dem Video, wenn es nicht laedt. Die Meldung des Browsers
   ("Kein Video mit unterstuetztem Format und MIME-Typ gefunden") nennt weder
   den Grund noch den naechsten Schritt. */
.viewer__error {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: .45rem;
  margin: 0;
  padding: 2rem;
  text-align: center;
  background: rgba(8, 13, 18, .93);
}

.viewer__error[hidden] { display: none; }

.viewer__error b {
  display: block;
  font-family: var(--cond);
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  font-weight: 700;
  color: var(--t);
}

.viewer__error span { color: var(--dim); font-size: .92rem; max-width: 42ch; }

.viewer__panel { padding: 1rem clamp(1rem, 3vw, 1.6rem) 1.2rem; }

.viewer__crumb {
  margin: 0;
  font-family: var(--cond);
  font-size: 1rem;
  color: var(--dim);
}

.viewer__crumb b { color: currentColor; font-weight: 600; }

.viewer__title { margin: .1rem 0 .8rem; font-size: 1.75rem; font-weight: 700; }

.viewer__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(122px, 1fr));
  gap: .7rem 1.1rem;
  margin: 0 0 1rem;
  padding: .8rem 0 0;
  border-top: 1px solid var(--rule);
}

.viewer__meta div { display: flex; flex-direction: column-reverse; gap: .1rem; }
.viewer__meta dt { font-size: .74rem; color: var(--dimmer); letter-spacing: .03em; }
.viewer__meta dd {
  margin: 0;
  font-family: var(--cond);
  font-weight: 600;
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.viewer__acts { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; }

.btn {
  padding: .4rem .8rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  font-size: .9rem;
}

.btn:hover { border-color: var(--t); color: var(--t); }

.viewer__keys { font-size: .8rem; color: var(--dimmer); }


/* ---------- Fuss ---------------------------------------------------------- */

.foot {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.5rem var(--pad) 3rem;
  border-top: 1px solid var(--rule-soft);
  color: var(--dimmer);
  font-size: .84rem;
}

.foot p { margin: 0; }


/* ---------- Klein --------------------------------------------------------- */

@media (max-width: 640px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
  .card__label { font-size: .88rem; }
  .viewer { width: 100vw; max-height: 100vh; border: 0; border-radius: 0; }
  .viewer__stage video { max-height: 46vh; }
  .controls__inner { gap: .5rem .6rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
