/* ═══════════════════════════════════════
   Mafia: Circle of Lies — Dark Gothic Theme
   Colors sourced from components/theme.ts
   ═══════════════════════════════════════ */

:root {
  /* Backgrounds */
  --bg: #0d0a0a;
  --surface: #1a1210;
  --surface-light: #2a1f1a;

  /* Primary (blood red) */
  --primary: #8b0000;
  --primary-light: #c41e3a;

  /* Accent (gold) */
  --accent: #c9a84c;
  --accent-light: #d4af37;
  --bronze: #8b6914;

  /* Text (parchment tones) */
  --text: #e8dcc8;
  --text-muted: #9a8b7a;
  --text-dim: #6a5d4e;

  /* Factions */
  --town: #4a7c4f;
  --mafia: #8b0000;
  --neutral: #8a7d6b;
  --cult: #6a1b6a;

  /* Semantic */
  --success: #4a7c4f;
  --warning: #d4a017;
  --danger: #c41e3a;

  /* Layout */
  --max-width: 1100px;
  --nav-height: 64px;
}

/* ── Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: "Cinzel", serif;
  font-weight: 700;
  line-height: 1.2;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-light);
}

img {
  max-width: 100%;
  height: auto;
}

/* ── Navigation ── */
.main-nav {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: 100;
  background: rgba(13, 10, 10, 0.95);
  backdrop-filter: blur(8px);
  border-block-end: 1px solid var(--surface-light);
  height: var(--nav-height);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-logo {
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--accent);
  letter-spacing: 0.1em;
}

.nav-logo:hover {
  color: var(--accent-light);
}

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

.nav-links a {
  color: var(--text-muted);
  font-size: 0.95rem;
  padding: 0.25rem 0;
  border-block-end: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  border-block-end-color: var(--accent);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: transform 0.3s, opacity 0.3s;
}

.lang-toggle {
  background: none;
  border: 1px solid var(--surface-light);
  color: var(--text-muted);
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: border-color 0.2s, color 0.2s;
}

.lang-toggle:hover {
  border-color: var(--accent);
  color: var(--text);
}

/* ── Mobile nav ── */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    inset-inline: 0;
    background: var(--bg);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1rem;
    border-block-end: 1px solid var(--surface-light);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s, opacity 0.3s;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
}

/* ── Hero ── */
.hero {
  padding-block-start: calc(var(--nav-height) + 4rem);
  padding-block-end: 4rem;
  text-align: center;
  background: radial-gradient(ellipse at center top, rgba(139, 0, 0, 0.15) 0%, transparent 60%);
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.hero-title {
  font-size: clamp(3rem, 10vw, 5rem);
  color: var(--accent);
  letter-spacing: 0.15em;
  margin-block-end: 0.25rem;
}

.hero-subtitle {
  font-family: "Cinzel", serif;
  font-size: clamp(1rem, 3vw, 1.5rem);
  color: var(--primary-light);
  letter-spacing: 0.3em;
  margin-block-end: 1.5rem;
}

.hero-tagline {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2.5rem;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border-radius: 6px;
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  transition: background 0.2s, transform 0.1s;
  cursor: pointer;
  border: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-light);
  color: #fff;
}

.btn-secondary {
  background: var(--surface-light);
  color: var(--text);
  border: 1px solid var(--accent);
}

.btn-secondary:hover {
  background: var(--surface);
  color: var(--accent);
}

/* ── Trailer ── */
.trailer {
  padding: 2rem 1.5rem;
  text-align: center;
  background: var(--bg);
}

.trailer-inner {
  max-width: 420px;
  margin: 0 auto;
}

.trailer-inner h2 {
  color: var(--accent);
  font-family: "Cinzel", serif;
  font-size: 1.5rem;
  margin-block-end: 1.25rem;
}

.trailer-inner video {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--surface-light);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
}

/* ── Beta section ── */
.beta {
  padding: 4rem 1.5rem;
  background: var(--surface);
  border-top: 1px solid var(--surface-light);
}

.beta-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}

.beta-inner h2 {
  color: var(--accent);
  font-family: "Cinzel", serif;
  font-size: 1.75rem;
  margin-block-end: 0.75rem;
}

.beta-desc {
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

.beta-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.beta-card {
  background: var(--bg);
  border: 1px solid var(--surface-light);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.beta-card h4 {
  color: var(--accent);
  font-family: "Cinzel", serif;
  font-size: 0.95rem;
  margin: 0;
}

.beta-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
  flex: 1;
}

.btn-sm {
  padding: 0.45rem 1rem;
  font-size: 0.82rem;
  align-self: flex-start;
}

/* ── Factions page ── */
.faction-block {
  background: var(--surface);
  border: 1px solid var(--surface-light);
  border-radius: 8px;
  padding: 1.5rem;
  margin-block-end: 1.5rem;
}

.faction-win {
  background: var(--bg);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin: 0.75rem 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  border-left: 3px solid var(--accent);
}

.faction-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.faction-category-tag {
  background: var(--surface-light);
  color: var(--text);
  border-radius: 4px;
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
}

/* ── Screenshot lightbox ── */
#screenshotOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

#screenshotOverlay.active {
  display: flex;
}

#screenshotOverlayImg {
  max-height: 90vh;
  max-width: 90vw;
  border-radius: 12px;
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.8);
  object-fit: contain;
}

/* ── Howto inline screenshot ── */
.howto-with-screenshot {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
}

.howto-screenshot-text {
  flex: 1;
}

.howto-screenshot-img {
  flex-shrink: 0;
}

