:root {
  --bg: #07090d;
  --panel: #10151d;
  --panel-soft: rgba(16, 21, 29, 0.78);
  --text: #f7f3ea;
  --muted: #aeb7bd;
  --line: rgba(255, 255, 255, 0.12);
  --gold: #d6a84f;
  --teal: #29d2c5;
  --red: #ff5a67;
  --discord: #5865f2;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  --scroll-track: rgba(7, 9, 13, 0.94);
  --scroll-thumb: linear-gradient(180deg, rgba(214, 168, 79, 0.96), rgba(41, 210, 197, 0.78));
  --scroll-thumb-hover: linear-gradient(180deg, #f0c86f, #29d2c5);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--gold) var(--scroll-track);
}

*::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

*::-webkit-scrollbar-track {
  background:
    linear-gradient(180deg, rgba(214, 168, 79, 0.1), rgba(41, 210, 197, 0.08)),
    var(--scroll-track);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

*::-webkit-scrollbar-thumb {
  min-height: 64px;
  border: 3px solid var(--scroll-track);
  border-radius: 999px;
  background: var(--scroll-thumb);
  box-shadow: 0 0 18px rgba(214, 168, 79, 0.16);
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-thumb-hover);
  box-shadow: 0 0 22px rgba(41, 210, 197, 0.24);
}

*::-webkit-scrollbar-corner,
*::-webkit-scrollbar-button {
  display: none;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  padding: 14px clamp(18px, 4vw, 54px);
  border-bottom: 1px solid var(--line);
  background: rgba(7, 9, 13, 0.72);
  backdrop-filter: blur(18px);
  animation: topbarDrop 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.brand {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  border-radius: 999px;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.24s ease, color 0.24s ease;
}

.brand:hover {
  transform: translateY(-2px);
}

.brand-logo {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(214, 168, 79, 0.6);
  border-radius: 50%;
  background: rgba(9, 13, 20, 0.72);
  object-fit: cover;
  animation: markPulse 3.4s ease-in-out infinite;
  transition: transform 0.28s ease;
}

.brand:hover .brand-logo {
  transform: rotate(-8deg) scale(1.06);
}

.nav-points {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.nav-points::-webkit-scrollbar {
  display: none;
}

.menu-toggle {
  display: none;
}

.menu-toggle {
  flex: 0 0 auto;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  transition: background 0.22s ease, border-color 0.22s ease;
}

.menu-toggle:hover,
.menu-toggle.open {
  border-color: rgba(41, 210, 197, 0.45);
  background: rgba(41, 210, 197, 0.12);
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.menu-toggle span + span {
  margin-top: 4px;
}

.menu-toggle.open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.menu-toggle.open span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.nav-dot {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.88rem;
  white-space: nowrap;
  transition: background 0.22s ease, color 0.22s ease;
}

.nav-dot.active,
.nav-dot:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.page {
  display: none;
  min-height: 100vh;
  padding-top: 76px;
}

.page.active {
  display: block;
  animation: pageIn 0.42s ease both;
}

#factions.page.active {
  animation: none;
}

.hero {
  position: relative;
  min-height: min(760px, 92vh);
  display: grid;
  align-items: end;
  overflow: hidden;
}

.hero-bg,
.hero-overlay {
  position: absolute;
  inset: 0;
}

.hero-bg {
  background: url("assets/onyx-hero.png") center / cover no-repeat;
  transform: scale(1.01);
  animation: heroDrift 22s ease-in-out infinite alternate;
}

.hero-overlay {
  background:
    linear-gradient(90deg, rgba(7, 9, 13, 0.94) 0%, rgba(7, 9, 13, 0.55) 46%, rgba(7, 9, 13, 0.18) 100%),
    linear-gradient(0deg, #07090d 0%, rgba(7, 9, 13, 0) 38%);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(780px, calc(100% - 36px));
  margin: 0 auto;
  padding: 128px 0 116px;
}

.hero-content > * {
  animation: fadeRise 0.75s ease both;
}

.hero-content > *:nth-child(2) {
  animation-delay: 0.12s;
}

.hero-content > *:nth-child(3) {
  animation-delay: 0.22s;
}

.hero-content > *:nth-child(4) {
  animation-delay: 0.32s;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}

.hero h1,
.legal-shell h1,
.shop-head h1,
.login-content h1 {
  margin: 0;
  line-height: 1.02;
  letter-spacing: 0;
}

.hero h1 {
  max-width: 780px;
  font-size: clamp(2.6rem, 7vw, 5.2rem);
}

.hero-copy {
  max-width: 640px;
  margin: 22px 0 0;
  color: #d6dce0;
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.primary-action,
.secondary-action,
.discord-button,
.logout-button,
.product-button,
.checkout-button,
.cart-pill,
.faction-tab,
.faction-button,
.faction-group-toggle,
.shop-link,
.icon-button,
.remove-item {
  position: relative;
  overflow: hidden;
  min-height: 46px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 14px;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text);
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease, color 0.22s ease, box-shadow 0.22s ease;
}

.primary-action::after,
.secondary-action::after,
.discord-button::after,
.product-button::after,
.checkout-button::after,
.cart-pill::after {
  content: "";
  position: absolute;
  inset: -2px auto -2px -55%;
  width: 44%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.34), transparent);
  transform: skewX(-18deg);
  transition: left 0.55s ease;
  pointer-events: none;
}

.primary-action:hover,
.secondary-action:hover,
.discord-button:hover,
.product-button:hover,
.checkout-button:hover,
.cart-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.3);
}

.primary-action:hover::after,
.secondary-action:hover::after,
.discord-button:hover::after,
.product-button:hover::after,
.checkout-button:hover::after,
.cart-pill:hover::after {
  left: 112%;
}

