:root {
  --bg-deep: #07110e;
  --bg-mid: #122019;
  --bg-lift: #1a2a22;
  --ink: #f2f7f3;
  --ink-muted: #b7c9bc;
  --accent: #e0b35a;
  --accent-soft: rgba(224, 179, 90, 0.18);
  --line: rgba(242, 247, 243, 0.12);
  --online: #5ecf8a;
  --offline: #6b7c72;
  --danger: #e07a5f;
  --font-display: "Lilita One", "Impact", sans-serif;
  --font-body: "Sora", system-ui, sans-serif;
  --radius: 14px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg-deep);
  line-height: 1.5;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* —— Palworld-inspired world backdrop —— */
.world-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: #07110e;
}

.world-photo {
  position: absolute;
  inset: -4%;
  background: url("/img/palpagos-horizon.png") center / cover no-repeat;
  transform: scale(1.06);
  animation: kenburns 42s ease-in-out infinite alternate;
  filter: saturate(1.08) contrast(1.05);
}

.world-bg-dim .world-photo {
  filter: saturate(0.95) contrast(1.02) brightness(0.72);
  opacity: 0.55;
}

.world-silhouette {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2%;
  height: min(42vh, 420px);
  background: url("/img/pal-silhouettes.png") center bottom / cover no-repeat;
  opacity: 0.42;
  mix-blend-mode: multiply;
  pointer-events: none;
  animation: silhouetteDrift 28s ease-in-out infinite alternate;
}

.world-bg-dim .world-silhouette {
  opacity: 0.22;
  height: min(28vh, 260px);
}

.world-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 17, 14, 0.35) 0%, rgba(7, 17, 14, 0.15) 35%, rgba(7, 17, 14, 0.55) 70%, rgba(7, 17, 14, 0.88) 100%),
    radial-gradient(ellipse 70% 55% at 50% 30%, transparent 0%, rgba(7, 17, 14, 0.55) 100%);
  pointer-events: none;
}

.page-home .world-vignette {
  background:
    linear-gradient(180deg, rgba(7, 17, 14, 0.2) 0%, rgba(7, 17, 14, 0.08) 40%, rgba(7, 17, 14, 0.45) 72%, rgba(7, 17, 14, 0.9) 100%),
    radial-gradient(ellipse 80% 60% at 50% 35%, transparent 10%, rgba(7, 17, 14, 0.4) 100%);
}

.world-orbs {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.world-orbs span {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff6c8 0%, #e0b35a 45%, #8a5a18 100%);
  box-shadow: 0 0 18px rgba(224, 179, 90, 0.55), 0 0 40px rgba(224, 179, 90, 0.25);
  animation: orbFloat 14s ease-in-out infinite;
  opacity: 0.75;
}

.world-orbs span:nth-child(1) { left: 12%; top: 28%; animation-duration: 16s; }
.world-orbs span:nth-child(2) { left: 78%; top: 22%; width: 10px; height: 10px; animation-duration: 12s; animation-delay: -3s; }
.world-orbs span:nth-child(3) { left: 64%; top: 58%; width: 18px; height: 18px; animation-duration: 18s; animation-delay: -6s; }
.world-orbs span:nth-child(4) { left: 28%; top: 62%; width: 9px; height: 9px; animation-duration: 13s; animation-delay: -2s; }
.world-orbs span:nth-child(5) { left: 48%; top: 18%; width: 12px; height: 12px; animation-duration: 20s; animation-delay: -8s; }

.world-orbs-soft span {
  opacity: 0.35;
  filter: blur(0.5px);
}

@keyframes kenburns {
  from { transform: scale(1.05) translate3d(0, 0, 0); }
  to { transform: scale(1.14) translate3d(-1.5%, 1%, 0); }
}

@keyframes silhouetteDrift {
  from { transform: translateX(0); }
  to { transform: translateX(-1.5%); }
}

@keyframes orbFloat {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.55; }
  50% { transform: translateY(-22px) scale(1.08); opacity: 0.9; }
}

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

