/* css/style.css */

/* =========================================
   1. 変数
   ========================================= */
:root {
    /* メインカラー */
    --primary-color: #8BC34A;
    --primary-dark: #689F38;
    --bg-color: #F9F9F9;
    --bg-light: #FFF;
    --text-color: #333333;
    --gray-text: #666666;
    --border-color: #e5e7eb;
    --danger-color: #ef5350;

    /* 個人カラー */
    --renga: #DCAA3C;
    --kafka: #A58CFF;
    --ten: #C8D7EB;
    --yukikaze: #46BEFF;
    --liguang: #FF3214;
    --akuta: #FF8232;
    --kiroku: #AF5AE6;
    --nanaki: #37C3B9;
    --muneuji: #FFA5D2;
    --ushio: #96F032;
    --raito: #41916E;
    --kinari: #EBC8FF;
    --chihiro: #46EB9B;
    --tao: #5A9BC8;
    --kuguri: #DC376E;
    --nagi: #736EEB;
    --toi: #FFDC64;
    --ryui: #FF507D;
    --yodaka: #F0E6AA;
    --netaro: #FF32C8;
    --conductor: #C5D8C2;

    /* メインメニュー */
    --col-tool: #FF9800;
    --col-data: #03A9F4;
    --col-info: #8BC34A;
    --col-link: #9E9E9E;

    /* 班別カラー */
    --ward-morning-bg: #6799CE; --ward-morning-text: #1A3B5C;
    --ward-day-bg: #FFDA62;     --ward-day-text: #735600;
    --ward-evening-bg: #DE7D4D; --ward-evening-text: #59260E;
    --ward-night-bg: #6E5D9C;   --ward-night-text: #2A1F45;

    /* イベント種別カラー */
    --tag-event-bg: #dbeafe; --tag-event-text: #1e40af;
    --tag-voice-bg: #cffafe; --tag-voice-text: #0e7490;
    --tag-real-bg: #fef9c3;  --tag-real-text: #a16207;
    --tag-mag-bg: #dcfce7;   --tag-mag-text: #166534;
    --tag-novel-bg: #fce7f3; --tag-novel-text: #9d174d;

    /* レイアウト */
    --radius-md: 8px;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-float: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* =========================================
   2. ベーススタイル 
   ========================================= */
* { box-sizing: border-box;}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

.special-link {
  color: var(--primary-color);
  text-decoration: underline;
}

.special-link:hover,
.special-link:active{
  color: var(--primary-dark);
  text-decoration: none;
}

h1, h2, h3 {
    margin: 0;
}

h1 {
    font-size: 1.3rem;
    color: var(--primary-dark);
    letter-spacing: 0.05em;
}

h2 {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--primary-color);
    margin: 20px 0 10px 0;
}

/* =========================================
   3. レイアウト・ヘッダー・フッター
   ========================================= */
header {
    background-color: var(--bg-light);
    border-bottom: 3px solid var(--primary-color);
    padding: 0.8rem 0;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    position: relative;
    z-index: 100;
}

.header-inner {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.year-header {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--primary-color);
    margin: 20px 0 10px 0;
    border-bottom: 1px solid var(--primary-color);
    padding-bottom: 5px;
}

footer {
    text-align: center;
    font-size: 0.8rem;
    color: var(--gray-text);
    padding: 20px;
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
}

.container {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 20px 40px 20px;
}

/* ハンバーガーメニュー */
.menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    width: 30px;
    height: 30px;
    position: relative;
    padding: 0;
    z-index: 102;
}

.menu-btn span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--primary-dark);
    position: absolute;
    left: 0;
    transition: all 0.3s;
    border-radius: 3px;
}

.menu-btn span:nth-child(1) { top: 4px; }
.menu-btn span:nth-child(2) { top: 13px; }
.menu-btn span:nth-child(3) { top: 22px; }

.menu-btn.open span:nth-child(1) { top: 13px; transform: rotate(45deg); }
.menu-btn.open span:nth-child(2) { opacity: 0; }
.menu-btn.open span:nth-child(3) { top: 13px; transform: rotate(-45deg); }

