:root {
  color-scheme: dark;
  --bg: #050809;
  --surface: #0b1115;
  --panel: #111a1f;
  --ink: #f7fbff;
  --muted: #9cadb7;
  --line: #1f3037;
  --accent: #00a88f;
  --accent-strong: #027a6c;
  --gold: #f2b84b;
  --blue: #19a7ff;
  --gain: #47d763;
  --loss: #df5562;
  --warn: #f2b84b;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.38);
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(25, 167, 255, 0.14), transparent 28%),
    linear-gradient(315deg, rgba(242, 184, 75, 0.12), transparent 32%),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 18px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, #070b0e 0%, #111a1f 48%, #050809 100%);
  color: #f8fbf8;
  box-shadow: 14px 0 40px rgba(17, 24, 22, 0.12);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
}

.brand-logo {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border: 1px solid rgba(242, 184, 75, 0.42);
  border-radius: 8px;
  background: #050809;
  box-shadow: 0 12px 26px rgba(242, 184, 75, 0.18);
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
  letter-spacing: 0;
}

.brand p {
  margin: 4px 0 0;
  color: #b7c5bc;
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 10px;
}

.nav button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #d7e1db;
  padding: 0 14px;
  text-align: left;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.nav button.active,
.nav button:hover {
  border-color: rgba(242, 184, 75, 0.35);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  transform: translateX(2px);
}

.sidebar-footer {
  margin-top: auto;
  color: #b7c5bc;
  font-size: 12px;
  line-height: 1.45;
}

.content {
  min-width: 0;
  padding: 32px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(11, 17, 21, 0.86);
  box-shadow: var(--shadow-soft);
  padding: 18px;
  backdrop-filter: blur(12px);
}

.topbar h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: 0;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
  justify-content: flex-end;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid rgba(245, 191, 53, 0.42);
  border-radius: 999px;
  background: rgba(245, 191, 53, 0.12);
  color: #f5bf35;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(0, 168, 143, 0.22);
  font-weight: 800;
  overflow: hidden;
}

img.avatar {
  display: block;
  object-fit: cover;
}

.avatar.small {
  width: 36px;
  height: 36px;
  font-size: 13px;
}

.button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 14px;
  box-shadow: 0 1px 0 rgba(17, 24, 22, 0.04);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.button:hover {
  border-color: rgba(0, 168, 143, 0.45);
  transform: translateY(-1px);
}

.button.primary {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(0, 168, 143, 0.22);
}

.button.primary:hover {
  background: var(--accent-strong);
}

.button.ghost {
  background: transparent;
}

.grid {
  display: grid;
  gap: 16px;
}

.metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric,
.panel,
.login-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.metric {
  position: relative;
  min-height: 124px;
  overflow: hidden;
  padding: 20px;
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--accent);
}

.metric:nth-child(2)::before {
  background: var(--gold);
}

.metric:nth-child(3)::before {
  background: var(--blue);
}

.metric:nth-child(4)::before {
  background: #e85d45;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: 32px;
  line-height: 1;
}

.metric small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
}

