:root {
  --gold: #c8982a;
  --gold-light: #f0c84a;
  --gold-dim: #8a6516;
  --amber: #d4890a;
  --amber-glow: rgba(212,137,10,0.35);
  --bg-deep: #0d0a06;
  --bg-dark: #13100a;
  --bg-card: #1a150d;
  --bg-panel: #201a10;
  --stone: #2a2318;
  --copper: #b5651d;
  --text-warm: #e8d8b0;
  --text-dim: #a08060;
  --text-muted: #604830;
  --border-gold: rgba(200,152,42,0.3);
  --border-amber: rgba(212,137,10,0.2);
  --shadow-gold: 0 0 30px rgba(200,152,42,0.15);
  --shadow-deep: 0 8px 40px rgba(0,0,0,0.8);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg-deep);
  color: var(--text-warm);
  font-family: 'EB Garamond', serif;
  font-size: 16px;
  overflow-x: hidden;
  cursor: default;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 3px; }

#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
}

/* Navigation */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: linear-gradient(180deg, rgba(13,10,6,0.98) 0%, rgba(13,10,6,0.85) 100%);
  border-bottom: 1px solid var(--border-gold);
  backdrop-filter: blur(12px);
  padding: 0 40px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 30px rgba(0,0,0,0.6);
}

.nav-logo {
  font-family: 'Cinzel Decorative', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 0 20px var(--amber-glow), 0 0 40px rgba(200,152,42,0.2);
  letter-spacing: 4px;
  text-decoration: none;
  cursor: pointer;
}

.nav-links {
  display: flex;
  gap: 6px;
  align-items: center;
  list-style: none;
}

.nav-links li a {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 3px;
  transition: all 0.3s;
  position: relative;
  cursor: pointer;
}

.nav-links li a::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  right: 50%;
  height: 1px;
  background: var(--gold);
  transition: all 0.3s;
  box-shadow: 0 0 6px var(--amber);
}

.nav-links li a:hover {
  color: var(--gold-light);
}

.nav-links li a:hover::after {
  left: 14%;
  right: 14%;
}

.nav-links li a.active {
  color: var(--gold);
}

.nav-links li a.active::after {
  left: 14%;
  right: 14%;
}

.nav-discord {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
  padding: 8px 20px;
  border: 1px solid var(--border-gold);
  border-radius: 3px;
  transition: all 0.3s;
  background: rgba(200,152,42,0.05);
  cursor: pointer;
}

.nav-discord:hover {
  background: rgba(200,152,42,0.15);
  border-color: var(--gold);
  box-shadow: 0 0 15px var(--amber-glow);
}

/* Pages */
.page {
  display: none;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.page.active {
  display: block;
}

/* Hero Section */
#page-home {
  display: none;
  background: radial-gradient(ellipse at 50% 30%, rgba(212,137,10,0.06) 0%, transparent 60%),
              radial-gradient(ellipse at 0% 100%, rgba(181,101,29,0.04) 0%, transparent 50%),
              var(--bg-deep);
}

#page-home.active {
  display: block;
}

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 120px 40px 80px;
  text-align: center;
  position: relative;
}

.hero::before,
.hero::after {
  content: '';
  position: absolute;
  width: 200px;
  height: 200px;
  border: 1px solid var(--border-gold);
  opacity: 0.4;
}

.hero::before {
  top: 80px;
  left: 40px;
  border-right: none;
  border-bottom: none;
}

.hero::after {
  bottom: 40px;
  right: 40px;
  border-left: none;
  border-top: none;
}

.hero-emblem {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 0 auto 40px;
  animation: emblemFloat 6s ease-in-out infinite;
}

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

.emblem-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--gold);
  box-shadow: 0 0 20px var(--amber-glow), inset 0 0 20px var(--amber-glow);
  animation: ringPulse 3s ease-in-out infinite;
}

.emblem-ring-outer {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 1px solid var(--border-gold);
  animation: ringRotate 20s linear infinite;
}

.emblem-ring-outer::before {
  content: '✦';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--gold);
  font-size: 14px;
}

.emblem-ring-outer::after {
  content: '✦';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--gold);
  font-size: 14px;
}

@keyframes ringPulse {
  0%, 100% { box-shadow: 0 0 20px var(--amber-glow), inset 0 0 20px var(--amber-glow); }
  50% { box-shadow: 0 0 40px rgba(212,137,10,0.5), inset 0 0 30px rgba(212,137,10,0.3); }
}