.hero {
  max-width: 920px;
  margin: 0 auto;
  padding: clamp(2.5rem, 8vw, 5rem) 1.5rem 2rem;
  text-align: center;
  animation: rise 0.8s ease-out both;
}

.brand {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--ink);
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.55);
}

.headline {
  margin: 0 0 0.75rem;
  font-family: var(--font-body);
  font-size: clamp(1rem, 2.4vw, 1.15rem);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.lede {
  margin: 0 auto 1.75rem;
  max-width: 34rem;
  color: var(--ink-muted);
  font-size: 1.02rem;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.45);
}

.hero-actions {
  display: flex;
  justify-content: center;
}

.search-wrap {
  width: min(100%, 420px);
}

#search {
  width: 100%;
  padding: 0.95rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(7, 17, 14, 0.72);
  color: var(--ink);
  font: inherit;
  font-size: 0.98rem;
  outline: none;
  backdrop-filter: blur(10px);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

#search::placeholder {
  color: var(--ink-muted);
}

#search:focus {
  border-color: rgba(224, 179, 90, 0.55);
  box-shadow: 0 0 0 4px var(--accent-soft);
  background: rgba(7, 17, 14, 0.88);
}

.meta {
  margin: 1rem 0 0;
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.main {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
  animation: rise 0.9s 0.12s ease-out both;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.tab {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(7, 17, 14, 0.45);
  backdrop-filter: blur(8px);
  color: var(--ink-muted);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s, transform 0.15s;
}

.tab:hover {
  color: var(--ink);
  border-color: rgba(232, 240, 234, 0.22);
}

.tab.is-active {
  color: var(--bg-deep);
  background: var(--accent);
  border-color: var(--accent);
}

.tab:active {
  transform: scale(0.97);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(12, 22, 18, 0.78);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.board-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.board-table th,
.board-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.board-table th {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  background: rgba(0, 0, 0, 0.22);
}

.board-table tbody tr {
  cursor: pointer;
  transition: background 0.15s;
}

.board-table tbody tr:hover {
  background: rgba(224, 179, 90, 0.1);
}

.board-table tbody tr:last-child td {
  border-bottom: 0;
}

.rank {
  font-variant-numeric: tabular-nums;
  color: var(--ink-muted);
  width: 3rem;
}

.player-cell {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 500;
}

.dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--offline);
  flex-shrink: 0;
}

.dot.is-online {
  background: var(--online);
  box-shadow: 0 0 10px rgba(94, 207, 138, 0.55);
}

.metric {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--accent);
}

.empty {
  text-align: center;
  color: var(--ink-muted);
  margin: 2rem 0;
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: end center;
  background: rgba(6, 10, 8, 0.55);
  padding: 1rem;
  animation: fade 0.2s ease-out;
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.drawer[hidden] {
  display: none !important;
}

.drawer-panel {
  width: min(100%, 420px);
  max-height: min(88vh, 640px);
  overflow: auto;
  background: var(--bg-lift);
  border: 1px solid var(--line);
  border-radius: 18px 18px 12px 12px;
  padding: 1.5rem 1.4rem 1.6rem;
  box-shadow: var(--shadow);
  position: relative;
  animation: slideUp 0.28s ease-out;
}

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

.drawer-close {
  position: absolute;
  top: 0.7rem;
  right: 0.85rem;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.drawer-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.drawer-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 400;
}

.drawer-status {
  margin: 0.35rem 0 1.2rem;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
  margin: 0;
}

.stats div {
  padding: 0.75rem 0.8rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line);
}

