:root {
  --bg: #0f1220;
  --bg-gradient: linear-gradient(180deg, #0f1220, #05060c);
  --nav-bg: #0f1220;
  --panel: #1a1f35;
  --panel2: #12162a;
  --line: #2a2f4a;
  --accent-a: #4da3ff;
  --accent-b: #ff6b6b;
  --accent: #4da3ff;
  --gold: #ffd166;
  --win-color: #ffa94d;
  --text: #f0f2fa;
  --sub: #9aa3c7;
}

[data-theme="light"] {
  --bg: #f7f4ed;
  --bg-gradient: linear-gradient(180deg, #f8f5ee, #ebe3d3);
  --nav-bg: #faf8f3;
  --panel: #ffffff;
  --panel2: #f2ebe0;
  --line: #ded5c4;
  --accent-a: #1a7fa6;
  --accent-b: #cc483b;
  --accent: #1a7fa6;
  --gold: #c97e06;
  --win-color: #d9480f;
  --text: #2c251e;
  --sub: #7a7062;
}

.stat-win {
  color: var(--win-color, #d9480f) !important;
  font-weight: 700;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', 'Noto Sans JP', "Hiragino Sans", "Yu Gothic", sans-serif;
  background: var(--bg-gradient);
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  letter-spacing: -0.01em;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.25s ease, color 0.25s ease;
}
.hptext, .stat-line-rich, .dmg, .fname, .result, .day, .hpfill {
  font-variant-numeric: tabular-nums;
}
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--nav-bg);
  z-index: 10;
  transition: background 0.25s ease, border-color 0.25s ease;
}
.nav-left {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.nav-right .day {
  color: var(--sub);
  font-size: 13px;
}
nav button {
  background: none; border: none; color: var(--sub);
  padding: 8px 14px; cursor: pointer; font-size: 14px;
  border-bottom: 2px solid transparent;
}
nav button.active { color: var(--text); border-bottom-color: var(--accent); }
nav button.logo {
  font-weight: 800;
  font-size: 16px;
  color: var(--text);
  letter-spacing: .05em;
  border-bottom: 2px solid transparent !important;
  margin-right: 12px;
}
main { max-width: 860px; margin: 0 auto; padding: 20px; }
section { display: none; }
section.active { display: block; }
h2 { font-size: 15px; color: var(--sub); font-weight: normal; margin: 0 0 12px; }
.subtabs {
  display: flex; gap: 4px; margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.subtabs button {
  background: none; border: none; color: var(--sub);
  padding: 8px 14px; cursor: pointer; font-size: 14px;
  border-bottom: 2px solid transparent;
}
.subtabs button.active { color: var(--text); border-bottom-color: var(--accent); }
.rank-panel { display: none; }
.rank-panel.active { display: block; }
.card {
  background: var(--panel); border-radius: 12px; padding: 16px; margin-bottom: 14px;
}
.card.sub { background: var(--panel2); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.name { font-weight: bold; font-size: 15px; }
.muted { color: var(--sub); font-size: 13px; }
.stats { color: var(--sub); font-size: 13px; margin-top: 6px; }
.abilities { white-space: pre-wrap; font-size: 13px; margin-top: 8px; line-height: 1.6; }
button.btn {
  background: var(--accent); color: #ffffff; border: none; border-radius: 8px;
  padding: 9px 16px; font-size: 14px; font-weight: bold; cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}
button.btn.ghost { background: var(--line); color: var(--text) !important; font-weight: 500; }
button.btn.ghost:hover { background: var(--panel2); color: var(--text) !important; }
button.btn:disabled { opacity: .4; cursor: default; }
input, textarea {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); padding: 9px 10px; font-size: 14px; font-family: inherit; width: 100%;
}
textarea { min-height: 90px; resize: vertical; line-height: 1.6; }
label { display: block; font-size: 13px; color: var(--sub); margin-bottom: 5px; }
.field { margin-bottom: 12px; }
.statgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.notice {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.5;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid transparent;
  animation: fadeIn 0.25s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.notice.error {
  background: #2a151b;
  border-color: #5c202a;
  color: #ff99a8;
}
.notice.info {
  background: #112338;
  border-color: #1f4268;
  color: #8ac2f7;
}
.notice .notice-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: bold;
  font-size: 14px;
}
.notice .notice-body {
  color: inherit;
  opacity: 0.95;
  white-space: pre-wrap;
}
.notice .notice-safety-note {
  margin-top: 6px;
  font-weight: 700;
  font-size: 12.5px;
  color: var(--text);
  opacity: 0.9;
  display: block;
}
.notice .error-code-tag {
  display: inline-block;
  font-family: monospace;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  color: #ffa8b8;
  margin-top: 4px;
  align-self: flex-start;
}
.badge {
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: var(--line); color: var(--sub);
}
.badge.win { background: #1d3a2a; color: #8ef0b0; }
.badge.lose { background: #3a1c26; color: #ffb3b3; }
.badge.def { background: #2b2340; color: #cbb3ff; }
.badge.retired { background: #22272e; color: #768390; border: 1px solid #373e47; }
.badge.my-char-badge {
  background: linear-gradient(135deg, #4c1d95, #6d28d9);
  color: #ede9fe;
  font-weight: 700;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #8b5cf6;
  margin-left: 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  box-shadow: 0 1px 4px rgba(109, 40, 217, 0.3);
}
[data-theme="light"] .badge.my-char-badge {
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  color: #5b21b6;
  border-color: #c4b5fd;
  box-shadow: 0 1px 3px rgba(91, 33, 182, 0.15);
}
.badge.sim { background: #3a2f1c; color: #ffd699; cursor: help; transition: opacity .3s; }
@keyframes badge-pulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
.badge.sim.loading { animation: badge-pulse 1.8s ease-in-out infinite; background: #1c2f3a; color: #99d6ff; }

.like {
  background: none; border: 1px solid var(--line); color: var(--sub);
  border-radius: 999px; padding: 5px 12px; cursor: pointer; font-size: 13px;
}
.like.on { border-color: var(--gold); color: var(--gold); }
ol.rank { list-style: none; padding: 0; margin: 0; }
ol.rank li {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 4px; border-bottom: 1px solid var(--line);
}
ol.rank li .pos { width: 28px; color: var(--sub); font-size: 13px; }
.empty { color: var(--sub); font-size: 14px; padding: 20px 0; text-align: center; }

/* ---- battle player ---- */
.fighters { display: flex; gap: 14px; margin-bottom: 16px; }
.fighter {
  flex: 1;
  background: var(--panel2);
  border-radius: 10px;
  padding: 12px;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  border: 1px solid transparent;
}
.fighter.attack-active {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}
.fighter.hit-small { animation: shake-small .2s, hit-flash-small .2s; }
.fighter.hit-medium { animation: shake-medium .3s, hit-flash-medium .3s; }
.fighter.hit-large { animation: shake-large .45s, hit-flash-large .45s; }

@keyframes shake-small {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}
@keyframes shake-medium {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  75% { transform: translateX(7px); }
}
@keyframes shake-large {
  0%,100% { transform: translateX(0); }
  15%, 45%, 75% { transform: translateX(-12px); }
  30%, 60%, 90% { transform: translateX(12px); }
}

@keyframes hit-flash-small {
  0%, 100% { background: var(--panel2); }
  50% { background: rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.2); }
}
@keyframes hit-flash-medium {
  0%, 100% { background: var(--panel2); }
  50% { background: rgba(240, 62, 62, 0.2); border-color: rgba(240, 62, 62, 0.3); }
}
@keyframes hit-flash-large {
  0%, 100% { background: var(--panel2); }
  50% { background: rgba(240, 62, 62, 0.5); border-color: #f03e3e; box-shadow: 0 0 20px rgba(240, 62, 62, 0.6); }
}

/* ダメージのオーバーレイエフェクトは一時削除 */
.fighter.a .fname { color: var(--accent-a); }
.fighter.b .fname { color: var(--accent-b); }
.fname {
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 8px;
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.15s ease;
}
.fname.blink-a {
  animation: blink-name-a 0.4s ease 2;
}
.fname.blink-b {
  animation: blink-name-b 0.4s ease 2;
}
@keyframes blink-name-a {
  0%, 100% { background: transparent; }
  50% { background: rgba(77, 173, 247, 0.35); }
}
@keyframes blink-name-b {
  0%, 100% { background: transparent; }
  50% { background: rgba(255, 107, 107, 0.35); }
}
.hpbar {
  background: var(--line);
  border-radius: 6px;
  height: 10px;
  overflow: hidden;
  margin-bottom: 5px;
  position: relative;
}
.hpfill-damage {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: #e03131;
  z-index: 1;
  transition: width 0.7s cubic-bezier(0.19, 1, 0.22, 1);
  transition-delay: 0.3s;
}
.hpfill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  z-index: 2;
  transition: width 0.25s ease-out;
}
.fighter.a .hpfill { background: var(--accent-a); }
.fighter.b .hpfill { background: var(--accent-b); }
.hptext { font-size: 12px; color: var(--sub); }
.vs { align-self: center; color: var(--sub); font-weight: bold; }
.dmg {
  position: absolute; top: -6px; right: 10px; font-size: 19px; font-weight: bold;
  color: var(--gold); opacity: 0; pointer-events: none;
}
.dmg.show { animation: pop .8s ease-out forwards; }
@keyframes pop {
  0% { opacity: 0; transform: translateY(0); }
  20% { opacity: 1; transform: translateY(-10px); }
  100% { opacity: 0; transform: translateY(-30px); }
}
.stage { background: var(--panel2); border-radius: 10px; padding: 16px; min-height: 130px; }
.turnlabel { font-size: 12px; color: var(--sub); letter-spacing: .08em; margin-bottom: 8px; transition: all 0.2s ease; }
.turnlabel.welcome {
  font-size: 17px;
  font-weight: bold;
  color: var(--text);
  text-align: center;
  margin: 30px 0 10px;
  letter-spacing: .05em;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.15);
}
.actionname { font-size: 15px; font-weight: bold; margin-bottom: 8px; }
.actionname.a { color: var(--accent-a); }
.actionname.b { color: var(--accent-b); }
.narration { font-size: 14px; line-height: 1.75; min-height: 3.4em; }
.result {
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  margin-top: 14px;
  min-height: 1.3em;
  color: #ffd700;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5), 0 0 2px #fff;
  letter-spacing: 0.05em;
  animation: result-fade-in 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
[data-theme="light"] .result {
  color: #b8860b;
  text-shadow: 
    0 0 12px rgba(218, 165, 32, 0.5),
    0 1px 2px rgba(120, 85, 0, 0.3);
}
@keyframes result-fade-in {
  0% { opacity: 0; transform: scale(0.9) translateY(10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* 勝者ファイターの特別な演出 */
.fighter.win {
  border-color: #ffd700 !important;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.35);
}
.fighter.win .fname::after {
  content: 'WIN';
  font-size: 10px;
  font-weight: 900;
  background: #f59f00;
  color: #000;
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 8px;
  vertical-align: middle;
  display: inline-block;
  letter-spacing: 0.05em;
  box-shadow: 0 0 5px rgba(245, 159, 0, 0.6);
  animation: win-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes win-pop {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.mvp {
  text-align: center;
  color: var(--gold);
  font-size: 15px;
  font-weight: 600;
  margin-top: 14px;
  padding: 10px 14px;
  background: rgba(255, 209, 102, 0.08);
  border: 1px dashed rgba(255, 209, 102, 0.25);
  border-radius: 8px;
  line-height: 1.55;
  animation: mvp-appear 0.4s ease-out;
}
@keyframes mvp-appear {
  0% { transform: translateY(5px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* ---- ターン解説下のメイン進行ボタン（中央に1個表示） ---- */
.turn-action-area {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 14px;
  margin-bottom: 6px;
  width: 100%;
}
.turn-action-btn {
  padding: 10px 32px;
  font-size: 15px;
  font-weight: bold;
  min-width: 180px;
  box-shadow: 0 4px 12px rgba(77, 171, 247, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.turn-action-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(77, 171, 247, 0.35);
}
.turn-action-btn:active:not(:disabled) {
  transform: translateY(0);
}

.controls { display: flex; justify-content: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

/* ---- バトル演出 (gen3 移植後に追加) ---- */
.genbadge {
  margin: 4px 0 12px; padding: 7px 12px; border-radius: 8px;
  background: var(--panel2); color: var(--sub); font-size: 12.5px;
  animation: genpulse 1.4s ease-in-out infinite;
}
@keyframes genpulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.vsintro {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  padding: 56px 16px; font-size: 21px; font-weight: bold;
  animation: vsin .5s ease-out;
}
.vsintro .vsmark {
  font-size: 34px; color: var(--gold);
  animation: vszoom .9s cubic-bezier(.2, 1.6, .4, 1);
}
@keyframes vsin { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; } }
@keyframes vszoom { from { transform: scale(3.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---- アコーディオン（キャラクター作成） ---- */
.accordion-header {
  width: 100%;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: none;
  border: none;
  color: inherit;
  font-family: inherit;
  padding: 0;
  cursor: pointer;
  outline: none;
}
.accordion-header h2 {
  margin: 0;
}
.accordion-header .icon {
  font-size: 14px;
  color: var(--sub);
  transition: transform 0.3s ease;
}
.accordion-header.active .icon {
  transform: rotate(180deg);
}
#createFormBody {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease-out, opacity 0.3s ease-out, margin-top 0.3s ease-out;
}
#createFormBody.open {
  max-height: 1000px; /* 十分な高さ */
  opacity: 1;
  margin-top: 16px;
}

/* ---- ステータススライダー・ゲージ ---- */
.stat-total-container {
  margin-bottom: 16px;
}
.total-bar {
  background: var(--line);
  border-radius: 6px;
  height: 12px;
  overflow: hidden;
  margin-top: 6px;
}
.bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.2s ease, background-color 0.2s ease;
}
.bar-fill.danger {
  background: var(--accent-b);
}
.stat-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.stat-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.stat-name {
  width: 50px;
  font-size: 14px;
  color: var(--text);
  font-weight: bold;
}
.btn-minus, .btn-plus {
  background: var(--line);
  color: var(--text);
  border: none;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-minus:hover, .btn-plus:hover {
  background: #3a3f5a;
}
.stat-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: var(--line);
  outline: none;
  padding: 0;
  margin: 0;
}
.stat-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  transition: transform 0.1s ease;
}
.stat-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}
.stat-number {
  width: 60px;
  text-align: center;
  padding: 4px 6px;
  font-size: 14px;
}
.stat-number::-webkit-outer-spin-button,
.stat-number::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.stat-number[type=number] {
  -moz-appearance: textfield;
}

/* ---- キャラ切り替え用リストアイテム ---- */
.fighter-select-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  border: 1px solid var(--line);
  transition: background-color 0.2s ease;
}
.fighter-select-item:hover {
  background: rgba(255, 255, 255, 0.06);
}
.fighter-select-item .name {
  font-weight: bold;
  font-size: 14px;
}
.fighter-select-item .info {
  font-size: 12px;
}

/* ---- テーマ切り替えボタン＆設定ボタン (ナビ右端) ---- */
.btn-theme-toggle,
.btn-settings {
  background: none;
  border: 1px solid var(--line);
  color: var(--sub);
  font-size: 16px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  user-select: none;
}
.btn-theme-toggle:hover,
.btn-settings:hover {
  color: var(--text);
  border-color: var(--sub);
  background: rgba(255, 255, 255, 0.05);
}
.btn-theme-toggle:hover {
  transform: scale(1.08);
}
.btn-settings:hover {
  transform: rotate(30deg);
}

[data-theme="light"] .btn-theme-toggle:hover,
[data-theme="light"] .btn-settings:hover {
  background: rgba(0, 0, 0, 0.04);
}
[data-theme="light"] button.btn:not(.ghost):not(.btn-secondary) {
  color: #ffffff;
}
[data-theme="light"] button.btn.ghost {
  background: var(--line);
  color: var(--text) !important;
}
[data-theme="light"] button.btn.ghost:hover {
  background: #e5dcce;
  color: var(--text) !important;
}
[data-theme="light"] .btn-secondary {
  background: var(--panel2);
  color: var(--text) !important;
  border-color: var(--line);
}
[data-theme="light"] .btn-secondary:hover {
  background: var(--line);
  color: var(--text) !important;
}
[data-theme="light"] .card {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .notice.error {
  background: #fff5f5;
  border-color: #ffc9c9;
  color: #c92a2a;
}
[data-theme="light"] .notice.info {
  background: #f1f8ff;
  border-color: #b9dcff;
  color: #1971c2;
}

/* ---- 設定モーダル ---- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modal-fade-in 0.2s ease-out;
}
@keyframes modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  width: 90%;
  max-width: 440px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  animation: modal-slide-up 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modal-slide-up {
  from { transform: translateY(20px) scale(0.97); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel2);
}
.modal-header h3 {
  margin: 0;
  font-size: 16px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-close {
  background: none;
  border: none;
  color: var(--sub);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s ease;
}
.btn-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}
.modal-body {
  padding: 18px;
}
.setting-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.setting-label {
  font-size: 14px;
  font-weight: bold;
  color: var(--text);
}
.speed-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.btn-speed {
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--sub);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}
.btn-speed:hover {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(77, 171, 247, 0.08);
}
.btn-speed.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(77, 171, 247, 0.35);
}
.setting-hint {
  font-size: 12px;
  color: var(--sub);
  margin-top: 4px;
  line-height: 1.5;
}

/* ---- 試合の準備中ステージ ---- */
.preparing-card {
  text-align: center;
  padding: 44px 20px;
  background: var(--panel2);
  border: 1px dashed var(--line);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  animation: modal-fade-in 0.3s ease-out;
}
.preparing-vs {
  font-size: 17px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 22px;
  letter-spacing: 0.04em;
}
.preparing-sword-icon {
  font-size: 40px;
  line-height: 1;
  margin-bottom: 18px;
  display: inline-block;
  user-select: none;
  animation: sword-glow-pulse 1.8s ease-in-out infinite;
}
@keyframes sword-glow-pulse {
  0% {
    transform: scale(0.95);
    filter: drop-shadow(0 0 4px rgba(77, 171, 247, 0.4)) drop-shadow(0 0 8px rgba(77, 171, 247, 0.2));
  }
  50% {
    transform: scale(1.16) rotate(6deg);
    filter: drop-shadow(0 0 14px rgba(77, 171, 247, 0.9)) drop-shadow(0 0 26px rgba(255, 215, 0, 0.65));
  }
  100% {
    transform: scale(0.95);
    filter: drop-shadow(0 0 4px rgba(77, 171, 247, 0.4)) drop-shadow(0 0 8px rgba(77, 171, 247, 0.2));
  }
}
.preparing-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.preparing-submsg {
  font-size: 13.5px;
  color: var(--sub);
  min-height: 1.6em;
  transition: opacity 0.25s ease;
}
.preparing-safety-badge {
  display: inline-block;
  margin-top: 14px;
  font-size: 12px;
  font-weight: bold;
  color: var(--accent);
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 20px;
  padding: 4px 12px;
}


/* ---- レーティング ツールチップ ---- */
.rating-tooltip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: help;
  user-select: none;
  white-space: nowrap;
  vertical-align: middle;
  outline: none;
}
.rating-badge-label {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border-bottom: 1px dashed rgba(255, 146, 43, 0.7);
  padding-bottom: 1px;
  transition: all 0.15s ease;
}
.rating-tooltip-wrap:hover .rating-badge-label,
.rating-tooltip-wrap:focus-visible .rating-badge-label,
.rating-tooltip-wrap.active .rating-badge-label {
  border-bottom-color: #ff922b;
  color: #fff;
}
.rating-tooltip-box {
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #181d33;
  border: 1px solid #333a5e;
  color: var(--text);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.5;
  width: max-content;
  max-width: 280px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s;
  z-index: 500;
  white-space: normal;
  text-align: left;
  cursor: default;
}
.rating-tooltip-box::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: #181d33 transparent transparent transparent;
}
.rating-tooltip-box::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 7px;
  border-style: solid;
  border-color: #333a5e transparent transparent transparent;
  z-index: -1;
}

/* ホバー・フォーカス・アクティブ(タップ)時の表示 */
.rating-tooltip-wrap:hover .rating-tooltip-box,
.rating-tooltip-wrap:focus-visible .rating-tooltip-box,
.rating-tooltip-wrap.active .rating-tooltip-box {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.rating-tooltip-title {
  display: block;
  font-weight: bold;
  font-size: 13px;
  color: #ff922b;
  margin-bottom: 4px;
}
.rating-tooltip-desc {
  display: block;
  color: #d1d6e8;
  font-size: 12px;
}
.rating-tooltip-desc b {
  color: #ffd166;
  font-weight: 700;
}
.rating-tooltip-sub {
  display: block;
  font-size: 11px;
  color: var(--sub);
  margin-top: 4px;
}

/* レコード行共通 */
.record-line-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 13px;
  margin-top: 4px;
}

/* インライン タブ切り替えリンク */
.tab-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  font-weight: 700;
  transition: opacity 0.2s ease;
}
.tab-link:hover {
  opacity: 0.75;
}

/* ホーム画面の召喚ボタン中央配置ラッパー */
.create-btn-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 18px 0 26px;
  width: 100%;
}

.btn-summon-open {
  background: linear-gradient(135deg, var(--accent), #d97706);
  color: #ffffff;
  font-weight: 800;
  font-size: 15px;
  padding: 11px 32px;
  border-radius: 999px;
  border: none;
  box-shadow: 0 4px 16px rgba(26, 127, 166, 0.3);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.02em;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.btn-summon-open:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(26, 127, 166, 0.42);
}
.btn-summon-open:active {
  transform: translateY(0);
}

/* モーダル共通ボタンスタイル */
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 14px;
  flex-wrap: wrap;
}
.btn-secondary {
  background: var(--panel2);
  color: var(--sub);
  border: 1px solid var(--line);
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.btn-secondary:hover {
  background: var(--line);
  color: var(--text);
}

/* 召喚入力モーダル */
.modal-create {
  max-width: 520px;
  width: 90%;
}

/* メガテン風 召喚結果演出モーダル */
.modal-summon-result {
  max-width: 560px;
  width: 92%;
  border: 2px solid var(--gold);
  box-shadow: 0 10px 30px rgba(217, 119, 6, 0.25), 0 0 20px rgba(26, 127, 166, 0.15);
  animation: summonModalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes summonModalPop {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.summon-header-aura {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  background: linear-gradient(90deg, rgba(217, 119, 6, 0.15), rgba(26, 127, 166, 0.15));
  border-bottom: 1px solid var(--line);
  border-radius: 12px 12px 0 0;
}
.summon-icon-glow {
  font-size: 20px;
  animation: glowPulse 1.5s infinite alternate;
}
.summon-header-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--gold);
  margin: 0;
  flex: 1;
}

/* メガテン風 セリフウィンドウ (Megaten Dialogue Box) */
.megaten-dialog-box {
  background: #090c14;
  color: #e2e8f0;
  border: 2px solid #38bdf8;
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 14px;
  position: relative;
  box-shadow: inset 0 0 12px rgba(56, 189, 248, 0.2), 0 4px 12px rgba(0, 0, 0, 0.3);
}
.megaten-dialog-box::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  right: 3px;
  bottom: 3px;
  border: 1px dashed rgba(56, 189, 248, 0.4);
  border-radius: 4px;
  pointer-events: none;
}

.megaten-speaker {
  display: inline-block;
  background: #0284c7;
  color: #ffffff;
  font-weight: 800;
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.megaten-text {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.6;
  color: #f8fafc;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  font-family: 'Hiragino Mincho ProN', 'Yu Mincho', 'BIZ UDPMincho', serif, sans-serif;
  letter-spacing: 0.02em;
}

.summon-char-card {
  border: 1px solid var(--line);
  background: var(--panel);
}

/* アプリ共通フッター */
.app-footer {
  text-align: center;
  color: var(--sub);
  font-size: 0.85rem;
  margin-top: 3rem;
  padding: 1.5rem 0 1rem;
  border-top: 1px solid var(--line);
}

.footer-copy {
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.footer-links {
  font-size: 0.78rem;
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  margin-top: 0.3rem;
}

.footer-links a {
  color: var(--sub);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: var(--accent);
}

/* ---- 注目 LIVE 対戦ピックアップ ---- */
.live-match-card {
  position: relative;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(245, 158, 11, 0.06) 50%, var(--panel) 100%);
  border: 1.5px solid rgba(239, 68, 68, 0.35);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.12);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

[data-theme="light"] .live-match-card {
  background: linear-gradient(135deg, #fff5f5 0%, #fffbf0 50%, #ffffff 100%);
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: 0 4px 16px rgba(220, 38, 38, 0.1);
}

.live-match-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ef4444;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 9999px;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
}

.live-dot {
  width: 8px;
  height: 8px;
  background-color: #ffffff;
  border-radius: 50%;
  animation: live-pulse 1.4s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes live-pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.3;
    transform: scale(1.3);
  }
}

.live-subtitle {
  font-size: 13px;
  font-weight: 600;
  color: var(--sub);
}

.live-match-body {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 12px 10px;
  background: var(--panel2);
  border-radius: 8px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
}

.live-fighter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  text-align: center;
}

.live-fighter-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  word-break: break-word;
}

.live-fighter.attacker .live-fighter-name {
  color: #3b82f6;
}

.live-fighter.defender .live-fighter-name {
  color: #ef4444;
}

.live-vs {
  font-size: 18px;
  font-weight: 900;
  font-style: italic;
  color: #f59e0b;
  padding: 0 16px;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.live-match-action {
  display: flex;
  justify-content: center;
}

.btn-live-watch {
  background: linear-gradient(135deg, #ef4444 0%, #f59e0b 100%);
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  padding: 10px 24px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.03em;
}

.btn-live-watch:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
  filter: brightness(1.08);
}

.btn-live-watch:active {
  transform: translateY(0);
}

/* ---- チケットナビゲーションボタン ---- */
.btn-ticket-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 9999px;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 700;
}

.btn-ticket-nav:hover {
  border-color: var(--accent);
  background: rgba(77, 171, 247, 0.1);
  transform: translateY(-1px);
}

.ticket-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--panel);
  padding: 2px 7px;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.ticket-add-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

/* ---- チケットモーダル詳細グリッド ---- */
.ticket-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 6px;
}

.ticket-detail-card {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  text-align: center;
}

.ticket-detail-header {
  font-size: 12.5px;
  font-weight: bold;
  color: var(--sub);
  margin-bottom: 6px;
}

.ticket-detail-count {
  font-size: 20px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 4px;
}

.ticket-detail-sub {
  font-size: 11.5px;
  color: var(--sub);
}

/* ---- 文字数カウンター ---- */
.char-counter {
  font-size: 11.5px;
  color: var(--sub);
  font-family: monospace;
  transition: color 0.15s ease;
}

.char-counter.warning {
  color: #f59e0b;
  font-weight: bold;
}

.char-counter.limit {
  color: #ef4444;
  font-weight: bold;
}

/* ---- JavaScript 無効ブラウザ検知・遮断画面 ---- */
.no-js nav,
.no-js main {
  display: none !important;
}

.no-js-screen {
  position: fixed;
  inset: 0;
  background: #0f172a;
  color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 999999;
  font-family: 'Noto Sans JP', sans-serif;
  text-align: center;
}

.no-js-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 16px;
  max-width: 480px;
  padding: 36px 24px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.no-js-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.no-js-card h2 {
  font-size: 20px;
  margin-bottom: 12px;
  color: #f1f5f9;
}

.no-js-card p {
  font-size: 14px;
  line-height: 1.6;
  color: #94a3b8;
  margin-bottom: 14px;
}

.no-js-hint {
  font-size: 12.5px;
  color: #cbd5e1;
  background: #0f172a;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid #334155;
  line-height: 1.5;
}

/* ---- 注目の対戦 ソートピル ＆ バッジ ---- */
.feed-sort-pills {
  display: flex;
  gap: 6px;
  background: var(--bg);
  padding: 4px;
  border-radius: 20px;
  border: 1px solid var(--line);
}

.btn-sort-pill {
  background: transparent;
  border: none;
  color: var(--sub);
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-sort-pill:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .btn-sort-pill:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn-sort-pill.active {
  background: var(--primary, #3b82f6);
  color: #fff !important;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.feed-stats-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
}

.feed-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.04);
  color: var(--sub);
}

[data-theme="dark"] .feed-badge {
  background: rgba(255, 255, 255, 0.06);
}

.feed-badge.hot {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.feed-badge.views {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.feed-badge.likes {
  background: rgba(236, 72, 153, 0.1);
  color: #ec4899;
}

.feed-rank-medal {
  font-size: 16px;
  margin-right: 4px;
  display: inline-flex;
  align-items: center;
}

/* ---- SNS・バイラル共有 ＆ 挑戦状スタイル ---- */
.btn-share-x {
  background: #000000;
  color: #ffffff !important;
  border: 1px solid #333333;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}

[data-theme="dark"] .btn-share-x {
  background: #ffffff;
  color: #000000 !important;
  border-color: #ffffff;
}

.btn-share-x:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.challenge-banner-card {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(168, 85, 247, 0.12));
  border: 2px solid #ef4444;
  border-radius: 12px;
  padding: 16px 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.15);
}

.challenge-banner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.challenge-banner-title {
  font-size: 16px;
  font-weight: 900;
  color: #ef4444;
  display: flex;
  align-items: center;
  gap: 6px;
}

.challenge-banner-body {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text);
}

/* ---- 召喚中ローディング演出 & ロック ---- */
.summon-loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  background: rgba(99, 102, 241, 0.06);
  border: 1px dashed var(--accent);
  border-radius: 12px;
  margin-top: 14px;
  text-align: center;
  animation: fadeIn 0.2s ease;
}

.summon-loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(99, 102, 241, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}

.summon-loading-title {
  font-size: 15px;
  font-weight: bold;
  color: var(--accent);
  margin-bottom: 6px;
}

.summon-loading-sub {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.4;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---- 自作バトル・未読（結果未確認）強調スタイル ---- */
.card.unwatched-my-battle {
  border: 1.5px solid #ff4d4f;
  background: linear-gradient(135deg, rgba(255, 77, 79, 0.08), rgba(99, 102, 241, 0.05));
  box-shadow: 0 4px 14px rgba(255, 77, 79, 0.18);
  position: relative;
}

[data-theme="light"] .card.unwatched-my-battle {
  border: 1.5px solid #e03131;
  background: linear-gradient(135deg, #fff5f5, #f8f0fc);
  box-shadow: 0 4px 14px rgba(224, 49, 49, 0.12);
}

.badge.unwatched-badge {
  background: #ff4d4f;
  color: #ffffff;
  font-weight: 800;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  animation: unwatched-pulse 1.8s ease-in-out infinite;
  box-shadow: 0 2px 6px rgba(255, 77, 79, 0.4);
}

@keyframes unwatched-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.04);
    opacity: 0.88;
  }
}

.btn.btn-watch-unwatched {
  background: linear-gradient(135deg, #ff4d4f, #f5222d);
  color: #ffffff !important;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(255, 77, 79, 0.35);
}

.btn.btn-watch-unwatched:hover {
  filter: brightness(1.1);
}

/* ---- 認証・ユーザー管理 & ゲストバナー ---- */
.btn-user-nav {
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-user-nav:hover {
  border-color: var(--accent);
  background: rgba(77, 171, 247, 0.08);
}

.btn-user-nav.logged-in {
  border-color: rgba(77, 171, 247, 0.4);
  background: rgba(77, 171, 247, 0.06);
}

.btn-user-nav[disabled],
.btn-user-nav.loading {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  background: var(--panel2);
  border-color: var(--line);
  color: var(--muted);
  filter: grayscale(0.8);
}

.guest-banner {
  background: linear-gradient(135deg, rgba(77, 171, 247, 0.08), rgba(105, 219, 124, 0.08));
  border: 1px solid rgba(77, 171, 247, 0.25);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.guest-banner-icon {
  font-size: 24px;
  line-height: 1;
}

.guest-banner-body {
  flex: 1;
  min-width: 220px;
}

.guest-banner-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.guest-banner-desc {
  font-size: 12.5px;
  color: var(--sub);
  line-height: 1.4;
}

.btn-guest-action {
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
}

.auth-tabs button.btn-tab-auth {
  font-weight: 700;
  font-size: 13.5px;
  padding: 8px 12px;
}

.auth-tabs button.btn-tab-auth.active {
  background: var(--accent);
  color: #fff !important;
  border-color: var(--accent);
}

/* ---- 📖 遊び方ナビボタン & ヘルプモーダル ---- */
.btn-help-nav {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(26, 127, 166, 0.1);
  color: var(--accent);
  border: 1px solid rgba(26, 127, 166, 0.3);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-help-nav:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-1px);
}

.help-step-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 14px;
  position: relative;
}

.help-step-num {
  display: inline-block;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--accent);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
}

.help-step-title {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.help-step-desc {
  font-size: 13.5px;
  color: var(--sub);
  line-height: 1.6;
}

.help-tip {
  display: inline-block;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--text);
  background: rgba(217, 119, 6, 0.08);
  border: 1px dashed rgba(217, 119, 6, 0.35);
  border-radius: 6px;
  padding: 6px 10px;
}

/* ---- タイムライン Load More ボタン ---- */
#btnLoadMoreFeed:hover {
  background: var(--card-bg);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ---- リスト共通 ローディングアニメーション ---- */
.list-loading-skeleton {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 36px 20px;
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--sub);
  font-size: 14px;
  margin-bottom: 16px;
}

.loading-spinner-dots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.loading-spinner-dots span {
  width: 8px;
  height: 8px;
  background-color: var(--accent);
  border-radius: 50%;
  display: inline-block;
  animation: dotBounce 1.4s infinite ease-in-out both;
}

.loading-spinner-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.loading-spinner-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

.loading-spinner-dots span:nth-child(3) {
  animation-delay: 0s;
}

@keyframes dotBounce {
  0%, 80%, 100% {
    transform: scale(0.4);
    opacity: 0.3;
  }
  40% {
    transform: scale(1.1);
    opacity: 1;
  }
}

/* ---- トースト通知 (画面下部ポップアップ) ---- */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: 90%;
  max-width: 440px;
}

.toast-item {
  background: rgba(16, 20, 36, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #f0f2fa;
  border: 1px solid rgba(77, 163, 255, 0.45);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.25);
  border-radius: 30px;
  padding: 10px 22px;
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

[data-theme="light"] .toast-item {
  background: rgba(255, 255, 255, 0.96);
  color: #1a1f35;
  border-color: rgba(26, 127, 166, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14), 0 2px 6px rgba(0, 0, 0, 0.08);
}

.toast-item.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ---- 引退キャラクター (殿堂入りアーカイブ) UI ---- */
.retired-section-wrap {
  margin-top: 32px;
  border-top: 1px dashed var(--line);
  padding-top: 20px;
}

.retired-header-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  user-select: none;
}

.retired-header-card:hover {
  background: var(--card-bg, rgba(255, 255, 255, 0.04));
  border-color: var(--accent);
}

.retired-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.retired-count-badge {
  background: rgba(140, 150, 180, 0.15);
  color: var(--sub);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
}

.retired-body {
  margin-top: 14px;
}

.retired-filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.retired-search-input {
  flex: 1;
  min-width: 180px;
  padding: 8px 12px;
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
}

.retired-search-input:focus {
  outline: none;
  border-color: var(--accent);
}

.retired-sort-select {
  padding: 8px 12px;
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.retired-sort-select:focus {
  outline: none;
  border-color: var(--accent);
}

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

.retired-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  opacity: 0.85;
  transition: opacity 0.15s, transform 0.15s, border-color 0.15s;
}

.retired-card:hover {
  opacity: 1;
  border-color: var(--sub);
  transform: translateY(-1px);
}

.retired-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.retired-card-name {
  font-weight: 700;
  font-size: 14.5px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.retired-tag {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(150, 150, 150, 0.15);
  color: var(--sub);
  flex-shrink: 0;
}

.retired-card-meta {
  font-size: 12.5px;
  color: var(--sub);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.retired-card-skills {
  font-size: 11.5px;
  color: var(--sub);
  opacity: 0.8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}

.retired-load-more-wrap {
  text-align: center;
  margin-top: 14px;
}

/* ---- キャラクターセリフ (登場時メッセージ) ---- */
.char-greeting-quote {
  font-size: 13px;
  color: var(--text);
  background: var(--card-bg, rgba(255, 255, 255, 0.04));
  border-left: 3px solid var(--accent);
  padding: 5px 10px;
  margin: 6px 0 8px 0;
  border-radius: 0 8px 8px 0;
  line-height: 1.45;
  word-break: break-word;
  font-style: italic;
}

[data-theme="light"] .char-greeting-quote {
  background: rgba(26, 127, 166, 0.07);
  border-left-color: var(--accent);
  color: #2b303a;
}

/* ---- 対戦日時バッジ ---- */
.battle-date-tag {
  font-size: 11.5px;
  color: var(--sub);
  background: rgba(150, 150, 150, 0.08);
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

[data-theme="light"] .battle-date-tag {
  background: rgba(0, 0, 0, 0.05);
  color: #5c5f66;
}

/* ---- キャラクター個別対戦履歴 ---- */
.char-battles-container {
  margin-top: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  max-height: 200px;
  overflow-y: auto;
  font-size: 12.5px;
}

.char-battle-list {
  display: flex;
  flex-direction: column;
}

.char-battle-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
  flex-wrap: wrap;
}

.char-battle-item:last-child {
  border-bottom: none;
}

.char-battle-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.char-battle-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.char-battle-opponent {
  color: var(--text);
}

.char-battle-date {
  color: var(--sub);
  font-size: 11px;
  white-space: nowrap;
}

.char-battle-empty {
  padding: 12px;
  color: var(--sub);
  text-align: center;
}

.char-battle-error {
  padding: 12px;
  color: #ef4444;
  text-align: center;
}

[data-theme="light"] .char-battles-container {
  background: #f8f9fa;
}
