/* /public/css/base.css
   Based on /public/css/index.css design system
*/

/* =========================
   Design Tokens (Light)
   ========================= */
:root{
  color-scheme: light;
  --bg-page:#e5e7eb;
  --bg-header:rgba(255,255,255,.96);
  --bg-footer:#f9fafb;
  --bg-card:#ffffff;
  --border-soft:#d1d5db;
  --text-main:#0f172a;
  --text-sub:#4b5563;
  --accent:#4f46e5;
  --accent-hover:#4338ca;
  --bg: var(--bg-page);
  --card: var(--bg-card);
  --text: var(--text-main);
  --muted: var(--text-sub);
  --border: var(--border-soft);
  --container: 1200px;
  --gutter: 16px;
  --radius-card: 16px;
  --radius-pill: 999px;
  --shadow-card: 0 4px 12px rgba(0,0,0,.03);
  --focus-ring: 0 0 0 3px rgba(99,102,241,.15);
  --focus: 0 0 0 3px rgba(79,70,229,.25);
  --shadow-1: 0 6px 18px rgba(0,0,0,.10);
  --shadow-2: 0 18px 50px rgba(0,0,0,.12);
  --shadow: var(--shadow-1);
  --accent-2: #7c3aed;
  --danger: #ef4444;
}

/* =========================
   Dark Theme Tokens
   - 既存の変数名を上書きする方式（管理しやすい）
   ========================= */
:root[data-theme="dark"]{
  color-scheme: dark;
  --bg-page:#0b1220;
  --bg-header: rgba(15,23,42,.78);
  --bg-footer:#0b1220;
  --bg-card: rgba(255,255,255,.06);
  --border-soft: rgba(255,255,255,.12);
  --text-main: rgba(255,255,255,.92);
  --text-sub: rgba(255,255,255,.65);
  --bg: var(--bg-page);
  --card: var(--bg-card);
  --text: var(--text-main);
  --muted: var(--text-sub);
  --border: var(--border-soft);
  --shadow: var(--shadow-1);
  --accent:#818cf8;
  --accent-2: #a78bfa;
  --accent-hover:#6366f1;
  --shadow-card: 0 12px 36px rgba(0,0,0,.35);
  --focus-ring: 0 0 0 3px rgba(129,140,248,.22);
    --danger: #fb7185;
}

/* =========================
  Reset & Base
   ========================= */
*, *::before, *::after {
  box-sizing: border-box; /* はみ出し防止の最重要設定 */
}

html, body{
  margin:0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background:var(--bg-page);
  color:var(--text-main);
  max-width:100%;
  overflow-x: visible;
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s, color 0.2s;
}

a:hover{ text-decoration: underline; }

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

.muted{ color: var(--text-sub); }

/* レイアウト */

.site-main {
  min-height: calc(100vh - 250px);
  width: 100%;
  position: relative;
}

.page-root {
  max-width: 1200px;
  margin: 32px auto 48px;
  padding: 0 16px;
}

/* ===== ヘッダー ===== */
.site-header {
  position: -webkit-sticky; /* Safari対策 */
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-soft);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.site-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* ロゴ周り */
.site-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

.site-logo-main {
  font-size: 20px;
  font-weight: 900; /* 太く強調 */
  letter-spacing: 0.02em;
  font-family: "Segoe UI", Roboto, sans-serif; 
}

/* ナビゲーション */
.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-nav-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-sub);
    border-radius: 12px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.site-nav-item:hover {
  background: #f3f4f6;
  color: var(--text-main);
    background: rgba(15,23,42,.06);
  border-color: var(--border-soft);
  color: var(--text-main);
  text-decoration: none;
}

.site-nav-item.is-active {
  background: var(--text-main);
  color: #ffffff;
}

.site-nav a{
  padding:4px 10px;
  border-radius:999px;
}

/* アクティブ状態：.card-tag と同じ感じ */
.site-nav a.is-active{
  background:#eff6ff;  /* .card-tag と同じ */
  color:#1d4ed8;
  border-radius:999px;
  font-weight:600;
}

.site-nav-icon {
  font-size: 18px;
  display: inline-block;
  width: 1.25em;
  min-width: 1.25em;
  line-height: 1;
  text-align: center;
}
:root[data-theme="dark"] .site-nav-item:hover{
  background: rgba(255,255,255,.06);
}