.stats dt {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.stats dd {
  margin: 0.2rem 0 0;
  font-size: 1.15rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.drawer-id {
  margin: 1.1rem 0 0;
  font-size: 0.75rem;
  color: var(--ink-muted);
  word-break: break-all;
}

.pals-block {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.pals-heading {
  margin: 0 0 0.4rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.pals-meta {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.pals-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 280px;
  overflow: auto;
}

.pal-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 0.75rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line);
  font-size: 0.82rem;
}

.pal-row-main {
  font-weight: 600;
}

.pal-row-sub {
  grid-column: 1 / -1;
  color: var(--ink-muted);
  font-size: 0.72rem;
  word-break: break-word;
}

.pal-shiny {
  color: var(--accent);
}

.footer {
  text-align: center;
  padding: 0 1.5rem 2.5rem;
  color: var(--ink-muted);
  font-size: 0.8rem;
}

.footer-home {
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
}

.topnav {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  padding: 1.1rem 1.25rem 0;
  font-size: 0.86rem;
  font-weight: 500;
}

.topnav a {
  color: var(--ink-muted);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 0.2s;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
}

.topnav a:hover,
.topnav a.is-current {
  color: var(--accent);
}

.page-home {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.home-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: clamp(2.5rem, 8vw, 5rem) 1.5rem 2rem;
  animation: rise 0.85s ease-out both;
}

.brand-home {
  margin-bottom: 0.55rem;
  font-size: clamp(2.8rem, 8vw, 4.6rem);
}

.brand-arc-wrap {
  margin: 0 0 0.35rem;
  width: min(100%, 920px);
  line-height: 0;
}

.brand-arc {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 3px 0 rgba(40, 22, 4, 0.55))
    drop-shadow(0 10px 24px rgba(0, 0, 0, 0.55));
}

.brand-arc-text {
  font-family: var(--font-display);
  font-size: 58px;
  font-weight: 400;
  letter-spacing: 0.02em;
  fill: url(#brandFill);
  stroke: rgba(28, 18, 4, 0.72);
  stroke-width: 3.5px;
  paint-order: stroke fill;
  stroke-linejoin: round;
}

.home-tag {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f0c35c;
  text-shadow:
    0 1px 0 rgba(40, 22, 4, 0.65),
    0 2px 14px rgba(0, 0, 0, 0.55);
}

.home-lede {
  margin: 0 0 2.75rem;
  max-width: 32rem;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.8vw, 1.45rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.35;
  color: #e8f0ea;
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.45),
    0 2px 14px rgba(0, 0, 0, 0.5);
}

.home-gates {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(1.75rem, 5vw, 3.5rem);
  width: min(100%, 720px);
}

.gate {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  width: min(42vw, 240px);
  padding: 0;
  text-decoration: none;
  color: var(--ink);
  border: none;
  background: transparent;
  border-radius: 0;
  overflow: visible;
  isolation: auto;
  transition: transform 0.3s ease, filter 0.3s ease;
  animation: rise 0.9s 0.1s ease-out both;
  filter: drop-shadow(0 16px 28px rgba(0, 0, 0, 0.4));
}

.gate-sphere-img {
  display: block;
  width: min(42vw, 220px);
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 0;
  transition: transform 0.35s ease;
  animation: sphere-float 4.5s ease-in-out infinite;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.55));
}

.gate:nth-child(2) .gate-sphere-img {
  animation-delay: -2.2s;
}

.gate-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  width: 100%;
  text-align: center;
  padding: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
}

.gate:hover {
  transform: translateY(-8px);
  filter: drop-shadow(0 22px 36px rgba(0, 0, 0, 0.5))
    drop-shadow(0 0 22px rgba(224, 179, 90, 0.3));
}

.gate:hover .gate-sphere-img {
  transform: scale(1.06) rotate(-6deg);
}

.gate:nth-child(2) {
  animation-delay: 0.18s;
}

.gate-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f0c35c;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

.gate-title {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3.8vw, 1.9rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.05;
  max-width: 100%;
  color: #fff4d0;
  text-shadow:
    0 1px 0 rgba(40, 22, 4, 0.55),
    0 3px 14px rgba(0, 0, 0, 0.5);
}

