/* ===== Reset & Base ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-dark: #0a0a0a;
  --bg-card: #1a1a1a;
  --bg-card-hover: #222;
  --gold: #D4AF37;
  --gold-dim: #B8962E;
  --silver: #C0C0C0;
  --white: #F5F5F5;
  --text-muted: #888;
  --crimson: #8B0000;
  --font-serif: 'Noto Serif JP', serif;
  --font-sans: 'Noto Sans JP', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg-dark);
  color: var(--white);
  font-family: var(--font-sans);
  line-height: 1.7;
  overflow-x: hidden;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(212,175,55,0.05) 0%, transparent 70%),
    linear-gradient(180deg, var(--bg-dark) 0%, #111 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 2rem 1.5rem;
}

.logo-img {
  max-width: 160px;
  height: auto;
  margin-bottom: 1.5rem;
}

.logo-fallback {
  margin-bottom: 1.5rem;
}

.logo-icon {
  font-size: 4rem;
  color: var(--gold);
  text-shadow: 0 0 30px rgba(212,175,55,0.3);
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 900;
  color: var(--gold);
  letter-spacing: 0.15em;
  margin-bottom: 1.5rem;
  text-shadow: 0 2px 20px rgba(212,175,55,0.2);
}

.hero-catch {
  font-family: var(--font-serif);
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--white);
  line-height: 2;
  margin-bottom: 1rem;
}

.hero-sub {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

.btn-x {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 2rem;
  background: var(--white);
  color: #000;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 9999px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-x:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(255,255,255,0.15);
}

.x-icon { flex-shrink: 0; }

.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--gold-dim);
  font-size: 1.2rem;
  animation: bounce 2s infinite;
  opacity: 0.5;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* ===== Section Common ===== */
.section {
  max-width: 800px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  color: var(--gold);
  text-align: center;
  margin-bottom: 2.5rem;
  letter-spacing: 0.1em;
}

/* ===== Divider ===== */
.section-divider {
  display: flex;
  justify-content: center;
  padding: 0 2rem;
}

.divider-sword {
  width: 200px;
  height: 20px;
}

/* ===== Doctrine ===== */
.scroll-container {
  display: flex;
  justify-content: center;
}

.scroll-bg {
  background: linear-gradient(135deg, #1c1810 0%, #15120d 100%);
  border: 1px solid var(--gold-dim);
  border-radius: 8px;
  padding: 2.5rem 2rem;
  max-width: 600px;
  width: 100%;
  position: relative;
}

.scroll-bg::before,
.scroll-bg::after {
  content: '';
  position: absolute;
  left: 1.5rem;
  right: 1.5rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}

.scroll-bg::before { top: 0.75rem; }
.scroll-bg::after { bottom: 0.75rem; }

.doctrine-list {
  list-style: none;
  counter-reset: none;
}

.doctrine-list li {
  font-family: var(--font-serif);
  font-size: clamp(0.9rem, 2vw, 1.05rem);
  line-height: 2.2;
  color: var(--white);
  padding-left: 0.5rem;
}

.doctrine-num {
  color: var(--gold);
  font-weight: 700;
  margin-right: 0.75rem;
}

/* ===== Ranks ===== */
.ranks-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (max-width: 480px) {
  .ranks-grid { grid-template-columns: 1fr; }
}

.rank-card {
  background: var(--bg-card);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 2rem 1.5rem;
  text-align: center;
  transition: border-color 0.3s, transform 0.3s;
}

.rank-card:hover {
  border-color: var(--gold-dim);
  transform: translateY(-3px);
}

.rank-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.rank-name {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.rank-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ===== Members ===== */
.members-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.members-count {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--silver);
}

.members-count span {
  color: var(--gold);
  font-weight: 700;
  font-size: 1.3rem;
}

.search-box { flex: 1; max-width: 280px; }

#member-search {
  width: 100%;
  padding: 0.6rem 1rem;
  background: var(--bg-card);
  border: 1px solid #333;
  border-radius: 6px;
  color: var(--white);
  font-size: 0.9rem;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.2s;
}

#member-search:focus { border-color: var(--gold-dim); }
#member-search::placeholder { color: #555; }

.members-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.loading-text {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem 0;
}

.member-card {
  background: var(--bg-card);
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  transition: border-color 0.3s;
}

.member-card:hover { border-color: var(--gold-dim); }

.member-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.member-number {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  color: var(--gold);
  font-weight: 700;
}

.member-rank {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  background: rgba(212,175,55,0.12);
  color: var(--gold);
  font-weight: 500;
}

.member-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.15rem;
}

.member-screen-name {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.member-screen-name a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.member-screen-name a:hover { color: var(--gold); }

.member-meta {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.member-weapon {
  color: var(--silver);
}

.member-weapon::before {
  content: '\1F5E1 ';
}

/* ===== Footer ===== */
.footer {
  border-top: 1px solid #222;
  padding: 3rem 1.5rem;
  text-align: center;
}

.footer-inner {
  max-width: 600px;
  margin: 0 auto;
}

.footer-cta {
  font-family: var(--font-serif);
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--white);
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.footer-cta strong {
  color: var(--gold);
}

.btn-x-footer {
  margin-bottom: 2rem;
}

.copyright {
  font-size: 0.75rem;
  color: #444;
}

.sp-only { display: none; }
@media (max-width: 768px) {
  .sp-only { display: inline; }
}

/* ===== Fade-in Animation ===== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== No results ===== */
.no-results {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 0;
  font-size: 0.9rem;
}
