:root {
  color-scheme: dark;
  --bg: #05070b;
  --bg-2: #08111a;
  --panel: #101721;
  --panel-2: #141d2b;
  --panel-3: #182230;
  --line: rgba(224, 234, 244, 0.13);
  --line-strong: rgba(242, 201, 110, 0.32);
  --text: #f6f8fb;
  --muted: #aeb9c8;
  --muted-2: #8190a2;
  --gold: #d8a84b;
  --gold-2: #f3cd74;
  --ice: #7fd7f2;
  --ice-2: #1f8aa8;
  --danger: #e46b7c;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 18% 10%, rgba(127, 215, 242, 0.15), transparent 28%),
    radial-gradient(circle at 82% 26%, rgba(216, 168, 75, 0.13), transparent 30%),
    linear-gradient(125deg, rgba(8, 17, 26, 0.95), rgba(3, 5, 9, 0.98)),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(3rem, 8vw, 7rem);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(1.75rem, 3vw, 3.1rem);
  line-height: 1.02;
}

h3 {
  margin-bottom: 8px;
}

p {
  color: var(--muted);
  line-height: 1.72;
}

.public-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 220px 1fr auto;
  align-items: center;
  gap: 24px;
  min-height: 76px;
  padding: 12px clamp(18px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(5, 7, 11, 0.9);
  backdrop-filter: blur(18px);
}

.brand img {
  display: block;
  width: min(210px, 48vw);
  height: auto;
}

.nav-links {
  display: flex;
  justify-content: center;
  gap: 22px;
  color: var(--muted);
  font-size: 0.95rem;
}

.nav-links a:hover,
.footer-links a:hover,
.sidebar nav a:hover {
  color: var(--gold-2);
}

.public-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 18px;
  color: var(--text);
  cursor: pointer;
  font-weight: 850;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  border-color: rgba(242, 201, 110, 0.55);
  background: linear-gradient(135deg, #9d681e, var(--gold-2));
  color: #130d05;
  box-shadow: 0 16px 36px rgba(216, 168, 75, 0.24);
}

.button-secondary {
  border-color: rgba(127, 215, 242, 0.28);
  background: rgba(16, 53, 68, 0.82);
}

.button-ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.045);
}

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

.hero-section {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 560px);
  gap: clamp(26px, 5vw, 76px);
  align-items: center;
  min-height: calc(100svh - 90px);
  padding: clamp(44px, 7vw, 96px) clamp(18px, 6vw, 96px) 58px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-v2::before {
  content: "";
  position: absolute;
  inset: 7% 8% auto auto;
  width: 38vw;
  height: 38vw;
  max-width: 520px;
  max-height: 520px;
  border: 1px solid rgba(242, 201, 110, 0.14);
  border-radius: 999px;
  background: radial-gradient(circle, rgba(127, 215, 242, 0.14), transparent 62%);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  max-width: 760px;
}

.hero-text {
  max-width: 690px;
  font-size: clamp(1.05rem, 2vw, 1.32rem);
}

.hero-actions,
.button-row,
.demo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 620px;
  margin-top: 34px;
}

.hero-metrics div {
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.hero-metrics strong {
  display: block;
  color: var(--gold-2);
  font-size: 1.55rem;
}

.hero-metrics span {
  color: var(--muted);
  font-size: 0.88rem;
}

.hero-media {
  position: relative;
  display: grid;
  place-items: center;
}

.premium-crest {
  min-height: 520px;
}

.hero-logo {
  width: min(100%, 530px);
  filter: drop-shadow(0 28px 90px rgba(127, 215, 242, 0.18));
}

.crest-panel {
  position: absolute;
  right: 2%;
  bottom: 7%;
  display: grid;
  gap: 4px;
  min-width: 220px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 16px;
  background: rgba(6, 10, 16, 0.86);
  box-shadow: var(--shadow);
}

.crest-panel span,
.crest-panel small {
  color: var(--muted);
}

.crest-panel strong {
  color: var(--ice);
}

.story-band,
.split-section {
  display: grid;
  grid-template-columns: minmax(240px, 0.75fr) minmax(0, 1.25fr);
  gap: clamp(24px, 5vw, 70px);
  align-items: start;
  padding: clamp(44px, 7vw, 84px) clamp(18px, 6vw, 96px);
  border-bottom: 1px solid var(--line);
}

.premium-band {
  background: linear-gradient(90deg, rgba(216, 168, 75, 0.08), rgba(127, 215, 242, 0.05));
}

.section {
  padding: clamp(48px, 7vw, 96px) clamp(18px, 6vw, 96px);
}

.section.narrow {
  max-width: 980px;
  margin: 0 auto;
}

.section-heading {
  max-width: 790px;
  margin-bottom: 28px;
}

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

.reason-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.value-card,
.reason-card,
.panel,
.form-panel,
.table-panel,
.empty-state,
.profile-sheet,
.social-grid a,
.timeline article,
.application-note,
.application-steps {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025));
  box-shadow: var(--shadow);
}

.value-card,
.reason-card {
  min-height: 190px;
  padding: 22px;
}

.value-card span {
  display: block;
  width: 34px;
  height: 3px;
  margin-bottom: 22px;
  background: linear-gradient(90deg, var(--gold), var(--ice));
}

.reason-card span {
  color: var(--ice);
  font-weight: 900;
}

.why-section {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(4, 7, 12, 0.34);
}

.target-list {
  display: grid;
  gap: 12px;
}

.target-list article,
.benefit-list div {
  display: grid;
  gap: 6px;
  padding: 18px;
  border-left: 3px solid var(--gold);
  background: rgba(255, 255, 255, 0.045);
}

.target-list span,
.benefit-list span {
  color: var(--muted);
}

.application-preview {
  display: grid;
  grid-template-columns: minmax(260px, 0.65fr) minmax(320px, 1fr);
  gap: 22px;
  align-items: start;
}

