/* Queens Alliance visual system.
 * Loaded after theme.css so these rules can refine the original layout without
 * changing the shared colour and accessibility foundations.
 */

:root {
  --max-width: 1180px;
  --radius: 14px;
  --radius-sm: 8px;
  --section-gap: clamp(1rem, 2vw, 1.5rem);
}

/* Author-level display rules (notably .btn) must never override the native
 * hidden state used by report success, error, and terminal-status controls. */
[hidden] {
  display: none !important;
}

/* ── Public incident reports ─────────────────────────────── */

.reports-apology {
  color: var(--color-accent-light, #ffd46b);
  font-size: 1.08rem;
  font-weight: 700;
}

.report-form-card,
.report-success,
.report-status {
  max-width: 820px;
  margin-inline: auto;
}

.report-form-grid,
.report-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.report-form-grid label {
  display: grid;
  gap: 0.42rem;
  color: var(--color-text);
  font-weight: 700;
}

.report-form-grid input,
.report-form-grid select,
.report-form-grid textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.7rem 0.78rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-steel-2);
  color: var(--color-text);
  font: inherit;
}

.report-form-grid textarea {
  resize: vertical;
}

.report-form-grid small {
  color: var(--color-text-muted);
  font-weight: 400;
}

.report-form-wide {
  grid-column: 1 / -1;
}

.cf-turnstile {
  min-height: 65px;
  margin: 1rem 0;
}

.form-alert {
  margin: 1rem 0;
  padding: 0.8rem 1rem;
  border: 1px solid #d97706;
  border-radius: var(--radius-sm);
  background: rgba(217, 119, 6, 0.12);
  color: var(--color-text);
}

.secret-link-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.secret-link {
  min-width: 0;
  overflow-wrap: anywhere;
  user-select: all;
}

.report-next-steps {
  display: grid;
  gap: 0.65rem;
  margin-block: 1.25rem 0;
}

.report-status-grid > div {
  padding: 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-steel-2);
}

.report-status-grid dt {
  color: var(--color-text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.report-status-grid dd {
  margin: 0.35rem 0 0;
  overflow-wrap: anywhere;
}

.status-pill {
  display: inline-flex;
  padding: 0.25rem 0.58rem;
  border-radius: 999px;
  background: rgba(241, 196, 15, 0.18);
  color: #ffe27a;
  font-weight: 800;
}

.status-pill[data-status='confirmed'] { background: rgba(231, 76, 60, 0.2); color: #ff9c91; }
.status-pill[data-status='rejected'],
.status-pill[data-status='resolved_by_reporter'] { background: rgba(46, 204, 113, 0.16); color: #8ef0b7; }

.guide-report-cta {
  margin-top: 1.5rem;
  padding: 1.2rem;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius);
  background: rgba(241, 196, 15, 0.08);
}

@media (max-width: 700px) {
  .report-form-grid,
  .report-status-grid {
    grid-template-columns: 1fr;
  }

  .report-form-wide {
    grid-column: auto;
  }

  .secret-link-row .btn {
    width: 100%;
  }
}

img {
  max-width: 100%;
}

/* ── Header / navigation ─────────────────────────────────── */

.page-header {
  border-bottom: 2px solid var(--color-red);
  background: rgba(30, 37, 48, 0.97);
  backdrop-filter: blur(14px);
}

.page-header .header-shell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem 1.25rem;
  min-height: 72px;
  padding: 0.55rem 1rem;
}

.crown-logo {
  display: block;
  flex-shrink: 0;
  border-radius: 50%;
}

.brand-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.55));
}

.page-header .nav {
  min-width: 0;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
}

.page-header .nav-link,
.nav-group-toggle {
  padding: 0.5rem 0.6rem;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
}

.page-header .nav-link:hover,
.page-header .nav-link:focus-visible,
.page-header .nav-link[aria-current='page'] {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.07);
}

.page-header .nav-link[aria-current='page'] {
  box-shadow: inset 0 -2px 0 var(--color-accent);
}

.nav-group {
  position: relative;
  margin: 0;
  flex-shrink: 0;
}

.nav-group-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  list-style: none;
  cursor: pointer;
}

