/* TCG Card Shop Simulator — unofficial fan guide
   Indigo / violet card-shop vibe. Mobile-first. */

:root {
  --indigo: #6366f1;
  --indigo-dark: #4f46e5;
  --indigo-light: #c4b5fd;
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --white: #ffffff;
  --amber: #f59e0b;
  --amber-bg: #fffbeb;
  --red-soft: #fef2f2;
  --red-text: #991b1b;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(15, 23, 42, 0.04);
  --max: 720px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--slate-800);
  background: var(--slate-50);
}

a { color: var(--indigo-dark); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--indigo); }

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

/* Header */
.site-header {
  background: var(--slate-900);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.logo {
  color: var(--white);
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-mark {
  display: inline-flex;
  width: 1.75rem;
  height: 1.75rem;
  background: var(--indigo);
  border-radius: 6px;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.logo-text { display: flex; flex-direction: column; line-height: 1.25; }
.logo-title { color: var(--white); font-weight: 700; font-size: 1rem; }
.logo-tagline { color: var(--indigo-light); font-weight: 500; font-size: 0.8rem; }

.nav-toggle {
  display: none;
  background: var(--slate-800);
  border: 1px solid var(--slate-700);
  color: var(--white);
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}

.site-nav { display: flex; gap: 0.25rem; flex-wrap: wrap; }

.site-nav a {
  color: var(--slate-200);
  text-decoration: none;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: var(--slate-800);
  color: var(--indigo-light);
}

.nav-more {
  position: relative;
}

.nav-more > summary {
  list-style: none;
  cursor: pointer;
  color: var(--slate-200);
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  user-select: none;
}

.nav-more > summary::-webkit-details-marker { display: none; }
.nav-more > summary::after { content: " ▾"; opacity: 0.7; font-size: 0.75em; }

.nav-more > summary:hover,
.nav-more[open] > summary {
  background: var(--slate-800);
  color: var(--indigo-light);
}

.nav-more-links {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.35rem;
  margin-top: 0.25rem;
  background: var(--slate-800);
  border: 1px solid var(--slate-700);
  border-radius: 8px;
  min-width: 10.5rem;
}

@media (min-width: 721px) {
  .nav-more-links {
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 120;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  }
}

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    padding-bottom: 0.5rem;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 0.6rem 0.75rem; }
  .nav-more > summary { padding: 0.6rem 0.75rem; }
  .nav-more-links { margin: 0 0 0.25rem; }
}

/* Layout */
.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.hero {
  background: linear-gradient(135deg, var(--slate-900) 0%, var(--slate-800) 50%, var(--indigo-dark) 100%);
  color: var(--white);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow);
}

.hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 4vw, 2rem);
  letter-spacing: -0.03em;
  line-height: 1.25;
}

.hero p { margin: 0; opacity: 0.9; max-width: 36em; }

.badge {
  display: inline-block;
  background: rgba(196, 181, 253, 0.18);
  color: var(--indigo-light);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
  letter-spacing: 0.02em;
}

main h1 {
  font-size: clamp(1.4rem, 3.5vw, 1.85rem);
  color: var(--slate-900);
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
  line-height: 1.3;
}

main h2 {
  font-size: 1.25rem;
  color: var(--slate-900);
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--indigo);
  letter-spacing: -0.01em;
}

main h3 {
  font-size: 1.05rem;
  color: var(--slate-800);
  margin: 1.5rem 0 0.5rem;
}

main p, main li { max-width: var(--max); }
main ul, main ol { padding-left: 1.25rem; }
main li { margin-bottom: 0.4rem; }

.lead { font-size: 1.1rem; color: var(--slate-600); max-width: var(--max); }

/* Cards / grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}

.card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.card:hover {
  border-color: var(--indigo);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.14);
}

.card a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.card a:hover { color: inherit; }
.card h3 { margin: 0 0 0.4rem; color: var(--indigo-dark); font-size: 1.05rem; }
.card p { margin: 0; font-size: 0.925rem; color: var(--slate-600); }

.panel {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  margin: 1.25rem 0;
  box-shadow: var(--shadow);
  max-width: var(--max);
}

/* Callouts */
.note, .warn, .tip, .community {
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  margin: 1.25rem 0;
  max-width: var(--max);
  font-size: 0.95rem;
}

.note {
  background: var(--slate-100);
  border-left: 4px solid var(--slate-500);
}

.warn {
  background: var(--red-soft);
  border-left: 4px solid #ef4444;
  color: var(--red-text);
}

.tip {
  background: #eef2ff;
  border-left: 4px solid var(--indigo);
}

