/* ============================================================
   DAISIA NOCTURNE — CHARACTER CSS
   Template: night-blood (reusable for vampire lineage chars)
   Default mode: night  |  Toggle: dawn
   ============================================================ */

/* ── NIGHT BASE（デフォルト CSS変数） ── */
:root {
  --n-bg:          #0a0608;
  --n-bg2:         #120a0d;
  --n-crimson:     #8b1a2a;
  --n-crimson2:    #a82035;
  --n-crimson-dim: #5a1020;
  --n-gold:        #c9a040;
  --n-gold2:       #e8c060;
  --n-bone:        #e8ddd0;
  --n-bone2:       #d0c4b4;
  --n-smoke:       #9a8878;
  --n-ash:         #5a4840;

  --border-cr:     rgba(139,26,42,0.5);
  --border-cr2:    rgba(139,26,42,0.9);
  --border-gold:   rgba(201,160,64,0.4);

  --text-warm:     #e8ddd0;
  --text-muted:    #c09080;
  --text-dim:      #6a4840;

  --particle-col:  rgba(139,26,42,0.7);
}

/* ── DAWN MODE 変数上書き ── */
body.dawn-mode {
  --n-bg:          #1a1008;
  --n-bg2:         #281808;
  --n-crimson:     #8b6020;
  --n-crimson2:    #c89040;
  --n-crimson-dim: #6a4810;
  --n-gold:        #e8b840;
  --n-gold2:       #f8d870;
  --n-bone:        #fff8e8;
  --n-bone2:       #f8ecd8;
  --n-smoke:       #b8a080;
  --n-ash:         #806848;

  --border-cr:     rgba(232,184,64,0.5);
  --border-cr2:    rgba(248,216,112,0.9);
  --border-gold:   rgba(232,184,64,0.5);

  --text-warm:     #fff8e8;
  --text-muted:    #d4b880;
  --text-dim:      #987848;

  --particle-col:  rgba(248,200,80,0.6);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--n-bg);
  color: var(--text-warm);
  font-family: 'Noto Serif JP', serif;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.8s ease, color 0.5s ease;
}

/* 背景テクスチャ */
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 80% 55% at 50% 0%,  rgba(100,10,20,0.45) 0%, transparent 65%),
    radial-gradient(ellipse 50% 40% at 15% 85%, rgba(80,8,16,0.2) 0%, transparent 55%),
    radial-gradient(ellipse 40% 30% at 85% 70%, rgba(60,40,10,0.12) 0%, transparent 50%),
    repeating-linear-gradient(
      45deg, transparent, transparent 70px,
      rgba(139,26,42,0.018) 70px, rgba(139,26,42,0.018) 71px
    );
  pointer-events: none; z-index: 0;
  transition: background 0.8s ease;
}

body.dawn-mode::before {
  background:
    radial-gradient(ellipse 90% 60% at 50% 0%,  rgba(200,140,20,0.3) 0%, transparent 65%),
    radial-gradient(ellipse 60% 40% at 80% 90%, rgba(180,100,10,0.15) 0%, transparent 55%),
    repeating-linear-gradient(
      45deg, transparent, transparent 70px,
      rgba(232,184,64,0.018) 70px, rgba(232,184,64,0.018) 71px
    );
}

/* ============================================================
   LAYOUT
   ============================================================ */