.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 250px;
    height: 100%;
    background: var(--bg-light);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 101;
    transition: right 0.3s ease;
    padding-top: 80px;
    display: flex;
    flex-direction: column;
}

.mobile-menu.open { right: 0; }

.mobile-menu a {
    padding: 15px 25px;
    border-bottom: 1px solid #eee;
    font-weight: bold;
    color: var(--text-color);
}

.mobile-menu a:hover {
    background-color: #f9f9f9;
    color: var(--primary-color);
}

.mobile-menu a.active {
    color: var(--bg-light);
    background-color: var(--primary-color);
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    display: none;
}
.menu-overlay.open { display: block; }

/* FAB */
.fab-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 56px;
    height: 56px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    border: none;
    cursor: pointer;
    z-index: 99;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background-color 0.2s;
}
.fab-btn:hover { background-color: var(--primary-dark); transform: scale(1.05); }
.fab-btn:active { transform: scale(0.95); }
.fab-btn .material-symbols-outlined { font-size: 28px; }

.material-icons {
  display: inline-flex;
  vertical-align: middle;
}
/* =========================================
   4. 共通コンポーネント
   ========================================= */
/* --- カード・ボックス共通スタイル --- */
.menu-card,
.timeline-content,
.noti-item,
.link-content,
.content-card,
.control-panel,
.card-item,
.dash-box,
.notice {
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}
.notice {
    max-width: 660px;
    width: calc(100% - 40px);
    margin: 0 auto;
    padding: 0.5em 20px;
}

/* --- ボタン共通スタイル --- */
.btn,
.clear-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    font-family: inherit;
    line-height: 1;
    border-radius: 99px; /* Pill shape defaults */
}

.btn:hover, .clear-button:hover { opacity: 0.9; transform: translateY(-1px); }
.btn:active, .clear-button:active { transform: translateY(1px); }
.btn:disabled, .clear-button:disabled { cursor: not-allowed; opacity: 0.6; background-color: var(--border-color); }

/* サイズ */
.btn-md { padding: 10px 20px; font-size: 0.95rem; font-weight: bold; }
.btn-icon { width: 40px; height: 40px; border-radius: 50%; padding: 0; }

/* 色バリエーション */
.btn-primary { background-color: var(--primary-color); color: #fff; }
.btn-blue    { background-color: var(--col-data); color: #fff; }
.btn-danger  { background-color: var(--danger-color); color: #fff; }
.btn-black   { background-color: #000; color: #fff; }
.btn-ghost   { background-color: transparent; color: var(--gray-text); border: 1px solid #ccc; }

.clear-button {
    width: 100%;
    padding: 12px;
    font-size: 1em;
    font-weight: bold;
    color: var(--bg-light);
    background-color: var(--primary-dark);
    border-radius: 8px; /* Slightly less rounded */
    margin-top: 20px;
}

/* --- フォーム要素共通 --- */
input[type="text"], input[type="number"], input[type="date"], input[type="time"],
select, textarea, .form-control {
    width: 100%;
    padding: 10px 12px;
    margin-top: 5px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background-color: var(--bg-light);
    color: var(--text-color);
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
}

input:focus, select:focus, textarea:focus, .form-control:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 5px rgba(139, 195, 74, 0.2);
}

/* チェックボックス */
input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-text); 
    border-radius: 99px; 
    background-color: var(--bg-light);
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin: 0 0 2px 0; 
    transition: all 0.1s ease;
}

input[type="checkbox"]:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* チェックマーク */
input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 45%;
    left: 50%;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -50%) rotate(45deg) scale(0);
}

/* チェックが入った瞬間にマークを拡大表示 */
input[type="checkbox"]:checked::after {
    transform: translate(-50%, -50%) rotate(45deg) scale(1);
}

input[type="checkbox"]:hover {
    border-color: var(--primary-color);
}

/* --- フィルターボタン群 --- */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.filters-container {
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 15px;
    box-shadow: var(--shadow-sm);
}

