@font-face {
  font-family: "Minecraftia";
  src: url("assets/Minecraftia-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --page: #111111;
  --panel: #1d1d1d;
  --white: #ffffff;
  --muted: #c8c8c8;
  --radius: 29px;
  --gap: clamp(16px, 1.55vw, 24px);
  --ease: cubic-bezier(.2,.75,.25,1);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
html { background: var(--page); }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100svh;
  background: var(--page);
  color: var(--white);
  font-family: Inter, Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.homepage {
  width: min(1180px, calc(100% - 40px));
  min-height: 100svh;
  margin: 0 auto;
  padding: 68px 0;
  display: grid;
  align-items: center;
}

.hero-grid {
  width: 100%;
  height: min(720px, calc(100svh - 136px));
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}

.identity-stack {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) clamp(56px, 8.5vh, 68px);
  gap: clamp(12px, 1.7vh, 17px);
}

.logo-card,
.server-copy,
.tile,
.discord-card {
  border-radius: var(--radius);
  overflow: hidden;
}

.logo-card {
  position: relative;
  display: grid;
  place-items: center;
  background: #29d00e;
}

/* Logo panel glow */
.logo-card::before {
  content: "";
  position: absolute;
  inset: -32%;
  background:
    radial-gradient(circle at 28% 30%, rgba(255,255,255,.38) 0 4%, rgba(255,255,255,.12) 5% 13%, transparent 28%),
    radial-gradient(circle at 72% 68%, rgba(135,255,96,.42) 0 7%, transparent 27%),
    radial-gradient(circle at 50% 50%, rgba(72,255,42,.26), transparent 58%);
  filter: blur(9px);
  animation: logoGlowDrift 6s ease-in-out infinite alternate;
  pointer-events: none;
}

.logo-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,.08),
    inset 0 0 38px rgba(255,255,255,.12),
    0 0 28px rgba(41,208,14,.18);
  background:
    linear-gradient(135deg, rgba(255,255,255,.14), transparent 27%, transparent 73%, rgba(0,0,0,.10));
  pointer-events: none;
}

.logo-card .brand-logo {
  z-index: 1;
  filter: drop-shadow(0 8px 12px rgba(0,0,0,.22));
}

@keyframes logoGlowDrift {
  0% { transform: translate3d(-2%, -1%, 0) scale(1); opacity: .82; }
  100% { transform: translate3d(3%, 2%, 0) scale(1.08); opacity: 1; }
}

/* Minecraft-style hover tooltip */
.hover-card {
  overflow: visible;
}

.hover-card::before,
.hover-card::after {
  position: absolute;
  z-index: 40;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}

.hover-card::before {
  content: attr(data-tooltip);
  right: 0;
  top: -54px;
  padding: 13px 17px 12px;
  min-width: max-content;
  background: #f5f5f5;
  color: #252525;
  border: 4px solid #111;
  border-radius: 0;
  box-shadow:
    4px 4px 0 #111,
    inset 0 0 0 2px #fff;
  font-family: Inter, Arial, Helvetica, sans-serif;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.05em;
  text-transform: uppercase;
  white-space: nowrap;
  transform: translateY(8px) scale(.96);
  transform-origin: right bottom;
  transition: opacity .13s linear, transform .16s steps(3, end), visibility .13s linear;
}

.hover-card::after {
  content: "";
  top: -7px;
  right: 14px;
  width: 18px;
  height: 18px;
  background: #f5f5f5;
  border-right: 4px solid #111;
  border-bottom: 4px solid #111;
  transform: translateY(8px) rotate(45deg) scale(.96);
  transition: opacity .13s linear, transform .16s steps(3, end), visibility .13s linear;
}

@media (hover:hover) and (pointer:fine) {
  .hover-card:hover::before,
  .hover-card:hover::after {
    opacity: 1;
    visibility: visible;
  }

  .hover-card:hover::before {
    transform: translateY(0) scale(1);
  }

  .hover-card:hover::after {
    transform: translateY(0) rotate(45deg) scale(1);
  }
}

/* Keep the COPY IP tooltip visible for the 1.5s copied confirmation,
   even if the pointer moves slightly after clicking. */
.server-copy.is-copied::before,
.server-copy.is-copied::after {
  opacity: 1;
  visibility: visible;
}

.server-copy.is-copied::before {
  transform: translateY(0) scale(1);
}

.server-copy.is-copied::after {
  transform: translateY(0) rotate(45deg) scale(1);
}

.brand-logo {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  width: 84%;
  height: 84%;
  object-fit: contain;
  object-position: center;
  transform: translate(-50%, -50%);
}
.brand-logo.is-missing { display: none; }