.application-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 22px;
  align-items: end;
}

.application-steps {
  display: grid;
  gap: 10px;
  padding: 20px;
}

.application-steps span {
  color: var(--muted);
}

.application-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(320px, 1.25fr);
  gap: 20px;
  align-items: start;
}

.application-note {
  position: sticky;
  top: 94px;
  padding: 24px;
}

.mini-checklist {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.mini-checklist span {
  border: 1px solid rgba(127, 215, 242, 0.2);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
  background: rgba(127, 215, 242, 0.05);
}

.form-panel {
  display: grid;
  gap: 18px;
  padding: clamp(18px, 3vw, 28px);
}

.application-form-v2 {
  border-color: rgba(242, 201, 110, 0.18);
}

.form-kicker {
  display: grid;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.form-kicker span {
  color: var(--gold-2);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.form-kicker strong {
  font-size: 1.25rem;
}

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

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 7, 11, 0.72);
  color: var(--text);
  outline: none;
  padding: 13px 14px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(127, 215, 242, 0.62);
  box-shadow: 0 0 0 3px rgba(127, 215, 242, 0.1);
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  margin-top: 3px;
}

.page-hero {
  padding: clamp(54px, 8vw, 108px) clamp(18px, 6vw, 96px);
  border-bottom: 1px solid var(--line);
}

.page-hero.compact {
  max-width: 1050px;
}

.page-hero.compact h1,
.application-hero h1 {
  font-size: clamp(2.6rem, 7vw, 5.5rem);
}

.timeline,
.social-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: clamp(40px, 6vw, 80px) clamp(18px, 6vw, 96px);
}

.timeline article,
.social-grid a {
  padding: 24px;
}

.timeline span {
  color: var(--ice);
  font-weight: 900;
}

.social-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.social-grid a {
  display: grid;
  gap: 8px;
}

.social-grid span {
  color: var(--muted);
}

.auth-page {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(320px, 1.2fr);
  gap: clamp(22px, 4vw, 56px);
  align-items: center;
  min-height: calc(100svh - 77px);
  padding: clamp(30px, 6vw, 82px) clamp(18px, 6vw, 96px);
}

.auth-visual img {
  width: min(360px, 78vw);
}

.auth-visual h1 {
  font-size: clamp(2.4rem, 6vw, 5rem);
}

.auth-panels {
  display: grid;
  gap: 16px;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 34px clamp(18px, 6vw, 96px);
  border-top: 1px solid var(--line);
  background: #030407;
}

.footer img {
  width: 210px;
  max-width: 70vw;
}

.footer p {
  max-width: 620px;
}

.footer-links {
  display: grid;
  gap: 10px;
  color: var(--muted);
}

.legal-footer {
  display: grid;
  gap: 4px;
  padding: 18px clamp(18px, 5vw, 72px);
  border-top: 1px solid rgba(242, 201, 110, 0.16);
  background:
    linear-gradient(90deg, rgba(216, 168, 75, 0.055), rgba(127, 215, 242, 0.035)),
    rgba(2, 3, 6, 0.95);
  color: rgba(246, 248, 251, 0.62);
  font-size: 0.78rem;
  text-align: center;
}

.legal-footer p {
  margin: 0;
  color: inherit;
  line-height: 1.45;
}

.legal-doc {
  display: grid;
  gap: 30px;
}

.legal-updated {
  margin: 0;
  color: var(--muted-2);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.legal-block {
  display: grid;
  gap: 12px;
}

.legal-block h2 {
  margin: 0;
  font-size: clamp(1.3rem, 3vw, 2rem);
  color: var(--text);
}

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

.legal-block ul {
  margin: 4px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 9px;
}

.legal-block li {
  color: var(--muted);
  line-height: 1.65;
}

.legal-block strong {
  color: var(--text);
}

.legal-block a {
  color: var(--ice);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(320px, 1.15fr);
  gap: 22px;
  align-items: start;
}

.contact-intro {
  display: grid;
  gap: 16px;
}

.contact-intro h2 {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2.1rem);
}

.contact-intro p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.contact-email {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid rgba(242, 201, 110, 0.25);
  border-radius: 8px;
  background: rgba(242, 201, 110, 0.05);
}

.contact-email span {
  color: var(--gold-2);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.contact-email strong {
  color: var(--text);
  font-size: 1.05rem;
}

.contact-support-note a,
.contact-intro a {
  color: var(--ice);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.support-doc {
  display: grid;
  gap: 34px;
}

.support-block {
  display: grid;
  gap: 12px;
}

.support-block h2 {
  margin: 0;
  font-size: clamp(1.3rem, 3vw, 2rem);
  color: var(--text);
}

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

.support-block a {
  color: var(--ice);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 0 18px;
}

.faq-item + .faq-item {
  margin-top: 10px;
}

.faq-item summary {
  cursor: pointer;
  padding: 16px 0;
  font-weight: 800;
  color: var(--text);
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  float: right;
  color: var(--ice);
  font-weight: 900;
}

.faq-item[open] summary {
  color: var(--ice);
}

.faq-item[open] summary::after {
  content: "\2212";
}

.faq-answer {
  padding: 0 0 18px;
  color: var(--muted);
  line-height: 1.75;
}

.app-shell {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100svh;
}

.workspace {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100svh;
  padding: 20px 16px;
  border-right: 1px solid var(--line);
  background: rgba(3, 4, 7, 0.94);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  font-weight: 900;
}

.sidebar-brand img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.sidebar nav {
  display: grid;
  gap: 6px;
}

.sidebar nav a {
  border-radius: 8px;
  padding: 12px;
  color: var(--muted);
  font-weight: 800;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 72px;
  padding: 12px clamp(18px, 4vw, 42px);
  border-bottom: 1px solid var(--line);
  background: rgba(5, 7, 11, 0.86);
  backdrop-filter: blur(16px);
}

.topbar span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
}

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

.admin-global-search {
  position: relative;
  min-width: min(360px, 42vw);
}

.admin-global-search input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(242, 201, 110, 0.2);
  border-radius: 8px;
  background: rgba(3, 5, 9, 0.74);
  color: var(--text);
  padding: 0 12px;
}

