:root {
  --primary: #FF6600;
  --primary-dark: #cc5200;
  --bg: #0a0a0f;
  --bg2: #12121a;
  --bg3: #1a1a26;
  --border: #2a2a3a;
  --text: #e8e8f0;
  --text2: #9090a8;
  --accent: #00d4ff;
  --danger: #ff4444;
  --success: #44cc88;
  --radius: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.5);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Hiragino Sans', 'Noto Sans JP', 'Meiryo', sans-serif;
  line-height: 1.7;
  font-size: 15px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--primary); }

/* ── Navbar ── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,10,15,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex; align-items: center; gap: 24px;
  height: 64px;
}
.navbar-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.3rem; font-weight: 800;
  color: var(--text); text-decoration: none;
}
/* ── Logo Icon ── */
/* 将来画像に差し替えるときはここだけ編集すればOK */
.logo-icon {
  display: inline-block;
  line-height: 1;
  vertical-align: middle;
}
.logo-icon::before {
  content: "🎯";
  font-size: 1.8rem;          /* navbar デフォルトサイズ */
}
.auth-logo .logo-icon {
  display: block;
  margin-bottom: 8px;
}
.auth-logo .logo-icon::before  { font-size: 2.5rem; }    /* ログイン/登録ページ */
.admin-sidebar-brand .logo-icon::before { font-size: 1.4rem; } /* 管理サイドバー */

/* ────────────────────────────────────────────────────────────────
   画像ロゴに切り替える場合: 上の .logo-icon::before ブロックを
   全部削除して、以下をコメントアウト解除するだけ
   ────────────────────────────────────────────────────────────────
.logo-icon::before { content: none; }
.logo-icon {
  background: url('/images/logo.png') center / contain no-repeat;
  width: 32px; height: 32px;
}
.auth-logo .logo-icon          { width: 48px; height: 48px; }
.admin-sidebar-brand .logo-icon { width: 22px; height: 22px; }
──────────────────────────────────────────────────────────────── */
.navbar-brand span em { color: var(--primary); font-style: normal; }

.navbar-cats { display: flex; gap: 4px; flex: 1; }
.navbar-cats a {
  padding: 6px 14px; border-radius: 20px;
  color: var(--text2); font-size: 0.88rem;
  transition: all .2s;
}
.navbar-cats a:hover, .navbar-cats a.active {
  background: var(--primary); color: white;
}

.navbar-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: var(--radius);
  font-size: 0.88rem; font-weight: 600; cursor: pointer;
  border: none; transition: all .2s; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); color: white; }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 5px 12px; font-size: 0.8rem; }
.btn-danger { background: var(--danger); color: white; }
.btn-success { background: var(--success); color: #000; }
.btn-ghost { background: transparent; color: var(--text2); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg3); color: var(--text); }

/* ── Banner Carousel ── */
.banner-carousel {
  position: relative;
  height: 480px;
  overflow: hidden;
  background: var(--bg2);
  user-select: none;
}
@media (max-width: 600px) { .banner-carousel { height: 260px; } }

.banner-slide {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity 0.7s ease;
  background-size: cover;
  background-position: center;
  background-color: var(--bg2);
}
.banner-slide.active { opacity: 1; z-index: 1; }

.banner-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(
    100deg,
    rgba(0,0,0,.75) 0%,
    rgba(0,0,0,.35) 55%,
    transparent 100%
  );
}

.banner-body {
  position: absolute; bottom: 80px; left: 60px;
  max-width: 560px; z-index: 2;
}
@media (max-width: 600px) {
  .banner-body { left: 20px; bottom: 48px; max-width: calc(100% - 40px); }
}
.banner-title {
  font-size: 1.9rem; font-weight: 900; line-height: 1.25;
  margin-bottom: 10px; text-shadow: 0 2px 8px rgba(0,0,0,.6);
}
@media (max-width: 600px) { .banner-title { font-size: 1.2rem; } }
.banner-subtitle {
  color: rgba(255,255,255,.82); font-size: .95rem; margin-bottom: 20px;
  text-shadow: 0 1px 4px rgba(0,0,0,.6);
}
@media (max-width: 600px) { .banner-subtitle { display: none; } }