.gate-hint {
  margin-top: 0.15rem;
  padding-top: 0;
  font-size: 0.75rem;
  line-height: 1.3;
  color: rgba(230, 238, 232, 0.85);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

@keyframes sphere-float {
  0%,
  100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

.home-podium {
  margin-top: 2.75rem;
  width: min(100%, 720px);
  animation: rise 1s 0.22s ease-out both;
}

.home-podium-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4vw, 2.25rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  color: #ffe09a;
  text-shadow:
    0 1px 0 rgba(40, 22, 4, 0.5),
    0 2px 18px rgba(0, 0, 0, 0.45);
}

.home-podium-sub {
  margin: 0.35rem 0 1.15rem;
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  font-weight: 400;
  color: #c9d9ce;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
}

.podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  align-items: end;
}

.podium-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  text-decoration: none;
  color: var(--ink);
  padding: 1.15rem 0.75rem 1.1rem;
  border-radius: 16px;
  border: 1px solid rgba(224, 179, 90, 0.28);
  background: rgba(12, 22, 18, 0.78);
  backdrop-filter: blur(12px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease, border-color 0.2s, box-shadow 0.2s;
}

.podium-card:hover {
  transform: translateY(-4px);
  border-color: rgba(224, 179, 90, 0.55);
}

.podium-rank-1 {
  padding-top: 1.55rem;
  padding-bottom: 1.35rem;
  border-color: rgba(224, 179, 90, 0.55);
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(224, 179, 90, 0.22), transparent 60%),
    rgba(12, 22, 18, 0.85);
}

.podium-rank-2 {
  transform: translateY(8px);
}

.podium-rank-3 {
  transform: translateY(14px);
}

.podium-rank-2:hover,
.podium-rank-3:hover {
  transform: translateY(4px);
}

.podium-medal {
  font-size: 1.35rem;
  line-height: 1;
}

.podium-place {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.podium-name {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3vw, 1.55rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.15;
  margin-top: 0.15rem;
  color: #ffe09a;
  text-shadow: 0 1px 0 rgba(40, 22, 4, 0.45);
}

.podium-points {
  margin-top: 0.35rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.podium-meta {
  font-size: 0.75rem;
  color: var(--ink-muted);
}

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

.hero-compact {
  padding-bottom: 1.25rem;
}

.ach-main {
  padding-top: 0.5rem;
}

.recent-strip {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding: 0.25rem 0 1.25rem;
  margin-bottom: 0.5rem;
  scrollbar-width: thin;
}

.recent-chip {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.85rem 0.55rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(12, 22, 18, 0.78);
  backdrop-filter: blur(10px);
  font-size: 0.82rem;
  white-space: nowrap;
}

.recent-chip img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.recent-chip strong {
  color: var(--accent);
  font-weight: 600;
}

.ach-category {
  margin-bottom: 2.25rem;
}

.ach-category h2 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 400;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
}

.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

.ach-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.55rem;
  padding: 1rem 0.75rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(12, 22, 18, 0.72);
  backdrop-filter: blur(10px);
  transition: transform 0.2s, border-color 0.2s;
}

.ach-card:hover {
  transform: translateY(-3px);
  border-color: rgba(224, 179, 90, 0.4);
}

.ach-card img {
  width: 96px;
  height: 96px;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.35));
}

.ach-card h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.25;
}

.ach-card p {
  margin: 0;
  font-size: 0.75rem;
  color: var(--ink-muted);
  line-height: 1.35;
}

.ach-tier {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}