.server-copy {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 10px;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-width: 0;
  padding: 0 20px 0 30px;
  border: 0;
  color: #fff;
  background: #1d1d1d;
  cursor: pointer;
  text-align: left;
  transition: transform .2s var(--ease), background .2s ease;
}
.server-copy:hover { background: #242424; transform: translateY(-1px); }
.server-copy:active { transform: scale(.992); }

@keyframes copyButtonPop {
  0% { transform: scale(1); }
  38% { transform: scale(1.07); }
  68% { transform: scale(.985); }
  100% { transform: scale(1); }
}

.server-copy.is-popping {
  animation: copyButtonPop .34s var(--ease);
}

.copy-icon {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  color: #fff;
}
.copy-icon svg { width: 43px; height: 43px; }

.server-copy__content {
  min-width: 0;
  display: grid;
  align-content: center;
}
.server-copy__ip {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(17px, 1.7vw, 28px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -.045em;
  text-transform: uppercase;
}
.server-copy__meta {
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #9b9b9b;
  font-size: 10px;
  font-weight: 700;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9ca3af;
}
.status-dot--loading { background: #9ca3af; }
.status-dot--online { background: #20c400; }
.status-dot--offline { background: #ef4444; }

.tile {
  position: relative;
  isolation: isolate;
  background: #202020;
  transform: translateZ(0);
}


.tile-store { grid-column: 2 / 4; grid-row: 1; }
.tile-stats { grid-column: 1 / 3; grid-row: 2; }
.tile-howto { grid-column: 3 / 5; grid-row: 2; }

.tile-image,
.tile-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.tile-image {
  z-index: -2;
  display: block;
  border-radius: var(--radius);
  object-fit: cover;
  object-position: center;
  transition: transform .55s var(--ease), filter .3s ease;
}
.tile-image.is-missing { display: none; }
.tile-overlay {
  z-index: -1;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(0,0,0,.12) 0%, rgba(0,0,0,.04) 48%, rgba(0,0,0,.08) 100%);
}
.tile-overlay--howto { background: rgba(0,0,0,.16); }

.tile-title {
  position: absolute;
  left: 20px;
  top: 23px;
  z-index: 2;
  font-size: clamp(28px, 2.7vw, 38px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.045em;
  text-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.discord-card {
  grid-column: 4;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 18px;
  background: #1d1d1d;
  text-align: center;
  transition: transform .2s var(--ease), background .2s ease;
}
.discord-card:hover { background: #242424; transform: translateY(-1px); }

.discord-logo-wrap {
  width: 82px;
  height: 82px;
  margin-bottom: 18px;
  display: grid;
  place-items: center;
}
.discord-logo-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.discord-logo-wrap img.is-missing { display: none; }

.discord-count {
  max-width: 100%;
  font-size: clamp(29px, 3vw, 43px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.045em;
  white-space: nowrap;
}
.discord-label {
  margin-top: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: clamp(13px, 1.35vw, 18px);
  font-weight: 500;
  white-space: nowrap;
}
.discord-status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #20c400;
}

/* 3D tilt cards. The grid item itself never transforms; only the
   absolutely positioned inner surface tilts. This keeps card sizing fixed. */
.tilt-card {
  position: relative;
  overflow: visible;
  background: transparent;
}

.tilt-surface {
  position: absolute;
  inset: 0;
  display: block;
  border-radius: inherit;
  overflow: hidden;
  background: #202020;
  isolation: isolate;
  transform: perspective(1000px) rotateX(0deg) rotateY(0deg);
  transform-style: preserve-3d;
  transform-origin: center center;
  will-change: transform;
  transition: transform .18s cubic-bezier(.2,.75,.25,1), box-shadow .18s ease;
}

.tilt-card .tile-overlay {
  background: linear-gradient(180deg, rgba(0,0,0,.12) 0%, rgba(0,0,0,.04) 48%, rgba(0,0,0,.08) 100%);
}

.tilt-card.tile-howto .tile-overlay {
  background: rgba(0,0,0,.16);
}

@media (hover:hover) and (pointer:fine) {
  .tilt-card.is-tilting .tilt-surface {
    transform: perspective(1000px) rotateX(var(--tilt-rotate-x, 0deg)) rotateY(var(--tilt-rotate-y, 0deg));
    box-shadow: 0 18px 38px rgba(0,0,0,.26);
  }

  .tilt-card.is-tilting .tile-image {
    transform: scale(1.025);
  }
}

@media (hover:hover) {
  .tile:not(.tilt-card):hover .tile-image { transform: scale(1.025); }
}


/* Footer revealed after a small scroll */
.site-footer {
  width: 100%;
  padding: 42px 20px 48px;
  background: #111111;
  border-top: 1px solid rgba(255,255,255,.035);
}

.footer-inner {
  width: min(920px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.footer-brand {
  color: #fff;
  font-family: "Minecraftia", monospace;
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  text-transform: lowercase;
  text-shadow: 2px 0 0 rgba(255,255,255,.16);
}

.footer-subtitle {
  margin-top: 7px;
  color: #a7a7a7;
  font-size: 12px;
  font-weight: 500;
}

.footer-links {
  margin-top: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 24px;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #9a9a9a;
  font-family: "Minecraftia", monospace;
  font-size: 14px;
  font-weight: 400;
  transition: color .16s ease, transform .16s ease;
}

.footer-links a:hover {
  color: #fff;
  transform: translateY(-1px);
}

.footer-status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
}

@media (min-width: 1051px) {
  .logo-card,
  .server-copy,
  .tile,
  .discord-card {
    border-radius: clamp(21px, 1.7vw, var(--radius));
  }

  .brand-logo {
    width: min(86%, 250px);
    height: min(86%, 250px);
  }

  .discord-logo-wrap {
    width: clamp(58px, 5.2vw, 76px);
    height: clamp(58px, 5.2vw, 76px);
    margin-bottom: clamp(10px, 1.3vh, 16px);
  }

  .tile-title {
    left: clamp(18px, 1.7vw, 24px);
    top: clamp(18px, 2vh, 24px);
    font-size: clamp(27px, 2.2vw, 36px);
  }
}



@media (max-width: 1050px) {
  :root { --gap: 18px; --radius: 24px; }
 .homepage {
    width: min(100% - 24px, 900px);
    min-height: 0;
    padding: 34px 0;
    display: block;
  }
 .hero-grid {
    height: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto;
  }
  .identity-stack {
    grid-column: 1;
    grid-row: auto;
    grid-template-rows: minmax(255px, 32vw) 70px;
  }
  .discord-card { grid-column: 2; grid-row: auto; min-height: 342px; }
  .tile-store { grid-column: 1 / -1; grid-row: auto; min-height: 380px; }
  .tile-stats { grid-column: 1 / -1; grid-row: auto; min-height: 350px; }
  .tile-howto { grid-column: 1 / -1; grid-row: auto; min-height: 350px; }
}

@media (max-width: 640px) {

  :root { --gap: 14px; --radius: 20px; }
 .homepage { width: calc(100% - 20px); padding: 24px 0; }
 .hero-grid { display: flex; flex-direction: column; }
  .identity-stack { display: grid; grid-template-rows: 280px 72px; }
  .logo-card { min-height: 0; }
  .server-copy { padding-left: 22px; grid-template-columns: 44px minmax(0,1fr) 8px; }
  .copy-icon, .copy-icon svg { width: 36px; height: 36px; }
  .server-copy__ip { font-size: 19px; }
  .discord-card { min-height: 250px; }
  .discord-logo-wrap { width: 68px; height: 68px; margin-bottom: 14px; }
  .discord-count { font-size: 34px; }
  .tile { min-height: 265px; }
  .tile-store { min-height: 300px; }
  .tile-title { left: 18px; top: 19px; font-size: 30px; }
  .site-footer { padding: 34px 16px 38px; }
  .footer-links { gap: 10px 18px; }
  .footer-links a { font-size: 12px; }
}

/* Smooth page entrance */
@keyframes pageCardEntrance {
  from {
    opacity: 0;
    transform: translateY(22px) scale(.985);
    filter: blur(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.hero-grid > .identity-stack,
.hero-grid > .tile-store,
.hero-grid > .discord-card,
.hero-grid > .tile-stats,
.hero-grid > .tile-howto {
  opacity: 0;
  animation: pageCardEntrance .62s var(--ease) forwards;
  will-change: transform, opacity, filter;
}

.hero-grid > .identity-stack { animation-delay: .04s; }
.hero-grid > .tile-store { animation-delay: .10s; }
.hero-grid > .discord-card { animation-delay: .16s; }
.hero-grid > .tile-stats { animation-delay: .22s; }
.hero-grid > .tile-howto { animation-delay: .28s; }


.site-footer {
  animation: footerEntrance .6s var(--ease) .32s both;
}

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

@media (prefers-reduced-motion: reduce) {
  .hero-grid > .identity-stack,
  .hero-grid > .tile-store,
  .hero-grid > .discord-card,
  .hero-grid > .tile-stats,
  .hero-grid > .tile-howto,
  .site-footer {
    opacity: 1;
    animation: none;
    transform: none;
    filter: none;
  }
}


@media (max-width: 1050px), (prefers-reduced-motion: reduce) {
  .tilt-card .tilt-surface,
  .tilt-card.is-tilting .tilt-surface {
    transform: none !important;
    box-shadow: none !important;
  }

  .tilt-card .tile-image {
    transform: none !important;
  }

}

/* Keep tilted content layered inside the internal surface without touching grid sizing. */
.tilt-surface .tile-image { z-index: 0; }
.tilt-surface .tile-overlay { z-index: 1; }
.tilt-surface .tile-title { z-index: 2; }


/* --------------------------------------------------------------------------
   Statistics leaderboard modal
   -------------------------------------------------------------------------- */
body.stats-modal-open {
  overflow: hidden;
}

.stats-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .22s ease, visibility .22s ease;
}

.stats-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.stats-modal__backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(5, 5, 5, .82);
  backdrop-filter: blur(10px);
  cursor: default;
}

.stats-panel {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: min(760px, calc(100svh - 48px));
  overflow: auto;
  padding: 28px 30px 30px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.025), transparent 26%),
    #171717;
  box-shadow: 0 32px 90px rgba(0,0,0,.62);
  transform: translateY(18px) scale(.97);
  transition: transform .28s var(--ease);
}

.stats-modal.is-open .stats-panel {
  transform: translateY(0) scale(1);
}

.stats-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.stats-panel__eyebrow {
  display: block;
  margin-bottom: 5px;
  color: #29d00e;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.stats-panel h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1;
  letter-spacing: -.045em;
}

.stats-close {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 13px;
  background: #232323;
  color: #fff;
  cursor: pointer;
  font-size: 30px;
  line-height: 1;
  transition: background .16s ease, transform .16s ease;
}

.stats-close:hover {
  background: #2d2d2d;
  transform: scale(1.04);
}

.stats-categories {
  margin-top: 24px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 7px;
  scrollbar-width: thin;
}

.stats-category {
  flex: 0 0 auto;
  padding: 11px 15px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px;
  background: #222;
  color: #a9a9a9;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease;
}

.stats-category:hover {
  color: #fff;
  transform: translateY(-1px);
}

.stats-category.is-active {
  color: #0b1608;
  background: #29d00e;
  border-color: #29d00e;
}

.stats-loading,
.stats-error {
  min-height: 350px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: #a9a9a9;
  text-align: center;
}

.stats-loading[hidden],
.stats-error[hidden],
.podium[hidden],
.stats-updated[hidden] {
  display: none !important;
}

.stats-loading__cube {
  width: 34px;
  height: 34px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.11) 50%, transparent 50%) 0 0/12px 12px,
    linear-gradient(rgba(255,255,255,.08) 50%, transparent 50%) 0 0/12px 12px,
    #29d00e;
  box-shadow: inset -7px -7px 0 rgba(0,0,0,.16), 5px 5px 0 rgba(0,0,0,.28);
  animation: statsCubeBounce .75s steps(4, end) infinite alternate;
}

@keyframes statsCubeBounce {
  from { transform: translateY(4px) rotate(-3deg); }
  to { transform: translateY(-7px) rotate(3deg); }
}

.stats-error strong {
  color: #e6e6e6;
  font-size: 17px;
}

.stats-error button {
  padding: 10px 15px;
  border: 0;
  border-radius: 10px;
  background: #29d00e;
  color: #0b1608;
  cursor: pointer;
  font-weight: 900;
}

.podium {
  min-height: 395px;
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: clamp(10px, 2vw, 20px);
  padding: 18px 12px 0;
}

.podium-place {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  text-align: center;
}

.podium-player {
  min-width: 0;
  margin: 0 auto 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.podium-rank {
  margin-bottom: 5px;
  color: #868686;
  font-size: 12px;
  font-weight: 900;
}

.podium-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(17px, 2vw, 24px);
  line-height: 1.05;
  letter-spacing: -.03em;
}

.podium-value {
  margin-top: 6px;
  color: #b6b6b6;
  font-size: clamp(11px, 1.25vw, 14px);
  font-weight: 700;
}

.podium-place--gold .podium-rank,
.podium-place--gold .podium-value {
  color: #f9d85c;
}

.podium-place--silver .podium-value { color: #d9dde0; }
.podium-place--bronze .podium-value { color: #d68c57; }

.podium-block {
  position: relative;
  width: 100%;
  display: grid;
  place-items: center;
  border: 4px solid rgba(0,0,0,.26);
  border-bottom-width: 8px;
  border-radius: 5px 5px 2px 2px;
  box-shadow:
    inset 0 4px 0 rgba(255,255,255,.18),
    inset -9px 0 0 rgba(0,0,0,.10),
    inset 0 -10px 0 rgba(0,0,0,.14),
    0 10px 0 rgba(0,0,0,.16);
  overflow: visible;
}

.podium-block::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .56;
  background:
    linear-gradient(90deg, rgba(255,255,255,.18) 25%, transparent 25% 50%, rgba(0,0,0,.08) 50% 75%, transparent 75%) 0 0/32px 32px,
    linear-gradient(rgba(255,255,255,.10) 25%, transparent 25% 50%, rgba(0,0,0,.07) 50% 75%, transparent 75%) 0 0/32px 32px;
  image-rendering: pixelated;
}

.podium-block--gold {
  height: 190px;
  background: linear-gradient(135deg, #ffe66f 0 22%, #e2b72a 22% 48%, #f6d64e 48% 72%, #bd8c16 72% 100%);
  border-color: #7e5d08;
}

.podium-block--silver {
  height: 145px;
  background: linear-gradient(135deg, #f4f6f7 0 23%, #adb4ba 23% 49%, #d9dee1 49% 73%, #858d94 73% 100%);
  border-color: #61686d;
}

.podium-block--bronze {
  height: 112px;
  background: linear-gradient(135deg, #e49a62 0 22%, #a85d32 22% 48%, #c97847 48% 72%, #79401f 72% 100%);
  border-color: #593019;
}

.podium-number {
  position: relative;
  z-index: 1;
  color: rgba(20,20,20,.72);
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 1000;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(255,255,255,.15);
}

.podium-crown {
  position: absolute;
  z-index: 2;
  top: -23px;
  left: 50%;
  transform: translateX(-50%);
  color: #ffe66f;
  font-size: 28px;
  filter: drop-shadow(0 3px 0 rgba(0,0,0,.5));
}

.podium-place.is-empty {
  opacity: .45;
}

.stats-updated {
  margin-top: 16px;
  color: #666;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .08em;
}

@media (max-width: 700px) {
  .stats-modal { padding: 12px; }
  .stats-panel {
    max-height: calc(100svh - 24px);
    padding: 22px 16px 22px;
    border-radius: 22px;
  }
  .stats-panel h2 { font-size: 32px; }
  .stats-categories { margin-top: 19px; }
  .podium {
    min-height: 330px;
    gap: 7px;
    padding-inline: 0;
  }
  .podium-block--gold { height: 155px; }
  .podium-block--silver { height: 120px; }
  .podium-block--bronze { height: 92px; }
  .podium-name { font-size: 14px; }
  .podium-value { font-size: 10px; }
  .podium-number { font-size: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .stats-panel,
  .stats-close,
  .stats-category,
  .stats-loading__cube {
    transition: none;
    animation: none;
  }
}


/* --------------------------------------------------------------------------
   Minecraft-style statistics popup
   -------------------------------------------------------------------------- */
.stats-modal__backdrop {
  background: rgba(0, 0, 0, .80);
  backdrop-filter: none;
}

.stats-panel {
  width: min(900px, 100%);
  padding: 24px 26px 28px;
  border: 4px solid #0b0b0b;
  border-radius: 0;
  background: #181818;
  color: #f4f4f4;
  box-shadow:
    8px 8px 0 #080808,
    inset 0 0 0 3px #3a3a3a,
    inset 0 0 0 7px #0f0f0f;
  image-rendering: pixelated;
}

.stats-panel::before {
  content: "";
  position: absolute;
  inset: 10px;
  pointer-events: none;
  border: 2px solid rgba(255,255,255,.08);
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.55);
}

.stats-panel__header,
.stats-categories,
.stats-loading,
.stats-error,
.podium,
.stats-updated {
  position: relative;
  z-index: 1;
}

.stats-panel__eyebrow {
  color: #55e53f;
  font-size: 11px;
  letter-spacing: .10em;
  text-shadow: 2px 2px 0 #0b0b0b;
}

.stats-panel h2 {
  color: #ffffff;
  font-weight: 900;
  text-shadow: 3px 3px 0 #000;
}

.stats-close {
  width: 42px;
  height: 42px;
  border: 3px solid #101010;
  border-radius: 0;
  background: #2a2a2a;
  color: #fff;
  box-shadow:
    3px 3px 0 #101010,
    inset 2px 2px 0 #4a4a4a,
    inset -2px -2px 0 #111;
  text-shadow: 2px 2px 0 #333;
  transition: transform .10s steps(2, end), background .10s linear;
}

.stats-close:hover {
  background: #333333;
  transform: translate(-1px, -1px);
}

.stats-close:active {
  transform: translate(2px, 2px);
  box-shadow:
    1px 1px 0 #101010,
    inset 2px 2px 0 #111,
    inset -2px -2px 0 #3f3f3f;
}

.stats-categories {
  margin-top: 22px;
  gap: 10px;
  padding: 3px 3px 9px;
}

.stats-category {
  padding: 11px 15px 10px;
  border: 3px solid #111;
  border-radius: 0;
  background: #2a2a2a;
  color: #f5f5f5;
  box-shadow:
    3px 3px 0 #111,
    inset 2px 2px 0 #454545,
    inset -2px -2px 0 #111;
  font-size: 12px;
  font-weight: 900;
  text-shadow: 2px 2px 0 #333;
  transition: transform .10s steps(2, end), background .10s linear;
}

.stats-category:hover {
  color: #fff;
  background: #303030;
  transform: translate(-1px, -1px);
}

.stats-category:active {
  transform: translate(2px, 2px);
}

.stats-category.is-active {
  color: #fff;
  background: #29d00e;
  border-color: #111;
  box-shadow:
    3px 3px 0 #111,
    inset 2px 2px 0 #75ef61,
    inset -2px -2px 0 #158306;
  text-shadow: 2px 2px 0 #126206;
}

.stats-loading,
.stats-error {
  color: #cfcfcf;
  font-weight: 800;
}

.stats-loading__cube {
  width: 38px;
  height: 38px;
  border: 3px solid #111;
  background:
    linear-gradient(90deg, rgba(255,255,255,.16) 50%, transparent 50%) 0 0/12px 12px,
    linear-gradient(rgba(255,255,255,.12) 50%, transparent 50%) 0 0/12px 12px,
    #29d00e;
  box-shadow:
    4px 4px 0 #111,
    inset 4px 4px 0 rgba(255,255,255,.22),
    inset -5px -5px 0 rgba(0,0,0,.18);
}

.stats-error strong {
  color: #ffffff;
}

.stats-error button {
  padding: 10px 15px;
  border: 3px solid #111;
  border-radius: 0;
  background: #29d00e;
  color: #fff;
  box-shadow:
    3px 3px 0 #111,
    inset 2px 2px 0 #75ef61,
    inset -2px -2px 0 #158306;
  text-shadow: 2px 2px 0 #126206;
}

.podium {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 3px solid #0b0b0b;
  box-shadow: inset 0 3px 0 #2e2e2e;
}

.podium-player {
  margin-bottom: 12px;
  padding: 7px 9px 6px;
  border: 3px solid #111;
  background: #2b2b2b;
  color: #fff;
  box-shadow:
    3px 3px 0 #111,
    inset 2px 2px 0 #505050,
    inset -2px -2px 0 #171717;
}

.podium-rank {
  color: #bdbdbd;
  text-shadow: 1px 1px 0 #000;
}

.podium-name {
  color: #fff;
  text-shadow: 2px 2px 0 #000;
}

.podium-value {
  color: #d8d8d8;
  text-shadow: 1px 1px 0 #000;
}

.podium-place--gold .podium-rank,
.podium-place--gold .podium-value { color: #ffe15a; }
.podium-place--silver .podium-value { color: #ecf1f3; }
.podium-place--bronze .podium-value { color: #f1a66d; }

.podium-block {
  border-radius: 0;
  border: 4px solid #111;
  border-bottom-width: 4px;
  box-shadow:
    5px 5px 0 #111,
    inset 5px 5px 0 rgba(255,255,255,.18),
    inset -6px -6px 0 rgba(0,0,0,.16);
}

.podium-block--gold { border-color: #111; }
.podium-block--silver { border-color: #111; }
.podium-block--bronze { border-color: #111; }

.podium-number {
  color: rgba(20,20,20,.78);
  text-shadow: 2px 2px 0 rgba(255,255,255,.20);
}

.podium-crown {
  top: -27px;
  filter: drop-shadow(3px 3px 0 #111);
}

.stats-updated {
  color: #8f8f8f;
  font-weight: 900;
  text-shadow: 1px 1px 0 #000;
}

@media (max-width: 700px) {
  .stats-panel {
    padding: 20px 14px 20px;
    border-width: 3px;
    box-shadow:
      5px 5px 0 #080808,
      inset 0 0 0 2px #ffffff,
      inset 0 0 0 5px #8b8b8b;
  }
}

/* Minecraftia typography: footer + leaderboard popup only */
.footer-inner,
.footer-brand,
.footer-subtitle,
.footer-links,
.footer-links a,
.stats-panel,
.stats-panel button,
.stats-panel__eyebrow,
.stats-panel h2,
.stats-categories,
.stats-category,
.stats-loading,
.stats-error,
.stats-error button,
.podium,
.podium-player,
.podium-rank,
.podium-name,
.podium-value,
.podium-number,
.stats-updated {
  font-family: "Minecraftia", monospace;
  font-weight: 400;
}

/* Keep hierarchy through size/color instead of fake bold, which looks bad on Minecraftia. */
.stats-panel h2,
.stats-category,
.podium-name,
.podium-value,
.footer-brand,
.footer-links a {
  font-weight: 400;
}

/* --------------------------------------------------------------------------
   Minecraftia layout corrections
   -------------------------------------------------------------------------- */

/* Keep the disclaimer in the normal site font; only the footer name/links use Minecraftia. */
.footer-subtitle {
  font-family: Inter, Arial, Helvetica, sans-serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}

/* Minecraftia has taller glyph metrics than the previous font, so give the modal header room. */
.stats-panel__header {
  align-items: flex-start;
  gap: 24px;
}

.stats-panel__header > div {
  min-width: 0;
  padding-top: 2px;
}

.stats-panel__eyebrow {
  margin-bottom: 10px;
  line-height: 1.55;
}

.stats-panel h2 {
  margin: 0;
  padding: 0;
  font-size: clamp(27px, 3.3vw, 40px);
  line-height: 1.28;
  letter-spacing: 0;
}

/* Center the close glyph independently from Minecraftia's unusual text baseline. */
.stats-close {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}

.stats-close > span {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  padding: 0 0 4px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 30px;
  font-weight: 400;
  line-height: 1;
  text-align: center;
}

/* Prevent Minecraftia from clipping or overflowing the leaderboard cards. */
.podium-player {
  width: calc(100% - 8px);
  min-width: 0;
  margin-left: auto;
  margin-right: auto;
  padding: 9px 7px 8px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.podium-rank {
  margin-bottom: 5px;
  font-size: 10px;
  line-height: 1.5;
}

.podium-name {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 1.45em;
  padding: 2px 3px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(12px, 1.25vw, 17px);
  line-height: 1.45;
  letter-spacing: 0;
  text-align: center;
}

.podium-value {
  margin-top: 5px;
  font-size: clamp(9px, .9vw, 12px);
  line-height: 1.5;
  text-align: center;
}

.stats-category {
  line-height: 1.45;
  padding-top: 12px;
  padding-bottom: 9px;
}

.stats-loading,
.stats-error,
.stats-updated {
  line-height: 1.55;
}

@media (max-width: 700px) {
  .stats-panel h2 {
    font-size: 28px;
    line-height: 1.3;
  }

  .stats-panel__eyebrow {
    margin-bottom: 8px;
  }

  .podium-name {
    font-size: 12px;
  }

  .podium-value {
    font-size: 9px;
  }
}

/* Final podium number alignment fix */
.podium-number {
  display: block;
  line-height: 1.18;
  padding-top: .12em;
  overflow: visible;
}

.podium-crown {
  display: none !important;
}

/* Bronze podium number: Minecraftia's glyph metrics need a little extra headroom. */
.podium-place--bronze .podium-number {
  line-height: 1.5;
  padding-top: .30em;
  padding-bottom: .08em;
  transform: translateY(2px);
  overflow: visible;
}

@media (max-width: 700px) {
  .podium-place--bronze .podium-number {
    line-height: 1.55;
    padding-top: .34em;
    transform: translateY(1px);
  }
}

/* Align podium numbers on one shared baseline from the bottom of each block. */
.podium-number {
  position: absolute !important;
  left: 50%;
  bottom: 22px;
  z-index: 2;
  display: block;
  margin: 0;
  padding: 0;
  line-height: 1 !important;
  transform: translateX(-50%) !important;
  overflow: visible;
}

.podium-place--bronze .podium-number {
  line-height: 1 !important;
  padding: 0;
  transform: translateX(-50%) !important;
}

@media (max-width: 700px) {
  .podium-number,
  .podium-place--bronze .podium-number {
    bottom: 16px;
    line-height: 1 !important;
    padding: 0;
    transform: translateX(-50%) !important;
  }
}

/* Final podium rank tuning: small bottom offset + clear size hierarchy. */
.podium-number,
.podium-place--bronze .podium-number {
  bottom: 8px;
  padding: 0;
  line-height: 1 !important;
  transform: translateX(-50%) !important;
}

.podium-place--gold .podium-number {
  font-size: clamp(52px, 5vw, 64px);
}

.podium-place--silver .podium-number {
  font-size: clamp(46px, 4.4vw, 56px);
}

.podium-place--bronze .podium-number {
  font-size: clamp(40px, 3.9vw, 49px);
}

@media (max-width: 700px) {
  .podium-number,
  .podium-place--bronze .podium-number {
    bottom: 6px;
  }

  .podium-place--gold .podium-number { font-size: 46px; }
  .podium-place--silver .podium-number { font-size: 41px; }
  .podium-place--bronze .podium-number { font-size: 36px; }
}


/* --------------------------------------------------------------------------
   Legal popup - dark Minecraft UI
   -------------------------------------------------------------------------- */
body.legal-modal-open {
  overflow: hidden;
}

.legal-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .18s ease, visibility .18s ease;
}

.legal-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.legal-modal__backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(0,0,0,.86);
  cursor: default;
}

.legal-panel {
  position: relative;
  z-index: 1;
  width: min(900px, 100%);
  max-height: min(780px, calc(100svh - 48px));
  overflow: auto;
  padding: 24px 28px 30px;
  border: 4px solid #090909;
  border-radius: 0;
  background: #181818;
  color: #efefef;
  box-shadow:
    8px 8px 0 #050505,
    inset 0 0 0 3px #3a3a3a,
    inset 0 0 0 7px #111;
  transform: translateY(14px) scale(.985);
  transition: transform .18s steps(3, end);
  scrollbar-color: #555 #171717;
}

.legal-modal.is-open .legal-panel {
  transform: translateY(0) scale(1);
}

.legal-panel::before {
  content: "";
  position: absolute;
  inset: 10px;
  pointer-events: none;
  border: 2px solid rgba(255,255,255,.06);
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.55);
}

.legal-panel__header,
.legal-content {
  position: relative;
  z-index: 1;
}

.legal-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 18px;
  border-bottom: 3px solid #0c0c0c;
  box-shadow: 0 3px 0 #303030;
}

.legal-panel__eyebrow {
  display: block;
  margin-bottom: 9px;
  color: #29d00e;
  font-family: "Minecraftia", monospace;
  font-size: 10px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: .08em;
}

.legal-panel h2 {
  margin: 0;
  color: #fff;
  font-family: "Minecraftia", monospace;
  font-size: clamp(24px, 3.1vw, 36px);
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0;
}

.legal-close {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 3px solid #080808;
  border-radius: 0;
  background: #292929;
  color: #fff;
  box-shadow:
    3px 3px 0 #080808,
    inset 2px 2px 0 #4a4a4a,
    inset -2px -2px 0 #131313;
  cursor: pointer;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 30px;
  line-height: 1;
}

.legal-close span {
  display: block;
  transform: translateY(-1px);
}

.legal-close:hover {
  background: #343434;
  transform: translate(-1px,-1px);
}

.legal-close:active {
  transform: translate(2px,2px);
  box-shadow:
    1px 1px 0 #080808,
    inset 2px 2px 0 #131313,
    inset -2px -2px 0 #444;
}

.legal-content {
  padding: 22px 2px 4px;
  color: #cfcfcf;
  font-family: Inter, Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.72;
}

.legal-content h3,
.legal-content h4 {
  margin: 25px 0 10px;
  color: #fff;
  font-family: "Minecraftia", monospace;
  font-weight: 400;
  letter-spacing: 0;
}

.legal-content h3:first-child {
  margin-top: 0;
}

.legal-content h3 {
  font-size: 15px;
  line-height: 1.55;
}

.legal-content h4 {
  margin-top: 20px;
  color: #dcdcdc;
  font-size: 12px;
  line-height: 1.6;
}

.legal-content p {
  margin: 0 0 13px;
}

.legal-content ul {
  margin: 8px 0 17px;
  padding-left: 24px;
}

.legal-content li {
  margin: 5px 0;
}

.legal-content li::marker {
  color: #29d00e;
}

.legal-content strong {
  color: #fff;
  font-weight: 700;
}

@media (max-width: 700px) {
  .legal-modal { padding: 12px; }
  .legal-panel {
    max-height: calc(100svh - 24px);
    padding: 18px 14px 22px;
    border-width: 3px;
    box-shadow:
      5px 5px 0 #050505,
      inset 0 0 0 2px #3a3a3a,
      inset 0 0 0 5px #111;
  }
  .legal-panel__header { gap: 12px; }
  .legal-panel h2 { font-size: 23px; }
  .legal-content { font-size: 13px; line-height: 1.65; }
}
