/* Solicit store on Tebex. Ported from web/store/public/css/site.css (home look "a").
   Mobile first; dark purple base, accent #A957EA, light purple #E0B8FF, pink and white on top.
   Gold is kept for the top donator and the top rank label. */

:root {
  --bg: #100a18;
  --bg-2: #160e22;
  --bg-3: #1e142e;
  --line: #2c2040;
  --line-2: #433160;
  --text: #f5effb;
  --muted: #b9a9cf;
  --accent: #a957ea;
  --accent-2: #e0b8ff;
  --pink: #ff8fd0;
  --white: #ffffff;
  --gold: #f2c14e;
  --danger: #ff7b8a;
  --ok: #7fe3a0;
  --opal-a: #ffb3e6;
  --opal-b: #a8e8ff;
  --font-head: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --radius: 6px;
  --wrap: 1160px;
  --gutter: 16px;
  color-scheme: dark;

  /* Tebex's legal footer (added by Tebex under the page) in the store colours */
  --tebex-legal-footer-background-color: #160e22;
  --tebex-legal-footer-text-color: #b9a9cf;
  --tebex-legal-footer-border-color: #2c2040;
  --tebex-legal-footer-logo-color: #e0b8ff;
  --tebex-legal-footer-max-width: 1160px;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font-body);
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; }
a { color: var(--accent-2); text-underline-offset: 3px; }
a:hover { color: var(--white); }
code { font-family: var(--font-mono); font-size: .92em; color: var(--accent-2); overflow-wrap: anywhere; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
ul, ol { padding: 0; margin: 0; list-style: none; }

:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; border-radius: 2px; }
main:focus { outline: none; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--accent-2);
  color: #1a0f26; font-weight: 600; border-radius: var(--radius);
}
.skip-link:focus { top: 8px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.page-pad { padding-top: 32px; padding-bottom: 64px; }
.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.pixel { image-rendering: pixelated; }

.h1 { font-size: clamp(2rem, 6vw, 3rem); font-weight: 800; }
.h2 { font-size: clamp(1.6rem, 4.5vw, 2.3rem); font-weight: 800; }
.h3 { font-size: 1.2rem; font-weight: 700; }
.lead { font-size: 1.1rem; color: var(--text); max-width: 60ch; }

/* text that comes from the Tebex panel (descriptions, custom pages, text box module) */
.text-content > :last-child { margin-bottom: 0; }
.text-content ul { list-style: disc; padding-left: 1.3em; margin: 0 0 1em; }
.text-content ol { list-style: decimal; padding-left: 1.3em; margin: 0 0 1em; }
.text-content img { border-radius: var(--radius); }
.text-content table { border-collapse: collapse; max-width: 100%; display: block; overflow-x: auto; }
.text-content td, .text-content th { border: 1px solid var(--line); padding: 6px 10px; }

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: var(--radius);
  border: 1px solid transparent; background: var(--bg-3); color: var(--text);
  font: 600 .95rem/1.2 var(--font-body); text-decoration: none; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover { color: var(--white); }
.btn:disabled, .btn.is-busy { opacity: .55; cursor: progress; }
.btn-primary { background: var(--accent-2); color: #1a0f26; }
.btn-primary:hover { background: var(--white); color: #1a0f26; }
.btn-secondary { background: transparent; border-color: var(--line-2); }
.btn-secondary:hover { border-color: var(--accent-2); }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent-2); }
.btn-small { min-height: 38px; padding: 7px 12px; font-size: .9rem; }
.btn-large { min-height: 50px; padding: 12px 22px; font-size: 1rem; }
.btn-block { width: 100%; }
.link-btn {
  background: none; border: 0; padding: 4px 2px; color: var(--accent-2); font: inherit; font-size: .9rem;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.link-btn:hover { color: var(--white); }

/* ---------------------------------------------------------------- header */

.site-header { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; align-items: center; gap: 10px; min-height: 64px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); margin-right: auto; }
.brand span { font: 800 1.25rem/1 var(--font-head); }
.brand .brand-sub { font: 500 .95rem/1 var(--font-body); color: var(--muted); }
.brand:hover { color: var(--white); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.site-nav { display: none; width: 100%; order: 3; padding: 4px 0 14px; }
.site-nav.is-open { display: block; }
.site-nav ul { display: flex; flex-direction: column; }
.site-nav a { display: block; padding: 10px 2px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line); }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--accent-2); }
.basket-count {
  display: inline-block; min-width: 24px; padding: 1px 7px; border-radius: 4px; background: var(--accent);
  color: var(--white); font-size: .8rem; text-align: center;
}
.basket-btn { background: var(--bg-3); border-color: var(--line-2); }
.user-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 6px 10px; border-radius: var(--radius);
  border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 600; font-size: .9rem;
}
.user-chip img { border-radius: 3px; }
.user-chip:hover { border-color: var(--accent-2); color: var(--white); }
.user-name { max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 480px) {
  .brand .brand-sub, .user-name, .login-btn { display: none; }
}

