:root {
  --bg: #0b0d18;
  --card: #141829;
  --card-2: #1b2036;
  --line: #262c47;
  --line-hover: #3b4570;
  --text: #e7e9f3;
  --soft: #c9cdf0;
  --muted: #9097b3;
  --blue: #1e90ff;
  --purple: #b44cff;
  --green: #3ddc84;
  --red: #ff5c6c;
  --amber: #f2b13c;
  --live: #e0243a;
  --grad: linear-gradient(90deg, var(--blue), var(--purple));
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: radial-gradient(ellipse at top, #161a33 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
}

a { color: #7cb8ff; }
a:hover { color: #b9d9ff; }
code {
  font: 0.92em ui-monospace, "Cascadia Mono", Consolas, monospace;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.1em 0.4em;
}
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ------------------------------------------------------------ header */

/* The areas stay centered, Streams and Impressum share an oval on the far right */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(11, 13, 24, 0.78);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.tabs { display: flex; gap: 4px; background: var(--card); padding: 4px; border-radius: 999px; border: 1px solid var(--line); }
.tabs a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  padding: 7px 20px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.15s, background-color 0.15s;
}
.tabs a:hover { color: var(--text); background: var(--card-2); }
.tabs a.active { color: #fff; background: var(--grad); }
.tabs { flex-wrap: wrap; justify-content: center; }
.top > .tabs:first-child { grid-column: 2; }
.top > .tabs.side { grid-column: 3; justify-self: end; flex-wrap: nowrap; }
.live-count { background: var(--live); color: #fff; font-size: 12px; border-radius: 999px; padding: 0 7px; line-height: 18px; }

/* -------------------------------------------------------------- main */

main { width: 100%; flex: 1; }
.wrap { position: relative; width: 100%; max-width: 980px; margin: 0 auto; padding: 24px 16px 48px; }
.wrap.wide { max-width: 1440px; }
main.admin, main.legal { margin: 0 auto; padding: 24px 16px 48px; }
main.admin { max-width: 640px; }
main.legal { max-width: 780px; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 12px; letter-spacing: -0.01em; }
h1 { font-size: 30px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; color: var(--soft); }
.sub, .muted, .hint { color: var(--muted); }
.hint { font-size: 14px; margin: 12px 0 0; }

/* -------------------------------------------------------------- hero */

/* The whole image must stay visible (the two figures at the bottom look at each other): never crop it */
.hero {
  --hero-width: min(100vw - 32px, 1500px);
  position: relative;
  z-index: 0;
  text-align: center;
  padding: 28px 0 32px;
  min-height: calc(var(--hero-width) * 1025 / 1920 + 8px);
}
.hero-bg {
  position: absolute;
  top: -8px;
  left: 50%;
  z-index: -1;
  width: var(--hero-width);
  max-width: none;
  height: auto;
  border-radius: var(--radius);
  transform: translateX(-50%);
  pointer-events: none;
}
.logo { width: min(38vw, 520px); height: auto; filter: drop-shadow(0 8px 30px rgba(11, 13, 24, 0.75)); }
.release-label { margin: 8px 0 0; font-size: 18px; font-weight: 700; color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8); }
.countdown { display: flex; justify-content: center; gap: 8px; margin-top: 6px; }
.countdown div {
  min-width: 68px;
  padding: 8px 6px 6px;
  background: rgba(20, 24, 41, 0.85);
  border: 1px solid var(--line);
  border-radius: 10px;
  line-height: 1.2;
}
.countdown b { display: block; font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; color: #fff; }
.countdown span { display: block; font-size: 12px; font-weight: 600; color: var(--soft); }
.hero-btn { margin-top: 12px; padding: 9px 20px; font-size: 15px; }
.tagline { margin: 8px 0 14px; font-size: 18px; color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 6px 16px;
  background: rgba(20, 24, 41, 0.85);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 600;
}
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.status.on .dot { background: var(--green); box-shadow: 0 0 0 4px rgba(61, 220, 132, 0.18); }
.status.off .dot { background: var(--red); }

/* ------------------------------------------------------------- cards */

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 16px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 16px;
  transition: border-color 0.15s;
}
.grid .card { margin-bottom: 0; }
.grid .card:hover { border-color: var(--line-hover); }
.card p { margin: 0 0 12px; }
.card p:last-child { margin-bottom: 0; }
.card h2 { margin-top: 18px; }
.card h2:first-child { margin-top: 0; }

.addr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 8px 8px 14px;
  margin-bottom: 14px;
}
.addr code { background: none; border: 0; padding: 0; font-size: 18px; font-weight: 700; }
button, .btn {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--grad);
  border: 0;
  border-radius: 8px;
  padding: 7px 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: filter 0.15s;
}
button:hover, .btn:hover { filter: brightness(1.12); color: #fff; }
button.copied { background: #1f9d58; }
button.ghost { background: var(--card-2); border: 1px solid var(--line); }
button.danger { background: #3a1d27; color: var(--red); border: 1px solid #5a2735; }
button:disabled { opacity: 0.6; cursor: default; }

dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; margin: 0; }
dt { color: var(--muted); }
dd { margin: 0; font-weight: 600; }

.notice {
  margin: 0 0 16px;
  padding: 14px 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--soft);
  text-align: center;
}
.section-head { margin: 28px 0 14px; text-align: center; }
.features { padding-left: 20px; margin: 0; }
ol { padding-left: 20px; margin: 0; }
li { margin-bottom: 6px; }

/* ---------------------------------------------------------- streamer */

.stream-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 28px; }
.stream-head h1 { margin-bottom: 4px; }
.stream-head .sub { margin: 0; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.filters input[type="search"] { flex: none; width: 240px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; cursor: pointer; white-space: nowrap; }
.check input { flex: none; accent-color: var(--blue); }

.stream-block { margin-top: 28px; }
.stream-block h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.stream-block h2 b { font-weight: inherit; }
.stream-block h2 span:not(:empty) { background: var(--card-2); border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 13px; font-weight: 600; line-height: 20px; padding: 0 9px; letter-spacing: 0; }
.stream-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }

.stream {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.stream:hover { transform: translateY(-2px); border-color: var(--line-hover); box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35); }
.stream.is-live { border-color: #5b3a8f; }
.stream.is-live:hover { border-color: var(--purple); }
.stream.playing { grid-column: 1 / -1; transform: none; box-shadow: none; }
.pane { position: relative; aspect-ratio: 16 / 9; background: var(--card-2); }
.stream.playing .pane { width: min(100%, calc((100vh - 170px) * 16 / 9)); margin: 0 auto; }
.pane iframe { display: block; width: 100%; height: 100%; border: 0; }

.tile { display: block; position: relative; width: 100%; height: 100%; padding: 0; border-radius: 0; background: var(--card-2); color: #fff; text-decoration: none; overflow: hidden; }
.tile:hover { filter: none; }
.thumb { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.25s, filter 0.2s; }
.stream:hover .thumb { transform: scale(1.03); }
.tile-avatar { position: absolute; top: 50%; left: 50%; width: 30%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; object-fit: cover; opacity: 0.6; transition: filter 0.2s; }
.stream:not(.is-live) .thumb, .stream:not(.is-live) .tile-avatar { filter: grayscale(1); }
.stream:not(.is-live):hover .thumb, .stream:not(.is-live):hover .tile-avatar { filter: none; }

.edge { position: absolute; left: 10px; display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; line-height: 22px; }
.edge-top { top: 10px; }
.edge-bottom { bottom: 10px; }
.edge > span { background: rgba(11, 13, 24, 0.78); border-radius: 6px; padding: 0 8px; backdrop-filter: blur(4px); }
.edge mark { background: var(--live); color: #fff; border-radius: 6px; padding: 0 8px; font-size: 11px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.edge mark.off { background: rgba(11, 13, 24, 0.78); color: var(--soft); }
.play { position: absolute; top: 50%; left: 50%; width: 56px; height: 56px; transform: translate(-50%, -50%); border-radius: 50%; background: var(--grad); opacity: 0; transition: opacity 0.15s; }
.play::before { content: ""; position: absolute; top: 17px; left: 22px; border-style: solid; border-width: 11px 0 11px 18px; border-color: transparent transparent transparent #fff; }
.tile:hover .play, .tile:focus-visible .play { opacity: 1; }
@media (hover: none) { .play { opacity: 0.9; } }

.consent { height: 100%; padding: 16px; background: var(--card-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; font-size: 14px; }
.consent p { margin: 0; max-width: 520px; color: var(--soft); }
.remember { display: flex; align-items: center; gap: 8px; color: var(--text); }
.remember input { flex: none; }

.stream-info { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; column-gap: 12px; align-items: start; padding: 12px 14px 14px; }
.avatar { display: block; width: 44px; height: 44px; border-radius: 50%; background: var(--card-2); object-fit: cover; }
.stream-info h3 { margin: 0; font-size: 16px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stream-info h3 a { color: inherit; text-decoration: none; }
.stream-info h3 a:hover { color: #7cb8ff; }
.stream-info p { margin: 1px 0 0; font-size: 14px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stream-title { color: var(--soft); }
.stream-info .stream-meta { color: var(--muted); font-size: 13px; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; height: 22px; overflow: hidden; margin: 8px 0 0; padding: 0; }
.tags li { margin: 0; padding: 0 8px; background: var(--card-2); border: 1px solid var(--line); border-radius: 999px; color: var(--soft); font-size: 12px; font-weight: 600; line-height: 20px; white-space: nowrap; }
.close-player { display: none; }
.stream.playing .close-player { display: block; }
.stream.playing .stream-title { white-space: normal; }

/* ------------------------------------------------------ status, stats */

.status.small { padding: 3px 12px; font-size: 13px; gap: 8px; background: var(--card-2); }
.status.small .dot { width: 8px; height: 8px; }
.machine-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.machine-head h2 { margin: 0; }
#tab-status .stream-head { margin-bottom: 20px; align-items: center; }
#tab-status .card h2 { margin-top: 0; }
#tab-stats .stream-head { margin-bottom: 20px; }
#stats-title { overflow-wrap: anywhere; }

.uptime-row { margin-bottom: 14px; }
.uptime-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 4px; font-weight: 600; }
.uptime-head b { font-variant-numeric: tabular-nums; }
.ticks { display: flex; gap: 2px; height: 28px; }
.ticks i { flex: 1; min-width: 0; border-radius: 3px; background: var(--card-2); transition: opacity 0.1s; }
.ticks i:hover { opacity: 0.7; }
.ticks .good, .legend .good { background: var(--green); }
.ticks .warn, .legend .warn { background: var(--amber); }
.ticks .bad, .legend .bad { background: var(--red); }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 10px; padding: 0; color: var(--muted); font-size: 13px; }
.legend li { display: flex; align-items: center; gap: 6px; margin: 0; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--card-2); }
.uptime details { margin-top: 12px; font-size: 14px; }
.table-scroll { max-height: 320px; overflow-y: auto; margin-top: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { padding: 4px 8px; text-align: right; border-bottom: 1px solid var(--line); font-weight: 400; }
thead th { color: var(--muted); position: sticky; top: 0; background: var(--card); }
th:first-child { text-align: left; }
.tip { position: fixed; z-index: 20; padding: 3px 9px; background: var(--card-2); border: 1px solid var(--line-hover); border-radius: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; pointer-events: none; }

.meters { display: grid; gap: 12px; margin-bottom: 16px; }
.meter { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; font-size: 14px; }
.meter-label { color: var(--muted); }
.meter b { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.track { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: var(--card-2); overflow: hidden; }
.track i { display: block; height: 100%; min-width: 2px; border-radius: 999px; background: var(--blue); transition: width 0.4s; }
.track i.warn { background: var(--amber); }
.track i.bad { background: var(--red); }

dl.rows { display: block; font-size: 14px; }
dl.rows > div { display: flex; justify-content: space-between; gap: 16px; padding: 5px 0; border-bottom: 1px solid var(--line); }
dl.rows > div:last-child { border-bottom: 0; }
dl.rows dd { text-align: right; font-variant-numeric: tabular-nums; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 16px; }
#stats-groups, #player-groups { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.tile-stat { padding: 16px 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.tile-stat span, .tile-stat small { display: block; color: var(--muted); font-size: 14px; }
.tile-stat small { font-size: 13px; min-height: 1.4em; }
.tile-stat b { display: block; font-size: 28px; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.tiles.small { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.tiles.small .tile-stat { padding: 10px 12px; background: var(--card-2); border-radius: 10px; }
.tiles.small .tile-stat b { font-size: 22px; }
.list li.muted { justify-content: flex-start; }
#outages li { font-size: 14px; }
#outages b { font-weight: 600; white-space: nowrap; }

.tiles.small.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
#peak-card h3 { margin: 18px 0 0; }
#peak-card details { margin-top: 12px; font-size: 14px; }
/* Room above for the number on the highest bar, on the left for the axis */
.peak-chart { margin: 30px 0 0 28px; }
.peak-plot { position: relative; height: 160px; }
.peak-grid i { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--line); font-style: normal; }
.peak-grid span { position: absolute; right: calc(100% + 8px); top: -0.75em; font-size: 12px; line-height: 1.4; color: var(--muted); font-variant-numeric: tabular-nums; }
.peak-bars { position: absolute; inset: 0; display: flex; gap: 2px; }
.peak-bars > div { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.peak-bars i { flex: none; width: 100%; max-width: 24px; min-height: 2px; border-radius: 4px 4px 0 0; background: var(--blue); transition: opacity 0.1s; }
.peak-bars > div:hover i { opacity: 0.7; }
.peak-bars b { flex: none; margin-bottom: 2px; font-size: 12px; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.peak-dates { display: flex; gap: 2px; height: 30px; font-size: 12px; color: var(--muted); }
.peak-dates span { position: relative; flex: 1; min-width: 0; }
.peak-dates em { position: absolute; top: 5px; left: 50%; transform: translateX(-50%); font-style: normal; white-space: nowrap; }
.peak-dates span:last-child em { left: auto; right: 0; transform: none; }

.player-search { position: relative; width: 260px; }
.player-search input { width: 100%; }
.suggest {
  position: absolute;
  z-index: 5;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 320px;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 4px;
  background: var(--card-2);
  border: 1px solid var(--line-hover);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}
.suggest li { margin: 0; padding: 6px 10px; border-radius: 6px; font-size: 14px; cursor: pointer; overflow-wrap: anywhere; }
.suggest li:hover, .suggest li.active { background: var(--line); }
.suggest li.none { color: var(--muted); cursor: default; background: none; }
.back-link { font-size: 14px; font-weight: 600; text-decoration: none; }

/* ------------------------------------------------------------- forms */

form.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
form.stack { display: grid; gap: 10px; margin-top: 12px; }
input, textarea {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  flex: 1;
  min-width: 0;
}
input:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: -1px; }
textarea { width: 100%; resize: vertical; }
#kontakt { scroll-margin-top: 84px; }
.trap { position: absolute; left: -9999px; }
label { font-size: 14px; color: var(--muted); display: grid; gap: 4px; }
.list { list-style: none; padding: 0; margin: 12px 0 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); margin: 0; }
.list li:last-child { border-bottom: 0; }
.msg { font-size: 14px; min-height: 1.4em; margin-top: 8px; }
.msg.err { color: var(--red); }
.msg.ok { color: var(--green); }
.ok-text { color: var(--green); font-weight: 600; }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
details summary { cursor: pointer; color: #7cb8ff; }

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

.legal ul { padding-left: 20px; margin: 0 0 12px; }
.legal li { margin-bottom: 8px; }
.legal .card { scroll-margin-top: 84px; }

footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; padding: 20px 16px; color: var(--muted); border-top: 1px solid var(--line); font-size: 14px; }
footer a { color: var(--muted); }


/* Too narrow for the logo above the figures: the image moves below it */
@media (max-width: 920px) {
  .hero { display: flex; flex-direction: column; align-items: center; min-height: 0; padding: 16px 0; }
  .logo { width: min(520px, 90%); }
  .countdown div { min-width: 60px; }
  .countdown b { font-size: 22px; }
  .hero-bg { position: static; order: 1; width: 100%; margin-top: 18px; transform: none; }
}

/* No room left to keep the bar centered with Streams and Impressum beside it: both wrap, centered */
@media (max-width: 960px) {
  .top { display: flex; flex-wrap: wrap; justify-content: center; }
}

@media (max-width: 520px) {
  h1 { font-size: 24px; }
  .card { padding: 18px; }
  .top { padding: 10px 8px; }
  .tabs a { padding: 6px 9px; font-size: 14px; }
  .tabs { gap: 2px; border-radius: 20px; }
  .filters, .filters input[type="search"], .player-search { width: 100%; }
}

@media (max-width: 700px) {
  .tiles.small.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 380px) {
  .tabs { gap: 0; }
  .tabs a { padding: 5px 7px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .stream:hover, .stream:hover .thumb { transform: none; }
}