.site-nav-item.is-active{
  /* index.cssの.card-tag風（青いピル）に統一 */
  background:#eff6ff;
  color:#1d4ed8;
  border-color: rgba(37,99,235,.20);
}

:root[data-theme="dark"] .site-nav-item.is-active{
  background: rgba(129,140,248,.16);
  color: rgba(255,255,255,.92);
  border-color: rgba(129,140,248,.22);
}

.site-nav-icon{
  font-size: 18px;
  display:inline-block;
  width: 1.25em;
  min-width: 1.25em;
  line-height: 1;
  text-align: center;
}

/* =========================
   Cards (index.css taste)
   ========================= */
.card{
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.card-header-line{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom: 10px;
}

.card-title{
  margin:0;
  font-size: 16px;
  font-weight: 700;
}

.card-tag{
  font-size: 10px;
  background:#eff6ff;
  color:#2563eb;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  border: 1px solid rgba(37,99,235,.12);
}

:root[data-theme="dark"] .card-tag{
  background: rgba(129,140,248,.16);
  color: rgba(255,255,255,.92);
  border-color: rgba(129,140,248,.22);
}

.card-desc{
  margin: 0 0 20px;
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.6;
}

/* =========================
   Common Form Controls (pill)
   - index.cssの input/button を共通部品化
   ========================= */
.ui-label{
  display:block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-sub);
  margin-bottom: 6px;
}

.ui-input{
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-pill);
  font-size: 16px; /* iOSズーム防止 */
  outline: none;
  background: #f9fafb;
  transition: all .2s;
  color: var(--text-main);
}

:root[data-theme="dark"] .ui-input{
  background: rgba(255,255,255,.06);
}

.ui-input:focus{
  background: #ffffff;
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}

:root[data-theme="dark"] .ui-input:focus{
  background: rgba(255,255,255,.08);
}

.ui-btn{
  border: none;
  border-radius: var(--radius-pill);
  padding: 11px 18px;
  font-size: 13px;
  font-weight: 800;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .2s, transform .08s, box-shadow .08s;
}

.ui-btn:hover{ opacity: .92; }
.ui-btn:active{ transform: translateY(1px); }

.ui-btn-sub{
  background: #111827;
}

:root[data-theme="dark"] .ui-btn-sub{
  background: rgba(255,255,255,.10);
  border: 1px solid var(--border-soft);
}

/* ===== フッター ===== */
/* フッターのベース色もメイン文字色に寄せる */
.site-footer {
  background: var(--bg-footer);
  border-top: 1px solid var(--border-soft);
  padding: 16px 16px 20px;
  font-size: 13px;
  color: var(--text-main);
}

/* PC 幅は 1200px に統一 */
.site-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--text-main);  /* ここもメイン文字色 */
}

.site-footer-brand{
  font-weight:700;
}

.site-footer-text {
  line-height: 1.6;
  color: var(--text-main);
}

/* 注意書き：背景なしで文字だけ濃く */
.site-footer-notice {
  margin: 6px 0 8px;
  font-size: 12px;
  line-height: 1.6;
  color: #111827;   /* さらに一段階濃い */
  background: none;
  border-radius: 0;
  padding: 0;
}


.site-footer-notice a{
  color:inherit;
  text-decoration:underline;
}
.site-footer-notice a:hover{
  text-decoration:none;
}

.site-footer-links{
  display:flex;
  flex-wrap:wrap;
  gap:6px 16px;
}

.site-footer-links a{
  font-size:12px;
  font-weight:500;
  color:var(--text-main);
}

.site-footer-links a:hover{
  color:var(--accent);
  text-decoration:underline;
}

/* コピーライトもコントラスト強めに */
.site-footer-copy {
  margin-top: 4px;
  font-size: 12px;
  color: #111827;   /* #6b7280 → より濃い色に */
}

:root[data-theme="dark"] .site-footer-copy{
  color: var(--text-sub);
}