.nav-group-toggle::-webkit-details-marker { display: none; }
.nav-group-toggle::after { content: '⌄'; }
.nav-group[open] > .nav-group-toggle::after { transform: rotate(180deg); }
.nav-group[open] > .nav-group-toggle,
.nav-group[data-current-group] > .nav-group-toggle {
  color: var(--color-text);
  background: rgba(201, 162, 39, 0.13);
}

.nav-group-toggle:hover { background: rgba(255, 255, 255, 0.07); }
.nav-group-toggle:focus-visible,
.page-header .nav-link:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
}

.nav-group-links {
  position: absolute;
  inset-inline-start: 0;
  top: calc(100% + 8px);
  width: 260px;
  max-height: min(440px, calc(100dvh - 100px));
  overflow-y: auto;
  padding: 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-steel);
  box-shadow: var(--shadow-lg);
}

.page-header .nav-group-links .nav-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  white-space: normal;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  min-width: 0;
}

.page-header .header-discord {
  min-height: 38px;
  flex: 0 0 auto;
  padding: 0.42rem 0.78rem;
  border-width: 1px;
  font-size: 0.82rem;
  line-height: 1;
  white-space: nowrap;
}

.header-discord-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.nav-toggle {
  display: none;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-steel-2);
  color: var(--color-text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.nav-toggle:hover,
.nav-toggle:focus-visible,
.nav-toggle[aria-expanded='true'] {
  border-color: var(--color-accent);
  background: rgba(201, 162, 39, 0.12);
  color: #fff;
  outline: none;
}

.nav-toggle:focus-visible {
  box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.35);
}

.nav-toggle-icon {
  display: grid;
  gap: 3px;
  width: 17px;
}

.nav-toggle-icon span {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle[aria-expanded='true'] .nav-toggle-icon span:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}

.nav-toggle[aria-expanded='true'] .nav-toggle-icon span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded='true'] .nav-toggle-icon span:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

/* ── Language switcher ───────────────────────────────────── */

.lang-switcher {
  position: relative;
  margin: 0;
  flex: 0 0 auto;
}

.lang-switcher summary {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 38px;
  padding: 0.35rem 0.62rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-steel-2);
  color: var(--color-text);
  cursor: pointer;
  list-style: none;
  font-size: 0.82rem;
  white-space: nowrap;
}

.lang-switcher summary::-webkit-details-marker {
  display: none;
}

.lang-switcher summary::after {
  content: '▾';
  color: var(--color-text-muted);
  font-size: 0.7rem;
}

.lang-switcher summary:hover,
.lang-switcher summary:focus-visible {
  background: var(--color-steel);
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.lang-options {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 100;
  min-width: 172px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-steel);
  box-shadow: var(--shadow-lg);
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  color: var(--color-text);
  font-size: 0.875rem;
}

.lang-option:hover,
.lang-option:focus-visible {
  background: var(--color-steel-2);
  outline: none;
}

.lang-option:focus-visible {
  box-shadow: inset 0 0 0 2px var(--color-accent);
}

.flag {
  width: 20px;
  height: 15px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 2px;
}

/* ── Hero ────────────────────────────────────────────────── */

.hero-section {
  position: relative;
  min-height: clamp(320px, 40vw, 470px);
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--color-img-fallback);
  background-position: center;
  background-size: cover;
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(90deg, rgba(6, 8, 12, 0.9) 0%, rgba(6, 8, 12, 0.58) 48%, rgba(6, 8, 12, 0.25) 100%),
    linear-gradient(0deg, rgba(6, 8, 12, 0.72), transparent 55%);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4rem) 1rem;
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 660px;
  text-align: left;
}

.hero-section--with-foreground .hero-content {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  align-items: center;
  gap: clamp(1rem, 4vw, 3rem);
}

.hero-section--with-foreground .hero-copy {
  width: auto;
  max-width: 620px;
}

.hero-logo {
  width: 76px;
  height: auto;
  margin-bottom: 0.8rem;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.7));
}

.hero-title {
  max-width: 760px;
  margin-bottom: 0.65rem;
  color: #fff;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  text-wrap: balance;
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.9);
}