/* 区切り線（ボーダー） */
.filter-separator {
    height: 1px;
    background-color: var(--border-color);
    margin: 15px 0;
    width: 100%;
}

.filters button {
    font-size: 0.85rem;
    padding: 5px 12px;
    border: 1px solid var(--primary-color);
    border-radius: 999px;
    background: var(--bg-light);
    cursor: pointer;
    transition: background 0.2s;
    color: var(--primary-color);
}
.filters button:hover { background: #f9fafb; }
.filters button.on {
    background: var(--primary-color);
    color: var(--bg-light);
    font-weight: bold;
}

/* --- タグ --- */
.tag {
    display: inline-block;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #374151;
    margin-left: 8px;
    white-space: nowrap;
    font-weight: bold;
    vertical-align: middle;
}

.tag.type-event, .tag-event { background-color: var(--tag-event-bg); color: var(--tag-event-text); }
.tag.type-voice, .tag-voice { background-color: var(--tag-voice-bg); color: var(--tag-voice-text); }
.tag.type-real,  .tag-real  { background-color: var(--tag-real-bg);  color: var(--tag-real-text); }
.tag.type-mag,   .tag-mag   { background-color: var(--tag-mag-bg);   color: var(--tag-mag-text); }
.tag.type-novel, .tag-novel { background-color: var(--tag-novel-bg); color: var(--tag-novel-text); }

/* Notification用 (Morning, Day, Evening, Night) */
.tag.morning, .tag-morning { background-color: var(--ward-morning-bg); color: var(--ward-morning-text); }
.tag.day,     .tag-day     { background-color: var(--ward-day-bg);     color: var(--ward-day-text); }
.tag.evening, .tag-evening { background-color: var(--ward-evening-bg); color: var(--ward-evening-text); }
.tag.night,   .tag-night   { background-color: var(--ward-night-bg);   color: var(--ward-night-text); }

/* --- ポップアップ --- */
.popup {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center; align-items: center;
    z-index: 200;
}
.popup-content {
    background-color: var(--bg-light);
    padding: 30px 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow-float);
    min-width: 320px;
}
.popup-content p { margin-bottom: 25px; font-size: 1.2em; }
.popup-buttons { display: flex; justify-content: center; gap: 10px; }


/* =========================================
   5. ページ別スタイル: トップ
   ========================================= */
