/* MortalisWorld - site styles, v2 layout.
   Structure inspired by a reference site's layout only (floating pill nav,
   full-bleed dark hero, wave divider, rounded cards); no content, images or
   code taken from it. Palette proposal: black, white-grey, deep red. */

:root {
  --wave-h: clamp(60px, 9vw, 120px);
  --bg: #000000;
  --surface: #121212;
  --surface-2: #1b1b1b;
  --border: #2e2e2e;
  --text: #f2f2f2;
  --text-muted: #b8b8b8;
  --red: #b5121b;          /* fills (buttons, bars) with white text */
  --red-hover: #8f0e15;
  --red-text: #ff5a66;     /* red used as text on dark surfaces */
  --status-up: #3ddc84;    /* "online" dot in the server status box only */
  --glow-core: rgba(150, 18, 27, 0.38);  /* skull glow: deep red centre */
  --glow-mid: rgba(48, 24, 26, 0.32);    /* dark red-grey, fades out */
  --pill-bg: rgba(18, 18, 18, 0.82);
  --focus: #ffffff;
  --radius: 10px;
  --radius-lg: 18px;
  --maxw: 72rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; }
/* Phones: keyboard focus and in-page jumps stop above the fixed IP bar (WCAG 2.4.11) */
@media (max-width: 47.99rem) {
  html { scroll-padding-bottom: 5.5rem; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;   /* a long word or URL wraps instead of widening the page */
}

img { max-width: 100%; height: auto; }

/* Nearest-neighbour upscaling for the pixel-art logo; browsers skip values they don't know */
.pixelated {
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

a { color: var(--red-text); text-underline-offset: 0.15em; }
a:hover { color: var(--text); }

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -10rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
}
.skip-link:focus { top: 1rem; }

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

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1rem;
}

/* Placeholder marker: must never look like real content */
.placeholder {
  padding: 0 0.3em;
  border: 1px dashed var(--red-text);
  border-radius: 4px;
  color: var(--red-text);
  font-family: var(--mono);
  font-size: 0.95em;
  font-weight: 700;
}

/* ---------- Top area: header floats over the hero background ---------- */
.page-top { position: relative; }