.hero-tagline {
  max-width: 620px;
  color: #f0c94a;
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  line-height: 1.5;
  text-wrap: balance;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

/* ── Page rhythm / shared surfaces ───────────────────────── */

.main-container {
  padding-top: clamp(1.25rem, 3vw, 2.25rem);
  padding-bottom: clamp(2rem, 5vw, 4rem);
}

.page-flow {
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
}

.page-flow > * {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.card,
.onboarding-section,
.guide-item,
.promo-card,
.rules-card,
.pandora-card {
  border-color: #313c4c;
  background: linear-gradient(145deg, rgba(34, 42, 54, 0.98), rgba(24, 29, 38, 0.98));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
}

.card {
  margin-top: 0;
  padding: clamp(1rem, 2.5vw, 1.5rem);
}

.home-section {
  position: relative;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  margin-bottom: 1rem;
}

.section-heading .card-title,
.section-heading .rules-title {
  margin: 0;
}

.card-title,
.rules-title,
.pandora-title,
.promo-card-title {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  letter-spacing: -0.01em;
}

.page-flow > h1.card-title {
  font-size: clamp(1.55rem, 3vw, 2.1rem);
}

.page-intro {
  max-width: 72ch;
  color: var(--color-text-muted);
}

.snapshot-status {
  min-height: 110px;
}

/* ── Existing art blocks ─────────────────────────────────── */

.events-explainer {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
}

.events-explainer-art {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: var(--color-img-fallback);
  background-image: url('/img/building.webp');
  background-position: center;
  background-size: cover;
}

.events-explainer-art::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}

.events-explainer-summary {
  position: relative;
  z-index: 1;
  padding: 1.5rem;
}

.zombie3d-accent {
  position: relative;
  min-height: 200px;
  background: transparent url('/img/zombie3d.webp') no-repeat right center / contain;
}

@media (max-width: 1100px) {
  .page-header .header-shell {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.4rem 0.6rem;
    min-height: 0;
    padding-block: 0.45rem;
  }

  .brand-logo { width: 46px; height: 46px; }
  .header-actions { grid-column: 2; grid-row: 1; gap: 0.4rem; }
  .nav-ready .nav-toggle { display: inline-flex; min-height: 44px; }

  .page-header .nav {
    display: grid;
    grid-row: 2;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    width: 100%;
    max-height: calc(100vh - 82px);
    max-height: calc(100dvh - 82px);
    overflow-y: auto;
    overscroll-behavior: contain;
    gap: 0.4rem;
    padding: 0.55rem 0.2rem max(0.6rem, env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .nav-ready .page-header .nav { display: none; }
  .nav-ready .page-header .nav[data-mobile-open='true'] { display: grid; }
  .nav-group { grid-column: 1 / -1; min-width: 0; }
  .nav-group-toggle {
    justify-content: space-between;
    padding: 0.75rem;
    color: var(--color-accent);
    font-size: 0.9rem;
    white-space: normal;
  }

  .nav-group-links {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: auto;
    max-height: none;
    overflow: visible;
    gap: 0.4rem;
    padding: 0.4rem 0;
    border: 0;
    background: none;
    box-shadow: none;
  }

  .page-header .nav-link {
    display: flex;
    min-height: 44px;
    align-items: center;
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.035);
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .page-header .nav-link[aria-current='page'] {
    border-color: rgba(201, 162, 39, 0.45);
    background: rgba(201, 162, 39, 0.13);
    box-shadow: inset 0 -2px 0 var(--color-accent);
  }

  .page-header .header-discord,
  .lang-switcher summary { min-height: 44px; }
}

@media (max-width: 700px) {
  .hero-section {
    min-height: 300px;
  }

  .hero-section--with-foreground .hero-content {
    grid-template-columns: 1fr;
    gap: 0;
    padding-top: 2rem;
    padding-bottom: 0;
  }

  .hero-section--with-foreground .hero-copy {
    width: 100%;
    max-width: 100%;
  }

  .hero-title {
    max-width: 12ch;
  }
}

@media (max-width: 460px) {
  .page-header .header-discord {
    width: 38px;
    justify-content: center;
    padding-inline: 0;
  }

  .header-discord-label,
  .lang-label,
  .lang-switcher summary::after {
    display: none;
  }

  .nav-toggle { padding-inline: 0.6rem; }

  .lang-switcher summary {
    width: 38px;
    justify-content: center;
    padding-inline: 0;
  }

  .page-header .nav-link {
    padding: 0.42rem 0.52rem;
    font-size: 0.8rem;
  }

  .hero-title {
    font-size: clamp(1.8rem, 10vw, 2.5rem);
  }
}
