*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-radius: 0 !important;
  -webkit-tap-highlight-color: transparent;
}
:root {
  --bg: #0D100E;
  --panel: #141915;
  --panel-alt: #111612;
  --border: #222B23;
  --border-hi: #2F3931;
  --text: #E6ECE6;
  --muted: #8FA08E;
  --dim: #5F6D5F;
  --accent: #36523B;
  --accent-hi: #426448;
}
html, body {
  width: 100%;
  height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 13px;
  line-height: 1.4;
  overflow: hidden;
  user-select: none;
  overscroll-behavior: none;
}
.hub-shell {
  position: relative;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
}
.hub-module {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hub-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.hub-frame {
  width: 100%;
  background: linear-gradient(145deg, #1E2420, #151A16 55%, #222924);
  border: 1px solid var(--border-hi);
  padding: 16px;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.hub-card {
  background: var(--panel-alt);
  border: 1px solid var(--border);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.hub-identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.hub-avatar-wrap {
  width: 96px;
  height: 96px;
  border: 1px solid var(--border-hi);
  background: #0B0E0C;
  padding: 3px;
}
.hub-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hub-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text);
}
.hub-socials {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  width: 100%;
}
.hub-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  background: #171D18;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}
.hub-btn i {
  color: #C8D3C7;
  font-size: 13px;
  width: 14px;
  text-align: center;
}
.hub-btn:hover {
  background: #1E2620;
  border-color: var(--border-hi);
}
.hub-btn:active {
  background: #253027;
}
.hub-btn.primary {
  background: var(--accent);
  border-color: var(--accent-hi);
}
.hub-btn.primary:hover {
  background: var(--accent-hi);
}
.hub-btn.icon-only {
  width: 36px;
  padding: 0;
  flex-shrink: 0;
}
.hub-row {
  display: flex;
  gap: 6px;
  width: 100%;
}
.hub-row > .hub-btn {
  flex: 1;
}
.hub-specs {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.spec-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 8px;
  background: var(--panel-alt);
  border: 1px solid #1C231D;
  font-size: 11px;
}
.spec-k {
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.spec-v {
  color: var(--text);
  text-align: right;
  font-weight: 500;
}
.game-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: #171D18;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease;
}
.game-link:hover {
  background: #1E2620;
  border-color: var(--border-hi);
}
.game-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.game-left i {
  color: #C8D3C7;
  font-size: 14px;
  width: 16px;
  text-align: center;
}
.game-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.game-stat {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.hub-ping {
  font-variant-numeric: tabular-nums;
  color: var(--dim);
}
.hub-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  padding: 4px 8px;
  background: var(--panel-alt);
  border: 1px solid #1C231D;
}
.top-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.top-tab {
  height: 28px;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}
.top-tab:hover {
  color: var(--text);
  border-color: var(--border-hi);
}
.top-tab.active {
  background: #233326;
  border-color: var(--accent-hi);
  color: var(--text);
}
.top-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 8px;
  background: var(--panel-alt);
  border: 1px solid #1C231D;
  font-size: 11px;
}
.top-row.first {
  border-color: var(--border-hi);
  font-weight: 700;
}
.top-rank {
  color: var(--muted);
  margin-right: 4px;
  font-variant-numeric: tabular-nums;
}
.top-user {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.top-score {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.top-empty {
  padding: 8px;
  background: var(--panel-alt);
  border: 1px solid #1C231D;
  color: var(--dim);
  font-size: 11px;
  text-align: center;
}
.hub-modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 7, 0.84);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}
.hub-modal-bg.open {
  display: flex;
}
.hub-modal {
  width: 100%;
  max-width: 360px;
  max-height: 90dvh;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border-hi);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.78);
}
.hub-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.hub-close {
  width: 26px;
  height: 26px;
  background: #171D18;
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hub-close:hover {
  color: var(--text);
  border-color: var(--border-hi);
}
.hub-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.hub-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.hub-input, .hub-textarea {
  width: 100%;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  padding: 8px 10px;
  outline: none;
}
.hub-input:focus, .hub-textarea:focus {
  border-color: var(--border-hi);
}
.hub-textarea {
  min-height: 84px;
  resize: vertical;
}
.hub-file {
  font-size: 11px;
  color: var(--muted);
}
.hub-error {
  font-size: 11px;
  color: #D28B8B;
  min-height: 15px;
}
.hub-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--panel);
  border: 1px solid var(--border-hi);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 200;
}
.hub-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.mob-bar, .mob-games, .mob-tools {
  display: none;
}