.admin-search-results {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  right: 0;
  width: min(420px, 82vw);
  max-height: 360px;
  overflow: auto;
  border: 1px solid rgba(242, 201, 110, 0.22);
  border-radius: 8px;
  background: rgba(6, 8, 13, 0.98);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.admin-search-results a,
.admin-search-empty {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.admin-search-results a:last-child {
  border-bottom: 0;
}

.admin-search-results span,
.admin-search-empty {
  color: var(--muted);
  font-size: 0.84rem;
}

.reward-point-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.reward-point-grid article,
.redemption-hint {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  padding: 14px;
}

.reward-point-grid span,
.reward-point-grid small,
.redemption-hint {
  color: var(--muted);
}

.reward-point-grid strong {
  display: block;
  margin: 6px 0;
  color: var(--gold);
  font-size: 1.4rem;
}

.workspace-content {
  flex: 1;
  padding: clamp(22px, 4vw, 46px);
}

.workspace .legal-footer {
  margin-top: auto;
  border-left: 1px solid rgba(242, 201, 110, 0.08);
}

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

.workspace-heading h1 {
  font-size: clamp(2rem, 4vw, 3.6rem);
}

.admin-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(20px, 4vw, 34px);
  background:
    linear-gradient(135deg, rgba(216, 168, 75, 0.12), transparent 44%),
    linear-gradient(225deg, rgba(127, 215, 242, 0.12), transparent 46%),
    rgba(255, 255, 255, 0.035);
  box-shadow: var(--shadow);
}

.admin-hero h1 {
  font-size: clamp(2.2rem, 5vw, 4.4rem);
}

.admin-status-card {
  display: grid;
  align-content: center;
  gap: 8px;
  border: 1px solid rgba(127, 215, 242, 0.2);
  border-radius: 8px;
  padding: 18px;
  background: rgba(4, 8, 14, 0.58);
}

.admin-status-card span,
.admin-status-card small {
  color: var(--muted);
}

.admin-status-card strong {
  color: var(--ice);
  font-size: 1.6rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat-grid article {
  min-height: 116px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--panel);
}

.admin-stats article {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025));
}

.stat-grid span {
  display: block;
  margin-bottom: 18px;
  color: var(--muted);
  font-weight: 800;
}

.stat-grid strong {
  color: var(--gold-2);
  font-size: 1.65rem;
}

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

.panel {
  padding: 22px;
}

.command-panel,
.admin-insight {
  min-height: 220px;
}

.admin-list-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.goal-row,
.goal-card,
.application-row,
.member-row {
  display: grid;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}

.goal-row,
.goal-card {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.goal-card:last-child,
.application-row:last-child,
.member-row:last-child {
  border-bottom: 0;
}

.profile-sheet {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
}

.profile-sheet div {
  display: grid;
  gap: 8px;
  min-height: 96px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.profile-sheet span,
.member-row span,
.application-row small {
  color: var(--muted);
}

.table-panel {
  padding: 8px 20px;
}

.modern-table {
  background: rgba(255, 255, 255, 0.035);
}

.application-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.row-title {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

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

.member-row {
  grid-template-columns: minmax(220px, 1.3fr) minmax(150px, 0.5fr) minmax(150px, 0.5fr) auto;
  align-items: center;
}

.member-row > div {
  display: grid;
  gap: 6px;
}

.member-editor {
  grid-template-columns: minmax(220px, 1.2fr) repeat(4, minmax(140px, 0.7fr));
  align-items: end;
}

.room-editor,
.quest-editor,
.content-editor {
  grid-template-columns: minmax(240px, 1.2fr) repeat(4, minmax(140px, 0.7fr));
  align-items: end;
}

.member-editor .admin-note-field,
.member-editor .row-actions,
.room-editor .admin-note-field,
.room-editor .row-actions,
.quest-editor .admin-note-field,
.quest-editor .row-actions,
.content-editor .admin-note-field,
.content-editor .row-actions {
  grid-column: span 2;
}

.member-main small,
.history-row span,
.admin-note-field span {
  color: var(--muted);
}

.admin-note-field {
  display: grid;
  gap: 8px;
}

.admin-note-field textarea {
  min-height: 86px;
  resize: vertical;
}

.admin-history {
  margin-top: 18px;
}

.admin-create-panel {
  margin-bottom: 18px;
}

.admin-inline-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(4, minmax(120px, 0.45fr)) auto;
  gap: 12px;
  align-items: end;
}

.history-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.4fr) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.history-row:last-child {
  border-bottom: 0;
}

.history-row > div {
  display: grid;
  gap: 4px;
}

.history-row code {
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(5, 7, 11, 0.42);
  color: var(--muted);
  font-family: inherit;
  font-size: 0.82rem;
}

.badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 900;
}

.badge-gold {
  border-color: rgba(242, 201, 110, 0.45);
  color: var(--gold-2);
}

.badge-ice {
  border-color: rgba(127, 215, 242, 0.38);
  color: var(--ice);
}

.badge-danger {
  border-color: rgba(228, 107, 124, 0.45);
  color: var(--danger);
}

.empty-state {
  padding: 22px;
}

[hidden] {
  display: none !important;
}

.avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border: 1px solid rgba(242, 201, 110, 0.34);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(216, 168, 75, 0.34), rgba(127, 215, 242, 0.18)),
    var(--panel);
  color: var(--gold-2);
  font-weight: 950;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-sm {
  width: 38px;
  height: 38px;
  font-size: 0.78rem;
}

.avatar-xl {
  width: clamp(96px, 16vw, 148px);
  height: clamp(96px, 16vw, 148px);
  font-size: 2rem;
}

