/* TASK232 — Dungeon War Public Guide — Dark Fantasy Theme */
/* Readability + Speed + Mobile UX priorities */

:root {
  --bg: #0d0e12;
  --bg-card: #16181f;
  --bg-hover: #1e2130;
  --border: #2a2d3a;
  --text: #d4d4e0;
  --text-dim: #8a8a9a;
  --text-bright: #f0f0f5;
  --gold: #e8c46a;
  --gold-dim: #a08840;
  --green: #5a5;
  --red: #c55;
  --blue: #6ab;
  --purple: #a6a;
  --accent: #c9a05c;
  --link: #6ab4ff;
  --link-hover: #8ac4ff;
  --shadow: 0 2px 8px rgba(0,0,0,0.3);
  --radius: 8px;
  --max-width: 1200px;
  --nav-width: 260px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }

/* === HEADER === */
.guide-header {
  background: linear-gradient(135deg, #1a1c24, #0d0e12);
  border-bottom: 2px solid var(--accent);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.guide-header .logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}
.guide-header .logo span { color: var(--text-dim); font-size: 14px; font-weight: 400; }
.guide-header .search-box {
  flex: 1;
  max-width: 400px;
  position: relative;
}
.guide-header .search-box input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  outline: none;
}
.guide-header .search-box input:focus { border-color: var(--accent); }
.guide-header .search-box::before {
  content: '🔍';
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
}
.guide-header .search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  max-height: 400px;
  overflow-y: auto;
  display: none;
  z-index: 200;
  box-shadow: var(--shadow);
}
.guide-header .search-results.visible { display: block; }
.guide-header .search-results .result-item {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 14px;
}
.guide-header .search-results .result-item:hover { background: var(--bg-hover); }
.guide-header .search-results .result-item .title { color: var(--text-bright); font-weight: 500; }
.guide-header .search-results .result-item .snippet { color: var(--text-dim); font-size: 12px; }

.guide-header .menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
}

/* === LAYOUT === */
.guide-layout {
  display: flex;
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: calc(100vh - 60px);
}

.guide-nav {
  width: var(--nav-width);
  flex-shrink: 0;
  padding: 20px 12px;
  border-right: 1px solid var(--border);
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
}
.guide-nav h3 {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 16px 0 8px 8px;
  letter-spacing: 1px;
}
.guide-nav h3:first-child { margin-top: 0; }
.guide-nav a {
  display: block;
  padding: 6px 12px;
  color: var(--text);
  border-radius: 4px;
  font-size: 14px;
  transition: background 0.1s;
}
.guide-nav a:hover { background: var(--bg-hover); text-decoration: none; }
.guide-nav a.active { background: var(--bg-hover); color: var(--gold); font-weight: 500; border-left: 3px solid var(--accent); }

.guide-content {
  flex: 1;
  padding: 24px 32px;
  min-width: 0;
}

/* === ARTICLE === */
article { max-width: 800px; }
article h1 {
  font-size: 28px;
  color: var(--gold);
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}
article h2 {
  font-size: 22px;
  color: var(--text-bright);
  margin: 28px 0 12px;
}
article h3 {
  font-size: 18px;
  color: var(--accent);
  margin: 20px 0 8px;
}
article p { margin-bottom: 12px; }
article ul, article ol { margin: 0 0 12px 20px; }
article li { margin-bottom: 4px; }
article code {
  background: var(--bg-card);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 14px;
  color: var(--gold);
}
article .note {
  background: rgba(106, 168, 187, 0.1);
  border-left: 3px solid var(--blue);
  padding: 12px 16px;
  margin: 16px 0;
  border-radius: 0 var(--radius) var(--radius) 0;
}
article .warning {
  background: rgba(197, 85, 85, 0.1);
  border-left: 3px solid var(--red);
  padding: 12px 16px;
  margin: 16px 0;
  border-radius: 0 var(--radius) var(--radius) 0;
}
article .canary-badge {
  display: inline-block;
  background: rgba(170, 102, 170, 0.2);
  color: var(--purple);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  margin-left: 8px;
}

