:root {
  --navy: #061018;
  --navy-2: #0b1a2e;
  --navy-3: #102844;
  --cyan: #3ec8f0;
  --cyan-soft: #7ed8f5;
  --cyan-deep: #1a8ec4;
  --amber: #f0a020;
  --amber-soft: #ffc45a;
  --ink: #e8f2ff;
  --ink-dim: #d6e4f4;
  --muted: #8aa4bc;
  --panel: #12263aee;
  --panel-solid: #142b42;
  --line: #2a5570;
  --danger: #ff7a6a;
  --ok: #5ee0a0;
  --shadow: 0 16px 40px #02081088;
  --radius: 10px;
  --font-display: "Fredoka", "Nunito", sans-serif;
  --font-body: "Nunito", "Segoe UI", sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  background:
    radial-gradient(ellipse at 80% -10%, #123a58 0%, transparent 42%),
    radial-gradient(ellipse at 10% 30%, #0e2a44 0%, transparent 36%),
    linear-gradient(180deg, #061018 0%, #0a1c30 45%, #0d2438 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.18;
  background-image:
    linear-gradient(#3ec8f022 1px, transparent 1px),
    linear-gradient(90deg, #3ec8f022 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 72%);
}

button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.wrap {
  width: min(1100px, calc(100% - 36px));
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #0b1a2eee;
  border-bottom: 2px solid #1e4a6a;
  backdrop-filter: blur(14px);
}

.nav {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding-right: 220px;
}

.nav-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.auth-corner {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 48px;
  height: 48px;
  object-fit: cover;
  object-position: center 38%;
  border-radius: 50%;
  border: 2px solid var(--cyan);
  box-shadow: 0 0 0 2px #163a58, 0 0 16px #3ec8f044;
  background: var(--navy);
}

.brand-text {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--cyan-soft);
  text-shadow: 0 0 18px #3ec8f055;
}

.navlinks {
  display: flex;
  gap: 18px;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
}

.navlinks a:hover { color: var(--cyan); }

.lang-toggle {
  min-width: 88px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--panel-solid);
  color: var(--cyan-soft);
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 800;
}

.discord-link {
  padding: 8px 12px;
  border: 2px solid #5865f2;
  border-radius: 8px;
  background: #5865f222;
  color: #c5caff;
  font-size: 12px;
  font-weight: 800;
}

.auth-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn,
.btn-ghost {
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 800;
  border: 2px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn {
  background: linear-gradient(180deg, #ffc45a, #e89218);
  border-color: #c87810;
  color: #1a1208;
  box-shadow: inset 0 -3px #c87810, 0 3px 0 #3a2810, 0 0 18px #f0a02033;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); box-shadow: inset 0 -1px #c87810; }

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--cyan-soft);
}

.btn-ghost:hover {
  border-color: var(--cyan);
  background: #3ec8f012;
}

.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: wait; }

/* Hero */
.hero {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: min(92vh, 820px);
  overflow: hidden;
  isolation: isolate;
  background: var(--navy);
}

.hero-visual {
  position: relative;
  z-index: 0;
  min-height: 420px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 50% 40%, #123a58 0%, #061018 68%),
    var(--navy);
  overflow: hidden;
}

.hero-pixel {
  width: min(920px, 92%);
  height: auto;
  max-height: 62vh;
  object-fit: contain;
  filter: drop-shadow(0 18px 40px #000a);
  animation: heroDrift 16s ease-in-out infinite alternate;
}

@keyframes heroDrift {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-10px) scale(1.03); }
}

.hero-bottom {
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, #061018 0%, #0a2034 100%);
  border-top: 1px solid #1e4a6a66;
  padding: 22px 0 34px;
}

.hero-content {
  max-width: 640px;
  color: var(--ink);
  animation: heroIn 0.7s ease both;
}

@keyframes heroIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero h1 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.hero h1 span { color: var(--cyan); }

.hero-copy {
  margin: 0 0 18px;
  max-width: 520px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.search {
  display: flex;
  gap: 8px;
  max-width: 520px;
  padding: 8px;
  background: #0e2236ee;
  border: 2px solid var(--cyan-deep);
  border-radius: 12px;
  box-shadow: 0 0 0 1px #3ec8f022, var(--shadow);
}

.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 700;
}

.search input::placeholder { color: #6a849c; font-weight: 600; }

.search button {
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  background: linear-gradient(180deg, #ffc45a, #e89218);
  color: #1a1208;
  font-weight: 800;
  box-shadow: inset 0 -3px #c87810;
}

/* Sections */
.section {
  padding: 36px 0 48px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
  padding: 18px 20px;
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.section-head h2 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--cyan-soft);
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.tag {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 2px solid var(--amber);
  border-radius: 6px;
  background: #f0a02018;
  color: var(--amber-soft);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.category-chip {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 10px 6px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--panel-solid);
  color: var(--ink-dim);
  font-size: 11px;
  font-weight: 800;
  transition: transform 0.15s ease, border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.category-chip img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  background: #0a1628;
  image-rendering: auto;
  background: #061018;
}

.category-chip:hover {
  transform: translateY(-2px);
  border-color: var(--cyan-deep);
}

.category-chip.active {
  background: linear-gradient(180deg, #1a4060, #123048);
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px #3ec8f033, 0 0 18px #3ec8f022;
  color: var(--cyan-soft);
}

.shared-status {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #123048;
  color: var(--cyan-soft);
  font-size: 12px;
  font-weight: 800;
}

.listings-count {
  grid-column: 1 / -1;
  margin: 0 0 4px;
  color: var(--cyan-soft);
  font-size: 12px;
  font-weight: 800;
}

.listing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.listing-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 36px 18px;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: #0e2236;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}

.listing-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--panel-solid);
  box-shadow: var(--shadow);
  animation: cardIn 0.35s ease both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.listing-cover {
  min-height: 120px;
  display: flex;
  flex-direction: column;
  background: radial-gradient(ellipse at 50% 80%, #2a6a8a, #0e2438 68%);
}

.listing-cover[data-cat="wings"] { background: radial-gradient(ellipse at 50% 80%, #3a7aa0, #102838); }
.listing-cover[data-cat="ances"] { background: radial-gradient(ellipse at 50% 80%, #4a7850, #142830); }
.listing-cover[data-cat="block"] { background: radial-gradient(ellipse at 50% 80%, #8a6240, #241810); }
.listing-cover[data-cat="hand"] { background: radial-gradient(ellipse at 50% 80%, #c88830, #2a1c10); }
.listing-cover[data-cat="hat"] { background: radial-gradient(ellipse at 50% 80%, #7a4a88, #1c1428); }
.listing-cover[data-cat="shoes"] { background: radial-gradient(ellipse at 50% 80%, #3a6888, #101c28); }
.listing-cover[data-cat="pant"] { background: radial-gradient(ellipse at 50% 80%, #385878, #101828); }
.listing-cover[data-cat="shirt"] { background: radial-gradient(ellipse at 50% 80%, #3a8870, #102820); }
.listing-cover[data-cat="hair"] { background: radial-gradient(ellipse at 50% 80%, #b87830, #281810); }
.listing-cover[data-cat="other"] { background: radial-gradient(ellipse at 50% 80%, #6a4a88, #1c1428); }

.listing-cover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  background: linear-gradient(90deg, #1a6a90, #c87818);
}

.listing-cover-label {
  flex: 0 1 auto;
  color: #f4fbff;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.05em;
  white-space: nowrap;
  opacity: 0.92;
}

.listing-seller {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  max-width: 72%;
  padding: 3px 10px 3px 3px;
  border-radius: 999px;
  background: #061018f2;
  border: 1px solid #ffc45a;
  box-shadow: 0 1px 4px #0006;
  color: #ffd88a;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-shadow: 0 1px 2px #000a;
}

.listing-seller-avatar-btn {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  border-radius: 50%;
  line-height: 0;
}

.listing-seller-avatar {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #ffc45a;
  background: #0b1a2e;
  pointer-events: none;
}

.listing-seller-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

button.listing-seller-name:hover b,
button.listing-seller-name:focus-visible b {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.listing-seller b {
  color: #fff;
  font-size: 13px;
  font-weight: 950;
}

.listing-cover-art {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  text-align: center;
}

.listing-cover-art img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  image-rendering: auto;
  filter: drop-shadow(0 3px 4px #0008);
}

.listing-cover-art strong {
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  text-shadow: 0 2px 4px #000a;
  overflow-wrap: anywhere;
}

.listing-body { flex: 1; padding: 12px; }

.listing-type {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.listing-body h3 {
  margin: 4px 0 8px;
  font-size: 15px;
  font-weight: 900;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.listing-world {
  padding: 8px;
  border-radius: 6px;
  background: #0e2236;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.listing-world span {
  color: var(--cyan);
  font-family: ui-monospace, Consolas, monospace;
  font-weight: 900;
}

.listing-note {
  margin: 8px 0 0;
  color: #9ab0c4;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.listing-actions {
  display: grid;
  gap: 6px;
  padding: 0 12px 12px;
}

.listing-actions > button,
.owner-actions button {
  min-height: 34px;
  padding: 7px 10px;
  border: 2px solid var(--line);
  border-radius: 7px;
  background: #0e2236;
  color: var(--cyan-soft);
  font-size: 11px;
  font-weight: 800;
}

.owner-actions { display: flex; gap: 6px; }
.owner-actions button { flex: 1; }
.owner-actions .danger {
  color: var(--danger);
  border-color: #8a4038;
  background: #2a1818;
}

/* Listing menu (header) */
.listing-menu {
  position: relative;
  z-index: 55;
}

.listing-menu-btn {
  white-space: nowrap;
}

.listing-menu-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 80;
  width: min(360px, calc(100vw - 24px));
  padding: 14px;
  border: 2px solid var(--cyan-deep);
  border-radius: 12px;
  background: linear-gradient(160deg, #142b42, #0b1a2e);
  box-shadow: var(--shadow), 0 0 24px #3ec8f022;
  display: none;
}

.listing-menu.open .listing-menu-dropdown,
.listing-menu-dropdown:not([hidden]) {
  display: grid;
  gap: 12px;
}

.listing-menu-dropdown[hidden] { display: none !important; }

.listing-menu-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.listing-menu-head strong {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--cyan-soft);
  line-height: 1.3;
}

.listing-menu-form.world-form,
.world-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 0;
  align-items: stretch;
}

.field { display: grid; gap: 5px; }
.field label {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
}

.field input,
.field select {
  width: 100%;
  min-width: 0;
  padding: 10px 11px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #0a1c2e;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.field input:focus,
.field select:focus {
  outline: 0;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px #3ec8f022;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.form-hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.55;
}

/* Tools */
.tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding-top: 0;
}

.tool-block {
  padding: 20px;
  background: var(--panel);
  border: 2px solid var(--line);
  border-top: 4px solid var(--cyan);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.tool-block h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--cyan-soft);
}

.tool-block > p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.lockcalc {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin-top: 14px;
}

.lockcalc .field { flex: 1; min-width: 120px; }

.calcresult {
  margin: 12px 0 0;
  color: var(--amber-soft);
  font-size: 13px;
  font-weight: 900;
}

.warning {
  margin-bottom: 36px;
  padding: 14px 16px;
  background: #2a2010;
  border: 2px solid #8a6a28;
  border-radius: 10px;
  color: #e8d8a8;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.7;
}

.warning a { color: var(--cyan-soft); text-decoration: underline; }
.warning b { color: var(--amber-soft); }

/* Footer */
.site-footer {
  border-top: 2px solid var(--line);
  padding: 18px 0 28px;
  background: #081420;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.foot {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 80;
  transform: translate(-50%, 12px);
  opacity: 0;
  pointer-events: none;
  padding: 11px 16px;
  background: linear-gradient(180deg, #ffc45a, #e89218);
  color: #1a1208;
  border: 2px solid #c87810;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
  box-shadow: var(--shadow);
  transition: 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Modals */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 16px;
  background: #020810cc;
  backdrop-filter: blur(8px);
}

.backdrop[hidden] { display: none !important; }

.modal {
  width: min(420px, 100%);
  padding: 22px;
  background: linear-gradient(160deg, #142b42, #0b1a2e);
  border: 2px solid var(--cyan-deep);
  border-radius: 14px;
  box-shadow: 0 24px 60px #000a, 0 0 30px #3ec8f022;
  color: var(--ink);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-head h2 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--cyan-soft);
}

.modal-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.modal-close {
  width: 34px;
  height: 34px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #0e2236;
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
}

.auth-error {
  min-height: 16px;
  margin: 8px 0;
  color: var(--danger);
  font-size: 12px;
  font-weight: 800;
}

.auth-switch {
  margin: 14px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.auth-switch button {
  border: 0;
  background: none;
  color: var(--cyan);
  text-decoration: underline;
  font-weight: 900;
}

.profile-head-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-avatar-img {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  border: 2px solid var(--cyan);
  object-fit: cover;
  background: var(--navy);
}

.profile-kicker {
  margin: 0;
  color: var(--amber-soft);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.profile-data {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.profile-data div {
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #0e2236;
}

.profile-data small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.profile-data strong {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.profile-listings-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #123048;
}

.profile-listings-row small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.count-badge {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  height: 38px;
  border-radius: 8px;
  background: linear-gradient(180deg, #1a6a90, #c87818);
  color: #fff;
  font-size: 16px;
  font-weight: 900;
}

/* Profile menu */
.profile-menu { position: relative; }

.profile-menu-btn {
  width: 48px;
  height: 48px;
  padding: 0;
  border: 2px solid var(--cyan);
  border-radius: 50%;
  background: var(--navy);
  overflow: hidden;
  box-shadow: 0 0 12px #3ec8f044;
}

.profile-menu-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-menu-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 80;
  width: min(320px, calc(100vw - 24px));
  max-height: min(78vh, 640px);
  overflow: auto;
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #0e2236;
  box-shadow: var(--shadow);
  display: none;
}

.profile-menu.open .profile-menu-dropdown { display: grid; gap: 8px; }

.profile-menu-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #2a557055;
}

.profile-menu-head img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--cyan);
}

.profile-menu-head strong {
  display: block;
  font-size: 13px;
  color: var(--ink);
}

.profile-menu-head small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.profile-menu-item {
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-align: left;
}

.profile-menu-item:hover { background: #123048; }
.profile-menu-item.danger { color: var(--danger); }

.avatar-actions { display: flex; gap: 6px; }

.avatar-actions button {
  flex: 1;
  padding: 7px;
  border: 2px solid var(--line);
  border-radius: 7px;
  background: #0a1c2e;
  font-size: 11px;
  font-weight: 800;
  color: var(--cyan-soft);
}

.avatar-actions .danger {
  color: var(--danger);
  border-color: #8a4038;
}

.managed-list {
  display: grid;
  gap: 6px;
  max-height: 140px;
  overflow: auto;
}

.managed-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0a1c2e;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.managed-item strong { display: block; font-size: 12px; color: var(--ink); }
.managed-item small { display: block; color: var(--muted); font-size: 10px; }
.managed-item em {
  color: var(--cyan);
  font: 800 11px ui-monospace, Consolas, monospace;
  align-self: center;
}

.managed-empty {
  padding: 10px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.friends-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #0a1c2e;
}

.friends-title {
  font-size: 12px;
  color: var(--cyan-soft);
}

.friends-add {
  display: flex;
  gap: 6px;
}

.friends-add input {
  flex: 1;
  min-width: 0;
  padding: 8px 9px;
  border: 2px solid var(--line);
  border-radius: 7px;
  background: #061018;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.friends-add .btn {
  padding: 8px 10px;
  font-size: 11px;
}

.friends-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 120px;
  overflow: auto;
}

.friend-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #123048;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.friend-chip:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px #3ec8f022;
}

.friend-chip img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--cyan-deep);
}

.friend-modal {
  width: min(720px, 100%);
}

.friend-listings {
  max-height: min(60vh, 480px);
  overflow: auto;
}

.friend-listings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.avatar-lightbox {
  z-index: 90;
  cursor: zoom-out;
}

.avatar-lightbox-img {
  width: min(320px, 78vw);
  height: min(320px, 78vw);
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #ffc45a;
  box-shadow: 0 16px 48px #000c, 0 0 24px #ffc45a33;
  background: #0b1a2e;
  animation: avatarPop 0.22s ease both;
}

@keyframes avatarPop {
  from { opacity: 0; transform: scale(0.86); }
  to { opacity: 1; transform: scale(1); }
}

.avatar-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
}

.profile-avatar-img {
  cursor: zoom-in;
}

@media (max-width: 620px) {
  .friend-listings-grid { grid-template-columns: 1fr; }
}

/* Responsive */
@media (max-width: 1000px) {
  .listing-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .category-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (max-width: 850px) {
  .navlinks { display: none; }
  .hero { min-height: auto; }
  .hero-visual { min-height: 300px; }
  .hero-pixel { max-height: 48vh; }
  .world-form { grid-template-columns: 1fr 1fr; }
  .tools { grid-template-columns: 1fr; }
  .listing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .wrap { width: calc(100% - 24px); }
  .nav { min-height: 60px; gap: 6px; padding-right: 168px; }
  .auth-corner { top: 8px; right: 8px; gap: 6px; }
  .profile-menu-btn { width: 42px; height: 42px; }
  .brand-logo { width: 40px; height: 40px; }
  .brand-text { font-size: 18px; }
  .discord-link { display: none; }
  .listing-menu-dropdown { right: 0; width: min(320px, calc(100vw - 16px)); }
  .lang-toggle { min-width: 70px; padding: 6px; font-size: 11px; }
  .btn, .btn-ghost { padding: 8px 10px; font-size: 11px; }
  .auth-corner .btn-ghost { display: none; }
  .listing-menu-btn { padding: 8px 9px; font-size: 10px; }
  .hero h1 { font-size: 28px; }
  .category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .world-form { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; }
  .foot { flex-direction: column; }
  .listing-grid { grid-template-columns: 1fr; }
}