.howto-screenshot-img img {
  width: 140px;
  border-radius: 12px;
  border: 1px solid var(--surface-light);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

@media (max-width: 500px) {
  .howto-with-screenshot {
    flex-direction: column;
  }

  .howto-screenshot-img img {
    width: 120px;
  }
}

/* ── Screenshot section ── */
.screenshot-section {
  padding: 4rem 1.5rem;
  background: var(--surface);
  border-top: 1px solid var(--surface-light);
  border-bottom: 1px solid var(--surface-light);
}

.screenshot-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 3rem;
}

.screenshot-text {
  flex: 1;
}

.screenshot-text h2 {
  color: var(--accent);
  font-family: "Cinzel", serif;
  font-size: 1.75rem;
  margin-block-end: 1rem;
}

.screenshot-text p {
  color: var(--text-muted);
  line-height: 1.7;
  font-size: 1rem;
}

.screenshot-image {
  flex-shrink: 0;
}

.screenshot-image img {
  width: 200px;
  border-radius: 16px;
  border: 1px solid var(--surface-light);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

@media (max-width: 600px) {
  .screenshot-inner {
    flex-direction: column-reverse;
    text-align: center;
  }

  .screenshot-image img {
    width: 160px;
  }
}

/* ── Features ── */
.features {
  padding: 4rem 1.5rem;
}

.features-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--surface-light);
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  transition: border-color 0.2s;
}

.feature-card:hover {
  border-color: var(--accent);
}

.feature-icon {
  margin-block-end: 1rem;
}

.feature-card h3 {
  color: var(--accent);
  font-size: 1.25rem;
  margin-block-end: 0.75rem;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ── CTA ── */
.cta {
  padding: 4rem 1.5rem;
  text-align: center;
  background: var(--surface);
  border-block: 1px solid var(--surface-light);
}

.cta-inner {
  max-width: 600px;
  margin: 0 auto;
}

.cta h2 {
  color: var(--accent);
  font-size: 2rem;
  margin-block-end: 1rem;
}

.cta p {
  color: var(--text-muted);
  margin-block-end: 2rem;
}

/* ── Page header ── */
.page-header {
  padding-block-start: calc(var(--nav-height) + 3rem);
  padding-block-end: 2rem;
  text-align: center;
  background: radial-gradient(ellipse at center top, rgba(139, 0, 0, 0.1) 0%, transparent 60%);
}

.page-header h1 {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  color: var(--accent);
  margin-block-end: 0.75rem;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ── Content sections ── */
.content-section {
  padding: 2rem 1.5rem 4rem;
}

.content-inner {
  max-width: 800px;
  margin: 0 auto;
}

.howto-block {
  margin-block-end: 3rem;
}

.howto-block h2 {
  color: var(--accent);
  font-size: 1.5rem;
  margin-block-end: 1rem;
  padding-block-end: 0.5rem;
  border-block-end: 1px solid var(--surface-light);
}

.howto-block p {
  color: var(--text-muted);
  margin-block-end: 1rem;
}

/* ── Steps list ── */
.howto-steps {
  list-style: none;
  counter-reset: step;
}

.howto-steps li {
  counter-increment: step;
  padding: 1rem;
  padding-inline-start: 3.5rem;
  position: relative;
  color: var(--text);
  background: var(--surface);
  border-radius: 6px;
  margin-block-end: 0.75rem;
}

.howto-steps li::before {
  content: counter(step);
  position: absolute;
  inset-inline-start: 1rem;
  top: 1rem;
  width: 1.75rem;
  height: 1.75rem;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

/* ── Phase cards ── */
.phase-card {
  background: var(--surface);
  border-radius: 8px;
  padding: 1.5rem;
  margin-block-end: 1rem;
  border-inline-start: 4px solid var(--text-dim);
}

.phase-night {
  border-inline-start-color: #3a5a8c;
}

.phase-day {
  border-inline-start-color: var(--accent);
}

.phase-vote {
  border-inline-start-color: var(--primary-light);
}

.phase-card h3 {
  color: var(--text);
  font-size: 1.15rem;
  margin-block-end: 0.5rem;
}

.phase-card p {
  color: var(--text-muted);
  margin: 0;
}

/* ── Win conditions grid ── */
.win-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.win-card {
  background: var(--surface);
  border-radius: 8px;
  padding: 1.25rem;
  border: 1px solid var(--surface-light);
  border-inline-start: 4px solid;
}

.win-card h4 {
  font-size: 1rem;
  margin-block-end: 0.5rem;
}

.win-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

/* ── Diff grid (online differences) ── */
.diff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.diff-card {
  background: var(--surface);
  border-radius: 8px;
  padding: 1.25rem;
  border: 1px solid var(--surface-light);
}

.diff-card h4 {
  color: var(--accent);
  font-size: 0.95rem;
  margin-block-end: 0.5rem;
}

.diff-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

/* ── FAQ ── */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.faq-item {
  background: var(--surface);
  border-radius: 6px;
  border: 1px solid var(--surface-light);
  overflow: hidden;
}

.faq-item summary {
  padding: 1rem 1.25rem;
  cursor: pointer;
  color: var(--text);
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.faq-item summary::after {
  content: "+";
  font-size: 1.25rem;
  color: var(--accent);
  transition: transform 0.2s;
}

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

.faq-item p {
  padding: 0 1.25rem 1rem;
  color: var(--text-muted);
}

/* ── Footer ── */
.site-footer {
  background: var(--surface);
  border-block-start: 1px solid var(--surface-light);
  padding: 2rem 1.5rem;
  text-align: center;
}

.footer-brand {
  font-family: "Cinzel", serif;
  font-weight: 700;
  color: var(--accent);
  font-size: 1.1rem;
  margin-block-end: 0.5rem;
}

.footer-copy {
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* ── RTL support ── */
[dir="rtl"] {
  direction: rtl;
}

[dir="rtl"] body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ── Utility ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
