/* RuneGate app pages + cabinet — sits on top of site.css (v2) */

:root {
  /* bridge old PHP class names to v2 tokens */
  --bg: var(--void);
  --bg-2: #0a0d12;
  --ink: var(--snow);
  --ink-soft: #c9d4de;
  --muted: var(--fog);
  --accent: var(--ice);
  --accent-deep: #1b8f86;
  --glow: rgba(94, 231, 216, 0.28);
  --danger: #c45b4a;
  --gold: #f0c456;
  --surface: rgba(10, 14, 20, 0.72);
  --surface-solid: #101820;
}

body.is-app {
  background:
    radial-gradient(900px 420px at 50% -8%, rgba(94, 231, 216, 0.07), transparent 55%),
    linear-gradient(180deg, var(--void) 0%, #0a0d12 100%);
  color: var(--snow);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body.is-app > main { flex: 1 0 auto; }

/* sticky solid nav for app pages */
body.is-app .nav.nav--solid {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(5, 6, 8, 0.94);
}

body.is-app .nav__end {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-left: auto;
}

.nav__text {
  color: var(--fog);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 0.35rem 0.2rem;
}
.nav__text:hover { color: var(--snow); }

.nav__wallet {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 36px;
  padding: 0.25rem 0.7rem 0.25rem 0.45rem;
  border: 1px solid rgba(240, 196, 86, 0.55);
  background: linear-gradient(180deg, rgba(240, 196, 86, 0.18), rgba(18, 14, 6, 0.65));
  color: #ffe7a3;
  line-height: 1;
}
.nav__wallet:hover { color: #fff4c8; border-color: #f6d56a; }
.nav__wallet-coin {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fff8d6, #f0c456 42%, #a06e12 78%);
  box-shadow: 0 0 8px rgba(240, 196, 86, 0.7);
}
.nav__wallet-sum {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  font-size: 0.85rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.nav__wallet-sum i {
  font-style: normal;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #e4c878;
  font-weight: 600;
}

/* undo landing-only table quirks on app pages */
body.is-app .table td:last-child {
  text-align: left;
  color: inherit;
  font-weight: inherit;
}
body.is-app .table th:last-child,
body.is-app .table td.num {
  text-align: right;
}

/* buttons — ensure ghost/primary work outside hero */
body.is-app .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--line-strong);
  background: rgba(5, 6, 8, 0.55);
  color: var(--snow);
  font: 600 0.72rem var(--font);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.2s var(--ease), border-color 0.2s, background 0.2s, color 0.2s;
}
body.is-app .btn:hover {
  transform: translateY(-1px);
  color: var(--void);
  background: linear-gradient(180deg, #7feee4, var(--ice));
  border-color: var(--ice);
}
body.is-app .btn--primary {
  background: linear-gradient(180deg, var(--ice), #1b8f86);
  color: var(--void);
  border-color: transparent;
  box-shadow: 0 8px 28px rgba(94, 231, 216, 0.18);
}
body.is-app .btn--primary:hover {
  background: linear-gradient(180deg, #b7fff6, var(--ice));
  color: var(--void);
}
body.is-app .btn--ghost {
  background: rgba(5, 6, 8, 0.4);
  border-color: rgba(238, 243, 247, 0.18);
  color: var(--ink-soft);
  box-shadow: none;
}
body.is-app .btn--ghost:hover {
  color: var(--ice);
  border-color: var(--ice);
  background: rgba(5, 6, 8, 0.7);
}
body.is-app .btn--sm,
body.is-app .btn--tiny {
  min-height: 34px;
  padding: 0.4rem 0.75rem;
  font-size: 0.64rem;
}
body.is-app .btn--block { width: 100%; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  margin: 0 0 12px;
  letter-spacing: 0.06em;
}
.page { padding: 2.25rem 0 4.5rem; }
.page h1 { font-size: clamp(1.85rem, 4vw, 2.6rem); }
.eyebrow {
  margin: 0 0 8px;
  color: var(--ice);
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}
.lede, .muted { color: var(--fog); }
.lede { max-width: 62ch; margin: 0 0 1.25rem; }
.narrow { max-width: 480px; }

.flash {
  margin: 1rem auto 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  background: rgba(10, 14, 20, 0.75);
}
.flash--ok { border-color: var(--ice-dim); background: rgba(94, 231, 216, 0.08); }
.flash--err { border-color: rgba(196, 91, 74, 0.55); background: rgba(196, 91, 74, 0.1); }

.form { display: grid; gap: 14px; margin: 1.25rem 0; }
.form label {
  display: grid;
  gap: 6px;
  color: var(--fog);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.form input,
.form select,
.form textarea {
  background: rgba(8, 12, 16, 0.85);
  border: 1px solid var(--line);
  color: var(--snow);
  padding: 0.8rem 0.95rem;
  font: inherit;
  border-radius: 0;
}
.form input:focus,
.form select:focus,
.form textarea:focus {
  outline: 0;
  border-color: var(--ice);
  box-shadow: 0 0 0 3px rgba(94, 231, 216, 0.12);
}

.panel, .dl-card, .card, .stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.panel { padding: 1.25rem; }
.panel h2, .panel h3 { font-size: 1.1rem; }
.panel p { color: var(--fog); margin: 0 0 0.75rem; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
  padding: 0.5rem 0 1rem;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th, .table td {
  padding: 0.7rem 0.45rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.table th {
  color: var(--fog);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}
.table tbody tr:hover td { background: rgba(94, 231, 216, 0.04); }
.live { color: var(--ice); font-size: 10px; }

.tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.1rem 0; }
.tabs__item {
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--line);
  color: var(--fog);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: transparent;
}
.tabs__item:hover { color: var(--snow); border-color: rgba(238, 243, 247, 0.28); }
.tabs__item.is-on {
  color: var(--void);
  background: var(--ice);
  border-color: var(--ice);
  font-weight: 700;
}

.list { margin: 0 0 1rem; padding-left: 1.15rem; color: var(--ink-soft); }
.list li { margin: 0.4rem 0; }

.dl-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
  margin: 1.5rem 0 1rem;
}
.dl-card { padding: 1.35rem; }
.dl-card h2 {
  margin: 0.25rem 0 0.65rem;
  font-size: 1.3rem;
}
.dl-card p { color: var(--fog); margin: 0 0 0.85rem; }
.dl-steps {
  margin: 0 0 1rem;
  padding-left: 1.1rem;
  color: var(--ink-soft);
}
.dl-steps li { margin: 0.35rem 0; }
.dl-steps code { color: var(--ice); font-size: 0.86em; }

.about-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 0.5rem 0 1.5rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}
.about-toc a {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fog);
}
.about-toc a:hover { color: var(--ice); }
.about-sec { margin: 2.2rem 0; }
.about-sec > p { color: var(--fog); max-width: 62ch; }

.kv { margin: 0 0 1rem; }
.kv > div {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}
.kv dt { color: var(--fog); }
.kv dd { margin: 0; }

.more {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fog);
}
.more:hover { color: var(--ice); }

/* —— cabinet —— */
.cab {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2rem;
  padding: 2rem 0 4.5rem;
}
.cab__side {
  position: sticky;
  top: 5.5rem;
  align-self: start;
}
.cab__side nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cab__side a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.9rem;
  color: var(--fog);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  border-left: 2px solid transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.cab__side a:hover {
  color: var(--snow);
  background: rgba(94, 231, 216, 0.04);
}
.cab__side a.is-on {
  color: var(--ice);
  border-left-color: var(--ice);
  background: rgba(94, 231, 216, 0.07);
}
.cab__side a svg { flex: 0 0 auto; opacity: 0.85; }
.cab__balance {
  margin-bottom: 1.1rem;
  padding: 1rem;
  border: 1px solid rgba(240, 196, 86, 0.35);
  background: linear-gradient(180deg, rgba(240, 196, 86, 0.1), rgba(10, 12, 16, 0.55));
}
.cab__balance-label {
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #d7b86a;
}
.cab__balance-val {
  font-size: 1.55rem;
  font-weight: 700;
  color: #fff0b8;
  font-variant-numeric: tabular-nums;
}
.cab__balance-val i {
  font-style: normal;
  font-size: 0.7rem;
  color: #e4c878;
  margin-left: 0.25rem;
}
.cab__main { min-width: 0; }
.cab__main > h1 { margin-top: 0.15rem; }

.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.4rem;
}
.stat-card { padding: 1.05rem; }
.stat-card__label {
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fog);
  margin-bottom: 0.3rem;
}
.stat-card__val {
  font-size: 1.4rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.stat-card__val.accent { color: var(--ice); }
.stat-card__val.gold { color: var(--gold); }

.card { padding: 1.25rem; }
.card h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.card p { color: var(--fog); margin: 0; }
.card--link {
  display: block;
  color: inherit;
  transition: border-color 0.2s, transform 0.2s;
}
.card--link:hover {
  color: inherit;
  border-color: var(--ice-dim);
  transform: translateY(-2px);
}
.card--link:hover h3 { color: var(--ice); }

.char-list { list-style: none; padding: 0; margin: 0; }
.char-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}
.char-item__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
}
.char-item__dot.is-on {
  background: var(--ice);
  box-shadow: 0 0 8px var(--glow);
}
.char-item__info strong { display: block; }
.char-item__info span { color: var(--fog); font-size: 0.85rem; }
.char-item__stats {
  color: var(--fog);
  font-size: 0.85rem;
  text-align: right;
}
.char-item__stats .clan { color: var(--ice-dim); }

