@font-face {
  font-family: "Press Start 2P";
  src: url("fonts/press-start-2p-latin.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "Pixelify Sans";
  src: url("fonts/pixelify-sans-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --bg: #0b1411;
  --ink: #f3e9dc;
  --ink-dim: #b9a58f;
  --card: rgba(13, 9, 8, 0.88);
  --edge: #000;
  --edge-glow: #7a3a10;
  --accent: #ff9a2e;
  --px: 4px; /* one "pixel" of the UI */
  --w: min(620px, 44vw);
  --pixel-font: "Press Start 2P", ui-monospace, monospace;
  --text-font: "Pixelify Sans", ui-monospace, monospace;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

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

/* The scene stays put while the page scrolls over it. The candle particles (fx.js) are drawn on top of it. */
.scene {
  --bg-x: 50%;
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--bg) url("img/background-small.webp") var(--bg-x) 50% / cover no-repeat;
}

@media (min-width: 1100px) {
  .scene { background-image: url("img/background.webp"); }
}

/* darken the right side so the cards read, keep the pumpkin lit */
.scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 70% 50%, rgba(0, 0, 0, 0.5), transparent 70%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.25), transparent 30%, rgba(0, 0, 0, 0.35));
}

#fx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.page {
  position: relative;
  z-index: 2;
  padding: max(5vh, 28px) 0 64px;
}

/* the column's centre sits at two thirds of the page */
.column {
  width: var(--w);
  margin-left: calc(66.667vw - var(--w) / 2);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 22px;
}

.logo { margin: 0; width: 100%; }
.logo img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.55));
}

/* pixel card: stepped corners made from box-shadow rings, no border-radius */
.card {
  width: 100%;
  padding: 22px 22px 22px;
  background: var(--card);
  box-shadow:
    0 calc(var(--px) * -1) 0 0 var(--edge),
    0 var(--px) 0 0 var(--edge),
    calc(var(--px) * -1) 0 0 0 var(--edge),
    var(--px) 0 0 0 var(--edge),
    0 calc(var(--px) * -2) 0 0 var(--edge-glow),
    0 calc(var(--px) * 2) 0 0 var(--edge-glow),
    calc(var(--px) * -2) 0 0 0 var(--edge-glow),
    calc(var(--px) * 2) 0 0 0 var(--edge-glow),
    inset var(--px) var(--px) 0 0 rgba(255, 255, 255, 0.07),
    inset calc(var(--px) * -1) calc(var(--px) * -1) 0 0 rgba(0, 0, 0, 0.45);
}

.tagline {
  margin: 0 0 18px;
  text-align: center;
  color: var(--ink-dim);
  font-family: var(--pixel-font);
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: 0.5px;
  text-shadow: 2px 2px 0 #000;
}

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

/* Minecraft-style buttons: black frame, bevelled light/dark edges, hard text shadow */
.mc-btn {
  --hi: #e8645a;
  --base: #b3261e;
  --lo: #6a110c;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 10px 14px;
  background: var(--base);
  border: var(--px) solid #000;
  box-shadow:
    inset var(--px) var(--px) 0 0 var(--hi),
    inset calc(var(--px) * -1) calc(var(--px) * -1) 0 0 var(--lo);
  color: #fff;
  font-family: var(--pixel-font);
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.mc-btn--stone { --hi: #c9c9c9; --base: #8b8b8b; --lo: #4a4a4a; }

.mc-btn__label {
  font-size: 13px;
  line-height: 1.3;
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.55);
}

.mc-btn__sub {
  font-size: 8px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.82);
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.55);
  overflow-wrap: anywhere;
}

