:root {
  --bg: #0d1210;
  --surface: #141b17;
  --surface-2: #1b241e;
  --border: #26332c;
  --text: #e7efe9;
  --muted: #82978b;
  --accent: #29c281;       /* emerald */
  --accent-strong: #1ba76b;
  --accent-ink: #74e0b1;
  --danger: #e0565c;
  --radius: 4px;
  --radius-sm: 3px;
  --display: "Zen Kaku Gothic New", "Inter", sans-serif;
  --body: "Inter", "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--body);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* 白ドットグリッドは固定レイヤーに置き、transformでドリフトさせる。
   background-position アニメと違い再描画が起きずGPU合成のみなので軽い。カードは不透明なので点は余白にだけ出る。 */
body::before {
  content: "";
  position: fixed;
  inset: -24px;            /* translate分を見越して外側を広げ、端に隙間が出ないようにする */
  z-index: -1;             /* 全コンテンツの背面・背景色の前面 */
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1.5px);
  background-size: 22px 22px;
  animation: dot-drift 22s linear infinite;
}
/* 1タイル(22px)ぶん動いてシームレスにループ */
@keyframes dot-drift {
  from { transform: translate(0, 0); }
  to   { transform: translate(22px, 22px); }
}
/* モーション低減設定のユーザーには静止 */
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
}

h1, h2, h3, .brand { font-family: var(--display); }

a { color: inherit; text-decoration: none; }
a.link { color: var(--accent-ink); }
a.link:hover { text-decoration: underline; }
.ic { vertical-align: -2px; flex-shrink: 0; }
.search-ic { display: inline-flex; }

/* ---------- Header ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 58px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.brand { font-weight: 900; font-size: 1.35rem; letter-spacing: -.02em; color: var(--text); }
.brand b { color: var(--accent); font-weight: 900; }
.site-header nav { display: flex; align-items: center; gap: 18px; font-size: .92rem; }
.site-header nav a:hover { color: var(--accent-ink); }
.site-header .user { color: var(--muted); }

.container { max-width: 1040px; margin: 0 auto; padding: 28px 20px 64px; }

/* ---------- Buttons ---------- */
.btn, .btn-ghost, .btn-danger {
  display: inline-block; padding: 8px 16px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer; font-size: .9rem; font-family: inherit; font-weight: 700;
  transition: background .12s, border-color .12s, color .12s;
}
.btn { background: var(--accent); color: #06140d; }
.btn:hover { background: var(--accent-strong); }
.btn.large { padding: 11px 22px; font-size: 1rem; }
.btn.join { background: var(--accent); color: #06140d; }
.btn.join:hover { background: var(--accent-strong); }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--muted); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }

/* ---------- Hero ---------- */
.hero { padding: 18px 0 26px; margin-bottom: 22px; border-bottom: 1px solid var(--border); }
.hero h1 { margin: 0 0 6px; font-size: 2.1rem; font-weight: 900; letter-spacing: -.02em; line-height: 1.2; }
.hero h1 .em { color: var(--accent); }
.hero p { color: var(--muted); margin: 0 0 18px; font-size: .95rem; }
.search { display: flex; align-items: center; gap: 8px; max-width: 460px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 4px 4px 12px; }
.search:focus-within { border-color: var(--accent); }
.search-ic { color: var(--muted); }
.search input { flex: 1; padding: 8px; border: none; background: transparent; color: var(--text); outline: none; font-size: .92rem; font-family: inherit; }
.search button { padding: 8px 16px; border-radius: var(--radius-sm); border: none; background: var(--accent); color: #06140d; cursor: pointer; font-weight: 700; }
.search button:hover { background: var(--accent-strong); }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: 190px 1fr; gap: 24px; align-items: start; }
.sidebar { position: sticky; top: 24px; min-width: 0; }
.sidebar h3 { margin: 0 0 10px; font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 700; }
.cat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.cat-list a { display: block; padding: 7px 11px; border-radius: var(--radius-sm); color: var(--muted); font-size: .9rem; border-left: 2px solid transparent; }
.cat-list a:hover { background: var(--surface); color: var(--text); }
.cat-list a.active { background: var(--surface); color: var(--text); border-left-color: var(--accent); }

/* ---------- Server cards ---------- */
.listing { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: border-color .12s; min-width: 0; }
.card:hover { border-color: var(--accent); }
.card-banner { height: 52px; background: hsl(var(--h, 150) 16% 13%); position: relative; border-bottom: 1px solid var(--border); }
.rank { position: absolute; top: 8px; right: 10px; font-family: var(--display); font-weight: 900; font-size: .8rem;
  color: var(--muted); background: rgba(0,0,0,.35); padding: 2px 9px; border-radius: var(--radius-sm); }
