/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  --red:        #e05a00;
  --red-dk:     #b84400;
  --orange:     #ff6600;
  --bg:         #f4f4f0;
  --surface:    #ffffff;
  --gray-50:    #fafafa;
  --gray-100:   #f0f0f0;
  --border:     #dddddd;
  --text:       #1a1a1a;
  --text-sub:   #555555;
  --text-muted: #999999;
  --link:       #0066cc;
  --font: 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Yu Gothic', sans-serif;
  --r:    3px;
  --r-md: 6px;
  --shadow:    0 1px 4px rgba(0,0,0,.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,.12);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 14px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
ul, ol { list-style: none; }
img { display: block; max-width: 100%; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* ============================================================
   CONTAINER
   ============================================================ */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 8px;
}
@media (min-width: 640px) {
  .container { padding: 0 16px; }
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  background: var(--red);
  border-bottom: 3px solid var(--red-dk);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 8px;
}
.logo {
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1;
  text-decoration: none;
}
.logo:hover { text-decoration: none; }
.logo span {
  font-size: 11px;
  font-weight: 400;
  display: block;
  letter-spacing: 0;
  margin-top: 2px;
  color: rgba(255,255,255,0.85);
}
.header-right { display: flex; align-items: center; gap: 8px; }
.header-btn {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.35);
  padding: 5px 12px;
  border-radius: var(--r);
  font-size: 12px;
  cursor: pointer;
  font-family: var(--font);
}
.header-btn.primary {
  background: #fff;
  color: var(--red);
  font-weight: 700;
}
.search-bar { background: var(--red-dk); padding: 8px 16px 10px; }
.search-inner { display: flex; gap: 6px; max-width: 600px; }
.search-inner input {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: var(--r) 0 0 var(--r);
  font-size: 14px;
  outline: none;
  font-family: var(--font);
}
.search-inner button {
  background: var(--orange);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 0 var(--r) var(--r) 0;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font);
  transition: background 0.15s;
}
.search-inner button:hover { background: #e55a00; }

/* ============================================================
   NAVIGATION BAR
   ============================================================ */
.nav-bar {
  background: #222;
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-bar::-webkit-scrollbar { display: none; }
.nav-item {
  color: #ddd;
  padding: 8px 14px;
  font-size: 13px;
  white-space: nowrap;
  border-right: 1px solid #333;
  transition: background 0.15s;
  text-decoration: none;
  display: block;
}
.nav-item:hover { background: #333; color: #fff; text-decoration: none; }
.nav-item.active { color: var(--orange); font-weight: 700; }
.nav-item-btn { background: none; border: none; font-family: var(--font); cursor: pointer; }
.nav-item-caret { font-size: 9px; margin-left: 3px; opacity: 0.7; }
.nav-dropdown-wrap { position: relative; display: flex; }
.nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  background: #2a2a2a;
  border: 1px solid #444;
  box-shadow: 0 4px 12px rgba(0,0,0,.4);
  z-index: 200;
}
.nav-dropdown-wrap:hover .nav-dropdown,
.nav-dropdown-wrap:focus-within .nav-dropdown { display: block; }
.nav-dropdown a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ddd;
  padding: 10px 14px;
  font-size: 13px;
  border-bottom: 1px solid #3a3a3a;
  white-space: nowrap;
  text-decoration: none;
}
.nav-dropdown a:last-child { border-bottom: none; }
.nav-dropdown a:hover { background: #3a3a3a; color: #fff; text-decoration: none; }
.nav-dropdown-label {
  font-size: 10px;
  color: var(--orange);
  font-weight: 700;
  margin-left: auto;
  padding: 1px 5px;
  border: 1px solid var(--orange);
  border-radius: 2px;
}

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 6px 0;
}
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
}
.breadcrumb a { color: var(--link); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb [aria-current="page"] { color: var(--text-sub); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  background: linear-gradient(135deg, #0a0a1a 0%, #1a1040 50%, #0d0820 100%);
  padding: 28px 0;
}
@media (max-width: 480px) {
  .hero { padding: 20px 0; }
}
.hero-inner { max-width: 720px; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(180,120,255,0.2);
  color: #cc99ff;
  border: 1px solid rgba(180,120,255,0.4);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 2px;
  margin-bottom: 10px;
}
.hero-title {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 12px;
}
@media (max-width: 480px) {
  .hero-title { font-size: 22px; }
}
.hero-desc {
  font-size: 14px;
  color: rgba(255,255,255,0.8);
  line-height: 1.7;
  max-width: 600px;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 12px 0 40px;
  align-items: start;
}
@media (min-width: 768px) {
  .layout { grid-template-columns: 1fr 260px; }
}

/* ============================================================
   SECTION CARD
   ============================================================ */
.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 12px;
  scroll-margin-top: 96px;
}
.section-card:last-child { margin-bottom: 0; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 2px solid var(--red);
  background: var(--gray-50);
}
.section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--red);
  display: flex;
  align-items: center;
  gap: 6px;
}
.update-date {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ============================================================
   GAME BLOCK（ゲーム内セクション）
   ============================================================ */
.game-block {
  padding: 14px;
  border-bottom: 1px solid var(--border);
}
.game-block:last-child { border-bottom: none; }
.game-sub-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

/* ============================================================
   TIER BADGES & ELEMENT TAGS
   ============================================================ */
.tier-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--r);
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.tier-s { background: #d4a000; color: #fff; }
.tier-a { background: #1565c0; color: #fff; }
.tier-b { background: #2e7d32; color: #fff; }
.tier-c { background: #777;    color: #fff; }

.elem-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 2px;
  white-space: nowrap;
}
.elem-pyro    { background: #ffe0cc; color: #b84400; border: 1px solid #f0b080; }
.elem-hydro   { background: #cce8ff; color: #1a5fa0; border: 1px solid #90c8f0; }
.elem-electro { background: #e8d0ff; color: #6a1b9a; border: 1px solid #c890f0; }
.elem-anemo   { background: #d0f0e8; color: #1a7a5a; border: 1px solid #80d0b0; }
.elem-geo     { background: #fff0cc; color: #9a6a00; border: 1px solid #f0d080; }
.elem-cryo    { background: #d0eeff; color: #1a60a0; border: 1px solid #80c0f0; }
.elem-fire    { background: #ffe0cc; color: #b84400; border: 1px solid #f0b080; }
.elem-water   { background: #cce8ff; color: #1a5fa0; border: 1px solid #90c8f0; }
.elem-light   { background: #fffde0; color: #9a7a00; border: 1px solid #f0e080; }
.elem-dark    { background: #e0d0f0; color: #4a1a7a; border: 1px solid #c090e0; }

/* ============================================================
   TIER TABLE（ランキングテーブル）
   ============================================================ */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.compare-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 13px;
}
.compare-table caption {
  font-size: 11px;
  color: var(--text-muted);
  text-align: left;
  padding: 0 0 6px;
}
.compare-table thead th {
  background: var(--gray-100);
  font-weight: 700;
  padding: 8px 10px;
  text-align: left;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.compare-table tbody td {
  padding: 8px 10px;
  border: 1px solid var(--border);
  vertical-align: middle;
  line-height: 1.5;
}
.compare-table tbody tr:hover { background: var(--gray-50); }
.compare-table .recommended { background: #fffaf0; }

/* ============================================================
   TIER LEGEND（読み方ガイド）
   ============================================================ */
.intro-body { padding: 14px; }
.intro-text {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.7;
  margin-bottom: 12px;
}
.tier-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.tier-legend-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: var(--r);
}
.tier-legend-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.tier-legend-desc {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.5;
}
.intro-note {
  font-size: 11px;
  color: var(--text-muted);
  padding: 6px 10px;
  background: #fff8f0;
  border: 1px solid #f0d0a0;
  border-radius: var(--r);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ============================================================
   TEAM COMP（パーティ編成カード）
   ============================================================ */
.team-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.team-card {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.team-name {
  background: var(--red);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
}
.team-members {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  padding: 10px 12px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--border);
}
.team-member {
  text-align: center;
  padding: 6px 10px;
  flex: 1;
  min-width: 80px;
}
.member-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.member-role {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.team-sep {
  color: var(--text-muted);
  font-size: 16px;
  padding: 0 2px;
  flex-shrink: 0;
}
.team-desc {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.65;
  padding: 10px 12px;
}

/* ============================================================
   ARTIFACT（聖遺物・装備）
   ============================================================ */
.artifact-block {
  margin-top: 12px;
}
.artifact-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.artifact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
@media (max-width: 540px) {
  .artifact-grid { grid-template-columns: 1fr; }
}
.artifact-card {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--gray-50);
}
.artifact-card.best {
  border-color: #d4a000;
  background: #fffaf0;
}
.artifact-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.artifact-card.best .artifact-label { color: #d4a000; }
.artifact-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.4;
}
.artifact-desc {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.6;
  margin-bottom: 6px;
}
.artifact-stat {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}
.stat-label {
  font-weight: 700;
  color: var(--red);
  margin-right: 4px;
}

/* ============================================================
   PRIORITY / WEAPON BADGES
   ============================================================ */
.priority-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 2px;
  white-space: nowrap;
}
.prio-1 { background: #d4a000; color: #fff; }
.prio-2 { background: #1565c0; color: #fff; }
.prio-3 { background: #2e7d32; color: #fff; }

/* ============================================================
   DIFFICULTY BADGES
   ============================================================ */
.diff-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 2px;
}
.diff-easy { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.diff-mid  { background: #fff3e0; color: #e65100; border: 1px solid #ffcc80; }
.diff-hard { background: #fce4ec; color: #880e4f; border: 1px solid #f48fb1; }

/* ============================================================
   TIPS LIST（モンスト攻略ポイント）
   ============================================================ */
.tips-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tip-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: var(--r);
}
.tip-icon {
  font-size: 18px;
  flex-shrink: 0;
  line-height: 1.4;
}
.tip-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.tip-desc {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.65;
}

/* ============================================================
   SUB GRID（パズドラ サブキャラ）
   ============================================================ */
.sub-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
@media (min-width: 480px) {
  .sub-grid { grid-template-columns: repeat(3, 1fr); }
}
.sub-card {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--gray-50);
}
.sub-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.sub-reason {
  font-size: 11px;
  color: var(--text-sub);
  line-height: 1.55;
  margin-top: 4px;
}

/* ============================================================
   PRIORITY LIST（ブルアカ装備優先度）
   ============================================================ */
.priority-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.priority-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
}
.priority-body { flex: 1; }
.priority-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.priority-desc {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.65;
}

/* ============================================================
   EQUIP LIST（FGO 礼装ランキング）
   ============================================================ */
.equip-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.equip-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.equip-item:last-child { border-bottom: none; }
.equip-item:hover { background: var(--gray-50); }
.equip-rank {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  background: var(--red);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  margin-top: 2px;
}
.equip-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.equip-desc {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.65;
}

/* ============================================================
   FAQ
   ============================================================ */
.faq-list { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}
.faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  background: var(--gray-50);
  gap: 8px;
  user-select: none;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q::before {
  content: 'Q';
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  background: var(--red);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}
.faq-q::after {
  content: '▼';
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.2s;
  margin-left: auto;
}
.faq-item[open] .faq-q::after { transform: rotate(180deg); }
.faq-a {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.7;
  border-top: 1px solid var(--border);
}

/* ============================================================
   DISCLAIMER BOX
   ============================================================ */
.disclaimer-box {
  padding: 10px 14px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.7;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  margin-bottom: 12px;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 12px;
}
.sidebar-widget:last-child { margin-bottom: 0; }
.sidebar-widget-head {
  padding: 8px 12px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--border);
  border-left: 3px solid var(--red);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.sidebar-widget-head--warn {
  border-left-color: #c84f14;
  color: #c84f14;
}
.sidebar-widget-body { padding: 10px 12px; }
.toc-list { display: flex; flex-direction: column; }
.toc-list li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  line-height: 1.5;
}
.toc-list li:last-child { border-bottom: none; }
.toc-list a { color: var(--link); }
.toc-list a:hover { text-decoration: underline; }
.related-list { display: flex; flex-direction: column; gap: 8px; }
.related-list li {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  line-height: 1.5;
}
.related-list li:last-child { border-bottom: none; padding-bottom: 0; }
.related-list a { color: var(--link); }
.related-list a:hover { text-decoration: underline; }
.sidebar-disclaimer {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: #222;
  color: #aaa;
  text-align: center;
  padding: 20px 16px;
  font-size: 12px;
  line-height: 1.8;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 16px;
  margin-bottom: 8px;
}
.footer-links a { color: #aaa; }
.footer-links a:hover { color: #fff; text-decoration: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
  .team-members { gap: 4px; }
  .team-member { min-width: 60px; padding: 4px 6px; }
  .team-sep { display: none; }
}
