/*
  PhantomAddons site. No scripts, no external fonts or requests.

  The palette is the mod's own GUI theme (gui/Theme.java in the mod), dark and light, so the site looks like
  the in-game menus: a header bar with a gold line under it, tabs with a gold underline, a darker sidebar,
  translucent group panels, rarity-coloured item slots and blue progress bars.
*/

:root {
  color-scheme: dark light;

  /* The mod's dark theme, exactly */
  --bg: #15151a;            /* C_BG */
  --sidebar: #101014;       /* C_SIDEBAR */
  --header: #1b1b1f;        /* C_HEADER */
  --border: #1e2233;        /* C_BORDER */
  --accent: #ffaa00;        /* C_ACCENT */
  --tab-active: #1a1f2e;    /* C_TAB_ACTIVE */
  --tab-hover: #131720;     /* C_TAB_HOVER */
  --text: #d4d8e8;          /* C_TEXT */
  --dim: #6b7399;           /* C_TEXT_DIM */
  --on: #44bb77;            /* C_ON */
  --slider-bg: #1a1f2e;     /* C_SLIDER_BG */
  --slider-fill: #4477dd;   /* C_SLIDER_GR */
  --group-bg: rgba(255, 255, 255, 0.055);
  --group-bar: rgba(255, 170, 0, 0.33);   /* C_GROUP_BAR */
  --cycle-bg: #151e33;      /* C_CYCLE_BG */
  --cycle-hover: #223366;   /* C_CYCLE_HOVER */
  --slot: rgba(0, 0, 0, 0.35);

  /* Derived, for text at normal reading size where the mod's dim colour is too faint */
  --muted: #98a0c4;
  --link: #ffc24d;
  --accent-ink: #1a1200;
  --accent-soft: rgba(255, 170, 0, 0.13);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --radius: 8px;
  --max: 1080px;
}

@media (prefers-color-scheme: light) {
  :root {
    /* The mod's light theme, exactly */
    --bg: #f7f2e5;
    --sidebar: #eee6d0;
    --header: #e1d3a4;
    --border: #c7b98a;
    --accent: #b87700;
    --tab-active: #eedca0;
    --tab-hover: #e2d5aa;
    --text: #201b0f;
    --dim: #6c5f3c;
    --on: #357f49;
    --slider-bg: #dbd0a8;
    --slider-fill: #cb9a33;
    --group-bg: rgba(0, 0, 0, 0.055);
    --group-bar: rgba(184, 119, 0, 0.4);
    --cycle-bg: #dbd0a8;
    --cycle-hover: #c9bb86;
    --slot: rgba(0, 0, 0, 0.12);

    --muted: #5a4e2c;
    --link: #8a5700;
    --accent-ink: #1a1200;
    --accent-soft: rgba(184, 119, 0, 0.12);
    --shadow: 0 12px 30px rgba(60, 40, 0, 0.16);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 76px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: var(--accent-ink); }

a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: 6px; font-weight: 600;
}
.skip:focus { top: 12px; }

.container { width: min(100% - 40px, var(--max)); margin-inline: auto; }

/* ── Header: the mod's tab bar ──────────────────────── */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header);
  border-bottom: 1px solid var(--accent);
}
.site-header .container { display: flex; align-items: center; gap: 18px; min-height: 60px; flex-wrap: wrap; padding-block: 6px; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: 0.2px; }
.brand img { width: 28px; height: 28px; display: block; }

.site-nav { display: flex; gap: 2px; flex-wrap: wrap; margin-left: auto; align-items: center; }
.site-nav a {
  color: var(--muted); text-decoration: none; font-size: 0.93rem; padding: 8px 14px; border-radius: 5px;
}
.site-nav a:hover { color: var(--text); background: var(--tab-hover); }
.site-nav a[aria-current="page"] { color: var(--accent); background: var(--tab-active); box-shadow: inset 0 -2px 0 var(--accent); }
.site-nav .btn { margin-left: 8px; }

/* ── Buttons ────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 6px; font-weight: 650; text-decoration: none;
  border: 1px solid var(--border); color: var(--text); background: var(--cycle-bg);
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}
.btn:hover { background: var(--cycle-hover); border-color: var(--accent); transform: translateY(-1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); background: var(--accent); }
.site-nav .btn { padding: 8px 18px; font-size: 0.92rem; }

/* ── Hero ───────────────────────────────────────────── */