.profile-hero,
.team-panel,
.chat-panel,
.chat-rooms,
.team-filters {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025));
  box-shadow: var(--shadow);
}

.profile-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  margin-bottom: 18px;
  padding: clamp(20px, 4vw, 34px);
}

.profile-hero h1 {
  font-size: clamp(2.2rem, 5vw, 4.8rem);
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.community-stats article {
  background: linear-gradient(180deg, rgba(127, 215, 242, 0.08), rgba(255, 255, 255, 0.025));
}

.community-grid {
  margin-bottom: 16px;
}

.progress-track {
  height: 12px;
  overflow: hidden;
  border: 1px solid rgba(127, 215, 242, 0.22);
  border-radius: 999px;
  background: rgba(5, 7, 11, 0.7);
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--ice));
}

.badge-grid,
.mini-stat-list {
  display: grid;
  gap: 10px;
}

.badge-card,
.team-chip,
.reward-row,
.mini-stat-list div {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.badge-card span,
.team-chip span,
.reward-row span,
.mini-stat-list span {
  color: var(--muted);
}

.reward-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  margin-top: 10px;
}

.quest-board {
  display: grid;
  gap: 14px;
}

.quest-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, 0.22fr);
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: var(--shadow);
}

.quest-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.quest-meta span,
.quest-progress span {
  color: var(--muted);
}

.quest-meta span {
  border: 1px solid rgba(127, 215, 242, 0.18);
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(127, 215, 242, 0.04);
  font-size: 0.82rem;
}

.quest-progress {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.quest-progress strong {
  color: var(--gold-2);
  font-size: 1.35rem;
}

.journey-section {
  margin-top: 18px;
}

.journey-board {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.journey-card,
.validation-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: var(--shadow);
}

.journey-card-head p,
.validation-comment {
  color: var(--muted);
  margin: 6px 0 0;
}

.quest-metrics {
  display: grid;
  gap: 12px;
}

.quest-metric {
  display: grid;
  gap: 6px;
}

.quest-metric-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.88rem;
}

.quest-metric-head strong {
  color: var(--gold-2);
}

.quest-progress-meter {
  display: grid;
  gap: 6px;
}

.quest-progress-meter-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
}

.quest-progress-meter-head span {
  color: var(--muted);
}

.quest-progress-meter-head strong {
  color: var(--gold-2);
  font-size: 1.05rem;
}

.proof-tiktok {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ice);
  font-weight: 600;
  font-size: 0.9rem;
}

.quest-muted {
  color: var(--muted);
  font-size: 0.88rem;
}

