:root {
  --bg: #0e0f14;
  --card: #171922;
  --card2: #1f2230;
  --txt: #e7e9ef;
  --muted: #8b90a3;
  --accent: #ff3d68;
  --accent2: #6c5ce7;
  --good: #2ecc71;
  --warn: #ffb020;
  --night: #4a3aff;
  --line: #272a38;
}
/* ——— Сброс стилей ——— */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
img, svg, canvas, video { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
:where(ul, ol) { list-style: none; padding: 0; margin: 0; }
table { border-collapse: collapse; }

body {
  font-family: "Roboto", system-ui, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  background: radial-gradient(1200px 600px at 80% -10%, #1b1530, var(--bg));
  color: var(--txt);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(14, 15, 20, 0.85);
  backdrop-filter: blur(8px);
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.header-right { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.header-right a.btn { text-decoration: none; }
.brand img { width: 52px; height: 52px; border-radius: 12px; background: var(--card2); object-fit: cover; }
h1 { font-size: 20px; margin: 0; }
h1 span { color: var(--accent); }
.sub { color: var(--muted); font-size: 13px; }
.status-pill {
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  background: var(--card2);
  border: 1px solid var(--line);
}
.status-pill.live { background: #3a0f1a; color: #ff5b7e; border-color: #ff3d68; animation: pulse 1.6s infinite; }
.status-pill.ingame { background: #142a18; color: #57d98a; border-color: #2ecc71; }
.status-pill.night { background: #161347; color: #9aa0ff; border-color: var(--night); }
.status-pill.offline { color: var(--muted); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }

main { max-width: 1100px; margin: 0 auto; padding: 24px 20px 60px; }
.quip-banner {
  background: linear-gradient(90deg, #2a1140, #3a1020);
  border: 1px solid #4a2040;
  border-radius: 14px;
  padding: 18px 22px;
  font-size: 18px;
  line-height: 1.45;
  margin-bottom: 22px;
}
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; margin-bottom: 18px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 18px;
}
.card h2 { margin: 0 0 14px; font-size: 15px; letter-spacing: 0.3px; }
.card h2 small { color: var(--muted); font-weight: 400; }

.gauge-card { text-align: center; }
.gauge { position: relative; max-width: 230px; margin: 0 auto; }
.gauge-val { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 18px; }
.gauge-val span { font-size: 44px; font-weight: 800; }
.gauge-val small { color: var(--muted); margin-left: 2px; align-self: flex-end; padding-bottom: 8px; }
.verdict { color: var(--muted); margin-top: 8px; font-size: 14px; }

.now-state { font-size: 17px; margin-bottom: 12px; font-weight: 600; }
.kv { list-style: none; padding: 0; margin: 0; }
.kv li { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.kv li span:first-child { color: var(--muted); }

.big-numbers { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.big-numbers.wide { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }

.halfyear-card { background: linear-gradient(135deg, #2a1140, #18121f); border-color: #3a2050; }
.halfyear-verdict {
  font-size: 16px;
  line-height: 1.5;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 14px;
  color: #f0e6ff;
}
.halfyear-card .big-numbers .n b { color: #d7b3ff; }

.records { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 14px; }
.rec { background: linear-gradient(90deg, #241046, #1a1226); border: 1px solid #34234d; border-radius: 10px; padding: 12px 14px; }
.rec .rl { color: var(--muted); font-size: 12px; }
.rec .rv { font-size: 20px; font-weight: 700; margin-top: 2px; }
.rec .rs { color: var(--muted); font-size: 12px; margin-top: 2px; }

.bedtime-pred {
  background: linear-gradient(90deg, #161347, #1a1226);
  border: 1px solid #2c2466;
  border-radius: 10px;
  padding: 12px 16px;
  margin: 14px 0;
  font-size: 15px;
}
.bedtime-pred b { color: #9aa0ff; }
.fake-sleeps { display: flex; flex-direction: column; gap: 7px; max-height: 300px; overflow: auto; }
.fake-sleep {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  background: var(--card2);
  border-left: 3px solid var(--warn);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
}
.fake-sleep .big { color: var(--warn); font-weight: 700; }
.fake-sleep .when { color: var(--muted); font-size: 12px; }

.promise-stat { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.promise-stat .big { font-size: 34px; font-weight: 800; color: var(--accent); }
.promise-stat .sub { color: var(--muted); font-size: 13px; }
.promises { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow: auto; }
.promise {
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--card2);
  border-left: 3px solid var(--line);
}
.promise.broken { border-left-color: var(--accent); }
.promise.kept { border-left-color: var(--good); }
.promise.pending { border-left-color: var(--warn); }
.promise.confessed { border-left-color: #9b59ff; }
.promise .ic { font-size: 18px; }
.promise .body { flex: 1; font-size: 13.5px; }
.promise .q { color: #d7dae6; }
.promise .d { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.promise .when { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* ——— Лог стримов ——— */
.streamlog { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow: auto; }
.streamlog li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; flex-wrap: wrap; }
.plat-badge { font-weight: 700; font-size: 11px; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.plat-badge.twitch { background: #3a1d6e; color: #c9b6ff; }
.plat-badge.vkplay { background: #123a5a; color: #8fd0ff; }
.streamlog .live-now { color: #ff5b7e; font-weight: 700; }
.streamlog .sl-time { color: var(--muted); }
.streamlog .sl-meta { margin-left: auto; color: var(--muted); font-size: 12px; }

/* ——— Ченджлог ——— */
.changelog { display: flex; flex-direction: column; gap: 22px; }
.rel { border-left: 3px solid var(--accent2); padding-left: 16px; }
.rel-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.rel-ver { background: var(--accent2); color: #fff; font-weight: 700; font-size: 13px; padding: 2px 10px; border-radius: 999px; }
.rel-title { font-weight: 700; font-size: 16px; }
.rel-date { color: var(--muted); font-size: 12px; margin-left: auto; }
.rel-items { list-style: none; margin: 0; padding: 0; }
.rel-items li { display: flex; gap: 10px; padding: 5px 0; font-size: 14px; color: #d7dae6; }
.rel-items .ri { min-width: 20px; }

/* ——— Ачивки ——— */
.achv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.achv {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.achv.locked { opacity: 0.4; filter: grayscale(1); }
.achv.unlocked { border-color: #6c5ce7; background: linear-gradient(90deg, #221545, #1a1226); }
.achv .ico { font-size: 30px; }
.achv .t { font-weight: 700; font-size: 14px; }
.achv .d { color: var(--muted); font-size: 12px; }

/* ——— Календарь ——— */
.cal-head { display: flex; align-items: center; justify-content: center; gap: 18px; margin-bottom: 12px; }
.cal-head h2 { margin: 0; min-width: 200px; text-align: center; }
.cal-legend { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; color: var(--muted); font-size: 12px; margin-bottom: 16px; }
.cal-legend .sw { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-wd { text-align: center; color: var(--muted); font-size: 12px; padding-bottom: 4px; }
.cal-cell {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card2);
  padding: 6px;
  display: flex;
  flex-direction: column;
  min-height: 56px;
}
.cal-cell.empty { background: transparent; border: none; }
.cal-cell.nodata { opacity: 0.4; }
.cal-cell.has { cursor: pointer; transition: transform 0.1s, border-color 0.1s; }
.cal-cell.has:hover { transform: translateY(-2px); border-color: var(--accent2); }
.cal-cell.sel { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(255, 61, 104, 0.4); }
.cal-d { font-size: 13px; color: var(--txt); font-weight: 600; }
.cal-dot { position: absolute; left: 6px; right: 6px; bottom: 22px; height: 6px; border-radius: 3px; }
.cal-meta { margin-top: auto; font-size: 11px; color: var(--muted); }

.sub2 { margin: 18px 0 8px; font-size: 14px; color: var(--muted); }
.gline { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
@media (max-width: 600px) { .cal-cell { min-height: 46px; padding: 4px; } .cal-meta { font-size: 9px; } }

.table-wrap { overflow-x: auto; }
table.gstats { width: 100%; border-collapse: collapse; font-size: 13px; }
table.gstats th, table.gstats td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.gstats th { color: var(--muted); font-weight: 600; position: sticky; top: 0; }
table.gstats td.g { font-weight: 600; color: var(--txt); white-space: normal; }
table.gstats tr:hover td { background: var(--card2); }
table.gstats .bar { height: 6px; border-radius: 3px; background: #6c5ce7; min-width: 4px; }
table.gstats .night { color: #9aa0ff; }
.big-numbers .n { background: var(--card2); border-radius: 10px; padding: 14px; text-align: center; }
.big-numbers .n b { display: block; font-size: 30px; }
.big-numbers .n small { color: var(--muted); font-size: 12px; }

.heatmap { display: grid; grid-template-columns: 40px repeat(24, 1fr); gap: 3px; font-size: 10px; }
.heatmap .lbl { color: var(--muted); display: flex; align-items: center; }
.heatmap .cell { aspect-ratio: 1; border-radius: 3px; background: var(--card2); }
.heatmap .hour-lbl { color: var(--muted); text-align: center; }
.heatmap .nightcol { outline: 1px solid rgba(74, 58, 255, 0.35); }

.streams { display: flex; flex-direction: column; gap: 10px; }
.stream {
  background: var(--card2);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  border-left: 3px solid var(--accent2);
}
.stream.night { border-left-color: var(--night); }
.stream .tag { display: inline-block; font-size: 11px; color: var(--warn); margin-top: 4px; }
.stream .when { color: var(--muted); font-size: 12px; }

.btn {
  background: var(--accent2);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
}
.btn:hover { filter: brightness(1.1); }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); font-weight: 400; }

.meme-live-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.meme-live-head h2 { margin: 0; }
.meme-live-head small { color: var(--muted); font-weight: 400; font-size: 12px; }
.meme-btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.meme-live-body { display: grid; grid-template-columns: 300px 1fr; gap: 16px; margin-top: 14px; align-items: start; }
.meme-card-wrap { border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #0c0d12; }
.meme-card-wrap img { display: block; width: 100%; height: auto; }
.meme-card-wrap img.flash { animation: cardFlash 0.5s ease; }
@keyframes cardFlash { 0% { opacity: 0.2; transform: scale(0.98); } 100% { opacity: 1; transform: none; } }
@media (max-width: 720px) { .meme-live-body { grid-template-columns: 1fr; } }
.meme-feed { display: flex; flex-direction: column; gap: 10px; max-height: 360px; overflow: auto; }
.meme-item {
  background: linear-gradient(90deg, #241046, #2c1020);
  border: 1px solid #3a2050;
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  animation: slideIn 0.35s ease;
}
.meme-item .meme-time { color: var(--muted); font-size: 11px; display: block; margin-bottom: 3px; }
.meme-item.fresh { box-shadow: 0 0 0 2px rgba(255, 61, 104, 0.4); }
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filters select {
  background: var(--card2);
  color: var(--txt);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
}
.filters .chk { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); }

.presence-wrap { max-width: 220px; height: 200px; margin: 0 auto; position: relative; }
.presence-wrap canvas { width: 100% !important; height: 100% !important; }
.presence-legend { display: flex; justify-content: center; gap: 16px; margin-top: 12px; font-size: 13px; flex-wrap: wrap; }
.presence-legend b { font-weight: 700; }
.presence-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }

.roast-card .roast {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 12.5px;
  line-height: 1.7;
  margin: 0;
  max-height: 340px;
  overflow: auto;
  color: #d7dae6;
}

.days { display: flex; flex-direction: column; gap: 10px; }
.day {
  background: var(--card2);
  border-radius: 10px;
  padding: 12px 14px;
}
.day-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.day-date { font-weight: 700; }
.day-strip { font-family: "Roboto Mono", ui-monospace, monospace; font-size: 13px; letter-spacing: 1px; margin: 8px 0; word-break: break-all; }
.day-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; margin: 6px 0; background: #0c0d12; }
.day-bar i { display: block; height: 100%; }
.day-bar .ig { background: #2ecc71; }
.day-bar .id { background: #ffb020; }
.day-bar .off { background: #3a3f52; }
.day-meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; }
.day-meta b { color: var(--txt); }
.day-roast { font-size: 13px; margin-top: 6px; color: #e7d3a8; }

.actlog { list-style: none; padding: 0; margin: 0; max-height: 380px; overflow: auto; font-size: 13px; }
.actlog li { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.actlog .when { color: var(--muted); min-width: 96px; }
.actlog .al-tag { font-size: 11px; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.actlog .al-tag.stream { background: #3a1d6e; color: #c9b6ff; }
.actlog .al-tag.self { background: var(--card); color: var(--muted); }
.actlog .al-tag.sleep { background: #161347; color: #9aa0ff; }
.actlog .ig { color: #57d98a; }
.actlog .id { color: #ffc452; }
.actlog .off { color: var(--muted); }

.timeline { list-style: none; padding: 0; margin: 0; max-height: 380px; overflow: auto; }
.timeline li { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.timeline .t { color: var(--muted); min-width: 48px; }
.timeline .ic { min-width: 22px; }

footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 20px 40px;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
@media (max-width: 600px) {
  .heatmap { font-size: 7px; grid-template-columns: 26px repeat(24, 1fr); }
  .quip-banner { font-size: 16px; }
}

/* Двойная жизнь / часовой пояс / долг сна */
.dl-row { display: flex; align-items: stretch; gap: 12px; flex-wrap: wrap; }
.dl-side { flex: 1 1 200px; background: var(--card2); border-radius: 12px; padding: 14px 16px; border: 1px solid #2a2e3e; }
.dl-side.pub { border-color: #2ecc71; }
.dl-side.sec { border-color: var(--accent2); }
.dl-tag { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.dl-game { font-size: 22px; font-weight: 800; margin: 4px 0; }
.dl-num { font-size: 13px; color: var(--muted); }
.dl-vs { align-self: center; font-weight: 800; color: var(--accent); font-size: 18px; }
.ludo-tz { margin-top: 12px; padding: 10px 14px; background: var(--card2); border-radius: 10px; font-size: 14px; }
.sleep-debt { margin-top: 8px; padding: 10px 14px; background: #2a0f16; border: 1px solid var(--accent); border-radius: 10px; font-size: 14px; }
.muted { color: var(--muted); }

/* ——— Мобильная адаптация ——— */
@media (max-width: 680px) {
  header { padding: 12px 16px; gap: 10px; }
  h1 { font-size: 18px; }
  .sub { font-size: 12px; }
  .brand { gap: 11px; }
  .brand img { width: 44px; height: 44px; }
  .header-right { gap: 8px; }
  .header-right .btn { padding: 7px 11px; font-size: 12px; }
  .status-pill { padding: 7px 13px; font-size: 13px; }
  main { padding: 16px 14px 48px; }
  .card { padding: 16px 14px; }
  .quip-banner { padding: 14px 16px; }
  .meme-btns .btn { padding: 7px 11px; font-size: 12px; }
  .big-numbers .n { padding: 12px; }
  .big-numbers .n b { font-size: 25px; }
  .promise-stat .big { font-size: 28px; }
  .dl-game { font-size: 19px; }
  .records { grid-template-columns: 1fr; }
  .cal-head { gap: 10px; }
  .cal-head h2 { min-width: auto; font-size: 16px; }
  footer { padding: 16px 14px 40px; }
}
@media (max-width: 400px) {
  h1 { font-size: 16px; }
  .header-right { width: 100%; }
  .card h2 { font-size: 14px; }
}

.trends-wrap { position: relative; height: 300px; }
.trends-wrap canvas { width: 100% !important; }

.week-compare { margin-top: 14px; padding: 12px 14px; background: var(--card2); border-radius: 10px; font-size: 13.5px; line-height: 1.6; }