.banner-cta {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary); color: #fff;
  padding: 10px 22px; border-radius: var(--radius);
  font-weight: 700; font-size: .9rem;
  transition: background .2s, transform .15s;
  text-decoration: none;
}
.banner-cta:hover { background: var(--primary-dark); color: #fff; transform: translateY(-1px); }

/* Dots */
.banner-dots {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 7px; z-index: 3;
}
.banner-dot {
  width: 8px; height: 8px; border-radius: 4px;
  background: rgba(255,255,255,.35); cursor: pointer;
  transition: all .3s;
}
.banner-dot.active { width: 26px; background: var(--primary); }

/* Arrows */
.banner-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 3; width: 42px; height: 42px; border-radius: 50%;
  background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.15);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #fff; font-size: 1.1rem;
  transition: background .2s; backdrop-filter: blur(4px);
}
.banner-arrow:hover { background: var(--primary); }
.banner-arrow.prev { left: 20px; }
.banner-arrow.next { right: 20px; }
@media (max-width: 600px) { .banner-arrow { display: none; } }

/* Static hero fallback (no banners configured) */
/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, #0a0a0f 0%, #1a0a00 50%, #0a1020 100%);
  padding: 80px 24px;
  text-align: center;
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(255,102,0,.15) 0%, transparent 70%);
}
.hero-content { position: relative; max-width: 700px; margin: 0 auto; }
.hero h1 { font-size: 2.8rem; font-weight: 900; margin-bottom: 16px; }
.hero h1 em { color: var(--primary); font-style: normal; }
.hero p { color: var(--text2); font-size: 1.1rem; margin-bottom: 32px; }

/* ── Layout ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.layout { display: grid; grid-template-columns: 1fr 320px; gap: 32px; padding: 32px 0; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }

/* ── Card Grid ── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.section-title {
  font-size: 1.1rem; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.section-title::before {
  content: ''; width: 4px; height: 20px;
  background: var(--primary); border-radius: 2px; display: inline-block;
}

.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }

.news-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: transform .2s, border-color .2s, box-shadow .2s;
  cursor: pointer;
}
.news-card:hover { transform: translateY(-4px); border-color: var(--primary); box-shadow: var(--shadow); }

.news-card-img {
  width: 100%; height: 180px; object-fit: cover;
  background: var(--bg3);
  display: flex; align-items: center; justify-content: center;
  color: var(--text2); font-size: 2rem;
}
.news-card-img img { width: 100%; height: 100%; object-fit: cover; }

.news-card-body { padding: 16px; }
.news-card-cat {
  display: inline-block; padding: 2px 10px; border-radius: 12px;
  font-size: 0.75rem; font-weight: 700; margin-bottom: 8px;
  background: var(--primary); color: white;
}
.cat-esports { background: #7c3aed; }
.cat-guide { background: #059669; }
.cat-update { background: #0284c7; }
.cat-news { background: var(--primary); }

.news-card-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 8px; line-height: 1.4; }
.news-card-summary { color: var(--text2); font-size: 0.82rem; line-height: 1.5; }
.news-card-meta {
  display: flex; align-items: center; gap: 12px;
  margin-top: 12px; color: var(--text2); font-size: 0.78rem;
}

/* ── Featured (top article) ── */
.featured-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  display: grid; grid-template-columns: 1fr 1fr;
  margin-bottom: 32px; cursor: pointer;
  transition: border-color .2s;
}
.featured-card:hover { border-color: var(--primary); }
.featured-card img { width: 100%; height: 280px; object-fit: cover; }
.featured-body {
  padding: 32px; display: flex; flex-direction: column; justify-content: center;
}
.featured-body .news-card-cat { font-size: 0.85rem; }
.featured-body .news-card-title { font-size: 1.4rem; margin: 12px 0; }
.featured-body .news-card-summary { font-size: 0.9rem; }
@media (max-width: 700px) { .featured-card { grid-template-columns: 1fr; } }