@keyframes ringRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.emblem-img {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  transition: box-shadow 0.5s;
  filter: drop-shadow(0 0 10px rgba(212,137,10,0.3));
}

.hero-emblem:hover .emblem-img {
  box-shadow: 0 0 40px rgba(212,137,10,0.6);
}

.hero-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(56px, 8vw, 96px);
  font-weight: 700;
  color: transparent;
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 40%, var(--amber) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: none;
  letter-spacing: 12px;
  line-height: 1;
  position: relative;
  animation: titleGlow 4s ease-in-out infinite;
  filter: drop-shadow(0 0 30px rgba(200,152,42,0.4));
}

@keyframes titleGlow {
  0%, 100% { filter: drop-shadow(0 0 20px rgba(200,152,42,0.3)); }
  50% { filter: drop-shadow(0 0 50px rgba(212,137,10,0.6)); }
}

.hero-divider {
  width: 300px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 20px auto;
  position: relative;
}

.hero-divider::before {
  content: '⚔';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: var(--gold);
  font-size: 16px;
  background: var(--bg-deep);
  padding: 0 10px;
}

.hero-subtitle {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 40px;
}

.section-hero-lite {
  margin-bottom: 18px;
  padding: 34px 20px 22px;
  border: 1px solid rgba(200, 152, 42, 0.32);
  background: linear-gradient(180deg, rgba(18, 13, 7, 0.96) 0%, rgba(10, 8, 5, 0.98) 100%);
  text-align: center;
}

.section-hero-title {
  margin: 0;
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(34px, 5.8vw, 72px);
  letter-spacing: 10px;
  text-transform: uppercase;
  color: transparent;
  background: linear-gradient(180deg, #f0c84a 0%, #d8a32f 44%, #a87312 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 16px rgba(216, 163, 47, 0.28));
}

.section-hero-divider {
  width: min(240px, 60vw);
  height: 1px;
  margin: 14px auto 12px;
  background: linear-gradient(90deg, transparent, rgba(216, 163, 47, 0.75), transparent);
  position: relative;
}

.section-hero-divider::before {
  content: '⚔';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -52%);
  font-size: 12px;
  color: #d8a32f;
  background: #100c06;
  padding: 0 8px;
}

.section-hero-subtitle {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: #b98d40;
}

.hero-tagline {
  font-family: 'EB Garamond', serif;
  font-size: 18px;
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 50px;
  max-width: 500px;
}

.hero-stats {
  display: flex;
  gap: 50px;
  margin-top: 30px;
}

.public-section {
  min-height: 100vh;
  padding: 110px 40px 80px;
  background: radial-gradient(circle at 15% 20%, rgba(212,137,10,0.08), transparent 40%),
              radial-gradient(circle at 85% 80%, rgba(200,152,42,0.06), transparent 45%),
              var(--bg-deep);
}

.section-header {
  text-align: center;
  max-width: 840px;
  margin: 0 auto 36px;
}

.section-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(30px, 4vw, 48px);
  color: var(--gold-light);
  letter-spacing: 2px;
}

.section-sub {
  margin-top: 8px;
  color: var(--text-dim);
  font-size: 18px;
}

.public-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
}

.public-card {
  background: linear-gradient(180deg, rgba(32,26,16,0.9), rgba(26,21,13,0.85));
  border: 1px solid var(--border-gold);
  border-radius: 10px;
  padding: 22px;
  box-shadow: var(--shadow-deep);
}

.public-card h3 {
  font-family: 'Cinzel', serif;
  color: var(--gold);
  margin-bottom: 10px;
}

.public-card p {
  color: var(--text-warm);
  line-height: 1.5;
}

.recruitment-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recruitment-links a,
.recruitment-links span {
  color: var(--text-warm);
  text-decoration: none;
  word-break: break-word;
}

.recruitment-links a:hover {
  color: var(--gold-light);
}

.public-meta {
  display: block;
  margin-top: 12px;
  color: var(--text-dim);
  font-size: 14px;
}

.public-card-wide {
  max-width: 1000px;
  margin: 0 auto;
}

.metrics-row {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-card {
  background: rgba(26,21,13,0.9);
  border: 1px solid var(--border-gold);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
}

.metric-value {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 34px;
  color: var(--gold-light);
}

.metric-label {
  display: block;
  margin-top: 6px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 12px;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-stat-num {
  font-family: 'Cinzel', serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 5px;
}

.hero-stat-label {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
}

.screen {
  display: none;
  min-height: 100vh;
}

.screen.active {
  display: flex;
}

/* Auth Screen */
#auth-screen {
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 1;
  display: none;
}

#auth-screen.active {
  display: flex;
}

