﻿@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600&family=Outfit:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #060d14;
  --bg-2: #0a141f;
  --card: #101e2b;
  --card-2: #17293a;
  --line: #2b4761;
  --line-soft: #375b7a;
  --text: #e9f4ff;
  --muted: #9cb9d4;
  --accent: #4db2ff;
  --accent-2: #4df0c6;
  --shadow: 0 18px 42px rgba(2, 8, 14, 0.45);
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  height: 100%;
}

body {
  min-height: 100vh;
  padding: 1rem;
  font-family: "Outfit", "Segoe UI", sans-serif;
  color: var(--text);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: hidden;
  background:
    radial-gradient(860px 360px at -5% -10%, rgba(77, 240, 198, 0.2), transparent 70%),
    radial-gradient(960px 420px at 110% 0%, rgba(77, 178, 255, 0.18), transparent 68%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

.topbar,
main,
footer {
  width: 100%;
  max-width: none;
  margin: 0;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
  padding: 0.62rem 0.1rem 0.95rem;
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  justify-self: center;
  gap: 0.58rem;
}

.brand {
  justify-self: start;
}

.brand h1 {
  margin: 0.12rem 0 0.2rem;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
}

.forum-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid #3b86bb;
  border-radius: 10px;
  background: linear-gradient(180deg, #1d7dbe 0%, #14679f 100%);
  color: #ecf8ff;
  padding: 0.44rem 0.9rem;
  font-weight: 600;
}

.connect-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid #2eae92;
  border-radius: 10px;
  background: linear-gradient(180deg, #1e9e83 0%, #147764 100%);
  color: #eafff8;
  padding: 0.44rem 0.9rem;
  font-weight: 600;
}

.topbar-spacer {
  justify-self: end;
  width: 110px;
}

.eyebrow {
  margin: 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.76rem;
  color: #80caef;
}

.dashboard-shell {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0.95rem;
}

.card {
  background: linear-gradient(165deg, rgba(16, 30, 43, 0.98) 0%, rgba(23, 41, 58, 0.95) 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.hero {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: 1fr auto;
  align-items: center;
  background:
    radial-gradient(780px 240px at 0% 0%, rgba(77, 178, 255, 0.2), transparent 68%),
    linear-gradient(156deg, #102030 0%, #1a3045 100%);
}

.hero h2 {
  margin: 0.18rem 0 0.25rem;
  font-size: clamp(1.15rem, 2.2vw, 1.62rem);
}

.muted {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 0.6rem;
}

.stat-box {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 0.6rem 0.72rem;
  background: rgba(9, 20, 31, 0.82);
}

.stat-box span {
  display: block;
  color: #95b8d7;
  font-size: 0.8rem;
}

.stat-box strong {
  display: block;
  margin-top: 0.18rem;
  font-size: 1.15rem;
}

.dashboard-grid {
  display: grid;
  gap: 0.95rem;
  min-height: 0;
  grid-template-columns: minmax(360px, 1.1fr) minmax(320px, 0.9fr) minmax(360px, 1fr);
  grid-template-rows: minmax(0, 1fr);
  grid-template-areas:
    "live top search";
}

.panel-live { grid-area: live; }
.panel-top { grid-area: top; }
.panel-search { grid-area: search; }

.panel-live {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0.7rem;
  min-width: 0;
  overflow: hidden;
}

.panel-live-top,
.panel-live-chart {
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-live-top .players-list {
  margin-top: 0.5rem;
  flex: 1;
  min-height: 0;
  max-height: none;
}

.panel-live-chart .line-chart-scroll {
  margin-top: 0.35rem;
  flex: 0 0 auto;
  min-height: 220px;
  height: clamp(220px, 28vh, 280px);
  max-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.panel-top {
  display: flex;
  flex-direction: column;
}

.panel-top .top-players-list {
  margin-top: 0.45rem;
  flex: 1;
  min-height: 0;
  max-height: none;
}

.panel-search {
  display: flex;
  flex-direction: column;
}

.panel-search .search-results {
  flex: 1;
  min-height: 0;
  height: auto;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.58rem;
}

.section-head h3 { margin: 0; }

.section-head-tight {
  margin-bottom: 0;
}

button,
input,
select { font: inherit; }

button {
  border: 1px solid #3b86bb;
  border-radius: 10px;
  background: linear-gradient(180deg, #1d7dbe 0%, #14679f 100%);
  color: #ecf8ff;
  padding: 0.44rem 0.74rem;
  cursor: pointer;
}

button:hover { filter: brightness(1.08); }
.forum-btn:hover,
.connect-btn:hover { filter: brightness(1.08); }

input,
select {
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(8, 17, 27, 0.86);
  padding: 0.5rem 0.6rem;
  color: var(--text);
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(77, 178, 255, 0.24);
}

.row {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  flex-wrap: wrap;
}

.players-list {
  list-style: none;
  margin: 0.5rem 0 0 0;
  padding: 0;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(7, 15, 24, 0.75);
}

.players-list li {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.45rem 0.62rem;
  border-bottom: 1px solid rgba(58, 90, 117, 0.72);
}

.players-list li:last-child { border-bottom: 0; }

.player-list-head {
  display: grid;
  grid-template-columns: 1.1fr 1fr auto;
  gap: 0.6rem;
  color: #95b8d7;
  font-size: 0.78rem;
  margin-top: 0.5rem;
  padding: 0 0.68rem;
}

.players-list li.player-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr auto;
  align-items: center;
  gap: 0.6rem;
}

.player-name {
  display: block;
  font-weight: 500;
}

.player-link {
  color: #d7ecff;
  text-decoration: none;
}

.player-link:hover {
  text-decoration: underline;
}

.player-meta {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  word-break: break-all;
}

.player-connected {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.top-list-head {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 0.6rem;
  color: #95b8d7;
  font-size: 0.78rem;
  margin-top: 0.42rem;
  padding: 0 0.62rem;
}

.top-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
}

.top-players-list .top-row {
  padding-top: 0.38rem;
  padding-bottom: 0.38rem;
}

.top-rank,
.top-hours {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.top-player-main {
  min-width: 0;
}

.top-player-main small {
  display: block;
  color: #8caec9;
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-results {
  margin-top: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  height: 240px;
  overflow-y: auto;
  padding: 0.34rem;
  background: rgba(8, 16, 25, 0.72);
}

.search-item {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(61, 92, 121, 0.75);
  border-radius: 9px;
  background: rgba(16, 34, 49, 0.88);
  color: var(--text);
  margin-bottom: 0.38rem;
  padding: 0.46rem 0.54rem;
  cursor: pointer;
}

.search-item:last-child { margin-bottom: 0; }

.search-item.selected {
  border-color: rgba(77, 240, 198, 0.95);
  background: rgba(33, 72, 74, 0.78);
}

.search-item small {
  display: block;
  color: var(--muted);
  margin-top: 0.1rem;
}

.search-empty {
  color: var(--muted);
  padding: 0.7rem;
  font-size: 0.87rem;
}

.playtime-card {
  margin-top: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(7, 15, 24, 0.82);
  padding: 0.62rem 0.72rem;
  min-height: 154px;
  max-height: 154px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0.5rem;
}

.playtime-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.playtime-title {
  margin: 0;
  font-size: 0.88rem;
  color: #d7ecff;
}

.playtime-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.playtime-stat {
  border: 1px solid rgba(61, 92, 121, 0.72);
  border-radius: 9px;
  padding: 0.34rem 0.44rem;
  background: rgba(15, 29, 42, 0.85);
  min-width: 0;
}

.playtime-stat span {
  display: block;
  color: #9cb9d4;
  font-size: 0.72rem;
}

.playtime-stat strong {
  display: block;
  margin-top: 0.1rem;
  color: #e9f4ff;
  font-size: 0.83rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playtime-period {
  margin: 0;
  color: #91b2ce;
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.line-chart-scroll {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(8, 16, 25, 0.76);
  overflow: hidden;
  overflow-x: hidden;
  padding: 0.55rem;
  min-width: 0;
}

.line-chart-canvas {
  display: block;
  width: 100%;
  min-width: 0;
  height: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.scroll-clean {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.scroll-clean::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

footer {
  margin-top: 0.55rem;
  padding: 0.35rem;
  color: #8eafcc;
  font-size: 0.84rem;
}

@media (max-width: 1400px) {
  .dashboard-grid {
    grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr);
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "live top"
      "search search";
  }
}

@media (max-width: 1024px) {
  body {
    overflow-y: auto;
    overflow-x: hidden;
    height: auto;
    min-height: 100%;
  }

  .dashboard-shell {
    flex: none;
    min-height: initial;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    grid-template-areas:
      "live"
      "top"
      "search";
  }

  .hero,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    grid-template-columns: repeat(3, minmax(100px, 1fr));
  }

  .player-list-head,
  .players-list li.player-row,
  .top-list-head,
  .top-row {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }

  .playtime-card {
    max-height: none;
    min-height: 0;
  }

  .playtime-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  body { padding: 0.72rem; }

  .topbar {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .forum-btn {
    justify-content: center;
    text-align: center;
  }

  .topbar-actions {
    width: 100%;
  }

  .forum-btn,
  .connect-btn {
    flex: 1;
  }

  .topbar-spacer {
    display: none;
  }
}