.primary-action {
  background: linear-gradient(135deg, var(--gold), #8b6623);
  color: #120f0a;
}

.secondary-action {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.08);
}

.content-band,
.legal-shell,
.info-shell {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 72px 0;
}

.section-heading {
  margin-bottom: 24px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
}

.feature-grid,
.legal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.feature-card,
.legal-grid article,
.product-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035));
  box-shadow: var(--shadow);
  transition: transform 0.28s ease, border-color 0.28s ease, background 0.28s ease, box-shadow 0.28s ease;
}

.feature-card:hover,
.legal-grid article:hover,
.product-card:hover,
.team-card:hover {
  transform: translateY(-6px);
  border-color: rgba(214, 168, 79, 0.36);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.48);
}

.feature-card {
  padding: 24px;
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: rgba(41, 210, 197, 0.12);
  color: var(--teal);
  font-weight: 900;
  transition: transform 0.28s ease;
}

.feature-card:hover .feature-icon {
  transform: rotate(-6deg) scale(1.08);
}

.feature-card h3,
.legal-grid h2,
.product-card h3 {
  margin: 18px 0 10px;
}

.feature-card p,
.legal-grid p,
.product-card p,
.login-content p {
  color: var(--muted);
  line-height: 1.7;
}

.login-error {
  min-height: 24px;
  margin-top: 14px;
  color: #ffd6da;
  font-weight: 700;
}

.legal-page {
  background:
    radial-gradient(circle at 20% 0%, rgba(214, 168, 79, 0.16), transparent 34%),
    radial-gradient(circle at 90% 20%, rgba(41, 210, 197, 0.12), transparent 30%),
    var(--bg);
}

.legal-shell h1 {
  max-width: 900px;
  font-size: clamp(2rem, 5.4vw, 4.1rem);
}

.legal-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 36px;
}

.legal-grid article {
  padding: 24px;
}

.legal-grid h2 {
  font-size: 1.1rem;
}

.info-page {
  background:
    radial-gradient(circle at 14% 12%, rgba(41, 210, 197, 0.14), transparent 32%),
    radial-gradient(circle at 86% 18%, rgba(214, 168, 79, 0.13), transparent 30%),
    var(--bg);
}

#factions {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

#factions .info-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  height: 100%;
  padding: clamp(22px, 4vh, 42px) 0;
}

#factions .faction-toolbar {
  justify-self: start;
}

#factions .faction-tabs {
  justify-self: start;
}

.info-heading {
  max-width: 760px;
  margin-bottom: 28px;
}

.info-heading h1 {
  margin: 0;
  font-size: clamp(2rem, 5.4vw, 4.1rem);
  line-height: 1.02;
}

.info-heading p:not(.eyebrow) {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.rules-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 18px;
}

.rules-access-card,
.rules-editor-card,
.rules-preview-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035));
  box-shadow: var(--shadow);
  animation: cardEnter 0.48s ease both;
}

.rules-access-card,
.rules-editor-card {
  padding: 22px;
}

.admin-login-card {
  position: relative;
  width: min(520px, 100%);
}

.admin-modal {
  position: fixed;
  z-index: 45;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
}

.admin-modal.hidden {
  display: none;
}

.admin-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.24s ease both;
}

.admin-modal .admin-login-card {
  z-index: 1;
  animation: cardEnter 0.28s ease both;
}

.admin-close-button {
  position: absolute;
  top: 14px;
  right: 14px;
}

.admin-open-button {
  position: absolute;
  top: 72px;
  right: 0;
  min-height: 46px;
  border: 1px solid rgba(214, 168, 79, 0.42);
  border-radius: 8px;
  padding: 0 24px;
  background: rgba(214, 168, 79, 0.12);
  color: var(--text);
  font-weight: 900;
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

.admin-open-button:hover {
  transform: translateY(-2px);
  border-color: rgba(214, 168, 79, 0.68);
  background: rgba(214, 168, 79, 0.2);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.3);
}

.rules-preview-card {
  padding: 24px;
}

.rules-reader-card {
  width: min(920px, 100%);
}

#rules .info-shell {
  display: grid;
  justify-items: center;
  position: relative;
}

#rules .info-heading {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

#rules .rules-preview-card,
#rules .rules-access-card {
  margin-left: auto;
  margin-right: auto;
}

#rules .rules-access-card {
  margin-top: 18px;
  text-align: center;
}

#rules .rules-actions {
  justify-content: center;
}

#rules .rules-preview {
  text-align: center;
}

.rules-access-card h2 {
  margin: 0 0 10px;
  font-size: 1.25rem;
}

.rules-access-card p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.65;
}

.rules-access-card label,
.rules-editor-card label {
  display: block;
  margin-bottom: 12px;
  color: var(--text);
  font-weight: 900;
}

#adminAccessCode,
#rulesEditor {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(5, 7, 11, 0.78);
  color: var(--text);
  font: inherit;
  line-height: 1.65;
  outline: none;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

#adminAccessCode {
  min-height: 50px;
}

#rulesEditor {
  min-height: 440px;
  resize: vertical;
}

#adminAccessCode:focus,
#rulesEditor:focus {
  border-color: rgba(41, 210, 197, 0.58);
  background: rgba(5, 7, 11, 0.94);
  box-shadow: 0 0 0 4px rgba(41, 210, 197, 0.08);
}

.rules-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 14px;
}

#rulesSaveStatus {
  color: var(--teal);
  font-weight: 800;
}

#adminAccessStatus {
  color: #ffd6da;
  font-weight: 800;
}

.rules-preview {
  min-height: 440px;
  white-space: pre-wrap;
  color: #d6dce0;
  line-height: 1.78;
}