.auth-container {
  background: var(--bg-card);
  border: 2px solid var(--border-gold);
  border-radius: 8px;
  padding: 40px;
  width: 90%;
  max-width: 450px;
  box-shadow: var(--shadow-deep);
}

.auth-logo {
  text-align: center;
  margin-bottom: 30px;
}

.auth-logo h1 {
  font-family: 'Cinzel', serif;
  font-size: 48px;
  color: var(--gold);
  text-shadow: 0 0 20px var(--amber-glow);
  margin-bottom: 10px;
}

.auth-logo p {
  color: var(--text-dim);
  font-size: 18px;
}

.auth-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
}

.auth-tab {
  flex: 1;
  padding: 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border-amber);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.3s;
  font-family: 'Cinzel', serif;
  font-size: 14px;
}

.auth-tab:hover {
  background: var(--stone);
  color: var(--gold-light);
}

.auth-tab.active {
  background: var(--gold-dim);
  color: var(--text-warm);
  border-color: var(--gold);
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-dim);
  font-size: 14px;
  font-family: 'Cinzel', serif;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border-amber);
  color: var(--text-warm);
  font-family: 'EB Garamond', serif;
  font-size: 16px;
  transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 10px var(--amber-glow);
}

.btn-primary,
.btn-secondary {
  width: 100%;
  padding: 14px;
  border: none;
  cursor: pointer;
  font-family: 'Cinzel', serif;
  font-size: 16px;
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-primary {
  background: transparent;
  color: var(--gold-light);
  border: 1px solid var(--gold);
  padding: 16px 48px;
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--gold-dim), var(--amber));
  transform: translateY(100%);
  transition: transform 0.4s;
  z-index: -1;
}

.btn-primary:hover {
  color: var(--bg-deep);
  box-shadow: 0 0 30px var(--amber-glow);
}

.btn-primary:hover::before {
  transform: translateY(0);
}

.btn-primary.is-loading,
.btn-secondary.is-loading {
  pointer-events: none;
  opacity: 0.85;
}

.btn-primary.is-loading {
  color: var(--gold-light);
}

.btn-primary.is-loading::after,
.btn-secondary.is-loading::after {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 10px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.8s linear infinite;
  vertical-align: -1px;
}

@keyframes btn-spin {
  to {
    transform: rotate(360deg);
  }
}

.btn-secondary {
  background: var(--bg-panel);
  color: var(--text-dim);
  border: 1px solid var(--border-amber);
}

.btn-secondary:hover {
  background: var(--stone);
  color: var(--gold-light);
}

/* Main Screen */
#main-screen {
  position: relative;
  z-index: 1;
  flex-direction: column;
  width: 100%;
  background: radial-gradient(ellipse at 50% 20%, rgba(212,137,10,0.06) 0%, transparent 55%), var(--bg-deep);
}

.sidebar {
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 20;
  height: auto;
  min-height: 64px;
  background: linear-gradient(180deg, rgba(13,10,6,0.98) 0%, rgba(13,10,6,0.85) 100%);
  border-right: none;
  border-bottom: 1px solid var(--border-gold);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 8px 28px;
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 30px rgba(0,0,0,0.6);
}

.sidebar-logo {
  padding: 0;
  border-bottom: none;
}

.sidebar-logo h2 {
  font-family: 'Cinzel Decorative', serif;
  font-size: 24px;
  color: var(--gold);
  letter-spacing: 4px;
  text-shadow: 0 0 20px var(--amber-glow), 0 0 40px rgba(200,152,42,0.2);
}

.sidebar-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  list-style: none;
  padding: 0;
  flex-wrap: wrap;
}

.sidebar-menu li {
  margin: 0;
}

.sidebar-menu a {
  display: inline-block;
  padding: 8px 14px;
  color: var(--text-dim);
  text-decoration: none;
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: all 0.3s;
  border-left: none;
  border-radius: 3px;
  position: relative;
}

.sidebar-menu a::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  right: 50%;
  height: 1px;
  background: var(--gold);
  transition: all 0.3s;
  box-shadow: 0 0 6px var(--amber);
}

.sidebar-menu a:hover {
  color: var(--gold-light);
}