.dashboard-area {
    display: flex; gap: 20px; margin-bottom: 30px;
    flex-wrap: wrap; align-items: stretch;
}
.dash-box {
    padding: 15px; text-align: center; color: var(--primary-dark);
    background: linear-gradient(135deg, #f1f8e9 0%, #ffffff 100%);
    border: 1px solid #dcedc8;
}
.dash-box h2 {
    font-size: 1rem; margin: 0 0 10px 0;
    display: inline-block;
    border-bottom: 1px dashed var(--primary-color);
}
.daily-corner { flex: 1 1 auto; min-width: 200px; }
.countdown-corner {
    display: none; flex: 0 0 auto; width: auto; min-width: 180px;
    background: linear-gradient(135deg, #fff3e0 0%, #ffffff 100%);
    border-color: #ffe0b2; color: #ef6c00;
}
.countdown-corner h2 { color: #ff9800; border-bottom-color: #ff9800; }

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px; margin-bottom: 40px;
}
.menu-card {
    padding: 20px;
    display: flex; flex-direction: column; justify-content: space-between;
    border-left: 5px solid #ddd;
}
.menu-card:hover { transform: translateY(-3px); box-shadow: 0 8px 15px rgba(0,0,0,0.1); }

/* Menu Type Colors */
.menu-card.type-tool { border-left-color: var(--col-tool); }
.menu-card.type-data { border-left-color: var(--col-data); }
.menu-card.type-info { border-left-color: var(--col-info); }
.menu-card.type-link { border-left-color: var(--col-link); }

.card-title { font-size: 1.2rem; font-weight: bold; margin-bottom: 10px; border-bottom: 1px solid var(--border-color); padding-bottom: 8px; }
.card-desc { font-size: 0.9rem; color: var(--gray-text); margin-bottom: 15px; }

.btn-link {
    display: inline-block; padding: 8px 16px; border-radius: 20px;
    font-size: 0.85rem; color: white; align-self: flex-start;
    background-color: #ccc;
}
.type-tool .btn-link { background-color: var(--col-tool); }
.type-data .btn-link { background-color: var(--col-data); }
.type-info .btn-link { background-color: var(--col-info); }
.type-link .btn-link { background-color: var(--col-link); }


/* =========================================
   6. ページ別スタイル: ストーリー
   ========================================= */
/* ストーリー */
.timeline-container { position: relative; }
.timeline-content {
    display: flex; align-items: center;
    padding: 12px 15px;
    margin-bottom: 10px;
    border-left: 5px solid #ccc; /* Default */
}
/* 左ボーダー色分け */
.type-event .timeline-content { border-left-color: var(--tag-event-bg); }
.type-voice .timeline-content { border-left-color: var(--tag-voice-bg); }
.type-real .timeline-content  { border-left-color: var(--tag-real-bg); }
.type-mag .timeline-content   { border-left-color: var(--tag-mag-bg); }
.type-novel .timeline-content { border-left-color: var(--tag-novel-bg); }

/* キーストーリー強調 */
.timeline-item.highlight .timeline-content {
    background: #fffbeb;
    border-left: 4px solid var(--tag-event-bg);
}

.tl-date {
    width: 60px; flex-shrink: 0; text-align: center; line-height: 1.2;
    font-size: 0.9rem; color: var(--gray-text);
}
.tl-title { flex-grow: 1; font-size: 1rem; padding: 0 15px;  display: block; margin: 0; }

/* =========================================
   7. ページ別スタイル: リンク
   ========================================= */
.link-content {
    display: flex; align-items: center;
    padding: 12px 15px; margin: 0 0 0.5em 0;
    border-left: 5px solid #ccc;
}
.link-content:hover { transform: translateY(2px); box-shadow: var(--shadow-md); }
.link-title { flex-grow: 1; font-size: 1rem; padding: 0 15px; font-weight: 500; }
.link-text { font-size: 0.8em; color: var(--gray-text); }

.link-content.type-illust { border-left-color: var(--col-tool); }
.link-content.type-music { border-left-color: var(--col-data); }
.link-content.type-info { border-left-color: var(--col-info); }
.link-content.type-link { border-left-color: var(--col-link); }


/* =========================================
   8. ページ別スタイル: 通知
   ========================================= */
.noti-list { display: flex; flex-direction: column; gap: 1rem; }
.noti-item {
    padding: 1.2rem 2em;
    display: grid; grid-template-columns: auto 1fr;
    gap: 0 1rem; align-items: stretch;
}
.noti-date-box {
    grid-column: 1 / 2; grid-row: 1 / 2; width: 3.5em;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    border-right: 1px solid var(--border-color);
    padding-right: 1rem; margin-right: -1px;
    font-size: 0.85rem; color: var(--gray-text); line-height: 1.3;
}
.noti-date-box span:last-child { font-size: 1rem; }
.noti-header {
    grid-column: 2 / 3; grid-row: 1 / 2;
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 8px; padding-bottom: 2px;
}
.noti-title { font-size: 0.9rem; font-weight: bold; color: var(--gray-text); }
.noti-content-box { display: contents; }
.noti-body {
    grid-column: 1 / 3; grid-row: 2 / 3;
    margin-top: 0.8rem; padding-top: 1rem;
    border-top: 1px dashed var(--border-color);
    font-size: 1.05rem; line-height: 1.7; color: var(--text-color);
}


/* =========================================
   9. ページ別スタイル: AP計算機
   ========================================= */
/* カード入力フォーム */
.form-container { display: flex; justify-content: space-around; align-items: center; margin-bottom: 15px; }
.form-item {
    display: flex; flex-direction: column; align-items: center; justify-content: space-around;
    width: 30%; max-width: none;
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 5px;
}

.input-row {
    display: flex;
    flex-direction: row; /* 横並び */
    align-items: center;
    justify-content: center;
    gap: 0.5em; /* ボタンと数字の間隔 */
    margin-top: 5px;
}

.card-label { font-size: 0.9rem; font-weight: bold; color: var(--primary-dark); margin-bottom: 8px; }
.number-display { font-size: 1.4rem; font-weight: bold; margin: 0.3em 0; text-align: center; }

.up-button, .down-button {
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    color: var(--primary-color);
    width: 30px; height: 30px; border-radius: 50%;
    cursor: pointer; font-size: 0.8rem;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.up-button:hover, .down-button:hover { background-color: var(--primary-color); color: var(--bg-light); border-color: var(--primary-color); }
.up-button:disabled, .down-button:disabled { background-color: var(--border-color); color: #ccc; cursor: auto; }
#card-input-container.disabled { opacity: 0.5; pointer-events: none; }

/* 手入力トグル */
#manual-bonus-section { text-align: center; margin-top: 15px; padding-top: 10px; border-top: 1px dashed var(--border-color); }
#manual-bonus-section label { display: inline-flex; align-items: center; cursor: pointer; font-size: 0.9rem; }
#manual-bonus-section input[type="checkbox"] { margin-right: 8px; accent-color: var(--primary-color); }
.bonus-rate-row { margin-top: 8px; display: flex; justify-content: center; align-items: center; }
#bonus-rate-input { width: 80px; font-weight: bold; text-align: right; margin: 0 5px; padding: 8px; }
#bonus-rate-input:disabled { background-color: #eee; color: #aaa; }

/* 難易度ラジオボタン */
.radio-group { display: flex; border-radius: 8px; overflow: hidden; border: 1px solid var(--border-color); margin: 1em 0; }
.radio-group .radio-area { position: relative; flex: 1; }
.radio-group .radio-area:last-child { border-right: none; }
.radio-group label {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: var(--bg-color); color: var(--gray-text);
    display: flex; align-items: center; justify-content: center;
    pointer-events: none; transition: all 0.02s;
}
.radio-group input[type="radio"] { position: relative; width: 100%; height: 3em; opacity: 0; cursor: pointer; }
.radio-group input[type="radio"]:checked + label { background-color: var(--primary-color); color: var(--bg-color); font-weight: bold; }
.radio-group input[type="radio"]:not(:checked):hover + label { background-color: #f0f0f0; }

form#expert-form { margin-top: 15px; }
form#expert-form label { display: inline-flex; align-items: center; cursor: pointer; }
form#expert-form input[type="checkbox"] { margin-right: 8px; }

/* 日時・結果表示 */
.date-time-container { display: flex; gap: 10px; margin-bottom: 15px; }
.date-time-container input { flex: 1; }

.countdown-container, #result-message {
    font-size: 1.05em; font-weight: bold; text-align: center;
    padding: 15px; margin-bottom: 15px; min-height: 1.2em;
    background-color: var(--bg-light);
    border: 1px solid var(--border-color); border-radius: 8px;
}
.countdown-container p, #result-message { margin: 0; }

.lap-buttons { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 20px; }
.lap-buttons button {
    flex: 1 1 18%; min-width: 30px; padding: 8px 0;
    font-size: 14px;
    border: 1px solid var(--border-color); border-radius: 4px;
    background-color: var(--bg-light); cursor: pointer;
    transition: background-color 0.2s;
}
.lap-buttons button:active { background-color: var(--border-color); }
.lap-buttons button:disabled { background-color: var(--border-color); color: var(--gray-text); cursor: auto; }



/* =========================================
   10. ページ別スタイル: カード一覧
   ========================================= */
.card-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.card-item {
    padding: 12px 15px;
    border-left: 5px solid #ccc; /* Rarity placeholder */
}
.card-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* Rarity Colors */
.type-ssr { border-left-color: #FFD700; }
.type-sr { border-left-color: #C0C0C0; }
.type-r { border-left-color: #CD7F32; }

/* レアリティ別カラー定義 */
:root {
    /* SSR: Red */
    --rarity-ssr-bg: #ffebee;     /* 薄い赤背景 */
    --rarity-ssr-border: #ef5350; /* 赤枠線 */
    --rarity-ssr-text: #c62828;   /* 濃い赤文字 */
    
    /* SR: Yellow */
    --rarity-sr-bg: #fffde7;      /* 薄い黄色背景 */
    --rarity-sr-border: #fdd835;  /* 黄色枠線 */
    --rarity-sr-text: #f57f17;    /* オレンジ寄りの文字 */
    
    /* R: Green */
    --rarity-r-bg: #e8f5e9;       /* 薄い緑背景 */
    --rarity-r-border: #66bb6a;   /* 緑枠線 */
    --rarity-r-text: #2e7d32;     /* 濃い緑文字 */
}

/* キャラクターごとのコンテナ */
.content-card.char-card-container {
    padding: 0;
    margin: 2px 0;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

/* ヘッダー部分（クリックで開閉） */
.char-header {
    padding: 15px 20px;
    cursor: pointer;
    background-color: #fff;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    transition: background-color 0.2s;
}
.char-header:hover {
    background-color: #fafafa;
}

/* キャラ名と基本情報 */
.char-info-main {
    flex: 1;
    min-width: 200px;
}
.char-name-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 5px;
}
.char-summary-tags {
    display: flex;
    gap: 5px;
}

/* ステータスバーと数値 */
.char-stat-area {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.stat-value-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-bottom: 4px;
}
.stat-bar-bg {
    height: 8px;
    background-color: #eee;
    border-radius: 4px;
    overflow: hidden;
    width: 100%;
}
.stat-bar-fill {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%; /* JSで操作 */
    transition: width 0.5s ease-out;
}

/* 開閉アイコン */
.toggle-icon {
    color: var(--gray-text);
    font-weight: bold;
    transition: transform 0.3s;
}
.char-card-container.open .toggle-icon {
    transform: rotate(180deg);
}

/* 詳細リスト（アコーディオン中身） */
.char-details {
    display: none;
    border-top: 1px solid var(--border-color);
    background-color: #fafafa;
    padding: 10px 20px 20px 20px;
}
.char-card-container.open .char-details {
    display: block;
}

/* カード個別の行 */
.card-row {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed #ddd;
}
.card-row:last-child { border-bottom: none; }

.card-title-cell { flex-grow: 1; padding: 0 10px; }

/* ジョブアイコン*/
.job-icon {
    font-size: 1.3rem;
    margin: 0 8px 0 5px;
    vertical-align: middle;
    cursor: default;
    position: relative;
    color: var(--gray-text);
    top: 1px;
}

/* 日付セル */
.card-date-cell {
    font-size: 0.85rem;
    color: var(--gray-text);
    white-space: nowrap;
    margin-left: auto;
}

/* レアリティバッジ（tagクラスを継承しつつ独自色） */
.tag.rarity-SSR { background: var(--rarity-ssr-bg); color: var(--rarity-ssr-text); border: 1px solid var(--rarity-ssr-border); }
.tag.rarity-SR  { background: var(--rarity-sr-bg);  color: var(--rarity-sr-text);  border: 1px solid var(--rarity-sr-border); }
.tag.rarity-R   { background: var(--rarity-r-bg);   color: var(--rarity-r-text);   border: 1px solid var(--rarity-r-border); }


/* =========================================
   11. ページ別スタイル: クイズ & ボーダー
   ========================================= */
.control-panel {
    padding: 15px; margin-bottom: 20px;
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    background: rgba(255, 255, 255, 0.95);
}
.control-panel.stacked { flex-direction: column; align-items: stretch; }
.sticky-controls { position: sticky; top: 10px; z-index: 90; backdrop-filter: blur(5px); }
.control-group { margin-bottom: 5px; }
.control-label { font-size: 0.9rem; color: var(--gray-text); font-weight: bold; margin-bottom: 5px; display: block; }

/* クイズ結果表示 */
#score-display {
    width: 100%; text-align: center; padding: 20px; margin-bottom: 20px;
    background: #fff; border: 2px solid var(--primary-color); border-radius: 8px;
    display: none;
}
.score-header { text-align: center; padding-bottom: 20px; border-bottom: 2px dashed #eee; margin-bottom: 20px; }
.score-circle {
    width: 100px; height: 100px; margin: 10px auto;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; border: 4px solid var(--primary-color);
    color: var(--primary-color); font-size: 3rem; font-weight: bold; background: #f1f8e9;
}
.score-circle small { font-size: 0.9rem; margin-top: 5px; }
.share-section {
    margin-top: 20px; padding-top: 20px; text-align: left;
    display: flex; flex-direction: column; gap: 12px;
}
.share-buttons-row { display: flex; gap: 10px; }
.share-buttons-row > * { flex: 1; }

/* クイズ問題カード */
.content-card { padding: 20px; margin-bottom: 20px; border-left: 5px solid var(--border-color); }
.content-card h3 {
    margin-top: 0; margin-bottom: 15px; font-size: 1.05rem;
    border-bottom: 1px solid var(--border-color); padding-bottom: 8px;
}
/* 正誤判定色 */
.content-card.correct { border-left-color: var(--primary-color); background-color: #f1f8e9; }
.content-card.incorrect { border-left-color: var(--danger-color); background-color: #ffebee; }
.result-feedback {
    margin-top: 10px; padding: 10px; border-radius: 6px; font-size: 0.9rem; display: none;
    background: rgba(255, 255, 255, 0.6); font-weight: bold;
}
.content-card.correct .result-feedback { display: block; color: var(--primary-dark); border: 1px solid var(--primary-color); }
.content-card.incorrect .result-feedback { display: block; color: #c62828; border: 1px solid var(--danger-color); }

/* 保存トースト */
.save-toast {
    position: fixed; bottom: 20px; left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0, 0, 0, 0.8); color: white;
    padding: 10px 20px; border-radius: 25px;
    opacity: 0; visibility: hidden; transition: all 0.3s ease;
    z-index: 1000;
}
.save-toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

/* ボーダーグラフ用 */
.chart-container {
    position: relative; height: 450px; width: 100%;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.chart-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; }

.table-wrapper { overflow-x: auto; margin-top: 10px; border: 1px solid var(--border-color); border-radius: 8px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; white-space: nowrap; }
.data-table th, .data-table td { padding: 10px 15px; border-bottom: 1px solid var(--border-color); text-align: right; }
.data-table th:first-child, .data-table td:first-child {
    text-align: left; position: sticky; left: 0;
    background-color: var(--bg-color); border-right: 2px solid var(--border-color);
    font-weight: bold; z-index: 1;
}
.data-table thead th { background-color: var(--border-color); color: var(--text-color); font-weight: bold; }

/* レンジスライダー */
.range-slider-wrapper { position: relative; width: 100%; height: 40px; display: flex; align-items: center; }
.range-slider-wrapper input[type="range"] {
    position: absolute; width: 100%; -webkit-appearance: none; background: none;
    z-index: 2; margin: 0; pointer-events: none;
}
.range-slider-wrapper input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; pointer-events: all;
    width: 20px; height: 20px; border-radius: 50%;
    background: var(--primary-color); border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3); cursor: pointer;
    position: relative; z-index: 3;
}
.slider-track {
    position: absolute; z-index: 1; left: 0; right: 0; top: 50%; transform: translateY(-50%);
    height: 6px; background-color: #ddd; border-radius: 3px;
}
.slider-labels { display: flex; justify-content: space-between; padding: 0 10px; margin-top: 5px; }
.slider-labels span { font-size: 0.7rem; color: var(--gray-text); width: 0; display: flex; justify-content: center; white-space: nowrap; }