@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .site-nav { display: block; width: auto; order: 0; padding: 0; margin-right: 12px; }
  .site-nav ul { flex-direction: row; gap: 22px; }
  .site-nav a { border: 0; padding: 6px 0; font-weight: 500; }
  .site-nav a[aria-current] { box-shadow: inset 0 -2px 0 var(--accent); }
  .nav-only-phone { display: none; }
}

/* ---------------------------------------------------------------- notices from Tebex, toast */

.notice { background: #241838; border-bottom: 1px solid var(--line-2); }
.notice-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
.notice p { margin: 0; }
.notice-danger, .notice-error { background: #3a1420; }
.notice-success { background: #143a26; }

.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 140%); z-index: 60;
  max-width: calc(100% - 32px); padding: 12px 16px; border-radius: var(--radius);
  background: var(--accent-2); color: #1a0f26; font-weight: 600; transition: transform .2s, visibility .2s;
  visibility: hidden;
}
.toast.is-shown { transform: translate(-50%, 0); visibility: visible; }
.toast.is-error { background: #ffd1d7; color: #3a0710; }

/* ---------------------------------------------------------------- server IP */

.ip {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  padding: 12px 12px 12px 16px; margin: 8px 0 22px; max-width: 520px;
  border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--bg-2);
}
.ip-label { width: 100%; font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.ip-value { font: 600 1.15rem/1.2 var(--font-mono); color: var(--white); margin-right: auto; word-break: break-all; }
.ip-wide { max-width: 640px; }

/* ---------------------------------------------------------------- hero */

.hero { padding: 36px 0 40px; }
.hero-grid { display: grid; gap: 36px; }
.hero-grid > * { min-width: 0; }
.hero-logo { margin: 0 0 18px; line-height: 0; }
.hero-logo img { width: min(100%, 520px); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-side { border-top: 1px solid var(--line); padding-top: 22px; }
.side-heading { font: 600 .8rem/1.2 var(--font-body); text-transform: uppercase; letter-spacing: .12em; color: var(--accent-2); margin-bottom: 14px; }

.ladder li {
  display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 2px 12px;
  padding: 12px 0 12px 16px; border-bottom: 1px solid var(--line); position: relative;
}
.ladder li::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px; background: var(--rank); }
.ladder-name { font: 800 1.35rem/1.1 var(--font-head); color: var(--rank); }
.ladder-boost { grid-column: 1; font-size: .9rem; color: var(--muted); }
.ladder-price { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-weight: 600; }
.ladder .top-label { justify-self: start; }
.ladder li.is-top .ladder-name { color: #ff5a5a; }

.top-label {
  display: inline-block; font: 700 .72rem/1 var(--font-body); text-transform: uppercase; letter-spacing: .08em;
  color: #1c1405; background: var(--gold); padding: 4px 7px; border-radius: 3px; vertical-align: middle;
}

.ore-strip { display: grid; grid-template-columns: repeat(5, 1fr); height: 8px; }
.ore-strip span { background: var(--rank); }

@media (min-width: 900px) {
  .hero { padding: 64px 0 72px; }
  .hero-grid { grid-template-columns: 1.25fr .75fr; align-items: center; gap: 64px; }
  .hero-side { border-top: 0; border-left: 1px solid var(--line); padding: 0 0 0 40px; }
}

/* ---------------------------------------------------------------- layout with the sidebar */

.layout { display: grid; gap: 8px 48px; }
.layout-main { min-width: 0; }
.sidebar { padding: 32px 0 56px; border-top: 1px solid var(--line); min-width: 0; }
@media (min-width: 960px) {
  /* desktop: sidebar on the left (it comes after the content in the page, so phones get it below) */
  .layout { grid-template-columns: 248px minmax(0, 1fr); }
  .sidebar { order: -1; padding-top: 56px; border-top: 0; border-right: 1px solid var(--line); padding-right: 28px; }
}
.side-block { padding: 0 0 22px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.side-block:last-child { border-bottom: 0; margin-bottom: 0; }
.side-title { font: 600 .8rem/1.2 var(--font-body); text-transform: uppercase; letter-spacing: .12em; color: var(--accent-2); margin-bottom: 12px; }
.side-empty, .side-small { font-size: .9rem; margin: 0; }
.side-text { font-size: .95rem; }
.side-links li + li { margin-top: 2px; }
.side-links a {
  display: block; padding: 8px 12px; margin: 0 -12px; border-radius: var(--radius); color: var(--text);
  font-weight: 600; text-decoration: none;
}
.side-links a:hover { background: var(--bg-3); color: var(--white); }
.side-links a[aria-current] { background: var(--bg-3); color: var(--accent-2); box-shadow: inset 3px 0 0 var(--accent); }

.donor { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.donor-skin { width: 120px; height: auto; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .35)); }
.donor-name { font: 800 1.25rem/1.2 var(--font-head); color: var(--gold); overflow-wrap: anywhere; text-align: center; }
.donor-note { text-align: center; font-size: .9rem; margin: 8px 0 0; }

.supporters { display: grid; grid-template-columns: repeat(auto-fill, 40px); gap: 8px; }
.supporter { position: relative; width: 40px; height: 40px; border-radius: 4px; cursor: default; }
.supporter img { display: block; width: 40px; height: 40px; border-radius: 4px; image-rendering: pixelated; background: var(--bg-3); }
.supporter:hover img, .supporter:focus-visible img { box-shadow: 0 0 0 2px var(--accent-2); }
.sup-tip {
  position: absolute; z-index: 20; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
  display: none; width: max-content; max-width: 200px; padding: 8px 10px; border-radius: var(--radius);
  background: #241838; border: 1px solid var(--line-2); color: var(--text); font-size: .85rem; line-height: 1.35;
  text-align: center; pointer-events: none;
}
.sup-tip strong { display: block; color: var(--accent-2); }
.sup-tip span { color: var(--muted); }
.supporter:hover .sup-tip, .supporter:focus .sup-tip { display: block; }
@media (max-width: 959px) {
  /* phones: the tip sits above the whole row of heads, so a head at the screen edge never cuts it off */
  .supporters { position: relative; }
  .supporter { position: static; }
  .sup-tip { left: 0; transform: none; max-width: 100%; }
}

.goal-bar { height: 10px; background: var(--bg-3); border-radius: 3px; overflow: hidden; margin-bottom: 8px; }
.goal-bar span { display: block; height: 100%; max-width: 100%; background: var(--accent); }
.goal-image { border-radius: var(--radius); margin-bottom: 10px; }
.featured-name { font-weight: 700; margin-bottom: 4px; }
.error-text { color: var(--danger); }
.server-status { font-size: .95rem; margin: 0; }

/* ---------------------------------------------------------------- sections */

.section { padding-top: 56px; padding-bottom: 8px; }
.section-head { max-width: 70ch; margin-bottom: 20px; }
.section-head p { margin: 0; }
.split .gameplay { margin-top: 8px; }
@media (min-width: 1100px) {
  .split { display: grid; grid-template-columns: 1fr 2fr; gap: 48px; align-items: start; }
}
.join { padding-bottom: 72px; }
.thanks { margin-top: 32px; padding: 16px 18px; border-left: 4px solid var(--ok); background: var(--bg-2); }
.thanks p { margin: 0; }
.home-text { margin-top: 40px; max-width: 70ch; }

/* ---------------------------------------------------------------- Opal packs */

.opal {
  display: block; flex: none; width: 34px; height: 34px; margin: 6px; transform: rotate(45deg);
  background: linear-gradient(135deg, var(--opal-a) 0 50%, var(--opal-b) 50% 100%);
  border: 3px solid #5a3a7a; box-shadow: inset 3px 3px 0 rgba(255, 255, 255, .5);
}
.packs { border-top: 1px solid var(--line); }
.pack {
  display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; align-items: center;
  padding: 18px 0; border-bottom: 1px solid var(--line);
}
.pack-img { width: 40px; height: 40px; object-fit: contain; }
.pack-main { min-width: 0; }
.pack-name { margin: 0; font-size: 1.15rem; font-weight: 700; }
.pack-name a { color: var(--text); text-decoration: none; }
.pack-name a:hover { color: var(--accent-2); text-decoration: underline; }
.pack-amount { font: 800 1.7rem/1 var(--font-head); color: var(--white); margin-right: 2px; }
.pack-extra { margin: 4px 0 0; font-size: .9rem; color: var(--pink); }
.pack-bonus { font-size: .85rem; font-weight: 700; color: var(--accent-2); white-space: nowrap; }
.pack-buy { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.price { font: 700 1.2rem/1 var(--font-head); color: var(--white); }
.price-old { color: var(--muted); font-size: .95rem; margin-right: 6px; }
.not-buyable { font-size: .9rem; }
@media (min-width: 640px) {
  .pack { grid-template-columns: auto 1fr auto; padding: 20px 4px; }
  .pack-buy { grid-column: auto; justify-content: flex-end; gap: 20px; }
  .pack-buy .price-wrap { min-width: 90px; text-align: right; }
}
.after-list { margin-top: 18px; }

/* ---------------------------------------------------------------- what Opals buy */

.spend > .h3 { margin-top: 8px; }
.spend > .h3 + .muted { margin-bottom: 14px; }
.spend-groups { display: grid; gap: 8px 48px; margin-top: 36px; }
.spend-group { padding: 18px 0 8px; border-top: 1px solid var(--line); min-width: 0; }
.spend-group .muted { font-size: .95rem; }
.spend-list div { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.spend-list div:last-child { border-bottom: 0; }
.spend-list dt { min-width: 0; }
.spend-list dd { margin: 0; color: var(--accent-2); white-space: nowrap; font-weight: 600; }
.spend-foot { margin-top: 20px; font-size: .9rem; }
@media (min-width: 760px) { .spend-groups { grid-template-columns: 1fr 1fr; } }


/* ---------------------------------------------------------------- rank table */

.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); -webkit-overflow-scrolling: touch; }
.rank-table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: .92rem; }
.rank-table th, .rank-table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.rank-table tbody tr:last-child > * { border-bottom: 0; }
.rank-table tbody th { font-weight: 500; color: var(--muted); position: sticky; left: 0; background: var(--bg-2); min-width: 130px; }
.rank-table thead th { background: var(--bg-2); }
.rt-corner { position: sticky; left: 0; z-index: 1; }
.rt-rank { border-top: 4px solid var(--rank); }
.rt-name { display: block; font: 800 1.1rem/1.1 var(--font-head); color: var(--rank); }
.rt-rank.is-top .rt-name { color: #ff5a5a; }
.rt-rank .top-label { margin-top: 6px; }
.rt-price td { font-weight: 600; color: var(--white); }
.perk-list li { padding: 2px 0 2px 12px; position: relative; font-size: .88rem; }
.perk-list li::before { content: ''; position: absolute; left: 0; top: 11px; width: 6px; height: 2px; background: var(--accent); }

/* ---------------------------------------------------------------- gameplay list */

.gameplay .gp-item { padding: 16px 0; border-bottom: 1px solid var(--line); }
.gameplay .gp-item:first-child { padding-top: 0; }
.gameplay dt { font: 700 1.1rem/1.3 var(--font-head); margin-bottom: 4px; color: var(--accent-2); }
.gameplay dd { margin: 0; color: var(--text); max-width: 65ch; }

/* ---------------------------------------------------------------- category and package pages */

.page-head { margin-bottom: 18px; }
.page-intro { color: var(--muted); max-width: 65ch; }

.pkg-detail { display: grid; gap: 28px; }
.pkg-detail-media { line-height: 0; }
.pkg-detail-media img { width: 160px; image-rendering: pixelated; }
.opal-big { width: 96px; height: 96px; margin: 28px; border-width: 5px; box-shadow: inset 8px 8px 0 rgba(255, 255, 255, .5); }
.pkg-detail-body { min-width: 0; }
.pkg-detail-body .pack-amount { font-size: inherit; }
.pkg-price-big { margin-bottom: 18px; }
.pkg-price-big .price { font-size: 2rem; }
.buy-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.facts { margin: 24px 0; border-top: 1px solid var(--line); }
.facts div { display: grid; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.facts dt { font-size: .85rem; color: var(--muted); }
.facts dd { margin: 0; }
@media (min-width: 640px) { .facts div { grid-template-columns: 180px 1fr; gap: 16px; } }
@media (min-width: 1100px) { .pkg-detail { grid-template-columns: 200px 1fr; gap: 40px; } }
.prose { max-width: 70ch; }

/* ---------------------------------------------------------------- forms */

input, select {
  min-height: 44px; padding: 8px 12px; border-radius: var(--radius); border: 1px solid var(--line-2);
  background: var(--bg); color: var(--text); font: inherit; max-width: 100%;
}
input:focus-visible, select:focus-visible { border-color: var(--accent-2); }
.login-form label, .field label { display: block; font-weight: 600; margin-bottom: 6px; }
.login-form input { width: 100%; font-family: var(--font-mono); font-size: 1.05rem; margin-bottom: 16px; }
.field { margin-bottom: 18px; }
.field input, .field select { width: 100%; }
.code-row { display: flex; flex-wrap: wrap; gap: 8px; }
.code-row input { flex: 1 1 120px; min-width: 0; }

/* ---------------------------------------------------------------- basket page */

.basket-who { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.basket-who img { border-radius: 3px; }
.basket-items { border-top: 1px solid var(--line); margin-bottom: 18px; }
.basket-item { display: grid; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.bi-main { display: flex; flex-direction: column; min-width: 0; }
.bi-name { font-weight: 600; color: var(--text); text-decoration: none; }
.bi-name:hover { color: var(--accent-2); }
.bi-options { font-size: .88rem; color: var(--muted); }
.bi-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.stepper { display: flex; align-items: center; gap: 6px; }
.bi-qty { width: 64px; text-align: center; }
.bi-price { margin-left: auto; font-weight: 600; }
.basket-form.is-busy { opacity: .6; pointer-events: none; }
.applied-codes li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; padding: 6px 0; }
.totals { margin: 0 0 18px; }
.totals div { display: flex; justify-content: space-between; padding: 4px 0; }
.totals dd { margin: 0; }
.totals .total { font: 700 1.25rem/1.4 var(--font-head); border-top: 1px solid var(--line); padding-top: 10px; margin-top: 6px; }
.fine { font-size: .85rem; margin-top: 12px; }

/* ---------------------------------------------------------------- footer */

.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); padding: 36px 0 28px; margin-top: 40px; }
.footer-inner { display: grid; gap: 20px; }
.footer-brand { display: flex; gap: 12px; align-items: center; }
.footer-brand p { margin: 0; font-size: .9rem; }
.footer-nav ul { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer-small { font-size: .85rem; margin: 0; max-width: 80ch; }
@media (min-width: 860px) { .footer-inner { grid-template-columns: 1fr auto; } .footer-small { grid-column: 1 / -1; } }