.proof-list {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.proof-list-title,
.award-form-title {
  font-weight: 700;
  color: var(--ice);
}

.proof-item {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(5, 7, 11, 0.4);
}

.proof-item-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.proof-item p,
.proof-review {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.proof-thumb {
  display: block;
  max-width: 220px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.proof-thumb img {
  display: block;
  width: 100%;
  height: auto;
}

.proof-form-wrap > summary {
  display: inline-flex;
  cursor: pointer;
  list-style: none;
  width: fit-content;
}

.proof-form-wrap > summary::-webkit-details-marker {
  display: none;
}

.proof-form,
.award-form {
  margin-top: 12px;
}

.validation-board {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  margin-bottom: 18px;
}

.validation-head,
.validation-quest {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.validation-head strong {
  display: block;
}

.validation-head span,
.validation-quest small {
  color: var(--muted);
  font-size: 0.85rem;
}

.award-form {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.community-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.team-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
  padding: 16px;
}

.team-board {
  display: grid;
  gap: 18px;
}

.team-panel {
  padding: clamp(18px, 3vw, 26px);
}

.team-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

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

.team-member-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(5, 7, 11, 0.44);
}

.team-member-card:hover,
.chat-rooms a:hover,
.chat-rooms a.is-active {
  border-color: rgba(242, 201, 110, 0.42);
  background: rgba(216, 168, 75, 0.08);
}

.team-member-card span,
.member-progress span,
.member-progress small {
  display: block;
  color: var(--muted);
}

.member-progress {
  text-align: right;
}

.chat-layout {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.chat-rooms {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.chat-rooms a {
  display: grid;
  gap: 4px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 12px;
}

.chat-rooms span,
.chat-meta span {
  color: var(--muted);
  font-size: 0.82rem;
}

.chat-panel {
  min-width: 0;
  padding: clamp(16px, 3vw, 24px);
}

.chat-panel-head {
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
  padding-bottom: 14px;
}

.pinned-message {
  border: 1px solid rgba(242, 201, 110, 0.36);
  border-radius: 8px;
  margin-bottom: 14px;
  padding: 14px;
  background: rgba(216, 168, 75, 0.08);
}

.chat-messages {
  display: grid;
  gap: 12px;
  max-height: min(64vh, 720px);
  overflow: auto;
  padding-right: 4px;
}

.chat-message {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.chat-message.is-deleted {
  opacity: 0.62;
}

.chat-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

.chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chat-actions .button {
  min-height: 34px;
  padding-inline: 12px;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-top: 14px;
}

.loading-screen {
  display: grid;
  place-items: center;
  gap: 14px;
  min-height: 100svh;
  color: var(--muted);
}

.loading-screen img {
  width: 120px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 36px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  background: var(--panel-2);
  color: var(--text);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-error {
  border-color: rgba(228, 107, 124, 0.5);
}

/* V4 Viking premium atmosphere */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}

body::before {
  background:
    radial-gradient(circle at 50% 2%, rgba(242, 201, 110, 0.12), transparent 22%),
    linear-gradient(115deg, rgba(5, 7, 11, 0.58), rgba(4, 10, 16, 0.92)),
    repeating-linear-gradient(90deg, rgba(242, 201, 110, 0.035) 0 1px, transparent 1px 96px),
    repeating-linear-gradient(0deg, rgba(127, 215, 242, 0.026) 0 1px, transparent 1px 82px),
    url("/assets/valhalla-logo.png") center 12vh / min(82vw, 980px) auto no-repeat;
  opacity: 0.34;
  filter: saturate(1.1);
}

body::after {
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 34%, rgba(242, 201, 110, 0.035)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.018) 0 2px, transparent 2px 16px);
  mix-blend-mode: screen;
  opacity: 0.5;
}

.kingdom-hero {
  background:
    linear-gradient(90deg, rgba(5, 7, 11, 0.96), rgba(5, 9, 15, 0.78)),
    url("/assets/valhalla-logo.png") right 8% center / min(58vw, 820px) auto no-repeat;
}

.kingdom-hero::after,
.app-shell::before,
.workspace-content::before {
  content: "ᚠ ᚢ ᚦ ᚨ ᚱ ᚲ";
  position: absolute;
  pointer-events: none;
  color: rgba(242, 201, 110, 0.13);
  font-size: clamp(2.4rem, 9vw, 8rem);
  font-weight: 900;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.kingdom-hero::after {
  right: -3vw;
  bottom: 5vh;
  transform: rotate(-8deg);
}

.rune-ring {
  position: absolute;
  left: clamp(14px, 4vw, 58px);
  top: clamp(18px, 5vw, 62px);
  border-left: 2px solid rgba(242, 201, 110, 0.55);
  padding-left: 12px;
  color: rgba(127, 215, 242, 0.76);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.28em;
  writing-mode: vertical-rl;
}

.hero-logo,
.loading-screen img,
.sidebar-brand img {
  animation: crestGlow 5.6s ease-in-out infinite;
}

@keyframes crestGlow {
  0%,
  100% {
    filter: drop-shadow(0 28px 90px rgba(127, 215, 242, 0.14));
  }
  50% {
    filter: drop-shadow(0 34px 110px rgba(242, 201, 110, 0.24));
  }
}

.public-nav,
.topbar,
.sidebar {
  background:
    linear-gradient(180deg, rgba(10, 15, 22, 0.94), rgba(3, 4, 7, 0.92)),
    repeating-linear-gradient(90deg, rgba(242, 201, 110, 0.035) 0 1px, transparent 1px 36px);
}

.brand img,
.footer img {
  filter: drop-shadow(0 10px 28px rgba(242, 201, 110, 0.18));
}

.button {
  position: relative;
  overflow: hidden;
}

.button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  transform: translateX(-120%);
  transition: transform 0.45s ease;
}

.button:hover::after {
  transform: translateX(120%);
}

.realm-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border-block: 1px solid rgba(242, 201, 110, 0.2);
  background: rgba(242, 201, 110, 0.16);
}

.realm-strip article {
  display: grid;
  gap: 6px;
  min-height: 128px;
  align-content: center;
  padding: 24px clamp(18px, 4vw, 42px);
  background:
    linear-gradient(145deg, rgba(7, 13, 20, 0.94), rgba(16, 23, 33, 0.88)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.025) 0 2px, transparent 2px 14px);
}

.realm-strip strong {
  color: var(--gold-2);
  font-size: 1.05rem;
}

.realm-strip span {
  color: var(--muted);
}

.value-card,
.reason-card,
.panel,
.form-panel,
.table-panel,
.profile-hero,
.team-panel,
.chat-panel,
.chat-rooms,
.team-filters,
.podium-card {
  position: relative;
  overflow: hidden;
}

.value-card::before,
.reason-card::before,
.panel::before,
.profile-hero::before,
.team-panel::before,
.chat-panel::before,
.podium-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 1px solid rgba(242, 201, 110, 0.18);
  background:
    linear-gradient(135deg, rgba(242, 201, 110, 0.055), transparent 42%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 18px);
  pointer-events: none;
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(4, 7, 12, 0.98), rgba(9, 15, 22, 0.94)),
    url("/assets/valhalla-logo.svg") center bottom 28px / 190px auto no-repeat;
}

.sidebar-oath {
  display: grid;
  gap: 4px;
  margin: -12px 0 18px;
  border: 1px solid rgba(242, 201, 110, 0.22);
  border-radius: 8px;
  padding: 12px;
  background: rgba(216, 168, 75, 0.075);
}

