/* ============================================================
   Re-Blox stylesheet
   2006-era web flair (gradients, glossy buttons, dotted borders,
   Tahoma) on a 2011-2012 Roblox-style page layout, with a
   light/dark theme toggle.
   ============================================================ */

:root {
  /* Page surfaces */
  --bg-base:        #e6eef8;
  --bg-stripe:      #dde6f3;
  --bg-panel:       #ffffff;
  --bg-panel-soft:  #fafcff;
  --bg-input:       #ffffff;

  /* Text */
  --color-text:        #222222;
  --color-text-strong: #111111;
  --color-muted:       #666666;
  --color-link:        #1a4f9c;
  --color-link-hover:  #ff8800;

  /* Accents (kept the same in both themes) */
  --color-blue-1:    #06407a;
  --color-blue-2:    #022a55;
  --color-blue-3:    #001735;
  --color-yellow-1:  #ffee88;
  --color-yellow-2:  #ffd744;
  --color-yellow-3:  #f0b800;
  --color-yellow-4:  #d49a00;
  --color-accent:    #ffcc00;

  /* Borders / shadows */
  --border-panel:   #5b7aa9;
  --border-soft:    #b6c6e0;
  --border-dotted:  #c9d4e6;
  --shadow-panel:   0 2px 4px rgba(0,0,0,0.15);
  --shadow-inset:   inset 0 1px 0 #ffffff;

  /* Card surfaces (games / catalog) */
  --bg-card:        linear-gradient(to bottom, #fcfdff 0%, #e9efff 100%);
  --bg-card-hover:  linear-gradient(to bottom, #fff8d8 0%, #ffe97a 100%);
  --bg-thumb:       linear-gradient(135deg, #6f9bd7 0%, #2768b8 100%);

  /* Body striped background */
  --body-bg:
    repeating-linear-gradient(
      0deg,
      var(--bg-base) 0px,
      var(--bg-base) 2px,
      var(--bg-stripe) 2px,
      var(--bg-stripe) 4px
    );
}

[data-theme="dark"] {
  --bg-base:        #161b27;
  --bg-stripe:      #1b2230;
  --bg-panel:       #232a3a;
  --bg-panel-soft:  #1c2230;
  --bg-input:       #2a3242;

  --color-text:        #e6e9f1;
  --color-text-strong: #ffffff;
  --color-muted:       #8a92a6;
  --color-link:        #7fb6ff;
  --color-link-hover:  #ffcc55;

  --border-panel:   #3a4358;
  --border-soft:    #2c3346;
  --border-dotted:  #2c3346;
  --shadow-panel:   0 2px 6px rgba(0,0,0,0.5);
  --shadow-inset:   inset 0 1px 0 rgba(255,255,255,0.08);

  --bg-card:        linear-gradient(to bottom, #2a3242 0%, #1d2433 100%);
  --bg-card-hover:  linear-gradient(to bottom, #3a4258 0%, #232b3d 100%);
  --bg-thumb:       linear-gradient(135deg, #1a3a6e 0%, #0a1a3a 100%);

  --body-bg: var(--bg-base);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: Tahoma, Verdana, Arial, sans-serif;
  font-size: 12px;
  color: var(--color-text);
  background: var(--body-bg);
  min-height: 100%;
}

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

img { border: 0; }

/* ---------- Top bar ---------- */

.topbar {
  width: 100%;
  background: linear-gradient(to bottom, var(--color-blue-1) 0%, var(--color-blue-2) 50%, var(--color-blue-3) 100%);
  border-bottom: 2px solid var(--color-accent);
  box-shadow: 0 2px 0 #aa8800, 0 4px 6px rgba(0,0,0,0.3);
  color: #fff;
  font-size: 12px;
}

.topbar-row {
  max-width: 1280px;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  font-family: "Trebuchet MS", Tahoma, sans-serif;
  font-size: 26px;
  font-weight: bold;
  color: #fff;
  text-decoration: none;
  letter-spacing: -1px;
  text-shadow: 0 1px 0 #001229, 1px 2px 4px rgba(0,0,0,0.6);
  line-height: 1;
}
.brand .brand-accent { color: var(--color-accent); }
.brand-tagline {
  display: block;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 9px;
  font-weight: normal;
  color: #cfe0ff;
  letter-spacing: 0;
  text-shadow: 0 1px 0 rgba(0,0,0,0.5);
  margin-top: 1px;
}

.topnav {
  display: flex;
  gap: 2px;
  margin-left: 12px;
  flex: 1;
}
.topnav a {
  display: inline-block;
  padding: 7px 13px;
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  border-radius: 3px 3px 0 0;
  text-shadow: 0 1px 0 rgba(0,0,0,0.5);
  border-bottom: 2px solid transparent;
}
.topnav a:hover {
  background: linear-gradient(to bottom, #1a66b2, #094279);
  color: #ffe97a;
}
.topnav a.active {
  background: linear-gradient(to bottom, var(--color-yellow-1), var(--color-yellow-2));
  color: #4a3300;
  border-bottom-color: var(--color-yellow-4);
  text-shadow: 0 1px 0 rgba(255,255,255,0.4);
}

.topbar-search {
  display: flex;
  align-items: stretch;
}
.topbar-search input {
  border: 1px solid #0a2855;
  border-right: 0;
  padding: 4px 8px;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 12px;
  width: 160px;
  background: #fff;
  color: #222;
  border-radius: 3px 0 0 3px;
}
.topbar-search button {
  border: 1px solid #0a2855;
  background: linear-gradient(to bottom, var(--color-yellow-1), var(--color-yellow-2) 50%, var(--color-yellow-3) 50%, var(--color-yellow-4));
  color: #4a3300;
  font-weight: bold;
  font-size: 11px;
  padding: 0 10px;
  cursor: pointer;
  border-radius: 0 3px 3px 0;
  text-shadow: 0 1px 0 rgba(255,255,255,0.4);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.me-name {
  color: var(--color-accent);
  font-weight: bold;
  text-shadow: 0 1px 0 rgba(0,0,0,0.5);
}
.me-greeting {
  color: #fff;
  font-size: 12px;
  text-shadow: 0 1px 0 rgba(0,0,0,0.4);
  white-space: nowrap;
}
.me-greeting strong { color: var(--color-accent); }

.robux-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  background: linear-gradient(to bottom, #2a8b2a, #155515);
  border: 1px solid #073007;
  border-radius: 9px;
  color: #fff;
  font-weight: bold;
  font-size: 11px;
  text-shadow: 0 -1px 0 rgba(0,0,0,0.4);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.3);
}
.robux-pill::before {
  content: "R$";
  color: var(--color-accent);
  font-family: Georgia, serif;
  font-style: italic;
}

/* Theme toggle button in the topbar */
.theme-toggle {
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 3px;
  cursor: pointer;
  text-shadow: 0 1px 0 rgba(0,0,0,0.4);
}
.theme-toggle:hover { background: rgba(0,0,0,0.4); }

/* ---------- Sub-nav strip ---------- */

.subnav {
  background: linear-gradient(to bottom, #f5f5f5 0%, #d8d8d8 100%);
  border-bottom: 1px solid #888;
  font-size: 11px;
}
[data-theme="dark"] .subnav {
  background: linear-gradient(to bottom, #232a3a 0%, #161b27 100%);
  border-bottom-color: #000;
  color: #cfd6e6;
}
.subnav-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 4px 12px;
  color: #444;
}
[data-theme="dark"] .subnav-inner { color: #cfd6e6; }
.subnav a { color: var(--color-link); margin: 0 6px; }

/* ---------- Page layout ---------- */

.page {
  max-width: 1120px;
  margin: 22px auto;
  padding: 0 16px 32px;
}
.page.narrow { max-width: 600px; }
.page.wide   { max-width: 1280px; }

.row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.row > .panel { flex: 1 1 0; min-width: 260px; }
.row > .col-1 { flex: 0 0 280px; }
.row > .col-2 { flex: 1 1 0; }
.row > .col-side { flex: 0 0 200px; }
.row > .col-main { flex: 1 1 0; }

/* ---------- Panels ---------- */

.panel {
  background: var(--bg-panel);
  color: var(--color-text);
  border: 1px solid var(--border-panel);
  border-radius: 6px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-inset), var(--shadow-panel);
  overflow: hidden;
}

.panel-header {
  padding: 6px 12px;
  font-weight: bold;
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.5px;
  background: linear-gradient(to bottom, #2d6fb8 0%, #1a4f9c 50%, #0e3a7a 100%);
  border-bottom: 1px solid #0a2855;
  text-shadow: 0 1px 0 rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.panel-header .panel-actions { font-size: 10px; font-weight: normal; }
.panel-header .panel-actions a { color: #ffe97a; }

.panel-body {
  padding: 12px;
  line-height: 1.5;
}

.panel-tight .panel-body { padding: 0; }

/* ---------- Hero (homepage) ---------- */

.hero {
  background:
    linear-gradient(to bottom, rgba(255,255,255,0.85), rgba(255,255,255,0.75)),
    repeating-linear-gradient(135deg, var(--color-yellow-1) 0 12px, var(--color-yellow-2) 12px 24px);
  border: 1px solid #d4b400;
  border-radius: 8px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-inset), var(--shadow-panel);
}
[data-theme="dark"] .hero {
  background:
    linear-gradient(to bottom, rgba(35,42,58,0.85), rgba(28,34,48,0.75)),
    repeating-linear-gradient(135deg, #3a3000 0 12px, #4d3f00 12px 24px);
  border-color: #5a4a00;
}
.hero-inner {
  padding: 24px 28px;
  text-align: center;
}
.hero-title {
  margin: 0 0 8px;
  font-family: "Trebuchet MS", Tahoma, sans-serif;
  font-size: 28px;
  color: #0e3a7a;
  text-shadow: 1px 1px 0 #fff, 2px 2px 4px rgba(0,0,0,0.15);
}
[data-theme="dark"] .hero-title {
  color: #ffe97a;
  text-shadow: 1px 1px 0 #000, 2px 2px 4px rgba(0,0,0,0.5);
}
.hero-blurb {
  margin: 0 auto 16px;
  max-width: 540px;
  color: var(--color-text);
}
.hero-cta { display: flex; gap: 10px; justify-content: center; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: 5px 14px;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 11px;
  font-weight: bold;
  text-decoration: none;
  border: 1px solid #444;
  border-radius: 3px;
  cursor: pointer;
  color: #222;
  background: linear-gradient(to bottom, #fafafa 0%, #ddd 50%, #bbb 50%, #ccc 100%);
  text-shadow: 0 1px 0 rgba(255,255,255,0.6);
  box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(0,0,0,0.2);
}
[data-theme="dark"] .btn {
  color: #e6e9f1;
  border-color: #000;
  background: linear-gradient(to bottom, #4d556a 0%, #383f52 50%, #1f2535 50%, #2a3142 100%);
  text-shadow: 0 -1px 0 rgba(0,0,0,0.4);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), 0 1px 2px rgba(0,0,0,0.4);
}
.btn:hover { filter: brightness(1.07); }
.btn:active {
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
  transform: translateY(1px);
}

.btn-blue {
  color: #fff;
  border-color: #0a2855;
  background: linear-gradient(to bottom, #4a8bd8 0%, #2768b8 50%, #144f95 50%, #0e3a7a 100%);
  text-shadow: 0 -1px 0 rgba(0,0,0,0.4);
}

.btn-yellow {
  color: #4a3300;
  border-color: #a98800;
  background: linear-gradient(to bottom, var(--color-yellow-1) 0%, var(--color-yellow-2) 50%, var(--color-yellow-3) 50%, var(--color-yellow-4) 100%);
  text-shadow: 0 1px 0 rgba(255,255,255,0.5);
}

.btn-green {
  color: #fff;
  border-color: #073007;
  background: linear-gradient(to bottom, #6cca6c 0%, #3aaa3a 50%, #1f7d1f 50%, #155515 100%);
  text-shadow: 0 -1px 0 rgba(0,0,0,0.4);
}

.btn-danger {
  color: #fff;
  border-color: #5a0a0a;
  background: linear-gradient(to bottom, #d65555 0%, #aa2828 50%, #851515 50%, #5a0a0a 100%);
  text-shadow: 0 -1px 0 rgba(0,0,0,0.4);
}

.btn-big { font-size: 13px; padding: 8px 22px; }

.btn-link {
  color: var(--color-link);
  font-size: 11px;
  margin-left: 8px;
}

/* ---------- Forms ---------- */

.form { display: flex; flex-direction: column; gap: 12px; }

.field { display: flex; flex-direction: column; gap: 3px; }
.field-label {
  font-weight: bold;
  color: #0e3a7a;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
[data-theme="dark"] .field-label { color: #7fb6ff; }

.field input,
.field textarea,
.field select {
  font-family: Tahoma, Arial, sans-serif;
  font-size: 13px;
  padding: 5px 7px;
  border: 1px solid #888;
  border-top-color: #555;
  background: linear-gradient(to bottom, #f4f4f4, #fff 6px);
  color: var(--color-text);
  border-radius: 2px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.15);
}
[data-theme="dark"] .field input,
[data-theme="dark"] .field textarea,
[data-theme="dark"] .field select {
  background: linear-gradient(to bottom, #1d2433, var(--bg-input) 6px);
  border-color: #000;
  border-top-color: #000;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--color-link);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.2), 0 0 4px rgba(26,79,156,0.4);
}
.field-hint { color: var(--color-muted); font-size: 10px; }

.form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.form-error {
  background: #ffe5e5;
  border: 1px solid #cc4444;
  color: #800;
  padding: 6px 10px;
  border-radius: 3px;
  font-size: 11px;
}
.form-success {
  background: #e5ffe5;
  border: 1px solid #44aa44;
  color: #060;
  padding: 6px 10px;
  border-radius: 3px;
  font-size: 11px;
}
[data-theme="dark"] .form-error {
  background: #3a1c1c; border-color: #aa3333; color: #ffb8b8;
}
[data-theme="dark"] .form-success {
  background: #1c3a1c; border-color: #44aa44; color: #b8ffb8;
}

/* ---------- Avatar / profile bits ---------- */

.avatar-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
}
.avatar-canvas {
  width: 220px;
  height: 260px;
  border: 1px solid var(--border-panel);
  border-radius: 4px;
  background: radial-gradient(circle at center, #cfe2ff 0%, #6f9bd7 60%, #3a6cae 100%);
  box-shadow: inset 0 0 24px rgba(0,0,0,0.25);
  position: relative;
  overflow: hidden;
}
[data-theme="dark"] .avatar-canvas {
  background: radial-gradient(circle at center, #2a3a5a 0%, #14264a 60%, #08172e 100%);
}
.avatar-canvas canvas { display: block; width: 100% !important; height: 100% !important; }

.avatar-meta { text-align: center; }

.bio-block {
  background: var(--bg-panel-soft);
  border: 1px dashed var(--border-soft);
  padding: 10px 12px;
  border-radius: 3px;
  white-space: pre-wrap;
  word-wrap: break-word;
  min-height: 60px;
}

/* ---------- Status indicators ---------- */

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: baseline;
  border: 1px solid rgba(0,0,0,0.3);
}
.status-dot.status-online  { background: radial-gradient(circle at 30% 30%, #aaffaa, #2ea82e); }
.status-dot.status-offline { background: radial-gradient(circle at 30% 30%, #ccc, #777); }

.status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 9px;
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid rgba(0,0,0,0.3);
  text-shadow: 0 1px 0 rgba(255,255,255,0.4);
}
.status-pill.status-online {
  color: #053f05;
  background: linear-gradient(to bottom, #b8f0b8, #5cc25c);
}
.status-pill.status-offline {
  color: #444;
  background: linear-gradient(to bottom, #e5e5e5, #b8b8b8);
}

/* ---------- Lists ---------- */

.bullets { margin: 0; padding-left: 20px; }
.bullets li { margin: 2px 0; }

.user-row {
  padding: 4px 6px;
  border-bottom: 1px dotted var(--border-dotted);
}
.user-row:last-child { border-bottom: none; }

.players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.player-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  text-decoration: none;
  color: var(--color-link);
}
.player-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--color-yellow-4);
  color: #4a3300;
}
.player-name { font-weight: bold; }

/* ---------- Games / Catalog grids ---------- */

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.tile {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  text-decoration: none;
  color: var(--color-text);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.tile:hover {
  border-color: var(--color-yellow-4);
  filter: brightness(1.03);
}

.tile-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--bg-thumb);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.65);
  font-family: "Trebuchet MS", Tahoma, sans-serif;
  font-size: 24px;
  font-weight: bold;
  text-shadow: 0 2px 4px rgba(0,0,0,0.4);
  border-bottom: 1px solid var(--border-soft);
}
.tile-thumb .badge {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(0,0,0,0.65);
  color: var(--color-accent);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 2px;
  font-family: Tahoma, Arial, sans-serif;
}
.tile-thumb .player-count {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0,0,0,0.6);
  color: #b8f0b8;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 2px;
  font-family: Tahoma, Arial, sans-serif;
}
.tile-thumb .player-count::before {
  content: "\25CF";
  color: #5cc25c;
  margin-right: 3px;
  font-size: 8px;
  vertical-align: middle;
}

.tile-body {
  padding: 6px 8px;
}
.tile-name {
  font-weight: bold;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tile-meta {
  font-size: 10px;
  color: var(--color-muted);
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
}
.tile-price {
  color: #2ea82e;
  font-weight: bold;
}
.tile-price.free { color: var(--color-muted); }

/* Catalog & games sidebar */
.sidebar-panel { padding: 0; }
.sidebar-list { list-style: none; padding: 0; margin: 0; }
.sidebar-list li {
  border-bottom: 1px solid var(--border-soft);
}
.sidebar-list li:last-child { border-bottom: none; }
.sidebar-list a {
  display: block;
  padding: 6px 12px;
  text-decoration: none;
  color: var(--color-text);
  font-size: 11px;
}
.sidebar-list a:hover {
  background: var(--bg-card-hover);
  color: #4a3300;
}
.sidebar-list a.active {
  background: linear-gradient(to right, var(--color-yellow-1), var(--color-yellow-2));
  color: #4a3300;
  font-weight: bold;
}

/* In-page tabs (above grids) */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border-panel);
  margin-bottom: 10px;
}
.tabs a {
  padding: 6px 14px;
  text-decoration: none;
  font-weight: bold;
  font-size: 11px;
  background: linear-gradient(to bottom, #e8eef8, #c7d4ea);
  border: 1px solid var(--border-panel);
  border-bottom: none;
  border-radius: 3px 3px 0 0;
  color: var(--color-link);
  margin-bottom: -1px;
}
[data-theme="dark"] .tabs a {
  background: linear-gradient(to bottom, #2a3242, #1d2433);
  color: var(--color-link);
}
.tabs a.active {
  background: var(--bg-panel);
  color: var(--color-text-strong);
  border-bottom: 1px solid var(--bg-panel);
}

/* ---------- Footer ---------- */

.footer {
  max-width: 980px;
  margin: 24px auto 12px;
  padding: 10px 12px;
  border-top: 1px solid var(--border-soft);
  color: var(--color-muted);
  font-size: 10px;
  text-align: center;
}
.footer a { color: var(--color-link); }

/* ---------- Misc ---------- */

.muted { color: var(--color-muted); }
.small { font-size: 10px; }
.center { text-align: center; }
.spacer { flex: 1; }
.right { text-align: right; }

hr.sep {
  border: 0;
  border-top: 1px dashed var(--border-soft);
  margin: 14px 0;
}

/* ---------- User dropdown menu (topbar) ---------- */

.user-menu {
  position: relative;
  display: inline-block;
}
.user-menu-trigger {
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.25);
  color: var(--color-accent);
  font-weight: bold;
  padding: 5px 12px;
  cursor: pointer;
  border-radius: 3px;
  font-size: 12px;
  font-family: Tahoma, Arial, sans-serif;
  text-shadow: 0 1px 0 rgba(0,0,0,0.4);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
}
.user-menu-trigger::after {
  content: "\25BE";
  font-size: 10px;
  margin-left: 1px;
  opacity: 0.85;
}
.user-menu-trigger:hover { background: rgba(0,0,0,0.32); }

.user-menu-panel {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 200px;
  background: var(--bg-panel);
  color: var(--color-text);
  border: 1px solid var(--border-panel);
  border-radius: 4px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.4);
  z-index: 1000;
  padding: 4px 0;
  display: none;
}
.user-menu.open .user-menu-panel { display: block; }

.user-menu-greeting {
  padding: 8px 14px 6px;
  color: var(--color-muted);
  font-size: 10px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 4px;
}
.user-menu-panel a,
.user-menu-panel button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 14px;
  text-decoration: none;
  color: var(--color-text);
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  font-weight: normal;
  text-shadow: none;
  border-radius: 0;
}
.user-menu-panel a:hover,
.user-menu-panel button:hover {
  background: var(--bg-card-hover);
  color: #4a3300;
}
.user-menu-panel hr {
  border: 0;
  border-top: 1px solid var(--border-soft);
  margin: 4px 0;
}

.pending-badge {
  display: inline-block;
  background: #d63a3a;
  color: #fff;
  font-size: 10px;
  font-weight: bold;
  padding: 0 5px;
  border-radius: 8px;
  min-width: 16px;
  text-align: center;
  text-shadow: 0 1px 0 rgba(0,0,0,0.4);
  border: 1px solid #6a1a1a;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.3);
  margin-left: 2px;
}
.pending-badge.inline {
  background: #ffcc00;
  color: #4a3300;
  border-color: #aa8800;
  text-shadow: 0 1px 0 rgba(255,255,255,0.4);
  margin-left: 4px;
}

.subnav-alert {
  color: #d63a3a !important;
  font-weight: bold;
}
[data-theme="dark"] .subnav-alert { color: #ff6c6c !important; }

/* ---------- Status message ---------- */

.status-message {
  font-style: italic;
  color: var(--color-muted);
  padding: 4px 8px;
  background: var(--bg-panel-soft);
  border-left: 3px solid var(--color-accent);
  border-radius: 2px;
  margin-top: 4px;
}

/* ---------- Profile stats strip ---------- */

.stats-strip {
  display: flex;
  gap: 0;
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  background: var(--bg-panel-soft);
  margin-top: 8px;
  overflow: hidden;
}
.stats-strip .stat {
  flex: 1 1 0;
  text-align: center;
  padding: 8px 4px;
  border-right: 1px solid var(--border-soft);
}
.stats-strip .stat:last-child { border-right: 0; }
.stats-strip .stat-num {
  display: block;
  font-family: "Trebuchet MS", Tahoma, sans-serif;
  font-size: 18px;
  font-weight: bold;
  color: var(--color-text-strong);
  line-height: 1.1;
}
.stats-strip .stat-label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-muted);
  margin-top: 2px;
}

/* ---------- Relationship action bar ---------- */

.relation-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.relation-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 9px;
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  color: var(--color-text);
}
.relation-tag.friends     { background: linear-gradient(to bottom, #b8f0b8, #5cc25c); color: #053f05; border-color: #2e7a2e; }
.relation-tag.pending     { background: linear-gradient(to bottom, #ffe97a, #ffd744); color: #4a3300; border-color: #aa8800; }
.relation-tag.best        { background: linear-gradient(to bottom, #ffb8e0, #d63a98); color: #4a0033; border-color: #a01070; }
.relation-tag.followsyou  { background: linear-gradient(to bottom, #cfe0ff, #7fb6ff); color: #001a4a; border-color: #1a4f9c; }

/* ---------- Avatar customizer ---------- */

.avatar-customizer {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
  align-items: start;
}
.avatar-customizer .avatar-canvas {
  width: 240px;
  height: 280px;
}
.color-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.color-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--border-soft);
  border-radius: 3px;
  background: var(--bg-panel-soft);
}
.color-row label {
  flex: 1;
  font-size: 11px;
  color: var(--color-text);
}
.color-row input[type="color"] {
  width: 36px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border-panel);
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
}

/* ---------- Friends list ---------- */

.friend-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px;
}
.friend-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 3px;
  text-decoration: none;
  color: var(--color-text);
  font-size: 11px;
}
.friend-card:hover {
  background: var(--bg-card-hover);
  color: #4a3300;
  border-color: var(--color-yellow-4);
}
.friend-card .friend-name {
  flex: 1;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.friend-card.best { border-left: 3px solid #d63a98; }

.request-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-bottom: 1px dotted var(--border-dotted);
}
.request-row:last-child { border-bottom: 0; }
.request-row .request-name { flex: 1; font-weight: bold; }

/* ---------- Catalog: featured row + compact tiles ---------- */

.tile-grid.featured {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 10px;
}
.tile.featured .tile-thumb {
  aspect-ratio: 16 / 9;
  font-size: 32px;
}
.tile.featured .tile-name { font-size: 13px; }

.tile-grid.compact {
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 6px;
}
.tile.compact .tile-thumb {
  aspect-ratio: 3 / 4;          /* vertical rectangle, like classic catalog */
  font-size: 18px;
}
.tile.compact .tile-body { padding: 4px 6px; }
.tile.compact .tile-name { font-size: 11px; }
.tile.compact .tile-meta { font-size: 9px; }
.tile.compact .tile-thumb .badge,
.tile.compact .tile-thumb .player-count {
  font-size: 9px;
  padding: 1px 4px;
}

/* Section labels above subgrids */
.section-label {
  font-family: "Trebuchet MS", Tahoma, sans-serif;
  font-size: 14px;
  font-weight: bold;
  color: var(--color-text-strong);
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 4px;
  margin: 16px 0 10px;
}
.section-label:first-child { margin-top: 0; }

/* ---------- Square small catalog cards (overrides .compact) ---------- */

.tile-grid.compact {
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  gap: 8px;
}
.tile.compact .tile-thumb {
  aspect-ratio: 1 / 1;       /* square cards as requested */
  font-size: 22px;
}

/* ---------- Hexagon brick-color palette ---------- */

.hex-palette {
  display: flex;
  flex-direction: column;
  align-items: center;
  user-select: none;
  --hex-w: 38px;
  --hex-h: 42px;
  --hex-gap: 3px;
}
.hex-row {
  display: flex;
  gap: var(--hex-gap);
  margin-bottom: -10px;       /* overlap rows for honeycomb packing */
}
.hex-row:last-child { margin-bottom: 0; }

.hex {
  width: var(--hex-w);
  height: var(--hex-h);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  cursor: pointer;
  border: 0;
  padding: 0;
  position: relative;
  transition: transform 0.08s ease;
  background: #888; /* overridden inline */
  outline: none;
}
.hex:hover  { transform: scale(1.12); z-index: 2; }
.hex:focus  { transform: scale(1.12); z-index: 2; }
.hex.selected::after {
  content: "";
  position: absolute;
  inset: 5px;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  border: 2px solid #ffffff;
  filter: drop-shadow(0 0 2px #000);
  pointer-events: none;
}
.hex.selected {
  transform: scale(1.18);
  z-index: 3;
}

/* Selectable body-part list on the avatar page */
.bodypart-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
.bodypart-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  color: var(--color-text);
  font-weight: bold;
  text-align: left;
}
.bodypart-pill .swatch {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  border: 1px solid rgba(0,0,0,0.3);
  box-shadow: inset 0 0 2px rgba(0,0,0,0.2);
}
.bodypart-pill:hover { background: var(--bg-card-hover); color: #4a3300; }
.bodypart-pill.active {
  background: linear-gradient(to bottom, var(--color-yellow-1), var(--color-yellow-2));
  color: #4a3300;
  border-color: var(--color-yellow-4);
  box-shadow: inset 0 1px 0 #fff, 0 0 0 1px var(--color-yellow-4);
}

/* ---------- Equipped items strip on avatar page ---------- */

.equipped-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}
.equipped-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  padding: 6px;
  text-align: center;
  font-size: 10px;
}
.equipped-card .equipped-thumb {
  aspect-ratio: 1 / 1;
  background: var(--bg-thumb);
  border-radius: 3px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.7);
  font-weight: bold;
  font-size: 12px;
  text-transform: uppercase;
}
.equipped-card .equipped-name {
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.equipped-card .equipped-slot {
  color: var(--color-muted);
  text-transform: uppercase;
  font-size: 9px;
  letter-spacing: 0.5px;
}

/* ---------- Admin panel ---------- */

.admin-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: linear-gradient(to right, #5a0a0a 0%, #aa2828 50%, #5a0a0a 100%);
  color: #ffe97a;
  border: 1px solid #2a0000;
  border-radius: 4px;
  margin-bottom: 12px;
  text-shadow: 0 1px 0 rgba(0,0,0,0.5);
  font-weight: bold;
}
.admin-banner::before {
  content: "ADMIN";
  background: #ffcc00;
  color: #4a0000;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 10px;
  letter-spacing: 1px;
  text-shadow: none;
}
.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.admin-stat {
  text-align: center;
  padding: 10px;
  background: var(--bg-panel-soft);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
}
.admin-stat .num {
  display: block;
  font-family: "Trebuchet MS", Tahoma, sans-serif;
  font-size: 24px;
  font-weight: bold;
  color: var(--color-text-strong);
}
.admin-stat .lbl {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-muted);
  margin-top: 3px;
}

.admin-item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-bottom: 1px dotted var(--border-dotted);
}
.admin-item-row:last-child { border-bottom: 0; }
.admin-item-thumb {
  width: 32px;
  height: 32px;
  border-radius: 3px;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.3);
}
.admin-item-name { flex: 1; font-weight: bold; }
.admin-item-cat  { color: var(--color-muted); font-size: 10px; text-transform: uppercase; }

/* ---------- Email page ---------- */

.email-list {
  display: flex;
  flex-direction: column;
}
.email-row {
  padding: 8px 12px;
  border-bottom: 1px dotted var(--border-dotted);
  cursor: pointer;
  display: grid;
  grid-template-columns: 24px 180px 1fr 80px;
  gap: 8px;
  align-items: center;
}
.email-row:hover { background: var(--bg-card-hover); color: #4a3300; }
.email-row.unread { background: var(--bg-panel-soft); font-weight: bold; }
.email-row .email-from {
  color: var(--color-link);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.email-row .email-subject {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.email-row .email-time {
  color: var(--color-muted);
  font-size: 10px;
  text-align: right;
}
.email-row .email-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
}
.email-row.unread .email-dot {
  background: radial-gradient(circle at 30% 30%, #ffe97a, #f0a625);
  border: 1px solid #aa6c00;
}

.email-detail {
  padding: 12px;
}
.email-detail-meta {
  font-size: 11px;
  color: var(--color-muted);
  margin-bottom: 4px;
}
.email-detail-subject {
  font-family: "Trebuchet MS", Tahoma, sans-serif;
  font-size: 18px;
  font-weight: bold;
  color: var(--color-text-strong);
  margin-bottom: 10px;
}
.email-body {
  background: var(--bg-panel-soft);
  border: 1px dashed var(--border-soft);
  padding: 12px;
  border-radius: 3px;
  white-space: pre-wrap;
}