/* スマホ時の余白調整 */
@media (max-width: 640px){
  /* ヘッダー：少しコンパクト＆折り返しやすく */
  .site-header-inner{
    padding:8px 12px;
    flex-wrap:wrap;
    gap:8px;
  }

  .site-logo{
    font-size:18px;
  }

  .site-nav{
    display:flex;
    flex-wrap:wrap;
    gap:6px;
    font-size:12px;
  }

  .site-nav a{
    padding:3px 8px;
  }

  /* フッター（さっきのやつと合わせる） */
  .site-footer-inner{
    padding:12px 20px 16px;
  }

  /* メインコンテンツ左右の余白を少し増やす */
  .page-root{
  max-width:1200px;
  margin:24px auto 40px;
  padding:0 16px;
  }
}

/* =========================================
   レスポンシブ (スマホ・タブレット)
   ========================================= */
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr; /* 縦並び */
  }
}

@media (max-width: 768px) {
  /* ヘッダー: 2段組にして見切れ防止 */
  .site-header-inner {
    height: auto;
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 12px;
  }

  /* ナビゲーション: ボタン風に並べる */
  .site-nav {
    width: 100%;
    justify-content: space-between; 
    overflow-x: visible;
    padding-bottom: 2px;
  }

  .site-nav-item {
    flex: 1;
    justify-content: center;
    white-space: nowrap;
    background: #f9fafb;
    font-size: 12px;
    padding: 8px 4px;
    border-radius: 6px;
  }
  
  .site-nav-label {
    font-size: 11px;
  }

  /* フッター: 縦積みレイアウト */
  .site-footer-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }

    .site-footer-left {
    max-width: 100%;
  }

  .site-footer-right {
    min-width: 100%;
  }

  .site-footer-links {
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .page-root {
    margin: 20px auto 32px;
    padding: 0 12px;
  }

  .card {
    padding: 16px 12px;
  }

  /* ここから追加：入力＋ボタンの横はみ出し防止 */
  .search-input-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .search-input-row input {
    width: 100%;
  }

  .search-input-row button {
    width: 100%;
    text-align: center;
  }

  .hero-title-main {
    font-size: 22px;
  }
}

.player-badges{
  display:inline-flex;
  align-items:center;
  gap:6px;
  margin-left:8px;
}

.bs-badge-btn {
  width: 24px;   /* 少し大きくしても見やすいです */
  height: 24px;
  padding: 0;
  border: none;           /* 枠線を削除 */
  background: transparent; /* 背景を透明に */
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  /* デフォルトの色 */
  color: #1d4ed8;
  font-size: 18px; /* アイコンサイズ */
  transition: transform 0.1s, color 0.2s;
}

.bs-badge-btn:hover {
  transform: scale(1.1);
  filter: brightness(1.1);
}