.site-header {
  position: absolute;
  top: 1rem;
  left: 0;
  right: 0;
  z-index: 20;
}
.pill {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.5rem 0.75rem;
  background: var(--pill-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}
@supports (backdrop-filter: blur(8px)) {
  .pill { backdrop-filter: blur(8px); }
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.brand img {
  width: 40px;
  height: 40px;   /* transparent cut-out of logo-64: no blend trick needed on the pill */
}
.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1rem;
  margin-left: auto;
}
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav ul a {
  display: inline-block;
  padding: 0.4rem 0.1rem;    /* >= 24px target height (WCAG 2.5.8) */
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  border-bottom: 2px solid transparent;
}
.site-nav ul a:hover { border-bottom-color: var(--red-text); }
.site-nav ul a[aria-current="page"] { border-bottom-color: var(--red); }
/* .btn.btn-nav: the generic .btn rule comes later in this file and would win otherwise */
.btn.btn-nav { min-height: 40px; padding: 0.35rem 1rem; }

/* Phones: two rows, brand + Discord on the first, the menu on the second
   (the button used to wrap onto a third row of its own). */
@media (max-width: 47.99rem) {
  .btn.btn-nav { margin-left: auto; padding: 0.35rem 0.85rem; }
  .site-nav { order: 3; width: 100%; margin-left: 0; }
}
/* 360 px and below: a smaller brand keeps the pill at two rows; at three rows it
   covered the first line of the sub-page heroes (measured at 320 px). */
@media (max-width: 22.5rem) {
  .pill { gap: 0.5rem 0.75rem; padding: 0.5rem 0.6rem; }
  .brand { gap: 0.4rem; font-size: 0.85rem; letter-spacing: 0.02em; }
  .brand img { width: 32px; height: 32px; }
  .btn.btn-nav { padding: 0.35rem 0.7rem; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  /* top: room for the floating pill (2 rows on phones); bottom: wave */
  padding: 10.5rem 0 calc(var(--wave-h) + 3rem);
  /* Plain dark background; pages with the server screenshot add class "has-photo" */
  background:
    radial-gradient(ellipse 45% 55% at 78% 42%, rgba(181, 18, 27, 0.22), transparent 70%),
    radial-gradient(ellipse 30% 40% at 8% 90%, rgba(181, 18, 27, 0.16), transparent 70%),
    radial-gradient(ellipse 60% 50% at 50% 0%, #1c1c20, transparent 75%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 32px),
    linear-gradient(180deg, #0e0e11 0%, #08080a 60%, #000000 100%);
}
/* Server screenshot (owner, 2026-10-11) under a black overlay. The photo is bright
   (sky, fog), so the overlay is strong where text sits: measured on the image's
   99th percentile pixel, 0.80+ keeps #ff5a66 and #b8b8b8 text at 4.5:1 or more.
   Bottom fades to black into the wave. Phones get an even overlay because the
   text sits in the middle, under the logo. */
.hero.has-photo {
  /* Phones get the 800 px copy (57 kB instead of 131 kB): under the 0.82 overlay
     the difference does not show. */
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0) 55%, #000000 100%),
    linear-gradient(rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.82)),
    url("../assets/bg/hero-800.jpg") center / cover no-repeat,
    #000000;
}
@media (min-width: 40rem) {
  .hero.has-photo {
    background:
      linear-gradient(180deg, rgba(0, 0, 0, 0) 55%, #000000 100%),
      linear-gradient(rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.82)),
      url("../assets/bg/hero-1600.jpg") center / cover no-repeat,
      #000000;
  }
}
@media (min-width: 56rem) {
  .hero.has-photo {
    background:
      linear-gradient(180deg, rgba(0, 0, 0, 0) 55%, #000000 100%),
      linear-gradient(90deg, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.84) 58%, rgba(0, 0, 0, 0.68) 100%),
      url("../assets/bg/hero-1600.jpg") center / cover no-repeat,
      #000000;
  }
}
@media (min-width: 48rem) {
  .hero { padding-top: 8.5rem; }
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 1.5rem;
}
@media (min-width: 56rem) {
  .hero-grid { grid-template-columns: 1.15fr 0.85fr; gap: 2rem; }
}
.hero-text { position: relative; z-index: 1; }
.kicker {
  margin: 0 0 0.5rem;
  color: var(--red-text);
  font-weight: 800;
  font-size: 1.1rem;
}
.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.25rem, 6.5vw, 4rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.01em;
}
.accent { color: var(--red-text); }
.subtitle {
  margin: 0 0 1.5rem;
  max-width: 34rem;
  color: var(--text-muted);
  font-size: 1.2rem;
}
.server-line {
  margin: 1rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.server-line .ip-value { color: var(--text); }
.ip-value {
  font-family: var(--mono);
  font-weight: 700;
  word-break: break-all;
}
.copy-status {
  min-height: 1.6em;
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Skull animation (transparent GIF) with a soft glow behind it */
.hero-art {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}
@media (max-width: 55.99rem) {
  .hero-art { order: -1; }   /* phones: skull above the headline */
}
.hero-figure {
  position: relative;
  isolation: isolate;
}
.hero-figure::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 50%;
  width: 150%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, var(--glow-core) 0%, var(--glow-mid) 45%, rgba(0, 0, 0, 0) 100%);
  pointer-events: none;
}
.hero-anim img,
.hero-still {
  display: block;
  width: min(420px, 62vw);
  height: auto;
}
@media (max-width: 55.99rem) {
  .hero-anim img, .hero-still { width: min(260px, 60vw); }
}
.hero-still[hidden] { display: none; }
.anim-toggle {
  min-height: 24px;   /* WCAG 2.5.8 target size */
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  color: var(--text-muted);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.anim-toggle:hover { color: var(--text); border-color: var(--text-muted); }
@media (prefers-reduced-motion: reduce) {
  /* The <picture> serves the transparent still frame here, so there is nothing to pause */
  .anim-toggle { display: none; }
}

/* Wave divider at the bottom of the hero (own SVG paths) */
.wave {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  width: 100%;
  height: var(--wave-h);
  display: block;
}
.wave .wave-back { fill: var(--surface); opacity: 0.7; }
.wave .wave-front { fill: var(--bg); }

/* Short top band for sub-pages */
.hero-sub h1 { font-size: clamp(2.25rem, 7vw, 3.5rem); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 48px;
  padding: 0.6rem 1.4rem;
  border: 2px solid var(--red);
  border-radius: var(--radius);
  background: var(--red);
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--red-hover); border-color: var(--red-hover); color: #ffffff; }
.btn-ghost {
  background: rgba(0, 0, 0, 0.55);
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--surface-2); border-color: var(--text-muted); color: var(--text); }
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ---------- Sections and rounded cards ---------- */
.section { padding: 3rem 0; }
.section h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.6rem, 4.5vw, 2.25rem);
  font-weight: 900;
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.lead { color: var(--text-muted); max-width: 44rem; margin-top: 0; }