.panel {
  padding: 20px;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.panel:hover,
.metric:hover {
  box-shadow: var(--shadow);
}

.panel h3 {
  margin: 0 0 14px;
  font-size: 18px;
  letter-spacing: 0;
}

.dash-console {
  display: grid;
  gap: 18px;
  border: 1px solid rgba(34, 49, 44, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(140deg, rgba(20, 48, 61, 0.96), rgba(5, 8, 8, 0.98) 48%),
    #080c0c;
  color: #f7fbff;
  padding: 18px;
  box-shadow: var(--shadow);
}

.dash-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 4px 10px;
}

.dash-eyebrow {
  margin: 0 0 8px;
  color: #7fc7d4;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.dash-hero h3 {
  margin: 0;
  font-size: 26px;
  letter-spacing: 0;
}

.dash-hero span {
  display: block;
  margin-top: 8px;
  color: #aab8c4;
}

.range-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.range-controls button {
  min-height: 38px;
  border: 1px solid #1f3037;
  border-radius: 8px;
  background: #111a1f;
  color: #9cadb7;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.range-controls button.active,
.range-controls button:hover {
  border-color: #19a7ff;
  background: #142536;
  color: #ffffff;
}

.dash-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.dash-tile,
.dash-panel {
  border: 1px solid #1f3037;
  border-radius: 8px;
  background: #0b1115;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.dash-tile {
  min-height: 120px;
  padding: 18px;
}

.dash-tile span,
.dash-panel h3 {
  color: #9cadb7;
  font-size: 13px;
}

.dash-tile > strong {
  display: block;
  margin-top: 10px;
  color: #ffffff;
  font-size: 28px;
  line-height: 1;
}

.dash-tile small {
  display: block;
  margin-top: 10px;
  color: #8fa1ad;
}

.winrate-tile,
.donut-tile,
.avg-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.winrate-chart {
  position: relative;
  display: grid;
  width: min(220px, 100%);
  gap: 10px;
}

.winrate-segments {
  display: grid;
  grid-template-columns: repeat(20, 1fr);
  gap: 3px;
}

.winrate-segments span {
  display: block;
  height: 42px;
  border-radius: 4px;
  background: #26323a;
}

.winrate-segments span.active {
  background: linear-gradient(180deg, #47d763, #1fae50);
  box-shadow: 0 0 14px rgba(71, 215, 99, 0.18);
}

.winrate-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #26323a;
}

.winrate-track span {
  display: block;
  width: calc(var(--pct) * 1%);
  height: 100%;
  border-radius: inherit;
  background: #19a7ff;
}

.winrate-labels {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #8fa1ad;
  font-size: 12px;
}

.winrate-labels b {
  color: #47d763;
}

.winrate-labels em {
  color: #df5562;
  font-style: normal;
}

.avg-tile div {
  display: grid;
  gap: 8px;
  text-align: right;
}

.donut {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: conic-gradient(#47d763 calc(var(--pct) * 1%), #df5562 0);
}

.donut::after {
  position: absolute;
  inset: 14px;
  content: "";
  border-radius: 50%;
  background: #0b1115;
}

.donut span,
.donut em {
  position: absolute;
  z-index: 1;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.donut span {
  left: -26px;
  top: 0;
}

.donut em {
  right: -34px;
  bottom: 0;
}

.dash-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.dash-panel {
  padding: 18px;
}

.dash-panel h3 {
  margin: 0 0 14px;
}

.line-chart-wrap {
  position: relative;
  min-height: 250px;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  background:
    linear-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1px) 0 0 / 100% 25%,
    rgba(255, 255, 255, 0.01);
  margin-top: 8px;
  padding: 18px;
}

.line-chart-svg {
  position: absolute;
  inset: 18px 18px 24px 32px;
  width: calc(100% - 50px);
  height: calc(100% - 48px);
  overflow: visible;
}

.line-chart-svg polyline {
  fill: none;
  stroke: #19a7ff;
  stroke-width: 1.6;
  vector-effect: non-scaling-stroke;
}

.chart-point {
  position: absolute;
  width: 26px;
  height: 26px;
  border: 0;
  background: transparent;
  transform: translate(-50%, 50%);
  padding: 0;
}

.chart-point span {
  display: block;
  width: 12px;
  height: 12px;
  margin: 7px;
  border: 2px solid #071014;
  border-radius: 50%;
  background: #19a7ff;
  box-shadow: 0 0 0 4px rgba(25, 167, 255, 0.18);
}

.chart-point.loss-point span {
  background: #df5562;
  box-shadow: 0 0 0 4px rgba(223, 85, 98, 0.18);
}

.chart-axis {
  position: absolute;
  left: 8px;
  color: #8fa1ad;
  font-size: 11px;
}

.chart-axis.top {
  top: 6px;
}

.chart-axis.bottom {
  bottom: 6px;
}

.x-axis-label,
.y-axis-label {
  position: absolute;
  color: #8fa1ad;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.x-axis-label {
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
}

.y-axis-label {
  top: 50%;
  left: -16px;
  transform: translateY(-50%) rotate(-90deg);
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  min-height: 240px;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  padding: 18px 12px 24px;
}

.bar {
  position: relative;
  flex: 1;
  min-width: 18px;
  border-radius: 6px 6px 0 0;
}

.chart-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 5;
  min-width: 112px;
  transform: translateX(-50%);
  border: 1px solid #2d4653;
  border-radius: 8px;
  background: #f7fbff;
  color: #081014;
  opacity: 0;
  padding: 8px 10px;
  pointer-events: none;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.bar:hover .chart-tooltip,
.chart-point:hover .chart-tooltip,
.chart-point:focus .chart-tooltip,
.winrate-chart:hover .chart-tooltip {
  opacity: 1;
  transform: translate(-50%, -2px);
}

.gain-bar {
  background: #47d763;
}

.loss-bar {
  background: #df5562;
}

.bar span {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  color: #8fa1ad;
  font-size: 11px;
}

.dash-calendar-wrap {
  display: grid;
  gap: 12px;
}

.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  text-align: center;
}

.calendar-head h3,
.calendar-head strong {
  margin: 0;
  color: #ffffff;
}

.calendar-nav {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid #1f3037;
  border-radius: 8px;
  background: #111a1f;
  color: #ffffff;
  font-size: 20px;
}

.calendar-nav:hover {
  border-color: #19a7ff;
  background: #142536;
}

.calendar-weekdays,
.profit-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays span {
  color: #9cadb7;
  padding: 12px 6px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.profit-calendar {
  border-top: 1px solid #2a3439;
  border-left: 1px solid #2a3439;
}

.calendar-cell {
  display: grid;
  align-content: start;
  min-height: 104px;
  border: 0;
  border-right: 1px solid #2a3439;
  border-bottom: 1px solid #2a3439;
  background: #0a1014;
  color: #dce8f0;
  padding: 10px;
  text-align: left;
}

.calendar-cell:hover,
.calendar-cell.selected {
  outline: 2px solid #19a7ff;
  outline-offset: -2px;
}

.calendar-cell.muted {
  opacity: 0.35;
}

.calendar-cell strong {
  margin-top: 16px;
  font-size: 17px;
}

.calendar-day-meta {
  display: grid;
  gap: 3px;
  margin-top: 5px;
}

.calendar-day-meta small {
  color: #9cadb7;
  font-size: 12px;
  line-height: 1.25;
}

.calendar-day-meta .calendar-win-rate {
  color: #dce8f0;
  font-weight: 800;
}

.calendar-cell.positive-day {
  background: rgba(12, 88, 54, 0.35);
}

.calendar-cell.negative-day {
  background: rgba(104, 9, 18, 0.48);
}

.selected-day-panel {
  background: #0b1115;
  color: #f7fbff;
}

.two-col {
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 820px;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 14px 12px;
  text-align: left;
  vertical-align: middle;
}

th {
  background: #111a1f;
  color: #9cadb7;
  font-size: 12px;
  text-transform: uppercase;
}

tbody tr {
  transition: background 0.14s ease;
}

tbody tr:hover {
  background: #111a1f;
}

tr:last-child td {
  border-bottom: 0;
}

.rank {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: #111816;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(17, 24, 22, 0.12);
  font-weight: 800;
}

.positive {
  color: var(--gain);
  font-weight: 800;
}

.negative {
  color: var(--loss);
  font-weight: 800;
}

.tournament-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.38fr);
  gap: 18px;
  margin-bottom: 16px;
  padding: 24px;
  border: 1px solid #1f3037;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(25, 167, 255, 0.18), rgba(245, 191, 53, 0.12)),
    #0b1115;
  color: #f7fbff;
  box-shadow: var(--shadow);
}

.tournament-hero h3 {
  margin: 0 0 10px;
  color: #ffffff;
  font-size: clamp(26px, 4vw, 44px);
  letter-spacing: 0;
}

.tournament-hero p {
  max-width: 760px;
  margin: 0;
  color: #aab8c4;
  line-height: 1.65;
}

.tournament-prize {
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px;
  border: 1px solid rgba(245, 191, 53, 0.24);
  border-radius: 8px;
  background: rgba(5, 8, 12, 0.58);
}

.tournament-prize span,
.tournament-card span,
.tournament-rules span {
  color: #f5bf35;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.tournament-prize strong {
  color: #ffffff;
  font-size: 22px;
}

.tournament-prize small {
  color: #9cadb7;
  line-height: 1.5;
}

.tournament-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.tournament-card {
  min-height: 150px;
  padding: 18px;
  border: 1px solid #1f3037;
  border-radius: 8px;
  background: #0b1115;
}

.tournament-card strong {
  display: block;
  margin: 12px 0 10px;
  color: #ffffff;
  font-size: 24px;
}

.tournament-card p {
  margin: 0;
  color: #9cadb7;
  line-height: 1.55;
}

.tournament-panel {
  margin-bottom: 16px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-head h3 {
  margin-bottom: 6px;
}

.profile-link,
.feed-profile-link {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
}

.profile-link {
  display: grid;
  gap: 3px;
}

.profile-link strong,
.feed-profile-link strong {
  color: var(--ink);
}

.profile-link span,
.feed-profile-link span {
  color: var(--muted);
  font-size: 13px;
}

.profile-link:hover strong,
.feed-profile-link:hover strong {
  color: #19a7ff;
}

.rule-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.rule-grid div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.rule-grid strong {
  display: block;
  margin: 14px 0 8px;
  color: #ffffff;
}

.rule-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  background: #111a1f;
  color: var(--ink);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
}

.tag.good {
  background: rgba(71, 215, 99, 0.14);
  color: var(--gain);
}

.tag.warn {
  background: rgba(242, 184, 75, 0.14);
  color: var(--warn);
}

.thumb-button {
  display: grid;
  width: 74px;
  height: 48px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #080d10;
  padding: 0;
}

.thumb-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.18s ease;
}