.ach-tier.bronze { color: #c48a4a; }
.ach-tier.silver { color: #a8b6c2; }
.ach-tier.gold { color: #e0b35a; }

.ach-count {
  font-size: 0.72rem;
  color: var(--ink-muted);
}

.ach-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.ach-mini img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
}

.ach-block {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.profile-badge {
  color: var(--accent);
  font-size: 0.7rem;
  opacity: 0.85;
}

.board-table tbody tr.has-profile .player-name {
  text-decoration: underline;
  text-decoration-color: rgba(224, 179, 90, 0.35);
  text-underline-offset: 3px;
}

.profile-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 3.5rem;
  animation: rise 0.75s ease-out both;
}

.profile-loading {
  text-align: center;
  color: var(--ink-muted);
  margin: 3rem 0;
}

.profile-card,
.profile-hero-card,
.profile-section {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(12, 22, 18, 0.78);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.profile-locked,
.profile-hero-card {
  padding: 1.75rem 1.5rem 1.6rem;
  margin-bottom: 1.25rem;
  text-align: left;
}

.profile-locked {
  text-align: center;
}

.profile-kicker {
  margin: 0 0 0.4rem;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.profile-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  font-weight: 400;
  line-height: 1.05;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.45);
}

.profile-status,
.profile-lede,
.profile-meta {
  color: var(--ink-muted);
  margin: 0.45rem 0 0;
}

.profile-hero-top {
  display: flex;
  justify-content: space-between;
  gap: 1.25rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.profile-rank-pill {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(224, 179, 90, 0.35);
  background: rgba(224, 179, 90, 0.1);
  min-width: 7.5rem;
}

.profile-rank-label {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.profile-rank-value {
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1.1;
  color: var(--accent);
}

.profile-rank-sub {
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1.35rem 0 1.1rem;
}

.profile-stats div {
  padding: 0.85rem 0.8rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid var(--line);
}

.profile-stats dt {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.profile-stats dd {
  margin: 0.25rem 0 0;
  font-size: 1.2rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.profile-back {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.profile-back:hover {
  text-decoration: underline;
}

.profile-section {
  padding: 1.35rem 1.25rem 1.4rem;
  margin-bottom: 1.15rem;
}

.profile-section-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.profile-section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 400;
}

.profile-section-head p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.85rem;
}

.profile-ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.75rem;
}

.profile-ach {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.3rem;
  padding: 0.75rem 0.45rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.18);
}

.profile-ach img {
  width: 72px;
  height: 72px;
}

.profile-ach strong {
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25;
}

.profile-ach.is-locked {
  opacity: 0.38;
  filter: grayscale(0.55);
}

.profile-ach.is-locked:hover {
  opacity: 0.72;
  filter: grayscale(0.15);
}

/* Achievement requirement tooltip on hover */
.has-tip {
  position: relative;
  cursor: help;
}

.has-tip::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(4px);
  width: max(180px, 100%);
  max-width: 240px;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(224, 179, 90, 0.35);
  background: rgba(8, 16, 12, 0.96);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
  letter-spacing: 0;
  text-transform: none;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  z-index: 30;
}

.has-tip::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(224, 179, 90, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s;
  z-index: 31;
}

.has-tip:hover::after,
.has-tip:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.has-tip:hover::before,
.has-tip:focus-visible::before {
  opacity: 1;
  visibility: visible;
}

.ach-mini .has-tip::after {
  left: 0;
  transform: translateX(0) translateY(4px);
  width: 200px;
}

.ach-mini .has-tip:hover::after,
.ach-mini .has-tip:focus-visible::after {
  transform: translateX(0) translateY(0);
}

.ach-mini .has-tip::before {
  left: 16px;
  transform: none;
}

.profile-pals {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 520px;
  overflow: auto;
}

.profile-pal-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.2rem 0.75rem;
  padding: 0.6rem 0.7rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line);
  font-size: 0.84rem;
}

.profile-empty {
  margin: 0;
  color: var(--ink-muted);
}

@media (max-width: 720px) {
  .profile-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .board-table th:nth-child(4),
  .board-table td:nth-child(4) {
    display: none;
  }

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

  .home-gates {
    flex-direction: column;
    align-items: center;
  }

  .gate {
    width: min(70vw, 220px);
  }

  .gate-sphere-img {
    width: min(70vw, 200px);
  }

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

  .podium-rank-1,
  .podium-rank-2,
  .podium-rank-3 {
    transform: none;
  }

  .podium-rank-2:hover,
  .podium-rank-3:hover {
    transform: translateY(-4px);
  }

  .world-orbs span:nth-child(4),
  .world-orbs span:nth-child(5) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .world-photo,
  .world-silhouette,
  .world-orbs span,
  .gate,
  .gate-sphere-img,
  .hero,
  .main,
  .home-hero {
    animation: none !important;
  }
}