.community {
  background: var(--amber-bg);
  border-left: 4px solid var(--amber);
}

.note strong, .warn strong, .tip strong, .community strong {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Tables */
.table-wrap { overflow-x: auto; margin: 1rem 0; max-width: 100%; }

table {
  width: 100%;
  max-width: var(--max);
  border-collapse: collapse;
  background: var(--white);
  font-size: 0.925rem;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

th, td {
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--slate-200);
  vertical-align: top;
}

th {
  background: var(--slate-800);
  color: var(--white);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

tr:last-child td { border-bottom: none; }
tr:nth-child(even) td { background: var(--slate-50); }

.secret { color: var(--slate-500); font-style: italic; }

/* Quick start steps */
.steps { counter-reset: step; list-style: none; padding: 0; max-width: var(--max); }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 0.75rem 0.75rem 0.75rem 3rem;
  margin-bottom: 0.5rem;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  width: 1.6rem;
  height: 1.6rem;
  background: var(--indigo);
  color: var(--white);
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* FAQ */
.faq-item {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  max-width: var(--max);
  overflow: hidden;
}

.faq-item summary {
  padding: 0.9rem 1.1rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--slate-900);
  list-style: none;
}

.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before {
  content: "+";
  display: inline-block;
  width: 1.25rem;
  color: var(--indigo);
  font-weight: 700;
}
.faq-item[open] summary::before { content: "−"; }
.faq-item .faq-body {
  padding: 0 1.1rem 1rem;
  color: var(--slate-600);
  border-top: 1px solid var(--slate-100);
}

/* Breadcrumb */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--slate-500);
  margin-bottom: 1rem;
}
.breadcrumb a { color: var(--slate-600); }

/* Footer */
.site-footer {
  background: var(--slate-900);
  color: var(--slate-200);
  padding: 2rem 1.25rem;
  font-size: 0.875rem;
  line-height: 1.6;
}

.footer-inner {
  max-width: 960px;
  margin: 0 auto;
}

.site-footer a { color: var(--indigo-light); }
.site-footer .disclaimer {
  opacity: 0.85;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--slate-700);
  max-width: 48em;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0.5rem;
}

.footer-nav a { text-decoration: none; font-weight: 500; }
.footer-nav a:hover { text-decoration: underline; }

/* Utility */
.meta { font-size: 0.85rem; color: var(--slate-500); margin-bottom: 1.5rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Filter + calculators (codes-calculator.html) */
.filter-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--slate-700);
  margin: 1rem 0 0.35rem;
}

.filter-input {
  width: 100%;
  max-width: var(--max);
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  font: inherit;
  font-size: 0.95rem;
  background: var(--white);
  color: var(--slate-800);
  box-shadow: var(--shadow);
}

.filter-input:focus {
  outline: 2px solid var(--indigo);
  outline-offset: 1px;
  border-color: var(--indigo);
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 1.25rem 0;
}

.calc-panel {
  max-width: none;
  margin: 0;
}

.calc-panel h3 { margin-top: 0; }

.calc-intro {
  font-size: 0.925rem;
  color: var(--slate-600);
  margin: 0 0 1rem;
}

.calc-form { display: flex; flex-direction: column; gap: 0.85rem; }

.calc-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--slate-800);
  margin-bottom: 0.25rem;
}

.calc-field input {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--slate-200);
  border-radius: 6px;
  font: inherit;
  font-size: 0.95rem;
  background: var(--slate-50);
}

.calc-field input:focus {
  outline: 2px solid var(--indigo);
  outline-offset: 1px;
  background: var(--white);
}

.calc-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--slate-500);
  margin-top: 0.25rem;
  line-height: 1.4;
}

.calc-result {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--slate-200);
  font-size: 0.95rem;
}

.calc-result p { margin: 0.4rem 0; max-width: none; }

.calc-muted { color: var(--slate-500); font-size: 0.85rem; }

/* Interactive checklist (static; local checkboxes only) */
.checklist {
  list-style: none;
  padding: 0;
  max-width: var(--max);
  margin: 0.75rem 0 1.25rem;
}

.checklist li {
  margin-bottom: 0.45rem;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.checklist label {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.7rem 0.85rem;
  cursor: pointer;
  color: var(--slate-800);
  line-height: 1.5;
}

.checklist input[type="checkbox"] {
  margin: 0.2rem 0 0;
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  accent-color: var(--indigo);
  cursor: pointer;
}

.checklist input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 2px;
}

.checklist label:has(input:checked) {
  color: var(--slate-500);
  text-decoration: line-through;
  text-decoration-color: var(--slate-300);
}