.sidebar-oath span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.sidebar-oath strong,
.topbar-rune {
  color: var(--gold-2);
  font-size: 0.74rem;
  font-weight: 950;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.app-shell {
  position: relative;
  background:
    linear-gradient(115deg, rgba(3, 4, 7, 0.92), rgba(8, 16, 24, 0.95)),
    repeating-linear-gradient(135deg, rgba(127, 215, 242, 0.026) 0 1px, transparent 1px 22px);
}

.app-shell::before {
  right: 3vw;
  bottom: 4vh;
  z-index: 0;
  opacity: 0.4;
  transform: rotate(-5deg);
}

.workspace,
.sidebar {
  position: relative;
  z-index: 1;
}

.workspace-content {
  position: relative;
}

.workspace-content::before {
  top: 10px;
  right: 28px;
  z-index: -1;
  opacity: 0.32;
  font-size: clamp(2rem, 6vw, 5.4rem);
}

.workspace-heading,
.admin-hero,
.profile-hero,
.leaderboard-heading {
  isolation: isolate;
}

.workspace-heading h1,
.admin-hero h1,
.profile-hero h1 {
  text-shadow: 0 16px 46px rgba(0, 0, 0, 0.62), 0 0 28px rgba(242, 201, 110, 0.12);
}

.privacy-panel,
.setting-panel {
  margin-top: 18px;
}

.compact-form {
  grid-template-columns: minmax(220px, 1fr) auto;
}

.content-preview-grid {
  margin-bottom: 18px;
}

.content-preview {
  display: grid;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.content-preview:last-child {
  border-bottom: 0;
}

.content-preview span {
  color: var(--ice);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.compact-history {
  grid-template-columns: minmax(120px, 0.35fr) minmax(0, 1fr);
}

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

.podium-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  border: 1px solid rgba(242, 201, 110, 0.22);
  border-radius: 8px;
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(216, 168, 75, 0.1), rgba(127, 215, 242, 0.04)),
    rgba(255, 255, 255, 0.035);
  box-shadow: var(--shadow);
  text-align: center;
}

.podium-1 {
  transform: translateY(-8px);
  border-color: rgba(242, 201, 110, 0.48);
}

.podium-rank {
  color: var(--gold-2);
  font-size: 1.4rem;
  font-weight: 950;
}

.podium-card small,
.podium-stats span {
  color: var(--muted);
}

.podium-stats {
  display: grid;
  gap: 6px;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 52px auto minmax(0, 1fr) repeat(3, minmax(90px, 0.25fr)) auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}

.leaderboard-row:last-child {
  border-bottom: 0;
}

.leaderboard-row span {
  color: var(--muted);
}

.leaderboard-row b {
  display: block;
}

.kingdom-hero::after,
.app-shell::before,
.workspace-content::before {
  content: "\16A0  \16A2  \16A6  \16A8  \16B1  \16B2";
}

.leaderboard-controls {
  display: grid;
  gap: 10px;
  margin: -8px 0 18px;
}

.leaderboard-controls div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.leaderboard-controls a {
  border: 1px solid rgba(127, 215, 242, 0.2);
  border-radius: 999px;
  padding: 9px 12px;
  color: var(--muted);
  background: rgba(5, 7, 11, 0.52);
  font-size: 0.86rem;
  font-weight: 850;
}

.leaderboard-controls a:hover,
.leaderboard-controls a.is-active {
  border-color: rgba(242, 201, 110, 0.46);
  color: var(--gold-2);
  background: rgba(216, 168, 75, 0.12);
}

.parchment-grid {
  align-items: stretch;
}

.panel-heading-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.tiktok-panel,
.avatar-panel {
  background:
    linear-gradient(145deg, rgba(216, 168, 75, 0.09), rgba(127, 215, 242, 0.04)),
    rgba(255, 255, 255, 0.035);
}

.tiktok-form,
.avatar-form {
  margin-top: 16px;
}

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

.tiktok-form .checkbox-row,
.tiktok-form .button {
  grid-column: span 2;
}

.avatar-preview {
  display: grid;
  place-items: center;
  margin: 14px 0;
}

.avatar-form {
  grid-template-columns: minmax(220px, 1fr) auto auto;
}

.auth-result-hero {
  background:
    linear-gradient(135deg, rgba(216, 168, 75, 0.15), rgba(127, 215, 242, 0.07)),
    url("/assets/valhalla-logo.png") right 8% center / min(54vw, 620px) auto no-repeat,
    rgba(255, 255, 255, 0.035);
}

.auth-result-hero h1 {
  color: var(--gold-2);
}

.auth-result-error {
  background:
    linear-gradient(135deg, rgba(228, 107, 124, 0.14), rgba(127, 215, 242, 0.06)),
    url("/assets/valhalla-logo.png") right 8% center / min(54vw, 620px) auto no-repeat,
    rgba(255, 255, 255, 0.035);
}

.referral-note {
  display: grid;
  gap: 4px;
  margin: 0 0 18px;
  border: 1px solid rgba(242, 201, 110, 0.24);
  border-radius: 8px;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(216, 168, 75, 0.14), rgba(127, 215, 242, 0.06)),
    rgba(255, 255, 255, 0.04);
}

.referral-note span,
.referral-admin-line span,
.settings-pill span {
  color: var(--muted);
}

.referral-note strong {
  color: var(--gold-2);
}

.referral-panel {
  margin-bottom: 16px;
  background:
    linear-gradient(135deg, rgba(216, 168, 75, 0.11), rgba(127, 215, 242, 0.05)),
    rgba(255, 255, 255, 0.035);
}

.referral-link-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin: 18px 0;
}

.referral-link-box code {
  min-width: 0;
  overflow-wrap: anywhere;
  border: 1px solid rgba(127, 215, 242, 0.18);
  border-radius: 8px;
  padding: 14px;
  color: var(--ice);
  background: rgba(5, 7, 11, 0.58);
}

.nested-panel {
  box-shadow: none;
  background: rgba(5, 7, 11, 0.34);
}

.ambassador-board {
  margin-top: 18px;
  background:
    linear-gradient(145deg, rgba(216, 168, 75, 0.1), rgba(127, 215, 242, 0.045)),
    rgba(255, 255, 255, 0.035);
}

.ambassador-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.ambassador-row {
  display: grid;
  grid-template-columns: 52px auto minmax(0, 1fr) repeat(3, minmax(110px, 0.32fr)) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(5, 7, 11, 0.48);
}

.ambassador-row > strong {
  color: var(--gold-2);
}

.ambassador-row b,
.settings-pill strong {
  display: block;
}

.ambassador-row span {
  color: var(--muted);
}

.referral-admin-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 12px 0;
}

.referral-admin-editor {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin: 12px 0;
  border: 1px solid rgba(127, 215, 242, 0.12);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.referral-editor,
.referral-reward-editor,
.reward-setting-editor {
  grid-template-columns: minmax(240px, 1.15fr) repeat(4, minmax(140px, 0.7fr));
  align-items: end;
}

.referral-editor .admin-note-field,
.referral-editor .row-actions,
.referral-reward-editor .row-actions,
.reward-setting-editor .admin-note-field,
.reward-setting-editor .row-actions {
  grid-column: span 2;
}

.table-section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}

.table-section-head h2 {
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 1.7rem);
}

.table-section-head span {
  color: var(--muted);
  font-weight: 850;
}