.char-page {
  position: relative; z-index: 1;
  max-width: 820px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

/* ============================================================
   MODE TOGGLE BUTTON
   ============================================================ */
.mode-toggle-wrap {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.mode-toggle-btn {
  font-family: 'Cormorant Garamond', serif;
  font-size: 11px;
  letter-spacing: 3px;
  padding: 7px 18px;
  background: transparent;
  border: 1px solid var(--border-cr);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s;
  text-transform: uppercase;
}

.mode-toggle-btn:hover {
  border-color: var(--n-gold);
  color: var(--text-warm);
  background: rgba(139,26,42,0.1);
}

body.dawn-mode .mode-toggle-btn:hover {
  border-color: var(--n-gold2);
  background: rgba(232,184,64,0.08);
}

/* ============================================================
   BACK LINK
   ============================================================ */
.char-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 28px;
  transition: color 0.2s;
}
.char-back-link:hover { color: var(--n-gold); }

/* ============================================================
   HEADER: 夜会血統ラベル
   ============================================================ */
.blood-label-header {
  border: 1px solid var(--border-cr);
  outline: 3px solid var(--border-cr);
  outline-offset: 6px;
  padding: 36px 40px 28px;
  text-align: center;
  position: relative;
  background: linear-gradient(180deg, rgba(80,6,14,0.4) 0%, rgba(10,6,8,0.6) 100%);
  margin-bottom: 40px;
  overflow: hidden;
  transition: border-color 0.6s, outline-color 0.6s, background 0.8s;
}

body.dawn-mode .blood-label-header {
  background: linear-gradient(180deg, rgba(120,80,10,0.3) 0%, rgba(26,16,8,0.5) 100%);
}

/* 四隅装飾 */
.blood-label-header::before,
.blood-label-header::after,
.char-corner-tl, .char-corner-br {
  position: absolute;
  font-size: 16px;
  color: var(--n-crimson2);
  opacity: 0.7;
  transition: color 0.6s, opacity 0.6s;
}
.blood-label-header::before { content: attr(data-corner); top: 12px; left: 16px; }
.blood-label-header::after  { content: attr(data-corner); bottom: 12px; right: 16px; }
.char-corner-tl { top: 12px; right: 16px; }
.char-corner-br { bottom: 12px; left: 16px; }

body.dawn-mode .blood-label-header::before,
body.dawn-mode .blood-label-header::after,
body.dawn-mode .char-corner-tl,
body.dawn-mode .char-corner-br {
  color: var(--n-gold2); opacity: 0.8;
}

/* ブランドロゴ */
.char-brand-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 10px;
  letter-spacing: 5px;
  color: var(--n-crimson2);
  opacity: 0.85;
  margin-bottom: 16px;
  text-transform: uppercase;
  transition: color 0.6s;
}
body.dawn-mode .char-brand-logo { color: var(--n-gold); }

/* 区切り線 */
.char-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
}
.char-divider::before,
.char-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--n-crimson2), transparent);
  transition: background 0.6s;
}
body.dawn-mode .char-divider::before,
body.dawn-mode .char-divider::after {
  background: linear-gradient(to right, transparent, var(--n-gold), transparent);
}
.char-divider span {
  color: var(--n-crimson2);
  font-size: 14px;
  opacity: 0.8;
  transition: color 0.6s;
}
body.dawn-mode .char-divider span { color: var(--n-gold); }

/* キャラ名 */
.char-name-en {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.4rem, 8vw, 4rem);
  font-weight: 300;
  letter-spacing: 0.12em;
  color: var(--n-bone);
  text-shadow: 0 0 40px rgba(139,26,42,0.5);
  margin: 4px 0;
  text-transform: uppercase;
  transition: text-shadow 0.6s, color 0.5s;
}
body.dawn-mode .char-name-en {
  text-shadow: 0 0 40px rgba(232,184,64,0.4);
}

.char-name-ja {
  font-family: 'Noto Serif JP', serif;
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 6px;
  color: var(--text-muted);
  margin-bottom: 16px;
  transition: color 0.5s;
}

/* フレーバーテキスト */
.char-flavor-text {
  font-family: 'IM Fell English', serif;
  font-style: italic;
  font-size: 13px;
  color: var(--n-bone2);
  opacity: 0.85;
  letter-spacing: 0.5px;
  line-height: 1.8;
  margin-top: 12px;
  transition: color 0.6s, opacity 0.6s;
}

/* ============================================================
   PARTICLE EFFECT
   ============================================================ */
.char-particle-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 10px;
  height: 60px;
  margin: 20px 0 8px;
  position: relative;
}

.char-particle {
  border-radius: 50%;
  background: var(--particle-col);
  animation: char-particle-float 3.5s ease-in-out infinite;
  transform-origin: bottom center;
  transition: background 0.6s;
}