/* ── Sidebar ── */
.sidebar-widget {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 20px;
}
.sidebar-widget-title {
  font-size: 0.9rem; font-weight: 700; margin-bottom: 16px;
  color: var(--primary); text-transform: uppercase; letter-spacing: 1px;
}
.rank-list { list-style: none; }
.rank-list li {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border); cursor: pointer;
}
.rank-list li:last-child { border-bottom: none; }
.rank-num {
  font-size: 1.2rem; font-weight: 900; color: var(--border);
  min-width: 24px;
}
.rank-list li:nth-child(1) .rank-num { color: #ffd700; }
.rank-list li:nth-child(2) .rank-num { color: #c0c0c0; }
.rank-list li:nth-child(3) .rank-num { color: #cd7f32; }

/* ── Article Detail ── */
.article-hero {
  width: 100%; max-height: 480px; object-fit: cover;
  border-radius: var(--radius); margin-bottom: 32px;
}
.article-header { margin-bottom: 24px; }
.article-title { font-size: 2rem; font-weight: 900; line-height: 1.3; margin: 12px 0; }
.article-meta { display: flex; align-items: center; gap: 16px; color: var(--text2); font-size: 0.85rem; flex-wrap: wrap; }
.article-body { font-size: 1rem; line-height: 1.9; }
.article-body h2 { font-size: 1.3rem; margin: 28px 0 12px; padding-left: 12px; border-left: 3px solid var(--primary); }
.article-body p { margin-bottom: 16px; }
.article-body ul, .article-body ol { padding-left: 24px; margin-bottom: 16px; }
.article-body li { margin-bottom: 6px; }
.article-body strong { color: var(--accent); }
.article-body video { width: 100%; border-radius: var(--radius); margin: 16px 0; }

/* ── Comments ── */
.comments-section { margin-top: 48px; }
.comments-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 20px; }
.comment-form { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 24px; }
.comment-form textarea {
  width: 100%; background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); padding: 12px;
  font-size: 0.9rem; resize: vertical; min-height: 80px;
  font-family: inherit;
}
.comment-form textarea:focus { outline: none; border-color: var(--primary); }

.comment-list { display: flex; flex-direction: column; gap: 16px; }
.comment {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}
.comment.reply { margin-left: 40px; background: var(--bg3); }
.comment-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.comment-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; overflow: hidden;
}
.comment-avatar img { width: 100%; height: 100%; object-fit: cover; }
.comment-username { font-weight: 700; font-size: 0.9rem; }
.comment-time { color: var(--text2); font-size: 0.78rem; }
.comment-content { font-size: 0.9rem; line-height: 1.6; }
.comment-actions { margin-top: 8px; display: flex; gap: 8px; }

/* ── Auth Forms ── */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(255,102,0,.1) 0%, var(--bg) 60%);
  padding: 24px;
}
.auth-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 12px; padding: 40px; width: 100%; max-width: 440px;
}
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo h1 { font-size: 1.6rem; font-weight: 900; }
.auth-logo h1 em { color: var(--primary); font-style: normal; }

.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.85rem; color: var(--text2); margin-bottom: 6px; }
.form-input {
  width: 100%; padding: 11px 14px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  font-size: 0.95rem; font-family: inherit; transition: border-color .2s;
}
.form-input:focus { outline: none; border-color: var(--primary); }
.form-select {
  width: 100%; padding: 11px 14px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  font-size: 0.95rem; font-family: inherit;
}

.form-hint { font-size: 0.8rem; color: var(--text2); margin-top: 4px; }
.form-error { font-size: 0.82rem; color: var(--danger); margin-top: 4px; }
.alert {
  padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px;
  font-size: 0.88rem;
}
.alert-success { background: rgba(68,204,136,.15); border: 1px solid rgba(68,204,136,.4); color: var(--success); }
.alert-error { background: rgba(255,68,68,.15); border: 1px solid rgba(255,68,68,.4); color: var(--danger); }
.alert-info { background: rgba(0,212,255,.1); border: 1px solid rgba(0,212,255,.3); color: var(--accent); }

