/* ==========================================
   🎨 テーマカラー定義（一括切り替え用）
   ========================================== */

 :root {
    --radius-lg: 24px;
    --radius-md: 16px;
}


/* 1. 今の状態（デフォルト：ライト・マイルド） */

:root,
body[data-theme="default"] {
    --primary: #546e7a;
    --text-main: #333333;
    --text-sub: #777777;
    --bg: #f2f4f6;
    --card-bg: #ffffff;
    --yellow: #fff9c4;
    --red: #ff4d4d;
    --shadow: 0 12px 40px rgba(0, 0, 0, 0.06);
    /* 教科ごとの色（背景色 / 文字色） */
    --sub-red: #ffebee;
    --sub-red-text: #c62828;
    --sub-blue: #e3f2fd;
    --sub-blue-text: #1565c0;
    --sub-green: #e8f5e9;
    --sub-green-text: #2e7d32;
    --sub-yellow: #fff9c4;
    --sub-yellow-text: #827717;
    --sub-purple: #f3e5f5;
    --sub-purple-text: #6a1b9a;
    --sub-orange: #fff3e0;
    --sub-orange-text: #ef6c00;
    --sub-pink: #fce4ec;
    --sub-pink-text: #ad1457;
    --sub-teal: #e0f2f1;
    --sub-teal-text: #00695c;
}


/* 2. ダーク（夜間モード） */

body[data-theme="dark"] {
    --primary: #90a4ae;
    --text-main: #e0e0e0;
    --text-sub: #9e9e9e;
    --bg: #121212;
    --card-bg: #1e1e1e;
    --yellow: #373316;
    --red: #cf6679;
    --shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    --sub-red: #3c1e1e;
    --sub-red-text: #ff8a80;
    --sub-blue: #1a237e;
    --sub-blue-text: #82b1ff;
    --sub-green: #1b5e20;
    --sub-green-text: #b9f6ca;
    --sub-yellow: #4a4a00;
    --sub-yellow-text: #ffff8d;
    --sub-purple: #4a148c;
    --sub-purple-text: #ea80fc;
    --sub-orange: #e65100;
    --sub-orange-text: #ffd180;
    --sub-pink: #880e4f;
    --sub-pink-text: #ff80ab;
    --sub-teal: #004d40;
    --sub-teal-text: #a7ffeb;
}


/* 3. 新緑（鮮やかなグリーンと木漏れ日） */

body[data-theme="shinryoku"] {
    --primary: #2e7d32;
    --text-main: #2c3e2b;
    --text-sub: #617d5f;
    --bg: #f1f8e9;
    --card-bg: #ffffff;
    --yellow: #fffde7;
    --red: #d32f2f;
    --shadow: 0 12px 40px rgba(46, 125, 50, 0.05);
    --sub-red: #ffebee;
    --sub-red-text: #c62828;
    --sub-blue: #e8f5e9;
    --sub-blue-text: #2e7d32;
    /* 新緑の主役 */
    --sub-green: #c8e6c9;
    --sub-green-text: #1b5e20;
    --sub-yellow: #f0f4c3;
    --sub-yellow-text: #33691e;
    --sub-purple: #f3e5f5;
    --sub-purple-text: #4a148c;
    --sub-orange: #fff3e0;
    --sub-orange-text: #e65100;
    --sub-pink: #fce4ec;
    --sub-pink-text: #ad1457;
    --sub-teal: #e0f2f1;
    --sub-teal-text: #00695c;
}


/* 4. 桜（春の柔らかなピンクと淡い空） */

body[data-theme="sakura"] {
    --primary: #ec407a;
    --text-main: #4a373d;
    --text-sub: #8a7379;
    --bg: #fff5f7;
    --card-bg: #ffffff;
    --yellow: #fffde7;
    --red: #e91e63;
    --shadow: 0 12px 40px rgba(236, 64, 122, 0.06);
    --sub-red: #ffe4e1;
    --sub-red-text: #b03060;
    --sub-blue: #e0f7fa;
    --sub-blue-text: #006064;
    --sub-green: #e8f5e9;
    --sub-green-text: #2e7d32;
    --sub-yellow: #fff9c4;
    --sub-yellow-text: #f57f17;
    --sub-purple: #f3e5f5;
    --sub-purple-text: #6a1b9a;
    --sub-orange: #ffe0b2;
    --sub-orange-text: #e65100;
    --sub-pink: #fce4ec;
    --sub-pink-text: #ad1457;
    --sub-teal: #e0f2f1;
    --sub-teal-text: #004d40;
}


/* 5. 海（ディープブルーと澄んだスカイ） */

body[data-theme="umi"] {
    --primary: #0288d1;
    --text-main: #1c2833;
    --text-sub: #566573;
    --bg: #e1f5fe;
    --card-bg: #ffffff;
    --yellow: #fffde7;
    --red: #ff5252;
    --shadow: 0 12px 40px rgba(2, 136, 209, 0.06);
    --sub-red: #ffcdd2;
    --sub-red-text: #c62828;
    --sub-blue: #e3f2fd;
    --sub-blue-text: #0d47a1;
    --sub-green: #e0f2f1;
    --sub-green-text: #004d40;
    --sub-yellow: #fffde7;
    --sub-yellow-text: #f57f17;
    --sub-purple: #ede7f6;
    --sub-purple-text: #311b92;
    --sub-orange: #ffe0b2;
    --sub-orange-text: #e65100;
    --sub-pink: #fce4ec;
    --sub-pink-text: #880e4f;
    --sub-teal: #e0f2f1;
    --sub-teal-text: #00695c;
}


/* 6. 紅葉（深みのある赤・朱色・黄金色） */

body[data-theme="kouyou"] {
    --primary: #bf360c;
    --text-main: #3e2723;
    --text-sub: #795548;
    --bg: #fff3e0;
    --card-bg: #ffffff;
    --yellow: #fffde7;
    --red: #d84315;
    --shadow: 0 12px 40px rgba(191, 54, 12, 0.06);
    --sub-red: #ffcc80;
    --sub-red-text: #d84315;
    --sub-blue: #d7ccc8;
    --sub-blue-text: #4e342e;
    --sub-green: #f0f4c3;
    --sub-green-text: #558b2f;
    --sub-yellow: #fff9c4;
    --sub-yellow-text: #f57f17;
    --sub-purple: #f3e5f5;
    --sub-purple-text: #6a1b9a;
    --sub-orange: #ffe0b2;
    --sub-orange-text: #e65100;
    --sub-pink: #fce4ec;
    --sub-pink-text: #ad1457;
    --sub-teal: #e0f2f1;
    --sub-teal-text: #00695c;
}


/* 7. 雪（冷涼なホワイトブルーと淡いグレー） */

body[data-theme="yuki"] {
    --primary: #78909c;
    --text-main: #263238;
    --text-sub: #546e7a;
    --bg: #eceff1;
    --card-bg: #ffffff;
    --yellow: #f1f8e9;
    --red: #e53935;
    --shadow: 0 12px 40px rgba(120, 144, 156, 0.05);
    --sub-red: #ffeaf0;
    --sub-red-text: #c2185b;
    --sub-blue: #e8eaf6;
    --sub-blue-text: #283593;
    --sub-green: #e0f2f1;
    --sub-green-text: #004d40;
    --sub-yellow: #ffffff;
    --sub-yellow-text: #455a64;
    --sub-purple: #f3e5f5;
    --sub-purple-text: #6a1b9a;
    --sub-orange: #eceff1;
    --sub-orange-text: #37474f;
    --sub-pink: #fce4ec;
    --sub-pink-text: #ad1457;
    --sub-teal: #cfd8dc;
    --sub-teal-text: #263238;
}


/* 8. 枯野（落ち着いたブラウントーンとベージュ） */

body[data-theme="karano"] {
    --primary: #6d4c41;
    --text-main: #3e2723;
    --text-sub: #8d6e63;
    --bg: #efebe9;
    --card-bg: #f5f5f5;
    --yellow: #fffde7;
    --red: #c62828;
    --shadow: 0 12px 40px rgba(109, 76, 65, 0.05);
    --sub-red: #d7ccc8;
    --sub-red-text: #5d4037;
    --sub-blue: #cfd8dc;
    --sub-blue-text: #37474f;
    --sub-green: #f5f5dc;
    --sub-green-text: #6d4c41;
    --sub-yellow: #fff9c4;
    --sub-yellow-text: #f57f17;
    --sub-purple: #e1bee7;
    --sub-purple-text: #4a148c;
    --sub-orange: #ffe0b2;
    --sub-orange-text: #e65100;
    --sub-pink: #f5f5f5;
    --sub-pink-text: #5d4037;
    --sub-teal: #b2dfdb;
    --sub-teal-text: #004d40;
}


