:root {
  --bg: #0a0a0c;
  --bg-deep: #060607;
  --panel: #131316;
  --panel-strong: #19191d;
  --panel-hover: #202024;
  --border: #26262c;
  --border-strong: #3a3a42;
  --text: #f5f5f7;
  --muted: #9c9ca6;
  --accent: #e5333f;
  --accent-soft: rgba(229, 51, 63, 0.12);
  --accent-glow: rgba(229, 51, 63, 0.35);
  --gold: #ffd700;
  --green: #58e29b;

  --font-display: "Space Grotesk", -apple-system, "Segoe UI", sans-serif;
  --font-body: "Montserrat", -apple-system, "Segoe UI", sans-serif;

  --shadow-card: 0 24px 72px #00000066;
  --shadow-soft: 0 16px 42px #00000052;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(229, 51, 63, 0.09), transparent 60%),
    radial-gradient(700px 400px at -10% 30%, rgba(120, 120, 130, 0.05), transparent 55%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: rgba(229, 51, 63, 0.35); color: #fff; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a2a30; border-radius: 999px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #3d3d45; }

/* ============ NAV ============ */
.nav {
  position: sticky;
  top: 12px;
  z-index: 100;
  padding: 0 20px;
  margin-top: 12px;
}

.nav-inner {
  max-width: 1480px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 0 18px;
  background: rgba(10, 10, 12, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.logo-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  font-size: 14px;
  color: #fff;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #7d1520);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.logo-text { font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: 0.3px; }
.logo-text span { color: var(--accent); }

.nav-links { display: flex; gap: 4px; }

.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 14px;
  border-radius: 13px;
  transition: all 0.15s ease;
}

.nav-links a:hover { color: var(--text); background: #ffffff0f; }

.nav-links a.active { color: var(--text); background: var(--accent-soft); }

.link-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.nav-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(88, 226, 155, 0.6);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(88, 226, 155, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(88, 226, 155, 0); }
  100% { box-shadow: 0 0 0 0 rgba(88, 226, 155, 0); }
}

/* ============ HERO ============ */
.hero {
  position: relative;
  overflow: hidden;
  padding: 88px 20px 48px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10%;
  background:
    radial-gradient(600px 300px at 70% -10%, rgba(229, 51, 63, 0.18), transparent 70%),
    radial-gradient(500px 260px at 15% 0%, rgba(229, 51, 63, 0.10), transparent 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards;
}

.eyebrow-line { width: 34px; height: 1px; background: linear-gradient(90deg, transparent, var(--accent)); }
.eyebrow-line:last-child { background: linear-gradient(90deg, var(--accent), transparent); }

.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(52px, 9vw, 104px);
  line-height: 1.02;
  letter-spacing: -2px;
  margin: 18px 0 20px;
  opacity: 0;
  animation: fadeUp 0.7s ease 0.1s forwards;
}

.grad {
  background: linear-gradient(100deg, var(--accent) 10%, #ff8a8f 45%, var(--gold) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 30px var(--accent-glow));
}

.hero-sub {
  max-width: 560px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
  font-weight: 500;
  opacity: 0;
  animation: fadeUp 0.7s ease 0.2s forwards;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 40px;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.7s ease 0.3s forwards;
}

.stat {
  min-width: 150px;
  padding: 18px 24px;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.stat:hover {
  transform: translateY(-4px);
  border-color: rgba(229, 51, 63, 0.45);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  background: linear-gradient(100deg, #fff, #ffb3b7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-label { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ BOARD ============ */
.board-section {
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 0 4px;
  scrollbar-width: none;
  position: relative;
}

.tabs::-webkit-scrollbar { display: none; }

.tabBtn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 96px;
  padding: 13px 14px 15px;
  background: #ffffff06;
  border: 1px solid #ffffff14;
  border-bottom: none;
  border-radius: 18px 18px 0 0;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  transition: all 0.18s ease;
}

.tabBtn:hover { color: var(--text); background: #ffffff0d; }

.tabBtn.active { color: var(--text); background: #101014; border-color: #fff2; }

.tabBtn .tab-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: #18181d;
  transition: all 0.18s ease;
}

.tabBtn .tab-icon svg { width: 17px; height: 17px; }
.tabBtn .tab-icon img { width: 17px; height: 17px; object-fit: contain; }

.tabBtn.active .tab-icon {
  border-color: rgba(229, 51, 63, 0.6);
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
}

.tabActiveLine {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 34px;
  height: 3px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  transition: transform 0.28s cubic-bezier(0.3, 1.2, 0.5, 1);
}

.board-card {
  background: #101014;
  border: 1px solid var(--border);
  border-radius: 0 24px 24px 24px;
  box-shadow: var(--shadow-card);
  padding: 26px 28px 30px;
}

.board-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.board-title { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -0.3px; }

.board-sub { color: var(--muted); font-size: 13px; font-weight: 500; margin-top: 4px; }

.legend { display: flex; gap: 14px; }

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.legend-dot { width: 14px; height: 14px; border-radius: 5px; display: inline-block; }
.legend-dot.ht1 { background: linear-gradient(135deg, #ffe14d, #ffd700); box-shadow: 0 0 10px rgba(255, 215, 0, 0.5); }
.legend-dot.none { background: #2c2c33; border: 1px dashed #5b5b66; }

.th-row {
  display: grid;
  grid-template-columns: 56px 68px minmax(170px, 1fr) minmax(0, 1.6fr);
  gap: 14px;
  padding: 0 16px 10px;
}

.th {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.th-left { }
.th-right { text-align: right; }

/* ============ ROWS ============ */
.rows { display: flex; flex-direction: column; gap: 9px; }

.row {
  display: grid;
  grid-template-columns: 56px 68px minmax(170px, 1fr) minmax(0, 1.6fr);
  gap: 14px;
  align-items: center;
  padding: 13px 16px;
  border-radius: 15px;
  background: #ffffff04;
  border: 1px solid #ffffff0f;
  transition: all 0.18s ease;
  opacity: 0;
  transform: translateY(14px);
}

.row.visible { animation: fadeUp 0.5s ease forwards; }

.row:hover {
  background: #ffffff0a;
  border-color: #ffffff29;
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3);
}

.row-top {
  background: linear-gradient(90deg, rgba(229, 51, 63, 0.09), rgba(255, 255, 255, 0.02));
  border-color: rgba(229, 51, 63, 0.25);
}

.row-top:hover {
  background: linear-gradient(90deg, rgba(229, 51, 63, 0.13), rgba(255, 255, 255, 0.04));
  border-color: rgba(229, 51, 63, 0.45);
}

.row-rank {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}

.row-top .row-rank { color: var(--accent); text-shadow: 0 0 18px var(--accent-glow); }

.row-avatar {
  width: 56px;
  height: 56px;
  border-radius: 13px;
  overflow: hidden;
  background: #18181d;
  border: 1px solid var(--border);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08);
  image-rendering: pixelated;
  transform: translateY(3px);
  filter: drop-shadow(-4px 0 6px rgba(0, 0, 0, 0.3));
  transition: transform 0.2s ease;
}

.row:hover .row-avatar { transform: translateY(3px) scale(1.05) rotate(-1deg); }

.row-avatar .avatar { display: block; width: 100%; height: 100%; image-rendering: pixelated; object-fit: cover; }

.row-top .row-avatar {
  border-color: rgba(229, 51, 63, 0.5);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08), 0 0 0 4px rgba(229, 51, 63, 0.08);
}

.row-id { display: flex; flex-direction: column; gap: 3px; min-width: 0; }

.row-name {
  font-size: 19px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-top .row-name { color: var(--text); }

.row-points { color: #8a8a93; font-size: 13px; font-weight: 700; }
.row-points b { color: var(--text); font-weight: 800; }
.row-top .row-points b { color: var(--accent); }

.row-badges {
  display: flex;
  gap: 11px;
  overflow-x: auto;
  padding: 4px 0 2px;
  scrollbar-width: none;
  justify-content: flex-end;
}

.row-badges::-webkit-scrollbar { display: none; }

/* Tier badge (a rangszínek maradnak) */
.tierBadge {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 42px;
  cursor: default;
}

.tierIcon {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 2px solid var(--tier-border);
  background: #18181d;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08);
  transition: transform 0.15s ease;
}

.tierIcon svg { width: 19px; height: 19px; color: var(--tier-accent); }
.tierIcon img { width: 19px; height: 19px; object-fit: contain; }

.tierBadge:hover .tierIcon {
  transform: scale(1.12);
  box-shadow: 0 0 0 4px var(--tier-surface), 0 0 16px var(--tier-glow);
}

.tierPill {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--tier-text);
  background: var(--tier-surface);
  letter-spacing: 0.3px;
  margin-top: -3px;
  white-space: nowrap;
}

.tierBadgeEmpty .tierIcon {
  border: 2px dashed #ffffff22;
  background: #ffffff06;
}

.tierBadgeEmpty .tierIcon svg { color: #ffffff36; }

.tierBadgeEmpty .tierIcon img { filter: grayscale(1) opacity(0.45); }

.tierBadgeEmpty .tierPill {
  color: #8a8a93;
  background: #2a2a30;
}

/* Tooltip */
.tooltip {
  position: fixed;
  z-index: 200;
  pointer-events: none;
  background: #16161af8;
  border: 1px solid #ffffff1f;
  border-radius: 15px;
  padding: 10px 14px;
  box-shadow: 0 18px 40px #0000005c;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 88px;
  backdrop-filter: blur(6px);
}

.tooltip.show { opacity: 1; transform: translateY(0); }

.tooltip-tier { font-size: 14px; font-weight: 900; font-family: var(--font-display); }
.tooltip-points { font-size: 12px; font-weight: 600; color: var(--muted); }

/* ============ JÁTÉKOS MODAL ============ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 4, 6, 0.76);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal.show { opacity: 1; pointer-events: auto; }

body.modal-open { overflow: hidden; }

.modal-card {
  position: relative;
  width: min(720px, 100%);
  max-height: 85vh;
  overflow-y: auto;
  background: #121216;
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  padding: 26px 26px 30px;
  box-shadow: var(--shadow-card);
  transform: translateY(14px) scale(0.98);
  transition: transform 0.22s cubic-bezier(0.3, 1.2, 0.5, 1);
}

.modal.show .modal-card { transform: none; }

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #ffffff0f;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.modal-close:hover { color: #fff; background: #ffffff1f; border-color: var(--border-strong); }

.modal-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  padding-right: 40px;
}

.modal-avatar {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: 16px;
  overflow: hidden;
  background: #18181d;
  border: 2px solid rgba(255, 215, 0, 0.4);
  box-shadow: 0 0 0 5px rgba(255, 215, 0, 0.07);
  image-rendering: pixelated;
}

.modal-avatar .avatar { display: block; width: 100%; height: 100%; image-rendering: pixelated; object-fit: cover; }

.modal-id { flex: 1; min-width: 0; }

.modal-name { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -0.4px; }

.modal-rank { color: var(--muted); font-size: 13px; font-weight: 600; margin-top: 5px; }

.modal-points {
  text-align: center;
  padding: 10px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(229, 51, 63, 0.14), rgba(255, 215, 0, 0.08));
  border: 1px solid rgba(229, 51, 63, 0.35);
  flex-shrink: 0;
}

.modal-points b {
  display: block;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
}

.modal-points span { font-size: 10px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }

.modal-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.mstat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.mstat b { color: var(--text); }

.modal-tiers {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 12px;
  overflow-x: auto;
  padding: 6px 2px 8px;
  scrollbar-width: thin;
}

.modal-tiers .tierBadge { flex-shrink: 0; }

.modal-tiers::-webkit-scrollbar { height: 8px; }
.modal-tiers::-webkit-scrollbar-track { background: transparent; }
.modal-tiers::-webkit-scrollbar-thumb { background: #ffffff1f; border-radius: 999px; }
.modal-tiers::-webkit-scrollbar-thumb:hover { background: #ffffff33; }

@media (max-width: 640px) {
  .modal-card { padding: 20px 16px 24px; }
  .modal-head { flex-wrap: wrap; }
  .modal-points { padding: 8px 14px; }
  .modal-points b { font-size: 20px; }
}

/* ============ FOOTER ============ */
footer {
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, transparent, rgba(229, 51, 63, 0.05));
  margin-top: auto;
}

.footer-inner {
  max-width: 1480px;
  margin: 0 auto;
  padding: 26px 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.footer-brand { font-family: var(--font-display); font-weight: 700; }
.footer-brand span { color: var(--accent); }

.footer-note .gold { color: var(--gold); }

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .row { grid-template-columns: 40px 56px minmax(140px, 1fr); }
  .row-badges { grid-column: 1 / -1; justify-content: flex-start; }
  .th-row { display: none; }
}

@media (max-width: 640px) {
  .hero { padding: 70px 16px 50px; }
  .stat { min-width: calc(50% - 14px); }
  .nav-chip { display: none; }
  .board-card { padding: 20px 16px 22px; border-radius: 0 18px 18px 18px; }
  .nav { top: 8px; margin-top: 8px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
