/* ============================================================
   NINDO WAY - SHINOBI ARCHIVES  |  Wiki/Encyclopedia Style
   Light parchment theme with dark accents, sidebar layouts
   ============================================================ */

:root {
  --parchment: #faf6ee;
  --parchment-dark: #f0e8d8;
  --parchment-darker: #e6dcc8;
  --ink: #1a1a2e;
  --ink-light: #2d2d44;
  --ink-muted: #6b6b80;
  --ink-faint: #9e9eb0;
  --accent: #b44d12;
  --accent-light: #e8782a;
  --accent-bg: rgba(180, 77, 18, 0.08);
  --red: #c0392b;
  --red-bg: rgba(192, 57, 43, 0.08);
  --blue: #2563eb;
  --blue-bg: rgba(37, 99, 235, 0.06);
  --green: #1a7a4c;
  --green-bg: rgba(26, 122, 76, 0.06);
  --purple: #7c3aed;
  --purple-bg: rgba(124, 58, 237, 0.06);
  --gold: #b8860b;
  --gold-bg: rgba(184, 134, 11, 0.06);
  --border: #d4cbb8;
  --border-light: #e8e0d0;
  --shadow: rgba(26, 26, 46, 0.08);
  --shadow-md: rgba(26, 26, 46, 0.12);
  --discord: #5865F2;
  --radius: 8px;
  --radius-lg: 12px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--parchment);
  color: var(--ink);
  line-height: 1.65;
}

/* ===== TOP BANNER ===== */
.top-banner {
  background: var(--ink);
  padding: 6px 0;
  position: relative;
  overflow: hidden;
}
.banner-pattern {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, transparent, transparent 40px, rgba(180,77,18,0.1) 40px, rgba(180,77,18,0.1) 41px);
}
.banner-content {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  position: relative; z-index: 1;
}
.banner-text {
  font-family: 'Cinzel', serif; font-size: 0.65rem; font-weight: 700;
  color: var(--accent-light); letter-spacing: 6px; text-transform: uppercase;
}
.banner-eye { width: 18px; height: 18px; object-fit: contain; animation: spinSlow 20s linear infinite; }
@keyframes spinSlow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ===== NAVBAR ===== */
.navbar {
  position: sticky; top: 0; z-index: 1000;
  background: white;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 12px var(--shadow);
}
.nav-inner {
  max-width: 1400px; margin: 0 auto;
  display: flex; align-items: center;
  padding: 0 24px; height: 56px; gap: 16px;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; flex-shrink: 0;
}
.logo-emblem {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
}
.logo-icon { width: 32px; height: 32px; object-fit: contain; animation: spinSlow 12s linear infinite; }
.logo-title { font-family: 'Cinzel', serif; font-size: 1rem; font-weight: 900; color: var(--ink); letter-spacing: 2px; display: block; line-height: 1.1; }
.logo-sub { font-size: 0.6rem; color: var(--ink-muted); letter-spacing: 1px; text-transform: uppercase; display: block; }

.nav-tabs {
  display: flex; align-items: center; gap: 2px;
  margin-left: 16px; flex: 1; overflow-x: auto;
}
.nav-tab {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border: none; background: none;
  font-family: 'Inter', sans-serif; font-size: 0.78rem; font-weight: 600;
  color: var(--ink-muted); cursor: pointer; border-radius: 6px;
  transition: all 0.2s; white-space: nowrap; position: relative;
}
.nav-tab:hover { color: var(--accent); background: var(--accent-bg); }
.nav-tab.active { color: var(--accent); background: var(--accent-bg); }
.nav-tab.active::after {
  content: ''; position: absolute; bottom: -13px; left: 50%; transform: translateX(-50%);
  width: 24px; height: 3px; background: var(--accent); border-radius: 3px;
}

.nav-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.search-box {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; background: var(--parchment);
  border: 1px solid var(--border-light); border-radius: 20px;
  position: relative; transition: all 0.3s;
}
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(180, 77, 18, 0.1); }
.search-box svg { color: var(--ink-muted); flex-shrink: 0; }
.search-box input {
  border: none; background: none; outline: none; width: 180px;
  font-family: 'Inter', sans-serif; font-size: 0.8rem; color: var(--ink);
}
.search-box input::placeholder { color: var(--ink-faint); }
.search-results {
  position: absolute; top: 100%; left: 0; right: 0; margin-top: 4px;
  background: white; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 30px var(--shadow-md); display: none; z-index: 100; max-height: 300px; overflow-y: auto;
}
.search-results.visible { display: block; }
.search-result-item {
  padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--border-light);
  transition: background 0.15s; font-size: 0.85rem;
}
.search-result-item:hover { background: var(--accent-bg); }
.search-result-item:last-child { border-bottom: none; }
.search-result-type { font-size: 0.65rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 1px; }