.settings-panel {
  margin-bottom: 18px;
  background:
    linear-gradient(145deg, rgba(216, 168, 75, 0.08), rgba(127, 215, 242, 0.045)),
    rgba(255, 255, 255, 0.035);
}

.settings-form {
  display: grid;
  gap: 16px;
}

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

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

.settings-pill {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}

.settings-pill:last-child {
  border-bottom: 0;
}

.clan-admin-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.clan-live-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.clan-assignment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.clan-live-grid h3 {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.95rem;
}

.mini-clan-card {
  padding: 12px;
  border: 1px solid rgba(245, 197, 92, 0.16);
  border-radius: 8px;
  background: rgba(8, 13, 25, 0.62);
  margin-bottom: 10px;
}

.mini-clan-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.mini-clan-header div {
  display: grid;
  gap: 2px;
}

.mini-clan-card strong,
.mini-clan-card span,
.mini-clan-card p {
  display: block;
}

.mini-clan-card span {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 4px;
}

.mini-clan-card p,
.muted {
  color: var(--muted);
}

.clan-kingdom-card {
  position: relative;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--clan-accent) 38%, rgba(245, 197, 92, 0.14));
}

.clan-kingdom-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 0%, color-mix(in srgb, var(--clan-accent) 28%, transparent), transparent 28%),
    linear-gradient(135deg, color-mix(in srgb, var(--clan-accent) 12%, transparent), transparent 42%);
  opacity: 0.65;
}

.clan-kingdom-card > * {
  position: relative;
}

.clan-banner {
  height: 145px;
  margin: -18px -18px 18px;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.clan-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.05) contrast(1.08);
}

.clan-emblem,
.clan-rank-emblem {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--clan-accent) 56%, rgba(255, 255, 255, 0.1));
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(5, 7, 11, 0.7);
  color: var(--gold);
  font-weight: 900;
}

.clan-emblem img,
.clan-rank-emblem img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.clan-motto {
  display: block;
  color: var(--gold);
  margin-top: 8px;
}

.clan-presentation {
  max-width: 720px;
}

.clan-stat-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.clan-stat-row span,
.clan-rank-summary {
  border: 1px solid rgba(245, 197, 92, 0.14);
  border-radius: 8px;
  padding: 10px;
  background: rgba(5, 7, 11, 0.45);
}

.clan-stat-row b {
  display: block;
  color: var(--gold);
  font-size: 1.12rem;
}

.champion-highlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.champion-highlight-card {
  min-height: 180px;
  border: 1px solid rgba(245, 197, 92, 0.18);
  border-radius: 8px;
  padding: 18px;
  background:
    radial-gradient(circle at 20% 0%, rgba(245, 197, 92, 0.18), transparent 34%),
    linear-gradient(145deg, rgba(13, 20, 35, 0.94), rgba(5, 7, 11, 0.78));
  box-shadow: var(--shadow);
}

.champion-highlight-card span,
.champion-highlight-card small {
  color: var(--muted);
}

.champion-highlight-card h2 {
  color: var(--gold);
}

.champions-grid {
  margin-bottom: 18px;
}

.champion-row {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.champion-row:last-child {
  border-bottom: 0;
}

.video-section {
  margin-bottom: 18px;
}

.video-grid,
.public-video-grid,
.recognition-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.video-card,
.public-video-card,
.recognition-card {
  border: 1px solid rgba(245, 197, 92, 0.16);
  border-radius: 8px;
  padding: 14px;
  background:
    radial-gradient(circle at 12% 0%, rgba(127, 215, 242, 0.12), transparent 34%),
    linear-gradient(145deg, rgba(9, 14, 24, 0.92), rgba(5, 7, 11, 0.72));
}

.video-card,
.public-video-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  min-height: 170px;
}

.public-video-section {
  padding-top: 8px;
}

.recognition-strip {
  margin: 16px 0;
}

.recognition-card span {
  color: var(--gold);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

.recognition-card strong,
.recognition-card small {
  display: block;
  margin-top: 6px;
}

.trophy-card {
  border-color: rgba(245, 197, 92, 0.26);
  background: linear-gradient(145deg, rgba(245, 197, 92, 0.08), rgba(8, 13, 25, 0.72));
}

.clan-rank-row {
  border-left: 3px solid var(--clan-accent);
}

.room-access-form {
  grid-template-columns: repeat(5, minmax(120px, 1fr)) auto;
}

.room-access-list {
  display: grid;
  gap: 8px;
  grid-column: span 2;
  border: 1px solid rgba(127, 215, 242, 0.14);
  border-radius: 8px;
  padding: 12px;
  background: rgba(5, 7, 11, 0.42);
}

.room-access-list span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  color: var(--muted);
}

.room-access-list button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.chat-rooms a span {
  line-height: 1.4;
}

.sidebar nav a {
  position: relative;
  padding-left: 18px;
}

.sidebar nav a::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: rgba(242, 201, 110, 0.42);
  transform: translateY(-50%);
}

.quest-card {
  background:
    linear-gradient(145deg, rgba(216, 168, 75, 0.08), rgba(127, 215, 242, 0.045)),
    rgba(255, 255, 255, 0.035);
}

.chat-message {
  animation: messageRise 0.22s ease both;
}

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

@media (max-width: 1100px) {
  .reason-grid,
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .application-preview,
  .application-layout,
  .contact-layout,
  .admin-hero,
  .chat-layout {
    grid-template-columns: 1fr;
  }

  .application-note {
    position: static;
  }
}

