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

* { box-sizing: border-box; }

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;
}

a { color: #7cb8ff; }
a:hover { color: #b9d9ff; }
code, kbd {
  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;
}
kbd { border-bottom-width: 2px; }

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

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  padding: 14px 16px;
  background: rgba(11, 13, 24, 0.82);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.tabs { display: flex; gap: 6px; 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;
}
.tabs a:hover { color: var(--text); }
.tabs a.active { color: #fff; background: var(--grad); }
.live-count { background: var(--red); color: #fff; font-size: 12px; border-radius: 999px; padding: 0 7px; line-height: 18px; }

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

main { width: 100%; max-width: 980px; margin: 0 auto; padding: 24px 16px 48px; flex: 1; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 12px; }
h1 { font-size: 30px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; color: #c9cdf0; }
.sub, .muted, .hint { color: var(--muted); }
.hint { font-size: 14px; margin: 12px 0 0; }

.hero { text-align: center; padding: 16px 0 28px; }
.logo { width: min(520px, 90%); height: auto; filter: drop-shadow(0 8px 30px rgba(30, 144, 255, 0.25)); }
.tagline { margin: 8px 0 14px; font-size: 18px; color: #c9cdf0; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 6px 16px;
  background: var(--card);
  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); }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 16px;
}
.grid .card { margin-bottom: 0; }
.grid { margin-bottom: 16px; }
.card p { margin: 0 0 12px; }
.card p:last-child { margin-bottom: 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;
}
button:hover, .btn:hover { filter: brightness(1.12); color: #fff; }
button.copied { background: var(--green); }
button.ghost { background: var(--card-2); border: 1px solid var(--line); }
button.danger { background: #3a1d27; color: var(--red); border: 1px solid #5a2735; }

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

.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px 28px; margin-top: 8px; }
ol { padding-left: 20px; margin: 0; }
li { margin-bottom: 6px; }

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

.streamers { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.streamer { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.streamer.live { grid-column: 1 / -1; border-color: #5b3a8f; }
.player { aspect-ratio: 16 / 9; width: 100%; background: #000; }
.player iframe { width: 100%; height: 100%; border: 0; display: block; }
.streamer .info { display: flex; gap: 12px; align-items: center; padding: 14px 16px; }
.avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--card-2); flex: none; object-fit: cover; }
.streamer .text { min-width: 0; flex: 1; }
.streamer .name { font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.streamer .title { color: #c9cdf0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.streamer .meta { color: var(--muted); font-size: 13px; }
.badge { font-size: 11px; font-weight: 800; letter-spacing: 0.05em; padding: 2px 8px; border-radius: 6px; text-transform: uppercase; }
.badge.live { background: var(--red); color: #fff; }
.badge.offline { background: var(--card-2); color: var(--muted); border: 1px solid var(--line); }
.streamer .channel { font-size: 14px; white-space: nowrap; }

/* ------------------------------------------------------------- admin */

.admin { max-width: 640px; }
form.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
form.stack { display: grid; gap: 10px; margin-top: 12px; }
input {
  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 { outline: 2px solid var(--blue); outline-offset: -1px; }
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 */

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

@media (max-width: 520px) {
  h1 { font-size: 24px; }
  .card { padding: 18px; }
  .tabs a { padding: 7px 14px; }
}
