/* Minimal placeholder styling - workshop later. */

/* --- Header font: "Edo SZ" -------------------------------------------------
   Edo SZ is a freeware display font (not a Google/web font), so it must be
   self-hosted. Drop the font file(s) into docs/fonts/ (see docs/fonts/README).
   Until then, headers fall back to the stack below. */
@font-face {
  font-family: "Edo SZ";
  src: url("fonts/edosz.woff2") format("woff2"),
       url("fonts/edosz.ttf") format("truetype");
  font-display: swap;
}

* { box-sizing: border-box; }

:root {
  --banner-height: 56px;
  --max-width: 980px;

  --font-header: "Edo SZ", Impact, "Arial Black", sans-serif;

  /* Light theme (default) */
  --bg: #ffffff;
  --text: #1d1d1f;
  --text-muted: #6e6e73;
  --text-soft: #333333;
  --border: #e5e5e7;
  --border-soft: #f0f0f0;
  --banner-bg: rgba(255, 255, 255, 0.9);
  --th-bg: #f5f5f7;
  /* Brand green (from the Combo Mode logo). --accent is the vivid fill used on
     buttons and decorative bars; --accent-ink is a readable green for text/links
     on the page background (darker in light mode, brighter in dark mode). */
  --accent: #16a34a;
  --accent-text: #ffffff;
  --accent-ink: #0f7a37;
  --error: #b00020;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --text: #f5f5f7;
    --text-muted: #a1a1a6;
    --text-soft: #cccccc;
    --border: #38383a;
    --border-soft: #1d1d1f;
    --banner-bg: rgba(0, 0, 0, 0.8);
    --th-bg: #1c1c1e;
    --accent: #2ee070;
    --accent-text: #06240f;
    --accent-ink: #4ade80;
    --error: #ff6b6b;
  }
}

html {
  scroll-behavior: smooth;
  /* Offset anchor jumps so the fixed banner doesn't cover section headings. */
  scroll-padding-top: var(--banner-height);
  color-scheme: light dark;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

/* Banner */
.banner {
  /* Sticky (not fixed) so it reserves its own space and can grow when the nav
     wraps to multiple rows on narrow screens - without overlapping content. */
  position: sticky;
  top: 0;
  min-height: var(--banner-height);
  background: var(--banner-bg);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
}

.banner-inner {
  max-width: var(--max-width);
  min-height: var(--banner-height);
  margin: 0 auto;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.brand {
  font-family: var(--font-header);
  font-weight: 600;
  font-size: 20px;
  text-decoration: none;
  color: var(--accent-ink);
  white-space: nowrap;
}

.nav {
  display: flex;
  gap: 8px 20px;
  flex-wrap: wrap;
}

.nav a {
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  opacity: 0.8;
}

.nav a:hover { opacity: 1; color: var(--accent-ink); }

/* Sections */
/* No top offset needed: the sticky banner reserves its own space in flow. */

.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 64px 20px;
  border-bottom: 1px solid var(--border-soft);
}

.hero {
  text-align: center;
  padding: 96px 20px;
}

/* Headers use the Edo SZ display font. */
.hero h1,
.section h2 {
  font-family: var(--font-header);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.hero h1 { font-size: 48px; margin: 0 0 8px; }

/* Hero logo image (falls back to the "Combo Mode" alt text if absent). */
.hero-title { margin: 0 0 8px; }
.hero-logo {
  display: block;
  margin: 0 auto;
  width: min(640px, 90%);
  height: auto;
}

.tagline { font-size: 20px; color: var(--text-muted); margin: 0; }

.section h2 { font-size: 32px; margin: 0 0 8px; }
/* Small green accent bar under each section heading. */
.section h2::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  margin-top: 8px;
  border-radius: 2px;
  background: var(--accent);
}
.section-lead { color: var(--text-muted); margin: 0 0 24px; }

.loading { color: var(--text-muted); }
.error { color: var(--error); }

/* Tables (characters + credits) */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

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

th {
  background: var(--th-bg);
  position: sticky;
  top: var(--banner-height);
  font-weight: 600;
}

td ul { margin: 0; padding-left: 18px; }

/* Character changes: release selector + grid */
.changes-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.changes-controls label { font-weight: 600; }

#release-select {
  font: inherit;
  padding: 6px 10px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}