/* ▼ 追加: バッジの種類ごとの色設定 (type-〇〇) ▼ */
/* 公式認定 (official) -> 青 */
.bs-badge-btn.type-official { color: #3b82f6; }

/* 認証済み (verified) -> 緑 */
.bs-badge-btn.type-verified { color: #10b981; }

/* 開発者 (dev) -> 紫/インディゴ */
.bs-badge-btn.type-dev { color: #6366f1; }

/* 運営者 (operator) -> オレンジ */
.bs-badge-btn.type-operator { color: #f59e0b; }

/* テスター (tester) -> ピンク */
.bs-badge-btn.type-tester { color: #ec4899; }

/* eSports (esports) -> 紫 */
.bs-badge-btn.type-esports { color: #8b5cf6; }

.bs-badge-btn i{
  font-size:18px;
  line-height:1;
}

/* ===== Simple Modal ===== */
.bs-modal-backdrop{
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0,0,0,.45);
  z-index: 9999;
}

.bs-modal{
  width: min(420px, 100%);
  background: #fff;
  color: #111;
  border-radius: 14px;
  padding: 14px 14px 12px;
  box-shadow: 0 18px 50px rgba(0,0,0,.25);
}

.bs-modal__title{
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 8px;
}

.bs-modal__body{
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  color: rgba(0,0,0,.85);
}

body.bs-modal-open{
  overflow: hidden;
}

/* =========================================
   MODAL
   ========================================= */
  
/* モーダル背景 */
.bs-modal-backdrop {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  /* 開始時: 0.15秒でフェードイン */
  animation: modalFadeIn 0.15s ease-out forwards;
}

/* ▼ 終了時: クラスが付いたらフェードアウト */
.bs-modal-backdrop.is-closing {
  animation: modalFadeOut 0.15s ease-in forwards;
  pointer-events: none; /* 閉じる最中はクリック禁止 */
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* モーダル本体 */
.bs-modal {
  background: #ffffff;
  width: 90%;
  max-width: 500px;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  overflow: hidden;
  animation: modalSlideUp 0.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* ▼ 終了時: 本体も少し下に下がりながら消える */
.bs-modal-backdrop.is-closing .bs-modal {
  animation: modalSlideDown 0.15s ease-in forwards;
}

@keyframes modalSlideUp {
  0% { opacity: 0; transform: translateY(15px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes modalSlideDown {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(10px); }
}

/* タイトルエリア */
.bs-modal__title {
  padding: 16px 20px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  background: #f8fafc;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* 本文エリア */
.bs-modal__body {
  padding: 20px;
  font-size: 14px;
  line-height: 1.6;
  color: #334155;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.bs-modal__body::-webkit-scrollbar {
  width: 6px;
}
.bs-modal__body::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 4px;
}
.bs-modal__body::-webkit-scrollbar-track {
  background: transparent;
}

/* リンクのスタイル */
.bs-modal__body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}
.bs-modal__body a:hover {
  color: var(--accent-hover);
  text-decoration-thickness: 2px;
}

/* スマホ調整 */
@media (max-width: 480px) {
  .bs-modal { width: 92%; }
  .bs-modal__title { padding: 14px 16px; }
  .bs-modal__body { padding: 16px; }
}

/* ================================
   Legal pages (Privacy / Terms)
   ================================ */

.legal-section{
  max-width: min(1200px, calc(var(--container) - (var(--gutter) * 2)));
  margin: 24px auto 48px;
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.legal-section h1{
  margin: 0 0 10px;
  font-size: 26px;
  letter-spacing: -0.01em;
}

.legal-section > p:first-of-type{
  margin-top: 0;
  color: var(--text-muted);
}

.legal-section > p strong{
  color: var(--text);
}

.legal-section h2{
  margin: 26px 0 10px;
  padding-top: 18px;
  border-top: 1px solid var(--border-soft);
  font-size: 18px;
}

.legal-section h3{
  margin: 18px 0 8px;
  font-size: 15px;
  color: var(--text);
}

.legal-section p,
.legal-section li{
  font-size: 14px;
  line-height: 1.9;
  color: var(--text);
}

.legal-section ul,
.legal-section ol{
  padding-left: 1.25em;
  margin: 10px 0 16px;
}

.legal-section li{
  margin: 6px 0;
}

/* legal内だけ、リンクは常時下線で見やすく */
.legal-section a{
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.legal-section a:hover{
  text-decoration-thickness: 2px;
}

/* コード・引用（規約でも使える） */
.legal-section code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
               "Liberation Mono", "Courier New", monospace;
  font-size: 0.95em;
  background: var(--bg-card-hover);
  padding: 0.12em 0.35em;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
}

.legal-section blockquote{
  margin: 14px 0;
  padding: 12px 14px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--accent);
  border-radius: 14px;
  color: var(--text-muted);
}

.legal-section hr{
  border: 0;
  border-top: 1px solid var(--border-soft);
  margin: 18px 0;
}

/* 表（必要になったとき用：利用規約/特商法などにも使える） */
.legal-section .legal-table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 12px 0 18px;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  overflow: hidden;
}
.legal-section .legal-table th,
.legal-section .legal-table td{
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
  font-size: 13px;
}
.legal-section .legal-table tr:last-child th,
.legal-section .legal-table tr:last-child td{
  border-bottom: 0;
}
.legal-section .legal-table th{
  background: var(--bg-card-hover);
  color: var(--text-muted);
  font-weight: 800;
}

/* 見出しへ飛んだ時にヘッダーで隠れないように */
.legal-section :target{
  scroll-margin-top: 88px;
}

/* スマホ最適化 */
@media (max-width: 640px){
  .legal-section{
    margin: 16px var(--gutter) 32px;
    padding: 20px 16px;
  }
  .legal-section h1{ font-size: 22px; }
  .legal-section h2{ font-size: 16px; }
}