/* 9. 和風（和紙・木目・落ち着いた茶系） */

body[data-theme="wafu"] {
    --primary: #a97846;
    --primary-strong: #7b5634;
    --text-main: #2f241d;
    --text-sub: #6d5848;
    --bg: #f5f0e7;
    --bg-strong: #e8dfcf;
    --card-bg: rgba(255, 251, 245, 0.82);
    --yellow: rgba(201, 168, 101, 0.18);
    --red: #b84e4e;
    --shadow: 0 20px 50px rgba(73, 52, 34, 0.12);
    --border: rgba(124, 91, 58, 0.18);
    --sub-red: rgba(184, 78, 78, 0.12);
    --sub-red-text: #7a2c2c;
    --sub-blue: rgba(111, 141, 182, 0.14);
    --sub-blue-text: #34517b;
    --sub-green: rgba(108, 140, 97, 0.14);
    --sub-green-text: #38543b;
    --sub-yellow: rgba(196, 169, 92, 0.18);
    --sub-yellow-text: #786129;
    --sub-purple: rgba(127, 108, 169, 0.14);
    --sub-purple-text: #4d406d;
    --sub-orange: rgba(200, 138, 76, 0.14);
    --sub-orange-text: #7a4d22;
    --sub-pink: rgba(184, 126, 160, 0.14);
    --sub-pink-text: #794c69;
    --sub-teal: rgba(102, 145, 144, 0.14);
    --sub-teal-text: #315b5a;
    position: relative;
    isolation: isolate;
    font-family: "Noto Serif JP", "Yu Mincho", "Hiragino Mincho ProN", serif;
    letter-spacing: 0.02em;
    background: radial-gradient(circle at top left, rgba(201, 168, 101, 0.18), transparent 24%), radial-gradient(circle at 80% 12%, rgba(124, 91, 58, 0.08), transparent 20%), linear-gradient(180deg, #f7f2e9 0%, #efe4d2 100%);
}

body[data-theme="wafu"]::before {
    content: "";
    position: fixed;
    inset: 0;
    background: linear-gradient(rgba(124, 91, 58, 0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(124, 91, 58, 0.04) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: radial-gradient(circle at center, black 48%, transparent 100%);
    pointer-events: none;
}

body[data-theme="wafu"]::after {
    content: "学級帖";
    position: fixed;
    right: 42px;
    bottom: 28px;
    font-family: "Noto Serif JP", serif;
    font-size: clamp(2.1rem, 4vw, 4.5rem);
    font-weight: 700;
    letter-spacing: 0.12em;
    color: rgba(124, 91, 58, 0.12);
    transform: rotate(-10deg);
    user-select: none;
    pointer-events: none;
}

body[data-theme="wafu"] #loadingOverlay {
    background: rgba(4, 12, 24, 0.78);
    backdrop-filter: blur(15px);
    color: var(--primary);
}

body[data-theme="wafu"] .header {
    position: relative;
}

body[data-theme="wafu"] .header::after {
    content: "";
    position: absolute;
    left: 40px;
    right: 40px;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(124, 91, 58, 0.4), rgba(124, 91, 58, 0.08));
}

body[data-theme="wafu"] h1 {
    font-size: clamp(1.5rem, 2.5vw, 2.2rem);
    font-weight: 700;
    margin: 0;
    color: var(--primary);
    font-family: "Noto Serif JP", serif;
    letter-spacing: 0.18em;
    text-shadow: 0 0 10px rgba(124, 91, 58, 0.12);
}

body[data-theme="wafu"] .btn-action {
    border: 1px solid var(--border);
    background: rgba(255, 251, 245, 0.8);
    color: var(--text-main);
    box-shadow: 0 8px 20px rgba(124, 91, 58, 0.08);
}

body[data-theme="wafu"] .btn-action:hover {
    transform: translateY(-1px);
    filter: brightness(1.02);
}

body[data-theme="wafu"] .btn-refresh {
    margin-right: 12px;
}

body[data-theme="wafu"] .btn-add,
body[data-theme="wafu"] .btn-cd,
body[data-theme="wafu"] .btn-save {
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    color: #f9f4eb;
    box-shadow: 0 0 18px rgba(124, 91, 58, 0.12);
}

body[data-theme="wafu"] .container {
    min-height: 0;
}

body[data-theme="wafu"] .card {
    background: linear-gradient(180deg, rgba(255, 251, 245, 0.88), rgba(246, 238, 226, 0.82));
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
    min-height: 0;
}

body[data-theme="wafu"] h2 {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-sub);
    letter-spacing: 0.12em;
    font-family: "Noto Serif JP", serif;
}

body[data-theme="wafu"] .tile {
    background: rgba(255, 250, 244, 0.72);
    border: 1px solid rgba(124, 91, 58, 0.12);
    border-top: 4px solid rgba(124, 91, 58, 0.8);
    box-shadow: inset 0 0 16px rgba(124, 91, 58, 0.02);
}

body[data-theme="wafu"] .tile.has-info {
    background: linear-gradient(135deg, rgba(201, 168, 101, 0.16), rgba(255, 250, 244, 0.75)) !important;
    border-color: rgba(124, 91, 58, 0.2);
}

body[data-theme="wafu"] .tile-header {
    align-items: center;
}

body[data-theme="wafu"] .period-num {
    font-family: "Noto Serif JP", serif;
}

body[data-theme="wafu"] .subject-name {
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

body[data-theme="wafu"] .sub-info {
    border-top: 1px dashed rgba(124, 91, 58, 0.16);
}

body[data-theme="wafu"] .future-item {
    background: rgba(255, 251, 245, 0.7);
    border-top: 5px solid rgba(124, 91, 58, 0.8);
    border: 1px solid rgba(124, 91, 58, 0.12);
    box-shadow: inset 0 0 16px rgba(124, 91, 58, 0.02);
}

body[data-theme="wafu"] .future-item.is-changed {
    background: linear-gradient(135deg, rgba(184, 78, 78, 0.08), rgba(255, 251, 245, 0.76));
}

body[data-theme="wafu"] .overlay {
    background: rgba(49, 35, 25, 0.35);
    backdrop-filter: blur(8px);
}

body[data-theme="wafu"] .action-card {
    background: linear-gradient(180deg, rgba(255, 251, 245, 0.96), rgba(244, 235, 222, 0.94));
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(73, 52, 34, 0.12);
}

body[data-theme="wafu"] .tab-group {
    background: rgba(124, 91, 58, 0.05);
    border: 1px solid rgba(124, 91, 58, 0.08);
}

body[data-theme="wafu"] .tab.active {
    background: linear-gradient(135deg, rgba(201, 168, 101, 0.22), rgba(124, 91, 58, 0.08));
    box-shadow: inset 0 0 14px rgba(124, 91, 58, 0.06);
}

body[data-theme="wafu"] label {
    color: var(--text-sub);
}

body[data-theme="wafu"] input,
body[data-theme="wafu"] select {
    border: 1px solid rgba(124, 91, 58, 0.14);
    background: rgba(255, 252, 247, 0.8);
    box-shadow: inset 0 0 10px rgba(124, 91, 58, 0.02);
}

body[data-theme="wafu"] input:focus,
body[data-theme="wafu"] select:focus {
    border-color: rgba(124, 91, 58, 0.38);
    box-shadow: 0 0 0 3px rgba(124, 91, 58, 0.08);
}

body[data-theme="wafu"] #countdownModal {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

body[data-theme="wafu"] .modal-content {
    background: var(--card-bg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

body[data-theme="wafu"] .close-btn {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-sub);
}

body[data-theme="wafu"] .cd-item {
    border: 1px solid rgba(0, 0, 0, 0.03);
}

body[data-theme="wafu"] .chrome-tab {
    color: var(--text-sub);
}

body[data-theme="wafu"] .chrome-tab.active {
    border-bottom: 3px solid var(--primary);
    color: var(--primary) !important;
}

body[data-theme="wafu"] .tab-link {
    color: var(--primary);
}

body[data-theme="wafu"] #cdModeSelect,
body[data-theme="wafu"] #cdTargetDate,
body[data-theme="wafu"] #cdDetailCard {
    background-color: var(--bg) !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
}

body[data-theme="wafu"] #cdDetailList span {
    background-color: var(--card-bg) !important;
    color: var(--text-main) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

body[data-theme="wafu"] #noteModal {
    background-color: rgba(0, 0, 0, 0.6) !important;
}

body[data-theme="wafu"] #noteModal .modal-content {
    background-color: rgba(255, 251, 245, 0.96) !important;
    border: 1px solid var(--border);
}

body[data-theme="wafu"] #note-content {
    color: var(--text-main) !important;
}