.nav-admin-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border: 1px solid var(--border);
  background: white; border-radius: 6px; font-family: 'Inter', sans-serif;
  font-size: 0.78rem; font-weight: 600; color: var(--ink-muted);
  cursor: pointer; transition: all 0.2s;
}
.nav-admin-btn:hover { border-color: var(--accent); color: var(--accent); }
.nav-admin-btn.logged-in { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); }

.discord-join {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; background: var(--discord); border-radius: 6px;
  color: white; text-decoration: none; font-size: 0.78rem; font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s;
}
.discord-join:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(88, 101, 242, 0.3); }

.mobile-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--ink); }

/* ===== MAIN CONTENT ===== */
.main-content {
  max-width: 1400px; margin: 0 auto; padding: 0 24px;
  min-height: calc(100vh - 200px);
}

.page { display: none; padding-bottom: 60px; }
.page.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ===== PAGE HEADERS ===== */
.page-header {
  position: relative; padding: 50px 40px; margin: 0 -24px 30px;
  background: linear-gradient(135deg, var(--ink), var(--ink-light));
  color: white; overflow: hidden;
}
.page-header-bg { position: absolute; right: -20px; top: -10px; bottom: -10px; width: 300px; opacity: 0.12; }
.page-header-char { height: 120%; object-fit: contain; }
.page-header h1 { font-family: 'Cinzel', serif; font-size: 2.4rem; font-weight: 900; margin-bottom: 6px; position: relative; z-index: 1; }
.page-header p { color: rgba(255,255,255,0.7); font-size: 1rem; position: relative; z-index: 1; }