.thumb-button:hover img {
  transform: scale(1.06);
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(9, 14, 13, 0.72);
  padding: 24px;
}

.image-modal-card {
  width: min(1120px, 100%);
  max-height: 92vh;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
}

.image-modal-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 17, 21, 0.94);
  padding: 14px;
  backdrop-filter: blur(10px);
}

.image-modal-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.image-modal-card img {
  display: block;
  width: 100%;
  height: auto;
  background: #101514;
}

.image-modal-card p {
  margin: 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
  line-height: 1.55;
  padding: 16px;
}

.feed-grid {
  display: grid;
  grid-template-columns: minmax(0, min(920px, 100%));
  justify-content: center;
  gap: 28px;
  scroll-snap-type: y proximity;
}

.feed-card {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 150px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  scroll-snap-align: start;
}

.feed-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
}

.feed-profile-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.feed-card-head strong,
.feed-card-head span {
  display: block;
}

.feed-card-head span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.feed-image {
  display: block;
  width: 100%;
  flex: 1;
  min-height: 54vh;
  overflow: hidden;
  border: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #101514;
  padding: 0;
}

.feed-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.feed-image:hover img {
  transform: scale(1.025);
}

.feed-card-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.feed-card-body p {
  margin: 0;
  color: var(--ink);
  line-height: 1.5;
}