/* Segmented control: cumulative history vs. just-this-release changes. */
.mode-toggle {
  display: inline-flex;
  padding: 2px;
  margin-right: 6px;
  background: var(--th-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.mode-btn {
  font: inherit;
  padding: 5px 12px;
  color: var(--text-muted);
  background: none;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.mode-btn:hover { color: var(--text); }

.mode-btn.is-active {
  color: var(--accent-text);
  background: var(--accent);
  font-weight: 600;
}

/* "vs 0.9.0" pill next to the release picker in compare mode. */
.compare-note {
  padding: 4px 10px;
  font-size: 14px;
  color: var(--text-muted);
  background: var(--th-bg);
  border-radius: 999px;
}

.changes-mode-note {
  margin: -14px 0 20px;
  font-size: 14px;
  color: var(--text-muted);
}

/* Subsection headings (e.g. Credits > Characters/Stages/Other) */
.subsection-title {
  font-family: var(--font-header);
  font-size: 22px;
  margin: 32px 0 12px;
}
.subsection-title:first-of-type { margin-top: 8px; }

/* Quirks (clickable icon grid) */
.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 12px;
}

.icon-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 8px;
  font: inherit;
  text-align: center;
  color: var(--text);
  background: var(--th-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}

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

.icon-img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.icon-img-wrap {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.icon-img-wrap .icon-img {
  width: 56px;
  height: 56px;
}

.icon-alt-badge {
  position: absolute;
  top: 0;
  left: 0;
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.icon-label {
  font-size: 13px;
  line-height: 1.2;
}

/* Text-only tile (no icon art yet): center the label and give it presence. */
.icon-card.no-icon {
  justify-content: center;
  min-height: 76px;
}
.icon-card.no-icon .icon-label { font-weight: 600; font-size: 14px; }

/* Cut from the roster: still listed with their full history, but drained of
   colour so it reads at a glance. Colour returns on hover/focus so the tile
   doesn't look disabled - it is still clickable. */
.icon-card.is-removed .icon-img {
  filter: grayscale(1);
  opacity: 0.55;
}
.icon-card.is-removed .icon-label { color: var(--text-muted); }
.icon-card.is-removed:hover .icon-img,
.icon-card.is-removed:focus-visible .icon-img {
  filter: grayscale(0.35);
  opacity: 0.85;
}

/* Modal */
.modal[hidden] { display: none; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.modal-dialog {
  position: relative;
  width: 100%;
  max-width: 720px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  margin: 0;
  font-family: var(--font-header);
  font-size: 24px;
}

.modal-close {
  font: inherit;
  font-size: 24px;
  line-height: 1;
  padding: 0 6px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
}

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

.modal-body {
  padding: 20px;
  overflow-y: auto;
}

/* Rendered markdown */
.markdown h1, .markdown h2, .markdown h3,
.markdown h4, .markdown h5, .markdown h6 {
  font-family: var(--font-header);
  margin: 1.2em 0 0.4em;
}
.markdown h1:first-child, .markdown h2:first-child,
.markdown h3:first-child { margin-top: 0; }
.markdown p { margin: 0 0 12px; }
.markdown ul, .markdown ol { margin: 0 0 12px; padding-left: 22px; }
.markdown li { margin: 2px 0; }
.markdown code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  padding: 1px 5px;
  background: var(--th-bg);
  border-radius: 4px;
}
.markdown pre {
  background: var(--th-bg);
  padding: 12px 14px;
  border-radius: 8px;
  overflow-x: auto;
}
.markdown pre code { padding: 0; background: none; }
.markdown blockquote {
  margin: 0 0 12px;
  padding: 4px 14px;
  border-left: 3px solid var(--accent);
  color: var(--text-muted);
}
.markdown a { color: var(--accent-ink); }
.markdown table { margin-bottom: 12px; }
.markdown hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }

/* Gallery (horizontal filmstrip) */
.gallery { position: relative; }

.gallery-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: 6px 2px 16px;
  scrollbar-width: thin;
}

.gallery-track::-webkit-scrollbar { height: 8px; }
.gallery-track::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.gallery-item {
  flex: 0 0 auto;
  width: min(80vw, 460px);
  scroll-snap-align: center;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 12px;
  overflow: hidden;
  line-height: 0;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

/* Prev/next arrows */
.gallery-nav {
  position: absolute;
  top: calc(50% - 5px);
  transform: translateY(-50%);
  z-index: 5;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.gallery-nav:hover { border-color: var(--accent); color: var(--accent-ink); }
.gallery-nav[hidden] { display: none; }
.gallery-nav:disabled { opacity: 0.3; cursor: default; }
.gallery-prev { left: 4px; }
.gallery-next { right: 4px; }

/* Lightbox (full-size image viewer) */
.lightbox[hidden] { display: none; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.9);
}

.lightbox-img {
  max-width: 94vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 34px;
  line-height: 1;
  color: #fff;
  background: none;
  border: 0;
  cursor: pointer;
}

/* Trailer */
.video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* FAQ */
.faq-item { margin-bottom: 20px; }
.faq-q { font-weight: 600; margin: 0 0 4px; }
.faq-a { margin: 0; color: var(--text-soft); }

/* Download and Join */
.download-join {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: center;
}

@media (max-width: 640px) {
  .download-join { grid-template-columns: 1fr; }
}

.download-col {
  display: flex;
  justify-content: center;
}

.download-button {
  display: inline-block;
  padding: 12px 24px;
  background: var(--accent);
  color: var(--accent-text);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
}

.discord-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 32px 24px;
  background: #5865f2;
  color: #fff;
  text-decoration: none;
  border-radius: 12px;
  text-align: center;
}

.discord-card:hover { background: #4752c4; }

.discord-logo { width: 56px; height: 56px; }

.discord-card-title {
  font-family: var(--font-header);
  font-size: 22px;
  font-weight: 700;
}

.discord-card-sub {
  font-size: 14px;
  opacity: 0.9;
  max-width: 34ch;
}

.discord-join-btn {
  margin-top: 6px;
  padding: 10px 22px;
  background: #fff;
  color: #5865f2;
  border-radius: 8px;
  font-weight: 600;
}

.discord-card:hover .discord-join-btn { background: #f2f3f5; }
