:root {
  --bg-deep: #2a2e35;
  --bg: #32383f;
  --panel: #3a4149;
  --panel-2: #343b43;
  --line: #4d5661;
  --line-soft: #454e58;
  --text: #e4e7eb;
  --muted: #9aa3ad;
  --accent: #c9a24a;
  --accent-bright: #dbb45a;
  --accent-dim: #e0c078;
  --ok: #5cb88a;
  --bad: #d66a6a;
  --link: #7eb0d8;
  --font-display: "Cinzel", Georgia, serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
  --radius: 10px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg-deep);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
.bg-atmosphere {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(820px 420px at 8% -5%, rgba(201, 162, 74, 0.10), transparent 55%),
    radial-gradient(700px 380px at 96% 0%, rgba(70, 100, 130, 0.14), transparent 50%),
    linear-gradient(180deg, #353b43 0%, var(--bg-deep) 45%, #24282e 100%);
}

a { color: var(--link); font-weight: 600; text-decoration: none; }
a:hover { color: var(--accent-dim); }

.site-nav {
  position: sticky; top: 0; z-index: 40;
  background: rgba(42, 46, 53, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.nav-inner {
  width: min(1120px, calc(100% - 1.5rem));
  margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.65rem 0;
}
.brand { display: flex; align-items: center; gap: 0.7rem; color: var(--text); }
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--accent); color: var(--accent-dim);
  font-family: var(--font-display); font-weight: 700; border-radius: 8px;
  background: linear-gradient(160deg, rgba(212,160,58,0.22), #3a4149);
}
.brand-text strong { display: block; font-family: var(--font-display); letter-spacing: 0.03em; font-size: 1.02rem; }
.brand-text small { color: var(--muted); font-size: 0.76rem; }
.nav-toggle {
  display: none; background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 0.4rem 0.65rem; font-size: 1.1rem;
}
.nav-links { display: flex; flex-wrap: wrap; gap: 0.2rem; }
.nav-links a {
  color: var(--muted); padding: 0.42rem 0.68rem; border-radius: 999px; font-size: 0.92rem;
}
.nav-links a:hover, .nav-links a.on {
  color: var(--text); background: rgba(212,160,58,0.14);
}
.nav-links a.on { color: var(--accent-dim); font-weight: 700; }

.page {
  position: relative; z-index: 1;
  width: min(1120px, calc(100% - 1.5rem));
  margin: 1.15rem auto 2.4rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 1.15rem;
  align-items: start;
}
.main-col, .side-col { min-width: 0; }

.hero {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.35rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}
.hero h1 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3vw, 1.95rem);
  letter-spacing: 0.03em;
  color: var(--accent-dim);
}
.hero p { margin: 0; color: var(--muted); max-width: 40rem; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }

/* Compact legend slider (~30% viewport) */
.legend-hero {
  position: relative;
  z-index: 1;
  height: min(30vh, 280px);
  min-height: 200px;
  max-height: 280px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  isolation: isolate;
}
.legend-slides {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.legend-slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transition: opacity 0.75s ease;
  pointer-events: none;
}
.legend-slide.is-active {
  opacity: 1;
  pointer-events: auto;
}
.legend-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  display: block;
  transform: scale(1.03);
  transition: transform 3.1s ease-out;
  filter: saturate(1.02) contrast(1.04);
}
.legend-slide.is-active img { transform: scale(1.08); }

