/* Panel DoggyGuard. Kolory i krój pisma wzięte z grafik, które bot rysuje na Discordzie (assets/fonts). */
@font-face { font-family: "DG Sans"; src: url("/fonts/DejaVuSans.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "DG Sans"; src: url("/fonts/DejaVuSans-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --ink: #141021;        /* tło strony */
  --panel: #1d1830;      /* pasek boczny, okna */
  --raised: #282141;     /* pola formularzy */
  --line: #3a3159;
  --text: #f1eef9;
  --muted: #a9a1c2;
  --amber: #f5b544;      /* jedyny kolor akcji: obroża psa stróża */
  --amber-ink: #23180a;
  --good: #63d391;
  --bad: #ff7a85;
  --twitch: #9146ff;
  --tiktok: #fe2c55;
  --kick: #53fc18;
  --radius: 10px;
  --step--1: 0.82rem;
  --step-0: 0.95rem;
  --step-1: 1.15rem;
  --step-2: 1.6rem;
  --step-3: clamp(2rem, 4.6vw, 3.3rem);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--ink); }
body {
  margin: 0; background: var(--ink); color: var(--text);
  font: 400 var(--step-0)/1.55 "DG Sans", "DejaVu Sans", Verdana, system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}
h1, h2, p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
h1 { font-size: var(--step-2); line-height: 1.2; letter-spacing: -0.01em; }
h2 { font-size: var(--step-1); line-height: 1.3; }
a { color: var(--amber); text-underline-offset: 3px; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 4px; }
.boot, .loading { color: var(--muted); padding: 3rem 1rem; text-align: center; }
.muted { color: var(--muted); }
.spacer { flex: 1; }
.center { text-align: center; }

