/* Minecraft-Statistiken – playful pixel look, clear hierarchy.
   All textures and icons are self-made (see tools/make_pixel_art.py). */

@font-face {
  font-family: 'Tiny5';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('../fonts/tiny5-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
    U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Tiny5';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('../fonts/tiny5-latin-ext-400-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Chunky logo font, used for the site title only (no digits there). */
@font-face {
  font-family: 'Pixelify Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 400 700;
  src: url('../fonts/pixelify-sans-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
    U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Pixelify Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 400 700;
  src: url('../fonts/pixelify-sans-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;

  --font-pixel: 'Tiny5', ui-monospace, 'Courier New', monospace;
  --font-logo: 'Pixelify Sans', 'Tiny5', ui-monospace, monospace;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  /* GUI colours (inventory style) */
  --gui: #c6c6c6;
  --gui-hi: #ffffff;
  --gui-lo: #555555;
  --gui-label: #3f3f3f;
  --ink: #1f1f23;
  --ink-muted: #4a4a4f;
  --slot: #8b8b8b;
  --slot-dark: #373737;

  /* Page */
  --cave: #34343a;
  --on-cave: #ffffff;
  --on-cave-muted: #d6d6de;
  --shadow-ink: #2a2a2e;

  /* Accents (Minecraft-ish chat colours, tuned for contrast) */
  --mc-yellow: #ffff55;
  --mc-green: #7dff5a;
  --mc-aqua: #55ffff;
  --mc-red: #ff6b6b;
  --link: #173d9a;
  --focus: #ffff55;

  --xp-hi: #c4ff7a;
  --xp: #80e020;
  --xp-lo: #4d9a12;

  --wrap: 1160px;
  --gutter: 16px;
  --tex: 48px; /* on-screen size of one 16px texture tile (3x) */
}

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

html {
  /* Tiny5 has a single weight; never fake bold/italic pixel glyphs. */
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--on-cave);
  background: var(--cave) url('../img/deepslate-v2.png') repeat 0 0 / 192px 192px;
  image-rendering: pixelated;
}

img,
svg,
canvas {
  image-rendering: pixelated;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-pixel);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
  letter-spacing: 0.01em;
}

p {
  margin: 0;
}

a {
  color: inherit;
}

button {
  font: inherit;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  padding: 8px 14px;
  background: #000;
  color: var(--mc-yellow);
  font-family: var(--font-pixel);
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.px-icon {
  display: inline-block;
  flex: none;
  width: 24px;
  height: 24px;
  vertical-align: middle;
}

.px-icon.i-sm { width: 12px; height: 12px; }
.px-icon.i-md { width: 24px; height: 24px; }
.px-icon.i-lg { width: 36px; height: 36px; }
.px-icon.i-xl { width: 48px; height: 48px; }

/* ------------------------------------------------------------------ */
/* Header: sky, clouds, grass and dirt                                */
/* ------------------------------------------------------------------ */

.site-header {
  position: relative;
}

.sky {
  position: relative;
  overflow: hidden;
  background: linear-gradient(#5f8fe8, #9cc2ff 85%);
  padding: 30px 0 26px;
}

.sky::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    url('../img/clouds.png') repeat-x 0 10px / 384px 72px,
    url('../img/clouds.png') repeat-x 170px 74px / 256px 48px;
  opacity: 0.95;
  animation: drift 90s linear infinite;
  pointer-events: none;
}

@keyframes drift {
  from { background-position: 0 10px, 170px 74px; }
  to { background-position: 384px 10px, 426px 74px; }
}

.header-inner {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 4px 24px;
}

.brand {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  text-decoration: none;
  color: #fff;
}

.brand-kicker {
  font-family: var(--font-pixel);
  font-size: 1rem;
  letter-spacing: 0.08em;
  color: #10244d;
}

.brand-title {
  font-family: var(--font-logo);
  font-weight: 700;
  font-size: clamp(2.1rem, 7.2vw, 4rem);
  line-height: 1;
  color: #e9e9e9;
  background: #dcdcdc url('../img/stone.png') repeat 0 0 / 24px 24px;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 0 #2d2d33) drop-shadow(3px 0 0 #2d2d33) drop-shadow(0 -2px 0 #2d2d33)
    drop-shadow(-2px 0 0 #2d2d33) drop-shadow(0 5px 0 rgb(0 0 0 / 0.35));
  padding: 4px 6px 2px 2px;
}

.brand:hover .brand-title,
.brand:focus-visible .brand-title {
  background-color: #fff;
}

/* Headings focused by the router sit on light-grey panels: dark ring there. */
.panel h1:focus-visible {
  outline-color: var(--ink);
}

/* The global yellow ring is too faint on the light sky: dark ring + yellow halo. */
.brand:focus-visible {
  outline-color: #10244d;
  box-shadow: 0 0 0 7px var(--focus);
}

.splash {
  position: absolute;
  right: -8px;
  bottom: 2px;
  transform: translate(40%, 10%) rotate(-14deg);
  font-family: var(--font-pixel);
  font-weight: 600;
  font-size: clamp(0.85rem, 2.2vw, 1.2rem);
  color: var(--mc-yellow);
  text-shadow: 2px 2px 0 #3f3f15;
  white-space: nowrap;
  pointer-events: none;
  animation: splash 0.9s ease-in-out infinite alternate;
}

@keyframes splash {
  from { transform: translate(40%, 10%) rotate(-14deg) scale(1); }
  to { transform: translate(40%, 10%) rotate(-14deg) scale(1.08); }
}

.tagline {
  max-width: 42rem;
  /* Leaves room for the rotated splash, which ends just above this line. */
  margin-top: 20px;
  color: #10244d;
  font-weight: 600;
  text-shadow: 0 1px 0 rgb(255 255 255 / 0.35);
}

.ground {
  position: relative;
  background:
    url('../img/grass.png') repeat-x 0 0 / var(--tex) var(--tex),
    url('../img/dirt.png') repeat 0 var(--tex) / var(--tex) var(--tex);
  padding: calc(var(--tex) - 6px) 0 16px;
  box-shadow: inset 0 -6px 0 rgb(0 0 0 / 0.25), 0 6px 0 rgb(0 0 0 / 0.35);
}

.nav-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ------------------------------------------------------------------ */
/* Buttons (stone GUI buttons)                                         */
/* ------------------------------------------------------------------ */

.mc-btn {
  --btn-shade: rgb(0 0 0 / 0.28);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 18px 8px;
  border: 2px solid #000;
  background:
    linear-gradient(var(--btn-shade), var(--btn-shade)),
    #7a7a7a url('../img/stone.png') repeat 0 0 / var(--tex) var(--tex);
  box-shadow: inset 2px 2px 0 rgb(255 255 255 / 0.45), inset -2px -4px 0 rgb(0 0 0 / 0.45);
  color: #fff;
  font-family: var(--font-pixel);
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.1;
  text-shadow: 2px 2px 0 #2f2f2f;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
}

.mc-btn:hover {
  border-color: #fff;
  color: #ffffa0;
}

.mc-btn:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-color: #fff;
  color: #ffffa0;
}

/* On the light-grey GUI panels the yellow ring is too faint (about 1.6:1):
   dark ring there. Cards are panels themselves and keep the yellow ring, which
   is drawn on the dark background around them. */
.panel :focus-visible,
.panel .mc-btn:focus-visible {
  outline-color: var(--ink);
}

.mc-btn:active,
.mc-btn[aria-current='page'],
.mc-btn[aria-pressed='true'] {
  --btn-shade: rgb(0 0 0 / 0.5);
  box-shadow: inset 2px 3px 0 rgb(0 0 0 / 0.45), inset -2px -2px 0 rgb(255 255 255 / 0.2);
  color: #ffffa0;
}

.mc-btn--small {
  min-height: 36px;
  padding: 4px 12px 6px;
  font-size: 1.125rem;
}

.mc-btn--green {
  --btn-shade: rgb(30 110 20 / 0.55);
}

/* ------------------------------------------------------------------ */
/* Layout                                                              */
/* ------------------------------------------------------------------ */

main {
  flex: 1 0 auto;
  padding: 28px 0 48px;
}

main:focus {
  outline: none;
}

.view > * + * {
  margin-top: 36px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  font-size: clamp(1.5rem, 4vw, 2rem);
  color: var(--on-cave);
  text-shadow: 3px 3px 0 #000;
}

.section-title .px-icon {
  width: 36px;
  height: 36px;
  filter: drop-shadow(3px 3px 0 rgb(0 0 0 / 0.6));
}

/* Chat-style backing, so the texture never touches the small text. */
.section-sub {
  width: fit-content;
  max-width: 100%;
  margin: -6px 0 16px;
  padding: 2px 8px;
  background: rgb(0 0 0 / 0.5);
  color: var(--on-cave-muted);
}

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

ul.grid,
ol.grid {
  margin: 0;
  padding: 0;
  list-style: none;
}

.grid--cards { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
/* Boards at least 330px wide, so podium names like "Zobbelienchen" fit on one line. */
.grid--boards { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 20px; }
.grid--lists { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; align-items: start; }
.grid--tiles { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.grid--facts { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }

/* ------------------------------------------------------------------ */
/* GUI panel (inventory style, 9-slice)                                */
/* ------------------------------------------------------------------ */

.panel {
  position: relative;
  border: 8px solid transparent;
  border-image: url('../img/panel.png') 4 fill / 8px / 0 stretch;
  background-color: transparent;
  color: var(--ink);
  padding: 10px 12px 12px;
  min-width: 0;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 1.5rem;
  color: var(--gui-label);
}

.panel-title .px-icon {
  width: 24px;
  height: 24px;
}

.panel-title .count {
  margin-left: auto;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.muted {
  color: var(--ink-muted);
}

.slot {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  background: var(--slot);
  box-shadow: inset 3px 3px 0 var(--slot-dark), inset -3px -3px 0 #fff;
}

.slot .px-icon {
  width: 36px;
  height: 36px;
}

.slot--sm {
  width: 36px;
  height: 36px;
  box-shadow: inset 2px 2px 0 var(--slot-dark), inset -2px -2px 0 #fff;
}

.slot--sm .px-icon {
  width: 24px;
  height: 24px;
}

/* ------------------------------------------------------------------ */
/* Notices, loading, errors                                            */
/* ------------------------------------------------------------------ */

.notice {
  margin-top: 20px;
}

.sign {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border: 3px solid #3b2a14;
  background: #a8834f url('../img/planks.png') repeat 0 0 / var(--tex) var(--tex);
  box-shadow: inset 0 0 0 3px rgb(255 255 255 / 0.15), 0 4px 0 rgb(0 0 0 / 0.45);
  color: #fff;
}

.sign-body {
  flex: 1;
  min-width: 0;
  padding: 6px 10px;
  background: rgb(30 18 6 / 0.72);
}

.sign-body strong {
  font-family: var(--font-pixel);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--mc-yellow);
}

.sign .px-icon {
  width: 36px;
  height: 36px;
  margin-top: 4px;
}

.error-box {
  max-width: 640px;
  margin: 24px auto;
  text-align: center;
}

.error-box .px-icon {
  width: 72px;
  height: 72px;
}

.error-box h1 {
  margin: 12px 0 8px;
  font-size: 2rem;
  color: var(--gui-label);
}

.error-box p + p {
  margin-top: 8px;
}

.error-box .actions {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.error-detail {
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.loading {
  display: grid;
  place-items: center;
  gap: 16px;
  min-height: 40vh;
  font-family: var(--font-pixel);
  font-size: 1.5rem;
  text-shadow: 2px 2px 0 #000;
}

.loading-blocks {
  display: flex;
  gap: 8px;
}

.loading-blocks span {
  width: 24px;
  height: 24px;
  border: 2px solid #000;
  background: url('../img/grass.png') 0 0 / 24px 24px;
  animation: hop 0.9s steps(2, end) infinite;
}

.loading-blocks span:nth-child(2) { animation-delay: 0.15s; }
.loading-blocks span:nth-child(3) { animation-delay: 0.3s; }

@keyframes hop {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ------------------------------------------------------------------ */
/* Server status (multiplayer list look)                               */
/* ------------------------------------------------------------------ */

.server-entry {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 4px 16px;
  align-items: start;
  padding: 12px;
  background: rgb(0 0 0 / 0.72);
  border: 3px solid #808080;
  box-shadow: 0 4px 0 rgb(0 0 0 / 0.4);
  color: #fff;
}

.server-icon {
  width: 72px;
  height: 72px;
  image-rendering: pixelated;
  grid-row: span 3;
}

.server-name {
  font-family: var(--font-pixel);
  font-size: 1.5rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.server-motd {
  color: #bdbdbd;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.server-meta {
  color: #bdbdbd;
  font-size: 0.875rem;
}

.server-ping {
  grid-column: 3;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-pixel);
  font-size: 1.25rem;
  white-space: nowrap;
}

.server-ping .px-icon {
  width: 24px;
  height: 24px;
}

.server-ping .status-text--on { color: var(--mc-green); }
.server-ping .status-text--off { color: var(--mc-red); }
.server-ping .status-text--unknown { color: #d6d6de; }

.online-list {
  margin-top: 14px;
}

.online-list h3 {
  margin-bottom: 10px;
  font-size: 1.25rem;
  color: var(--on-cave);
  text-shadow: 2px 2px 0 #000;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  background: rgb(0 0 0 / 0.72);
  border: 2px solid #5a5a5a;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

a.chip:hover {
  border-color: #fff;
  color: #ffffa0;
}

.chip--anon {
  color: var(--on-cave-muted);
  font-weight: 500;
  font-style: italic;
}

/* Who was online at the last (stale) data point. */
.chips--past {
  margin-top: 10px;
}

.chips--past .chip {
  border-style: dashed;
  color: var(--on-cave-muted);
}

.chips--past .head {
  filter: grayscale(1);
}

.online-hint {
  margin-top: 10px;
  font-size: 0.875rem;
  color: var(--on-cave-muted);
}

.empty-cave {
  color: var(--on-cave-muted);
  font-style: italic;
}

/* Whitelisted players who never joined (below the player cards). */
.never-joined {
  margin-top: 18px;
}

.never-joined h3 {
  font-size: 1.125rem;
  color: var(--on-cave-muted);
  text-shadow: 2px 2px 0 #000;
}

/* ------------------------------------------------------------------ */
/* Player heads and figure                                             */
/* ------------------------------------------------------------------ */

.head {
  --size: 32px;
  --skin: none;
  position: relative;
  display: inline-block;
  flex: none;
  width: var(--size);
  height: var(--size);
  /* Plain dark square while the skin loads; skin.js adds .head--fallback ("?")
     when there is no skin or it fails to load. */
  background-color: #3a3a40;
  background-image: var(--skin), var(--skin);
  background-repeat: no-repeat;
  background-size: calc(var(--size) * 8) auto, calc(var(--size) * 8) auto;
  background-position:
    calc(var(--size) * -5) calc(var(--size) * -1),
    calc(var(--size) * -1) calc(var(--size) * -1);
  image-rendering: pixelated;
  box-shadow: 0 0 0 2px #000;
}

.head--fallback {
  background-image: url('../img/head-fallback.png');
  background-size: 100% 100%;
  background-position: 0 0;
}

.figure {
  position: relative;
  display: grid;
  place-items: end center;
  width: 180px;
  height: 260px;
  padding-bottom: 36px;
  background:
    url('../img/grass.png') repeat-x 0 100% / 36px 36px,
    linear-gradient(#5f8fe8, #b9d6ff);
  box-shadow: inset 3px 3px 0 var(--slot-dark), inset -3px -3px 0 #fff;
  border: 3px solid #000;
  overflow: hidden;
}

.figure canvas {
  width: 96px;
  height: 192px;
  image-rendering: pixelated;
  filter: drop-shadow(4px 0 0 rgb(0 0 0 / 0.25));
  animation: bob 2.4s steps(2, end) infinite;
}

.figure .head {
  margin-bottom: 40px;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* ------------------------------------------------------------------ */
/* Badges and XP bars                                                  */
/* ------------------------------------------------------------------ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  background: #1d1d21;
  color: #e6e6e6;
  font-family: var(--font-pixel);
  font-size: 1rem;
  line-height: 1.5;
  white-space: nowrap;
}

.badge::before {
  content: '';
  width: 8px;
  height: 8px;
  background: #8a8a8a;
  box-shadow: 0 0 0 2px #000;
}

.badge--online {
  color: var(--mc-green);
}

.badge--online::before {
  background: var(--mc-green);
  animation: blink 1.2s steps(2, end) infinite;
}

.badge--plain::before {
  display: none;
}

.badge--unknown {
  color: #d6d6de;
}

/* Played in the last few minutes, not named online (just left, or hidden). */
.badge--recent {
  color: var(--mc-yellow);
}

.badge--recent::before {
  background: #e9b623;
}

.badge--unknown::before {
  background: #5a5a62;
}

@keyframes blink {
  50% { opacity: 0.35; }
}

.xp {
  --fill: 0;
  position: relative;
  display: block;
  height: 14px;
  background: #1a1a1d;
  border: 2px solid #000;
  overflow: hidden;
}

.xp > span {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--fill) * 100%);
  min-width: 0;
  background: linear-gradient(var(--xp-hi) 0 25%, var(--xp) 25% 70%, var(--xp-lo) 70%);
}

.xp::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 2px), rgb(0 0 0 / 0.55) calc(10% - 2px) 10%);
  pointer-events: none;
}

.xp--thin {
  height: 10px;
}

.xp--thin::after {
  background: none;
}

.xp--red > span { background: linear-gradient(#ff9a8a 0 25%, #e5312c 25% 70%, #9e1418 70%); }
.xp--blue > span { background: linear-gradient(#a8e4ff 0 25%, #3fa9f5 25% 70%, #1e6bb0 70%); }
.xp--gold > span { background: linear-gradient(#fff38a 0 25%, #f4c534 25% 70%, #b58412 70%); }
.xp--purple > span { background: linear-gradient(#e2c6ff 0 25%, #a26cf0 25% 70%, #5d34a8 70%); }

.level {
  font-family: var(--font-pixel);
  font-weight: 700;
  color: var(--xp);
  text-shadow: 2px 0 0 #000, -2px 0 0 #000, 0 2px 0 #000, 0 -2px 0 #000;
}

/* ------------------------------------------------------------------ */
/* Player cards (start page)                                           */
/* ------------------------------------------------------------------ */

.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-decoration: none;
  transition: transform 0.15s steps(3, end);
}

.card:hover,
.card:focus-visible {
  animation: wiggle 0.45s steps(4, end) 1;
  transform: translateY(-4px) rotate(-0.6deg);
}

.card:focus-visible {
  outline-offset: 6px;
}

@keyframes wiggle {
  0% { transform: rotate(0); }
  25% { transform: translateY(-3px) rotate(-1.5deg); }
  50% { transform: translateY(-4px) rotate(1.2deg); }
  75% { transform: translateY(-4px) rotate(-0.8deg); }
  100% { transform: translateY(-4px) rotate(-0.6deg); }
}

.card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-top .slot {
  width: 64px;
  height: 64px;
}

.card-name {
  font-size: 1.5rem;
  overflow-wrap: anywhere;
}

.card-rank {
  margin-left: auto;
  align-self: flex-start;
  font-family: var(--font-pixel);
  font-size: 1.5rem;
  color: var(--gui-label);
}

.card-status {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.card-status .seen {
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
  margin: 0;
  padding: 10px;
  background: rgb(0 0 0 / 0.07);
  box-shadow: inset 2px 2px 0 rgb(0 0 0 / 0.18), inset -2px -2px 0 rgb(255 255 255 / 0.6);
}

.mini-stats div {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.mini-stats div:first-child {
  grid-column: 1 / -1;
}

.mini-stats dt {
  flex: none;
  display: flex;
}

.mini-stats dd {
  margin: 0;
  font-family: var(--font-pixel);
  font-size: 1.125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-xp {
  display: grid;
  gap: 4px;
}

.card-xp .label {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.card-empty {
  font-style: italic;
  color: var(--ink-muted);
}

/* ------------------------------------------------------------------ */
/* Stat tiles                                                          */
/* ------------------------------------------------------------------ */

.tile {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.tile-text {
  min-width: 0;
}

.tile-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-muted);
  line-height: 1.25;
}

.tile-value {
  font-family: var(--font-pixel);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.tile-sub {
  font-size: 0.8rem;
  color: var(--ink-muted);
  line-height: 1.3;
}

.totals {
  padding: 16px;
}

/* ------------------------------------------------------------------ */
/* Leaderboards / podium                                               */
/* ------------------------------------------------------------------ */

.board {
  display: flex;
  flex-direction: column;
}

.podium {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.podium li {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.podium .p1 { order: 2; }
.podium .p2 { order: 1; }
.podium .p3 { order: 3; }

.podium-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 2px 2px 6px;
  text-decoration: none;
}

.podium-player:hover .podium-name {
  text-decoration: underline;
}

.podium-name {
  max-width: 100%;
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.15;
  /* Names are at most 16 characters: wrap instead of cutting off the winners. */
  overflow-wrap: anywhere;
}

/* Long names get a smaller font first, so they rarely need to wrap at all. */
.podium-name--long {
  font-size: 0.75rem;
  letter-spacing: -0.01em;
}

.podium-value {
  font-family: var(--font-pixel);
  font-size: 1rem;
  line-height: 1.1;
  text-wrap: balance;
}

.podium-block {
  display: grid;
  place-items: center;
  width: 100%;
  border: 2px solid #000;
  box-shadow: inset -4px -4px 0 rgb(0 0 0 / 0.18);
  font-family: var(--font-pixel);
  font-size: 2rem;
  line-height: 1;
  background-size: 48px 48px;
  background-repeat: repeat;
}

.p1 .podium-block { height: 76px; }
.p2 .podium-block { height: 56px; }
.p3 .podium-block { height: 40px; }

.m1 .podium-block {
  background-image: url('../img/gold-block.png');
  background-color: #f6d33c;
  color: #5c3c00;
  text-shadow: 2px 2px 0 #fff6c2;
}

.m2 .podium-block {
  background-image: url('../img/iron-block.png');
  background-color: #d6d6d6;
  color: #3a3a3f;
  text-shadow: 2px 2px 0 #ffffff;
}

.m3 .podium-block {
  background-image: url('../img/copper-block.png');
  background-color: #c46d48;
  color: #ffffff;
  text-shadow: 2px 2px 0 #5a2410;
}

.p1 .head { --size: 44px; }

.podium-empty {
  font-size: 0.8rem;
  color: var(--ink-muted);
  padding-bottom: 6px;
}

.ranklist {
  margin: 12px 0 0;
  padding: 8px 0 0;
  list-style: none;
  border-top: 2px solid rgb(0 0 0 / 0.15);
}

.ranklist li {
  display: grid;
  grid-template-columns: 2.2em auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
}

.ranklist .rank {
  font-family: var(--font-pixel);
  color: var(--ink-muted);
  text-align: right;
}

.ranklist a {
  font-weight: 600;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranklist a:hover {
  text-decoration: underline;
}

.ranklist .value {
  font-family: var(--font-pixel);
  font-weight: 600;
  white-space: nowrap;
}

.board-empty {
  padding: 18px 0;
  text-align: center;
  font-style: italic;
  color: var(--ink-muted);
}

/* ------------------------------------------------------------------ */
/* Player page                                                         */
/* ------------------------------------------------------------------ */

.back-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
}

/* Fills the rest of the row: "previous" sits on the left, "next" on the right. */
.player-nav {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 8px;
}

.player-nav-next {
  margin-left: auto;
}

.hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px 28px;
  align-items: center;
  padding: 18px;
}

.hero-name {
  font-size: clamp(2rem, 6vw, 3rem);
  overflow-wrap: anywhere;
  color: var(--ink);
}

.hero-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin-top: 10px;
}

.hero-status .seen {
  color: var(--ink-muted);
  font-weight: 600;
}

.hero-hint {
  margin-top: 6px;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.hero-facts li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgb(0 0 0 / 0.08);
  box-shadow: inset 2px 2px 0 rgb(0 0 0 / 0.15), inset -2px -2px 0 rgb(255 255 255 / 0.55);
  font-weight: 600;
  font-size: 0.925rem;
}

.hero-xp {
  margin-top: 18px;
  max-width: 520px;
}

.hero-xp .level {
  display: block;
  text-align: center;
  font-size: 2rem;
  margin-bottom: 2px;
}

.hero-xp .xp {
  height: 18px;
}

.hero-xp .label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.hero-latest {
  margin-top: 10px;
  font-size: 0.925rem;
  color: var(--ink-muted);
}

.hero-latest strong {
  color: var(--ink);
}

.dist-total {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-bottom: 12px;
}

.dist-total .big {
  font-family: var(--font-pixel);
  font-size: 2rem;
  font-weight: 700;
}

.dist-list,
.toplist {
  margin: 0;
  padding: 0;
  list-style: none;
}

.dist-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    'icon name value'
    'icon bar bar';
  gap: 2px 10px;
  align-items: center;
  padding: 5px 0;
}

.dist-list .px-icon { grid-area: icon; width: 24px; height: 24px; }
.dist-list .name { grid-area: name; font-weight: 600; }
.dist-list .value { grid-area: value; font-family: var(--font-pixel); font-weight: 600; white-space: nowrap; }
.dist-list .xp { grid-area: bar; }

.toplist li {
  display: grid;
  grid-template-columns: 1.8em minmax(0, 1fr) auto;
  grid-template-areas:
    'rank name value'
    'rank bar bar';
  gap: 2px 8px;
  align-items: center;
  padding: 4px 0;
}

.toplist .rank {
  grid-area: rank;
  align-self: start;
  font-family: var(--font-pixel);
  color: var(--ink-muted);
  text-align: right;
}

.toplist .name {
  grid-area: name;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.toplist .value {
  grid-area: value;
  font-family: var(--font-pixel);
  font-weight: 600;
  white-space: nowrap;
}

.toplist .xp {
  grid-area: bar;
}

/* An expanded top list scrolls inside its panel, so the panel stays compact
   and the "Weniger anzeigen" button stays close. */
.toplist--expanded {
  max-height: 480px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 6px;
  box-shadow: inset 0 -8px 8px -8px rgb(0 0 0 / 0.35);
}

.toplist--expanded:focus-visible {
  outline-color: #000;
  outline-offset: 2px;
}

.list-more {
  margin-top: 10px;
}

/* "Getötet von": deaths without a mob or player to blame. */
.toplist-note {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 2px dashed rgb(0 0 0 / 0.18);
  font-size: 0.875rem;
  font-style: italic;
  color: var(--ink-muted);
}

.empty-note {
  padding: 10px 0;
  font-style: italic;
  color: var(--ink-muted);
}

.fact {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgb(0 0 0 / 0.72);
  border: 2px solid #5a5a5a;
  color: #fff;
}

.fact .num {
  font-family: var(--font-pixel);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--mc-yellow);
}

.fact .txt {
  font-size: 0.9rem;
  color: #e4e4e4;
  line-height: 1.3;
}

/* Advancements */

.adv-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.adv-toolbar .group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
  color: var(--on-cave-muted);
}

.legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend .adv-frame {
  width: 20px;
  height: 20px;
}

.adv-cat + .adv-cat {
  margin-top: 20px;
}

.adv-cat-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 10px;
}

.adv-cat-head h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.5rem;
  color: var(--gui-label);
}

.adv-cat-head .xp {
  flex: 1 1 140px;
  max-width: 260px;
}

.adv-cat-head .count {
  font-weight: 600;
  color: var(--ink-muted);
}

.adv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.adv {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px;
  background: rgb(0 0 0 / 0.06);
  box-shadow: inset 2px 2px 0 rgb(0 0 0 / 0.16), inset -2px -2px 0 rgb(255 255 255 / 0.55);
  min-width: 0;
}

.adv-title {
  font-weight: 700;
  line-height: 1.25;
}

.adv-desc {
  font-size: 0.85rem;
  color: var(--ink-muted);
  line-height: 1.3;
}

.adv-date {
  margin-top: 2px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #1a4d0e;
}

.adv--missing .adv-title,
.adv--missing .adv-desc {
  color: #47474c;
}

.adv--missing .adv-frame {
  filter: grayscale(1) brightness(0.9);
  opacity: 0.75;
}

.adv-frame {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  background: #e2b232;
  border: 2px solid #000;
  box-shadow: inset 2px 2px 0 #fff3b0, inset -2px -2px 0 #9a6f0c;
}

.adv-frame .px-icon {
  width: 24px;
  height: 24px;
}

.adv-frame--goal {
  border-radius: 12px;
  background: #57b8e8;
  box-shadow: inset 2px 2px 0 #c6ecff, inset -2px -2px 0 #22709a;
}

.adv-frame--challenge {
  background: #a26cf0;
  box-shadow: inset 2px 2px 0 #e2c6ff, inset -2px -2px 0 #5d34a8;
  clip-path: polygon(20% 0, 80% 0, 80% 8%, 92% 8%, 92% 20%, 100% 20%, 100% 80%, 92% 80%, 92% 92%, 80% 92%, 80% 100%,
    20% 100%, 20% 92%, 8% 92%, 8% 80%, 0 80%, 0 20%, 8% 20%, 8% 8%, 20% 8%);
}

.adv-hidden-note {
  margin-top: 14px;
  font-size: 0.9rem;
  color: var(--ink-muted);
  font-style: italic;
}

.no-stats {
  display: flex;
  gap: 16px;
  align-items: center;
}

.no-stats .px-icon {
  width: 48px;
  height: 48px;
}

/* ------------------------------------------------------------------ */
/* Static pages (impressum)                                            */
/* ------------------------------------------------------------------ */

.page-panel {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 22px 24px;
}

.page-panel h1 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 2rem;
  color: var(--gui-label);
  margin-bottom: 14px;
}

.page-panel h1 .px-icon {
  width: 36px;
  height: 36px;
}

.page-panel h2 {
  font-size: 1.5rem;
  color: var(--gui-label);
  margin: 22px 0 8px;
}

.page-panel p + p {
  margin-top: 10px;
}

.page-panel ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.page-panel li {
  position: relative;
  padding-left: 22px;
}

.page-panel li + li {
  margin-top: 6px;
}

/* Small diamond-coloured pixel as bullet. */
.page-panel li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 0.55em;
  width: 6px;
  height: 6px;
  background: #3fdccf;
  box-shadow: 0 0 0 2px #1d1d21;
}

.page-panel a:not(.mc-btn) {
  color: var(--link);
  font-weight: 600;
}

.page-panel .actions {
  margin-top: 22px;
}

/* ------------------------------------------------------------------ */
/* Footer (bedrock)                                                    */
/* ------------------------------------------------------------------ */

.site-footer {
  flex: none;
  background: #2f2f2f url('../img/bedrock.png') repeat 0 0 / var(--tex) var(--tex);
  border-top: 4px solid #000;
  padding: 22px 0;
}

.footer-inner {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  background: rgb(0 0 0 / 0.78);
  color: #e6e6e6;
  font-size: 0.9rem;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: center;
  justify-content: space-between;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.footer-links a {
  font-family: var(--font-pixel);
  font-size: 1.25rem;
  color: var(--mc-yellow);
}

.footer-links a:hover {
  color: #fff;
}

.disclaimer {
  color: #bdbdbd;
  font-size: 0.85rem;
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 720px) {
  :root {
    --tex: 36px;
  }

  .sky {
    padding: 22px 0 22px;
  }

  .splash {
    right: auto;
    left: 52%;
    bottom: -18px;
    transform: translate(0, 0) rotate(-8deg);
    animation-name: splash-sm;
  }

  @keyframes splash-sm {
    from { transform: rotate(-8deg) scale(1); }
    to { transform: rotate(-8deg) scale(1.08); }
  }

  .tagline {
    margin-top: 26px;
    font-size: 0.95rem;
  }

  .hero {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .hero-status,
  .hero-facts {
    justify-content: center;
  }

  .hero-xp {
    width: 100%;
  }

  .server-entry {
    grid-template-columns: auto 1fr;
  }

  .server-icon {
    width: 56px;
    height: 56px;
    grid-row: span 2;
  }

  .server-ping {
    grid-column: 1 / -1;
    grid-row: auto;
  }
}

@media (max-width: 420px) {
  .mc-btn {
    padding: 6px 12px 8px;
    font-size: 1rem;
  }

  .grid--cards,
  .grid--boards,
  .grid--lists {
    grid-template-columns: minmax(0, 1fr);
  }

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

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

  .fact {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 8px;
  }

  .fact .num {
    font-size: 1.25rem;
    overflow-wrap: anywhere;
  }

  .fact .txt {
    font-size: 0.825rem;
  }

  .splash {
    font-size: 0.8rem;
    left: 46%;
  }

  .totals {
    padding: 8px;
  }

  .tile {
    gap: 8px;
    align-items: flex-start;
  }

  .tile .slot {
    width: 36px;
    height: 36px;
    box-shadow: inset 2px 2px 0 var(--slot-dark), inset -2px -2px 0 #fff;
  }

  .tile .slot .px-icon {
    width: 24px;
    height: 24px;
  }

  .tile-label {
    font-size: 0.8rem;
  }

  .tile-value {
    font-size: 1.125rem;
  }

  .sky {
    padding: 16px 0 18px;
  }

  .adv-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .podium {
    gap: 6px;
  }

  .podium-name {
    font-size: 0.8rem;
  }

  .podium-name--long {
    font-size: 0.75rem;
  }

  /* Compact rows on phones: icon, title and date only. */
  .adv {
    align-items: center;
    padding: 6px;
  }

  .adv-desc {
    display: none;
  }

  .adv-frame {
    width: 36px;
    height: 36px;
  }

  .adv-frame .px-icon {
    width: 20px;
    height: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .card:hover,
  .card:focus-visible {
    transform: none;
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
  }

  .sky::before,
  .ground,
  .site-footer {
    display: none;
  }
}