body[data-theme="wafu"] #note-tab-container {
    border-bottom: 1px solid rgba(124, 91, 58, 0.1);
}


/* 10. サイバーパンク（ネオンとホログラム） */

body[data-theme="cyberpunk"] {
    --primary: #00e5ff;
    --primary-strong: #ff2bd6;
    --text-main: #e8f7ff;
    --text-sub: #88a6c9;
    --bg: #050816;
    --bg-strong: #0c1530;
    --card-bg: rgba(8, 16, 32, 0.82);
    --yellow: rgba(0, 229, 255, 0.14);
    --red: #ff4d8d;
    --shadow: 0 24px 60px rgba(0, 229, 255, 0.14);
    --border: rgba(0, 229, 255, 0.2);
    --sub-red: rgba(255, 77, 141, 0.18);
    --sub-red-text: #ff9ac0;
    --sub-blue: rgba(73, 174, 255, 0.18);
    --sub-blue-text: #8fd3ff;
    --sub-green: rgba(0, 255, 170, 0.16);
    --sub-green-text: #9affd8;
    --sub-yellow: rgba(255, 214, 0, 0.18);
    --sub-yellow-text: #fff1a3;
    --sub-purple: rgba(183, 94, 255, 0.16);
    --sub-purple-text: #d9b2ff;
    --sub-orange: rgba(255, 124, 77, 0.16);
    --sub-orange-text: #ffbf9d;
    --sub-pink: rgba(255, 43, 214, 0.16);
    --sub-pink-text: #ff9feb;
    --sub-teal: rgba(0, 229, 255, 0.18);
    --sub-teal-text: #92f3ff;
    position: relative;
    isolation: isolate;
    font-family: "Orbitron", "Noto Sans JP", "Hiragino Sans", sans-serif;
    letter-spacing: 0.02em;
    background: radial-gradient(circle at 10% 10%, rgba(0, 229, 255, 0.18), transparent 20%), radial-gradient(circle at 90% 0%, rgba(255, 43, 214, 0.16), transparent 18%), radial-gradient(circle at 72% 78%, rgba(0, 255, 170, 0.12), transparent 16%), linear-gradient(180deg, #060916 0%, #090d1d 48%, #04050b 100%);
}

body[data-theme="cyberpunk"]::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(rgba(0, 229, 255, 0.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 43, 214, 0.08) 1px, transparent 1px), radial-gradient(circle at center, transparent 0 36%, rgba(3, 8, 21, 0.6) 100%);
    background-size: 34px 34px, 34px 34px, 100% 100%;
    mask-image: radial-gradient(circle at center, black 42%, transparent 100%);
}

body[data-theme="cyberpunk"]::after {
    content: "NEON NODE";
    position: fixed;
    left: 42px;
    bottom: 26px;
    font-family: "Orbitron", sans-serif;
    font-size: clamp(1.6rem, 3vw, 3.8rem);
    font-weight: 700;
    letter-spacing: 0.22em;
    color: rgba(0, 229, 255, 0.16);
    text-shadow: 0 0 14px rgba(0, 229, 255, 0.3), 0 0 28px rgba(255, 43, 214, 0.18);
    user-select: none;
    pointer-events: none;
}

body[data-theme="cyberpunk"] #loadingOverlay {
    background: rgba(3, 8, 21, 0.84);
    backdrop-filter: blur(18px) saturate(1.2);
    color: var(--primary);
}

body[data-theme="cyberpunk"] .header {
    position: relative;
}

body[data-theme="cyberpunk"] .header::after {
    content: "";
    position: absolute;
    left: 40px;
    right: 40px;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.35), rgba(255, 43, 214, 0.35), transparent);
}

body[data-theme="cyberpunk"] h1 {
    font-family: "Orbitron", "Noto Sans JP", sans-serif;
    font-size: clamp(1.35rem, 2.4vw, 2rem);
    letter-spacing: 0.24em;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.55), 0 0 24px rgba(255, 43, 214, 0.28);
}

body[data-theme="cyberpunk"] h2 {
    color: #9feeff;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-family: "Orbitron", "Noto Sans JP", sans-serif;
}

body[data-theme="cyberpunk"] .btn-action {
    border: 1px solid rgba(0, 229, 255, 0.24);
    background: rgba(7, 16, 36, 0.88);
    color: var(--text-main);
    box-shadow: 0 0 0 1px rgba(255, 43, 214, 0.08), 0 10px 30px rgba(0, 229, 255, 0.12);
}

body[data-theme="cyberpunk"] .btn-add,
body[data-theme="cyberpunk"] .btn-cd,
body[data-theme="cyberpunk"] .btn-save {
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    color: #03111a;
    box-shadow: 0 0 18px rgba(0, 229, 255, 0.25), 0 0 28px rgba(255, 43, 214, 0.16);
}

body[data-theme="cyberpunk"] .card,
body[data-theme="cyberpunk"] .action-card,
body[data-theme="cyberpunk"] .modal-content {
    background: linear-gradient(180deg, rgba(8, 16, 32, 0.88), rgba(5, 10, 22, 0.86));
    border: 1px solid rgba(0, 229, 255, 0.18);
    box-shadow: 0 24px 60px rgba(0, 229, 255, 0.08), inset 0 0 0 1px rgba(255, 43, 214, 0.04);
    backdrop-filter: blur(14px) saturate(1.1);
}

body[data-theme="cyberpunk"] .card {
    position: relative;
}

body[data-theme="cyberpunk"] .card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.07), transparent 36%), radial-gradient(circle at 88% 8%, rgba(255, 43, 214, 0.12), transparent 18%), radial-gradient(circle at 8% 92%, rgba(0, 255, 170, 0.08), transparent 16%);
}

body[data-theme="cyberpunk"] .modal-content {
    background-attachment: fixed;
}

body[data-theme="cyberpunk"] .tab-group {
    background: rgba(0, 229, 255, 0.06);
    border: 1px solid rgba(0, 229, 255, 0.14);
}

body[data-theme="cyberpunk"] .tab.active {
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.18), rgba(255, 43, 214, 0.12));
    box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.16), inset 0 0 12px rgba(0, 229, 255, 0.08);
    color: #f4fdff;
}

body[data-theme="cyberpunk"] .tile,
body[data-theme="cyberpunk"] .future-item {
    background: linear-gradient(180deg, rgba(10, 20, 41, 0.92), rgba(7, 12, 25, 0.9));
    border: 1px solid rgba(0, 229, 255, 0.14);
    border-top: 4px solid rgba(0, 229, 255, 0.48);
    box-shadow: 0 0 0 1px rgba(255, 43, 214, 0.05), inset 0 0 20px rgba(0, 229, 255, 0.04);
}

body[data-theme="cyberpunk"] .tile.is-changed {
    border-top-color: #ff2bd6 !important;
}

body[data-theme="cyberpunk"] .tile.has-info {
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.12), rgba(10, 20, 41, 0.92)) !important;
    border-color: rgba(0, 229, 255, 0.24);
}

body[data-theme="cyberpunk"] .tile.is-past {
    background-color: rgba(0, 229, 255, 0.02) !important;
    filter: saturate(0.8) brightness(0.72) grayscale(0.12);
}

body[data-theme="cyberpunk"] .period-num {
    color: #76f7ff;
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.35);
}

body[data-theme="cyberpunk"] .subject-name {
    color: #f4fdff;
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.12);
}

body[data-theme="cyberpunk"] .sub-info,
body[data-theme="cyberpunk"] label,
body[data-theme="cyberpunk"] .close-btn,
body[data-theme="cyberpunk"] .cd-days {
    color: #8caed9;
}

body[data-theme="cyberpunk"] .sub-info {
    border-top-color: rgba(0, 229, 255, 0.14);
}

body[data-theme="cyberpunk"] .container>.card:last-child {
    background-image: linear-gradient(180deg, rgba(8, 16, 32, 0.94), rgba(5, 10, 22, 0.92)), linear-gradient(180deg, rgba(0, 229, 255, 0.98), rgba(255, 43, 214, 0.92));
    background-repeat: no-repeat, no-repeat;
    background-position: 0 0, 18px 16px;
    background-size: auto, 6px calc(100% - 32px);
}

body[data-theme="cyberpunk"] input,
body[data-theme="cyberpunk"] select {
    background: rgba(6, 12, 24, 0.86);
    border: 1px solid rgba(0, 229, 255, 0.18);
    color: var(--text-main);
    box-shadow: inset 0 0 12px rgba(0, 229, 255, 0.04);
}

body[data-theme="cyberpunk"] input:focus,
body[data-theme="cyberpunk"] select:focus {
    border-color: rgba(255, 43, 214, 0.35);
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.1), 0 0 0 6px rgba(255, 43, 214, 0.05);
}