/* === STAT TABLES === */
.stat-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 14px;
}
.stat-table th, .stat-table td {
  padding: 8px 12px;
  border: 1px solid var(--border);
  text-align: left;
}
.stat-table th {
  background: var(--bg-card);
  color: var(--gold);
  font-weight: 600;
}
.stat-table tr:nth-child(even) { background: rgba(255,255,255,0.02); }
.stat-table tr:hover { background: var(--bg-hover); }

/* === CARD GRID === */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  transition: border-color 0.1s;
}
.card:hover { border-color: var(--accent); }
.card .card-title { font-size: 16px; color: var(--text-bright); font-weight: 600; margin-bottom: 4px; }
.card .card-meta { font-size: 12px; color: var(--text-dim); margin-bottom: 8px; }
.card .card-stats { font-size: 13px; color: var(--text); }
.card .card-effect { font-size: 13px; color: var(--green); margin-top: 4px; }

/* === FILTER BAR === */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-btn {
  padding: 4px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.1s;
}
.filter-btn:hover { border-color: var(--accent); }
.filter-btn.active { background: var(--accent); color: var(--bg); border-color: var(--accent); }

/* === HOME CATEGORIES === */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  transition: all 0.15s;
}
.category-card:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
  text-decoration: none;
  transform: translateY(-2px);
}
.category-card .icon { font-size: 32px; margin-bottom: 8px; }
.category-card .title { font-size: 15px; font-weight: 600; color: var(--gold); }

/* === FAQ === */
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
}
.faq-item .faq-q {
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 500;
  color: var(--text-bright);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-item .faq-q::after { content: '▼'; font-size: 12px; color: var(--text-dim); transition: transform 0.2s; }
.faq-item.open .faq-q::after { transform: rotate(180deg); }
.faq-item .faq-a {
  padding: 0 16px 12px;
  color: var(--text);
  display: none;
}
.faq-item.open .faq-a { display: block; }

/* === FOOTER === */
.guide-footer {
  text-align: center;
  padding: 20px;
  color: var(--text-dim);
  font-size: 13px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

/* === RARITY COLORS === */
.rarity-common { color: #999; }
.rarity-uncommon { color: #5a5; }
.rarity-rare { color: #55a; }
.rarity-epic { color: #a55; }
.rarity-legendary { color: var(--gold); }
.rarity-mystical { color: #a5a; }

/* === MOBILE === */
@media (max-width: 768px) {
  .guide-header { padding: 8px 12px; gap: 8px; }
  .guide-header .logo { font-size: 16px; }
  .guide-header .logo span { display: none; }
  .guide-header .menu-toggle { display: block; }
  .guide-header .search-box { max-width: none; }

  .guide-nav {
    position: fixed;
    left: -280px;
    top: 52px;
    height: calc(100vh - 52px);
    width: var(--nav-width);
    background: var(--bg);
    z-index: 99;
    transition: left 0.2s;
    padding-top: 12px;
  }
  .guide-nav.open { left: 0; box-shadow: var(--shadow); }

  .guide-content { padding: 16px 12px; }
  article h1 { font-size: 22px; }
  article h2 { font-size: 18px; }
  article h3 { font-size: 16px; }

  .card-grid { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .category-card { padding: 14px; }
  .category-card .icon { font-size: 24px; }
  .category-card .title { font-size: 13px; }

  .stat-table { font-size: 12px; }
  .stat-table th, .stat-table td { padding: 4px 6px; }
}


/* === TASK335 — STATUS BADGES (единая легенда статусов) === */
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  margin-left: 6px;
  vertical-align: middle;
  white-space: nowrap;
}
.status-live { background: rgba(46, 160, 67, 0.18); color: #3fb950; }
.status-canary { background: rgba(170, 102, 170, 0.22); color: #c084fc; }
.status-staged { background: rgba(210, 153, 34, 0.18); color: #d29922; }
.status-wip { background: rgba(56, 139, 253, 0.18); color: #58a6ff; }
.status-planned { background: rgba(139, 148, 158, 0.18); color: #8b949e; }
.status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
  font-size: 13px;
  color: var(--text-dim);
  align-items: center;
}