/* サイズバリエーション（7個固定） */
.char-particle:nth-child(1) { width:3px;height:3px; animation-delay:0s;    animation-duration:3.2s; }
.char-particle:nth-child(2) { width:5px;height:5px; animation-delay:0.5s;  animation-duration:3.8s; }
.char-particle:nth-child(3) { width:2px;height:2px; animation-delay:1.1s;  animation-duration:2.9s; }
.char-particle:nth-child(4) { width:4px;height:4px; animation-delay:0.3s;  animation-duration:4.1s; }
.char-particle:nth-child(5) { width:3px;height:3px; animation-delay:0.8s;  animation-duration:3.5s; }
.char-particle:nth-child(6) { width:2px;height:2px; animation-delay:1.5s;  animation-duration:3.0s; }
.char-particle:nth-child(7) { width:4px;height:4px; animation-delay:0.2s;  animation-duration:4.3s; }

@keyframes char-particle-float {
  0%   { transform: translateY(0) scale(1);         opacity: 0; }
  15%  { opacity: 0.9; }
  50%  { transform: translateY(-32px) scale(0.7);   opacity: 0.5; }
  80%  { transform: translateY(-54px) scale(0.3);   opacity: 0.2; }
  100% { transform: translateY(-68px) scale(0.1);   opacity: 0; }
}

/* Dawn：黒星の悪夢が消える演出 */
body.dawn-mode .char-particle {
  animation-name: char-particle-dawn;
}

@keyframes char-particle-dawn {
  0%   { transform: translateY(0) scale(1) rotate(0deg);      opacity: 0; }
  10%  { opacity: 0.8; }
  40%  { transform: translateY(-20px) scale(1.4) rotate(15deg);  opacity: 0.5; }
  70%  { transform: translateY(-50px) scale(0.5) rotate(-10deg); opacity: 0.15; }
  100% { transform: translateY(-80px) scale(0.1) rotate(5deg);   opacity: 0; }
}

/* Dawn：朝光の筋 */
.char-dawn-ray {
  position: absolute;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to top, rgba(248,200,80,0.0), rgba(248,200,80,0.5), rgba(248,200,80,0.0));
  animation: char-ray-pulse 4s ease-in-out infinite;
  display: none;
}
body.dawn-mode .char-dawn-ray { display: block; }

.char-dawn-ray:nth-child(8)  { left:20%;  height:50px; animation-delay:0s;   animation-duration:4.2s; }
.char-dawn-ray:nth-child(9)  { left:40%;  height:65px; animation-delay:0.8s; animation-duration:3.8s; }
.char-dawn-ray:nth-child(10) { left:60%;  height:45px; animation-delay:1.5s; animation-duration:4.5s; }
.char-dawn-ray:nth-child(11) { left:80%;  height:55px; animation-delay:0.4s; animation-duration:3.6s; }

@keyframes char-ray-pulse {
  0%,100% { opacity: 0; transform: scaleY(0.6); }
  50%      { opacity: 1; transform: scaleY(1); }
}

/* ============================================================
   COLOR STRIP
   ============================================================ */
.char-color-strip {
  display: flex;
  height: 3px;
  margin: 6px 0 20px;
  transition: opacity 0.5s;
}
.char-color-strip span { flex: 1; }

.char-strip-night { display: flex; }
.char-strip-dawn  { display: none; }
body.dawn-mode .char-strip-night { display: none; }
body.dawn-mode .char-strip-dawn  { display: flex; }

/* ============================================================
   PROFILE GRID
   ============================================================ */
.char-profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

/* ============================================================
   CARD
   ============================================================ */
.char-card {
  background: rgba(18,10,13,0.75);
  border: 1px solid var(--border-cr);
  padding: 24px;
  position: relative;
  transition: all 0.35s ease;
  backdrop-filter: blur(4px);
}

.char-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(139,26,42,0.07) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
}

.char-card:hover {
  border-color: var(--border-cr2);
  box-shadow: 0 0 22px rgba(139,26,42,0.2), inset 0 0 28px rgba(139,26,42,0.06);
}

.char-card:hover::before { opacity: 1; }