/* ---------- przyciski i pola ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  font: inherit; font-weight: 700; color: var(--text); text-decoration: none; cursor: pointer;
  background: var(--raised); border: 1px solid var(--line); border-radius: 8px; padding: 0.5rem 0.95rem; min-height: 2.5rem;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); }
.btn.primary:hover { background: #ffc862; border-color: #ffc862; }
.btn.quiet { background: transparent; border-color: transparent; }
.btn.quiet:hover { background: var(--raised); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #2a0a0e; }
.btn.danger-text { color: var(--bad); }
.btn.small { padding: 0.3rem 0.7rem; min-height: 2rem; font-size: var(--step--1); }
.btn.big { padding: 0.8rem 1.4rem; font-size: var(--step-1); }
.btn:disabled { opacity: 0.45; cursor: default; }

input, select {
  font: inherit; color: var(--text); background: var(--raised); border: 1px solid var(--line);
  border-radius: 8px; padding: 0.5rem 0.65rem; min-height: 2.5rem; width: 100%; min-width: 0;
}
input[type="checkbox"] { width: 1.15rem; height: 1.15rem; min-height: 0; padding: 0; accent-color: var(--amber); flex: none; }
input:hover, select:hover { border-color: var(--muted); }
input::placeholder { color: #7f779b; }
.field { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.field .label { font-size: var(--step--1); color: var(--muted); }
.hint { font-size: var(--step--1); color: var(--muted); }
.hint.warn, .problem { color: var(--amber); }
.hint.warn:empty { display: none; }
.picker { display: flex; flex-direction: column; gap: 0.3rem; }
.joined { display: flex; gap: 0.4rem; }
.joined select { width: auto; flex: none; }
.checkline { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.9rem; cursor: pointer; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem 1.25rem; }
.inline { display: flex; align-items: flex-end; gap: 0.75rem; flex-wrap: wrap; }
.inline .field { flex: 1 1 16rem; }
.actions { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-top: 1.1rem; }
.actions.sticky { position: sticky; bottom: 0; background: var(--ink); padding: 0.9rem 0; border-top: 1px solid var(--line); margin-top: 0; }

.notice { border-left: 3px solid var(--muted); background: var(--panel); padding: 0.7rem 0.9rem; border-radius: 0 8px 8px 0; margin: 1rem 0; }
.notice.bad { border-left-color: var(--bad); }
.notice.good { border-left-color: var(--good); }

/* ---------- rama ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 0.7rem clamp(1rem, 3vw, 2rem); border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 700; font-size: var(--step-1); color: var(--text); text-decoration: none; }
.top-right { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; }
.who { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--muted); }
.who img { border-radius: 50%; }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.lang button { font: inherit; font-size: var(--step--1); color: var(--muted); background: transparent; border: 0; padding: 0.35rem 0.7rem; cursor: pointer; }
.lang button.on { background: var(--raised); color: var(--text); font-weight: 700; }

.shell .body { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); min-height: calc(100vh - 3.6rem); }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 1.1rem 0.8rem; display: flex; flex-direction: column; gap: 0.9rem; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 0.65rem; padding: 0.5rem 0.65rem; border-radius: 8px; color: var(--text); text-decoration: none; }
.nav-item:hover { background: var(--raised); }
.nav-item.on { background: var(--raised); font-weight: 700; box-shadow: inset 3px 0 0 var(--amber); }
.nav-item.off { color: var(--muted); }
.side > .nav-item.bot { margin-top: auto; }
/* kropka = kolor platformy; to jedyne miejsce, gdzie kolory platform coś znaczą */
.dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--muted); flex: none; }
.twitch .dot { background: var(--twitch); }
.tiktok .dot { background: var(--tiktok); }
.kick .dot { background: var(--kick); }
.games .dot, .schedule .dot, .summary .dot, .overview .dot, .bot .dot { background: transparent; border: 2px solid var(--muted); }
.main { padding: clamp(1.2rem, 3vw, 2.4rem); max-width: 68rem; width: 100%; }
.lead { color: var(--muted); max-width: 44rem; margin-top: 0.4rem; }
.block { margin-top: 2rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.block > h2 { margin-bottom: 0.8rem; }
.block > h2 + .hint { display: block; margin: -0.5rem 0 0.9rem; }
.empty { padding: 3rem 0; display: grid; gap: 1rem; justify-items: start; }
.foot { display: flex; gap: 1.2rem; flex-wrap: wrap; color: var(--muted); font-size: var(--step--1); margin-top: 3.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.foot a { color: var(--muted); }

/* ---------- lista serwerów ---------- */
.servers { margin-top: 1.2rem; border-top: 1px solid var(--line); }
.servers a { display: flex; align-items: center; gap: 0.9rem; padding: 0.7rem 0.3rem; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.servers a:hover { background: var(--panel); }
.gicon { width: 44px; height: 44px; border-radius: 14px; flex: none; background: var(--raised); }
.gicon.letter { display: grid; place-items: center; font-weight: 700; color: var(--muted); }
.gname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.main h2 { margin-top: 0; }
.servers + h2, .notice + h2 { margin-top: 2.2rem; }
.fine { font-size: var(--step--1); color: var(--muted); margin-top: 1.2rem; }

/* ---------- wiersze (obserwowane kanały, reguły) ---------- */
.row { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 0.9rem 1.25rem; padding: 1rem 0; border-bottom: 1px solid var(--line); align-items: start; }
.row:last-child { border-bottom: 0; }
.row.new { background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); padding: 1rem; margin-top: 0.6rem; }
.row-name { font-weight: 700; font-size: var(--step-1); color: var(--text); overflow-wrap: anywhere; padding-top: 1.45rem; }
a.row-name { text-decoration-color: var(--line); }
.row-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr)); gap: 0.8rem 1rem; }
.row-fields.wide { grid-template-columns: minmax(0, 2fr) minmax(11.5rem, 1fr); }
.row .actions { grid-column: 2; margin-top: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.chip { display: inline-flex; align-items: center; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { border: 1px solid var(--line); border-radius: 999px; padding: 0.25rem 0.75rem; font-size: var(--step--1); color: var(--muted); }
.chip input:checked + span { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); font-weight: 700; }
.chip input:disabled + span { opacity: 0.6; }
.chip input:focus-visible + span { outline: 2px solid var(--amber); outline-offset: 2px; }

/* ---------- przegląd ---------- */
.status li { display: grid; grid-template-columns: auto 10rem minmax(0, 1fr); gap: 0.7rem; align-items: baseline; padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.status li:last-child { border-bottom: 0; }
.status .dot { align-self: center; }
.status a { color: var(--text); font-weight: 700; }
.checklist li { display: flex; flex-wrap: wrap; gap: 0.3rem 0.8rem; padding: 0.45rem 0 0.45rem 1.4rem; position: relative; border-bottom: 1px solid var(--line); }
.checklist li::before { content: ""; position: absolute; left: 0.2rem; top: 0.95rem; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--good); }
.checklist li.bad::before { background: var(--bad); }
.checklist .problem { flex-basis: 100%; }

/* ---------- plan tygodnia: tablica w układzie grafiki, którą bot wysyła ---------- */
.week-bar { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.week + .hint { display: block; margin-top: 0.7rem; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.5rem; }
.day { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.55rem; display: flex; flex-direction: column; gap: 0.4rem; min-height: 11rem; }
.day.today { border-color: var(--amber); }
.day.past { opacity: 0.55; }
.day-head { display: flex; flex-direction: column; line-height: 1.25; padding-bottom: 0.4rem; border-bottom: 1px solid var(--line); }
.day-head strong { font-size: var(--step--1); overflow: hidden; text-overflow: ellipsis; }
.day-head span { font-size: var(--step--1); color: var(--muted); }
.day.today .day-head span { color: var(--amber); }
.slot { font: inherit; text-align: left; color: var(--text); background: var(--raised); border: 1px solid var(--line); border-left: 3px solid var(--twitch); border-radius: 6px; padding: 0.4rem 0.45rem; cursor: pointer; display: flex; flex-direction: column; gap: 0.1rem; }
.slot:hover { border-color: var(--muted); border-left-color: var(--twitch); }
.slot .time { font-weight: 700; font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot .what { font-size: var(--step--1); color: var(--muted); overflow-wrap: anywhere; }
.slot.add { border: 1px dashed var(--line); background: transparent; color: var(--muted); align-items: center; margin-top: auto; font-size: var(--step-1); line-height: 1; }
.slot.add:hover { color: var(--amber); border-color: var(--amber); }
.render { display: block; width: 100%; max-width: 46rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); min-height: 6rem; }

/* ---------- okna ---------- */
.dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 14px; padding: 1.4rem; width: min(30rem, calc(100vw - 2rem)); }
.dialog::backdrop { background: rgba(8, 5, 18, 0.72); }
.dialog form, .dialog { display: grid; gap: 0.9rem; }
.dialog:not([open]) { display: none; }
#toasts { position: fixed; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: 0.5rem; z-index: 50; max-width: min(26rem, calc(100vw - 2rem)); }
.toast { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--good); border-radius: 8px; padding: 0.7rem 0.9rem; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45); }
.toast.bad { border-left-color: var(--bad); }