@media (min-width: 900px) {
  .hub-shell {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .hub-corner {
    position: fixed;
    width: 248px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10;
  }
  .hub-corner.tl {
    top: 18px;
    left: 18px;
  }
  .hub-corner.bl {
    bottom: 18px;
    left: 18px;
  }
  .hub-corner.tr {
    top: 18px;
    right: 18px;
  }
  .hub-corner.br {
    bottom: 18px;
    right: 18px;
  }
  .hub-center {
    width: 100%;
    max-width: 340px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 899px) {
  .hub-corner {
    display: none !important;
  }
  .hub-shell {
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 10px;
    padding: 12px;
    height: 100dvh;
    overflow: hidden;
  }
  .mob-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    background: var(--panel);
    border: 1px solid var(--border);
    padding: 6px;
  }
  .mob-account {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
  }
  .mob-account .hub-btn {
    height: 34px;
    padding: 0 10px;
    font-size: 11px;
    flex: 1;
    min-width: 0;
    justify-content: flex-start;
  }
  .mob-account .hub-btn span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mob-account .hub-btn.icon-only {
    flex: 0 0 34px;
    width: 34px;
    justify-content: center;
    padding: 0;
  }
  .mob-ping {
    font-size: 10px;
    color: var(--dim);
    font-variant-numeric: tabular-nums;
    padding: 0 4px;
    flex-shrink: 0;
  }
  .mob-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }
  .mob-actions .hub-btn {
    width: 34px;
    height: 34px;
    padding: 0;
  }
  .hub-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 0;
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
    gap: 8px;
  }
  .hub-frame {
    padding: 12px;
  }
  .hub-card {
    padding: 16px 14px;
    gap: 14px;
  }
  .hub-identity {
    gap: 8px;
  }
  .hub-avatar-wrap {
    width: 74px;
    height: 74px;
  }
  .hub-name {
    font-size: 18px;
  }
  .hub-socials {
    gap: 6px;
  }
  .hub-socials .hub-btn {
    height: 36px;
    font-size: 11px;
  }
  .mob-tools {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    width: 100%;
  }
  .mob-tools .hub-btn {
    height: 34px;
    padding: 0 8px;
    font-size: 11px;
  }
  .mob-games {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--panel);
    border: 1px solid var(--border);
    padding: 10px;
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
  }
  .mob-games-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .mob-game-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6px;
    padding: 10px;
    background: #171D18;
    border: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
  }
  .mob-game-card:active {
    background: #253027;
    border-color: var(--border-hi);
  }
  .mob-game-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }
  .mob-game-top i {
    color: #C8D3C7;
    font-size: 14px;
  }
  .mob-game-stat {
    font-size: 10px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
  }
  .mob-game-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
}

@media (max-width: 899px) and (max-height: 620px) {
  .hub-shell {
    gap: 6px;
    padding: 8px;
  }
  .hub-frame {
    padding: 9px;
  }
  .hub-card {
    padding: 11px 10px;
    gap: 10px;
  }
  .hub-avatar-wrap {
    width: 58px;
    height: 58px;
  }
  .hub-name {
    font-size: 16px;
  }
  .hub-socials .hub-btn {
    height: 32px;
  }
  .mob-tools .hub-btn {
    height: 30px;
  }
  .mob-games {
    padding: 8px;
  }
  .mob-game-card {
    padding: 8px;
  }
}