.legend-tag {
  position: absolute;
  left: max(1rem, calc((100% - 1120px) / 2));
  bottom: 0.7rem;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  max-width: min(18rem, 48vw);
  pointer-events: none;
}
.legend-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff8e6;
  text-shadow: 0 1px 8px rgba(0,0,0,0.75);
}
.legend-line {
  color: rgba(255,255,255,0.88);
  font-size: 0.8rem;
  text-shadow: 0 1px 6px rgba(0,0,0,0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.legend-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(18,24,34,0.72) 0%, rgba(18,24,34,0.35) 48%, rgba(18,24,34,0.2) 100%),
    linear-gradient(180deg, rgba(18,24,34,0.15) 0%, transparent 40%, rgba(18,24,34,0.55) 100%);
}
.legend-content {
  position: relative;
  z-index: 2;
  width: min(1120px, calc(100% - 1.5rem));
  margin: 0 auto;
  padding: 1.15rem 0 1.35rem;
  max-width: 30rem;
  animation: legend-rise 0.7s ease-out both;
}
.legend-brand {
  margin: 0 0 0.2rem;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3.2vw, 2rem);
  letter-spacing: 0.04em;
  line-height: 1.1;
  color: #f0d078;
  text-shadow: 0 1px 10px rgba(0,0,0,0.45);
}
.legend-content h1 {
  margin: 0 0 0.35rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0,0,0,0.4);
}
.legend-lead {
  margin: 0;
  color: rgba(255,255,255,0.9);
  font-size: 0.92rem;
  max-width: 26rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.legend-content .cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.legend-content .btn {
  padding: 0.48rem 0.9rem;
  font-size: 0.92rem;
}
.legend-content .btn.secondary {
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.55);
  color: #fff !important;
  backdrop-filter: blur(4px);
}
.legend-content .btn.secondary:hover {
  background: rgba(255,255,255,0.28);
  color: #fff !important;
}
.legend-dots {
  position: absolute;
  right: max(1rem, calc((100% - 1120px) / 2));
  bottom: 0.85rem;
  z-index: 3;
  display: flex;
  gap: 0.4rem;
}
.legend-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.65);
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.legend-dot.is-active {
  background: var(--accent-bright);
  border-color: var(--accent-bright);
  transform: scale(1.15);
}
.legend-dot:hover { background: rgba(255,255,255,0.45); }

@keyframes legend-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-home { margin-top: 1.15rem; }
.home-intro, .home-about {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.home-intro h2, .home-about h2 {
  margin: 0 0 0.7rem;
  font-family: var(--font-display);
  font-size: 1.02rem;
  color: var(--accent-dim);
  letter-spacing: 0.04em;
}

/* Screenshot mosaic */
.home-shots {
  margin-bottom: 1.15rem;
}
.home-shots__head {
  margin-bottom: 0.75rem;
}
.home-shots__head h2 {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--accent-dim);
  letter-spacing: 0.04em;
}
.home-shots__head p { margin: 0; }
.shot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
}
.shot-card {
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0f141c;
  box-shadow: var(--shadow);
  position: relative;
}
.shot-card img {
  display: block;
  width: 100%;
  height: 118px;
  object-fit: cover;
  transition: transform 0.45s ease;
}
.shot-card:hover img { transform: scale(1.06); }
.shot-card figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 0.45rem 0.55rem;
  font-size: 0.78rem;
  color: #fff;
  background: linear-gradient(transparent, rgba(10,14,20,0.85));
}