.facts { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 0.45rem 1rem; }
.facts dt { color: var(--muted); }
.key { display: inline-block; margin-right: 0.9rem; }
.key.good { color: var(--good); }
.key.bad { color: var(--muted); }

/* ---------- strona główna ---------- */
.landing { max-width: 76rem; margin: 0 auto; padding-bottom: 2rem; }
.landing .top { border-bottom: 0; }
.hero { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: center; padding: clamp(1.5rem, 5vw, 4.5rem) clamp(1rem, 3vw, 2rem); }
.hero h1 { font-size: var(--step-3); line-height: 1.08; letter-spacing: -0.02em; text-wrap: balance; }
.hero .lead { font-size: var(--step-1); margin-top: 1.2rem; }
.cta { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 1.8rem; }
/* prawdziwe grafiki bota ułożone jak wiadomości na kanale */
.showcase { position: relative; aspect-ratio: 1 / 0.8; }
.shot { position: absolute; border-radius: 12px; border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55); }
.shot.a { width: 78%; left: 0; top: 0; transform: rotate(-2deg); }
.shot.b { width: 70%; right: 0; top: 37%; transform: rotate(1.5deg); }
.shot.c { width: 50%; left: 4%; bottom: 0; transform: rotate(-1deg); }
.about { padding: 1rem clamp(1rem, 3vw, 2rem) 2rem; }
.about h2 { font-size: var(--step-2); margin-bottom: 1.2rem; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 0 2.5rem; }
.features li { padding: 1rem 0; border-top: 1px solid var(--line); display: grid; gap: 0.3rem; align-content: start; }
.features span { color: var(--muted); }
.landing .foot { margin-left: clamp(1rem, 3vw, 2rem); margin-right: clamp(1rem, 3vw, 2rem); }
.prose { max-width: 44rem; padding: 2rem clamp(1rem, 3vw, 2rem); display: grid; gap: 0.8rem; }
.prose h2 { margin-top: 1rem; }
.prose p { color: var(--muted); }

/* ---------- telefon ---------- */
@media (max-width: 56rem) {
  .shell .body { grid-template-columns: minmax(0, 1fr); }
  .side { border-right: 0; border-bottom: 1px solid var(--line); padding: 0.7rem; }
  .side nav { flex-direction: row; overflow-x: auto; gap: 0.3rem; padding-bottom: 0.2rem; }
  .nav-item { white-space: nowrap; }
  .nav-item.on { box-shadow: inset 0 -3px 0 var(--amber); }
  .side > .nav-item.bot { margin-top: 0; }
  .row { grid-template-columns: minmax(0, 1fr); }
  .row-name { padding-top: 0; }
  .row .actions { grid-column: 1; }
  .row-fields.wide { grid-template-columns: minmax(0, 1fr); }
  .week { grid-template-columns: minmax(0, 1fr); }
  .day { min-height: 0; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .day-head { flex-direction: row; gap: 0.5rem; border-bottom: 0; padding-bottom: 0; flex-basis: 100%; }
  .slot.add { margin-top: 0; padding: 0.4rem 0.9rem; }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .status li { grid-template-columns: auto minmax(0, 1fr); }
  .status li span:last-child { grid-column: 2; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .who { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: rise 0.18s ease-out; }
  @keyframes rise { from { transform: translateY(8px); opacity: 0; } }
}