.rules-preview:empty::before {
  content: "A szabályzat előnézete itt fog megjelenni.";
  color: var(--muted);
}

.faction-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.faction-tab {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.faction-tab.active,
.faction-tab:hover {
  background: linear-gradient(135deg, rgba(214, 168, 79, 0.24), rgba(41, 210, 197, 0.12));
  color: var(--text);
}

.faction-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.faction-admin-open {
  min-height: 40px;
}

.faction-overview {
  display: grid;
  grid-template-columns: minmax(260px, 1.35fr) repeat(2, minmax(170px, 0.8fr));
  gap: 12px;
  margin-top: 18px;
}

.faction-overview-card {
  min-height: 108px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.052);
}

.faction-overview-main {
  background:
    linear-gradient(135deg, rgba(214, 168, 79, 0.16), rgba(41, 210, 197, 0.08)),
    rgba(255, 255, 255, 0.052);
}

.faction-overview-card span,
.faction-detail-grid span,
.faction-focus span {
  display: block;
  margin-bottom: 8px;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.faction-overview-card strong {
  display: block;
  color: var(--text);
  font-size: clamp(1.08rem, 2vw, 1.42rem);
  line-height: 1.08;
}

.faction-overview-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.faction-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  min-height: 0;
  overflow: hidden;
  margin-top: 18px;
}

.faction-list {
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: 0;
  overflow: hidden;
}

.faction-list-scroll {
  max-height: 100%;
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--teal) rgba(255, 255, 255, 0.05);
}

.faction-list-scroll::-webkit-scrollbar {
  width: 10px;
}

.faction-list-scroll::-webkit-scrollbar-track {
  border-left: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.faction-list-scroll::-webkit-scrollbar-thumb {
  border: 2px solid rgba(7, 9, 13, 0.94);
  background: linear-gradient(180deg, rgba(41, 210, 197, 0.9), rgba(214, 168, 79, 0.72));
}

#factions .faction-detail {
  position: static;
  max-height: 100%;
  overflow: hidden;
}

.faction-group {
  display: grid;
  gap: 0;
}

.faction-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.052);
  color: var(--text);
  text-align: left;
}

.faction-group-copy {
  display: grid;
  gap: 4px;
}

.faction-group-copy strong {
  font-size: 0.9rem;
  line-height: 1.2;
}

.faction-group-copy small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.faction-count {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  border: 1px solid rgba(41, 210, 197, 0.24);
  border-radius: 8px;
  background: rgba(41, 210, 197, 0.14);
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 900;
}

.faction-group-toggle.active,
.faction-group-toggle:hover {
  border-color: rgba(214, 168, 79, 0.48);
  background: rgba(214, 168, 79, 0.12);
}

.faction-group-items {
  display: grid;
  gap: 10px;
  max-height: 0;
  margin: 0 0 0 14px;
  padding-left: 12px;
  border-left: 1px solid transparent;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateY(-6px);
  transition: max-height 0.32s ease, margin-top 0.22s ease, opacity 0.22s ease, transform 0.26s ease, border-color 0.22s ease;
}

.faction-group-items.open {
  max-height: 520px;
  margin-top: 8px;
  border-left-color: rgba(214, 168, 79, 0.24);
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.faction-button {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 70px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  text-align: left;
}

.faction-button-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(214, 168, 79, 0.24);
  border-radius: 8px;
  background: rgba(214, 168, 79, 0.1);
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 900;
}

.faction-button-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.faction-button-copy strong {
  overflow-wrap: anywhere;
  line-height: 1.2;
}

.faction-button-copy span {
  color: var(--muted);
  font-size: 0.78rem;
}

.faction-button em {
  justify-self: end;
  max-width: 116px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
}

.faction-button.active,
.faction-button:hover {
  border-color: rgba(41, 210, 197, 0.48);
  background: rgba(41, 210, 197, 0.1);
  box-shadow: inset 3px 0 0 var(--teal);
}

.faction-button.active .faction-button-mark,
.faction-button:hover .faction-button-mark {
  border-color: rgba(41, 210, 197, 0.42);
  background: rgba(41, 210, 197, 0.14);
  color: var(--teal);
}

.faction-detail,
.team-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035));
  box-shadow: var(--shadow);
  transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

.faction-detail {
  position: sticky;
  top: 104px;
  display: grid;
  gap: 18px;
  min-height: 0;
  padding: 24px;
  overflow: hidden;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.faction-detail-head {
  display: flex;
  align-items: center;
  gap: 18px;
}

.faction-empty-state {
  display: grid;
  align-content: center;
  min-height: 220px;
}

.faction-empty-state .product-tag {
  justify-self: start;
}

.faction-empty-state p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.faction-admin-panel {
  position: fixed;
  z-index: 44;
  inset: 76px 0 0;
  display: grid;
  place-items: center;
  padding: 18px;
}

.faction-admin-panel.hidden {
  display: none;
}

.faction-admin-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(8px);
}

.faction-admin-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(1120px, 100%);
  height: min(790px, calc(100vh - 112px));
  max-height: calc(100vh - 112px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 13, 18, 0.96);
  box-shadow: var(--shadow);
}

.faction-admin-head,
.faction-admin-list-head,
.faction-admin-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.faction-admin-head {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.faction-admin-head h2,
.faction-admin-list-head h3 {
  margin: 0;
}

.faction-admin-layout {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.1fr);
  gap: 18px;
  min-height: 0;
  padding: 18px;
  overflow: hidden;
}

.faction-admin-layout.is-scrollable {
  overflow-y: auto;
}

.faction-admin-list,
.faction-admin-form {
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow-y: hidden;
  overscroll-behavior: contain;
}