body[data-theme="cyberpunk"] .overlay,
body[data-theme="cyberpunk"] #countdownModal,
body[data-theme="cyberpunk"] #noteModal {
    background: rgba(3, 8, 21, 0.74) !important;
    backdrop-filter: blur(12px) saturate(1.1);
}

body[data-theme="cyberpunk"] .close-btn {
    background: rgba(0, 229, 255, 0.08);
    border: 1px solid rgba(0, 229, 255, 0.16);
}

body[data-theme="cyberpunk"] .cd-item {
    background: linear-gradient(180deg, rgba(8, 16, 32, 0.96), rgba(5, 10, 22, 0.94));
    border: 1px solid rgba(0, 229, 255, 0.12);
    box-shadow: 0 0 0 1px rgba(255, 43, 214, 0.04), inset 0 0 18px rgba(0, 229, 255, 0.04);
}

body[data-theme="cyberpunk"] .cd-subject,
body[data-theme="cyberpunk"] .cd-date {
    color: #ecfbff;
}

body[data-theme="cyberpunk"] .chrome-tab {
    color: #88a6c9;
}

body[data-theme="cyberpunk"] .chrome-tab.active {
    border-bottom-color: var(--primary);
    color: var(--primary) !important;
}

body[data-theme="cyberpunk"] .tab-link {
    color: var(--primary);
    text-decoration-color: rgba(0, 229, 255, 0.45);
}

body[data-theme="cyberpunk"] #cdModeSelect,
body[data-theme="cyberpunk"] #cdTargetDate,
body[data-theme="cyberpunk"] #cdDetailCard {
    background-color: rgba(6, 12, 24, 0.9) !important;
    border: 1px solid rgba(0, 229, 255, 0.14) !important;
}

body[data-theme="cyberpunk"] #cdDetailList span {
    background-color: rgba(8, 16, 32, 0.96) !important;
    color: #ecfbff !important;
    border: 1px solid rgba(0, 229, 255, 0.12) !important;
}

body[data-theme="cyberpunk"] #note-tab-container {
    border-bottom: 1px solid rgba(0, 229, 255, 0.12);
}


/* 11. 海外リゾート（陽気な南国カラー） */

body[data-theme="resort"] {
    --primary: #ff8a3d;
    --primary-strong: #ff4f6d;
    --text-main: #433224;
    --text-sub: #8f6b4f;
    --bg: #fff4e6;
    --bg-strong: #ffe6c7;
    --card-bg: rgba(255, 252, 246, 0.88);
    --yellow: rgba(255, 194, 92, 0.22);
    --red: #ff5b6b;
    --shadow: 0 22px 54px rgba(255, 138, 61, 0.14);
    --border: rgba(255, 138, 61, 0.16);
    --sub-red: rgba(255, 91, 107, 0.12);
    --sub-red-text: #a23a48;
    --sub-blue: rgba(74, 171, 255, 0.14);
    --sub-blue-text: #2e5f9b;
    --sub-green: rgba(93, 185, 120, 0.14);
    --sub-green-text: #2c6b45;
    --sub-yellow: rgba(255, 194, 92, 0.18);
    --sub-yellow-text: #8a5a18;
    --sub-purple: rgba(196, 125, 255, 0.14);
    --sub-purple-text: #65408b;
    --sub-orange: rgba(255, 150, 77, 0.14);
    --sub-orange-text: #9a5318;
    --sub-pink: rgba(255, 140, 178, 0.14);
    --sub-pink-text: #a13f68;
    --sub-teal: rgba(53, 192, 173, 0.14);
    --sub-teal-text: #1f6d64;
    position: relative;
    isolation: isolate;
    font-family: "Noto Sans JP", "Hiragino Sans", sans-serif;
    letter-spacing: 0.02em;
    background: radial-gradient(circle at 14% 14%, rgba(255, 194, 92, 0.28), transparent 18%), radial-gradient(circle at 88% 10%, rgba(255, 91, 107, 0.18), transparent 16%), radial-gradient(circle at 74% 78%, rgba(53, 192, 173, 0.16), transparent 18%), linear-gradient(180deg, #fff8ef 0%, #ffe8cf 46%, #ffd9b3 100%);
}

body[data-theme="resort"]::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(rgba(255, 138, 61, 0.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 194, 92, 0.08) 1px, transparent 1px), radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.58), transparent 32%);
    background-size: 36px 36px, 36px 36px, 100% 100%;
    mask-image: radial-gradient(circle at center, black 46%, transparent 100%);
}

body[data-theme="resort"]::after {
    content: "SUNNY DAYS";
    position: fixed;
    right: 42px;
    top: 30px;
    font-family: "Noto Serif JP", serif;
    font-size: clamp(1.8rem, 3vw, 3.8rem);
    font-weight: 700;
    letter-spacing: 0.22em;
    color: rgba(255, 138, 61, 0.14);
    text-shadow: 0 0 18px rgba(255, 138, 61, 0.24), 0 0 34px rgba(255, 194, 92, 0.18);
    user-select: none;
    pointer-events: none;
}

body[data-theme="resort"] #loadingOverlay {
    background: rgba(53, 30, 17, 0.5);
    backdrop-filter: blur(14px) saturate(1.1);
    color: var(--primary);
}

body[data-theme="resort"] .header::after {
    background: linear-gradient(90deg, transparent, rgba(255, 138, 61, 0.34), rgba(255, 194, 92, 0.28), transparent);
}

body[data-theme="resort"] h1,
body[data-theme="resort"] h2 {
    font-family: "Noto Serif JP", serif;
}

body[data-theme="resort"] h2 {
    color: #9b6a41;
    letter-spacing: 0.16em;
}

body[data-theme="resort"] .btn-action {
    border: 1px solid rgba(255, 138, 61, 0.18);
    background: rgba(255, 251, 245, 0.88);
    color: var(--text-main);
    box-shadow: 0 8px 20px rgba(255, 138, 61, 0.08);
}

body[data-theme="resort"] .btn-add,
body[data-theme="resort"] .btn-cd,
body[data-theme="resort"] .btn-save {
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    color: #fff8ef;
    box-shadow: 0 0 18px rgba(255, 138, 61, 0.2), 0 0 28px rgba(255, 91, 107, 0.12);
}

body[data-theme="resort"] .card,
body[data-theme="resort"] .action-card,
body[data-theme="resort"] .modal-content {
    background: linear-gradient(180deg, rgba(255, 252, 246, 0.94), rgba(255, 241, 224, 0.92));
    border: 1px solid rgba(255, 138, 61, 0.14);
    box-shadow: 0 22px 54px rgba(255, 138, 61, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
}

body[data-theme="resort"] .card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 84% 10%, rgba(255, 194, 92, 0.14), transparent 16%), radial-gradient(circle at 12% 90%, rgba(255, 91, 107, 0.1), transparent 18%), linear-gradient(135deg, rgba(255, 138, 61, 0.06), transparent 40%);
}

body[data-theme="resort"] .modal-content {
    background-attachment: fixed;
}

body[data-theme="resort"] .tab-group {
    background: rgba(255, 138, 61, 0.07);
    border: 1px solid rgba(255, 138, 61, 0.12);
}

body[data-theme="resort"] .tab.active {
    background: linear-gradient(135deg, rgba(255, 194, 92, 0.2), rgba(255, 138, 61, 0.1));
    box-shadow: 0 0 0 1px rgba(255, 138, 61, 0.1), inset 0 0 12px rgba(255, 138, 61, 0.05);
}

body[data-theme="resort"] .tile,
body[data-theme="resort"] .future-item {
    background: linear-gradient(180deg, rgba(255, 250, 242, 0.98), rgba(255, 239, 217, 0.96));
    border: 1px solid rgba(255, 138, 61, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.56);
}

body[data-theme="resort"] .tile.is-changed {
    border-color: #ff5b6b !important;
}

body[data-theme="resort"] .tile.has-info {
    background: linear-gradient(135deg, rgba(255, 194, 92, 0.18), rgba(255, 250, 242, 0.98)) !important;
    border-color: rgba(255, 138, 61, 0.18);
}

body[data-theme="resort"] .period-num {
    color: #d86b20;
}

body[data-theme="resort"] .subject-name {
    color: #50351f;
}

body[data-theme="resort"] .sub-info,
body[data-theme="resort"] label,
body[data-theme="resort"] .close-btn,
body[data-theme="resort"] .cd-days,
body[data-theme="resort"] .tab,
body[data-theme="resort"] .chrome-tab {
    color: #8c6846;
}

body[data-theme="resort"] .sub-info {
    border-top-color: rgba(255, 138, 61, 0.12);
}