/* News feed */
.home-news {
  margin-bottom: 1.15rem;
}
.home-news__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.home-news__head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--accent-dim);
  letter-spacing: 0.04em;
}
.news-feed { display: grid; gap: 0.85rem; }
.news-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}
.news-card--featured {
  border-color: rgba(201,162,74,0.45);
  background: linear-gradient(165deg, #454b38, var(--panel));
}
.news-card__meta {
  display: flex; align-items: center; gap: 0.35rem;
  color: var(--muted); font-size: 0.84rem; margin-bottom: 0.35rem;
}
.news-card__dot { opacity: 0.6; }
.news-card__title {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: var(--text);
}
.news-card__title a { color: inherit; }
.news-card__title a:hover { color: var(--accent-dim); }
.news-card__content {
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.6;
}
.news-card__content img {
  max-width: 100%;
  border-radius: 8px;
  margin: 0.5rem 0;
}
.news-bb-image { margin: 0.6rem 0; }
.news-bb-center { text-align: center; }
.news-empty {
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 1.2rem;
  color: var(--muted);
  text-align: center;
}
.news-pagination {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem; margin-top: 0.9rem;
}
.news-pagination__btn {
  display: inline-block;
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font-size: 0.9rem;
}
.home-admin-actions {
  display: flex; gap: 0.45rem; margin-top: 0.75rem; flex-wrap: wrap;
}
.home-admin-btn {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 6px;
  padding: 0.28rem 0.55rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.home-admin-btn--danger { color: var(--bad); border-color: #efb4b4; }
.news-admin-head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
}
.news-admin-head h2 { margin: 0; }
.news-admin-list { list-style: none; margin: 0; padding: 0; }
.news-admin-list li {
  display: flex; justify-content: space-between; gap: 1rem; align-items: center;
  padding: 0.7rem 0; border-bottom: 1px solid var(--line-soft);
}
.news-admin-list li:last-child { border-bottom: 0; }
.news-admin-list strong { display: block; }
.news-admin-actions { display: flex; gap: 0.4rem; }
textarea {
  width: 100%; padding: 0.58rem 0.7rem; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  font: inherit; min-height: 180px; resize: vertical;
}

.panel, .box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.panel h2, .box h3 {
  margin: 0 0 0.7rem;
  font-family: var(--font-display);
  font-size: 1.02rem;
  color: var(--accent-dim);
  letter-spacing: 0.04em;
}
.box h3 { font-size: 0.94rem; }

.steps { margin: 0; padding-left: 1.15rem; color: var(--text); }
.steps li { margin: 0.5rem 0; }
.steps a { font-weight: 700; }

.btn {
  display: inline-block;
  border: 1px solid var(--accent);
  background: linear-gradient(180deg, #e6bf63, #c99630);
  color: #1a1408 !important;
  font-weight: 700;
  padding: 0.58rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  text-align: center;
}
.btn:hover { filter: brightness(1.05); color: #1a1408 !important; }
.btn.secondary {
  background: var(--panel-2);
  color: var(--accent-dim) !important;
  border-color: var(--line);
}
.btn.secondary:hover { background: rgba(212,160,58,0.12); border-color: var(--accent); }
.btn.block { width: 100%; margin-top: 0.6rem; }
.btn.danger {
  background: linear-gradient(180deg, #d96a6a, #a83d3d);
  border-color: #a84848;
  color: #fff !important;
}

label { display: block; font-weight: 600; margin: 0.65rem 0 0.25rem; font-size: 0.92rem; }
input, select {
  width: 100%; padding: 0.58rem 0.7rem; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  font: inherit;
}
input:focus, select:focus { outline: 2px solid rgba(184,134,45,0.35); border-color: var(--accent); }
.hint, .muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.center { text-align: center; }

.flash {
  padding: 0.7rem 0.95rem; border-radius: 8px; margin-bottom: 1rem;
  border: 1px solid; font-weight: 600;
}
.flash-ok { background: rgba(47,143,91,0.18); border-color: rgba(92,184,138,0.45); color: #9fd4b5; }
.flash-err { background: rgba(196,69,69,0.18); border-color: rgba(214,106,106,0.45); color: #efb0b0; }

.status-line { margin: 0 0 0.3rem; font-weight: 700; display: flex; align-items: center; gap: 0.4rem; }
.online-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--bad); display: inline-block; }
.online-dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(47,143,91,0.2); }

.side-login label { margin-top: 0.5rem; }
.side-login .btn { margin-top: 0.8rem; }

.mini-hs { list-style: none; margin: 0; padding: 0; }
.mini-hs li {
  display: flex; justify-content: space-between; gap: 0.5rem;
  padding: 0.4rem 0; border-bottom: 1px solid var(--line-soft);
  font-size: 0.9rem;
}
.mini-hs li:last-child { border-bottom: 0; }
.mini-hs b { color: var(--accent-dim); font-weight: 700; }

.hs-table {
  width: 100%; border-collapse: collapse; font-size: 0.95rem;
  background: var(--panel); border-radius: var(--radius); overflow: hidden;
}
.hs-table th, .hs-table td {
  padding: 0.55rem 0.5rem; text-align: left;
  border-bottom: 1px solid var(--line-soft);
}
.hs-table th {
  color: var(--accent-dim); font-family: var(--font-display);
  font-weight: 600; font-size: 0.84rem; letter-spacing: 0.03em;
  background: var(--panel-2);
}
.hs-table tr:hover td { background: rgba(212,160,58,0.06); }
.hs-table .rank { color: var(--muted); width: 2.5rem; }
.char-link { color: var(--text); }
.char-link:hover { color: var(--accent-dim); }

.hs-name {
  display: flex; align-items: center; gap: 0.35rem;
}
.skull-ico {
  width: 16px; height: 16px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  flex-shrink: 0;
  vertical-align: middle;
}
.skull-ico--lg {
  width: 24px; height: 24px;
}

.profile-header {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1rem;
}
.profile-outfit {
  width: 72px; height: 72px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #2a3038;
  display: grid; place-items: center;
  overflow: hidden;
}
.profile-outfit img { image-rendering: pixelated; }
.profile-header__text h2 { margin: 0 0 0.2rem; font-family: var(--font-display); color: var(--accent-dim); display: flex; align-items: center; gap: 0.55rem; flex-wrap: wrap; }
.profile-header__text p { margin: 0; }
.skull-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}
.skull-none { background: rgba(154,163,173,0.18); color: var(--muted); border: 1px solid var(--line); }
.skull-yellow { background: rgba(212,160,58,0.22); color: #e8c878; border: 1px solid rgba(212,160,58,0.45); }
.skull-white { background: rgba(230,235,240,0.16); color: #f0f3f6; border: 1px solid rgba(230,235,240,0.45); }
.skull-red { background: rgba(196,69,69,0.28); color: #ff9a9a; border: 1px solid rgba(214,106,106,0.55); }
.profile-table {
  width: 100%; border-collapse: collapse; font-size: 0.95rem;
}
.profile-table th, .profile-table td {
  padding: 0.45rem 0.35rem; text-align: left;
  border-bottom: 1px solid var(--line-soft);
}
.profile-table th {
  width: 9rem; color: var(--muted); font-weight: 600;
}
.tag {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(255,255,255,0.08);
  color: var(--muted);
  vertical-align: middle;
}
.tag-pvp {
  background: rgba(196,69,69,0.22);
  color: #ef9a9a;
}

.char-list { list-style: none; padding: 0; margin: 0; }
.char-list li {
  display: flex; justify-content: space-between; gap: 1rem; align-items: center;
  padding: 0.65rem 0; border-bottom: 1px solid var(--line-soft);
}
.char-list li:last-child { border-bottom: 0; }

.qr-wrap {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start;
  margin: 0.75rem 0;
}
.qr-wrap img {
  width: 180px; height: 180px; background: #fff; border-radius: 8px; padding: 8px;
  border: 1px solid var(--line);
}
.secret-box {
  font-family: ui-monospace, Consolas, monospace;
  background: #2a3038; border: 1px solid var(--line);
  padding: 0.55rem 0.7rem; border-radius: 8px; word-break: break-all;
}

code {
  font-family: ui-monospace, Consolas, monospace;
  background: #2a3038; padding: 0.12rem 0.35rem; border-radius: 4px;
  border: 1px solid var(--line-soft); font-size: 0.9em;
}

.foot {
  position: relative; z-index: 1;
  border-top: 1px solid var(--line);
  padding: 1.3rem 1rem 2rem; text-align: center;
  color: var(--muted); font-size: 0.9rem;
  background: rgba(24,28,34,0.65);
}
.foot strong { color: var(--accent-dim); font-family: var(--font-display); }

@media (max-width: 900px) {
  .page { grid-template-columns: 1fr; }
  .nav-toggle { display: inline-block; }
  .nav-links {
    display: none; width: 100%; flex-direction: column;
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 0.5rem 0.75rem 0.85rem;
  }
  .nav-links.open { display: flex; }
  .nav-inner { flex-wrap: wrap; }
  .legend-hero {
    height: min(30vh, 240px);
    min-height: 180px;
    max-height: 240px;
  }
  .legend-content {
    padding: 0.85rem 0 1.1rem;
    max-width: 100%;
  }
  .legend-lead { -webkit-line-clamp: 1; }
  .legend-tag {
    left: 0.85rem;
    bottom: 0.55rem;
    max-width: calc(100% - 4.5rem);
  }
  .legend-dots {
    right: 0.85rem;
    bottom: 0.65rem;
  }
  .shot-grid { grid-template-columns: repeat(2, 1fr); }
  .shot-card img { height: 100px; }
}

@media (prefers-reduced-motion: reduce) {
  .legend-slide,
  .legend-slide img,
  .legend-content { transition: none !important; animation: none !important; }
}