.faction-admin-list.is-scrollable,
.faction-admin-form.is-scrollable {
  overflow-y: auto;
}

.faction-admin-list {
  display: grid;
  gap: 14px;
  align-content: start;
  padding-right: 10px;
  padding-bottom: 34px;
}

#factionAdminList {
  display: grid;
  gap: 14px;
}

.faction-admin-filter {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.035);
}

.faction-admin-filter button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.faction-admin-filter button.active {
  background: rgba(41, 210, 197, 0.16);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(41, 210, 197, 0.28);
}

.faction-admin-group {
  display: grid;
  gap: 8px;
}

.faction-admin-group h4 {
  margin: 0;
  color: var(--gold);
  font-size: 0.84rem;
  text-transform: uppercase;
}

.faction-admin-edit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.052);
  color: var(--text);
  text-align: left;
}

.faction-admin-edit span,
.faction-admin-edit small {
  display: block;
}

.faction-admin-edit small {
  margin-top: 2px;
  color: var(--muted);
}

.faction-admin-edit em {
  color: var(--teal);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
}

.faction-admin-empty {
  margin: 0;
  color: var(--muted);
}

.faction-admin-form {
  display: grid;
  align-content: start;
  gap: 10px;
  padding-right: 10px;
  padding-bottom: 10px;
}

.faction-admin-form label {
  color: var(--text);
  font-weight: 900;
}

.native-select-hidden,
.native-select-hidden[hidden],
.custom-select[hidden] {
  display: none !important;
}

.faction-admin-form input,
.faction-admin-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(5, 7, 11, 0.78);
  color: var(--text);
  font: inherit;
  outline: none;
}

.faction-admin-form textarea {
  min-height: 132px;
  resize: vertical;
}

.faction-admin-form input:focus,
.faction-admin-form textarea:focus {
  border-color: rgba(41, 210, 197, 0.58);
  box-shadow: 0 0 0 4px rgba(41, 210, 197, 0.08);
}

.custom-select {
  display: grid;
}

.custom-select-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 47px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: rgba(5, 7, 11, 0.86);
  color: var(--text);
  font: inherit;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
}

.custom-select.open .custom-select-button,
.custom-select-button:focus-visible {
  border-color: rgba(41, 210, 197, 0.72);
  box-shadow: 0 0 0 4px rgba(41, 210, 197, 0.08);
  outline: none;
}

.custom-select-arrow {
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: 0.78;
  transition: transform 0.18s ease;
}

.custom-select.open .custom-select-arrow {
  transform: rotate(225deg) translateY(-2px);
}

.custom-select-menu {
  display: grid;
  max-height: 0;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 6px;
  background: rgb(8, 10, 15);
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.46);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: max-height 0.22s ease, opacity 0.18s ease, padding 0.18s ease, transform 0.18s ease;
}

.custom-select.open .custom-select-menu {
  max-height: 192px;
  overflow-y: auto;
  border-color: rgba(41, 210, 197, 0.34);
  padding: 6px;
  margin-top: 6px;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.custom-select-menu button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
}

.custom-select-menu button:hover,
.custom-select-menu button[aria-selected="true"] {
  background: rgba(41, 210, 197, 0.14);
  color: var(--text);
}

#factionAdminStatusText {
  color: var(--teal);
  font-weight: 900;
}

.faction-emblem {
  display: grid;
  place-items: center;
  flex: 0 0 76px;
  width: 76px;
  height: 76px;
  border: 1px solid rgba(214, 168, 79, 0.42);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(214, 168, 79, 0.2), rgba(41, 210, 197, 0.14)),
    rgba(255, 255, 255, 0.05);
  color: var(--gold);
  font-size: 1.25rem;
  font-weight: 900;
}

.faction-detail h2 {
  margin: 12px 0 8px;
  font-size: clamp(1.65rem, 3vw, 2.55rem);
  line-height: 1;
}

.faction-detail-head p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.faction-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.faction-detail-grid div,
.faction-description,
.faction-focus {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.14);
}

.faction-detail-grid strong,
.faction-focus strong {
  display: block;
  color: var(--text);
  line-height: 1.35;
}

.faction-description h3 {
  margin: 0 0 10px;
  font-size: 0.92rem;
}

.faction-description p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.team-hierarchy {
  position: relative;
  display: grid;
  gap: 34px;
  margin-top: 28px;
}

#team .team-hierarchy {
  margin-top: 0;
}

.team-hierarchy::before {
  content: "";
  position: absolute;
  top: 76px;
  bottom: 42px;
  left: 50%;
  width: 1px;
  background: linear-gradient(180deg, rgba(214, 168, 79, 0.7), rgba(41, 210, 197, 0.45), rgba(255, 255, 255, 0.08));
  transform: translateX(-50%);
}

.team-tier {
  position: relative;
  display: grid;
  gap: 16px;
}

.team-tier::before {
  display: none;
}

.team-tier-head {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 14px;
  width: min(520px, 100%);
  margin: 0 auto;
  padding: 14px 16px;
  border: 1px solid rgba(214, 168, 79, 0.24);
  border-radius: 8px;
  background: rgba(7, 9, 13, 0.88);
  text-align: left;
}

.team-tier-head > span {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(41, 210, 197, 0.28);
  border-radius: 8px;
  background: rgba(41, 210, 197, 0.1);
  color: var(--teal);
  font-weight: 900;
}

.team-tier-head h2 {
  margin: 0 0 6px;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
}