body[data-theme="resort"] input,
body[data-theme="resort"] select {
    background: rgba(255, 251, 245, 0.92);
    border: 1px solid rgba(255, 138, 61, 0.14);
    box-shadow: inset 0 0 10px rgba(255, 138, 61, 0.02);
}

body[data-theme="resort"] input:focus,
body[data-theme="resort"] select:focus {
    border-color: rgba(255, 91, 107, 0.28);
    box-shadow: 0 0 0 3px rgba(255, 138, 61, 0.08);
}

body[data-theme="resort"] .overlay,
body[data-theme="resort"] #countdownModal,
body[data-theme="resort"] #noteModal {
    background: rgba(53, 30, 17, 0.4) !important;
    backdrop-filter: blur(10px) saturate(1.08);
}

body[data-theme="resort"] .close-btn {
    background: rgba(255, 138, 61, 0.08);
    border: 1px solid rgba(255, 138, 61, 0.12);
}

body[data-theme="resort"] .cd-item {
    background: linear-gradient(180deg, rgba(255, 250, 242, 0.98), rgba(255, 239, 217, 0.96));
    border: 1px solid rgba(255, 138, 61, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

body[data-theme="resort"] .cd-subject,
body[data-theme="resort"] .cd-date {
    color: #50351f;
}

body[data-theme="resort"] .container>.card:last-child {
    background-image: linear-gradient(180deg, rgba(255, 250, 242, 0.98), rgba(255, 239, 217, 0.96)), linear-gradient(180deg, rgba(255, 160, 64, 0.98), rgba(255, 91, 107, 0.92));
    background-repeat: no-repeat, no-repeat;
    background-position: 0 0, 18px 16px;
    background-size: auto, 6px calc(100% - 32px);
}

body[data-theme="resort"] #cdModeSelect,
body[data-theme="resort"] #cdTargetDate,
body[data-theme="resort"] #cdDetailCard {
    background-color: rgba(255, 250, 242, 0.94) !important;
    border: 1px solid rgba(255, 138, 61, 0.12) !important;
}

body[data-theme="resort"] #cdDetailList span {
    background-color: rgba(255, 250, 242, 0.98) !important;
    color: var(--text-main) !important;
    border: 1px solid rgba(255, 138, 61, 0.12) !important;
}

body[data-theme="resort"] #note-tab-container {
    border-bottom: 1px solid rgba(255, 138, 61, 0.1);
}


/* 12. 古書（図書館と魔導書） */

body[data-theme="grimoire"] {
    --primary: #c08a3a;
    --primary-strong: #7d4f1f;
    --text-main: #3a2a1f;
    --text-sub: #81624c;
    --bg: #f2eadc;
    --bg-strong: #dfcfb5;
    --card-bg: rgba(255, 250, 242, 0.88);
    --yellow: rgba(215, 183, 98, 0.18);
    --red: #a85050;
    --shadow: 0 20px 50px rgba(110, 74, 33, 0.12);
    --border: rgba(125, 79, 31, 0.18);
    --sub-red: rgba(168, 80, 80, 0.12);
    --sub-red-text: #7a3131;
    --sub-blue: rgba(98, 123, 173, 0.14);
    --sub-blue-text: #344d78;
    --sub-green: rgba(111, 145, 108, 0.14);
    --sub-green-text: #39543d;
    --sub-yellow: rgba(201, 167, 86, 0.18);
    --sub-yellow-text: #7a6127;
    --sub-purple: rgba(140, 107, 169, 0.14);
    --sub-purple-text: #56406d;
    --sub-orange: rgba(193, 128, 66, 0.14);
    --sub-orange-text: #7a4920;
    --sub-pink: rgba(184, 126, 160, 0.14);
    --sub-pink-text: #794c69;
    --sub-teal: rgba(93, 142, 136, 0.14);
    --sub-teal-text: #315a57;
    position: relative;
    isolation: isolate;
    font-family: "Noto Serif JP", "Yu Mincho", "Hiragino Mincho ProN", serif;
    letter-spacing: 0.02em;
    background: radial-gradient(circle at 14% 10%, rgba(201, 167, 86, 0.16), transparent 18%), radial-gradient(circle at 86% 14%, rgba(125, 79, 31, 0.08), transparent 16%), linear-gradient(180deg, #f6efe1 0%, #eadbbc 56%, #dcc7a1 100%);
}

body[data-theme="grimoire"]::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(rgba(125, 79, 31, 0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(125, 79, 31, 0.04) 1px, transparent 1px), radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.45), transparent 28%);
    background-size: 32px 32px, 32px 32px, 100% 100%;
    mask-image: radial-gradient(circle at center, black 50%, transparent 100%);
}

body[data-theme="grimoire"]::after {
    content: "THE ARCHIVE";
    position: fixed;
    right: 40px;
    bottom: 26px;
    font-family: "Noto Serif JP", serif;
    font-size: clamp(1.7rem, 3vw, 3.6rem);
    font-weight: 700;
    letter-spacing: 0.2em;
    color: rgba(125, 79, 31, 0.12);
    transform: rotate(-8deg);
    user-select: none;
    pointer-events: none;
}

body[data-theme="grimoire"] #loadingOverlay {
    background: rgba(31, 21, 13, 0.76);
    backdrop-filter: blur(14px) saturate(1.02);
    color: var(--primary);
}

body[data-theme="grimoire"] .header::after {
    background: linear-gradient(90deg, rgba(125, 79, 31, 0.34), rgba(201, 167, 86, 0.28), rgba(125, 79, 31, 0.08));
}

body[data-theme="grimoire"] h1,
body[data-theme="grimoire"] h2 {
    font-family: "Noto Serif JP", serif;
}

body[data-theme="grimoire"] h2 {
    color: #8a6846;
    letter-spacing: 0.14em;
}

body[data-theme="grimoire"] .btn-action {
    border: 1px solid rgba(125, 79, 31, 0.18);
    background: rgba(255, 250, 242, 0.86);
    color: var(--text-main);
    box-shadow: 0 8px 20px rgba(110, 74, 33, 0.08);
}

body[data-theme="grimoire"] .btn-add,
body[data-theme="grimoire"] .btn-cd,
body[data-theme="grimoire"] .btn-save {
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    color: #fff8ed;
    box-shadow: 0 0 18px rgba(201, 167, 86, 0.14);
}

body[data-theme="grimoire"] .card,
body[data-theme="grimoire"] .action-card,
body[data-theme="grimoire"] .modal-content {
    background: linear-gradient(180deg, rgba(255, 250, 242, 0.92), rgba(243, 232, 211, 0.9));
    border: 1px solid var(--border);
    box-shadow: 0 22px 54px rgba(110, 74, 33, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
}

body[data-theme="grimoire"] .card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(201, 167, 86, 0.08), transparent 36%), radial-gradient(circle at 90% 10%, rgba(125, 79, 31, 0.1), transparent 18%), radial-gradient(circle at 12% 92%, rgba(255, 255, 255, 0.26), transparent 14%);
}

body[data-theme="grimoire"] .tab-group {
    background: rgba(125, 79, 31, 0.06);
    border: 1px solid rgba(125, 79, 31, 0.1);
}

body[data-theme="grimoire"] .tab.active {
    background: linear-gradient(135deg, rgba(201, 167, 86, 0.22), rgba(125, 79, 31, 0.08));
    box-shadow: inset 0 0 12px rgba(125, 79, 31, 0.06);
}

