/* ===== THE ROYALE ORGANIZATION — shared stylesheet ===== */
:root {
  --gold: #D4AF37;
  --gold-light: #E6C65B;
  --bg: #090B12;
  --panel: #10131C;
  --card-a: #171A24;
  --card-b: #0B0D14;
  --text: #FFFFFF;
  --muted: #B9BECA;
  --line: rgba(212, 175, 55, 0.35);
  --accent: var(--gold);
  --accent-soft: rgba(212, 175, 55, 0.4);
  --hero-tint: #2A210D;
  --font-display: "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  --font-body: "Barlow", Arial, Helvetica, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid var(--gold-light); outline-offset: 3px; }

.skip-link {
  position: absolute; left: -999px; top: 8px;
  background: var(--gold); color: #10131C; padding: 10px 16px; border-radius: 6px; z-index: 10;
}
.skip-link:focus { left: 8px; }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; margin: 0; }

/* ===== HEADER / NAV ===== */
.site-header { background: var(--panel); }
.brand {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 16px 20px 12px; gap: 2px;
}
.brand-crown { color: var(--gold); font-size: 36px; line-height: 1; }
.brand-name {
  font-family: var(--font-display); color: var(--gold);
  font-size: 26px; font-weight: 700; letter-spacing: 3px;
}
.brand-tagline { color: #AAB0BF; font-size: 12px; letter-spacing: 3px; }

.site-nav {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 28px;
  padding: 14px 18px; background: #15151C; border-bottom: 1px solid var(--gold);
}
.site-nav a {
  color: var(--gold); font-weight: 600; padding: 4px 2px;
  border-bottom: 2px solid transparent; transition: color .2s, border-color .2s;
}
.site-nav a:hover { color: #fff; }
.site-nav a[aria-current="page"] { color: #fff; border-bottom-color: var(--gold); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-block; padding: 14px 30px; border-radius: 8px;
  font-weight: 700; text-align: center; cursor: pointer;
  transition: background .2s, color .2s, box-shadow .2s;
}
.btn-primary { background: var(--accent); color: #10131C; box-shadow: 0 0 20px var(--accent-soft); }
.btn-primary:hover { background: var(--gold-light); box-shadow: 0 0 30px var(--accent-soft); }
.btn-outline { color: var(--gold); border: 1px solid var(--gold); }
.btn-outline:hover { background: var(--gold); color: #10131C; }
.btn-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; margin-top: 32px; }

/* ===== HEROES ===== */
.hero, .page-hero {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 90px 20px;
  background: radial-gradient(ellipse at center, var(--hero-tint) 0%, var(--bg) 75%);
}
.hero { min-height: 75vh; }
.page-hero { min-height: 55vh; }
.hero-inner { max-width: 900px; }
.hero h1, .page-hero h1 {
  font-size: clamp(2.8rem, 8vw, 5.5rem); font-weight: 800;
  letter-spacing: 2px; color: var(--accent); text-transform: uppercase;
  margin: 18px 0; text-shadow: 0 0 28px var(--accent-soft);
}
.hero p, .page-hero p {
  color: #E3E5EA; font-size: 1.2rem; max-width: 650px; margin: 8px auto;
}
.hero .eyebrow, .page-hero .eyebrow { color: var(--accent); font-weight: 600; letter-spacing: 2px; }
.page-hero-icon { font-size: 4.5rem; line-height: 1; margin: 10px 0; color: var(--accent);
  filter: drop-shadow(0 0 22px var(--accent-soft)); }
.float { animation: float 4s ease-in-out infinite; }
.hero h1, .page-hero h1 { animation: rise 1s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* Clan themes */
.theme-mojo { --accent: #E53935; --accent-soft: rgba(229, 57, 53, .45); --hero-tint: #351518; }
.theme-mojo .btn-primary { color: #fff; }
.theme-mk { --accent: #B266FF; --accent-soft: rgba(178, 102, 255, .45); --hero-tint: #30144D; }
.theme-mk .btn-primary { color: #fff; background: #7B2CBF; }
.theme-mk .btn-primary:hover { background: #9D4EDD; }

/* ===== SECTIONS ===== */
.section { padding: 90px 20px; text-align: center; }
.section-dark { background: var(--panel); }
.section h2, .cta-section h2 { font-size: clamp(2rem, 5vw, 3.2rem); margin: 12px 0 8px; }
.label { color: var(--gold); font-size: .8rem; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; }
.lead { max-width: 720px; margin: 18px auto; color: var(--muted); font-size: 1.1rem; line-height: 1.8; }
.text-link { display: inline-block; margin-top: 20px; color: var(--gold); font-weight: 700; }
.text-link:hover { color: #fff; }
.note { color: #8E94A3; font-size: .9rem; max-width: 560px; margin: 24px auto 0; }

.cta-section {
  text-align: center; padding: 100px 20px;
  background: radial-gradient(ellipse at center, #28220F 0%, var(--bg) 75%);
}
.cta-section p { max-width: 650px; margin: 16px auto 28px; color: #C5C8D0; font-size: 1.1rem; }

/* ===== GRIDS & CARDS ===== */
.grid { display: grid; gap: 24px; max-width: 1100px; margin: 44px auto 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card {
  background: linear-gradient(145deg, var(--card-a), var(--card-b));
  border: 1px solid var(--line); border-radius: 16px; padding: 34px 28px;
  text-align: left; transition: border-color .25s, box-shadow .25s;
}
.card:hover { border-color: var(--gold); box-shadow: 0 0 30px rgba(212, 175, 55, .18); }
.card h3 { color: var(--gold); font-size: 1.7rem; margin-bottom: 10px; }
.card p { color: var(--muted); margin: 0 0 14px; }
.card-icon { display: block; font-size: 2.6rem; color: var(--gold); margin-bottom: 14px; }
.card-center { text-align: center; align-items: center; }
.card-link { display: flex; flex-direction: column; }
.card-link .btn { margin-top: auto; align-self: flex-start; }
.card-center.card-link .btn { align-self: center; }
.step-number { display: block; font-family: var(--font-display); font-size: 2.8rem; font-weight: 800; color: var(--gold); }

.panel-wide { max-width: 820px; margin: 44px auto 0; text-align: center; padding: 50px 30px; }
.panel-wide p { max-width: 560px; margin-left: auto; margin-right: auto; }
.details { margin-top: 22px; padding-top: 16px; border-top: 1px solid rgba(212, 175, 55, .2); }
.details p { margin-bottom: 8px; }
.details strong { color: var(--gold); }

/* ===== CLAN PAGES ===== */
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; max-width: 900px; margin: 40px auto 0; }
.stat-card { background: var(--card-a); border: 1px solid var(--line); border-radius: 14px; padding: 28px 16px; }
.stat-value { display: block; font-family: var(--font-display); font-size: 3rem; font-weight: 800; color: var(--gold); line-height: 1; }
.stat-label { display: block; margin-top: 8px; color: var(--muted); font-size: .9rem; }

.roster { max-width: 900px; margin: 40px auto 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; text-align: left; }
.roster-header { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 12px; padding: 14px 20px; background: #1A1D28; color: var(--gold); font-weight: 700; font-size: .85rem; letter-spacing: 1px; }
.roster-empty { padding: 44px 20px; text-align: center; color: var(--muted); background: var(--card-b); }

/* ===== DECKS ===== */
.deck-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 26px; max-width: 1200px; margin: 44px auto 0; }
.deck-card { display: flex; flex-direction: column; }
.deck-cards { list-style: none; padding: 0; margin: 18px 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.deck-cards li {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 4px;
  background: #20232D; border: 1px solid rgba(212, 175, 55, .25); border-radius: 8px;
  padding: 8px 4px; text-align: center; font-size: .72rem; line-height: 1.2; color: #F5F5F5; min-height: 52px;
}
.deck-cards img { width: 100%; max-width: 64px; border-radius: 6px; }
.deck-card strong { color: var(--gold); }

/* ===== FORM EMBED ===== */
.form-embed { max-width: 850px; margin: 40px auto 0; padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.form-embed iframe { display: block; width: 100%; height: 1418px; border: 0; border-radius: 10px; }

/* ===== FOOTER ===== */
.site-footer { text-align: center; background: var(--panel); border-top: 1px solid var(--gold); padding: 40px 20px; }
.footer-brand { font-family: var(--font-display); color: var(--gold); font-size: 1.3rem; font-weight: 700; letter-spacing: 2px; }
.site-footer p { color: #AAB0BF; font-size: .8rem; letter-spacing: 2px; margin: 8px 0; }
.site-footer .copyright { letter-spacing: 0; margin-top: 22px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 800px) {
  .grid-2, .grid-3, .stats-grid { grid-template-columns: 1fr; }
  .section { padding: 64px 18px; }
  .hero { min-height: 65vh; }
  .page-hero { min-height: 45vh; padding: 70px 18px; }
  .brand-name { font-size: 20px; }
  .site-nav { gap: 6px 18px; }
  .roster-header { grid-template-columns: 1.5fr 1fr 1fr; }
  .roster-header span:last-child { display: none; }
  .form-embed iframe { height: 1600px; }
  .form-embed { padding: 8px; }
}
@media (max-width: 420px) { .deck-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ===== v2 additions ===== */
.btn-discord { background: #5865F2; color: #fff; }
.btn-discord:hover { background: #6F7BF7; }
.btn-sm { padding: 8px 16px; font-size: .9rem; }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.tree-line { width: 2px; height: 40px; background: var(--line); margin: 36px auto; }
.site-footer .disclaimer { max-width: 620px; margin: 18px auto 0; font-size: .75rem; letter-spacing: 0; color: #8E94A3; }

/* ===== deck builder ===== */
.builder { max-width: 760px; margin: 36px auto 0; }
.deck-slots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.slot { min-height: 92px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border: 1px dashed var(--line); border-radius: 12px; background: var(--card-b); color: #6D7384; font: inherit; font-size: .85rem; padding: 6px; }
.slot.filled { border: 1px solid var(--gold); background: var(--card-a); color: #fff; cursor: pointer; }
.slot.filled:hover { background: #20232D; }
.elixir { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; border-radius: 50%;
  background: #B52BC9; color: #fff; font-weight: 700; font-size: .8rem; }
.builder-stats { display: flex; justify-content: center; gap: 36px; margin: 26px 0 4px; }
.builder-stats div { text-align: center; }
.builder-stats strong { display: block; font-family: var(--font-display); font-size: 2.2rem; color: var(--gold); line-height: 1; }
.builder-stats span { color: var(--muted); font-size: .85rem; }
.btn.is-disabled, .btn:disabled { opacity: .45; pointer-events: none; }
.import { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 22px; }
.import input, .search input { padding: 10px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--card-b); color: #fff; font: inherit; min-width: 0; flex: 1 1 240px; }
.picker-wrap { max-width: 1000px; margin: 50px auto 0; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 14px 0; }
.filters button { background: none; border: 1px solid var(--line); color: var(--muted); padding: 8px 16px; border-radius: 999px; font: inherit; cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--gold); color: #10131C; border-color: var(--gold); }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; margin-top: 16px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card-a); color: #fff; font: inherit; font-size: .82rem; cursor: pointer; }
.tile:hover:not(:disabled) { border-color: var(--gold); }
.tile:disabled { opacity: .35; cursor: default; }
.tile[data-type="S"] { border-color: rgba(90, 160, 255, .5); }
.tile[data-type="B"] { border-color: rgba(120, 200, 120, .5); }
@media (max-width: 520px) { .slot { font-size: .7rem; min-height: 80px; } .builder-stats { gap: 20px; } }

/* ===== live roster + card art ===== */
.roster-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 12px; padding: 12px 20px; border-top: 1px solid rgba(212, 175, 55, .15); background: var(--card-b); }
.roster-row a { color: var(--gold); font-weight: 600; }
.slot img, .tile img { max-width: 100%; height: auto; }
@media (max-width: 800px) { .roster-row { grid-template-columns: 1.5fr 1fr 1fr; } .roster-row span:last-child { display: none; } }