@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700;900&family=Noto+Serif+JP:wght@400;700&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  /* ── ブランドカラー ── */
  --brand:      #202f55;
  --brand-d:    #172240;
  --brand-l:    #2d4275;
  --brand-xs:   #eef1f8;
  --brand-s:    #d4daf0;

  /* ── 基本色 ── */
  --bg:         #f3f5f9;
  --surface:    #ffffff;
  --border:     #dde1ea;
  --text:       #1a1d23;
  --muted:      #6b7280;

  /* ── アクセント ── */
  --gold:       #b8860b;
  --gold-l:     #fef3c7;
  --gold-d:     #92400e;
  --blue-l:     #dbeafe;
  --blue-d:     #1e40af;
  --green-l:    #d1fae5;
  --green-d:    #065f46;

  /* ── 状態色 ── */
  --danger:     #dc2626;
  --danger-s:   #fef2f2;
  --success:    #16a34a;
  --success-s:  #f0fdf4;
  --warn:       #d97706;

  /* ── タイポ ── */
  --sans:       'Noto Sans JP', sans-serif;
  --serif:      'Noto Serif JP', serif;
  --mono:       'JetBrains Mono', monospace;

  --radius:     8px;
  --radius-lg:  14px;
}

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

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ══════════════════════════════════════
   ヘッダー
══════════════════════════════════════ */
.site-header {
  background: var(--brand);
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 200;
  flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(32,47,85,0.18);
}
.site-header .logo-img {
  height: 36px;
  width: auto;
  cursor: pointer;
  user-select: none;
  filter: brightness(0) invert(1);
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.header-nav a, .header-nav button {
  color: rgba(255,255,255,0.78);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: var(--sans);
  transition: background 0.15s, color 0.15s;
}
.header-nav a:hover, .header-nav button:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}
.header-nav .nav-active {
  background: rgba(255,255,255,0.15);
  color: #fff;
}
.header-auth {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
  padding-left: 12px;
  border-left: 1px solid rgba(255,255,255,0.18);
}
.btn-login {
  background: rgba(255,255,255,0.15) !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,0.3) !important;
  font-size: 13px !important;
  padding: 5px 14px !important;
}
.btn-login:hover { background: rgba(255,255,255,0.25) !important; }
.user-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: rgba(255,255,255,0.85);
}
.user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
}

/* ══════════════════════════════════════
   パンくず
══════════════════════════════════════ */
.breadcrumb {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 8px 28px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
}
.breadcrumb .sep { color: var(--border); }
.breadcrumb .crumb-link {
  color: var(--brand);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.breadcrumb .crumb-current { color: var(--text); font-weight: 500; }

/* ══════════════════════════════════════
   広告スロット
══════════════════════════════════════ */
.ad-slot {
  position: relative;
  border: 2px solid var(--brand-s);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: visible;
}
.ad-slot::before {
  content: '広告';
  position: absolute;
  top: -10px; left: 12px;
  background: var(--brand);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 1px 8px;
  border-radius: 99px;
}
.ad-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.05em;
  min-height: 90px;
}
.ad-slot-728 { width: 100%; max-width: 728px; }
.ad-slot-300 { width: 300px; }

/* ══════════════════════════════════════
   ボタン
══════════════════════════════════════ */
button {
  font-family: var(--sans);
  cursor: pointer;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 24px;
  transition: opacity 0.15s, transform 0.1s, background 0.15s;
  white-space: nowrap;
}
button:active { transform: scale(0.97); }
button:disabled { opacity: 0.38; cursor: not-allowed; }
.btn-primary  { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-l); }
.btn-ghost    { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--bg); }
.btn-danger   { background: var(--danger-s); color: var(--danger); border: 1px solid #fecaca; }
.btn-danger:hover:not(:disabled) { background: #fee2e2; }

/* ══════════════════════════════════════
   バッジ
══════════════════════════════════════ */
.badge { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.badge-1 { background: var(--gold-l);  color: var(--gold-d); }
.badge-2 { background: var(--blue-l);  color: var(--blue-d); }
.badge-3 { background: var(--green-l); color: var(--green-d); }

/* ══════════════════════════════════════
   モーダル共通
══════════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(10,15,30,0.65);
  backdrop-filter: blur(4px);
  z-index: 500;
  align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  width: 400px; max-width: 94vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  animation: popIn 0.2s cubic-bezier(.22,.87,.47,1);
}
.modal-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.modal-card p  { font-size: 14px; color: var(--muted); line-height: 1.7; margin-bottom: 24px; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions button { flex: 1; }

@keyframes popIn {
  from { opacity:0; transform:scale(0.9) translateY(8px); }
  to   { opacity:1; transform:scale(1)   translateY(0); }
}

/* ══════════════════════════════════════
   スクロールバー
══════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