.panel {
  padding: clamp(1.25rem, 4vw, 2.5rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 48rem) {
  .cards { grid-template-columns: 1fr 1fr; }
}
.card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.card h3 {
  margin: 0 0 0.25rem;
  font-size: 1.4rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.card .card-kicker { margin: 0 0 0.75rem; color: var(--red-text); font-weight: 700; }
.card ul { margin: 0 0 1rem; padding-left: 1.2rem; }
.card li { margin: 0.2rem 0; }
.card .card-link { margin-top: auto; font-weight: 700; }

/* Honest info box about paid items */
.note {
  margin: 1rem 0 0;
  padding: 1rem 1.25rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 4px solid var(--text-muted);
  border-radius: var(--radius);
}
.note h3 { margin: 0 0 0.35rem; font-size: 1.05rem; }
.note p { margin: 0; }

/* Steps */
.steps {
  counter-reset: step;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
@media (min-width: 48rem) {
  .steps { grid-template-columns: repeat(3, 1fr); }
}
.steps li {
  counter-increment: step;
  padding: 1rem 1.25rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.steps li::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin-right: 0.6rem;
  border-radius: 8px;
  background: var(--red);
  color: #ffffff;
  font-weight: 900;
}
.steps code { font-family: var(--mono); font-weight: 700; word-break: break-all; }

/* Game mode detail page */
.mode { padding: 1.5rem 0; scroll-margin-top: 1rem; }
.mode-header { margin-bottom: 1rem; }
.mode h2 {
  margin: 0;
  font-size: clamp(1.75rem, 6vw, 2.5rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.mode .mode-kicker { margin: 0.25rem 0 0; color: var(--red-text); font-weight: 700; }
.feature-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (min-width: 40rem) {
  .feature-list { grid-template-columns: 1fr 1fr; }
}
.feature-list li {
  padding: 0.9rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.feature-list strong { display: block; }
.feature-list span { color: var(--text-muted); }
.toc { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.25rem 0 0; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 2rem;
  padding: 2rem 0 6rem;   /* bottom space for the mobile sticky IP bar */
  background: var(--surface);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.95rem;
}
.site-footer h2 {
  margin: 0 0 0.5rem;
  color: var(--text);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 48rem) {
  .footer-grid { grid-template-columns: 2fr 1fr; }
  .site-footer { padding-bottom: 2rem; }
}
.disclaimer p { margin: 0 0 0.5rem; }
.disclaimer .en { color: var(--text); font-weight: 700; letter-spacing: 0.02em; }
.footer-meta p { margin: 0 0 0.4rem; }
.footer-meta a { display: inline-block; padding: 0.25rem 0; }   /* standalone link: >= 24px tall (WCAG 2.5.8) */

/* Mobile sticky IP bar */
.sticky-ip {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 1rem calc(0.6rem + env(safe-area-inset-bottom));
  background: var(--surface-2);
  border-top: 2px solid var(--red);
}
/* Wraps at 320 px instead of pushing the button off screen; the <wbr> after "play."
   is the preferred break, so the host name is never cut mid-word. */
.sticky-ip .ip-value { flex: 1 1 auto; min-width: 0; font-size: 0.95rem; word-break: normal; overflow-wrap: anywhere; }
.sticky-ip .btn { flex: none; min-height: 44px; padding: 0.4rem 1rem; }
@media (max-width: 22.5rem) {
  .sticky-ip .ip-value { font-size: 0.85rem; }   /* "mortalisworld.eu" fits on one line at 320 px */
  .sticky-ip .btn { padding: 0.4rem 0.8rem; }
}
@media (min-width: 48rem) {
  .sticky-ip { display: none; }
}
/* ---------- Server status box (js/status-loader.js fills #mc-status) ----------
   Adapted from the web-player-stats skill's status.css to the dark palette.
   Opaque surface, so the contrast is measurable even over the hero photo:
   text #f2f2f2 and muted #b8b8b8 on #1b1b1b, dots >= 3:1 (see the commit). */
.status-block { margin: 1rem 0 0; }
.status-block + .cta-row { margin-top: 1rem; }   /* "Gyere fel!": box and buttons were touching */
.status-label {
  margin: 0 0 0.35rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
/* Room for the box before status-loader.js fills it: an empty container grew by
   42 px at first paint and moved the centred hero (CLS 0.017, measured 2026-10-23). */
#mc-status { min-height: 2.65rem; color: var(--text-muted); font-size: 0.95rem; }
.mc-status {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  margin: 0;
  padding: 0.5rem 0.9rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.4;
}
.mc-status .dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  align-self: center;
}
.mc-status.up .dot { background: var(--status-up); }
.mc-status.down .dot { background: var(--red-text); }
.mc-status .count { font-variant-numeric: tabular-nums; font-weight: 800; }
/* The server MOTD lists modes this site does not describe (KitPvP, SkyBlock...).
   Owner decision (Discord 2026-10-23 23:14): the site's two modes are right, the MOTD
   is not followed, so it stays hidden. */
.mc-status .motd { display: none; }
.mc-status .stamp { color: var(--text-muted); font-size: 0.85em; }
.mc-status-note {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
}

/* ---------- News list (between the news:begin/end markers in hirek.html) ---------- */
.news-list {
  display: grid;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.news-item { min-width: 0; }   /* a grid item may shrink below its longest word */
.news-item article {
  padding: 1.25rem 1.5rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.news-title { margin: 0 0 0.25rem; font-size: 1.35rem; font-weight: 900; overflow-wrap: anywhere; }
.news-title a { color: var(--text); }
.news-title a:hover { color: var(--red-text); }
.news-date { margin: 0 0 0.5rem; color: var(--text-muted); font-size: 0.9rem; }
.news-summary { margin: 0; }
.news-empty { color: var(--text-muted); }
.feed-link { margin: 1.5rem 0 0; color: var(--text-muted); }

/* Copy and pause buttons need JS; without it the IP text stays visible and selectable.
   A media query instead of a no-js class: the class was removed by a deferred script,
   so the buttons appeared after the first paint and pushed the hero text down (CLS). */
@media (scripting: none) {
  .js-only { display: none; }
}

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