.hero {
  padding: clamp(48px, 8vw, 96px) 0 clamp(44px, 7vw, 80px);
  background:
    radial-gradient(900px 420px at 12% -12%, var(--accent-soft), transparent 70%),
    var(--bg);
  border-bottom: 1px solid var(--border);
}
.hero-grid { display: grid; grid-template-columns: 1.02fr 0.98fr; gap: clamp(28px, 5vw, 56px); align-items: center; }
@media (max-width: 940px) { .hero-grid { grid-template-columns: 1fr; } }

.eyebrow {
  display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--link); background: var(--accent-soft); border: 1px solid var(--group-bar); padding: 4px 12px; border-radius: 5px;
}
h1 { font-size: clamp(2rem, 4.8vw, 3.1rem); line-height: 1.13; margin: 18px 0 16px; letter-spacing: -0.02em; }
.lead { font-size: clamp(1.02rem, 2vw, 1.2rem); color: var(--muted); max-width: 38em; margin: 0 0 26px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.fine { color: var(--muted); font-size: 0.92rem; margin-top: 18px; max-width: 38em; }

/* ── The profile viewer window, drawn in CSS ────────── */

.mock { margin: 0; }
.mock-window {
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden; box-shadow: var(--shadow);
  background: radial-gradient(120% 90% at 30% 10%, color-mix(in srgb, var(--bg) 88%, #fff), color-mix(in srgb, var(--bg) 92%, #000));
  font-size: 0.74rem; user-select: none;
}
.mock-tabs {
  display: flex; gap: 2px; padding: 5px 6px 0; background: var(--header); border-bottom: 1px solid var(--accent);
  overflow: hidden; white-space: nowrap;
}
.mock-tabs span { padding: 7px 11px 8px; color: var(--dim); border-radius: 5px 5px 0 0; }
.mock-tabs .on { color: var(--accent); background: var(--tab-active); box-shadow: inset 0 -2px 0 var(--accent); }
.mock-body { display: grid; grid-template-columns: 112px 1fr; min-height: 292px; }
.mock-side { background: var(--sidebar); border-right: 1px solid var(--border); padding: 8px 0; }
.mock-side span { display: block; padding: 6px 12px; color: var(--dim); }
.mock-side .on { color: var(--accent); background: var(--tab-active); box-shadow: inset 2px 0 0 var(--accent); }
.mock-main { padding: 14px 12px 12px; display: flex; justify-content: center; align-items: flex-start; gap: 10px; }

.slot-col { display: grid; gap: 4px; align-content: start; }
.slot-grid { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; flex: 1; max-width: 330px; }
.gap-top { margin-top: 8px; }
.slot-label { color: var(--dim); font-size: 0.66rem; margin: 0 0 4px; }

/* An item slot. Rarity colours are the game's: uncommon green, rare blue, epic purple, legendary gold, mythic pink. */
.slot {
  position: relative; display: block; aspect-ratio: 1; min-width: 17px; border-radius: 4px; background: var(--slot);
  color: transparent;
}
.slot::after { content: ""; position: absolute; inset: 27%; border-radius: 2px; background: currentColor; opacity: 0.8; }
.slot.c  { color: #9aa1b8; }
.slot.u  { color: #55ff55; box-shadow: inset 0 0 0 1px #55ff55c8; background: linear-gradient(#55ff5530, #55ff5530), var(--slot); }
.slot.r  { color: #6f7bff; box-shadow: inset 0 0 0 1px #5555ffe0; background: linear-gradient(#5555ff38, #5555ff38), var(--slot); }
.slot.e  { color: #c633c6; box-shadow: inset 0 0 0 1px #aa00aae6; background: linear-gradient(#aa00aa40, #aa00aa40), var(--slot); }
.slot.l  { color: #ffaa00; box-shadow: inset 0 0 0 1px #ffaa00e6; background: linear-gradient(#ffaa0038, #ffaa0038), var(--slot); }
.slot.m  { color: #ff55ff; box-shadow: inset 0 0 0 1px #ff55ffe6; background: linear-gradient(#ff55ff38, #ff55ff38), var(--slot); }

.mock-foot { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; border-top: 1px solid var(--border); background: var(--sidebar); }
.mock-chip {
  background: var(--header); border: 1px solid var(--border); border-radius: 6px; padding: 4px 11px; color: var(--text);
}
.mock-chip b { color: var(--dim); font-weight: 600; }
.mock-chip .lvl { color: #ff5555; font-weight: 700; }
.mock figcaption { color: var(--muted); font-size: 0.82rem; margin-top: 10px; text-align: center; }

@media (max-width: 560px) {
  .mock-body { grid-template-columns: 1fr; }
  .mock-side { display: none; }
  .mock-tabs span:nth-child(n+6) { display: none; }
}

/* ── Sections ───────────────────────────────────────── */

section { padding: clamp(48px, 7vw, 84px) 0; }
section + section { border-top: 1px solid var(--border); }
.alt { background: var(--sidebar); }

h2 { font-size: clamp(1.5rem, 3.2vw, 2.05rem); line-height: 1.2; margin: 0 0 12px; letter-spacing: -0.01em; }
h3 { font-size: 1.08rem; margin: 0 0 8px; }
.section-lead { color: var(--muted); max-width: 44em; margin: 0 0 32px; font-size: 1.05rem; }

/* Group panels: translucent, with the mod's gold group bar along the top */
.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.card {
  background: var(--group-bg); border: 1px solid var(--border); border-top: 2px solid var(--group-bar);
  border-radius: var(--radius); padding: 22px;
}
.card p { margin: 0; color: var(--muted); }
.card .icon {
  width: 38px; height: 38px; border-radius: 6px; display: grid; place-items: center; margin-bottom: 14px;
  background: var(--slot); color: var(--accent); font-weight: 800; font-size: 1.05rem; box-shadow: inset 0 0 0 1px var(--group-bar);
}

/* Tab chips, like the viewer's own tab bar */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 20px 0 0; padding: 0; list-style: none; }
.chips li {
  background: var(--tab-hover); border: 1px solid var(--border); border-radius: 5px; padding: 5px 13px;
  font-size: 0.9rem; color: var(--muted);
}
.chips li.hot { color: var(--accent); background: var(--tab-active); box-shadow: inset 0 -2px 0 var(--accent); }

.split { display: grid; gap: 36px; grid-template-columns: 1.1fr 0.9fr; align-items: start; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; gap: 24px; } }

.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.checks li { position: relative; padding-left: 30px; }
.checks li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--on); font-weight: 800; }

code, kbd {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 0.9em;
  background: var(--slot); border: 1px solid var(--border); padding: 1px 7px; border-radius: 5px; white-space: nowrap;
}

.callout {
  background: var(--accent-soft); border: 1px solid var(--group-bar); border-left: 3px solid var(--accent);
  border-radius: var(--radius); padding: 16px 20px; margin-top: 28px;
}
.callout p { margin: 0; }

/* ── Request flow diagram ───────────────────────────── */

.flow { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(4, 1fr); }
.flow li {
  position: relative; background: var(--group-bg); border: 1px solid var(--border); border-top: 2px solid var(--group-bar);
  border-radius: var(--radius); padding: 16px; font-size: 0.95rem; color: var(--muted);
}
.flow li strong { display: block; color: var(--text); margin-bottom: 2px; }
.flow li:not(:last-child)::after {
  content: "→"; position: absolute; right: -15px; top: 50%; transform: translateY(-50%);
  color: var(--accent); font-weight: 800; width: 16px; text-align: center; z-index: 2;
}
@media (max-width: 900px) {
  .flow { grid-template-columns: 1fr 1fr; }
  .flow li:not(:last-child)::after { display: none; }
}
@media (max-width: 520px) { .flow { grid-template-columns: 1fr; } }

/* ── Footer ─────────────────────────────────────────── */

.site-footer { border-top: 1px solid var(--accent); background: var(--header); padding: 36px 0 52px; color: var(--muted); font-size: 0.93rem; }
.site-footer .links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-bottom: 16px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }
.site-footer p { margin: 0 0 10px; max-width: 60em; }

/* ── Text pages (privacy, 404) ──────────────────────── */

.page-head {
  padding: clamp(40px, 6vw, 72px) 0 12px; border-bottom: 1px solid var(--border);
  background: radial-gradient(800px 300px at 12% -25%, var(--accent-soft), transparent 70%), var(--bg);
}
.page-head h1 { font-size: clamp(1.9rem, 4.2vw, 2.6rem); margin-top: 10px; }
.page-head .lead { margin-bottom: 28px; }

.prose { max-width: 46em; padding: 40px 0 72px; }
/* keep the text column flush with the header and title instead of centred */
.container.prose { margin-left: max(20px, calc((100% - var(--max)) / 2)); margin-right: auto; width: min(100% - 40px, 46em); }
.prose h2 { font-size: 1.45rem; margin: 44px 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 24px; color: var(--accent); }
.prose li { margin: 6px 0; }
.prose ul { padding-left: 1.3em; }
.muted { color: var(--muted); }

.table-wrap { overflow-x: auto; margin: 16px 0 8px; border: 1px solid var(--border); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; background: var(--group-bg); }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--header); color: var(--accent); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; box-shadow: inset 0 -1px 0 var(--accent); }
tr:last-child td { border-bottom: 0; }

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