/* ── Admin ── */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.admin-sidebar {
  background: var(--bg2); border-right: 1px solid var(--border);
  padding: 24px 0;
}
.admin-sidebar-brand {
  padding: 0 20px 24px; font-size: 1rem; font-weight: 800;
  color: var(--primary); border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.admin-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; color: var(--text2); font-size: 0.9rem;
  transition: all .2s;
}
.admin-nav a:hover, .admin-nav a.active {
  background: rgba(255,102,0,.1); color: var(--primary); border-right: 3px solid var(--primary);
}
.admin-content { padding: 32px; overflow-y: auto; }
.admin-header { margin-bottom: 24px; }
.admin-header h2 { font-size: 1.4rem; font-weight: 800; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; text-align: center;
}
.stat-num { font-size: 2rem; font-weight: 900; color: var(--primary); }
.stat-label { color: var(--text2); font-size: 0.82rem; margin-top: 4px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { background: var(--bg3); color: var(--text2); font-size: 0.82rem; text-align: left; padding: 10px 14px; }
td { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
tr:hover td { background: rgba(255,255,255,.02); }

.badge {
  display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 0.75rem; font-weight: 700;
}
.badge-pending { background: rgba(255,193,7,.15); color: #ffc107; border: 1px solid rgba(255,193,7,.3); }
.badge-published { background: rgba(68,204,136,.15); color: var(--success); border: 1px solid rgba(68,204,136,.3); }
.badge-rejected { background: rgba(255,68,68,.15); color: var(--danger); border: 1px solid rgba(255,68,68,.3); }
.badge-creator { background: rgba(0,212,255,.15); color: var(--accent); border: 1px solid rgba(0,212,255,.3); }
.badge-admin { background: rgba(255,102,0,.15); color: var(--primary); border: 1px solid rgba(255,102,0,.3); }

/* ── Tabs ── */
.tabs { display: flex; gap: 4px; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
.tab {
  padding: 10px 20px; cursor: pointer; color: var(--text2); font-size: 0.9rem;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all .2s;
}
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ── Modal ── */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.8); align-items: center; justify-content: center; padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 12px; padding: 32px; width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto;
}
.modal-title { font-size: 1.2rem; font-weight: 800; margin-bottom: 20px; }
.modal-close { float: right; cursor: pointer; color: var(--text2); font-size: 1.4rem; line-height: 1; }

/* ── Pagination ── */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 32px; }
.page-btn {
  width: 36px; height: 36px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  background: var(--bg2); border: 1px solid var(--border);
  color: var(--text2); cursor: pointer; font-size: 0.88rem; transition: all .2s;
}
.page-btn:hover, .page-btn.active { background: var(--primary); border-color: var(--primary); color: white; }

/* ── User menu ── */
.user-menu { position: relative; }
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem; overflow: hidden;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); min-width: 180px;
  box-shadow: var(--shadow); display: none; z-index: 50;
}
.user-dropdown.open { display: block; }
.user-dropdown a, .user-dropdown button {
  display: block; width: 100%; text-align: left;
  padding: 10px 16px; color: var(--text); font-size: 0.88rem;
  background: none; border: none; cursor: pointer;
  transition: background .2s; font-family: inherit;
}
.user-dropdown a:hover, .user-dropdown button:hover { background: var(--bg3); color: var(--primary); }

/* ── Misc ── */
.empty { text-align: center; padding: 60px; color: var(--text2); }
.empty-icon { font-size: 3rem; margin-bottom: 12px; }
.loading { text-align: center; padding: 40px; color: var(--text2); }
.divider { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
.tag { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 0.8rem; background: var(--bg3); color: var(--text2); margin: 2px; }

footer {
  background: var(--bg2); border-top: 1px solid var(--border);
  padding: 40px 24px; text-align: center; color: var(--text2); font-size: 0.85rem;
  margin-top: 60px;
}
footer a { color: var(--text2); margin: 0 12px; }
footer a:hover { color: var(--primary); }

/* ── Responsive ── */
@media (max-width: 600px) {
  .hero h1 { font-size: 1.8rem; }
  .navbar-cats { display: none; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
}

.write-form textarea {
  min-height: 200px;
}

/* Toast */
#toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 999;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 20px;
  font-size: 0.88rem; box-shadow: var(--shadow);
  transform: translateY(100px); opacity: 0; transition: all .3s;
  max-width: 320px;
}
#toast.show { transform: translateY(0); opacity: 1; }
#toast.success { border-left: 3px solid var(--success); }
#toast.error { border-left: 3px solid var(--danger); }
