﻿/* ===== Pokémon Voyage V3 — Global Styles ===== */
:root {
  --bg:        #0a0f1e;
  --bg2:       #111827;
  --bg3:       #1a2035;
  --border:    #2d3a5e;
  --border2:   #374151;
  --text:      #e2e8f0;
  --muted:     #94a3b8;
  --blue:      #3b82f6;
  --blue-dark: #1d4ed8;
  --green:     #10b981;
  --gold:      #f59e0b;
  --red:       #ef4444;
  --purple:    #8b5cf6;

  /* Type colours */
  --type-normal:   #9ca3af;
  --type-fire:     #f97316;
  --type-water:    #60a5fa;
  --type-grass:    #4ade80;
  --type-electric: #facc15;
  --type-ice:      #67e8f9;
  --type-fighting: #ef4444;
  --type-poison:   #a855f7;
  --type-ground:   #ca8a04;
  --type-flying:   #93c5fd;
  --type-psychic:  #f472b6;
  --type-bug:      #84cc16;
  --type-rock:     #a16207;
  --type-ghost:    #6d28d9;
  --type-dark:     #78350f;
  --type-dragon:   #7c3aed;
  --type-steel:    #9ca3af;
  --type-fairy:    #f9a8d4;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', Arial, sans-serif;
  min-height: 100vh;
  line-height: 1.5;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Layout ===== */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* Back link used on modcp sub-pages */
.ph-back { display:block; font-size:13px; color:var(--muted); text-decoration:none; margin-bottom:6px; }
.ph-back:hover { color:var(--text); text-decoration:none; }
.page-center {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* ===== Cards ===== */
.card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
}

.card-sm { padding: 14px 16px; }

/* ===== Forms ===== */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.form-group input {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
  padding: 10px 14px;
  outline: none;
  transition: border-color .15s;
}
.form-group input:focus { border-color: var(--blue); }
.form-group input::placeholder { color: var(--muted); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 22px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  text-decoration: none;
}
.btn:hover { opacity: .88; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.btn-primary  { background: var(--blue);       color: white; }
.btn-success  { background: var(--green);       color: white; }
.btn-danger   { background: var(--red);         color: white; }
.btn-ghost    { background: var(--bg2);         color: var(--text); border: 1px solid var(--border); }
.btn-gold     { background: var(--gold);        color: #1a1a1a; }
.btn-full     { width: 100%; }

/* ===== Navbar ===== */
.navbar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar-brand {
  /* Logo replaces the text brand site-wide. The url is relative to this
     stylesheet (assets/style.css), so it resolves the same on every page. */
  display: block;
  width: 188px;
  height: 34px;
  background: url('images/rpg/navbar-logo.png') left center / contain no-repeat;
  text-indent: -9999px;
  overflow: hidden;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
}
@media (max-width: 560px) { .navbar-brand { width: 150px; height: 27px; } }
/* Public pages (.pa-nav: Home/Login/Register/About/Legal/Discord): the links
   wrap on phones, but .navbar's fixed 56px height clipped row 1 and spilled
   row 2 over the hero. Let the bar grow instead. */
@media (max-width: 700px) {
  .navbar:has(.pa-nav) { height: auto; min-height: 56px; flex-wrap: wrap; padding: 8px 12px; }
  .navbar:has(.pa-nav) .pa-nav { gap: 0; row-gap: 2px; }
  .navbar:has(.pa-nav) .pa-nav .nav-link { padding: 6px 9px; font-size: 13px; }
}
.navbar-info {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
  margin-left: auto;
}
.navbar-info .val { color: var(--text); font-weight: 600; }
.navbar-info .money .val { color: var(--green); }
.navbar-info .coins .val { color: var(--gold); }

/* ===== Type badges ===== */
.type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: white;
}
.type-normal   { background: var(--type-normal);   color: #1a1a1a; }
.type-fire     { background: var(--type-fire); }
.type-water    { background: var(--type-water);    color: #1a1a1a; }
.type-grass    { background: var(--type-grass);    color: #1a1a1a; }
.type-electric { background: var(--type-electric); color: #1a1a1a; }
.type-ice      { background: var(--type-ice);      color: #1a1a1a; }
.type-fighting { background: var(--type-fighting); }
.type-poison   { background: var(--type-poison); }
.type-ground   { background: var(--type-ground); }
.type-flying   { background: var(--type-flying);   color: #1a1a1a; }
.type-psychic  { background: var(--type-psychic); }
.type-bug      { background: var(--type-bug);      color: #1a1a1a; }
.type-rock     { background: var(--type-rock); }
.type-ghost    { background: var(--type-ghost); }
.type-dark     { background: var(--type-dark); }
.type-dragon   { background: var(--type-dragon); }
.type-steel    { background: var(--type-steel);    color: #1a1a1a; }
.type-fairy    { background: var(--type-fairy);    color: #1a1a1a; }

/* ===== Roster card — canonical standard (all pages must match) ===== */
.roster-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  text-align: center;
}
.roster-card .rc-head {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 9px 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.roster-card .rc-body {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 150px;
  background: var(--bg);
}
.roster-card .rc-body img {
  max-width: 168px;
  max-height: 150px;
  image-rendering: pixelated;
  object-fit: contain;
}
.roster-card .rc-foot {
  background: var(--bg3);
  border-top: 1px solid var(--border);
  padding: 10px 14px;
  text-align: center;
  font-size: 13px;
  line-height: 2;
  color: var(--text);
}

/* ===== Pokémon sprite card ===== */
.poke-card {
  background: var(--bg2);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 14px 10px 10px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
  user-select: none;
}
.poke-card:hover { border-color: var(--blue); background: var(--bg3); }
.poke-card.selected { border-color: var(--blue); background: #1e3a5a; box-shadow: 0 0 0 3px rgba(59,130,246,.3); }
.poke-card img { max-width: 96px; max-height: 80px; object-fit: contain; image-rendering: pixelated; }
.poke-card .poke-name { font-size: 13px; font-weight: 700; margin: 6px 0 4px; }
.poke-card .poke-types { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; }

/* ===== Feature nav grid ===== */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.feature-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 14px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  transition: border-color .15s, background .15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.feature-card:hover { border-color: var(--blue); background: #1a2540; text-decoration: none; }
.feature-card.disabled { opacity: .45; pointer-events: none; }
.feature-card .icon { font-size: 32px; line-height: 1; }
.feature-card .label { font-size: 14px; font-weight: 600; color: var(--text); }
.feature-card .sublabel { font-size: 11px; color: var(--muted); }

/* ===== Rank badge ===== */
.rank-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.rank-trainer         { background: #374151; color: #9ca3af; }
.rank-assistant       { background: #451a03; color: #fbbf24; }
.rank-moderator       { background: #1e3a5a; color: #60a5fa; }
.rank-super_moderator { background: #3b1f6e; color: #a78bfa; }
.rank-administrator   { background: #7c1d1d; color: #fca5a5; }
.rank-banned          { background: #1c1917; color: #78716c; }

/* ===== Alerts ===== */
.alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-top: 12px;
}
.alert-error   { background: #2d1515; border: 1px solid #7f1d1d; color: #fca5a5; }
.alert-success { background: #0d2d1f; border: 1px solid #14532d; color: #6ee7b7; }

/* ===== Misc ===== */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.text-muted { color: var(--muted); font-size: 13px; }
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; }

/* ===== Tabs ===== */
.tab-list {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.tab-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.tab-btn:hover { border-color: var(--blue); color: var(--text); }
.tab-btn.active { background: var(--blue-dark); border-color: var(--blue); color: white; }

/* ===== Nav dropdown links ===== */
.nav-links {
  display: flex;
  align-items: stretch;
  gap: 2px;
  flex: 1;
  justify-content: center;
  margin-left: 0;
}
.nav-link {
  display: flex;
  align-items: center;
  padding: 0 10px;
  height: 56px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s, background .15s;
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}
.nav-link:hover { color: var(--text); background: rgba(255,255,255,.05); text-decoration: none; }

.nav-dropdown { position: relative; display: flex; align-items: stretch; }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 0 0 8px 8px;
  min-width: 190px;
  z-index: 500;
  padding: 4px 0;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.nav-dropdown-menu.open,
.nav-dropdown:hover .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
  display: block;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  transition: color .15s, background .15s;
  text-decoration: none;
}
.nav-dropdown-menu a:hover { color: var(--text); background: var(--bg3); text-decoration: none; }
.nav-dropdown-menu a.cs { opacity: .4; pointer-events: none; }
.nav-dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }
/* Mobile hamburger (injected by sidebar.js; hidden on desktop) */
.nav-hamburger { display: none; position: relative; margin-left: auto; width: 40px; height: 40px; padding: 0; background: none; border: none; color: var(--text); font-size: 20px; line-height: 1; cursor: pointer; align-items: center; justify-content: center; flex-shrink: 0; }
/* Red waiting-count badge on the mobile "Menu" button (notifications live in
   the drawer on phones - the desktop sidebar that hosts them is hidden) */
.mob-notif-badge {
  position: absolute; top: -2px; right: -6px;
  min-width: 16px; height: 16px; line-height: 16px; padding: 0 4px;
  background: #ef4444; color: #fff; border-radius: 9px;
  font-size: 10px; font-weight: 800; text-align: center; display: none;
}

/* ===== Sidebar ===== */
.sidebar-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
}
.sidebar-card-head {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}
.sidebar-card-body { padding: 12px; font-size: 13px; }

/* 1024px (was 860): desktop-mode phones render ~980px wide, where the
   centered nav links ran underneath the sidebar's theme toggle. Below
   1024 the layout genuinely doesn't fit, so use the drawer. */
@media (max-width: 1024px) {
  .nav-links { display: none; }
  .navbar-info .label { display: none; }
  .nav-hamburger { display: flex; }
  /* Tapped-open mobile menu: full-width vertical panel below the navbar, with
     the hover dropdowns shown expanded inline (no hover on touch devices). */
  .nav-links.mobile-open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    position: fixed;
    top: 56px; left: 0; right: 0;
    max-height: calc(100vh - 56px);
    overflow-y: auto;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 24px rgba(0,0,0,.5);
    padding: 4px 0 10px;
    z-index: 200;
    gap: 0;
  }
  .nav-links.mobile-open .nav-link { height: auto; padding: 13px 20px; font-size: 15px; }
  .nav-links.mobile-open .nav-dropdown { flex-direction: column; align-items: stretch; }
  .nav-links.mobile-open .nav-dropdown > .nav-link { color: var(--text); font-weight: 800; }
  .nav-links.mobile-open .nav-dropdown-menu {
    display: block; position: static; min-width: 0;
    border: none; box-shadow: none; border-radius: 0; padding: 0;
    background: var(--bg);
  }
  .nav-links.mobile-open .nav-dropdown-menu a { padding: 11px 20px 11px 36px; font-size: 14px; }
  .nav-links.mobile-open .nav-dropdown-divider { margin: 0; }
}

@media (max-width: 600px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .container { padding: 0 12px; }
  .card { padding: 16px; }
}

/* ===== Global Sidebar ===== */
.pv-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 204px;
  bottom: 0;
  overflow-y: auto;
  border-left: 1px solid var(--border);
  background: var(--bg2);
  z-index: 90;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform .25s ease;
}
/* Keep every card at its natural height: without this, a flex column that's
   taller than the viewport SHRINKS its children (squashing the money value,
   clipping the last event card) instead of scrolling. flex-shrink:0 forces the
   overflow to scroll via the sidebar's overflow-y:auto. */
.pv-sidebar > * { flex-shrink: 0; }
.pv-sidebar.collapsed { transform: translateX(100%); }
body.has-sidebar { padding-right: 204px; transition: padding-right .25s ease; }
body.has-sidebar.sidebar-collapsed { padding-right: 0; }

.psb-collapse-btn {
  margin-top: auto;
  flex-shrink: 0;
  width: 100%;
  padding: 7px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s, color .15s;
}
.psb-collapse-btn:hover { border-color: var(--blue); color: var(--text); }

.psb-expand-tab {
  position: fixed;
  right: 0;
  bottom: 80px;
  width: 28px;
  height: 48px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 8px 0 0 8px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 91;
  color: var(--text);
  font-size: 14px;
  padding: 0;
  font-family: inherit;
  transition: border-color .15s, background .15s;
}
.psb-expand-tab:hover { border-color: var(--blue); background: var(--bg3); }
.psb-expand-tab.visible { display: flex; }

.psb-clock-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  text-align: center;
}
.psb-time { font-size: 20px; font-weight: 800; letter-spacing: .02em; }
.psb-date { font-size: 11px; color: var(--muted); margin-top: 2px; }

.psb-pokemon-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.psb-head {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 7px 12px;
  font-size: 10px; font-weight: 700;
  color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em;
  text-align: center;
}
.psb-sprite-box {
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  height: 150px;
}
.psb-sprite-box img {
  max-width: 168px; max-height: 150px;
  image-rendering: pixelated;
  object-fit: contain;
}
.psb-info { padding: 10px 12px 12px; }
.psb-name   { font-size: 16px; font-weight: 800; text-align: center; margin-bottom: 2px; }
.psb-gender { font-size: 14px; font-weight: 900; color: var(--muted); text-align: center; margin-bottom: 2px; }
.gsym { font-weight: 900; font-size: 1.1em; }
.psb-lv     { font-size: 13px; font-weight: bold; color: var(--muted); text-align: center; margin-bottom: 8px; }
.psb-bar-wrap {
  background: var(--bg);
  border-radius: 4px; height: 6px; overflow: hidden; margin-bottom: 5px;
}
.psb-bar-fill {
  height: 100%; background: var(--blue); border-radius: 4px; transition: width .3s;
}
.psb-xp-lbl { font-size: 13px; color: var(--muted); text-align: center; font-weight: bold; }

.psb-notif-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.psb-notif-head {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 7px 12px;
  font-size: 10px; font-weight: 700;
  color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em;
  text-align: center;
}
.psb-notif-list { padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.psb-notif-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 10px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 7px; text-decoration: none;
  font-size: 12px; font-weight: 600; color: var(--text);
  transition: border-color .12s, background .12s;
  gap: 8px;
}
.psb-notif-item:hover { border-color: var(--blue); background: rgba(59,130,246,.08); text-decoration: none; }
.psb-notif-count {
  font-size: 11px; font-weight: 800;
  background: var(--blue); color: #fff;
  border-radius: 10px; padding: 1px 7px;
  flex-shrink: 0;
}

.psb-event-item {
  display: flex; align-items: center;
  padding: 7px 10px;
  background: rgba(52,211,153,.08); border: 1px solid rgba(52,211,153,.35);
  border-radius: 7px;
  font-size: 12px; font-weight: 700; color: var(--green, #34d399);
  gap: 8px;
}
.psb-event-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green, #34d399); flex-shrink: 0;
}

.psb-staff-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.psb-head-staff { color: #fca5a5; border-bottom-color: #7f1d1d; background: #2d1515; }
.psb-staff-links { padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.psb-staff-link {
  display: block;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 12px; font-weight: 600;
  color: var(--text);
  background: var(--bg2);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: border-color .15s, background .15s;
}
.psb-staff-link:hover { border-color: #ef4444; background: #2d1515; text-decoration: none; }

@media (max-width: 1024px) {
  .pv-sidebar { display: none; }
  body.has-sidebar { padding-right: 0; }
  .psb-expand-tab { display: none !important; }
}

/* ===== Staff Left Sidebar ===== */
.pv-staff-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 204px;
  bottom: 0;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: var(--bg2);
  z-index: 90;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform .25s ease;
}
.pv-staff-sidebar.collapsed { transform: translateX(-100%); }
body.has-staff-sidebar { padding-left: 204px; transition: padding-left .25s ease; }
body.has-staff-sidebar.staff-sidebar-collapsed { padding-left: 0; }

.pss-navbar-slot {
  height: 56px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin: -12px -12px 0 -12px;
  padding: 0 14px;
  border-bottom: 1px solid #7f1d1d;
  background: #2d1515;
}
.pss-title {
  font-size: 11px;
  font-weight: 700;
  color: #fca5a5;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.pss-section-label {
  font-size: 10px;
  font-weight: 700;
  color: #fca5a5;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 4px 14px 2px;
  opacity: .7;
}

.pss-collapse-btn {
  margin-top: auto;
  flex-shrink: 0;
  width: 100%;
  padding: 7px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s, color .15s;
}
.pss-collapse-btn:hover { border-color: #ef4444; color: var(--text); }

.pss-expand-tab {
  position: fixed;
  left: 0;
  bottom: 80px;
  width: 28px;
  height: 48px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 8px 8px 0;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 91;
  color: var(--text);
  font-size: 14px;
  padding: 0;
  font-family: inherit;
  transition: border-color .15s, background .15s;
}
.pss-expand-tab:hover { border-color: #ef4444; background: var(--bg3); }
.pss-expand-tab.visible { display: flex; }

@media (max-width: 1024px) {
  .pv-staff-sidebar { display: none; }
  body.has-staff-sidebar { padding-left: 0; }
  .pss-expand-tab { display: none !important; }
}

/* ===== Sidebar navbar slot (theme toggle, top of sidebar) ===== */
.psb-navbar-slot {
  position: relative;
  height: 56px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin: -12px -12px 0 -12px;
  padding: 0 10px;
  border-bottom: 1px solid var(--border);
}
.psb-theme-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s, background .15s;
}
.psb-theme-toggle:hover { border-color: var(--blue); }
.psb-theme-swatch {
  width: 12px; height: 12px; border-radius: 50%;
  border: 1px solid var(--border2); flex-shrink: 0;
}
.psb-theme-menu {
  position: absolute;
  top: 52px; left: 10px; right: 10px;
  z-index: 120;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
  display: none;
}
.psb-theme-menu.open { display: block; }
.psb-theme-item {
  width: 100%;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  background: none; border: none; border-radius: 7px;
  color: var(--text); font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: inherit; text-align: left;
}
.psb-theme-item:hover { background: var(--bg3); }
.psb-theme-item.active { background: var(--bg3); color: var(--blue); }

/* ===== Trainer card widget ===== */
.tcw-header {
  padding: 10px 14px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}
.tcw-name { font-size: 14px; font-weight: 800; }
.tcw-body {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--bg);
}
.tcw-avatar {
  width: 80px; height: 80px;
  border-radius: 8px;
  border: 2px solid var(--border);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
  background: var(--bg3);
  flex-shrink: 0;
}
.tcw-avatar img { width: 100%; height: 100%; object-fit: cover; }
.tcw-meta     { display: flex; flex-direction: column; gap: 6px; }
.tcw-username { font-size: 15px; font-weight: 800; }
.tcw-id       { font-size: 12px; color: var(--muted); font-weight: 700; }

/* Rank-tinted headers */
.tcw-head-administrator   { background: #7c1d1d; color: #fca5a5; border-bottom-color: #9b2c2c; }
.tcw-head-super_moderator { background: #3b1f6e; color: #a78bfa; border-bottom-color: #4c2889; }
.tcw-head-moderator       { background: #1e3a5a; color: #60a5fa; border-bottom-color: #234d75; }
.tcw-head-assistant       { background: #451a03; color: #fbbf24; border-bottom-color: #78350f; }


/* ===== Footer ===== */
.pv-footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 18px 24px 20px;
  margin-top: 40px;
}
.pv-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.pv-footer-copy {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.7;
}
.pv-footer-author { color: inherit; font-weight: inherit; }
.pv-footer-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.pv-footer-links a { font-size: 11px; color: var(--muted); text-decoration: none; }
.pv-footer-links a:hover { color: var(--text); text-decoration: underline; }
.pv-footer-sep { color: var(--border); font-size: 11px; }

/* ===== Mobile Nav ===== */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 10px 6px;
  margin-left: auto;
  font-family: inherit;
  flex-shrink: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.mobile-nav-overlay {
  display: none;
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(0,0,0,.55);
  z-index: 999;
}
.mobile-nav-overlay.open { display: block; }
body.mob-nav-open { overflow: hidden !important; }
.mob-drawer {
  position: absolute;
  top: 0; left: 0;
  width: 280px;
  max-width: 85vw;
  bottom: 0;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
}
.mob-drawer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 56px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.mob-drawer-title { font-size: 16px; font-weight: 800; color: var(--blue); }
.mob-drawer-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  line-height: 1;
  font-family: inherit;
}
.mob-drawer-close:hover { color: var(--text); }
.mob-drawer-body { padding: 8px; flex: 1; }
.mob-section {
  font-size: 11px;
  font-weight: 800;
  color: var(--gold, #fbbf24);   /* was --muted: too faint on mobile */
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 12px 10px 4px;
}
/* Collapsible section headers (nav groups in the mobile drawer) */
button.mob-sec-toggle {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; background: none; border: none; cursor: pointer;
  font-family: inherit; text-align: left;
}
.mob-sec-arrow { font-size: 12px; color: var(--muted); margin-left: 8px; }
.mob-status-utc {
  font-size: 9px; font-weight: 700; color: var(--muted);
  margin-left: 5px; letter-spacing: .06em; vertical-align: middle;
}
.mob-link {
  display: block;
  padding: 9px 12px;
  border-radius: 7px;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  transition: background .12s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.mob-link:hover { background: var(--bg3); text-decoration: none; }
.mob-link.mob-cs { opacity: .45; pointer-events: none; }
.mob-link-direct {
  font-weight: 700;
  color: var(--blue);
  margin-top: 4px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  padding-bottom: 12px;
}
.mob-divider { height: 1px; background: var(--border); margin: 4px 10px; }

/* Mobile drawer status cards (time / money / partner pokemon / theme) */
.mob-status-card {
  margin: 4px 8px 8px;
  padding: 10px 12px;
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
}
.mob-status-time { display: flex; align-items: baseline; justify-content: space-between; font-size: 16px; font-weight: 800; }
.mob-status-date { font-size: 11px; font-weight: 600; color: var(--muted); }
.mob-status-money { margin-top: 6px; font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; }
.mob-status-money strong { color: var(--green, #34d399); font-size: 14px; }
.mob-partner { display: flex; gap: 12px; align-items: center; }
.mob-partner-sprite { width: 64px; height: 64px; object-fit: contain; image-rendering: pixelated; flex-shrink: 0; }
.mob-partner-info { flex: 1; min-width: 0; }
.mob-partner-name { font-weight: 800; font-size: 14px; }
.mob-partner-gender { font-weight: 600; }
.mob-partner-lv { font-size: 12px; color: var(--muted); margin-top: 2px; }
.mob-partner-bar { height: 6px; border-radius: 4px; background: var(--bg3); margin-top: 6px; overflow: hidden; }
.mob-partner-fill { height: 100%; border-radius: 4px; background: var(--blue); }
.mob-partner-xp { font-size: 10px; color: var(--muted); margin-top: 3px; }
.mob-theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 4px 8px 12px; }
.mob-theme-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 12px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.mob-theme-btn.active { border-color: var(--blue); background: var(--bg3); }

@media (max-width: 1024px) {
  .nav-hamburger { display: flex; align-items: center; }
}

/* ===== Light mode ===== */
/* Gold — dark theme with warm gold accents. Replaced the old light/cream
   palette (key stays "light" so saved preferences keep working). All themes
   are dark now, so sprites are always visible; sprite boxes that opt in via
   background: var(--sprite-panel, var(--bg)) simply fall back to var(--bg). */
[data-theme="light"] {
  --bg:        #14100a;
  --bg2:       #1d1810;
  --bg3:       #292013;
  --border:    #4a3c1e;
  --border2:   #5c4a26;
  --text:      #f0e6cf;
  --muted:     #b09d72;
  --blue:      #ca8a04;
  --blue-dark: #a16207;
  --green:     #34d399;
  --gold:      #fbbf24;
  --red:       #f87171;
  --purple:    #a78bfa;
}

[data-theme="midnight"] {
  --bg:        #05060a;
  --bg2:       #0b0d14;
  --bg3:       #12151f;
  --border:    #232838;
  --border2:   #2e3447;
  --text:      #e5e7eb;
  --muted:     #8b93a7;
  --blue:      #3b82f6;
  --blue-dark: #1d4ed8;
  --green:     #10b981;
  --gold:      #f59e0b;
  --red:       #ef4444;
  --purple:    #8b5cf6;
}

[data-theme="ocean"] {
  --bg:        #041620;
  --bg2:       #082230;
  --bg3:       #0d3040;
  --border:    #1c4d60;
  --border2:   #275b70;
  --text:      #dcf0f5;
  --muted:     #7fa8b5;
  --blue:      #0891b2;
  --blue-dark: #0e7490;
  --green:     #34d399;
  --gold:      #fbbf24;
  --red:       #f87171;
  --purple:    #a78bfa;
}

[data-theme="forest"] {
  --bg:        #0a120b;
  --bg2:       #101b12;
  --bg3:       #16261a;
  --border:    #2b4531;
  --border2:   #35543c;
  --text:      #e2ece3;
  --muted:     #8fa893;
  --blue:      #059669;
  --blue-dark: #047857;
  --green:     #4ade80;
  --gold:      #eab308;
  --red:       #f87171;
  --purple:    #a78bfa;
}

[data-theme="rocket"] {
  --bg:        #120a0d;
  --bg2:       #1a1014;
  --bg3:       #24161c;
  --border:    #45222e;
  --border2:   #542a38;
  --text:      #f0e7ea;
  --muted:     #ab929b;
  --blue:      #e11d48;
  --blue-dark: #9f1239;
  --green:     #34d399;
  --gold:      #fbbf24;
  --red:       #ef4444;
  --purple:    #c084fc;
}

/* Shared wiki top bar (wiki.html + all wiki tool pages) */
.wiki-header { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 56px; padding: 0 20px; background: var(--bg2); border-bottom: 1px solid var(--border); }
.wiki-brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 900; color: var(--text); text-decoration: none; }
.wiki-brand-mark { font-size: 20px; }
.wiki-header-right { display: flex; align-items: center; gap: 10px; }
.wiki-staff-link, .wiki-submit-btn { font-size: 13px; font-weight: 700; text-decoration: none; border: 1px solid var(--border); border-radius: 8px; padding: 6px 12px; cursor: pointer; background: none; font-family: inherit; color: var(--muted); }
.wiki-staff-link:hover { color: var(--text); border-color: var(--blue); }
.wiki-submit-btn { border-color: var(--blue); color: var(--blue); }
.wiki-submit-btn:hover { background: var(--blue); color: #fff; }

/* iOS: double-tapping the page background zooms in - players spam-tapping
   near the attack button kept triggering it mid-battle (BEN & Mystoria,
   2026-07-26). manipulation keeps pinch-zoom and panning but drops the
   double-tap-to-zoom gesture, game-wide. */
body, body * { touch-action: manipulation; }