.sidebar-menu a:hover::after {
  left: 14%;
  right: 14%;
}

.sidebar-menu a.active {
  color: var(--gold);
}

.sidebar-menu a.active::after {
  left: 14%;
  right: 14%;
}

.sidebar-footer {
  padding: 0;
  border-top: none;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-footer .btn-secondary {
  width: auto;
  padding: 8px 14px;
  font-size: 12px;
}

.user-info {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
  color: var(--text-dim);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.main-content {
  margin-left: 0;
  padding: 28px 40px 40px;
  min-height: 100vh;
  width: 100%;
  max-width: 1400px;
  margin-right: auto;
  margin-left: auto;
}

.page-preload-panel {
  display: none;
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid rgba(200, 152, 42, 0.4);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(22, 17, 10, 0.96) 0%, rgba(16, 12, 8, 0.98) 100%);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.3);
}

.page-preload-panel.active {
  display: block;
}

.page-preload-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--gold-light);
  font-family: 'Cinzel', serif;
  letter-spacing: 1px;
}

.page-preload-track {
  margin-top: 10px;
  height: 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.34);
  overflow: hidden;
}

.page-preload-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c8982a 0%, #f0c84a 50%, #f6dd8f 100%);
  transition: width 0.25s ease;
}

.page-preload-list {
  margin-top: 12px;
  display: grid;
  gap: 6px;
}

.page-preload-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.page-preload-item small {
  font-size: 10px;
  letter-spacing: 1px;
}

.page-preload-item.status-loading {
  color: #f0c84a;
}

.page-preload-item.status-done {
  color: #c4e7ba;
}

.page-preload-item.status-error {
  color: #f3adad;
}

.page-loading-shell {
  overflow: hidden;
}

.page-loading-track {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.32);
  overflow: hidden;
}

.page-loading-fill {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(200, 152, 42, 0.2) 0%, rgba(240, 200, 74, 0.95) 50%, rgba(200, 152, 42, 0.2) 100%);
  animation: page-loading-shift 1.1s linear infinite;
}

.page-loading-lines {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.page-loading-lines span {
  display: block;
  height: 11px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0%, rgba(240, 200, 74, 0.12) 50%, rgba(255, 255, 255, 0.03) 100%);
  animation: page-loading-pulse 1.4s ease-in-out infinite;
}

.page-loading-lines span:nth-child(2) {
  width: 86%;
  animation-delay: 0.18s;
}

.page-loading-lines span:nth-child(3) {
  width: 72%;
  animation-delay: 0.36s;
}

@keyframes page-loading-shift {
  from {
    transform: translateX(-130%);
  }
  to {
    transform: translateX(260%);
  }
}

@keyframes page-loading-pulse {
  0%, 100% {
    opacity: 0.45;
  }
  50% {
    opacity: 1;
  }
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: 8px;
  padding: 25px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-deep);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-amber);
}

.card-title {
  font-family: 'Cinzel', serif;
  font-size: 24px;
  color: var(--gold);
}

.stack {
  display: grid;
  gap: 20px;
}

.split-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.section-kicker {
  font-family: 'Cinzel', serif;
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.helper-text {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.45;
}

.status-banner {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border-amber);
  background: rgba(200,152,42,0.06);
  color: var(--text-warm);
  border-radius: 8px;
}

.option-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.option-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border-gold);
  background: rgba(32,26,16,0.7);
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--text-warm);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.option-chip:hover {
  border-color: var(--gold);
  box-shadow: 0 0 14px rgba(200,152,42,0.15);
  transform: translateY(-1px);
}

.option-chip input {
  width: auto;
  margin: 0;
  accent-color: var(--gold);
}

.list-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-amber);
}

.list-row:last-child {
  border-bottom: none;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.empty-state {
  padding: 24px;
  border: 1px dashed var(--border-gold);
  border-radius: 8px;
  color: var(--text-dim);
  text-align: center;
}

.media-preview {
  display: block;
  width: 100%;
  max-width: 820px;
  margin-top: 16px;
  border-radius: 10px;
  border: 1px solid var(--border-gold);
}

.code-block {
  margin-top: 16px;
  padding: 16px;
  border-radius: 8px;
  background: rgba(10, 8, 5, 0.85);
  border: 1px solid var(--border-amber);
  color: var(--text-warm);
  white-space: pre-wrap;
  line-height: 1.45;
  font-size: 14px;
}

.profile-shell {
  overflow: hidden;
}

.modal-wide {
  max-width: 1080px;
}

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

.detail-card {
  border: 1px solid var(--border-amber);
  border-radius: 8px;
  background: rgba(32,26,16,0.7);
  padding: 14px;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  justify-content: center;
  align-items: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border: 2px solid var(--border-gold);
  border-radius: 8px;
  padding: 40px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  right: 20px;
  top: 20px;
  font-size: 32px;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.3s;
}

.modal-close:hover {
  color: var(--gold);
}

.modal-content h2 {
  font-family: 'Cinzel', serif;
  color: var(--gold);
  margin-bottom: 25px;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
}

table th,
table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-amber);
}