body.dawn-mode .char-card:hover {
  border-color: rgba(232,184,64,0.7);
  box-shadow: 0 0 22px rgba(232,184,64,0.15), inset 0 0 28px rgba(232,184,64,0.04);
}

/* 赤い指輪 hover演出 */
.char-ring-accent {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  border: 1px solid var(--n-crimson2);
  margin-right: 6px;
  vertical-align: middle;
  transition: box-shadow 0.3s, border-color 0.3s;
}
.char-card:hover .char-ring-accent {
  box-shadow: 0 0 8px rgba(139,26,42,0.9), 0 0 16px rgba(139,26,42,0.4);
  border-color: #e03050;
}
body.dawn-mode .char-card:hover .char-ring-accent {
  box-shadow: 0 0 8px rgba(232,184,64,0.8), 0 0 16px rgba(232,184,64,0.3);
  border-color: var(--n-gold2);
}

.char-card-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 11px;
  letter-spacing: 4px;
  color: var(--n-crimson2);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-cr);
  text-transform: uppercase;
  transition: color 0.5s, border-color 0.5s;
  display: flex;
  align-items: center;
}
body.dawn-mode .char-card-title {
  color: var(--n-gold);
  border-bottom-color: var(--border-gold);
}

/* ============================================================
   PROFILE TABLE
   ============================================================ */
.char-status-list {
  display: grid;
  row-gap: 10px;
  font-size: 13px;
}

.char-status-list dt {
  font-family: 'Cormorant Garamond', serif;
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 2px;
  transition: color 0.5s;
}

.char-status-list dd {
  color: var(--n-bone);
  letter-spacing: 1px;
  line-height: 1.6;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(139,26,42,0.12);
  transition: color 0.5s, border-color 0.5s;
}
body.dawn-mode .char-status-list dd { border-bottom-color: rgba(232,184,64,0.1); }
.char-status-list dd:last-child { border-bottom: none; }

/* ============================================================
   TAGS
   ============================================================ */
.char-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.char-tag {
  font-family: 'Cormorant Garamond', serif;
  font-size: 9px;
  letter-spacing: 2px;
  padding: 4px 10px;
  border: 1px solid var(--border-cr);
  color: var(--text-muted);
  text-transform: uppercase;
  transition: all 0.2s;
}

.char-tag:hover {
  border-color: var(--n-crimson2);
  color: #e06080;
  background: rgba(139,26,42,0.1);
}
body.dawn-mode .char-tag:hover {
  border-color: var(--n-gold);
  color: var(--n-gold2);
  background: rgba(232,184,64,0.08);
}

/* ============================================================
   CAPABILITY BARS
   ============================================================ */
.char-cap-row { margin-bottom: 12px; }

.char-cap-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 5px;
  transition: color 0.5s;
}

.char-cap-label span:last-child {
  color: var(--n-gold);
  font-family: 'Cormorant Garamond', serif;
  transition: color 0.5s;
}
body.dawn-mode .char-cap-label span:last-child { color: var(--n-gold2); }

.char-cap-bar {
  height: 2px;
  background: rgba(139,26,42,0.15);
  position: relative;
  overflow: hidden;
  transition: background 0.5s;
}
body.dawn-mode .char-cap-bar { background: rgba(232,184,64,0.15); }

.char-cap-fill {
  height: 100%;
  background: linear-gradient(to right, var(--n-crimson), var(--n-gold));
  border-radius: 1px;
  animation: char-bar-in 1.2s ease both;
  transition: background 0.6s;
}
body.dawn-mode .char-cap-fill {
  background: linear-gradient(to right, #c89040, #f8d870);
}

@keyframes char-bar-in {
  from { width: 0 !important; }
}

/* ============================================================
   CONCEPT TEXT
   ============================================================ */
.char-concept-text {
  font-size: 13px;
  line-height: 2.2;
  color: var(--n-bone2);
  letter-spacing: 0.5px;
  transition: color 0.5s;
}

.char-concept-text em {
  font-family: 'IM Fell English', serif;
  font-style: italic;
  color: var(--n-crimson2);
  transition: color 0.5s;
}
body.dawn-mode .char-concept-text em { color: var(--n-gold2); }

/* ============================================================
   NOTES SECTION
   ============================================================ */
.char-notes-inner {
  padding: 16px 0 4px;
  border-left: 2px solid var(--n-crimson);
  padding-left: 16px;
  margin-top: 4px;
  transition: border-color 0.6s;
}
body.dawn-mode .char-notes-inner { border-left-color: var(--n-gold); }

.char-notes-inner p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 2;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
  transition: color 0.5s;
}