.page-header-purple { background: linear-gradient(135deg, #2d1854, #4a1c6e); }
.page-header-green { background: linear-gradient(135deg, #0a3d26, #1a7a4c); }
.page-header-orange { background: linear-gradient(135deg, #5c2500, #b44d12); }
.page-header-gold { background: linear-gradient(135deg, #3d2d00, #7a5b10); }
.page-header-blue { background: linear-gradient(135deg, #1a2a5e, #2563eb); }

/* ===== HERO (HOME) ===== */
.wiki-hero {
  margin: 0 -24px; padding: 0;
  background: linear-gradient(135deg, var(--ink) 0%, #2a1f0e 50%, #1a0f05 100%);
  position: relative; overflow: hidden;
}
.hero-scroll { display: flex; align-items: center; max-width: 1400px; margin: 0 auto; padding: 60px 40px; gap: 40px; position: relative; }
.hero-char-art { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.hero-char-img {
  position: absolute; bottom: 0; height: 95%; object-fit: contain; opacity: 0.15;
  transition: opacity 0.5s;
}
.hero-char-img:hover { opacity: 0.3; }
.hero-char-l { left: -3%; }
.hero-char-r { right: -3%; }
.hero-text { position: relative; z-index: 2; max-width: 650px; margin: 0 auto; text-align: center; }
.hero-heading { font-family: 'Cinzel', serif; font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 900; color: white; line-height: 1.1; margin-bottom: 16px; }
.hero-accent { color: var(--accent-light); display: block; }
.hero-desc { color: rgba(255,255,255,0.65); font-size: 1rem; margin-bottom: 28px; line-height: 1.7; }
.hero-stats { display: flex; justify-content: center; gap: 24px; margin-bottom: 28px; flex-wrap: wrap; }
.stat-box {
  display: flex; flex-direction: column; align-items: center;
  padding: 14px 20px; background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius);
  min-width: 100px;
}
.stat-num { font-family: 'Cinzel', serif; font-size: 1.8rem; font-weight: 900; color: var(--accent-light); }
.stat-label { font-size: 0.7rem; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 1px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ===== HOME GRID ===== */
.home-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px; padding: 40px 0;
}
.home-card {
  background: white; border: 1px solid var(--border-light); border-radius: var(--radius-lg);
  padding: 0; overflow: hidden; cursor: pointer; transition: all 0.3s;
  box-shadow: 0 2px 8px var(--shadow);
}
.home-card:hover { transform: translateY(-6px); box-shadow: 0 12px 30px var(--shadow-md); }
.home-card-icon {
  height: 120px; position: relative; overflow: hidden;
  display: flex; align-items: flex-end; justify-content: flex-end; padding: 0;
}
.card-char { height: 110%; object-fit: contain; opacity: 0.4; position: absolute; right: -10px; bottom: -5px; transition: all 0.4s; }
.home-card:hover .card-char { opacity: 0.6; transform: scale(1.08); }
.home-card h3 { font-family: 'Cinzel', serif; font-size: 1.1rem; padding: 16px 20px 6px; color: var(--ink); }
.home-card p { font-size: 0.85rem; color: var(--ink-muted); padding: 0 20px 18px; line-height: 1.5; }

.home-section { padding: 30px 0; }
.section-header-bar {
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 2px solid var(--border); padding-bottom: 12px; margin-bottom: 20px;
}
.section-header-bar h2 { font-family: 'Cinzel', serif; font-size: 1.4rem; color: var(--ink); }

/* ===== CHARACTER SHOWCASE ===== */
.character-showcase {
  padding: 40px 0; border-top: 1px solid var(--border-light);
}
.character-showcase h2 { font-family: 'Cinzel', serif; font-size: 1.4rem; color: var(--ink); margin-bottom: 20px; text-align: center; }
.showcase-track { display: flex; gap: 16px; overflow-x: auto; padding: 10px 0 20px; }
.showcase-card {
  flex-shrink: 0; width: 130px; background: white;
  border: 1px solid var(--border-light); border-radius: var(--radius);
  text-align: center; padding: 16px 10px 12px;
  transition: all 0.3s; cursor: pointer;
  box-shadow: 0 2px 8px var(--shadow);
}
.showcase-card:hover { transform: translateY(-8px) scale(1.05); box-shadow: 0 12px 30px var(--shadow-md); border-color: var(--accent); }
.showcase-card img { width: 80px; height: 90px; object-fit: contain; margin-bottom: 8px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2)); }
.showcase-card span { font-size: 0.72rem; color: var(--ink-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }

/* ===== SIDEBAR LAYOUT ===== */
.content-with-sidebar { display: grid; grid-template-columns: 240px 1fr; gap: 24px; }
.sidebar {
  position: sticky; top: 80px; align-self: start;
  background: white; border: 1px solid var(--border-light);
  border-radius: var(--radius-lg); padding: 0; overflow: hidden;
  box-shadow: 0 2px 8px var(--shadow);
}
.sidebar-section { padding: 16px; border-bottom: 1px solid var(--border-light); }
.sidebar-section:last-child { border-bottom: none; }
.sidebar-section h4 { font-size: 0.7rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 8px; }
.sidebar-filters { display: flex; flex-direction: column; gap: 2px; }
.sidebar-filter-btn {
  padding: 7px 10px; text-align: left; border: none; background: none;
  font-family: 'Inter', sans-serif; font-size: 0.82rem; font-weight: 500;
  color: var(--ink-muted); cursor: pointer; border-radius: 4px;
  transition: all 0.15s;
}
.sidebar-filter-btn:hover { color: var(--ink); background: var(--parchment); }
.sidebar-filter-btn.active { color: var(--accent); background: var(--accent-bg); font-weight: 600; }
.sidebar-stat {
  display: flex; justify-content: space-between; padding: 6px 0;
  font-size: 0.85rem; color: var(--ink-muted);
}
.sidebar-stat span:last-child { font-weight: 700; color: var(--accent); }

.content-main { min-width: 0; }
.content-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: white; border: 1px solid var(--border-light);
  border-radius: var(--radius); margin-bottom: 16px;
  box-shadow: 0 1px 4px var(--shadow);
}
.toolbar-info { font-size: 0.85rem; color: var(--ink-muted); }
.toolbar-actions { display: flex; gap: 8px; }

/* ===== WIKI TABLE (JUTSU) ===== */
.wiki-table-container { overflow-x: auto; }
.wiki-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: white; border: 1px solid var(--border-light);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 2px 8px var(--shadow);
}
.wiki-table thead th {
  padding: 12px 16px; text-align: left;
  font-size: 0.7rem; font-weight: 700; color: var(--ink-faint);
  text-transform: uppercase; letter-spacing: 1px;
  background: var(--parchment-dark); border-bottom: 2px solid var(--border);
}
.wiki-table tbody tr {
  transition: background 0.15s; cursor: pointer;
}
.wiki-table tbody tr:hover { background: var(--accent-bg); }
.wiki-table tbody td {
  padding: 12px 16px; border-bottom: 1px solid var(--border-light);
  font-size: 0.88rem; vertical-align: middle;
}
.wiki-table tbody tr:last-child td { border-bottom: none; }

.rank-pill {
  display: inline-block; padding: 2px 10px; border-radius: 12px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.5px;
}
.rank-pill-S { background: #7c3aed; color: white; }
.rank-pill-A { background: #dc2626; color: white; }
.rank-pill-B { background: #2563eb; color: white; }
.rank-pill-C { background: #059669; color: white; }
.rank-pill-D { background: #d97706; color: white; }
.rank-pill-E { background: #6b7280; color: white; }

.element-dot {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.82rem;
}

/* ===== KEKKEI GENKAI GRID ===== */
.kekkei-categories {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 0 0 20px;
}
.kekkei-cat-btn {
  padding: 8px 18px; border: 2px solid var(--border);
  background: white; border-radius: 20px;
  font-family: 'Inter', sans-serif; font-size: 0.82rem; font-weight: 600;
  color: var(--ink-muted); cursor: pointer; transition: all 0.2s;
}
.kekkei-cat-btn:hover { border-color: var(--purple); color: var(--purple); }
.kekkei-cat-btn.active { background: var(--purple); border-color: var(--purple); color: white; }

.kekkei-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.kekkei-card {
  background: white; border: 1px solid var(--border-light); border-radius: var(--radius-lg);
  padding: 0; overflow: hidden; cursor: pointer; transition: all 0.3s;
  box-shadow: 0 2px 8px var(--shadow);
}
.kekkei-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px var(--shadow-md); }
.kekkei-card-top {
  padding: 18px 20px 14px; position: relative;
  border-bottom: 1px solid var(--border-light);
}
.kekkei-card-top::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
}
.kekkei-card.cat-Dojutsu .kekkei-card-top::before { background: linear-gradient(90deg, #dc2626, #7c3aed); }
.kekkei-card.cat-Elemental .kekkei-card-top::before { background: linear-gradient(90deg, #059669, #2563eb); }
.kekkei-card.cat-Body .kekkei-card-top::before { background: linear-gradient(90deg, #d97706, #dc2626); }
.kekkei-card.cat-Kekkei.cat-Tota .kekkei-card-top::before, .kekkei-card[class*="Kekkei Tota"] .kekkei-card-top::before { background: linear-gradient(90deg, #7c3aed, #ec4899); }
.kekkei-card.cat-Other .kekkei-card-top::before { background: linear-gradient(90deg, #6b7280, #374151); }

.kekkei-name { font-family: 'Cinzel', serif; font-size: 1.15rem; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.kekkei-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.kekkei-meta-tag {
  padding: 2px 8px; border-radius: 4px; font-size: 0.68rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.kekkei-meta-tag.cat { background: var(--purple-bg); color: var(--purple); }
.kekkei-meta-tag.rarity-Common { background: rgba(107,114,128,0.1); color: #6b7280; }
.kekkei-meta-tag.rarity-Uncommon { background: rgba(5,150,105,0.1); color: #059669; }
.kekkei-meta-tag.rarity-Rare { background: rgba(37,99,235,0.1); color: #2563eb; }
.kekkei-meta-tag.rarity-Legendary { background: rgba(124,58,237,0.1); color: #7c3aed; }
.kekkei-meta-tag.rarity-Mythic { background: rgba(236,72,153,0.1); color: #ec4899; }

.kekkei-card-body { padding: 14px 20px 18px; }
.kekkei-elements { font-size: 0.82rem; color: var(--ink-muted); margin-bottom: 6px; }
.kekkei-clan { font-size: 0.82rem; color: var(--ink-muted); margin-bottom: 8px; }
.kekkei-desc { font-size: 0.88rem; color: var(--ink-light); line-height: 1.6; }

/* ===== MISSIONS BOARD ===== */
.missions-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 10px;
}
.mission-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.mission-filter-btn {
  padding: 6px 16px; border: 1px solid var(--border); background: white;
  border-radius: 20px; font-size: 0.82rem; font-weight: 600;
  color: var(--ink-muted); cursor: pointer; transition: all 0.2s;
}
.mission-filter-btn:hover { border-color: var(--green); color: var(--green); }
.mission-filter-btn.active { background: var(--green); border-color: var(--green); color: white; }

.missions-board {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}
.mission-card-v2 {
  background: white; border: 1px solid var(--border-light); border-radius: var(--radius);
  padding: 20px; transition: all 0.3s; position: relative;
  box-shadow: 0 2px 8px var(--shadow);
}
.mission-card-v2::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.mission-card-v2.rank-D::before { background: #d97706; }
.mission-card-v2.rank-C::before { background: #059669; }
.mission-card-v2.rank-B::before { background: #2563eb; }
.mission-card-v2.rank-A::before { background: #dc2626; }
.mission-card-v2.rank-S::before { background: #7c3aed; }
.mission-card-v2:hover { transform: translateY(-3px); box-shadow: 0 8px 24px var(--shadow-md); }

.mission-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; gap: 8px; }
.mission-card-title { font-family: 'Cinzel', serif; font-size: 1rem; font-weight: 700; color: var(--ink); }
.mission-card-badges { display: flex; gap: 6px; }
.mission-card-detail { display: flex; gap: 16px; font-size: 0.8rem; color: var(--ink-muted); margin-bottom: 8px; }
.mission-card-detail strong { color: var(--ink); }
.mission-card-desc { font-size: 0.85rem; color: var(--ink-muted); line-height: 1.5; }

.status-badge {
  padding: 2px 10px; border-radius: 12px; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
}
.status-badge-Open { background: rgba(5,150,105,0.1); color: #059669; }
.status-badge-In-Progress { background: rgba(249,115,22,0.1); color: #f97316; }
.status-badge-Completed { background: rgba(107,114,128,0.1); color: #6b7280; }

/* ===== SHINOBI DIRECTORY ===== */
.shinobi-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; gap: 12px; flex-wrap: wrap;
}
.shinobi-search {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; background: white; border: 1px solid var(--border);
  border-radius: 20px; flex: 1; max-width: 400px;
}
.shinobi-search input {
  border: none; outline: none; background: none; width: 100%;
  font-family: 'Inter', sans-serif; font-size: 0.88rem; color: var(--ink);
}
.shinobi-search svg { color: var(--ink-faint); flex-shrink: 0; }

.quicklinks { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.quicklink {
  padding: 4px 12px; background: white; border: 1px solid var(--border-light);
  border-radius: 4px; color: var(--ink-muted); text-decoration: none;
  font-size: 0.82rem; font-weight: 600; transition: all 0.2s;
}
.quicklink:hover { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); }

.shinobi-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.oc-card {
  background: white; border: 1px solid var(--border-light); border-radius: var(--radius-lg);
  overflow: hidden; transition: all 0.3s; cursor: pointer;
  box-shadow: 0 2px 8px var(--shadow);
}
.oc-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px var(--shadow-md); }
.oc-card-header {
  padding: 16px 20px; display: flex; justify-content: space-between; align-items: flex-start;
  border-bottom: 1px solid var(--border-light);
  background: var(--parchment);
}
.oc-name { font-family: 'Cinzel', serif; font-size: 1.1rem; font-weight: 700; color: var(--ink); }
.oc-player { font-size: 0.75rem; color: var(--ink-faint); margin-top: 2px; }
.oc-expand-hint { font-size: 0.6rem; color: var(--ink-faint); margin-top: 3px; text-transform: uppercase; letter-spacing: 1px; }

.oc-rank-badge {
  padding: 3px 10px; border-radius: 4px; font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.rank-genin { background: var(--blue); color: white; }
.rank-chunin { background: var(--green); color: white; }
.rank-jonin { background: var(--accent); color: white; }
.rank-anbu { background: var(--purple); color: white; }
.rank-kage { background: linear-gradient(135deg, #b8860b, #d4a853); color: var(--ink); }
.rank-missing-nin { background: var(--red); color: white; }
.rank-default { background: var(--accent); color: white; }

.oc-portrait-section { overflow: hidden; max-height: 0; transition: max-height 0.5s, padding 0.3s; display: flex; justify-content: center; padding: 0 20px; }
.oc-card.show-portrait .oc-portrait-section { max-height: 500px; padding: 20px; }
.oc-portrait-wrapper {
  width: 160px; height: 160px; border-radius: 50%; overflow: hidden;
  border: 3px solid var(--accent); box-shadow: 0 0 20px rgba(180, 77, 18, 0.2);
}
.oc-portrait-img { width: 100%; height: 100%; object-fit: cover; }
.oc-no-portrait {
  width: 100%; height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; background: var(--parchment);
  color: var(--ink-faint); font-size: 0.7rem; gap: 4px;
}
.oc-no-portrait-icon { font-size: 2rem; opacity: 0.4; }
.oc-card-upload-controls { display: flex; gap: 8px; margin-top: 12px; justify-content: center; }
.oc-upload-btn {
  padding: 5px 12px; background: var(--accent); border: none; border-radius: 4px;
  color: white; font-size: 0.78rem; font-weight: 600; cursor: pointer;
}
.oc-upload-btn:hover { background: var(--accent-light); }

.oc-card-body { padding: 16px 20px; }
.oc-detail-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--border-light); font-size: 0.88rem; }
.oc-detail-row:last-child { border-bottom: none; }
.oc-detail-label { color: var(--ink-faint); font-weight: 600; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.5px; }
.oc-detail-value { color: var(--ink); font-weight: 600; text-align: right; }
.oc-specs { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-light); }
.oc-specs-title { font-size: 0.68rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.oc-spec-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.oc-spec-tag {
  padding: 2px 8px; background: var(--accent-bg); border: 1px solid rgba(180,77,18,0.15);
  border-radius: 4px; font-size: 0.75rem; color: var(--accent); font-weight: 600;
}
.oc-backstory { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-light); }
.oc-backstory-title { font-size: 0.68rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.oc-backstory-text { font-size: 0.85rem; color: var(--ink-muted); line-height: 1.6; white-space: pre-wrap; }

/* ===== LORE TIMELINE ===== */
.lore-timeline { position: relative; padding-left: 30px; }
.lore-timeline::before {
  content: ''; position: absolute; left: 8px; top: 0; bottom: 0;
  width: 2px; background: var(--border);
}
.lore-entry {
  position: relative; margin-bottom: 20px; padding: 20px 24px;
  background: white; border: 1px solid var(--border-light);
  border-radius: var(--radius); cursor: pointer; transition: all 0.3s;
  box-shadow: 0 2px 8px var(--shadow);
}
.lore-entry::before {
  content: ''; position: absolute; left: -26px; top: 24px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--gold); border: 2px solid white;
  box-shadow: 0 0 0 2px var(--gold);
}
.lore-entry:hover { box-shadow: 0 6px 20px var(--shadow-md); transform: translateX(4px); }
.lore-entry-header { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.lore-date-badge {
  padding: 2px 10px; background: var(--gold-bg); border: 1px solid rgba(184,134,11,0.2);
  border-radius: 4px; font-size: 0.7rem; font-weight: 700; color: var(--gold);
  text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap;
}
.lore-entry-title { font-family: 'Cinzel', serif; font-size: 1.1rem; font-weight: 700; color: var(--ink); }
.lore-entry-toggle { font-size: 0.7rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 1px; }
.lore-entry-content {
  display: none; margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--border-light);
  color: var(--ink-muted); font-size: 0.92rem; line-height: 1.7; white-space: pre-wrap;
}
.lore-entry.expanded .lore-entry-content { display: block; }

/* ===== CAPS LIST ===== */
.caps-list { display: flex; flex-direction: column; gap: 12px; }
.cap-card {
  background: white; border: 1px solid var(--border-light); border-radius: var(--radius);
  padding: 20px 24px; transition: all 0.3s;
  box-shadow: 0 2px 8px var(--shadow);
  display: grid; grid-template-columns: 200px auto; gap: 20px; align-items: start;
}
.cap-card:hover { box-shadow: 0 6px 20px var(--shadow-md); }
.cap-category { font-family: 'Cinzel', serif; font-size: 1rem; font-weight: 700; color: var(--ink); }
.cap-limit { font-size: 0.82rem; color: var(--accent); font-weight: 700; margin-top: 2px; }
.cap-description { color: var(--ink-muted); font-size: 0.88rem; line-height: 1.6; }

/* ===== ANNOUNCEMENT CARDS ===== */
.announcement-card {
  background: white; border: 1px solid var(--border-light); border-left: 4px solid var(--accent);
  border-radius: var(--radius); padding: 18px 22px; margin-bottom: 12px;
  transition: all 0.3s; box-shadow: 0 2px 8px var(--shadow);
}
.announcement-card:hover { box-shadow: 0 6px 20px var(--shadow-md); transform: translateX(4px); }
.announcement-date { font-size: 0.7rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.announcement-title { font-family: 'Cinzel', serif; font-size: 1.1rem; font-weight: 700; color: var(--accent); margin-bottom: 6px; }
.announcement-content { color: var(--ink-muted); font-size: 0.9rem; line-height: 1.6; white-space: pre-wrap; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 22px; border-radius: 6px; font-family: 'Inter', sans-serif;
  font-size: 0.85rem; font-weight: 600; text-decoration: none;
  cursor: pointer; transition: all 0.2s; border: none;
}
.btn-sm { padding: 5px 12px; font-size: 0.78rem; }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-light); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(180, 77, 18, 0.3); }
.btn-outline { background: transparent; color: white; border: 2px solid rgba(255,255,255,0.4); }
.btn-outline:hover { background: rgba(255,255,255,0.1); border-color: white; }
.btn-ghost { background: transparent; color: var(--ink-muted); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn-danger { background: var(--red); color: white; }

.edit-toggle-btn {
  padding: 6px 14px; background: var(--accent-bg); border: 1px solid rgba(180,77,18,0.2);
  border-radius: 6px; color: var(--accent); font-family: 'Inter', sans-serif;
  font-size: 0.78rem; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.edit-toggle-btn:hover { background: var(--accent); color: white; }
.edit-toggle-btn.active { background: var(--accent); border-color: var(--accent); color: white; }

/* ===== EDITOR PANEL ===== */
.editor-panel {
  background: white; border: 2px solid var(--accent); border-radius: var(--radius-lg);
  padding: 24px; margin-top: 20px;
  box-shadow: 0 4px 16px rgba(180, 77, 18, 0.1);
}
.editor-panel h3 { font-family: 'Cinzel', serif; color: var(--accent); margin-bottom: 16px; font-size: 1.1rem; }
.editor-panel input, .editor-panel textarea, .editor-panel select {
  width: 100%; padding: 10px 14px; background: var(--parchment);
  border: 1px solid var(--border); border-radius: 6px; color: var(--ink);
  font-family: 'Inter', sans-serif; font-size: 0.88rem; margin-bottom: 10px;
}
.editor-panel select { cursor: pointer; }
.editor-panel input:focus, .editor-panel textarea:focus, .editor-panel select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(180, 77, 18, 0.08);
}
.editor-panel textarea { resize: vertical; min-height: 60px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-actions { display: flex; gap: 10px; margin: 4px 0 16px; }
.edit-list { display: flex; flex-direction: column; gap: 6px; }
.edit-list-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; background: var(--parchment); border: 1px solid var(--border-light);
  border-radius: 4px; gap: 10px;
}
.edit-list-item span { font-size: 0.85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.edit-list-item .edit-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(26, 26, 46, 0.5);
  backdrop-filter: blur(4px); z-index: 2000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: white; border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 28px; max-width: 420px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.modal h3 { font-family: 'Cinzel', serif; color: var(--accent); font-size: 1.3rem; margin-bottom: 8px; }
.modal p { color: var(--ink-muted); font-size: 0.9rem; margin-bottom: 16px; }
.modal input {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: 6px; font-family: 'Inter', sans-serif; font-size: 0.9rem;
  color: var(--ink); margin-bottom: 10px;
}
.modal input:focus { outline: none; border-color: var(--accent); }
.modal-actions { display: flex; gap: 8px; }
.modal-error { color: var(--red) !important; font-size: 0.82rem !important; margin-top: 10px !important; }

/* Detail modal for viewing entries */
.detail-modal-overlay {
  position: fixed; inset: 0; background: rgba(26, 26, 46, 0.5);
  backdrop-filter: blur(4px); z-index: 2000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.detail-modal {
  background: white; border-radius: var(--radius-lg); padding: 32px;
  max-width: 600px; width: 100%; max-height: 80vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2); position: relative;
}
.detail-modal-close {
  position: absolute; top: 12px; right: 16px;
  background: none; border: none; font-size: 1.5rem; color: var(--ink-faint);
  cursor: pointer; transition: color 0.2s;
}
.detail-modal-close:hover { color: var(--ink); }
.detail-modal h2 { font-family: 'Cinzel', serif; font-size: 1.6rem; color: var(--ink); margin-bottom: 12px; }
.detail-modal .detail-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.detail-modal .detail-body { color: var(--ink-muted); font-size: 0.95rem; line-height: 1.7; }

/* ===== DISCORD PANEL ===== */
.discord-panel {
  position: fixed; top: 0; right: -380px; width: 360px; height: 100vh;
  background: white; border-left: 1px solid var(--border); z-index: 1500;
  transition: right 0.35s; display: flex; flex-direction: column;
  box-shadow: -4px 0 20px var(--shadow-md);
}
.discord-panel.open { right: 0; }
.discord-panel-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  font-family: 'Cinzel', serif; color: var(--discord); font-size: 1rem;
}
.discord-panel-close { background: none; border: none; color: var(--ink-faint); font-size: 1.5rem; cursor: pointer; }
.discord-panel-body { padding: 16px 20px; overflow-y: auto; flex: 1; }
.discord-panel-hint { color: var(--ink-faint); font-size: 0.82rem; margin-bottom: 14px; }
.discord-channel-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: var(--parchment); border: 1px solid var(--border-light);
  border-radius: 6px; margin-bottom: 6px;
}
.discord-channel-link { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.88rem; flex: 1; }
.discord-channel-link::before { content: '#'; color: var(--ink-faint); margin-right: 4px; }
.discord-channel-link:hover { color: var(--discord); }
.discord-channel-del { background: none; border: none; color: var(--ink-faint); cursor: pointer; font-size: 1.1rem; }
.discord-channel-del:hover { color: var(--red); }
.discord-channel-add { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-light); }
.discord-channel-add input {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 0.85rem; margin-bottom: 6px;
  font-family: 'Inter', sans-serif; color: var(--ink);
}
.discord-channel-add input:focus { outline: none; border-color: var(--discord); }

/* ===== IMAGE UPLOAD ===== */
.image-upload-area { margin-bottom: 10px; }
.image-upload-label { display: block; cursor: pointer; }
.image-upload-placeholder {
  width: 100%; height: 140px; border: 2px dashed var(--border);
  border-radius: var(--radius); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
  color: var(--ink-faint); font-size: 0.85rem; transition: all 0.2s;
  overflow: hidden;
}
.image-upload-placeholder:hover { border-color: var(--accent); color: var(--accent); }
.image-upload-placeholder.has-image { border-color: var(--accent); padding: 0; height: 180px; }
.image-upload-placeholder.has-image img { width: 100%; height: 100%; object-fit: contain; }
.upload-icon { font-size: 1.6rem; }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 40px 20px; color: var(--ink-faint); }
.empty-state-icon { font-size: 2rem; margin-bottom: 8px; opacity: 0.4; }

/* ===== FOOTER ===== */
.footer {
  background: var(--ink); padding: 40px 0 30px; margin-top: 60px;
}
.footer-inner {
  max-width: 1400px; margin: 0 auto; padding: 0 24px;
  text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.footer-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Cinzel', serif; color: var(--accent-light); font-size: 1rem;
}
.footer-logo { width: 30px; height: 24px; object-fit: contain; opacity: 0.5; filter: grayscale(1); }
.footer-links { display: flex; gap: 16px; }
.footer-links a, .footer-links button {
  background: none; border: none; color: rgba(255,255,255,0.5);
  text-decoration: none; font-size: 0.85rem; cursor: pointer; transition: color 0.2s;
}
.footer-links a:hover, .footer-links button:hover { color: var(--accent-light); }
.footer-copy { font-size: 0.75rem; color: rgba(255,255,255,0.3); }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .content-with-sidebar { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .nav-tabs { display: none; }
  .nav-tabs.show { display: flex; flex-direction: column; position: absolute; top: 56px; left: 0; right: 0; background: white; border-bottom: 1px solid var(--border); padding: 8px; z-index: 100; box-shadow: 0 8px 20px var(--shadow-md); }
  .mobile-toggle { display: block; }
  .search-box input { width: 120px; }
  .hero-scroll { flex-direction: column; padding: 40px 20px; }
  .hero-char-img { height: 60%; opacity: 0.1; }
  .form-row { grid-template-columns: 1fr; }
  .cap-card { grid-template-columns: 1fr; gap: 8px; }
  .kekkei-grid { grid-template-columns: 1fr; }
  .missions-board { grid-template-columns: 1fr; }
  .shinobi-grid { grid-template-columns: 1fr; }
  .discord-panel { width: 100%; right: -100%; }
  .page-header { padding: 30px 20px; margin: 0 -24px 20px; }
  .page-header h1 { font-size: 1.6rem; }
}

@media (max-width: 600px) {
  .nav-actions { gap: 4px; }
  .discord-join { display: none !important; }
  .search-box { display: none; }
  .home-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 12px; }
  .stat-box { min-width: 70px; padding: 10px 12px; }
  .spotlight-grid { grid-template-columns: 1fr; }
  .bingo-grid { grid-template-columns: 1fr; }
}

/* ===== OC SPOTLIGHT ===== */
.section-desc { color: var(--ink-muted, #6b7280); font-size: 0.9rem; margin-bottom: 16px; }

.spotlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.spotlight-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.spotlight-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.spotlight-image-wrap {
  width: 100%; height: 200px; overflow: hidden;
  background: var(--surface-alt, #f9fafb); display: flex; align-items: center; justify-content: center;
}
.spotlight-img { width: 100%; height: 100%; object-fit: cover; }
.spotlight-no-img { font-size: 2.5rem; color: var(--ink-faint, #d1d5db); }

.spotlight-info { padding: 16px; }
.spotlight-name { font-weight: 700; font-size: 1.15rem; color: var(--ink, #1a1a2e); margin-bottom: 2px; }
.spotlight-epithet { font-size: 0.85rem; color: var(--ink-muted, #6b7280); font-style: italic; margin-bottom: 8px; }
.spotlight-meta { display: flex; gap: 12px; font-size: 0.8rem; color: var(--ink-faint, #9ca3af); margin-bottom: 10px; flex-wrap: wrap; }
.spotlight-desc { font-size: 0.85rem; color: var(--ink-muted, #6b7280); line-height: 1.55; }

/* ===== BINGO BOOK ===== */
.page-header-crimson { background: linear-gradient(135deg, #991b1b 0%, #7f1d1d 100%); }

.bingo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px; padding: 20px 0;
}

.bingo-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px; overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.bingo-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.08); }
.bingo-card.threat-S { border-left: 4px solid #dc2626; }
.bingo-card.threat-A { border-left: 4px solid #f97316; }
.bingo-card.threat-B { border-left: 4px solid #eab308; }
.bingo-card.threat-C { border-left: 4px solid #22c55e; }
.bingo-card.threat-D { border-left: 4px solid #3b82f6; }

.bingo-threat-banner {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 14px; background: rgba(220, 38, 38, 0.04);
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.bingo-threat-level { font-weight: 700; font-size: 0.82rem; color: #dc2626; letter-spacing: 0.5px; }
.threat-A .bingo-threat-level { color: #f97316; }
.threat-B .bingo-threat-level { color: #eab308; }
.threat-C .bingo-threat-level { color: #22c55e; }
.threat-D .bingo-threat-level { color: #3b82f6; }

.bingo-status-badge {
  font-size: 0.7rem; padding: 2px 8px; border-radius: 12px; font-weight: 600; text-transform: uppercase;
}
.bingo-status-active { background: rgba(220,38,38,0.1); color: #dc2626; }
.bingo-status-captured { background: rgba(34,197,94,0.1); color: #16a34a; }
.bingo-status-eliminated { background: rgba(107,114,128,0.1); color: #6b7280; }
.bingo-status-unknown { background: rgba(168,85,247,0.1); color: #9333ea; }

.bingo-card-body { display: flex; gap: 14px; padding: 14px; }
.bingo-mugshot {
  flex-shrink: 0; width: 80px; height: 80px; border-radius: 8px; overflow: hidden;
  background: var(--surface-alt, #f3f4f6); border: 1px solid var(--border, #e5e7eb);
}
.bingo-mugshot-img { width: 100%; height: 100%; object-fit: cover; }
.bingo-no-img { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: 1.8rem; color: var(--ink-faint, #d1d5db); font-weight: bold; }

.bingo-info { flex: 1; min-width: 0; }
.bingo-target-name { font-weight: 700; font-size: 1.05rem; color: var(--ink, #1a1a2e); margin-bottom: 2px; }
.bingo-alias { font-size: 0.8rem; color: var(--ink-muted, #6b7280); font-style: italic; margin-bottom: 6px; }
.bingo-detail { font-size: 0.8rem; color: var(--ink-muted, #6b7280); margin-bottom: 3px; }
.bingo-label { color: var(--ink-faint, #9ca3af); }
.bingo-bounty-text { color: #d97706; font-weight: 600; }
.bingo-description { font-size: 0.8rem; color: var(--ink-muted, #6b7280); line-height: 1.5; margin-top: 6px; }