table th {
  font-family: 'Cinzel', serif;
  color: var(--gold);
  font-weight: 600;
}

table td {
  color: var(--text-warm);
}

table tr:hover {
  background: var(--bg-panel);
}

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

.admin-row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.table-scroll {
  overflow-x: auto;
}

.chip {
  display: inline-block;
  border: 1px solid var(--border-gold);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  color: var(--gold-light);
}

.player-name {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  letter-spacing: 0.4px;
  display: inline-block;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 18px rgba(200, 152, 42, 0.12);
}

.player-name-member {
  background-image: linear-gradient(135deg, #dcc48a 0%, #f2e0a9 45%, #c8982a 100%);
}

.player-name-party_leader {
  background-image: linear-gradient(135deg, #fff4c1 0%, #f9d670 22%, #ff9f43 58%, #ffdf8d 100%);
  text-shadow: 0 0 24px rgba(255, 186, 64, 0.22);
}

.player-name-admin {
  background-image: linear-gradient(135deg, #fff7d1 0%, #ffd15c 20%, #ff7b54 55%, #ffe5a6 100%);
  text-shadow: 0 0 26px rgba(255, 132, 84, 0.26);
}

.role-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 1px solid var(--border-amber);
  background: rgba(32, 26, 16, 0.7);
  color: var(--text-warm);
}

.role-admin {
  background: linear-gradient(135deg, rgba(255, 217, 102, 0.22), rgba(255, 129, 91, 0.18));
  color: #ffe3a3;
  box-shadow: 0 0 18px rgba(255, 142, 76, 0.14);
}

.role-party_leader {
  background: linear-gradient(135deg, rgba(255, 238, 153, 0.22), rgba(255, 151, 59, 0.18));
  color: #ffeaa5;
  border-color: rgba(255, 193, 84, 0.45);
  box-shadow: 0 0 20px rgba(255, 174, 77, 0.16);
}

.forum-topic-card,
.forum-post-card {
  border: 1px solid var(--border-amber);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(39, 31, 20, 0.92), rgba(20, 16, 10, 0.96));
  padding: 18px;
}

.forum-topic-card + .forum-topic-card,
.forum-post-card + .forum-post-card {
  margin-top: 14px;
}

.forum-post-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.forum-post-body,
.forum-topic-preview,
.payout-cell-content {
  line-height: 1.5;
}

.forum-post-body {
  margin-top: 12px;
  color: var(--text-warm);
}

.forum-topic-preview {
  margin-top: 14px;
  color: var(--text-dim);
}

.forum-post-content p {
  margin: 0 0 10px;
}

.forum-post-content p:last-child {
  margin-bottom: 0;
}

.forum-post-content-empty {
  color: var(--text-dim);
  font-style: italic;
}

.forum-spacer {
  height: 10px;
}

.forum-list {
  margin: 8px 0 10px 22px;
}

.forum-blockquote {
  margin: 10px 0;
  padding: 10px 14px;
  border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0;
  background: rgba(200, 152, 42, 0.08);
  color: var(--text-warm);
}

.forum-code-block {
  margin: 10px 0;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-amber);
  background: rgba(10, 8, 5, 0.88);
  overflow-x: auto;
}

.forum-code-block code {
  font-family: Consolas, 'Courier New', monospace;
  font-size: 13px;
  color: #f5e8bb;
  white-space: pre;
}

.forum-link {
  color: #80c7ff;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  word-break: break-word;
}

.forum-link:hover {
  color: #b2ddff;
}

.forum-post-actions {
  margin-top: 12px;
}

.forum-filter-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.forum-filter-actions {
  align-items: flex-end;
}

.forum-editor-group {
  margin-top: 4px;
}

