:root {
 --logo-blue: #0b1c3f;
 --bg: #0b1c3f;
 --card: #0a1931;
 --text: #ffffff;
 --muted: #94a3b8;
 --accent: #3b82f6;
 --border: rgba(255, 255, 255, 0.1);
 --body-gradient: linear-gradient(180deg, #0b1c3f 0%, #0b1c3f 150px, #081832 62%, #051026 100%);
 --links-a-color: #fff;
 --input-color: white;
}
[data-theme="light"] {
 --bg: #f0f4f8;
 --card: #ffffff;
 --text: #1a202c;
 --muted: #64748b;
 --accent: #2563eb;
 --border: rgba(0, 0, 0, 0.1);
 --body-gradient: linear-gradient(155deg, #dbeafe 0%, #edf5ff 46%, #f0f4f8 100%);
 --links-a-color: #1a202c;
 --input-color: #1a202c;
}
[data-theme="dark"] {
 --bg: #0d0d0d;
 --card: #1a1a1a;
 --text: #e5e5e5;
 --muted: #888888;
 --accent: #60a5fa;
 --border: rgba(255, 255, 255, 0.08);
 --body-gradient: linear-gradient(155deg, #202020 0%, #151515 48%, #0d0d0d 100%);
 --links-a-color: #e5e5e5;
 --input-color: #e5e5e5;
}
* { box-sizing: border-box; }
html {
 min-height: 100%;
 background: var(--bg);
}
body {
 margin: 0;
 min-height: 100vh;
 font-family: 'Noto Sans JP', sans-serif;
 background-color: var(--bg);
 background-image: var(--body-gradient);
 background-attachment: fixed;
 background-repeat: no-repeat;
 background-size: 100% 100%;
 color: var(--text);
 line-height: 1.6;
 transition: background-color 0.3s, color 0.3s;
}
body.share-loading-active {
 overflow: hidden;
 touch-action: none;
}
.container { width: 900px; max-width: 95%; margin: 0 auto; padding: 20px 0; }
.header { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.header-left { display: flex; align-items: center; gap: 12px; }
#logo { width: 54px; height: 54px; border-radius: 8px; transition: transform 0.3s; }
.site-title { font-size: 22px; margin: 0; font-weight: 700; letter-spacing: 1px; }
.nav { display: flex; gap: 14px; align-items: center; }
.nav a { color: var(--muted); text-decoration: none; font-size: 14px; transition: color 0.3s; }
.nav a:hover { color: var(--accent); }
.nav-tool-btn {
 display: inline-flex;
 align-items: center;
 justify-content: center;
 width: 30px;
 height: 30px;
 border: 1px solid var(--border);
 border-radius: 6px;
 background: var(--card);
 color: var(--text);
 cursor: pointer;
 font-size: 0.82rem;
}
.nav-tool-btn:hover { border-color: var(--orange); }
.theme-switcher { display: flex; align-items: center; background: var(--card); border: 1px solid var(--border); border-radius: 30px; padding: 4px; gap: 2px; transition: background 0.3s, border-color 0.3s; }
.theme-btn { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; border: none; background: transparent; cursor: pointer; font-size: 15px; transition: background 0.2s, transform 0.2s; color: var(--muted); position: relative; }
.theme-btn:hover { background: rgba(59, 130, 246, 0.15); transform: scale(1.1); }
.theme-btn.active { background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4); }
.theme-btn[title]::after { content: attr(title); position: absolute; bottom: -28px; left: 50%; transform: translateX(-50%); font-size: 10px; white-space: nowrap; background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 4px; padding: 2px 6px; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.theme-btn:hover[title]::after { opacity: 1; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 24px; transition: transform 0.3s, border-color 0.3s, background 0.3s; }
.card:hover { transform: translateY(-5px); border-color: var(--accent); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.card h3 { margin: 0; font-size: 18px; }
.tag { font-size: 10px; background: rgba(59, 130, 246, 0.2); color: var(--accent); padding: 2px 8px; border-radius: 20px; text-transform: uppercase; }
.links { list-style: none; padding: 0; margin: 0; }
.links li { margin-bottom: 10px; }
.links a { display: block; padding: 12px 15px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border); border-radius: 10px; color: var(--links-a-color); text-decoration: none; font-size: 14px; transition: all 0.2s; }
[data-theme="light"] .links a { background: rgba(0, 0, 0, 0.03); }
.links a:hover { background: var(--accent); border-color: var(--accent); color: #fff; transform: scale(1.02); }
footer { margin-top: 50px; text-align: center; color: var(--muted); font-size: 12px; }
.fade-in { animation: fadeIn 0.8s ease forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.share-loading-overlay {
 position: fixed;
 inset: 0;
 z-index: 10000;
 display: none;
 align-items: center;
 justify-content: center;
 padding: 24px;
 background:
  radial-gradient(circle at 50% 34%, rgba(243,152,0,0.18), transparent 32%),
  rgba(3, 9, 22, 0.92);
 backdrop-filter: blur(10px);
 pointer-events: auto;
}
.share-loading-overlay.show { display: flex; }
.share-loading-panel {
 width: min(360px, 88vw);
 color: #fff;
 text-align: center;
 user-select: none;
}
.share-loading-logo {
 width: 86px;
 height: 86px;
 border-radius: 16px;
 display: block;
 margin: 0 auto 18px;
 box-shadow: 0 16px 38px rgba(0,0,0,0.38);
}
.share-loading-title {
 font-size: 1.02rem;
 font-weight: 700;
 margin-bottom: 14px;
}
.share-loading-spinner {
 width: 34px;
 height: 34px;
 margin: 0 auto 20px;
 border-radius: 50%;
 border: 3px solid rgba(255,255,255,0.2);
 border-top-color: #f39800;
 animation: shareLoadingSpin 0.8s linear infinite;
}
@keyframes shareLoadingSpin { to { transform: rotate(360deg); } }
.share-loading-progress-row {
 display: grid;
 grid-template-columns: minmax(0, 1fr) 46px;
 gap: 10px;
 align-items: center;
 margin-bottom: 12px;
}
.share-loading-progress-track {
 height: 8px;
 overflow: hidden;
 border-radius: 999px;
 background: rgba(255,255,255,0.16);
 box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}
.share-loading-progress-bar {
 width: 0%;
 height: 100%;
 border-radius: inherit;
 background: linear-gradient(90deg, #f39800, #ffd166);
 transition: width 0.25s ease;
}
.share-loading-percent {
 font-size: 0.78rem;
 color: rgba(255,255,255,0.82);
 text-align: right;
 font-variant-numeric: tabular-nums;
}
.share-loading-status {
 font-size: 0.86rem;
 font-weight: 700;
 color: #ffd166;
 min-height: 1.5em;
}
.share-loading-detail {
 font-size: 0.74rem;
 color: rgba(255,255,255,0.7);
 line-height: 1.6;
 min-height: 1.6em;
}
.share-loading-overlay.error .share-loading-progress-bar {
 background: linear-gradient(90deg, #ff6b6b, #ffd166);
}
input[type="text"], input[type="number"], select { background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); color: var(--input-color); padding: 8px 12px; border-radius: 6px; margin-top: 4px; }
label { font-size: 12px; color: var(--muted); }
.content-area { width: 100%; max-width: 1200px; margin: 20px auto; padding: 0 10px; box-sizing: border-box; }
.iframe-wrapper { position: relative; width: 100%; height: 80vh; border: 2px solid #ccc; border-radius: 8px; overflow: hidden; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.iframe-wrapper iframe { width: 100%; height: 100%; border: none; }
.gacha-section { margin-top: 20px; padding: 0; background: transparent; border: none; }
.search-controls { margin-bottom: 15px; display: flex; align-items: center; gap: 10px; }
#gachaNumber { padding: 8px; font-size: 16px; width: 100px; border: 1px solid #ccc; border-radius: 4px; }
.search-controls button { padding: 8px 16px; background-color: #007bff; color: white; border: none; border-radius: 4px; cursor: pointer; }
.search-controls button:hover { background-color: #0056b3; }
.gacha-view { height: 60vh; border: 1px solid var(--border); }
.lang-selector { margin-bottom: 10px; padding: 10px 0; background: none; box-shadow: none; }
.lang-selector p { margin: 0 0 8px 0; font-size: 14px; font-weight: bold; color: var(--text); text-shadow: 1px 1px 2px rgba(0,0,0,0.5); }
.lang-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.lang-buttons button { padding: 5px 15px; cursor: pointer; border: 1px solid rgba(255,255,255,0.5); background: rgba(255,255,255,0.2); color: white; border-radius: 20px; font-size: 13px; transition: 0.3s; }
.lang-buttons button:hover { background: rgba(255,255,255,0.4); border-color: white; }
.gacha-details { margin: 20px 0; width: 100%; max-width: 1200px; }
.gacha-details summary { background-color: rgba(0, 123, 255, 0.8); color: white; padding: 10px 20px; border-radius: 5px; cursor: pointer; font-weight: bold; list-style: none; text-align: center; transition: 0.3s; box-shadow: 0 4px 6px rgba(0,0,0,0.2); }
.gacha-details summary:hover { background-color: rgba(0, 123, 255, 1); }
.gacha-details summary::before { content: "🔍 "; }
.gacha-details[open] .external-search-controls { margin-top: 10px; background-color: transparent; padding: 15px; border-radius: 10px; display: flex; justify-content: center; }
.gacha-container-inner { background: transparent !important; border: none !important; }
#stageType { background: rgba(255, 255, 255, 0.1); color: var(--text); padding: 8px; border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 4px; cursor: pointer; font-size: 14px; }
#stageType option { background-color: var(--card); color: var(--text); }
.mini-player { position: fixed; bottom: 0; width: 100%; height: 65px; background: #222539; display: none; align-items: center; padding: 0 15px; z-index: 100; border-top: 2px solid #f39800; }
.full-player { position: fixed; top: 100%; left: 0; width: 100%; height: 100%; background: #1a1c2c; transition: 0.4s; z-index: 200; overflow: hidden; color: white; }
.full-player.active { top: 0; }
.album-art-circle { width: 260px; height: 260px; background: #333; border-radius: 50%; margin: 50px auto; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.play-main-btn { width: 75px; height: 75px; border-radius: 50%; background: #f39800; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.seek-container { display: flex; align-items: center; gap: 10px; padding: 0 20px; }
input[type="range"] { flex-grow: 1; accent-color: #f39800; }


/* =============================================
   検索ボックス　ここからevent
   ============================================= */
#search-wrap {
  position: relative;
  display: inline-block;
}
#searchInput {
  padding: 3px 8px;
  font-size: 0.8rem;
  border: 1px solid #555;
  border-radius: 4px;
  background: var(--bg-secondary, #2a2a2a);
  color: var(--text-primary, #eee);
  width: 200px;
  outline: none;
}
#searchInput:focus { border-color: #f90; }
#search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  background: var(--bg-secondary, #2a2a2a);
  border: 1px solid #555;
  border-radius: 4px;
  width: 260px;
  max-height: 220px;
  overflow-y: auto;
  display: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.suggestion-item {
  padding: 5px 10px;
  font-size: 0.78rem;
  cursor: pointer;
  color: var(--text-primary, #eee);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.suggestion-item:hover,
.suggestion-item.active { background: #f90; color: #000; }

/* =============================================
   JSON/生データ表示ボタン
   ============================================= */
.overlay-raw-buttons { display: flex; gap: 8px; margin-top: 4px; }
.overlay-raw-btn {
  padding: 4px 12px;
  font-size: 0.75rem;
  cursor: pointer;
  border: 1px solid #555;
  border-radius: 4px;
  background: rgba(255,255,255,0.08);
  color: #eee;
  transition: background 0.2s;
}
.overlay-raw-btn:hover { background: rgba(255,153,0,0.3); border-color: #f90; }

/* =============================================
   テーマトグル
   ============================================= */
.theme-toggle-group {
  display: flex; align-items: center; gap: 2px;
  background: rgba(0,0,0,0.2); border-radius: 20px; padding: 3px;
}
.theme-btn {
  background: none; border: none; cursor: pointer;
  width: 28px; height: 28px; border-radius: 50%;
  font-size: 0.9rem; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, transform 0.1s;
  color: var(--text-primary, #eee); opacity: 0.5;
}
.theme-btn:hover { background: rgba(255,255,255,0.12); opacity: 0.85; }
.theme-btn.active {
  background: rgba(255,153,0,0.25); opacity: 1;
  box-shadow: 0 0 0 1px rgba(255,153,0,0.6);
}
.theme-btn.active:hover { background: rgba(255,153,0,0.35); }

/* =============================================
   ライトモード（data-theme="light"）
   ============================================= */
[data-theme="light"] {
  --bg-primary:   #f4f5f7;
  --bg-secondary: #ffffff;
  --bg-tertiary:  #e8eaed;
  --card:         #ffffff;
  --border:       rgba(0,0,0,0.1);
  --text-primary: #1a1a2e;
  --text-secondary: #555;
  --accent:       #f90;
}
[data-theme="light"] body {
  background-color: var(--bg-primary, #f4f5f7);
  background-image: var(--body-gradient);
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  color: var(--text-primary, #1a1a2e);
}
[data-theme="light"] .event-card {
  background: #fff; border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
[data-theme="light"] .event-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
[data-theme="light"] .card-period,
[data-theme="light"] .card-name { color: #222; }
[data-theme="light"] .overlay-panel { background: #fff; color: #1a1a2e; }
[data-theme="light"] .overlay-label { color: #555; }
[data-theme="light"] .overlay-value { color: #222; }
[data-theme="light"] #searchInput {
  background: #fff; color: #222; border-color: #ccc;
}
[data-theme="light"] .suggestion-item { color: #222; background: #fff; }
[data-theme="light"] .now-display { color: #444; }
[data-theme="light"] .count-label { color: #444; }
[data-theme="light"] .loading { color: #666; }
[data-theme="light"] .settings-section {
  background: #fff; border-color: rgba(0,0,0,0.1);
}
[data-theme="light"] .history-event-card { background: #fff; border-color: rgba(0,0,0,0.08); }
[data-theme="light"] .history-event-date { color: #555; }
[data-theme="light"] .history-type-btn { color: #333; background: rgba(0,0,0,0.05); border-color: #ccc; }
[data-theme="light"] .occ-list { color: #444; }
[data-theme="light"] .ver-badge.ver-need { background: rgba(200,0,0,0.1); color: #c00; }
[data-theme="light"] .ver-badge.ver-limit { background: rgba(180,120,0,0.12); color: #a07000; }
[data-theme="light"] .theme-toggle-group { background: rgba(0,0,0,0.08); }
[data-theme="light"] .theme-btn { color: #333; }
[data-theme="light"] .hist-section-header { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.1); color: #333; }
[data-theme="light"] .hist-section-header.added   { color: #1a8a3a; }
[data-theme="light"] .hist-section-header.removed { color: #c0392b; }
[data-theme="light"] .hist-section-header.changed { color: #d47000; }

/* =============================================
   タブ
   ============================================= */
.tab {
  padding: 6px 10px !important;
  border-top: 0;
  border-right: 0;
  border-left: 0;
  background: transparent;
  font-family: inherit;
  font-size: 0.78rem !important;
}
.tab:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: -2px;
}

/* =============================================
   カード文字サイズ設定（ここで一括変更可能）
   ============================================= */
.event-card   { padding: 4px 7px !important; min-height: 34px !important; margin-bottom: 5px !important; gap: 6px !important; border-radius: 7px !important; }
.event-card:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}
.card-period  { font-size: 0.62rem !important; margin-bottom: 0 !important; }
.card-name    { font-size: 0.7rem !important; line-height: 1.25 !important; }
.event-card[data-event-type="mission"] .card-name {
  display: -webkit-box;
  overflow: hidden;
  white-space: normal;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.card-tag     { font-size: 0.53rem !important; padding: 1px 4px !important; }
.gacha-type-tag { font-size: 0.53rem !important; padding: 1px 4px !important; }
.card-arrow   { font-size: 0.68rem !important; }

/* ステージタグ / itemタグ */
.stage-tag    { font-size: 0.53rem !important; padding: 1px 3px !important;
                border-radius: 3px; vertical-align: middle; margin-left: 2px;
                font-weight: bold; display: inline-block; }

/* =============================================
   オーバーレイ
   ============================================= */
.overlay-header-row {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 8px; margin-bottom: 4px;
}
.overlay-header-row .overlay-title {
  flex: 1; min-width: 0; word-break: break-word;
}
.overlay-title-row {
  align-items: flex-start;
  margin-bottom: 0;
}
.overlay-title-row .overlay-title {
  padding-right: 8px;
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.55;
}
.overlay-header-divider {
  margin: 9px 0 8px !important;
}
.overlay-action-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 12px;
}
.overlay-stage-code {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.2);
  color: #bfdbfe;
  font-size: 0.7rem;
  font-weight: 800;
}
.overlay-meta-section .overlay-value {
  white-space: normal;
}
.overlay-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  line-height: 1.3;
  min-width: 0;
}
.overlay-tags .card-tag,
.overlay-tags .gacha-type-tag,
.overlay-tags .stage-tag,
.overlay-feature-tag {
  margin-left: 0 !important;
  font-size: 0.58rem !important;
  line-height: 1.25;
  padding: 2px 5px !important;
  border-radius: 999px;
}
.overlay-feature-tag {
  display: inline-block;
  color: #dbeafe;
  background: rgba(59, 130, 246, 0.18);
  border: 1px solid rgba(147, 197, 253, 0.18);
  font-weight: 700;
  white-space: nowrap;
}
.overlay-same-section {
  margin-bottom: 14px;
}
.overlay-same-list {
  display: grid;
  gap: 4px;
}
.overlay-same-list .event-card {
  margin-bottom: 0 !important;
  min-height: 29px !important;
  padding: 3px 5px !important;
  box-shadow: none;
}
.overlay-same-list .card-period {
  font-size: 0.52rem !important;
}
.overlay-same-list .card-name {
  font-size: 0.62rem !important;
}
.overlay-close {
  border: 0;
  background: transparent;
  font-family: inherit;
}
.overlay-close:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}
#overlay-sub { z-index: 2100; }

/* =============================================
   バージョンバッジ
   ============================================= */
.ver-badge  { font-size:0.6rem; padding:1px 4px; border-radius:3px; vertical-align:middle; margin-left:3px; }
.ver-need   { background:rgba(255,80,80,0.2); color:#f99; }
.ver-limit  { background:rgba(255,200,0,0.15); color:#fc8; }

/* =============================================
   次の開催リスト
   ============================================= */
.occ-list { font-size:0.7rem; color:#bbb; white-space:pre-wrap; line-height:1.8; }
.occ-current { color:#4f8; font-weight:bold; }

/* =============================================
   フィルターオーバーレイ
   ============================================= */
#filter-overlay {
  display:none; position:fixed; inset:0; z-index:2500;
  background:rgba(0,0,0,0.65); align-items:flex-start; justify-content:center;
  padding-top:60px;
}
#filter-overlay.show { display:flex; }
#filter-panel {
  background:var(--card,#0a1931); border:1px solid var(--border,rgba(255,255,255,0.15));
  border-radius:12px; padding:16px 20px; width:min(92vw,420px);
  max-height:80vh; overflow-y:auto;
}
#filter-panel h4 { margin:0 0 12px; font-size:0.9rem; color:#eee; }
.filter-row {
  display:flex; align-items:center; justify-content:space-between;
  padding:5px 4px; border-radius:4px; cursor:pointer;
}
.filter-row:hover { background:rgba(255,255,255,0.06); }
.filter-row-left { display:flex; align-items:center; gap:6px; }
.filter-count { font-size:0.68rem; color:#888; }
.filter-row input[type="checkbox"] { accent-color:#f90; width:15px; height:15px; cursor:pointer; }
.filter-actions { display:flex; gap:8px; margin-top:12px; border-top:1px solid rgba(255,255,255,0.08); padding-top:10px; }
.filter-btn-all, .filter-btn-none, .filter-btn-close {
  padding:5px 14px; font-size:0.78rem; border-radius:4px; cursor:pointer; border:1px solid #555;
}
.filter-btn-all  { background:rgba(255,153,0,0.2); color:#f90; }
.filter-btn-none { background:rgba(255,255,255,0.06); color:#ccc; }
.filter-btn-close{ background:rgba(255,255,255,0.06); color:#ccc; margin-left:auto; }

/* =============================================
   履歴タブ
   ============================================= */
.history-event-card {
  border: 1px solid rgba(255,255,255,0.08); border-radius: 6px;
  padding: 8px 10px; margin-bottom: 6px;
  background: var(--card, #0a1931);
}
.history-event-date { font-size: 0.72rem; color: #bbb; margin-bottom: 6px; }
.history-badge {
  font-size: 0.6rem; background: #f90; color: #000;
  border-radius: 3px; padding: 1px 5px; margin-left: 6px; font-weight: bold;
}
.history-event-types { display: flex; gap: 6px; flex-wrap: wrap; }
.history-type-btn {
  font-size: 0.72rem; padding: 2px 10px; border-radius: 4px; cursor: pointer;
  border: 1px solid #555; background: rgba(255,255,255,0.07); color: #ddd;
  transition: background 0.15s;
}
.history-type-btn:hover { background: rgba(255,153,0,0.25); border-color: #f90; color: #fff; }

/* =============================================
   差分オーバーレイ
   ============================================= */
.hist-section { margin-bottom: 8px; }
.hist-section-header {
  font-size: 0.8rem; padding: 6px 10px; border-radius: 5px;
  cursor: pointer; user-select: none;
  border: 1px solid rgba(255,255,255,0.1);
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(255,255,255,0.05);
}
.hist-section-header:hover { background: rgba(255,255,255,0.1); }
.hist-section-header.added   { border-left: 3px solid #2ecc71; color: #2ecc71; }
.hist-section-header.removed { border-left: 3px solid #e74c3c; color: #e74c3c; }
.hist-section-header.changed { border-left: 3px solid #f39c12; color: #f39c12; }
.hist-section-body { padding: 4px 0 4px 6px; }
.hist-entry {
  font-size: 0.68rem; color: #ccc; padding: 4px 6px; border-radius: 3px;
  border-left: 2px solid rgba(255,255,255,0.15); margin: 3px 0;
  line-height: 1.5; background: rgba(255,255,255,0.03);
}
.hist-entry-period { opacity: 0.65; font-size: 0.62rem; }
.hist-entry-name   { color: #eee; }
.hist-entry-change { font-size: 0.62rem; color: #f39c12; margin-top: 2px; white-space: pre-wrap; }
.hist-no-prev { font-size: 0.75rem; color: #888; padding: 8px 4px; }

/* =============================================
   フィルターボタン
   ============================================= */
.filter-open-btn {
  background:none; border:1px solid #555; color:#ccc; font-size:0.78rem;
  padding:2px 10px; border-radius:4px; cursor:pointer; margin-left:4px;
}
.filter-open-btn:hover { border-color:#f90; color:#f90; }

/* =============================================
   スクショ確認オーバーレイ
   ============================================= */
#ss-confirm-overlay {
  display:none; position:fixed; inset:0; z-index:3000;
  background:rgba(0,0,0,0.7); align-items:center; justify-content:center;
}
#ss-confirm-overlay.show { display:flex; }
#ss-confirm-box {
  background:var(--card,#0a1931); border:1px solid var(--border,rgba(255,255,255,0.1));
  border-radius:12px; padding:24px 28px; min-width:280px; max-width:90vw; text-align:center;
}
#ss-confirm-msg { font-size:0.95rem; color:#eee; margin-bottom:18px; line-height:1.5; }
.ss-confirm-btns { display:flex; gap:12px; justify-content:center; }
.ss-btn-yes, .ss-btn-no {
  padding:8px 28px; border-radius:6px; font-size:0.9rem; cursor:pointer; border:none;
}
.ss-btn-yes { background:#f90; color:#000; font-weight:bold; }
.ss-btn-no  { background:rgba(255,255,255,0.12); color:#eee; }

/* =============================================
   カメラボタン
   ============================================= */
.camera-btn {
  background:none; border:1px solid #555; color:#ccc;
  font-size:1rem; padding:2px 8px; border-radius:4px;
  cursor:pointer; margin-left:4px; vertical-align:middle; line-height:1;
}
.camera-btn:hover { border-color:#f90; color:#f90; }

/* =============================================
   設定ボタン
   ============================================= */
.settings-btn {
  padding: 6px 18px; font-size: 0.82rem; cursor: pointer;
  border: 1px solid #555; border-radius: 4px;
  background: rgba(255,255,255,0.08); color: #eee; transition: background 0.2s;
  display: inline-block;
}
.settings-btn:hover { background: rgba(255,153,0,0.3); border-color: #f90; }

/* =============================================
   アップロードファイル名
   ============================================= */
.upload-filename {
  font-size: 0.75rem; color: #aaa; margin-left: 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px;
}

/* =============================================
   rawファイル一覧
   ============================================= */
.raw-file-item {
  display: flex; align-items: center; gap: 6px;
  padding: 3px 6px; border-radius: 3px; cursor: pointer;
}
.raw-file-item:hover { background: rgba(255,255,255,0.06); }
.raw-file-item input[type="checkbox"] { accent-color: #f90; flex-shrink: 0; }
.raw-file-label { font-size: 0.75rem; color: #ccc; }
.raw-file-group-header {
  font-size: 0.72rem; color: #f90; padding: 4px 6px 2px;
  border-bottom: 1px solid rgba(255,153,0,0.2); margin-bottom: 2px;
}
.all-section-header {
  font-size:0.85rem; color:#f90; border-top:1px solid rgba(255,153,0,0.3);
  border-bottom:1px solid rgba(255,153,0,0.3); padding:4px 8px;
  margin:12px 0 4px 0; letter-spacing:0.1em; text-align:center;
}

/* =============================================
   詳細スクショボタン
   ============================================= */
.overlay-ss-btn {
  padding:4px 12px; font-size:0.75rem; cursor:pointer;
  border:1px solid #555; border-radius:4px;
  background:rgba(255,255,255,0.08); color:#eee; transition:background 0.2s;
}
.overlay-ss-btn:hover { background:rgba(255,153,0,0.3); border-color:#f90; }

/* =============================================
   リスト
   ============================================= */
.list-panel {
  padding: 12px 0;
}
.list-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 0 12px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.1));
  margin-bottom: 12px;
}
.list-layout {
  display: grid;
  grid-template-columns: minmax(170px, 220px) 1fr;
  gap: 14px;
  align-items: start;
}
.list-list-panel,
.list-detail-panel {
  min-width: 0;
}
.list-list-title {
  font-size: 0.75rem;
  color: var(--muted, #aaa);
  margin-bottom: 7px;
}
.list-list-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.list-list-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  border: 1px solid var(--border, rgba(255,255,255,0.12));
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  color: var(--text-primary, #eee);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  padding: 9px 10px;
  text-align: left;
}
.list-list-btn:hover,
.list-list-btn.active {
  border-color: #f90;
  background: rgba(255,153,0,0.14);
}
.list-list-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-list-count {
  flex-shrink: 0;
  color: var(--muted, #aaa);
  font-size: 0.72rem;
}
.list-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.list-detail-title {
  font-size: 0.95rem;
  font-weight: bold;
  color: var(--text-primary, #eee);
}
.list-detail-count {
  font-size: 0.72rem;
  color: var(--muted, #aaa);
  margin-top: 2px;
}
.list-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.list-select,
.list-input {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary, #eee);
  border: 1px solid var(--border, rgba(255,255,255,0.12));
  border-radius: 6px;
  padding: 7px 9px;
  font: inherit;
  font-size: 0.82rem;
  min-height: 34px;
}
.list-select {
  min-width: 160px;
}
.list-input {
  min-width: 180px;
}
.list-action-btn,
.list-remove-btn {
  border: 1px solid var(--border, rgba(255,255,255,0.14));
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  color: var(--text-primary, #eee);
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  padding: 7px 10px;
}
.list-action-btn:hover,
.list-remove-btn:hover {
  border-color: #f90;
  color: #f90;
}
.list-status {
  min-height: 18px;
  font-size: 0.78rem;
  color: var(--muted, #aaa);
  white-space: pre-wrap;
}
.list-empty {
  color: var(--muted, #aaa);
  font-size: 0.86rem;
  padding: 18px 0;
}
.list-empty.compact {
  padding: 8px 0;
  font-size: 0.78rem;
}
.list-events {
  min-height: 40px;
}
.list-card-wrap {
  position: relative;
}
.list-card-wrap .event-card {
  padding-right: 58px !important;
}
.list-card-remove {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  border: 1px solid var(--border, rgba(255,255,255,0.14));
  border-radius: 6px;
  background: rgba(0,0,0,0.18);
  color: var(--muted, #aaa);
  cursor: pointer;
  font: inherit;
  font-size: 0.68rem;
  padding: 4px 7px;
}
.list-card-remove:hover {
  border-color: #f90;
  color: #f90;
}
.list-broken-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--muted, #aaa);
  font-size: 0.82rem;
}
.list-items {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.list-event-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  border-left: 4px solid var(--orange-light, #ffb347);
  background: var(--card, #0a1931);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
}
.list-event-row:hover {
  border-color: var(--accent, #f90);
}
.list-event-main {
  flex: 1;
  min-width: 0;
}
.list-event-title {
  color: var(--text-primary, #eee);
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-event-meta {
  color: var(--muted, #aaa);
  font-size: 0.72rem;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-remove-btn {
  flex-shrink: 0;
}
.list-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2600;
  background: rgba(0,0,0,0.66);
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.list-modal-backdrop.show {
  display: flex;
}
.list-modal-panel {
  width: min(92vw, 460px);
  background: var(--card, #0a1931);
  color: var(--text-primary, #eee);
  border: 1px solid var(--border, rgba(255,255,255,0.14));
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow, 0 10px 28px rgba(0,0,0,0.35));
}
.list-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.list-modal-title {
  font-weight: bold;
  font-size: 0.92rem;
}
.list-modal-close {
  border: none;
  background: transparent;
  color: var(--muted, #aaa);
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
}
.list-modal-close:hover {
  color: var(--text-primary, #eee);
}
.list-preview {
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  border-radius: 6px;
  padding: 8px;
  margin: 10px 0;
  color: var(--text-primary, #eee);
  font-size: 0.82rem;
  line-height: 1.5;
  word-break: break-word;
}
.list-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

@media (max-width: 720px) {
  .container {
    max-width: calc(100% - 16px);
    padding-top: 10px;
  }
  .header {
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    padding: 8px 0 10px;
  }
  .header-left {
    gap: 7px;
  }
  #logo {
    width: 42px;
    height: 42px;
  }
  .site-title {
    font-size: 19px;
  }
  .nav {
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
  }
  .nav a,
  .try-btn {
    font-size: 12px;
    white-space: nowrap;
  }
  .event-card {
    gap: 3px !important;
    min-height: 27px !important;
    padding: 2px 4px !important;
    margin-bottom: 3px !important;
    border-left-width: 3px;
    border-radius: 7px;
  }
  .card-body {
    min-width: 0;
    overflow: hidden;
  }
  .card-period {
    font-size: 0.5rem !important;
    white-space: nowrap;
  }
  .card-name {
    font-size: 0.59rem !important;
    line-height: 1.18 !important;
  }
  .card-tag,
  .gacha-type-tag,
  .stage-tag {
    max-width: 58px;
    overflow: hidden;
    padding: 0 3px !important;
    font-size: 0.43rem !important;
    line-height: 1.2;
    text-overflow: ellipsis;
  }
  #mission .event-card {
    gap: 3px !important;
  }
  #mission .card-name br {
    display: none;
  }
  #mission .stage-tag {
    max-width: 46px;
  }
  .list-layout {
    grid-template-columns: 1fr;
  }
  .list-detail-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .list-detail-actions {
    justify-content: flex-start;
  }
  .overlay-action-row {
    gap: 5px;
    margin-bottom: 10px;
  }
  .overlay-tags .card-tag,
  .overlay-tags .gacha-type-tag,
  .overlay-tags .stage-tag,
  .overlay-feature-tag {
    max-width: none;
    font-size: 0.5rem !important;
  }
  .overlay-same-list .event-card {
    min-height: 26px !important;
  }
}

/* =============================================
   設定タブ
   ============================================= */
.settings-section {
  padding: 16px;
  background: var(--card, #0a1931);
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  border-radius: 8px;
  margin-bottom: 12px;
}
.settings-section h3 {
  font-size: 0.95rem;
  color: var(--text-primary, #eee);
  margin: 0 0 12px 0;
}
.settings-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 6px 0;
}
.settings-label {
  font-size: 0.82rem;
  color: #aaa;
  min-width: 160px;
}
.settings-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  cursor: pointer;
  font-size: 0.8rem;
}
.settings-toggle input {
  width: 17px;
  height: 17px;
  accent-color: var(--orange);
}
.settings-note {
  color: var(--muted);
  font-size: 0.7rem;
}
.viewer-section {
  border-left: 4px solid var(--orange);
}
.viewer-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  padding: 12px 14px;
}
.viewer-main {
  display: grid;
  gap: 4px;
}
.viewer-label {
  color: var(--muted);
  font-size: 0.74rem;
}
.viewer-count {
  color: var(--text);
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
}
.viewer-unit {
  margin-left: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}
.viewer-sub {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 0.68rem;
  text-align: right;
}
.share-builder-section {
  border-left: 4px solid rgba(243, 152, 0, 0.55);
}
.share-builder-help {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.7;
  margin-bottom: 10px;
}
.share-builder-shortcuts,
.share-builder-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 10px;
}
.share-builder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  align-items: end;
}
.share-builder-field,
.share-builder-check {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.72rem;
}
.share-builder-field select,
.share-builder-input,
.share-builder-output {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
  color: var(--input-color);
  font: inherit;
  font-size: 0.78rem;
  padding: 7px 9px;
}
.share-builder-output {
  resize: vertical;
  min-height: 70px;
  line-height: 1.55;
  word-break: break-all;
}
.share-builder-list-param {
  grid-column: 1 / -1;
}
.share-builder-check {
  align-self: center;
  grid-template-columns: auto 1fr;
  align-items: center;
  margin-top: 20px;
}
.share-builder-check input {
  width: 17px;
  height: 17px;
  accent-color: var(--orange);
}
.share-builder-open {
  text-decoration: none;
}
.share-mini-btn {
  padding-inline: 10px;
  font-size: 0.74rem;
}
.share-builder-status {
  min-height: 1.6em;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.6;
  white-space: pre-wrap;
}
.share-builder-status.ok {
  color: #4ade80;
}
.share-builder-status.warn {
  color: #f8b84e;
}
.share-builder-status.error {
  color: #ff8a8a;
}
.share-builder-hidden {
  display: none !important;
}
@media (max-width: 520px) {
  .viewer-card {
    align-items: flex-start;
    flex-direction: column;
  }
  .viewer-sub {
    text-align: left;
  }
}
.ss-preview-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 3600;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.78);
  padding: 12px;
}
.ss-preview-overlay.show {
  display: flex;
}
.ss-preview-panel {
  width: min(94vw, 760px);
  max-height: 94vh;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  padding: 12px;
  color: var(--text);
}
.ss-preview-head,
.ss-preview-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ss-preview-panel p {
  margin: 8px 0;
  color: var(--muted);
  font-size: 0.78rem;
}
#ss-preview-image {
  display: block;
  width: 100%;
  max-height: 68vh;
  object-fit: contain;
  border: 1px solid var(--border);
  background: var(--bg);
}
.ss-preview-actions {
  justify-content: flex-end;
  margin-top: 10px;
}

/* =============================================
   Developer TSV editor
   ============================================= */
.dev-only { display: none; }
.dev-editor-head {
  display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap;
  margin-bottom:10px;
}
.dev-badge {
  font-size:0.68rem; color:#000; background:#f90; border-radius:3px; padding:2px 7px;
  font-weight:bold; letter-spacing:0.03em;
}
.dev-sheet-tabs { display:flex; gap:6px; flex-wrap:wrap; margin:8px 0; }
.dev-sheet-tab {
  border:1px solid #555; border-radius:4px; padding:4px 9px; cursor:pointer;
  color:#ccc; background:rgba(255,255,255,0.06); font-size:0.74rem;
}
.dev-sheet-tab.active { color:#000; background:#f90; border-color:#f90; font-weight:bold; }
.dev-toolbar {
  display:flex; align-items:center; gap:6px; flex-wrap:wrap;
  padding:8px; border:1px solid rgba(255,255,255,0.08); border-radius:6px;
  background:rgba(0,0,0,0.12); margin:8px 0;
}
.dev-mini-btn {
  padding:4px 9px; font-size:0.72rem; border-radius:4px; cursor:pointer;
  border:1px solid #555; background:rgba(255,255,255,0.07); color:#ddd;
}
.dev-mini-btn:hover { border-color:#f90; color:#f90; }
.dev-mini-btn:disabled { opacity:.35; cursor:not-allowed; }
.dev-input, .dev-select {
  font-size:0.76rem; padding:4px 7px; border-radius:4px; border:1px solid #555;
  background:var(--bg-secondary,#222); color:var(--text-primary,#eee);
}
.dev-search { width:min(260px,70vw); }
.dev-editor-frame {
  height:460px; border:1px solid rgba(255,255,255,0.16); border-radius:8px;
  overflow: auto; background:rgba(0,0,0,0.22); position:relative;
  contain: layout style paint; scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: auto;
}
#dev-sheet-viewport {
  transform-origin: top left; padding:0 0 120px 0;
  display:block;
  overflow: visible;
  -webkit-overflow-scrolling: touch;
}
.dev-sheet-table { border-collapse:collapse; table-layout:fixed; font-family:Consolas, monospace; font-size: calc(12px * var(--dev-zoom, 1)); width: max-content; }
.dev-sheet-table th {
  position:sticky; top:0; z-index:4; background:#18243a; color:#aaa;
  border:1px solid rgba(255,255,255,0.12); height:24px; min-width:46px; max-width:46px;
  font-weight:normal; text-align:center;
}
.dev-sheet-table .dev-row-head { left:0; z-index:5; min-width:46px; max-width:46px; }
.dev-cell {
  width: calc(80px * var(--dev-zoom, 1)); min-width: calc(80px * var(--dev-zoom, 1)); max-width: calc(80px * var(--dev-zoom, 1)); height: calc(24px * var(--dev-zoom, 1)); max-height: calc(24px * var(--dev-zoom, 1));
  border:1px solid rgba(255,255,255,0.10); padding:2px 5px;
  color:#e9eef8; background:rgba(255,255,255,0.025); overflow:hidden;
  white-space:nowrap; outline:none; vertical-align:top; box-sizing:border-box;
}
.dev-cell:hover { background:rgba(255,255,255,0.07); }
.dev-cell.dev-selected { box-shadow:inset 0 0 0 2px #f90; background:rgba(255,153,0,0.12); }
.dev-cell:focus {
  position:absolute; z-index:10;
  height: calc(24px * var(--dev-zoom, 1)) !important;
  max-height: calc(24px * var(--dev-zoom, 1)) !important;
  min-width: calc(260px * var(--dev-zoom, 1));
  background:#121b2d;
  box-shadow:0 4px 16px rgba(0,0,0,.6), inset 0 0 0 2px #f90;
  transform:translate(-2px, -2px);
}
.dev-cell:focus::before {
  content:''; position:absolute; inset:0; z-index:-1;
  background:rgba(255,153,0,.08);
}
.dev-virtual-tbody { contain:strict; }

/* Virtual Scrolling */
.dev-virtual-tbody { will-change: transform; contain: layout style; }
.dev-row-buffer { height: 24px !important; }

.dev-cell.dev-search-hit { background:rgba(255,220,0,0.20); box-shadow:inset 0 0 0 1px rgba(255,220,0,0.65); }
.dev-cell.dev-search-current { background:rgba(255,153,0,0.45); box-shadow:inset 0 0 0 2px #fff; }
.dev-editor-foot { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-top:10px; }
.dev-status { font-size:0.76rem; color:#aaa; }
#dev-save-overlay {
  display:none; position:fixed; inset:0; z-index:3200; background:rgba(0,0,0,0.72);
  align-items:center; justify-content:center;
}
#dev-save-overlay.show { display:flex; }
#dev-save-panel {
  width:min(92vw,420px); background:var(--card,#0a1931); color:var(--text-primary,#eee);
  border:1px solid var(--border,rgba(255,255,255,0.14)); border-radius:12px; padding:18px;
}
#dev-save-panel h4 { margin:0 0 12px; font-size:0.92rem; }
.dev-save-actions { display:flex; justify-content:flex-end; gap:8px; flex-wrap:wrap; margin-top:14px; }
[data-theme="light"] .dev-editor-frame { background:#f6f7f9; border-color:rgba(0,0,0,0.12); }
[data-theme="light"] .dev-toolbar { background:rgba(0,0,0,0.035); border-color:rgba(0,0,0,0.08); }
[data-theme="light"] .dev-cell { color:#222; background:#fff; border-color:rgba(0,0,0,0.12); }
[data-theme="light"] .dev-cell:focus { background:#fff7e8; }
[data-theme="light"] .dev-sheet-table th { background:#e8eaed; color:#444; }

/* =============================================
   その他
   ============================================= */
#utc-select { font-size: 0.8rem; padding: 3px 6px; }