.feed-stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.feed-stats span,
.feed-stats strong {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: #111a1f;
  padding: 0 10px;
  font-size: 12px;
}

.comments {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.comments h4 {
  margin: 0;
  font-size: 13px;
  text-transform: uppercase;
  color: var(--muted);
}

.comment {
  display: grid;
  gap: 2px;
  border-radius: 8px;
  background: #111a1f;
  padding: 10px;
}

.comment-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.comment strong {
  font-size: 13px;
}

.comment span {
  color: var(--muted);
  font-size: 12px;
}

.comment p {
  margin: 4px 0 0;
}

.comment-empty {
  color: var(--muted);
  font-size: 13px;
}

.comment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.profile-hero {
  display: grid;
  gap: 18px;
  margin-bottom: 16px;
  border: 1px solid #1f3037;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(25, 167, 255, 0.16), rgba(245, 191, 53, 0.1)),
    #0b1115;
  box-shadow: var(--shadow);
  padding: 22px;
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  font-size: 22px;
}

.profile-identity h3 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(28px, 4vw, 44px);
}

.profile-identity p {
  margin: 4px 0 0;
  color: var(--muted);
}

.profile-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.profile-metrics div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.profile-metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-metrics strong {
  display: block;
  margin-top: 7px;
  color: #ffffff;
  font-size: 24px;
}

.profile-posts-panel {
  margin-bottom: 16px;
}

.profile-post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.profile-post-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1115;
}

.profile-post-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #101514;
  padding: 0;
}

.profile-post-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.profile-post-body {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.profile-post-body p {
  margin: 0;
  color: var(--ink);
  line-height: 1.5;
}

.review-modal-card {
  width: min(760px, 100%);
  max-height: 92vh;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
}

.review-lock-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}

.review-lock-grid div {
  background: #111a1f;
  padding: 12px;
}