.rank-0 { background: var(--accent); color: #06140d; }
.card-icon { position: absolute; top: 22px; left: 16px; width: 56px; height: 56px; border-radius: var(--radius);
  border: 3px solid var(--surface); overflow: hidden; background: var(--surface-2); }
.card-icon img, .detail-icon img { width: 100%; height: 100%; object-fit: cover; }
.ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 900; color: var(--text);
  background: hsl(var(--h, 150) 18% 24%); font-size: 1.5rem; }
.card-body { padding: 12px 16px 4px 84px; min-height: 40px; }
.card-body h2 { margin: 0 0 3px; font-size: 1.08rem; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; word-break: break-word; }
.card-body h2 a:hover { color: var(--accent-ink); }
.card-body .desc { margin: 0 0 9px; color: var(--muted); font-size: .9rem; white-space: pre-line;
  overflow-wrap: anywhere; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px 14px; min-width: 0; }
.badges { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; color: var(--muted); font-size: .82rem; min-width: 0; }
.stat { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot.green { background: var(--accent); }
.dot.grey { background: #5e6f64; }
.tag { display: inline-block; padding: 2px 9px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); font-size: .77rem; }
.tag:hover { color: var(--accent-ink); }
.tag.small { padding: 1px 7px; font-size: .72rem; }

.empty { color: var(--muted); text-align: center; padding: 44px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }

/* 星(表示用・部分塗り対応) */
.stars { position: relative; display: inline-block; white-space: nowrap; line-height: 1; font-size: .95rem; vertical-align: -1px; }
.stars.sm { font-size: .85rem; }
.stars-bg { color: #4a505e; }
.stars-fill { position: absolute; left: 0; top: 0; overflow: hidden; color: #f5b301; }

/* レビュー */
.reviews { max-width: 720px; margin: 18px auto 0; }
.reviews h2 { font-size: 1.2rem; }
.rev-avg { color: #f5b301; font-size: .95rem; font-weight: 700; margin-left: 6px; }
.review-form { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.review-form textarea { padding: 9px 11px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-family: inherit; }
.review-form .btn { align-self: flex-start; }
.review-delete { margin: 8px 0 4px; }
.star-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; }
.star-input input { display: none; }
.star-input label { font-size: 1.9rem; color: #4a505e; cursor: pointer; padding: 0 2px; transition: color .08s; }
.star-input label:hover, .star-input label:hover ~ label,
.star-input input:checked ~ label { color: #f5b301; }
.review-list { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-direction: column; gap: 12px; }
.review-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.review-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; min-width: 0; }
.rev-ava img, .rev-ava .ava-ph { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; display: flex; align-items: center; justify-content: center; background: var(--surface-2); font-weight: 700; flex-shrink: 0; }
.rev-name { font-weight: 700; overflow-wrap: anywhere; min-width: 0; }
.review-comment { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-form textarea, .report-form textarea { width: 100%; max-width: 100%; }

/* ---------- Detail ---------- */
.detail-card { max-width: 720px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.detail-banner { height: 104px; background: hsl(var(--h, 150) 16% 13%); position: relative; border-bottom: 1px solid var(--border); }
.detail-icon { position: absolute; left: 24px; bottom: -28px; width: 84px; height: 84px; border-radius: var(--radius); border: 4px solid var(--surface); overflow: hidden; background: var(--surface-2); }
.detail-content { padding: 40px 24px 24px; }
.detail-content h1 { margin: 0 0 10px; font-size: 1.5rem; font-weight: 900; letter-spacing: -.01em; overflow-wrap: anywhere; word-break: break-word; }
.detail-content .badges { margin-bottom: 12px; }
.detail-content .tags { margin-bottom: 14px; }
.detail-desc { color: var(--text); white-space: pre-wrap; margin: 12px 0 16px; overflow-wrap: anywhere; word-break: break-word; }
.detail-action { margin: 16px 0; }
.back-link { max-width: 720px; margin: 14px auto 0; }
.back-link a { color: var(--muted); }
.back-link a:hover { color: var(--text); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ---------- Report ---------- */
.report-box { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 14px; }
.report-box summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.report-box summary:hover { color: var(--text); }
.report-form { display: flex; flex-direction: column; gap: 8px; max-width: 460px; margin-top: 10px; }
.report-form textarea { padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-family: inherit; }
.report-done { color: var(--accent); display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Dashboard / forms ---------- */
.dash-section { background: var(--surface); border: 1px solid var(--border); padding: 20px; border-radius: var(--radius); margin-bottom: 18px; }
.dash-section h2 { margin-top: 0; font-size: 1.15rem; font-weight: 700; }
.owned-list { list-style: none; padding: 0; margin: 0; }
.owned-card { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.owned-name { flex: 1; font-weight: 700; }
.owned-actions { display: flex; align-items: center; gap: 8px; }
.owned-actions form { margin: 0; }
.bot-add { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--muted); margin-bottom: 16px; background: var(--surface-2); padding: 12px 14px; border-radius: var(--radius); font-size: .9rem; }
.register-form { display: flex; flex-direction: column; gap: 12px; max-width: 520px; }
.register-form label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: .88rem; }
.register-form input, .register-form textarea, .register-form select { padding: 9px 11px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-family: inherit; font-size: .93rem; }
.register-form input:focus, .register-form textarea:focus, .register-form select:focus { outline: none; border-color: var(--accent); }
.hint { color: var(--muted); font-size: .84rem; }
.nsfw-badge { display: inline-block; vertical-align: middle; font-size: .68rem; font-weight: 700; letter-spacing: .04em;
  color: #fff; background: var(--danger); padding: 2px 7px; border-radius: 5px; }
.check-label { flex-direction: row !important; align-items: center; gap: 8px; color: var(--text) !important; cursor: pointer; }
.check-label input { width: auto; }

/* モダンなタグ入力(チップ + 候補) */
.tag-input {
  position: relative;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 7px 9px; min-height: 42px;
  border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2);
  cursor: text;
}
.tag-input:focus-within { border-color: var(--accent); }
.tag-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--accent); color: #06140d; font-weight: 700; font-size: .82rem;
  padding: 3px 6px 3px 10px; border-radius: 999px; line-height: 1.4;
}
.tag-x {
  border: none; background: rgba(0,0,0,.25); color: #06140d;
  width: 16px; height: 16px; border-radius: 50%; cursor: pointer;
  font-size: 13px; line-height: 1; display: flex; align-items: center; justify-content: center; padding: 0;
}
.tag-x:hover { background: rgba(0,0,0,.45); color: #fff; }
.tag-entry {
  flex: 1; min-width: 90px; border: none; outline: none; background: transparent;
  color: var(--text); font-family: inherit; font-size: .92rem; padding: 3px 2px;
}
.tag-entry.tag-warn::placeholder { color: var(--danger); }

.tag-ac-menu {
  position: absolute; left: -1px; right: -1px; top: calc(100% + 3px); z-index: 30;
  background: var(--surface-2); border: 1px solid var(--accent);
  border-radius: var(--radius-sm); max-height: 220px; overflow-y: auto; display: none;
}
.tag-ac-item { padding: 8px 11px; cursor: pointer; font-size: .9rem; color: var(--text); }
.tag-ac-item:hover, .tag-ac-item.active { background: var(--surface); color: var(--accent-ink); }
code { background: var(--surface-2); padding: 1px 6px; border-radius: var(--radius-sm); color: var(--accent-ink); }

/* ---------- Admin ---------- */
.admin-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 9px; }
.admin-row { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 12px; background: var(--surface-2); border-radius: var(--radius); }
.admin-row.resolved { opacity: .5; }
.admin-row-main { flex: 1; min-width: 0; }
.admin-row-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.admin-row-actions form { margin: 0; }
.report-reason { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.user-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-row strong { overflow-wrap: anywhere; }
.user-ava img, .ava-ph { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; display: flex; }
.ava-ph { align-items: center; justify-content: center; background: var(--surface); color: var(--text); font-weight: 700; font-family: var(--display); }
.badge { display: inline-block; padding: 1px 8px; border-radius: var(--radius-sm); font-size: .72rem; margin-left: 6px; background: var(--surface); color: var(--muted); }
.badge-open { background: var(--danger); color: #fff; }
.badge-ok { background: var(--accent); color: #06140d; }
.admin-tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 9px; }
.admin-tag { display: flex; align-items: center; gap: 6px; background: var(--surface-2); padding: 6px 10px; border-radius: var(--radius); }
.admin-tag form { margin: 0; }
.small-btn { padding: 2px 8px; font-size: .75rem; }

/* ---------- Legal pages ---------- */
.legal { max-width: 760px; margin: 0 auto; }
.legal h1 { font-size: 1.7rem; font-weight: 900; margin: 0 0 4px; }
.legal h2 { font-size: 1.1rem; font-weight: 700; margin: 28px 0 8px; padding-top: 4px; border-top: 1px solid var(--border); }
.legal h2:first-of-type { border-top: none; }
.legal p, .legal li { color: var(--text); }
.legal ul { padding-left: 1.2em; }
.legal li { margin: 4px 0; }
.legal-updated { color: var(--muted); font-size: .85rem; margin: 0 0 20px; }
.legal-foot { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--border); color: var(--muted); }

/* ---------- Pagination ---------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 22px 0 4px; }
.pager-btn { padding: 8px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); color: var(--text); font-size: .9rem; }
.pager-btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.pager-btn.disabled { color: #555c69; border-color: var(--border-soft); pointer-events: none; }
.pager-info { color: var(--muted); font-size: .88rem; }

/* ---------- Admin overview / search ---------- */
.admin-nav { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.admin-card { flex: 1; min-width: 160px; display: flex; align-items: center; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; font-weight: 700; }
.admin-card:hover { border-color: var(--accent); }
.admin-card-n { font-family: var(--display); font-size: 1.3rem; color: var(--accent); }
.admin-search { display: flex; gap: 8px; margin-bottom: 18px; max-width: 520px; }
.admin-search input { flex: 1; padding: 9px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-family: inherit; }
.admin-search input:focus { outline: none; border-color: var(--accent); }
.admin-search button { padding: 9px 18px; border-radius: var(--radius-sm); border: none; background: var(--accent); color: #06140d; font-weight: 700; cursor: pointer; }

/* ---------- Footer ---------- */
.site-footer { text-align: center; color: var(--muted); padding: 26px; font-size: .82rem; border-top: 1px solid var(--border); margin-top: 26px; }
.footer-links { display: flex; justify-content: center; gap: 18px; margin-bottom: 10px; }
.footer-links a:hover { color: var(--accent-ink); }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .container { padding: 20px 14px 56px; }
  .layout { grid-template-columns: 1fr; gap: 16px; }
  .sidebar { position: static; }
  .sidebar h3 { display: none; }
  /* カテゴリは横スクロールのチップに */
  .cat-list { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; gap: 6px; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .cat-list a { white-space: nowrap; border-left: none; border-radius: 999px; background: var(--surface); }
  .cat-list a.active { border-left: none; box-shadow: none; background: var(--surface-2); color: var(--accent-ink); }
  .card-foot { flex-direction: column; align-items: stretch; gap: 10px; }
  .card-foot .btn.join { text-align: center; }
  .hero h1 { font-size: 1.55rem; }
  /* 管理パネルの行を縦積みに */
  .admin-row { flex-direction: column; }
  .admin-row-actions { flex-direction: row; flex-wrap: wrap; }
  .owned-card { flex-wrap: wrap; }
  .register-form { max-width: none; }
}

@media (max-width: 520px) {
  /* ヘッダーは折り返し可・ユーザー名は非表示 */
  .site-header { height: auto; min-height: 52px; padding: 8px 14px; flex-wrap: wrap; gap: 8px 14px; }
  .site-header nav { gap: 14px; font-size: .88rem; }
  .site-header .user { display: none; }
  .container { padding: 16px 12px 48px; }
  .hero { padding: 12px 0 20px; }
  .hero h1 { font-size: 1.35rem; }
  .card-icon { width: 50px; height: 50px; top: 24px; left: 14px; }
  .card-body { padding: 12px 14px 4px 76px; }
  .detail-content { padding: 34px 16px 20px; }
  .detail-content h1 { font-size: 1.25rem; }
  .detail-icon { width: 72px; height: 72px; bottom: -24px; left: 18px; }
  .legal h1 { font-size: 1.4rem; }
  /* レビュー */
  .reviews { margin-top: 14px; }
  .reviews h2 { font-size: 1.05rem; }
  .review-form { padding: 13px; }
  .star-input label { font-size: 1.7rem; padding: 0 1px; }
  .badges { gap: 8px 12px; }
  .stat { font-size: .78rem; }
}

/* ---------- アクセス統計ダッシュボード ---------- */
.stat-tiles {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 6px 0 26px;
}
.stat-tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0;
}
.stat-num { font-family: var(--display); font-weight: 900; font-size: 1.9rem; color: var(--accent-ink); line-height: 1.1; letter-spacing: -.02em; }
.stat-lbl { color: var(--muted); font-size: .82rem; }

/* 世界地図(コロプレス) */
.access-map {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px; overflow: hidden;
}
.access-map svg { display: block; width: 100%; height: auto; }
.access-map svg path { fill: var(--surface-2); stroke: var(--border); stroke-width: .3; transition: fill .1s, filter .1s; }
.access-map svg path:hover { filter: brightness(1.35); }
.map-legend { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.legend-bar {
  flex: 1; max-width: 260px; height: 10px; border-radius: 5px; border: 1px solid var(--border);
  background: linear-gradient(90deg, hsl(158 45% 30%), hsl(158 73% 75%));
}

/* 30日トレンド */
.trend {
  display: flex; align-items: flex-end; gap: 3px; height: 140px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 12px 6px; overflow-x: auto;
}
.tcol { flex: 1; min-width: 12px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.tbar { width: 70%; min-height: 2px; background: var(--accent); border-radius: 2px 2px 0 0; transition: background .1s; }
.tcol:hover .tbar { background: var(--accent-ink); }
.tlbl { font-size: .58rem; color: var(--muted); margin-top: 4px; white-space: nowrap; transform: rotate(-45deg); transform-origin: center; height: 14px; }

/* 国別ランキング */
.rank-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.rank-row { display: flex; align-items: center; gap: 10px; }
.rank-code { width: 44px; color: var(--muted); font-size: .85rem; flex-shrink: 0; }
.rank-track { flex: 1; height: 12px; background: var(--surface-2); border-radius: 6px; overflow: hidden; min-width: 0; }
.rank-fill { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.rank-num { width: 60px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; flex-shrink: 0; }

/* ---------- NSFW 切替リンク・警告 ---------- */
.nsfw-switch { margin: 14px 0 0; font-size: .9rem; }
.nsfw-switch a { color: var(--muted); }
.nsfw-switch a:hover { color: var(--accent-ink); }
.nsfw-warn {
  color: var(--muted); font-size: .92rem; max-width: 60ch;
  border-left: 3px solid var(--danger); padding: 4px 0 4px 12px; margin: 6px 0 14px;
}
.nsfw-warn a { color: var(--accent-ink); }

/* ---------- 更新履歴(releases) ---------- */
.release-ver { font-family: var(--display); font-weight: 900; color: var(--accent-ink); }
.release-date { color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; }
.site-footer .ver { color: var(--muted); }
.site-footer .ver:hover { color: var(--accent-ink); }

/* 一覧(タイトルのみ) */
.release-list { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-direction: column; gap: 10px; }
.release-item a {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 18px; transition: border-color .12s, background .12s;
}
.release-item a:hover { border-color: var(--muted); background: var(--surface-2); }
.release-item .release-ver { font-size: 1rem; }
.release-item-title { flex: 1; min-width: 0; font-weight: 700; }
.release-item a:hover .release-item-title { color: var(--accent-ink); }

/* 個別ページ */
.release-full { margin-top: 8px; }
.release-full .release-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.release-full .release-ver { font-size: 1.15rem; }
.release-full h1 { margin: 0 0 18px; }
.edit-link { color: var(--accent-ink); font-size: .85rem; margin-left: auto; }
.release-body { font-size: .96rem; line-height: 1.85; }
.release-body p { margin: 0 0 1em; }
.rel-img-link { display: block; margin: 18px 0; }
.rel-img {
  display: block; max-width: min(100%, 460px); max-height: 400px; height: auto; margin: 0 auto;
  border: 1px solid var(--border); border-radius: var(--radius); cursor: zoom-in;
}

/* 管理フォーム */
.rel-form { display: flex; flex-direction: column; gap: 16px; max-width: 720px; margin-top: 20px; }
.rel-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: .9rem; }
.rel-form label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
.rel-form input[type=text], .rel-form input[type=url], .rel-form textarea {
  font: inherit; font-weight: 400; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border); color: var(--text); width: 100%;
}
.rel-form textarea { resize: vertical; line-height: 1.6; }
.form-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rel-form .hint { color: var(--muted); font-size: .82rem; margin: -6px 0 0; }
.rel-form .hint code, .release-body code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 3px; padding: 1px 5px; font-size: .85em; }
.form-actions { display: flex; gap: 10px; align-items: center; }
.upload-widget { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -6px 0 0; }
.upload-widget input[type=file] { font-size: .82rem; color: var(--muted); max-width: 100%; }

@media (max-width: 640px) {
  .stat-tiles { grid-template-columns: repeat(2, 1fr); }
  .stat-num { font-size: 1.5rem; }
  .tlbl { display: none; }
  .trend { height: 110px; }
}