.team-tier-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.team-tier-members {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.team-tier-owners {
  grid-template-columns: repeat(2, minmax(220px, 340px));
  justify-content: center;
}

.team-tier-leads {
  grid-template-columns: repeat(2, minmax(220px, 340px));
  justify-content: center;
}

.team-tier-control {
  grid-template-columns: repeat(2, minmax(220px, 340px));
  justify-content: center;
}

.team-card {
  position: relative;
  min-height: 100%;
  padding: 22px;
  overflow: hidden;
  animation: cardEnter 0.48s ease both;
}

.team-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 3px solid rgba(41, 210, 197, 0.42);
  pointer-events: none;
}

.team-card-owner {
  padding: 26px;
  background:
    linear-gradient(135deg, rgba(214, 168, 79, 0.18), rgba(41, 210, 197, 0.06)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035));
}

.team-card-owner::before {
  border-top-color: rgba(214, 168, 79, 0.7);
}

.team-card-lead::before {
  border-top-color: rgba(41, 210, 197, 0.68);
}

.team-card-control::before {
  border-top-color: rgba(255, 255, 255, 0.24);
}

.team-card:nth-child(2),
.product-card:nth-child(2),
.feature-card:nth-child(2) {
  animation-delay: 0.06s;
}

.team-card:nth-child(3),
.product-card:nth-child(3),
.feature-card:nth-child(3) {
  animation-delay: 0.12s;
}

.team-card:nth-child(4) {
  animation-delay: 0.18s;
}

.team-card:nth-child(5) {
  animation-delay: 0.24s;
}

.team-card:nth-child(6) {
  animation-delay: 0.3s;
}

.team-photo {
  display: block;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  border: 2px solid rgba(214, 168, 79, 0.56);
  object-fit: cover;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  animation: portraitFloat 4.4s ease-in-out infinite;
}

.team-card:hover .team-photo {
  border-color: rgba(41, 210, 197, 0.72);
  box-shadow: 0 18px 42px rgba(41, 210, 197, 0.16);
  transform: scale(1.05) rotate(-2deg);
}

.team-card-owner .team-photo {
  width: 96px;
  height: 96px;
}

.team-card h3 {
  margin: 18px 0 10px;
  font-size: 1.12rem;
}

.team-card-owner h3 {
  font-size: 1.22rem;
}

.team-rank {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(41, 210, 197, 0.32);
  border-radius: 999px;
  background: rgba(41, 210, 197, 0.1);
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
}

.team-card p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.65;
}

.shop-page {
  background:
    linear-gradient(180deg, rgba(41, 210, 197, 0.08), rgba(41, 210, 197, 0)),
    var(--bg);
}

.shop-login {
  min-height: calc(100vh - 76px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
}

.login-visual {
  min-height: 360px;
  background:
    linear-gradient(90deg, rgba(7, 9, 13, 0.18), #07090d 95%),
    url("assets/onyx-hero.png") center / cover no-repeat;
  animation: heroDrift 24s ease-in-out infinite alternate;
}

.login-content {
  align-self: center;
  padding: clamp(28px, 6vw, 72px);
}

.login-content h1 {
  font-size: clamp(1.9rem, 4.5vw, 3.4rem);
}

.discord-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  background: var(--discord);
}

.discord-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  animation: softBounce 2.4s ease-in-out infinite;
}

.shop-app {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  min-height: calc(100vh - 76px);
}

.hidden {
  display: none;
}

.shop-sidebar {
  position: sticky;
  top: 76px;
  height: calc(100vh - 76px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px;
  border-right: 1px solid var(--line);
  background: rgba(10, 13, 18, 0.92);
}

.profile-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  animation: fadeRise 0.55s ease both;
}

.avatar {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--teal));
  color: #071014;
  font-weight: 900;
  animation: markPulse 3s ease-in-out infinite;
}

.discord-avatar {
  display: block;
  object-fit: cover;
}

.avatar.hidden,
.discord-avatar.hidden {
  display: none;
}

.profile-box span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
}

.shop-menu {
  display: grid;
  gap: 8px;
}

.shop-link,
.shop-admin-open,
.logout-button {
  width: 100%;
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 14px;
  font-size: 0.88rem;
  text-align: left;
  color: var(--muted);
  background: transparent;
}

.shop-link:hover,
.shop-link.active {
  border-color: rgba(214, 168, 79, 0.38);
  background: rgba(214, 168, 79, 0.1);
  color: var(--text);
  transform: translateX(4px);
}

.shop-admin-open {
  margin-top: auto;
  border-color: rgba(41, 210, 197, 0.34);
  color: var(--teal);
  font-weight: 900;
  text-align: center;
}

.shop-admin-open:hover {
  background: rgba(41, 210, 197, 0.12);
  border-color: rgba(41, 210, 197, 0.58);
  color: var(--text);
}

.logout-button {
  border-color: rgba(255, 90, 103, 0.34);
  color: #ffd6da;
  text-align: center;
}

.shop-main {
  padding: clamp(22px, 4vw, 42px);
}

.shop-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.shop-head h1 {
  font-size: clamp(1.7rem, 4vw, 3rem);
}

.cart-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  white-space: nowrap;
  animation: fadeRise 0.45s ease both;
}

.cart-pill:hover {
  border-color: rgba(41, 210, 197, 0.45);
  color: var(--text);
}

.cart-pill span {
  display: grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(41, 210, 197, 0.14);
  color: var(--teal);
  font-weight: 900;
}

.shop-subtabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 20px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.shop-subtabs.hidden {
  display: none;
}

.shop-subtab {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.shop-subtab:hover,
.shop-subtab.active {
  border-color: rgba(41, 210, 197, 0.42);
  background: rgba(41, 210, 197, 0.12);
  color: var(--text);
}

.custom-points-panel {
  display: grid;
  gap: 14px;
  width: min(560px, 100%);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.052);
}

.custom-points-panel.hidden,
.product-grid.hidden {
  display: none;
}