@media (max-width: 1000px) {
  .public-nav {
    grid-template-columns: 1fr auto;
  }

  .nav-links {
    display: none;
  }

  .hero-section,
  .story-band,
  .split-section,
  .auth-page,
  .dashboard-grid,
  .command-grid,
  .champion-highlight-grid,
  .clan-admin-summary,
  .clan-assignment-grid,
  .clan-stat-row,
  .clan-live-grid {
    grid-template-columns: 1fr;
  }

  .value-grid,
  .timeline,
  .social-grid,
  .team-member-grid,
  .realm-strip,
  .podium-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

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

  .sidebar nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .application-row,
  .member-row,
  .member-editor,
  .room-editor,
  .quest-editor,
  .content-editor,
  .referral-editor,
  .referral-reward-editor,
  .reward-setting-editor,
  .referral-admin-editor,
  .room-access-form,
  .admin-inline-form,
    .quest-card,
    .ambassador-row,
    .leaderboard-row,
    .history-row {
    grid-template-columns: 1fr;
  }

  .member-editor .admin-note-field,
  .member-editor .row-actions,
  .room-editor .admin-note-field,
  .room-editor .row-actions,
  .quest-editor .admin-note-field,
  .quest-editor .row-actions,
  .content-editor .admin-note-field,
  .content-editor .row-actions,
  .referral-editor .admin-note-field,
  .referral-editor .row-actions,
  .referral-reward-editor .row-actions,
  .reward-setting-editor .admin-note-field,
  .reward-setting-editor .row-actions,
  .room-access-list {
    grid-column: auto;
  }

  .config-grid,
  .settings-toggles,
  .referral-link-box {
    grid-template-columns: 1fr;
  }

  .row-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .public-nav {
    min-height: 66px;
    gap: 12px;
    padding-inline: 14px;
  }

  .brand img {
    width: 158px;
  }

  .button {
    width: 100%;
  }

  .public-nav .button {
    width: auto;
    min-height: 40px;
    padding-inline: 12px;
  }

  .public-actions {
    display: grid;
    gap: 6px;
  }

  .public-actions .button {
    min-height: 34px;
    padding-inline: 10px;
    font-size: 0.78rem;
  }

  h1 {
    font-size: clamp(2.45rem, 13vw, 4.2rem);
  }

  .hero-section,
  .section,
  .story-band,
  .split-section,
  .page-hero,
  .workspace-content {
    padding-inline: 18px;
  }

  .premium-crest {
    min-height: 360px;
  }

  .hero-logo {
    width: min(100%, 350px);
  }

  .crest-panel {
    position: static;
    width: 100%;
    margin-top: 14px;
  }

  .hero-metrics,
  .form-grid,
  .value-grid,
  .reason-grid,
  .timeline,
  .social-grid,
  .realm-strip,
  .podium-grid,
  .leaderboard-row,
  .leaderboard-controls div,
  .stat-grid,
  .profile-sheet,
  .sidebar nav,
  .team-filters,
  .team-member-grid,
  .profile-hero,
  .team-member-card,
  .tiktok-form,
  .avatar-form,
  .chat-form {
    grid-template-columns: 1fr;
  }

  .tiktok-form .checkbox-row,
  .tiktok-form .button {
    grid-column: auto;
  }

  .hero-actions,
  .button-row,
  .row-actions,
  .topbar-actions {
    display: grid;
  }

  .admin-global-search,
  .reward-point-grid {
    min-width: 0;
    width: 100%;
  }

  .reward-point-grid {
    grid-template-columns: 1fr;
  }

  .footer,
  .topbar,
  .leaderboard-controls div,
  .admin-list-heading,
  .community-heading,
  .team-panel-head,
  .reward-row {
    display: grid;
  }

  .member-progress {
    text-align: left;
  }

  .quest-progress {
    justify-items: start;
  }

  .table-panel {
    padding: 6px 14px;
  }
}

/* Internal policy (reglement) viewer + filleuls */
.policy-viewer {
  max-height: 70vh;
  overflow-y: auto;
  border: 1px solid rgba(184, 134, 11, 0.35);
  border-radius: 16px;
  background: rgba(12, 14, 20, 0.6);
  padding: 16px;
  margin: 8px 0 16px;
  scroll-behavior: smooth;
}

.policy-pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.policy-page-canvas {
  width: 100%;
  max-width: 780px;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4);
  background: #fff;
}

.policy-iframe {
  width: 100%;
  height: 68vh;
  border: 0;
  border-radius: 8px;
  background: #fff;
}

.policy-loading {
  text-align: center;
  padding: 32px 12px;
  opacity: 0.75;
}

.policy-scroll-hint {
  position: sticky;
  bottom: 0;
  margin-top: 12px;
  padding: 10px 14px;
  text-align: center;
  font-size: 0.9rem;
  border-radius: 10px;
  background: rgba(184, 134, 11, 0.18);
  color: #f4e7c5;
}

.policy-gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
}

.policy-gate .workspace-heading {
  margin-bottom: 8px;
}

.policy-publish-form input[type="file"] {
  padding: 8px;
}

.admin-help-line {
  border-left: 3px solid rgba(184, 134, 11, 0.6);
  padding-left: 12px;
  margin-top: 8px;
  font-size: 0.92rem;
  opacity: 0.9;
}

.filleul-card .filleul-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px 18px;
  margin: 12px 0;
}

.filleul-card .filleul-stats div {
  display: flex;
  flex-direction: column;
}

.filleul-card .filleul-stats span {
  font-size: 0.78rem;
  opacity: 0.7;
}

/* Single-source referral admin + "Mes filleuls" profile section. */
.referral-adjust {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(5, 7, 11, 0.4);
}

.referral-adjust > span {
  color: var(--muted);
  font-size: 0.85rem;
}

.referral-adjust-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.referral-adjust-controls input[type="number"] {
  max-width: 140px;
}

.mes-filleuls .filleuls-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mes-filleuls .filleul-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(5, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(5, 7, 11, 0.42);
}

.mes-filleuls .filleul-row span {
  color: var(--muted);
  font-size: 0.82rem;
}

.mes-filleuls .filleul-id strong {
  display: block;
}

@media (max-width: 900px) {
  .mes-filleuls .filleul-row {
    grid-template-columns: 1fr 1fr;
  }
}