.forum-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.forum-editor-btn {
  border: 1px solid var(--border-amber);
  background: rgba(32, 26, 16, 0.9);
  color: var(--text-warm);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.forum-editor-btn:hover {
  border-color: var(--gold);
  background: rgba(200, 152, 42, 0.14);
}

.forum-editor-hint {
  margin-top: 8px;
}

.forum-editor-preview {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--border-amber);
  border-radius: 8px;
  background: rgba(16, 12, 8, 0.7);
}

.forum-attachments {
  margin-top: 14px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.forum-attachment-item {
  border: 1px solid rgba(200, 152, 42, 0.24);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(9, 7, 5, 0.84);
}

.forum-attachment-media {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  background: rgba(4, 3, 2, 0.92);
}

.forum-attachment-caption {
  padding: 8px 10px;
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.forum-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 1px solid var(--border-amber);
}

.forum-status-open {
  color: #8de2b2;
  background: rgba(53, 118, 78, 0.2);
}

.forum-status-closed {
  color: #ffb08d;
  background: rgba(122, 59, 27, 0.2);
}

.forum-status-resolved {
  color: #9ad3ff;
  background: rgba(30, 89, 123, 0.2);
}

.payout-toolbar {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.sheet-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sheet-tab {
  border: 1px solid var(--border-amber);
  background: rgba(32, 26, 16, 0.7);
  color: var(--text-warm);
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.sheet-tab:hover,
.sheet-tab.active {
  border-color: var(--gold);
  color: var(--gold-light);
  transform: translateY(-1px);
}

.payout-shell {
  border: 1px solid var(--border-amber);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(9, 7, 4, 0.82);
}

.payout-scroll {
  max-height: 70vh;
}

.payout-table {
  min-width: max-content;
}

.payout-table td {
  min-width: 72px;
  vertical-align: top;
  border: 1px solid rgba(200, 152, 42, 0.16);
  background: rgba(19, 15, 10, 0.95);
}

.payout-cell {
  cursor: default;
}

.payout-formula-cell {
  background: rgba(19, 38, 25, 0.95);
  color: #d7efd8;
}

.payout-editable-cell {
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(200, 152, 42, 0.16);
}

.payout-editable-cell:hover {
  box-shadow: inset 0 0 0 1px rgba(200, 152, 42, 0.55);
}

.payout-inline-input {
  width: 100%;
  border: 1px solid var(--border-gold);
  background: rgba(12, 10, 7, 0.96);
  color: var(--text-warm);
  padding: 8px 10px;
  border-radius: 6px;
  font: inherit;
}

body.page-mode-payout .main-content {
  max-width: none;
  padding: 0;
}

.page-content-admin {
  min-height: calc(100vh - 64px);
  width: 100%;
}

body.page-mode-admin .main-content {
  max-width: none;
  margin: 0;
  padding: 16px 20px 24px;
}

body.page-mode-admin .admin-row-actions {
  flex-wrap: wrap;
}

.page-content-payout {
  min-height: calc(100vh - 64px);
}

.payout-page-shell {
  min-height: calc(100vh - 64px);
  padding: 18px;
}

.payout-app {
  min-height: calc(100vh - 100px);
  display: grid;
  grid-template-rows: auto auto auto auto 1fr;
  gap: 14px;
  background:
    linear-gradient(180deg, rgba(26, 21, 13, 0.96) 0%, rgba(13, 10, 6, 0.98) 100%),
    radial-gradient(circle at top left, rgba(240, 200, 74, 0.08), transparent 35%);
  border: 1px solid var(--border-gold);
  border-radius: 16px;
  box-shadow: var(--shadow-deep);
  padding: 20px;
}

.payout-onlyoffice-app {
  grid-template-rows: auto auto 1fr;
}

.payout-onlyoffice-editor {
  min-height: calc(100vh - 240px);
  border: 1px solid rgba(200, 152, 42, 0.24);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(12, 9, 5, 0.96);
}

.payout-app:fullscreen {
  padding: 18px;
  border-radius: 0;
  border: none;
}

.payout-app-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.payout-app-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.payout-app-actions .btn-secondary,
.payout-app-actions .btn-primary {
  width: auto;
  padding: 10px 16px;
}

.payout-toolbar {
  display: grid;
  gap: 12px;
  margin: 0;
}

.excel-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(200, 152, 42, 0.24);
  border-radius: 10px;
  background: rgba(20, 16, 10, 0.95);
  overflow-x: auto;
}

.excel-toolbar-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-right: 10px;
  border-right: 1px solid rgba(200, 152, 42, 0.18);
}

.excel-toolbar-group:last-child {
  border-right: none;
  padding-right: 0;
}

.excel-toolbar select,
.excel-toolbar input[type="number"] {
  min-height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border-gold);
  background: rgba(12, 10, 7, 0.96);
  color: var(--text-warm);
  padding: 6px 8px;
  font: inherit;
}