.custom-points-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.custom-points-head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.custom-points-head strong {
  color: var(--teal);
  white-space: nowrap;
}

.custom-points-panel label {
  color: var(--text);
  font-weight: 900;
}

.custom-points-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.custom-points-row input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(5, 7, 11, 0.78);
  color: var(--text);
  font: inherit;
  outline: none;
}

.custom-points-row input:focus {
  border-color: rgba(41, 210, 197, 0.58);
  box-shadow: 0 0 0 4px rgba(41, 210, 197, 0.08);
}

.custom-points-range {
  width: 100%;
  accent-color: var(--teal);
}

.custom-points-status {
  min-height: 20px;
  margin: 0;
  color: var(--gold);
  font-size: 0.86rem;
  font-weight: 800;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.product-card {
  display: flex;
  flex-direction: column;
  min-height: 256px;
  padding: 20px;
  animation: cardEnter 0.45s ease both;
}

.product-card-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  align-self: flex-start;
}

.product-tag {
  align-self: flex-start;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(41, 210, 197, 0.12);
  color: var(--teal);
  font-size: 0.7rem;
  font-weight: 800;
}

.product-sale-badge {
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(214, 168, 79, 0.18);
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 900;
}

.product-card-sale {
  border-color: rgba(214, 168, 79, 0.36);
}

.product-card p {
  margin: 0 0 20px;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
}

.price {
  color: var(--gold);
  font-size: 1rem;
  font-weight: 900;
}

.price-sale {
  display: grid;
  gap: 2px;
}

.price-sale strong {
  color: var(--gold);
  font-size: 1.08rem;
}

.old-price {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: line-through;
}

.product-button {
  min-width: 106px;
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--line);
}

.product-button:hover {
  background: var(--gold);
  color: #11100d;
}

.shop-admin-panel {
  position: fixed;
  z-index: 44;
  inset: 76px 0 0;
  display: grid;
  place-items: center;
  padding: 18px;
}

.shop-admin-panel.hidden {
  display: none;
}

.shop-admin-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(8px);
}

.shop-admin-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(1120px, 100%);
  height: min(790px, calc(100vh - 112px));
  max-height: calc(100vh - 112px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 13, 18, 0.96);
  box-shadow: var(--shadow);
}

.shop-admin-head,
.shop-admin-list-head,
.shop-admin-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.shop-admin-list-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.shop-admin-list-actions .active {
  border-color: rgba(214, 168, 79, 0.58);
  background: rgba(214, 168, 79, 0.14);
  color: var(--gold);
}

.shop-admin-head {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.shop-admin-head h2,
.shop-admin-list-head h3 {
  margin: 0;
}

.shop-admin-layout {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.1fr);
  gap: 18px;
  min-height: 0;
  padding: 18px;
  overflow: hidden;
}

.shop-admin-layout.is-scrollable {
  overflow-y: auto;
}

.shop-admin-list,
.shop-admin-editor-column {
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow-y: hidden;
  overscroll-behavior: contain;
}

.shop-admin-list.is-scrollable,
.shop-admin-editor-column.is-scrollable {
  overflow-y: auto;
}

.shop-admin-list,
.shop-admin-editor-column,
.shop-admin-form {
  display: grid;
  align-content: start;
  gap: 10px;
  padding-right: 10px;
  padding-bottom: 10px;
}

.shop-admin-form {
  height: auto;
  max-height: none;
  overflow: visible;
}

#shopAdminProductList {
  display: grid;
  gap: 8px;
}

.shop-bulk-sale-panel {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(214, 168, 79, 0.26);
  border-radius: 8px;
  padding: 12px;
  background: rgba(214, 168, 79, 0.06);
}

.shop-bulk-sale-panel[hidden] {
  display: none !important;
}

.shop-bulk-sale-row,
.shop-bulk-sale-tools {
  display: grid;
  gap: 8px;
}

.shop-bulk-sale-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.shop-bulk-sale-tools {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.shop-bulk-sale-panel input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(5, 7, 11, 0.78);
  color: var(--text);
  font: inherit;
  outline: none;
}

.shop-bulk-sale-panel input:focus {
  border-color: rgba(41, 210, 197, 0.58);
  box-shadow: 0 0 0 4px rgba(41, 210, 197, 0.08);
}

.shop-admin-product-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.shop-admin-product-row.selection-mode {
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: stretch;
}

.shop-admin-row-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.shop-product-select {
  display: grid;
  place-items: center;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.shop-product-select input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.shop-product-select span {
  position: relative;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-radius: 5px;
  background: rgba(5, 7, 11, 0.78);
}

.shop-product-select input:checked + span {
  border-color: var(--gold);
  background: var(--gold);
  box-shadow: 0 0 18px rgba(214, 168, 79, 0.22);
}

.shop-product-select input:checked + span::after {
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border-right: 2px solid #11100d;
  border-bottom: 2px solid #11100d;
  content: "";
  transform: rotate(45deg);
}

.shop-admin-edit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.052);
  color: var(--text);
  text-align: left;
}

.shop-admin-edit span,
.shop-admin-edit small {
  display: block;
}

.shop-admin-edit small {
  margin-top: 2px;
  color: var(--muted);
}

.shop-admin-edit em {
  color: var(--teal);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
}

.shop-admin-delete {
  min-height: 58px;
  padding: 0 12px;
  border: 1px solid rgba(255, 90, 103, 0.34);
  border-radius: 8px;
  background: rgba(255, 90, 103, 0.08);
  color: #ffd6da;
  font-size: 0.72rem;
  font-weight: 900;
}

.shop-admin-delete:hover {
  border-color: rgba(255, 90, 103, 0.62);
  background: rgba(255, 90, 103, 0.16);
  color: var(--text);
}