body[data-theme="grimoire"] .tile,
body[data-theme="grimoire"] .future-item {
    background: linear-gradient(180deg, rgba(255, 249, 240, 0.96), rgba(241, 228, 204, 0.94));
    border: 1px solid rgba(125, 79, 31, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

body[data-theme="grimoire"] .tile.is-changed {
    border-color: #c08a3a !important;
}

body[data-theme="grimoire"] .tile.has-info {
    background: linear-gradient(135deg, rgba(201, 167, 86, 0.18), rgba(255, 249, 240, 0.96)) !important;
    border-color: rgba(125, 79, 31, 0.18);
}

body[data-theme="grimoire"] .period-num {
    color: #a76e1f;
}

body[data-theme="grimoire"] .subject-name {
    color: #432d17;
}

body[data-theme="grimoire"] .sub-info,
body[data-theme="grimoire"] label,
body[data-theme="grimoire"] .close-btn,
body[data-theme="grimoire"] .cd-days,
body[data-theme="grimoire"] .tab,
body[data-theme="grimoire"] .chrome-tab {
    color: #7d6247;
}

body[data-theme="grimoire"] .sub-info {
    border-top-color: rgba(125, 79, 31, 0.12);
}

body[data-theme="grimoire"] input,
body[data-theme="grimoire"] select {
    background: rgba(255, 252, 247, 0.84);
    border: 1px solid rgba(125, 79, 31, 0.14);
    box-shadow: inset 0 0 10px rgba(125, 79, 31, 0.02);
}

body[data-theme="grimoire"] input:focus,
body[data-theme="grimoire"] select:focus {
    border-color: rgba(125, 79, 31, 0.32);
    box-shadow: 0 0 0 3px rgba(125, 79, 31, 0.08);
}

body[data-theme="grimoire"] .overlay,
body[data-theme="grimoire"] #countdownModal,
body[data-theme="grimoire"] #noteModal {
    background: rgba(31, 21, 13, 0.62) !important;
    backdrop-filter: blur(10px) saturate(1.02);
}

body[data-theme="grimoire"] .close-btn {
    background: rgba(125, 79, 31, 0.08);
    border: 1px solid rgba(125, 79, 31, 0.12);
}

body[data-theme="grimoire"] .cd-item {
    background: linear-gradient(180deg, rgba(255, 250, 242, 0.96), rgba(241, 228, 204, 0.94));
    border: 1px solid rgba(125, 79, 31, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

body[data-theme="grimoire"] .cd-subject,
body[data-theme="grimoire"] .cd-date {
    color: #432d17;
}

body[data-theme="grimoire"] .container>.card:last-child {
    background-image: linear-gradient(180deg, rgba(255, 250, 242, 0.92), rgba(243, 232, 211, 0.9)), linear-gradient(180deg, rgba(201, 167, 86, 0.78), rgba(125, 79, 31, 0.5));
    background-repeat: no-repeat, no-repeat;
    background-position: 0 0, 18px 16px;
    background-size: auto, 4px calc(100% - 32px);
    background-attachment: local, local;
}

body[data-theme="grimoire"] #cdModeSelect,
body[data-theme="grimoire"] #cdTargetDate,
body[data-theme="grimoire"] #cdDetailCard {
    background-color: rgba(255, 250, 242, 0.92) !important;
    border: 1px solid rgba(125, 79, 31, 0.12) !important;
}

body[data-theme="grimoire"] #cdDetailList span {
    background-color: rgba(255, 250, 242, 0.98) !important;
    color: var(--text-main) !important;
    border: 1px solid rgba(125, 79, 31, 0.12) !important;
}

body[data-theme="grimoire"] #note-tab-container {
    border-bottom: 1px solid rgba(125, 79, 31, 0.1);
}

body[data-theme="cyberpunk"] #note-content {
    color: var(--text-main) !important;
}


/* 13. 語学学習風（鮮やかなポップグリーン） */

body[data-theme="language"] {
    --primary: #58cc02;
    --primary-strong: #46a302;
    --text-main: #4b4b4b;
    --text-sub: #777777;
    --bg: #ffffff;
    --card-bg: #ffffff;
    --yellow: #fff9a6;
    --red: #ff4b4b;
    --shadow: 0 4px 0 #e5e5e5;
    --border: #e5e5e5;
    --sub-red: #ffdfe0;
    --sub-red-text: #ea2b2b;
    --sub-blue: #ddf4ff;
    --sub-blue-text: #1cb0f6;
    --sub-green: #d7ffb8;
    --sub-green-text: #58cc02;
    --sub-yellow: #fff9a6;
    --sub-yellow-text: #ffbf00;
    --sub-purple: #f3e5f5;
    --sub-purple-text: #af73e8;
    --sub-orange: #ffedd5;
    --sub-orange-text: #ff9600;
    --sub-pink: #fce4ec;
    --sub-pink-text: #ff6699;
    --sub-teal: #e0f2f1;
    --sub-teal-text: #20d4b6;
    font-family: "M PLUS U", "DIN Round", "Helvetica Neue", sans-serif;
    background-color: #f7f7f7;
}


/* ポップな立体感（厚みのある3D風デザイン） */

body[data-theme="language"] .card {
    border: 2px solid #e5e5e5;
    border-bottom: 4px solid #e5e5e5;
    box-shadow: none;
}

body[data-theme="language"] .btn-action,
body[data-theme="language"] .btn-date {
    border-bottom: 4px solid rgba(0, 0, 0, 0.2);
    font-weight: 800;
}

body[data-theme="language"] .btn-action:active,
body[data-theme="language"] .btn-date:active {
    transform: translateY(2px);
    border-bottom-width: 2px;
}

body[data-theme="language"] .btn-add,
body[data-theme="language"] .btn-cd,
body[data-theme="language"] .btn-save {
    background: #58cc02;
    color: #ffffff;
    border-bottom: 4px solid #46a302;
}

body[data-theme="language"] .tile,
body[data-theme="language"] .future-item {
    border: 2px solid #e5e5e5;
    border-bottom: 4px solid #e5e5e5;
    border-radius: 16px;
}

body[data-theme="language"] .main-view-tabs,
body[data-theme="language"] .tab-group {
    background: #e5e5e5;
}

body[data-theme="language"] .tab.active {
    background: #ffffff;
    border-bottom: 3px solid #58cc02;
    color: #58cc02;
    font-weight: 800;
}


/* .is-changed クラスがついた tile または future-item の中にある period-num */

body[data-theme="language"] .tile.is-changed .period-num {
    color: var(--red);
}

body[data-theme="language"] .tile {
    border-color: var(--border) !important;
}


/* ==========================================
   🧱 以下、基本スタイル（変数を使用するように統合）
   ========================================== */

* {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

*::-webkit-scrollbar {
    display: none;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes windmill {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.tile.loading::after {
    content: '';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid var(--primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: windmill 0.8s linear infinite;
    pointer-events: none;
}

.tile.loading {
    position: relative;
}

body {
    font-family: "M PLUS U", "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    margin: 0;
    background-color: var(--bg);
    color: var(--text-main);
    height: 100dvh;
    overflow: hidden;
    transition: background-color 0.3s, color 0.3s;
    /* 切り替え時のアニメーション */
}

#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-weight: 600;
    color: var(--primary);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

#loadingOverlay.active {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.toast {
    position: fixed;
    z-index: 5000;
    bottom: 18px;
    left: 50%;
    max-width: min(90vw, 460px);
    padding: 12px 18px;
    border: 1px solid rgba(84, 110, 122, 0.16);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--text-main);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 12px);
    transition: opacity 180ms ease, transform 180ms ease;
    text-align: center;
    font-size: 0.85rem;
    backdrop-filter: blur(10px);
}

.toast.visible {
    opacity: 0.72;
    transform: translate(-50%, 0);
}

.legal-links {
    display: flex;
    gap: 14px;
    justify-content: center;
    margin-top: 18px;
}

.legal-links a {
    color: var(--text-sub);
    font-size: 0.75rem;
}

body #loadingOverlay.refreshing {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(3px);
    color: transparent;
    pointer-events: none;
}

.header {
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    z-index: 500;
}

h1 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: var(--primary);
}

.btn-action {
    border: none;
    padding: 10px 24px;
    border-radius: var(--radius-lg);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    height: 1rem;
    margin-top: 8px;
}