.excel-toolbar .btn-secondary {
  width: auto;
  min-width: 36px;
  padding: 8px 10px;
}

#payout-font-name {
  min-width: 160px;
}

#payout-number-format {
  min-width: 140px;
}

.excel-toolbar .btn-secondary.active {
  border-color: #f0c84a;
  color: #f0c84a;
  box-shadow: inset 0 0 0 1px rgba(240, 200, 74, 0.45);
}

.excel-color-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-size: 12px;
}

.excel-color-field input[type="color"] {
  width: 34px;
  height: 26px;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.payout-formula-bar {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.payout-address-field,
.payout-formula-input {
  width: 100%;
  border: 1px solid var(--border-gold);
  background: rgba(12, 10, 7, 0.96);
  color: var(--text-warm);
  padding: 10px 12px;
  border-radius: 8px;
  font: inherit;
}

.payout-address-field {
  text-align: center;
  letter-spacing: 1px;
  font-family: 'Cinzel', serif;
}

.payout-selection-meta {
  min-height: 20px;
}

.payout-sheet-frame {
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--border-amber);
  border-radius: 14px;
  background: rgba(7, 6, 4, 0.92);
}

.payout-sections {
  display: grid;
  gap: 18px;
}

.payout-section-card {
  display: grid;
  gap: 12px;
}

.payout-grid-scroll {
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 290px);
  overflow: auto;
}

.payout-grid-table {
  border-collapse: separate;
  border-spacing: 0;
  min-width: max-content;
}

.payout-corner-cell,
.payout-col-header,
.payout-row-header {
  position: sticky;
  z-index: 3;
  background: linear-gradient(180deg, rgba(33, 26, 16, 0.98) 0%, rgba(19, 15, 10, 0.98) 100%);
  color: var(--gold-light);
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  text-align: center;
  border: 1px solid rgba(200, 152, 42, 0.18);
  min-width: 56px;
  padding: 10px 8px;
}

.payout-corner-cell {
  top: 0;
  left: 0;
  z-index: 5;
}

.payout-col-header {
  top: 0;
}

.payout-col-header-label {
  display: inline-block;
  pointer-events: none;
}

.payout-col-resizer {
  position: absolute;
  top: 0;
  right: -4px;
  width: 10px;
  height: 100%;
  cursor: col-resize;
  z-index: 8;
}

.payout-col-resizer::after {
  content: '';
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 4px;
  width: 1px;
  background: rgba(240, 200, 74, 0.38);
}

.payout-row-header {
  left: 0;
  z-index: 4;
  min-width: 58px;
}