.review-lock-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.review-lock-grid strong {
  display: block;
  margin-top: 5px;
}

.review-form-body {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.review-preview {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101514;
}

.signup-form {
  margin-top: 28px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

.profile-picture-control {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1115;
  padding: 14px;
}

label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #080d10;
  color: var(--ink);
  padding: 9px 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(0, 168, 143, 0.65);
  box-shadow: 0 0 0 4px rgba(0, 168, 143, 0.12);
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.login-copy {
  padding: 34px;
  background:
    linear-gradient(150deg, rgba(0, 168, 143, 0.24), transparent 42%),
    linear-gradient(330deg, rgba(242, 184, 75, 0.28), transparent 38%),
    #050809;
  color: #ffffff;
}

.login-copy h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.05;
}

.login-copy p {
  color: #cbd8d0;
  line-height: 1.55;
}

.login-form {
  padding: 34px;
}

.login-form h2 {
  margin: 0 0 8px;
  font-size: 24px;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.notice {
  border: 1px solid rgba(242, 184, 75, 0.5);
  border-radius: 8px;
  background: rgba(242, 184, 75, 0.1);
  color: #f7e5b2;
  padding: 12px;
  font-size: 13px;
  line-height: 1.45;
}

.leaderboard-admin-note,
.discord-status {
  margin-top: 8px;
}

.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: end center;
  background: rgba(4, 7, 10, 0.54);
  padding: 24px;
}

.onboarding-card {
  width: min(520px, 100%);
  border: 1px solid rgba(25, 167, 255, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(25, 167, 255, 0.16), rgba(245, 191, 53, 0.1)),
    #0b1115;
  color: #f7fbff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  padding: 22px;
}

.onboarding-card > span {
  color: #f5bf35;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.onboarding-card h3 {
  margin: 10px 0 10px;
  color: #ffffff;
  font-size: 28px;
}

.onboarding-card p {
  margin: 0;
  color: #aab8c4;
  line-height: 1.6;
}

.onboarding-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #18242b;
  margin: 18px 0;
}

.onboarding-progress span {
  display: block;
  width: var(--tour-progress);
  height: 100%;
  background: linear-gradient(90deg, #19a7ff, #f5bf35);
}

.onboarding-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 22px;
  color: var(--muted);
  text-align: center;
}

.progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--panel);
}

.progress span {
  display: block;
  height: 100%;
  width: var(--value);
  background: linear-gradient(90deg, var(--accent), var(--blue));
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 2;
    gap: 14px;
    padding: 14px;
  }

  .nav {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .nav button {
    justify-content: center;
    padding: 0 8px;
  }

  .sidebar-footer {
    display: none;
  }

  .metrics,
  .two-col,
  .login-card,
  .dash-stats-grid,
  .dash-chart-grid,
  .dash-calendar-wrap,
  .profile-metrics,
  .profile-post-grid,
  .tournament-hero,
  .tournament-grid,
  .rule-grid {
    grid-template-columns: 1fr;
  }

  .dash-hero {
    align-items: flex-start;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .calendar-cell {
    min-height: 86px;
  }
}

@media (max-width: 620px) {
  .content {
    padding: 18px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .user-chip {
    width: 100%;
    justify-content: space-between;
  }

  .metrics,
  .form-grid,
  .review-lock-grid {
    grid-template-columns: 1fr;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feed-card {
    min-height: calc(100vh - 130px);
  }

  .feed-image {
    min-height: 44vh;
  }

  .comment-form {
    grid-template-columns: 1fr;
  }

  .profile-picture-control {
    grid-template-columns: 1fr;
  }

  .dash-console {
    padding: 12px;
  }

  .dash-hero h3 {
    font-size: 22px;
  }

  .range-controls button {
    flex: 1;
  }

  .winrate-tile,
  .donut-tile,
  .avg-tile {
    align-items: flex-start;
    flex-direction: column;
  }

  .calendar-weekdays span {
    font-size: 10px;
    padding: 8px 2px;
  }

  .calendar-cell {
    min-height: 72px;
    padding: 6px;
  }

  .calendar-cell strong {
    margin-top: 8px;
    font-size: 13px;
  }

  .calendar-day-meta small {
    font-size: 10px;
  }

  .calendar-cell small {
    font-size: 11px;
  }
}