.btn-account {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-account svg {
    width: 20px;
    height: 20px;
}

.btn-refresh {
    background: var(--card-bg);
    color: var(--text-main);
    margin-right: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.btn-add {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(84, 110, 122, 0.2);
}


.floating-image-button {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1000;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.floating-image-button svg {
    width: 24px;
    height: 24px;
}

.gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 2500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 5vh 4vw;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    box-sizing: border-box;
}

.gallery-modal.active {
    display: flex;
}

.gallery-panel {
    width: min(92vw, 1100px);
    height: min(86vh, 760px);
    border-radius: var(--radius-lg);
    background: var(--card-bg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    padding: 28px;
    box-sizing: border-box;
    overflow-y: auto;
}

.gallery-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.gallery-heading h2 {
    margin: 0;
}

.gallery-blocks {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gallery-block {
    border: 1px solid color-mix(in srgb, var(--primary) 18%, transparent);
    border-radius: 14px;
    overflow: hidden;
}

.gallery-toggle {
    width: 100%;
    min-height: 58px;
    padding: 16px 18px;
    border: 0;
    background: color-mix(in srgb, var(--primary) 8%, var(--card-bg));
    color: var(--text-main);
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.gallery-toggle::before {
    content: "＋";
    display: inline-block;
    width: 1.4em;
    color: var(--primary);
}

.gallery-block.is-open .gallery-toggle::before {
    content: "−";
}

.gallery-content {
    display: none;
    padding: 18px;
    color: var(--text-main);
    line-height: 1.7;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.gallery-block.is-open .gallery-content {
    display: block;
}

.gallery-content .img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 10px 0;
    border-radius: 10px;
    cursor: zoom-in;
}

.gallery-content .img:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 3px;
}

.gallery-image-viewer {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 48px;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.82);
    cursor: zoom-out;
}

.gallery-image-viewer.active {
    display: flex;
}

.gallery-viewer-image {
    display: block;
    max-width: min(94vw, 1400px);
    max-height: 92vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.4);
    cursor: default;
}

.gallery-viewer-close {
    position: absolute;
    top: 18px;
    right: 22px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: white;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.gallery-add-button,
.gallery-editor button {
    min-height: 48px;
    border: 0;
    border-radius: 12px;
    padding: 12px 16px;
    background: var(--primary);
    color: white;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.gallery-add-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    padding: 0;
    border-radius: 50%;
    margin: 20px 0 0 auto;
}

.gallery-add-button svg {
    width: 24px;
    height: 24px;
}

.gallery-editor {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid color-mix(in srgb, var(--primary) 18%, transparent);
}

.gallery-editor h3 {
    margin: 0 0 14px;
}

.gallery-editor textarea {
    width: 100%;
    min-height: 180px;
    resize: vertical;
    box-sizing: border-box;
}

#eventImageInput {
    margin-bottom: 16px;
}

#inputDetails {
    width: 100%;
    box-sizing: border-box;
    overflow-y: hidden;
    resize: none;
}

.gallery-editor-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.gallery-editor-actions button[type="button"] {
    background: transparent;
    color: var(--text-main);
    border: 1px solid color-mix(in srgb, var(--text-main) 20%, transparent);
}

.gallery-editor-actions .gallery-delete-button {
    margin-left: auto;
    border-color: rgba(198, 40, 40, 0.3);
    color: #c62828;
}

@media (max-width: 600px) {
    .floating-image-button {
        right: 16px;
        bottom: 16px;
    }
}
.btn-cd {
    background: var(--primary);
    color: white;
    margin-right: 12px;
    box-shadow: 0 4px 15px rgba(84, 110, 122, 0.2);
}

.container {
    display: flex;
    height: calc(100dvh - 80px);
    padding: 0 40px 40px 40px;
    gap: 24px;
    box-sizing: border-box;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 32px;
    overflow-y: auto;
    box-shadow: var(--shadow);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    flex: 1;
    transition: background-color 0.3s, box-shadow 0.3s;
}

h2 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-sub);
    margin-top: 0;
    margin-bottom: 24px;
}

.tile {
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    margin-bottom: 12px;
    border-top: 2px solid #ddd;
}

.tile.is-changed {
    border-top-color: var(--red) !important;
}

.tile.has-info {
    background-color: var(--yellow) !important;
    border-color: rgba(0, 0, 0, 0.1);
}

.tile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
}

.period-num {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--primary);
    width: 20px;
}

.subject-name {
    font-size: 1.05rem;
    font-weight: 600;
}

.sub-info {
    font-size: 0.85rem;
    color: var(--text-sub);
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed rgba(0, 0, 0, 0.1);
    line-height: 1.5;
}

.sub-info img.img {
    display: block;
    max-width: 100%;
    height: auto;
}

.future-item {
    padding: 16px;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    background: rgba(0, 0, 0, 0.02);
    cursor: pointer;
    border-top: 2px solid #ddd;
}

.future-item.is-changed {
    border-left-color: var(--red);
    background: var(--card-bg);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-top: 2px solid var(--red);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    z-index: 1500;
    display: none;
    justify-content: center;
    align-items: center;
}

.overlay.active {
    display: flex;
}

.action-card {
    width: 420px;
    max-width: 90vw;
    max-height: 85dvh;
    background: var(--card-bg);
    color: var(--text-main);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
    box-sizing: border-box;
}

.account-card,
.personal-note-card {
    width: min(90vw, 420px);
}

.modal-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-heading h3 {
    margin: 0;
    font-size: 1.1rem;
}

.modal-close {
    border: 0;
    background: transparent;
    color: var(--text-sub);
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
}

.account-status {
    color: var(--text-sub);
    font-size: 0.85rem;
    line-height: 1.7;
    margin: 0 0 18px;
}

.account-button,
.account-secondary-button,
.account-danger-button {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: center;
    width: 100%;
}

.account-secondary-button,
.account-danger-button {
    border: 1px solid rgba(84, 110, 122, 0.18);
    border-radius: 12px;
    cursor: pointer;
    margin-top: 10px;
    padding: 12px 16px;
}

.account-secondary-button {
    background: var(--card-bg);
    color: var(--text-main);
}

.account-danger-button {
    background: transparent;
    border-color: rgba(198, 40, 40, 0.22);
    color: #c62828;
}

.account-button svg,
.account-secondary-button svg,
.account-danger-button svg,
.personal-note-card .btn-save svg {
    height: 17px;
    width: 17px;
}

.personal-note-input {
    background: var(--card-bg);
    border: 1px solid rgba(84, 110, 122, 0.2);
    border-radius: 12px;
    box-sizing: border-box;
    color: var(--text-main);
    font: inherit;
    line-height: 1.6;
    margin-bottom: 16px;
    min-height: 180px;
    padding: 12px;
    resize: vertical;
    width: 100%;
}

.personal-note-colors {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.personal-note-color {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 50%;
    background: var(--text-sub);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
    cursor: pointer;
}

.personal-note-color.is-selected,
.personal-note-custom-color.is-selected input[type="color"] {
    border-color: var(--text-main);
    box-shadow: 0 0 0 2px var(--card-bg), 0 0 0 4px var(--text-main);
}

.personal-note-color.color-red {
    background: #e53935;
}

.personal-note-color.color-blue {
    background: #1e88e5;
}

.personal-note-color.color-green {
    background: #43a047;
}

.personal-note-custom-color {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    position: relative;
    margin: 0;
    padding: 0;
    color: var(--text-sub);
    font-size: 0.75rem;
    cursor: pointer;
}

.personal-note-custom-color span {
    display: inline;
}

.personal-note-custom-color input[type="color"] {
    order: -1;
    width: 28px;
    height: 28px;
    padding: 0;
    margin: 0;
    border: 2px solid transparent;
    border-radius: 50%;
    background: var(--text-sub);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    box-sizing: border-box;
}

.tab-group {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: rgba(0, 0, 0, 0.05);
    padding: 6px;
    border-radius: 30px;
}

.tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    font-size: 0.85rem;
    border-radius: 25px;
    cursor: pointer;
    color: var(--text-sub);
    transition: 0.2s;
}

.tab.active {
    background: var(--card-bg);
    color: var(--text-main);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 6px;
}

input,
select,
textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 0.95rem;
    outline: none;
    background: rgba(0, 0, 0, 0.02);
    box-sizing: border-box;
    color: var(--text-main);
}

.btn-save {
    width: 100%;
    padding: 18px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
}


/* @media (max-width: 800px) {
  .container { flex-direction: column; padding: 16px; }
  .header { padding: 0 24px; }
} */

#countdownModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2500;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--card-bg);
    color: var(--text-main);
    margin: 20px auto;
    padding: 35px 15px 20px 15px;
    width: 92%;
    max-width: 800px;
    border-radius: 24px;
    position: relative;
    max-height: 85dvh;
    overflow-y: auto;
    animation: slideDown 0.3s ease-out;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    font-size: 18px;
    color: var(--text-sub);
    transition: 0.2s;
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

.countdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