.payout-col-header.active,
.payout-row-header.active {
  color: var(--bg-deep);
  background: linear-gradient(135deg, #f0c84a 0%, #c8982a 100%);
}

.payout-grid-cell {
  min-width: 92px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(200, 152, 42, 0.12);
  background: rgba(19, 15, 10, 0.96);
  vertical-align: middle;
  position: relative;
  cursor: default;
  overflow: hidden;
}

.payout-grid-cell.selected {
  box-shadow: inset 0 0 0 2px #f0c84a, 0 0 0 1px rgba(240, 200, 74, 0.45);
  z-index: 2;
}

.payout-grid-cell.drop-target {
  box-shadow: inset 0 0 0 2px #8fd3ff, 0 0 0 1px rgba(143, 211, 255, 0.55);
  background: rgba(20, 40, 54, 0.9);
}

.payout-grid-cell.editing {
  padding: 2px;
}

.payout-cell-content {
  display: block;
  min-height: 36px;
  padding: 8px 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.payout-cell-content.has-checkbox {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.payout-cell-checkbox-input {
  width: 18px;
  height: 18px;
  accent-color: #f0c84a;
  pointer-events: auto;
  cursor: pointer;
}

.payout-cell-content.has-media {
  padding: 4px;
}

.payout-cell-media-wrap {
  display: block;
  width: 100%;
  min-height: 30px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(200, 152, 42, 0.34);
  background: rgba(10, 8, 6, 0.92);
  position: relative;
}

.payout-cell-media {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.payout-cell-media-resizer {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  background:
    linear-gradient(135deg, transparent 0 35%, rgba(240, 200, 74, 0.86) 35% 45%, transparent 45% 60%, rgba(240, 200, 74, 0.92) 60% 70%, transparent 70%);
  z-index: 2;
}

.payout-cell-media-caption {
  margin-top: 4px;
  display: block;
  font-size: 10px;
  letter-spacing: 0.5px;
  color: rgba(238, 225, 198, 0.78);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.payout-formula-cell {
  background: linear-gradient(180deg, rgba(24, 43, 29, 0.96) 0%, rgba(18, 31, 21, 0.98) 100%);
  color: #d7efd8;
}

.payout-font-bold {
  font-weight: 700;
}

.payout-font-italic {
  font-style: italic;
}

.payout-font-underline .payout-cell-content {
  text-decoration: underline;
}

.payout-wrap-text .payout-cell-content {
  white-space: normal;
  overflow: visible;
  text-overflow: initial;
  word-break: break-word;
}

.payout-editable-cell {
  cursor: cell;
}

.payout-editable-cell:hover {
  background: rgba(34, 25, 14, 0.98);
}

.requirement-editor-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(200px, 1.4fr) auto auto;
  gap: 10px;
  align-items: center;
}

/* Utility */
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 768px) {
  nav {
    padding: 0 20px;
    height: auto;
    flex-direction: column;
    padding: 15px 20px;
  }

  .nav-logo {
    font-size: 18px;
    margin-bottom: 10px;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
  }

  .nav-links li a {
    font-size: 10px;
    padding: 6px 10px;
  }

  .nav-discord {
    margin-top: 10px;
    font-size: 10px;
    padding: 6px 15px;
  }

  .hero {
    padding: 100px 20px 60px;
  }

  .hero::before,
  .hero::after {
    width: 100px;
    height: 100px;
  }

  .hero-emblem {
    width: 150px;
    height: 150px;
    margin-bottom: 30px;
  }

  .hero-title {
    font-size: 48px;
    letter-spacing: 8px;
  }

  .hero-divider {
    width: 200px;
  }

  .hero-subtitle {
    font-size: 11px;
    letter-spacing: 4px;
  }

  .hero-tagline {
    font-size: 16px;
    padding: 0 20px;
  }

  .hero-stats {
    flex-direction: column;
    gap: 20px;
  }

  .public-section {
    padding: 100px 20px 60px;
  }

  .public-grid {
    grid-template-columns: 1fr;
  }

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

  .btn-primary {
    padding: 14px 36px !important;
    font-size: 14px;
  }

  .sidebar {
    position: relative;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px 16px;
    text-align: center;
  }

  .sidebar-menu {
    justify-content: center;
  }

  .sidebar-footer {
    justify-content: center;
    flex-direction: column;
  }

  .user-info {
    justify-content: center;
    flex-wrap: wrap;
  }

  .main-content {
    padding: 18px;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

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

  .split-header,
  .list-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .button-row {
    flex-direction: column;
  }

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

  .forum-post-meta {
    align-items: flex-start;
  }

  .forum-filter-grid {
    grid-template-columns: 1fr;
  }

  .forum-filter-actions {
    align-items: stretch;
  }

  .sheet-tabs {
    flex-direction: column;
  }

  .sheet-tab {
    width: 100%;
  }

  .payout-page-shell {
    padding: 12px;
  }

  .payout-app {
    min-height: calc(100vh - 88px);
    padding: 14px;
  }

  .payout-app-header {
    grid-template-columns: 1fr;
    display: grid;
  }

  .payout-app-actions {
    justify-content: stretch;
  }

  .payout-app-actions .btn-secondary,
  .payout-app-actions .btn-primary {
    width: 100%;
  }

  .payout-formula-bar {
    grid-template-columns: 1fr;
  }

  .excel-toolbar {
    gap: 8px;
    padding: 8px;
  }

  .excel-toolbar-group {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid rgba(200, 152, 42, 0.18);
    padding-right: 0;
    padding-bottom: 8px;
  }

  .excel-toolbar-group:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .excel-toolbar select,
  .excel-toolbar input[type="number"] {
    width: 100%;
  }

  .payout-grid-scroll {
    max-height: calc(100vh - 380px);
  }

  .requirement-editor-row {
    grid-template-columns: 1fr;
  }
}