.shop-price { font-size: 1.1rem; font-weight: 700; color: var(--gold); }
.shop-price small { font-size: 0.7rem; color: #e4c878; font-weight: 500; }
.shop-item { display: flex; flex-direction: column; }
.shop-item > div:last-child { margin-top: auto; }

.donate-row {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 0.85rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
.donate-row time { color: var(--fog); }

.donate-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.donate-preview { color: var(--ice); margin: 0; }
.donate-agree {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.donate-agree input { width: auto; margin-top: 0.25rem; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--line);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.badge--gold {
  color: var(--gold);
  border-color: rgba(240, 196, 86, 0.4);
}
.badge--hero {
  color: #ff8a8a;
  border-color: rgba(255, 107, 107, 0.4);
}

@media (max-width: 860px) {
  .cab { grid-template-columns: 1fr; gap: 1.25rem; }
  .cab__side { position: static; }
  .cab__side nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.35rem;
  }
  .cab__side a {
    padding: 0.55rem 0.7rem;
    border-left: 0;
    border-bottom: 2px solid transparent;
  }
  .cab__side a.is-on { border-bottom-color: var(--ice); }
  .grid-2, .grid-3, .dl-grid { grid-template-columns: 1fr; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .nav__wallet-sum b { font-size: 0.8rem; }
}

@media (max-width: 520px) {
  .stat-cards { grid-template-columns: 1fr; }
  .char-item {
    grid-template-columns: auto 1fr;
  }
  .char-item__stats {
    grid-column: 2;
    text-align: left;
  }
}