@media (max-width: 350px) {
    .countdown-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.cd-item {
    padding: 12px 4px;
    border-radius: 16px;
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cd-subject {
    font-size: 0.75rem;
    font-weight: bold;
    margin-bottom: 2px;
}

.cd-date {
    font-size: 1rem;
    font-weight: 800;
}

.cd-days {
    font-size: 0.7rem;
    opacity: 0.8;
    font-weight: 600;
}


/* 🌟 各教科の色定義もテーマの変数と連動するように書き直しました */

.bg-red {
    background-color: var(--sub-red);
    color: var(--sub-red-text);
}

.bg-blue {
    background-color: var(--sub-blue);
    color: var(--sub-blue-text);
}

.bg-green {
    background-color: var(--sub-green);
    color: var(--sub-green-text);
}

.bg-yellow {
    background-color: var(--sub-yellow);
    color: var(--sub-yellow-text);
}

.bg-purple {
    background-color: var(--sub-purple);
    color: var(--sub-purple-text);
}

.bg-orange {
    background-color: var(--sub-orange);
    color: var(--sub-orange-text);
}

.bg-pink {
    background-color: var(--sub-pink);
    color: var(--sub-pink-text);
}

.bg-teal {
    background-color: var(--sub-teal);
    color: var(--sub-teal-text);
}

.tile.is-past {
    opacity: 0.25;
    filter: grayscale(0.9);
    background-color: rgba(0, 0, 0, 0.05) !important;
    border-left-color: #bbb !important;
}

.weather-card {
    margin-top: 12px;
    padding: 14px 16px;
    border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent);
    border-radius: 14px;
    background: color-mix(in srgb, var(--card-bg) 92%, var(--primary));
    color: var(--text-main);
}

.weather-card-heading,
.weather-card-body {
    display: flex;
    align-items: center;
}

.weather-card-heading {
    justify-content: space-between;
    gap: 12px;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 700;
}

.weather-heading-icon {
    width: 0.9rem;
    height: 0.9rem;
    margin-right: 5px;
    vertical-align: -0.12rem;
}

.weather-card-place {
    color: var(--text-sub);
    font-size: 0.7rem;
    font-weight: 500;
}

.weather-card-body {
    gap: 10px;
    margin-top: 8px;
}

.weather-time {
    min-width: 42px;
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 700;
}

.weather-icon {
    width: 1.7rem;
    height: 1.7rem;
    flex: 0 0 1.7rem;
}

.weather-sunny {
    color: #f59e0b;
}

.weather-cloudy {
    color: #64748b;
}

.weather-foggy {
    color: #94a3b8;
}

.weather-drizzle {
    color: #38bdf8;
}

.weather-rainy {
    color: #0284c7;
}

.weather-snowy {
    color: #60a5fa;
}

.weather-stormy {
    color: #7c3aed;
}

.weather-neutral {
    color: var(--primary);
}

.weather-summary {
    font-size: 0.95rem;
    font-weight: 700;
}

.weather-card-body strong {
    margin-left: auto;
    font-size: 1.15rem;
}

.weather-card-loading {
    margin-top: 8px;
    color: var(--text-sub);
    font-size: 0.8rem;
}

.weather-card-source {
    display: block;
    margin-top: 8px;
    color: var(--text-sub);
    font-size: 0.7rem;
}

.weather-card-source a {
    color: #000;
}

.cd-item:active {
    transform: scale(0.95);
    transition: transform 0.1s;
}

.chrome-tab {
    padding: 6px 14px;
    font-size: 0.95rem;
    color: var(--text-sub);
    background: transparent;
    margin-right: 12px;
    cursor: pointer;
    border: none;
    font-weight: 600;
    border-radius: 0;
    transition: color 0.2s;
}

.chrome-tab.active {
    color: var(--primary) !important;
    font-weight: 800;
    background: transparent !important;
    border-bottom: 3px solid var(--primary);
}

.tab-link {
    color: var(--primary);
    text-decoration: underline;
    cursor: pointer;
    font-weight: bold;
}


/* 🌟 カウントダウンモーダル内のデザイン調整（テーマへの馴染ませ） */

#cdModeSelect,
#cdTargetDate {
    background-color: var(--bg) !important;
    color: var(--text-main) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    font-family: inherit;
    outline: none;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}


/* ダークモードなど、背景が暗いテーマの時は枠線を少し明るく調整 */

body[data-theme="dark"] #cdModeSelect,
body[data-theme="dark"] #cdTargetDate {
    border-color: rgba(255, 255, 255, 0.15) !important;
}

#cdModeSelect:focus,
#cdTargetDate:focus {
    border-color: var(--primary) !important;
}


/* 詳細スケジュール表示部分の調整 */

#cdDetailCard {
    background-color: var(--bg) !important;
    border-radius: 16px;
    padding: 20px;
    margin-top: 24px;
    /* 点線を無くし、テーマに馴染む薄い境界線に変更 */
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
}

#cdDetailList span {
    background-color: var(--card-bg) !important;
    color: var(--text-main) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    cursor: pointer;
    transition: transform 0.1s, background-color 0.2s;
    user-select: none;
}

body[data-theme="dark"] #cdDetailList span {
    border-color: rgba(255, 255, 255, 0.08) !important;
}

#cdDetailList span:hover {
    background-color: var(--primary) !important;
    color: white !important;
}

#cdDetailList span:active {
    transform: scale(0.95);
}


/* 🌟 「あと0回」モードで授業数が0のタイルを暗くする */

.cd-item.is-zero-classes {
    opacity: 0.35;
    /* タイル全体を薄くする */
    filter: grayscale(0.6);
    /* 色味を少し抑えて目立たなくする */
    cursor: default;
    /* カーソルを通常の矢印に戻す */
}

@media (max-width: 379px) {
    .btn-action {
        padding: 10px 12px;
    }
}

.btn-date {
    background: var(--primary);
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 10px;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(84, 110, 122, 0.15);
    font-family: sans-serif;
    padding: 8px;
}


/* PC時はスマホ用タブを非表示 */

.main-view-tabs {
    display: none;
}


/* スマホ表示時（800px以下）のレイアウトとタブ制御 */

@media (max-width: 800px) {
    .header {
        padding: 0 24px;
    }
    .container {
        flex-direction: column;
        padding: 16px;
        gap: 16px;
    }
    /* 既存のtab-groupのデザインを流用したタブを表示 */
    .main-view-tabs {
        display: flex;
        gap: 8px;
        background: rgba(0, 0, 0, 0.05);
        padding: 6px;
        border-radius: 30px;
        flex-shrink: 0;
    }
    /* 非アクティブなカードを非表示 */
    .container>.card {
        display: none;
    }
    /* アクティブなカードのみを表示 */
    .container>.card.active-view {
        display: block;
        flex: 1;
    }
}


/* ==========================================
   🛠 スクロール時のグラデーション切れ完全防止
   ========================================== */


/* 1. トラブルの原因になる ::before のグラデーション描画を無効化 */

body[data-theme="wafu"] .card::before,
body[data-theme="cyberpunk"] .card::before,
body[data-theme="resort"] .card::before,
body[data-theme="grimoire"] .card::before {
    display: none !important;
}


/* 2. カードの背景にグラデーションを直接重ねて描画（マルチ背景化） */


/* 和風 */

body[data-theme="wafu"] .card {
    background-image: linear-gradient(180deg, rgba(255, 251, 245, 0.88), rgba(246, 238, 226, 0.82)) !important;
    background-attachment: local !important;
}


/* サイバーパンク */

body[data-theme="cyberpunk"] .card {
    background-image: linear-gradient(135deg, rgba(0, 229, 255, 0.07), transparent 36%), radial-gradient(circle at 88% 8%, rgba(255, 43, 214, 0.12), transparent 18%), radial-gradient(circle at 8% 92%, rgba(0, 255, 170, 0.08), transparent 16%), linear-gradient(180deg, rgba(8, 16, 32, 0.88), rgba(5, 10, 22, 0.86)) !important;
    background-attachment: local !important;
}


/* 海外リゾート */

body[data-theme="resort"] .card {
    background-image: radial-gradient(circle at 84% 10%, rgba(255, 194, 92, 0.14), transparent 16%), radial-gradient(circle at 12% 90%, rgba(255, 91, 107, 0.1), transparent 18%), linear-gradient(135deg, rgba(255, 138, 61, 0.06), transparent 40%), linear-gradient(180deg, rgba(255, 252, 246, 0.94), rgba(255, 241, 224, 0.92)) !important;
    background-attachment: local !important;
}


/* 古書 */

body[data-theme="grimoire"] .card {
    background-image: linear-gradient(135deg, rgba(201, 167, 86, 0.08), transparent 36%), radial-gradient(circle at 90% 10%, rgba(125, 79, 31, 0.1), transparent 18%), radial-gradient(circle at 12% 92%, rgba(255, 255, 255, 0.26), transparent 14%), linear-gradient(180deg, rgba(255, 250, 242, 0.92), rgba(243, 232, 211, 0.9)) !important;
    background-attachment: local !important;
}


/* 🎯 ジャンプ先タイルの強調アニメーション */

@keyframes targetHighlight {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0px rgba(124, 77, 255, 0);
    }
    25% {
        transform: scale(1.06);
        box-shadow: 0 0 25px var(--primary, #7c4dff);
        border-color: var(--primary, #7c4dff);
    }
    50% {
        transform: scale(0.98);
    }
    75% {
        transform: scale(1.03);
        box-shadow: 0 0 15px var(--primary, #7c4dff);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0px rgba(124, 77, 255, 0);
    }
}

.tile-target-highlight {
    animation: targetHighlight 1.5s ease-in-out;
    position: relative;
    z-index: 10;
}


/* ✨ パーティクル（輝く粒子）エフェクト */

.sparkle-particle {
    position: fixed;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    animation: particleFly 0.8s ease-out forwards;
}

@keyframes particleFly {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--dx), var(--dy)) scale(0.2);
    }
}