.shop-admin-empty {
  margin: 0;
  color: var(--muted);
}

.shop-admin-list label,
.shop-admin-form label {
  color: var(--text);
  font-weight: 900;
}

.shop-admin-form input:not([type="checkbox"]),
.shop-admin-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(5, 7, 11, 0.78);
  color: var(--text);
  font: inherit;
  outline: none;
}

.shop-admin-form textarea {
  min-height: 190px;
  resize: vertical;
}

.shop-admin-form input:not([type="checkbox"]):focus,
.shop-admin-form textarea:focus {
  border-color: rgba(41, 210, 197, 0.58);
  box-shadow: 0 0 0 4px rgba(41, 210, 197, 0.08);
}

.shop-sale-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.shop-sale-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
}

.shop-sale-fields {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(214, 168, 79, 0.24);
  border-radius: 8px;
  padding: 12px;
  background: rgba(214, 168, 79, 0.06);
}

.shop-sale-fields[hidden] {
  display: none !important;
}

#shopAdminStatusText {
  color: var(--teal);
  font-weight: 900;
}

.coupon-admin-card {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(41, 210, 197, 0.22);
  border-radius: 8px;
  padding: 14px;
  background: rgba(41, 210, 197, 0.045);
}

.coupon-admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.coupon-admin-head h3 {
  margin: 0;
}

#couponAdminStatusText {
  color: var(--teal);
  font-weight: 900;
}

.coupon-admin-form {
  display: grid;
  gap: 10px;
}

.coupon-admin-form label {
  color: var(--text);
  font-weight: 900;
}

.coupon-admin-form input:not([type="checkbox"]) {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(5, 7, 11, 0.78);
  color: var(--text);
  font: inherit;
  outline: none;
}

.coupon-admin-form input:focus {
  border-color: rgba(41, 210, 197, 0.58);
  box-shadow: 0 0 0 4px rgba(41, 210, 197, 0.08);
}

.coupon-admin-list {
  display: grid;
  gap: 8px;
}

.coupon-admin-item {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.045);
}

.coupon-admin-item div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.coupon-admin-item span,
.coupon-admin-item small {
  color: var(--muted);
}

.cart-modal {
  position: fixed;
  z-index: 40;
  top: 76px;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  place-items: stretch end;
}

.cart-modal.hidden {
  display: none;
}

.cart-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.24s ease both;
}

.cart-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(480px, 100%);
  min-height: calc(100vh - 76px);
  max-height: calc(100vh - 76px);
  overflow-y: auto;
  padding: 24px;
  border-left: 1px solid var(--line);
  background: #0b0f15;
  box-shadow: var(--shadow);
  animation: cartSlide 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.cart-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.cart-panel h2 {
  margin: 0;
  font-size: 1.55rem;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-weight: 900;
}

.close-icon {
  display: block;
  width: 18px;
  height: 18px;
  object-fit: contain;
  pointer-events: none;
}

.cart-items {
  display: grid;
  gap: 12px;
  padding: 18px 0;
}

.cart-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  animation: fadeRise 0.24s ease both;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.cart-item:hover {
  transform: translateX(-3px);
  border-color: rgba(41, 210, 197, 0.32);
}

.cart-item h3 {
  margin: 0 0 6px;
  font-size: 0.9rem;
}

.cart-item span {
  color: var(--muted);
  font-size: 0.8rem;
}

.remove-item {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid rgba(255, 90, 103, 0.36);
  border-radius: 8px;
  background: rgba(255, 90, 103, 0.08);
  color: #ffd6da;
  font-weight: 900;
}

.empty-cart {
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.cart-coupon {
  display: grid;
  gap: 9px;
  padding: 0 0 18px;
  border-bottom: 1px solid var(--line);
}

.cart-coupon label {
  color: var(--text);
  font-weight: 900;
}

.cart-coupon-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.cart-coupon input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(5, 7, 11, 0.78);
  color: var(--text);
  font: inherit;
  outline: none;
}

.cart-coupon input:focus {
  border-color: rgba(41, 210, 197, 0.58);
  box-shadow: 0 0 0 4px rgba(41, 210, 197, 0.08);
}

.cart-coupon p {
  min-height: 20px;
  margin: 0;
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 900;
}

.cart-coupon p.error {
  color: var(--red);
}

.remove-coupon-button {
  justify-self: start;
  min-height: 34px;
  border: 1px solid rgba(255, 90, 103, 0.36);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(255, 90, 103, 0.08);
  color: #ffd6da;
  font-weight: 900;
}

.cart-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.cart-summary span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.cart-summary strong {
  color: var(--gold);
}

.cart-discount-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 9px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.cart-discount-row strong {
  color: var(--teal);
}

.checkout-button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  padding: 0 20px;
  background: linear-gradient(135deg, var(--gold), #8b6623);
  color: #11100d;
  font-weight: 900;
}

.checkout-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.checkout-message {
  min-height: 24px;
  margin: 14px 0 0;
  color: var(--teal);
  line-height: 1.5;
}

.checkout-message.error {
  color: var(--red);
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.62s ease, transform 0.62s ease;
}