.char-notes-inner strong {
  color: var(--n-bone);
  font-weight: 500;
  transition: color 0.5s;
}

.char-warning-label {
  font-family: 'Cormorant Garamond', serif;
  font-size: 9px;
  letter-spacing: 3px;
  color: rgba(201,160,64,0.5);
  margin-bottom: 12px;
  text-transform: uppercase;
  transition: color 0.5s;
}
body.dawn-mode .char-warning-label { color: rgba(248,216,112,0.6); }

/* ============================================================
   DOSSIER LINK
   ============================================================ */
.char-dossier-wrap {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(139,26,42,0.25);
  transition: border-color 0.6s;
}
body.dawn-mode .char-dossier-wrap { border-top-color: rgba(232,184,64,0.25); }

.char-internal-link {
  display: inline-block;
  font-family: 'Cormorant Garamond', serif;
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--n-crimson2);
  text-decoration: none;
  padding: 8px 14px;
  border: 1px solid rgba(139,26,42,0.5);
  transition: all 0.25s;
}
.char-internal-link:hover {
  background: rgba(139,26,42,0.14);
  border-color: var(--n-crimson2);
  color: #f06080;
  box-shadow: 0 0 12px rgba(139,26,42,0.3);
}
body.dawn-mode .char-internal-link {
  color: var(--n-gold);
  border-color: rgba(232,184,64,0.4);
}
body.dawn-mode .char-internal-link:hover {
  background: rgba(232,184,64,0.1);
  border-color: var(--n-gold2);
  color: var(--n-gold2);
  box-shadow: 0 0 12px rgba(232,184,64,0.25);
}

/* ============================================================
   FULL SECTION WRAPPER
   ============================================================ */
.char-full-section { margin-bottom: 20px; }

/* ============================================================
   FOOTER
   ============================================================ */
.char-footer {
  margin-top: 48px;
  text-align: center;
  padding: 24px;
  border: 1px solid var(--border-cr);
  position: relative;
  background: rgba(18,10,13,0.5);
  transition: border-color 0.6s, background 0.6s;
}
body.dawn-mode .char-footer { border-color: var(--border-gold); }

.char-footer::before {
  content: '— ✦ —';
  display: block;
  font-family: 'Cormorant Garamond', serif;
  color: var(--n-crimson2);
  opacity: 0.5;
  margin-bottom: 12px;
  letter-spacing: 8px;
  transition: color 0.6s;
}
body.dawn-mode .char-footer::before { color: var(--n-gold); }

.char-footer p {
  font-family: 'IM Fell English', serif;
  font-style: italic;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-bottom: 8px;
  transition: color 0.5s;
}

.char-footer small {
  font-family: 'Cormorant Garamond', serif;
  font-size: 10px;
  letter-spacing: 4px;
  color: var(--text-dim);
  text-transform: uppercase;
  transition: color 0.5s;
}

/* ============================================================
   FADE IN
   ============================================================ */
.char-fade-in {
  animation: char-fade-in 0.7s ease both;
}
.char-fade-in:nth-child(2) { animation-delay: 0.1s; }
.char-fade-in:nth-child(3) { animation-delay: 0.2s; }
.char-fade-in:nth-child(4) { animation-delay: 0.3s; }

@keyframes char-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--n-bg); }
::-webkit-scrollbar-thumb { background: var(--border-cr); border-radius: 2px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  .char-page          { padding: 20px 14px 60px; }
  .blood-label-header { padding: 24px 20px 20px; }
  .char-name-en       { font-size: 2.2rem; }
  .char-profile-grid  { grid-template-columns: 1fr; }
  .char-card          { padding: 18px; }
}