.mc-btn:hover,
.mc-btn:focus-visible { --hi: #ff8d80; --base: #cf3a30; outline: none; }
.mc-btn--stone:hover,
.mc-btn--stone:focus-visible { --hi: #e6e6e6; --base: #a3a3a3; }

.mc-btn:focus-visible {
  box-shadow:
    0 0 0 var(--px) #fff,
    inset var(--px) var(--px) 0 0 var(--hi),
    inset calc(var(--px) * -1) calc(var(--px) * -1) 0 0 var(--lo);
}

.mc-btn:active {
  box-shadow:
    inset var(--px) var(--px) 0 0 var(--lo),
    inset calc(var(--px) * -1) calc(var(--px) * -1) 0 0 var(--hi);
  padding-top: 18px;
  padding-bottom: 12px;
}

.mc-btn--stone[data-placeholder] { cursor: default; }

.status {
  min-height: 1.3em;
  margin: 12px 0 0;
  text-align: center;
  font-family: var(--pixel-font);
  font-size: 9px;
  line-height: 1.5;
  color: #9fd88a;
  text-shadow: 2px 2px 0 #000;
}

.about {
  margin-top: 10px;
  padding-top: 18px;
  border-top: var(--px) dashed rgba(122, 58, 16, 0.7);
}

h2 {
  margin: 0 0 12px;
  font-family: var(--pixel-font);
  font-weight: 400;
  font-size: 13px;
  line-height: 1.6;
  color: var(--accent);
  text-shadow: 3px 3px 0 #000;
}

.about p {
  margin: 0;
  font-size: 19px;
  line-height: 1.5;
  color: var(--ink);
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.6);
}

/* whitelist tutorial: one collapsible card, closed by default */
.steps { padding: 6px 22px; }
.wl > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  font-family: var(--pixel-font);
  font-size: 12px;
  line-height: 1.6;
  color: var(--accent);
  text-shadow: 3px 3px 0 #000;
  user-select: none;
}
.wl > summary::-webkit-details-marker { display: none; }
.wl > summary::after {
  content: "+";
  flex: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  background: #3a3a3a;
  box-shadow: inset 3px 3px 0 0 #7d7d7d, inset -3px -3px 0 0 #1b1b1b, 0 0 0 2px #000;
  color: #fff;
  font-size: 12px;
  text-shadow: 2px 2px 0 #000;
}
.wl[open] > summary::after { content: "-"; background: #b3261e; box-shadow: inset 3px 3px 0 0 #e8645a, inset -3px -3px 0 0 #6a110c, 0 0 0 2px #000; }
.wl > summary:hover { color: #ffb865; }
.wl > summary:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

.steps-list { list-style: none; margin: 0; padding: 0 0 14px; display: grid; gap: 10px; }
.steps-list li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: center; }
.steps-list .n {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  background: #b3261e;
  box-shadow: inset 3px 3px 0 0 #e8645a, inset -3px -3px 0 0 #6a110c, 0 0 0 2px #000;
  color: #fff;
  font-family: var(--pixel-font);
  font-size: 10px;
  text-shadow: 2px 2px 0 #000;
}
.steps-list p { margin: 0; font-size: 16px; line-height: 1.4; color: #e6d9c8; }
.steps-list strong { color: #fff; font-weight: 600; }
.steps-list em { color: var(--accent); font-style: normal; }

/* FAQ accordion (native details/summary, one open at a time) */
.faq h2 { font-size: 14px; margin-bottom: 14px; }

.faq details {
  border-top: 2px solid rgba(255, 255, 255, 0.08);
}
.faq details:last-of-type { border-bottom: 2px solid rgba(255, 255, 255, 0.08); }

.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 4px;
  font-family: var(--pixel-font);
  font-size: 10px;
  line-height: 1.7;
  color: var(--ink);
  text-shadow: 2px 2px 0 #000;
  user-select: none;
}
.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  flex: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  background: #3a3a3a;
  box-shadow:
    inset 3px 3px 0 0 #7d7d7d,
    inset -3px -3px 0 0 #1b1b1b,
    0 0 0 2px #000;
  color: #fff;
  font-size: 12px;
  text-shadow: 2px 2px 0 #000;
}
.faq details[open] > summary::after { content: "-"; background: #b3261e; box-shadow: inset 3px 3px 0 0 #e8645a, inset -3px -3px 0 0 #6a110c, 0 0 0 2px #000; }
.faq summary:hover { color: var(--accent); }
.faq summary:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

.answer { padding: 2px 4px 18px; font-size: 17px; line-height: 1.55; color: #e6d9c8; }
.answer p { margin: 0 0 10px; }
.answer p:last-child { margin-bottom: 0; }
.answer ol { margin: 0; padding-left: 26px; }
.answer li { margin: 0 0 6px; padding-left: 4px; }
.answer strong { color: #fff; font-weight: 600; text-shadow: 1px 1px 0 #000; }
.answer em { color: var(--accent); font-style: normal; }
.answer code {
  font-family: var(--text-font);
  padding: 0 6px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.5);
  color: #ffd9a0;
}

.stats { margin: 0; display: grid; gap: 0; }
.stats div { display: grid; grid-template-columns: 8.5em 1fr; gap: 10px; padding: 5px 0; border-bottom: 2px dotted rgba(255, 255, 255, 0.1); }
.stats div:last-child { border-bottom: 0; }
.stats dt { color: var(--ink-dim); }
.stats dd { margin: 0; color: #fff; }

.foot {
  padding: 6px 4px 0;
  text-align: center;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(243, 233, 220, 0.55);
  text-shadow: 2px 2px 0 #000;
}
.foot p { margin: 0; }
.foot a { color: var(--ink-dim); }

/* tablet and phone: one centred column */
@media (max-width: 900px) {
  :root { --w: min(560px, calc(100vw - 32px)); }
  .scene { --bg-x: 22%; }
  .scene::after {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.4) 40%, rgba(0, 0, 0, 0.7));
  }
  .column { margin-left: auto; margin-right: auto; }
}

@media (max-width: 420px) {
  .actions { flex-direction: column; }
  .card { padding: 18px 16px; }
  .stats div { grid-template-columns: 1fr; gap: 0; }
}

@media (prefers-reduced-motion: no-preference) {
  .logo img { animation: hover 5s steps(5) infinite; }
  @keyframes hover {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ---- player pages (/user/NAME) ---- */
.logo--small { display: block; width: 62%; margin: 0 auto; }
.msg { margin: 0; font-size: 19px; text-align: center; }
.back { display: block; margin-top: 12px; text-align: center; color: var(--accent); }

.profile { display: flex; gap: 24px; align-items: center; }
.skin-wrap {
  flex: none;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 2px #000, inset 4px 4px 0 0 rgba(255, 255, 255, 0.06);
}
#skin { display: block; width: 112px; height: 224px; image-rendering: pixelated; filter: drop-shadow(5px 6px 0 rgba(0, 0, 0, 0.5)); }
.who { min-width: 0; }
.who h1 { margin: 0 0 10px; font-family: var(--pixel-font); font-weight: 400; font-size: 20px; line-height: 1.4; color: #fff; text-shadow: 3px 3px 0 #000; overflow-wrap: anywhere; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.pill {
  display: inline-block;
  padding: 5px 9px 4px;
  font-family: var(--pixel-font);
  font-size: 9px;
  line-height: 1.3;
  box-shadow: 0 0 0 2px #000, inset 2px 2px 0 0 rgba(255, 255, 255, 0.35), inset -2px -2px 0 0 rgba(0, 0, 0, 0.3);
}
.who .status { margin: 0; text-align: left; font-size: 8px; }
.who .status.on { color: #9fd88a; }
.who .status.off { color: var(--ink-dim); }
.sub { margin: 6px 0 0; font-size: 16px; color: var(--ink-dim); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.stat {
  padding: 12px 12px 10px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 2px #000, inset 3px 3px 0 0 rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat strong { font-family: var(--pixel-font); font-weight: 400; font-size: 15px; color: #fff; text-shadow: 2px 2px 0 #000; }
.stat span { font-size: 15px; color: var(--ink-dim); }
.stat--big { grid-column: 1 / -1; background: rgba(179, 38, 30, 0.22); }
.stat--big strong { font-size: 26px; color: var(--accent); }

.rank-line { margin: 0 0 10px; font-size: 20px; }
.rank-line strong { font-family: var(--pixel-font); font-weight: 400; font-size: 14px; text-shadow: 2px 2px 0 #000; }
.bar { height: 16px; background: rgba(0, 0, 0, 0.55); box-shadow: inset 0 0 0 2px #000; }
.bar span { display: block; height: 100%; width: 0; background: var(--accent); box-shadow: inset 0 3px 0 0 rgba(255, 255, 255, 0.3), inset 0 -3px 0 0 rgba(0, 0, 0, 0.25); }
.ladder { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.ladder li { display: flex; align-items: center; gap: 10px; font-size: 17px; }
.ladder i { flex: none; width: 14px; height: 14px; box-shadow: 0 0 0 2px #000; }
.ladder .locked { color: #6b6b6b; }
.ladder em { margin-left: auto; font-style: normal; font-size: 14px; color: var(--ink-dim); }

.ach-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; max-height: 420px; overflow: auto; }
.ach-list li { display: grid; gap: 1px; padding: 8px 10px; background: rgba(255, 255, 255, 0.04); border-left: 4px solid #8b8b8b; }
.ach-list strong { font-weight: 600; font-size: 16px; color: #fff; }
.ach-list span { font-size: 14px; color: var(--ink-dim); }
.ach-list .frame-goal { border-left-color: #ffd83a; }
.ach-list .frame-challenge { border-left-color: #b050f0; }
.ach-list .none { border-left-color: transparent; color: var(--ink-dim); }
#ach .bar { margin-top: 2px; }

.finder { display: flex; gap: 10px; margin-bottom: 20px; }
.finder input {
  flex: 1;
  min-width: 0;
  padding: 12px;
  background: rgba(0, 0, 0, 0.6);
  border: 0;
  box-shadow: inset 0 0 0 2px #000, inset 3px 3px 0 0 rgba(255, 255, 255, 0.07);
  color: #fff;
  font-family: var(--text-font);
  font-size: 18px;
}
.finder input:focus { outline: 3px solid #fff; outline-offset: 1px; }
.finder .mc-btn { flex: none; padding: 12px 22px; }
.top-title { margin-top: 4px; }
.players { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.players li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: rgba(255, 255, 255, 0.04); font-size: 18px; }
.players a { color: #fff; text-decoration: none; font-weight: 600; }
.players a:hover { color: var(--accent); }
.players .live { font-style: normal; font-size: 13px; color: #9fd88a; }
.players .right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.players b { font-family: var(--pixel-font); font-weight: 400; font-size: 12px; color: var(--accent); }
.players .none { color: var(--ink-dim); }
.foot a { color: inherit; }

@media (max-width: 560px) {
  .profile { flex-direction: column; text-align: center; }
  .who .status { text-align: center; }
  .pills { justify-content: center; }
}