@keyframes topbarDrop {
  from {
    opacity: 0;
    transform: translateY(-24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeRise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes heroDrift {
  from {
    transform: scale(1.02) translate3d(-8px, -4px, 0);
  }
  to {
    transform: scale(1.08) translate3d(10px, 6px, 0);
  }
}

@keyframes markPulse {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(214, 168, 79, 0);
  }
  50% {
    box-shadow: 0 0 28px rgba(214, 168, 79, 0.3);
  }
}

@keyframes softBounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

@keyframes cartSlide {
  from {
    opacity: 0;
    transform: translateX(42px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes portraitFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

@media (max-width: 980px) {
  .topbar {
    align-items: center;
    flex-direction: row;
    min-height: 66px;
    gap: 10px;
    padding: 10px 14px;
  }

  .page {
    padding-top: 66px;
  }

  .cart-modal {
    top: 66px;
  }

  .cart-panel {
    min-height: calc(100vh - 66px);
    max-height: calc(100vh - 66px);
  }

  .feature-grid,
  .product-grid,
  .team-tier-members {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .faction-layout {
    grid-template-columns: 1fr;
  }

  .faction-overview {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .faction-detail {
    position: static;
  }

  .faction-admin-panel {
    inset: 66px 0 0;
  }

  .shop-admin-panel {
    inset: 66px 0 0;
  }

  .faction-admin-card {
    height: calc(100vh - 92px);
    max-height: calc(100vh - 92px);
  }

  .shop-admin-card {
    height: calc(100vh - 92px);
    max-height: calc(100vh - 92px);
  }

  .faction-admin-layout {
    grid-template-columns: 1fr;
    padding-bottom: 34px;
    overflow-y: hidden;
    overscroll-behavior: contain;
  }

  .shop-admin-layout {
    grid-template-columns: 1fr;
    padding-bottom: 34px;
    overflow-y: hidden;
    overscroll-behavior: contain;
  }

  .faction-admin-layout.is-scrollable {
    overflow-y: auto;
  }

  .shop-admin-layout.is-scrollable {
    overflow-y: auto;
  }

  .faction-admin-list,
  .faction-admin-form,
  .shop-admin-list,
  .shop-admin-editor-column,
  .shop-admin-form {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .admin-open-button {
    position: static;
    margin-top: 18px;
  }

  .shop-login,
  .shop-app,
  .rules-layout {
    grid-template-columns: 1fr;
  }

  .shop-sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .shop-menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .topbar {
    overflow: visible;
  }

  .menu-toggle {
    display: inline-grid;
    margin-left: auto;
  }

  .nav-points {
    position: absolute;
    top: calc(100% + 8px);
    left: 14px;
    right: 14px;
    flex: none;
    display: flex;
    align-items: stretch;
    flex-direction: column;
    justify-content: flex-start;
    gap: 6px;
    min-width: 0;
    max-height: calc(100vh - 88px);
    padding: 10px;
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    background: rgba(7, 9, 13, 0.97);
    box-shadow: 0 18px 54px rgba(0, 0, 0, 0.42);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    visibility: hidden;
  }

  .topbar.menu-open .nav-points {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    visibility: visible;
  }

  .nav-points .nav-dot {
    justify-content: flex-start;
    width: 100%;
    min-height: 40px;
    padding: 0 12px;
    border-radius: 8px;
  }

  .nav-points .nav-dot.active {
    background: rgba(41, 210, 197, 0.14);
    color: var(--text);
  }
}

@media (max-width: 700px) {
  .brand {
    gap: 8px;
    font-size: 0.78rem;
    white-space: nowrap;
  }

  .brand-logo {
    width: 32px;
    height: 32px;
  }

  .nav-dot {
    min-height: 32px;
    padding: 0 8px;
    font-size: 0.76rem;
  }

  .nav-points {
    justify-content: flex-start;
  }

  .hero-content {
    padding: 78px 0 72px;
  }

  .feature-grid,
  .legal-grid,
  .product-grid,
  .shop-menu,
  .team-tier-members,
  .team-tier-owners,
  .team-tier-control {
    grid-template-columns: 1fr;
  }

  .team-hierarchy {
    gap: 28px;
  }

  .team-hierarchy::before,
  .team-tier::before {
    display: none;
  }

  .team-tier {
    padding-left: 14px;
    border-left: 1px solid rgba(214, 168, 79, 0.28);
  }

  .team-tier-head {
    grid-template-columns: 46px minmax(0, 1fr);
    padding: 12px;
  }

  .team-tier-head > span {
    width: 46px;
    height: 46px;
  }

  .faction-tabs {
    display: grid;
    width: 100%;
  }

  .faction-toolbar,
  .faction-admin-head,
  .faction-admin-list-head,
  .faction-admin-actions,
  .shop-head,
  .shop-admin-head,
  .shop-admin-list-head,
  .shop-admin-list-actions,
  .shop-admin-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .faction-admin-open,
  .faction-admin-actions button,
  .shop-admin-open,
  .shop-admin-list-actions button,
  .shop-admin-actions button {
    width: 100%;
  }

  .shop-bulk-sale-row,
  .shop-bulk-sale-tools {
    grid-template-columns: 1fr;
  }

  .shop-admin-row-main {
    grid-template-columns: 1fr;
  }

  .shop-admin-delete {
    min-height: 40px;
  }

  .faction-overview,
  .faction-detail-grid {
    grid-template-columns: 1fr;
  }

  .faction-button {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .faction-button em {
    grid-column: 2;
    justify-self: start;
    max-width: 100%;
  }

  .faction-detail-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .shop-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .shop-subtabs {
    display: grid;
    width: 100%;
  }

  .custom-points-head,
  .custom-points-row {
    grid-template-columns: 1fr;
  }

  .custom-points-head {
    display: grid;
  }

  .custom-points-head strong {
    white-space: normal;
  }

  .product-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .product-button {
    width: 100%;
  }

  .cart-panel {
    width: 100%;
  }

  .cart-coupon-row {
    grid-template-columns: 1fr;
  }

  .cart-coupon-row button,
  .remove-coupon-button {
    width: 100%;
  }

  .cart-summary {
    align-items: stretch;
    flex-direction: column;
  }

  #rulesEditor,
  .rules-preview {
    min-height: 320px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
