/* ==========================================
   スキル練習ページ用スタイル
   ========================================== */

/* スキル問題ページを100%幅にする */
body.single-skill_practice .contentArea,
body.single-skill_practice .content,
body.single-skill_practice .main,
body.single-skill_practice article,
body.single-skill_practice .post,
body.single-skill_practice .entry-content {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* パンくずリストと日付を非表示 */
body.single-skill_practice .breadcrumb,
body.single-skill_practice .bread,
body.single-skill_practice .entry-meta,
body.single-skill_practice .postinfo,
body.single-skill_practice .post-date,
body.single-skill_practice .entry-date,
body.single-skill_practice .updated,
body.single-skill_practice .copyright,
body.single-skill_practice .post-meta,
body.single-skill_practice .byline,
body.single-skill_practice time,
body.single-skill_practice .entry-header .entry-title,
body.single-skill_practice .post-header,
body.single-skill_practice .article-header,
body.single-skill_practice h1.entry-title,
body.single-skill_practice .pr-notation,
body.single-skill_practice .cat-name {
    display: none !important;
}

/* post ID 2573 (スキルマイページ) のパンくずリストを非表示 */
.postid-2573 .breadcrumb,
.postid-2573 .bread,
.page-id-2573 .breadcrumb,
.page-id-2573 .bread {
    display: none !important;
}

/* PR表記や警告文を非表示 */
body.single-skill_practice .notice,
body.single-skill_practice .disclaimer,
body.single-skill_practice .pr-notice,
body.single-skill_practice .alert,
body.single-skill_practice .entry-content > .notice,
body.single-skill_practice article > .notice,
body.single-skill_practice .post > .notice {
    display: none !important;
}

/* 記事ヘッダー全体を非表示（タイトル、日付、メタ情報） */
body.single-skill_practice .entry-header,
body.single-skill_practice .post-header,
body.single-skill_practice .article-header {
    display: none !important;
}

/* 元のナビゲーションバー（ヘッダーメニュー）を非表示 */
body.single-skill_practice .header,
body.single-skill_practice .siteHeader,
body.single-skill_practice #header,
body.single-skill_practice .site-header {
    display: none !important;
}

body.single-skill_practice .container,
body.single-skill_practice .wrapper {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
}

body.single-skill_practice .sidebar,
body.single-skill_practice aside {
    display: none !important;
}

/* 2カラムレイアウトを解除 */
body.single-skill_practice .contentArea {
    float: none !important;
}

body.single-skill_practice #main {
    width: 100% !important;
    max-width: 100% !important;
}

/* ==========================================
   1. スキル問題ナビゲーションバー
   ========================================== */

.skill-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 2px solid #0073aa;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-nav-item {
    display: inline-block;
    padding: 8px 16px;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    transition: background 0.3s ease;
}

.skill-nav-item:hover {
    background: #005a87;
    color: #fff;
}

.skill-nav-item.disabled {
    background: #ccc;
    color: #666;
    cursor: not-allowed;
    pointer-events: none;
}

.skill-nav-list {
    background: #7b68ee !important;
}

.skill-nav-list:hover {
    background: #6a5acd !important;
}

.ai-correction-section {
    display: flex;
    justify-content: center;
    padding: 20px;
    margin-top: 20px;
}

.skill-nav-item-ai {
    display: inline-block;
    padding: 12px 24px;
    background: #28a745;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.skill-nav-item-ai:hover {
    background: #218838;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

@media (max-width: 600px) {
    .skill-navigation {
        flex-wrap: wrap;
        padding: 10px;
        gap: 8px;
    }

    .skill-nav-item {
        font-size: 12px;
        padding: 6px 12px;
    }

    .ai-correction-section {
        padding: 15px;
        margin-top: 15px;
    }

    .skill-nav-item-ai {
        font-size: 14px;
        padding: 10px 20px;
    }
}

/* ==========================================
   2. スキル特訓マイページ
   ========================================== */

.skill-mypage-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
}

.skill-mypage-title {
    font-size: 28px;
    margin-bottom: 40px;
    padding-bottom: 10px;
    border-bottom: 3px solid #0073aa;
    text-align: center;
}

/* 蛇道型ロードマップ */
.skill-roadmap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

/* 左側の縦線（メインライン） */
.skill-roadmap::before {
    content: '';
    position: absolute;
    top: 40px;
    left: 40px;
    width: 6px;
    height: calc(100% - 80px);
    background: linear-gradient(to bottom, #764ba2 0%, #009DE3 25%, #4F85C4 50%, #7FBE25 75%, #01A13F 100%);
    border-radius: 3px;
    z-index: 0;
    pointer-events: none;
}

/* 級レベルボックス - 基本スタイル */
.skill-level-box {
    width: calc(100% - 110px);
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    margin-bottom: 40px;
    margin-left: 100px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 2;
}

.skill-level-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* 基礎コース（1番目） */
.skill-level-box:nth-child(1) {
    background: #764ba2;
}

/* 準2級（2番目） */
.skill-level-box:nth-child(2) {
    background: #009DE3;
}

/* 2級（3番目） */
.skill-level-box:nth-child(3) {
    background: #4F85C4;
}

/* 準1級（4番目） */
.skill-level-box:nth-child(4) {
    background: #7FBE25;
}

/* 1級（5番目） */
.skill-level-box:nth-child(5) {
    background: #01A13F;
}

/* 左側の縦線から各ボックスへの接続線 */
.skill-level-box::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 100%;
    width: 60px;
    height: 6px;
    transform: translateY(-50%);
    z-index: 1;
}

.skill-level-box:nth-child(1)::after {
    background: #764ba2;
}

.skill-level-box:nth-child(2)::after {
    background: #009DE3;
}

.skill-level-box:nth-child(3)::after {
    background: #4F85C4;
}

.skill-level-box:nth-child(4)::after {
    background: #7FBE25;
}

.skill-level-box:nth-child(5)::after {
    background: #01A13F;
}

/* 級レベルヘッダー */
.skill-level-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.skill-level-header:hover {
    background: rgba(255, 255, 255, 0.1);
}

.skill-level-header:active {
    background: rgba(255, 255, 255, 0.2);
}

.skill-level-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
    margin-right: 12px;
}

.skill-level-title {
    font-size: 22px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
}

.skill-level-progress-inline {
    font-size: 28px;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.skill-level-progress {
    font-size: 24px;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    display: none;
}

.skill-total-count {
    font-size: 18px;
    color: #ffd700;
    margin-left: 10px;
    font-weight: 600;
}

.skill-level-modes {
    font-size: 15px;
    color: #fff;
    margin-top: 8px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.mode-block {
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-weight: 500;
}

.skill-level-toggle {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
}

.skill-level-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.toggle-icon {
    display: block;
    font-size: 18px;
    line-height: 1;
    color: #fff;
}

/* 各級のスキルコンテンツ */
.skill-level-content {
    padding: 0 16px 12px 16px;
    width: 100%;
}

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

/* スキルアイテム */
.skill-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.skill-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

.skill-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: #0073aa;
}

.skill-item-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.skill-checkbox {
    width: 22px;
    height: 22px;
    cursor: pointer;
    flex-shrink: 0;
}

.skill-link {
    font-size: 14px;
    font-weight: bold;
    color: #0073aa;
    text-decoration: none;
    flex-grow: 1;
}

.skill-link:hover {
    text-decoration: underline;
    color: #005a87;
}

.skill-stats {
    display: flex !important;
    flex-direction: row !important;
    align-items: baseline !important;
    gap: 12px !important;
    font-size: 16px !important;
    color: #666 !important;
    padding-left: 34px !important;
    flex-wrap: wrap !important;
}

.skill-understanding {
    font-size: 16px !important;
    color: #333 !important;
    margin: 0 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    display: inline !important;
}

.skill-understanding strong {
    color: #0073aa !important;
    font-size: 18px !important;
    font-weight: bold !important;
}

.skill-mode-stat {
    font-size: 17px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline !important;
    font-weight: 600 !important;
}

.skill-mode-stat.stat-complete {
    color: #0073aa !important;
}

.skill-mode-stat.stat-incomplete {
    color: #dc3545 !important;
}

@media (max-width: 600px) {
    .skill-mypage-title {
        font-size: 20px;
    }

    .skill-roadmap {
        padding: 5px;
        max-width: 100%;
    }

    .skill-roadmap::before {
        left: 8px;
        width: 4px;
    }

    .skill-level-box {
        width: calc(100% - 40px);
        margin-left: 35px;
        margin-bottom: 30px;
    }

    .skill-level-box::after {
        width: 27px;
    }

    .skill-level-header {
        padding: 10px 12px;
    }

    .skill-level-title {
        font-size: 16px;
        gap: 8px;
    }

    .skill-level-progress-inline {
        font-size: 22px;
    }

    .skill-level-progress {
        font-size: 18px;
        display: none;
    }

    .skill-total-count {
        font-size: 13px;
    }

    .skill-level-modes {
        font-size: 12px;
        gap: 6px;
    }

    .mode-block {
        padding: 5px 10px;
    }

    .skill-level-toggle {
        width: 35px;
        height: 35px;
        font-size: 20px;
        line-height: 1;
        padding: 0;
    }

    .skill-level-stats {
        gap: 2px;
        margin-right: 8px;
    }

    .skill-level-content {
        padding: 0 8px 8px 8px;
    }

    .skill-item-header {
        flex-wrap: nowrap;
        margin-bottom: 5px;
    }

    .skill-stats {
        padding: 0 !important;
        margin: 0 !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: baseline !important;
        gap: 6px !important;
        flex-wrap: nowrap !important;
        font-size: 13px !important;
    }

    .skill-understanding {
        font-size: 13px !important;
        margin: 0 !important;
        padding: 0 !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        display: inline !important;
    }

    .skill-understanding strong {
        font-size: 15px !important;
        color: #0073aa !important;
        font-weight: bold !important;
    }

    .skill-mode-stat {
        font-size: 12px !important;
        margin: 0 !important;
        padding: 0 !important;
        white-space: nowrap !important;
        flex-shrink: 1 !important;
        display: inline !important;
        font-weight: 600 !important;
    }

    .skill-mode-stat.stat-complete {
        color: #0073aa !important;
    }

    .skill-mode-stat.stat-incomplete {
        color: #dc3545 !important;
    }

    .skill-item {
        padding: 10px;
        margin-bottom: 8px;
    }

    .skill-checkbox {
        width: 18px;
        height: 18px;
    }

    .skill-link {
        font-size: 12px;
    }
}

/* ==========================================
   3. スキル一覧ページ
   ========================================== */

.skill-list-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.skill-list-title {
    font-size: 24px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0073aa;
}

.skill-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.skill-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 15px;
    transition: box-shadow 0.3s ease;
}

.skill-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.skill-item-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.skill-checkbox {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
}

.skill-link {
    font-size: 15px;
    font-weight: bold;
    color: #0073aa;
    text-decoration: none;
    flex-grow: 1;
}

.skill-link:hover {
    text-decoration: underline;
}

.skill-stats {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 14px;
    color: #666;
    margin-left: 30px;
}

.skill-understanding {
    font-size: 16px;
    color: #333;
}

.skill-understanding strong {
    color: #0073aa;
    font-size: 18px;
}

.skill-mode-stats {
    display: flex;
    gap: 20px;
}

.skill-mode-stats span {
    background: #f5f5f5;
    padding: 5px 10px;
    border-radius: 4px;
}

/* ==========================================
   2. モード切り替えタブ
   ========================================== */

.skill-mode-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #ddd;
    margin-top: 0;
}

.mode-tab {
    padding: 12px 24px;
    border: 2px solid #ddd;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
}

/* 記述モード（手入力モード） */
.mode-tab[data-mode="input"] {
    background: #fff;
    color: #dc6b9f;
    border-color: #dc6b9f;
}

.mode-tab[data-mode="input"]:hover {
    background: #fef5f9;
}

.mode-tab[data-mode="input"].active {
    background: #7b68ee;
    color: #fff;
    border-color: #7b68ee;
}

/* 選択型（選択式モード） */
.mode-tab[data-mode="choice"] {
    background: #fff;
    color: #dc6b9f;
    border-color: #dc6b9f;
}

.mode-tab[data-mode="choice"]:hover {
    background: #fef5f9;
}

.mode-tab[data-mode="choice"].active {
    background: #ff6b9d;
    color: #fff;
    border-color: #ff6b9d;
}

/* 並び替えモード */
.mode-tab[data-mode="reorder"] {
    background: #fffacd;
    color: #333;
    border-color: #f0e68c;
}

.mode-tab[data-mode="reorder"]:hover {
    background: #fff9b8;
}

.mode-tab[data-mode="reorder"].active {
    background: #7b68ee;
    color: #fff;
    border-color: #7b68ee;
}

/* ==========================================
   3. 個別練習ページレイアウト（レスポンシブ）
   ========================================== */

.skill-practice-container {
    width: 100%;
    margin: 0;
    padding: 20px 0;
}

.skill-practice-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

/* タブレット（768px以下）: 2カラム維持 */
@media (max-width: 768px) {
    .skill-practice-container {
        padding: 20px 0;
    }

    .skill-practice-layout {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
}

/* スマホ（600px以下）: 1カラム */
@media (max-width: 600px) {
    .skill-practice-layout {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0;
        margin: 0;
    }

    .skill-left-section,
    .skill-right-section {
        padding: 15px;
        margin: 0;
        border-radius: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .work-item {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
}

/* ==========================================
   4. 左側: 説明と例題
   ========================================== */

.skill-left-section {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.skill-explanation h2 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #333;
}

.skill-description {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
    color: #555;
}

.skill-video {
    margin: 0 0 20px 0;
}

.skill-video h3 {
    font-size: 18px;
    margin-bottom: 15px;
}

.skill-video iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
}

/* スライド埋め込み用 */
.skill-slide {
    margin: 20px 0;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.skill-slide h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.slide-page-count {
    font-size: 14px;
    color: #666;
    background: #f0f0f0;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: normal;
}

.slide-container {
    position: relative !important;
    width: 100% !important;
    padding-bottom: 56.25% !important; /* 16:9のアスペクト比 */
    height: 0 !important;
    overflow: hidden !important;
    background: #f5f5f5;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.slide-container iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: none;
    border-radius: 8px;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* 全画面表示時のスタイル */
.slide-container:fullscreen,
.slide-container:-webkit-full-screen,
.slide-container:-moz-full-screen,
.slide-container:-ms-fullscreen {
    padding-bottom: 0;
    height: 100vh;
    width: 100vw;
    background: #000;
}

.slide-container:fullscreen iframe,
.slide-container:-webkit-full-screen iframe,
.slide-container:-moz-full-screen iframe,
.slide-container:-ms-fullscreen iframe {
    border-radius: 0;
}

/* スライド操作ボタン */
.slide-control-btn {
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    position: absolute;
}

.slide-control-btn:hover {
    background: rgba(0, 0, 0, 1);
    transform: scale(1.1);
}

.slide-control-btn svg {
    pointer-events: none;
    width: 32px;
    height: 32px;
}

/* 全画面ボタン（右上配置） */
.slide-fullscreen {
    top: 20px;
    right: 20px;
    z-index: 10;
}

/* 最初から読むボタン（スマホのみ、右下配置） */
.slide-restart {
    bottom: 20px;
    right: 20px;
    z-index: 10;
    display: none;
}

/* mobile-onlyクラス: デフォルトで非表示、スマホ（600px以下）のみ表示 */
.mobile-only {
    display: none !important;
}

@media (max-width: 600px) {
    .mobile-only {
        display: block !important;
    }

    /* slide-restartボタンはflexで表示 */
    .mobile-only.slide-restart {
        display: flex !important;
    }
}

/* モバイル対応 */
@media (max-width: 600px) {
    /* スライドを画面端まで表示 */
    .skill-slide {
        margin-left: -15px;
        margin-right: -15px;
        width: calc(100% + 30px);
        max-width: none;
    }

    .custom-slide-viewer,
    .slide-container {
        border-radius: 0;
        box-shadow: none;
    }

    .custom-slide-wrapper {
        border-radius: 0;
    }

    .slide-control-btn {
        width: 48px;
        height: 48px;
    }

    .slide-control-btn svg {
        width: 32px;
        height: 32px;
    }

    .slide-fullscreen {
        top: 10px;
        right: 10px;
    }

    .slide-restart {
        display: flex;
        bottom: 10px;
        right: 10px;
    }
}

.skill-examples {
    margin-top: 0;
    margin-bottom: 20px;
}

.skill-examples h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #333;
}

.example-item {
    background: #f9f9f9;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #0073aa;
    border-radius: 4px;
}

.example-title {
    font-size: 18px;
    margin-bottom: 12px;
    color: #0073aa;
    font-weight: bold;
}

.example-explanation {
    font-size: 15px;
    color: #333;
    line-height: 1.8;
}

/* ==========================================
   5. 右側: ワーク問題
   ========================================== */

.skill-right-section {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.skill-right-section h3 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #333;
}

.work-item {
    background: #f5f5f5;
    padding: 20px;
    margin-bottom: 3px;
    border-radius: 8px;
    border: 2px solid #ddd;
}

.work-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.work-item h4 {
    font-size: 18px;
    margin-bottom: 0;
    color: #0073aa;
}

.work-question {
    font-size: 16px;
    margin-bottom: 15px;
    color: #333;
    font-weight: bold;
}

/* 日本語と英語を分けて表示 */
.question-ja {
    font-size: 16px;
    color: #333;
    margin-bottom: 8px;
    font-weight: bold;
}

.question-en {
    font-size: 18px;
    color: #0073aa;
    font-weight: bold;
    font-family: 'Arial', 'Helvetica', sans-serif;
    letter-spacing: 0.5px;
}

/* 手入力用テキストエリア */
.work-answer {
    width: 100%;
    max-width: 100%;
    min-height: 80px;
    padding: 12px;
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #000 !important;
    border: 2px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    font-family: inherit;
    resize: vertical;
    line-height: 1.5;
}

.work-answer:focus {
    outline: none;
    border-color: #0073aa;
}

.work-answer:disabled {
    background: #e0e0e0;
    cursor: not-allowed;
}

/* 選択式用ラジオボタン */
.work-choices {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.choice-option {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.choice-option:hover {
    background: #f0f8ff;
    border-color: #0073aa;
}

.choice-option input[type="radio"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
}

.choice-option input[type="radio"]:checked + label {
    font-weight: bold;
}

/* 回答送信ボタン */
.submit-works-btn {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    background: #0073aa;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.submit-works-btn:hover {
    background: #005a87;
}

.submit-works-btn.partial-answer-btn {
    background: #28a745 !important;
}

.submit-works-btn.partial-answer-btn:hover {
    background: #218838 !important;
}

.submit-works-btn:disabled,
.submit-works-btn.disabled-btn {
    background: #ccc !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

/* ==========================================
   6. 評価結果表示
   ========================================== */

.work-result {
    margin-top: 20px;
    padding: 10px;
    background: #fff;
    border-radius: 8px;
    border: 2px solid #ddd;
}

.result-judgment {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 5px;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
}

.judgment-correct {
    color: #28a745;
    background: #d4edda;
    border: 2px solid #28a745;
}

.judgment-incorrect {
    color: #dc3545;
    background: #f8d7da;
    border: 2px solid #dc3545;
}

.result-ai-feedback {
    margin-top: 5px;
    margin-bottom: 5px;
    padding: 15px;
    background: #f0f8ff;
    border-left: 4px solid #0073aa;
    border-radius: 4px;
}

.result-ai-feedback strong {
    display: block;
    font-size: 16px;
    margin-bottom: 8px;
    color: #0073aa;
}

.result-ai-feedback p {
    font-size: 15px;
    line-height: 1.6;
    color: #333;
    margin: 0;
}

.result-hint {
    padding: 15px;
    background: #fff9e6;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
    margin-top: 5px;
}

.result-hint strong {
    display: block;
    font-size: 16px;
    margin-bottom: 8px;
    color: #f57c00;
}

.result-hint p {
    font-size: 15px;
    line-height: 1.6;
    color: #555;
    margin: 0;
}

/* ==========================================
   7. 次のスキルへのリンク
   ========================================== */

.next-skill-section {
    text-align: center;
    padding: 30px;
    background: #f5f5f5;
    border-radius: 8px;
    margin-top: 30px;
}

.next-skill-section h3 {
    font-size: 22px;
    margin-bottom: 10px;
    color: #28a745;
}

.next-skill-link {
    display: inline-block;
    padding: 15px 30px;
    margin-top: 15px;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    background: #0073aa;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.3s ease;
}

.next-skill-link:hover {
    background: #005a87;
}

/* ==========================================
   8. レスポンシブ調整
   ========================================== */

@media (max-width: 600px) {
    .skill-practice-container {
        padding: 15px 0;
    }

    .skill-left-section,
    .skill-right-section {
        padding: 15px;
    }

    .skill-mode-tabs {
        gap: 10px;
        margin-bottom: 15px;
        border-bottom: none;
    }

    .mode-tab {
        flex: 1;
        border-radius: 8px;
        font-size: 14px;
        padding: 10px 16px;
    }

    .work-item {
        padding: 15px;
    }

    .skill-stats {
        margin-left: 0;
    }

    .skill-mode-stats {
        flex-direction: column;
        gap: 5px;
    }
}

/* ==========================================
   並び替えモード用スタイル
   ========================================== */

/* 並び替え用の単語ボタン */
.reorder-words-container {
    margin: 20px 0;
}

.reorder-words {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    min-height: 80px;
}

.word-btn {
    padding: 8px 16px;
    background: #fff;
    border: 2px solid #0073aa;
    border-radius: 6px;
    color: #0073aa;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.word-btn:hover:not(:disabled) {
    background: #0073aa;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.word-btn:disabled,
.word-btn.used {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: #ccc;
    color: #999;
}

/* 選択した単語の表示エリア */
.reorder-answer-area {
    margin: 20px 0;
}

.selected-words {
    min-height: 60px;
    padding: 15px;
    background: #fff;
    border: 2px dashed #0073aa;
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
    flex: 1;
    min-width: 0;
}

.selected-words:empty::before {
    content: '単語をクリックして文を作ってください';
    color: #999;
    font-style: italic;
}

.selected-word {
    position: relative;
    padding: 8px 16px;
    background: #0073aa;
    color: #fff;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.selected-word:hover {
    background: #005a87;
    transform: scale(1.05);
}

.word-number {
    position: absolute;
    top: -8px;
    left: -8px;
    background: #ff6b6b;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.reset-btn {
    padding: 6px 12px;
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.reset-btn:hover {
    background: #c82333;
}

/* モバイル対応 */
@media (max-width: 600px) {
    .word-btn {
        padding: 8px 16px;
        font-size: 14px;
    }

    .selected-word {
        padding: 6px 12px;
        font-size: 14px;
    }

    .reorder-words {
        padding: 15px;
        gap: 8px;
    }

    .selected-words {
        padding: 10px;
        min-height: 50px;
    }
}

/* ==========================================
   prefix/suffix（固定文字列）スタイル
   ========================================== */

/* 記述モード用 */
.input-with-fixed {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.fixed-prefix,
.fixed-suffix {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    padding: 8px 12px;
    background: #e8f4f8;
    border: 2px solid #0073aa;
    border-radius: 6px;
    flex-shrink: 0;
    white-space: nowrap;
}

.work-answer.with-fixed {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

/* 並び替えモード用 */
.reorder-fixed-prefix,
.reorder-fixed-suffix {
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    padding: 10px 16px;
    background: #7b68ee;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: inline-block;
}

.reorder-answer-area {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* モバイル対応 */
@media (max-width: 600px) {
    .fixed-prefix,
    .fixed-suffix,
    .reorder-fixed-prefix,
    .reorder-fixed-suffix {
        font-size: 15px;
        padding: 6px 10px;
    }

    .input-with-fixed {
        flex-wrap: nowrap;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .fixed-prefix,
    .fixed-suffix {
        font-size: 14px;
        flex-shrink: 0;
        max-width: 25%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .work-answer.with-fixed {
        flex: 1;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }

    .work-answer {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
}

/* ==========================================
   カスタムHTMLスライド
   ========================================== */

.custom-slide-viewer {
    width: 100%;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
}

.custom-slides-container {
    width: 100%;
    aspect-ratio: 1 / 1; /* 正方形 */
    position: relative;
    overflow: hidden;
    background: white;
    border: 2px solid #ddd; /* スライド枠を見えるようにする */
}

.custom-slide-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow: auto;
    padding: 0; /* パディング削除 */
    box-sizing: border-box;
}

.custom-slide-item.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

/* custom-slide-container スタイル（カスタムHTML内で使用） */
.custom-slide-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 5px; /* 全方向5px */
    background: #ffffff;
    color: #333;
    font-family: 'Yu Gothic', 'Hiragino Kaku Gothic Pro', 'Meiryo', sans-serif;
    overflow: auto;
    box-sizing: border-box;
}

/* レッスンバッジ */
.lesson-badge {
    background: #ffd700;
    color: #333;
    padding: 5px 15px;
    border-radius: 50%;
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 10px;
    display: inline-block;
}

.custom-slide-container .slide-title {
    font-size: 2em;
    margin-top: 0; /* ブラウザデフォルトの上マージンを削除 */
    margin-bottom: 20px;
    color: #0073aa;
    text-align: center;
    font-weight: bold;
}

/* h1タグもデフォルトマージンを削除 */
.custom-slide-container h1 {
    margin-top: 0;
}

/* h3タグもデフォルトマージンを削除 */
.custom-slide-container h3 {
    margin-top: 0;
}

.custom-slide-container .slide-content {
    font-size: 1.1em;
    line-height: 1.8;
    width: 100%;
    max-width: 100%;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: left;
}

.custom-slide-container .formula {
    font-size: 1.5em;
    background: #fff4e6;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    font-weight: bold;
    border: 2px solid #ff9800;
    text-align: center;
}

.custom-slide-container .example-box {
    background: #f0f8ff;
    padding: 15px;
    margin: 10px 0;
    border-radius: 8px;
    border-left: 4px solid #0073aa;
}

.custom-slide-container .english {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 8px;
    color: #0073aa;
}

.custom-slide-container .japanese {
    font-size: 1em;
    color: #666;
}

.custom-slide-container .highlight {
    color: #ff9800;
    font-weight: bold;
    text-decoration: underline;
}

.custom-slide-container .note {
    font-size: 0.95em;
    margin-top: 15px;
    padding: 12px;
    background: #fff9e6;
    border-radius: 6px;
    border-left: 3px solid #ffc107;
}

.custom-slide-container .slide-list {
    text-align: left;
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

.custom-slide-container .slide-list li {
    margin: 10px 0;
    padding-left: 25px;
    position: relative;
    font-size: 1.05em;
}

.custom-slide-container .slide-list li:before {
    content: "▸";
    position: absolute;
    left: 0;
    color: #0073aa;
    font-size: 1.2em;
}

/* 形容詞スライド用の追加スタイル */
.intro-text {
    font-size: 1.3em;
    line-height: 1.8;
}

.body-text {
    font-size: 1.2em;
    line-height: 1.8;
    margin-top: 15px;
}

.important-text {
    background: #fff3cd;
    padding: 2px 8px;
    font-weight: bold;
}

.position-box {
    background: #ffe6f0;
    border: 3px solid #ff69b4;
    padding: 20px;
    border-radius: 10px;
    margin: 15px 0;
}

.position-flex {
    display: flex;
    justify-content: space-around;
    align-items: center;
    font-size: 1.3em;
    font-weight: bold;
}

.position-item {
    text-align: center;
}

.position-label {
    color: #e74c3c;
    margin-bottom: 10px;
}

.position-divider {
    font-size: 2em;
    color: #666;
}

.highlight-underline {
    color: #e74c3c;
    text-decoration: underline;
}

.note-small {
    margin-top: 10px;
    font-size: 0.95em;
    color: #555;
}

.section-intro {
    font-size: 1.2em;
    margin-bottom: 20px;
}

.usage-box {
    background: #f8f0ff;
    padding: 20px;
    border-radius: 10px;
    margin: 15px 0;
}

.usage-title {
    font-size: 1.3em;
    font-weight: bold;
    color: #9c27b0;
    margin-bottom: 15px;
}

.usage-item {
    margin-bottom: 10px;
}

.usage-badge {
    background: #e1bee7;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.9em;
    display: inline-block;
    margin-bottom: 5px;
}

.usage-example {
    margin-top: 8px;
    font-size: 1.1em;
}

.usage-translation {
    color: #666;
    font-size: 0.95em;
}

.word-highlight {
    color: #e74c3c;
    font-weight: bold;
}

.suffix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1em;
    margin-top: 15px;
}

.suffix-table thead {
    background: #333;
    color: white;
}

.suffix-table th {
    padding: 10px;
    border: 1px solid #ddd;
}

.suffix-table th:first-child {
    width: 30%;
}

.suffix-table tbody tr {
    background: #ffcce0;
}

.suffix-cell {
    padding: 12px;
    border: 1px solid #ddd;
    font-weight: bold;
    font-size: 1.2em;
    text-align: center;
}

.example-cell {
    padding: 12px;
    border: 1px solid #ddd;
    background: #fffacd;
}

.example-cell div {
    margin: 5px 0;
}

.hero-advice {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
}

/* スマホ対応 */
@media (max-width: 768px) {
    .intro-text, .body-text {
        font-size: 1em;
    }

    .position-flex {
        font-size: 1em;
        flex-direction: column;
    }

    .position-divider {
        display: none;
    }

    .suffix-table {
        font-size: 0.85em;
    }
}

/* スライド内のキャラクター画像 */
.slide-character-top {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: auto;
    z-index: 10;
}

.slide-character-bottom {
    position: absolute;
    bottom: 10px;
    left: 10px;
    width: 40px;
    height: auto;
    z-index: 10;
}

.slide-character-comment {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 50px;
    height: auto;
    z-index: 10;
    opacity: 0.9;
}

/* custom-html-slide スタイル（h2/h3分割時） */
.custom-html-slide {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 30px;
    box-sizing: border-box;
    overflow: auto;
}

/* ナビゲーション */
.custom-slide-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
}

.custom-slide-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 20px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.custom-slide-btn:hover:not(:disabled) {
    background: #005a87;
    transform: translateY(-2px);
}

.custom-slide-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

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

.custom-slide-counter {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.current-slide {
    color: #0073aa;
    font-size: 20px;
}

/* スマホ対応 */
@media (max-width: 768px) {
    .custom-slides-container {
        aspect-ratio: auto;
        min-height: 400px;
    }

    .custom-slide-item {
        padding: 15px;
    }

    .custom-slide-nav {
        padding: 10px 15px;
    }

    .custom-slide-btn {
        padding: 8px 15px;
        font-size: 13px;
    }

    .custom-slide-counter {
        font-size: 14px;
    }

    /* カスタムスライドのスマホ調整 */
    .custom-slide-container {
        padding: 5px; /* 全方向5px */
    }

    .custom-slide-container .slide-title {
        font-size: 1.5em;
    }

    .custom-slide-container .slide-content {
        font-size: 0.95em;
        padding: 15px;
    }

    .custom-slide-container .formula {
        font-size: 1.2em;
        padding: 12px;
    }

    .custom-slide-container .example-box {
        padding: 12px;
    }

    .custom-slide-container .english {
        font-size: 1.05em;
    }

    .custom-slide-container .japanese {
        font-size: 0.9em;
    }

    .custom-slide-container .slide-list li {
        font-size: 0.95em;
    }

    /* スマホ用：キャラクター画像を小さく */
    .slide-character-top,
    .slide-character-bottom {
        width: 25px;
    }

    .slide-character-comment {
        width: 30px;
    }
}

/* ==========================================
   ローディング画面
   ========================================== */
#skill-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(3px);
    z-index: 9998;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #f3f3f3;
    border-top: 6px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    font-size: 1.8em;
    font-weight: bold;
    color: #0073aa;
    animation: blink 1.5s ease-in-out infinite;
}

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

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ==========================================
   紙吹雪アニメーション
   ========================================== */
@keyframes confetti-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.confetti {
    pointer-events: none;
    z-index: 10000;
}

/* ==========================================
   全問正解アイコンのアニメーション
   ========================================== */
@keyframes perfect-score-bounce {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* ==========================================
   花火アニメーション
   ========================================== */
@keyframes firework-burst {
    0% {
        transform: translateX(0) translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateX(100px) translateY(100px);
        opacity: 0;
    }
}

.firework-particle {
    pointer-events: none;
}

/* ==========================================
   途中回答インジケーター
   ========================================== */
#progress-indicator {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 10px;
    background: #ff9800;
    color: white;
    padding: 14px 35px;
    font-weight: bold;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 9997;
    cursor: pointer;
    text-align: center;
    border-radius: 25px;
    width: auto;
    white-space: nowrap;
    transition: all 0.3s ease;
}

#progress-indicator:hover {
    background: #f57c00;
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

#progress-indicator:active {
    transform: translateX(-50%) scale(0.98);
}

#progress-indicator.scrolling {
    opacity: 0.5;
}

@media (max-width: 768px) {
    #progress-indicator {
        font-size: 15px;
        padding: 12px 28px;
    }
}

/* ==========================================
   学習カレンダー
   ========================================== */

.skill-calendar-container {
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
    max-width: 100%;
    pointer-events: auto;
    transition: all 0.3s ease;
    border: 2px solid #e0e0e0;
    overflow: visible; /* Safari対策: hidden → visible */
    position: relative;
    min-height: 100px; /* Safariのレンダリングバグ回避 */
}

.shooting-star {
    position: absolute;
    font-size: 2em;
    pointer-events: none;
    z-index: 1000;
    animation: shootingStar 1s ease-out forwards;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8), 0 0 20px rgba(255, 215, 0, 0.5);
}

@keyframes shootingStar {
    0% {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translate(300px, 400px) rotate(360deg);
    }
}

.calendar-note {
    font-size: 0.85em;
    color: #999;
    text-align: center;
    margin: 5px 0 20px 0;
    padding: 0;
}

@media (min-width: 1025px) {
    .calendar-note {
        display: none;
    }
}

@media (max-width: 1024px) {
    .skill-calendar-container {
        padding: 5px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .skill-calendar-header {
        margin-bottom: 5px !important;
    }

    .calendar-month-title {
        font-size: clamp(1em, 4vw, 1.5em) !important;
    }

    .monthly-star-count {
        font-size: 0.6em !important;
        display: block !important;
        margin-top: 3px !important;
        margin-left: 0 !important;
    }

    .calendar-star-message {
        font-size: 0.85em !important;
        padding: 8px !important;
    }

    .star-message-line1 {
        margin-bottom: 3px !important;
        font-size: 0.95em !important;
    }

    .star-message-line2 {
        font-size: 1em !important;
    }

    .calendar-nav-btn {
        width: 30px !important;
        height: 30px !important;
        font-size: 1.1em !important;
    }

    .skill-calendar-grid {
        gap: 2px !important;
        width: 100% !important;
    }

    .calendar-day-header {
        font-size: 0.9em !important;
        padding: 3px !important;
    }

    .calendar-day {
        padding: 2px !important;
        font-size: 0.65em !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }

    .calendar-day-number {
        font-size: 0.8em !important;
        flex-shrink: 0 !important;
        line-height: 1 !important;
    }

    .calendar-day-stars {
        font-size: 1.2em !important;
    }

    .calendar-day-details {
        display: none !important;
    }
}

.skill-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    position: relative;
    z-index: 5;
}

.calendar-month-title {
    margin: 0;
    font-size: clamp(1.2em, 3vw, 1.8em);
    color: #333;
    font-weight: bold;
    text-align: center;
}

.monthly-star-count {
    color: #1976d2;
    font-size: 0.7em;
    font-weight: bold;
    margin-left: 8px;
}

.star-number-title {
    font-size: 1.3em;
}

.calendar-nav-btn {
    background: #5c6bc0;
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-size: 1.3em;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    z-index: 10;
    flex-shrink: 0;
}

.calendar-nav-btn:hover {
    background: #3f51b5;
    transform: scale(1.1);
}

.calendar-nav-btn:active {
    transform: scale(0.95);
}

.calendar-star-message {
    grid-column: 1 / -1;
    text-align: center;
    background: linear-gradient(135deg, #fff9c4 0%, #ffeb3b 100%);
    color: #333;
    padding: 10px;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.star-message-line1 {
    margin-bottom: 5px;
}

.star-message-line1::first-letter,
.star-message-line2::first-letter {
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8), 0 0 20px rgba(255, 215, 0, 0.5);
    animation: starPulse 2s ease-in-out infinite;
}

@keyframes starPulse {
    0%, 100% {
        transform: scale(1);
        text-shadow: 0 0 10px rgba(255, 215, 0, 0.8), 0 0 20px rgba(255, 215, 0, 0.5);
    }
    50% {
        transform: scale(1.2);
        text-shadow: 0 0 15px rgba(255, 215, 0, 1), 0 0 30px rgba(255, 215, 0, 0.7);
    }
}

.star-message-line2 {
    font-size: 1.05em;
}

.calendar-star-message .star-count {
    color: #1976d2;
    font-weight: bold;
}

.calendar-star-message .star-number {
    font-size: 1.3em;
}

.calendar-loading {
    text-align: center;
    padding: 40px 20px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 15px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #5c6bc0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    font-size: 1.1em;
    color: #666;
    font-weight: bold;
}

/* Safari PC版対応: display: gridの明示的な設定 */
.skill-calendar-grid {
    display: -ms-grid !important;
    display: -webkit-grid !important;
    display: grid !important;
    -ms-grid-columns: (1fr)[7];
    -webkit-grid-template-columns: repeat(7, 1fr);
    grid-template-columns: repeat(7, 1fr) !important;
    gap: 5px;
    -webkit-gap: 5px;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    width: 100%;
    min-height: 50px; /* Safariのレンダリングバグ回避 */
}

/* page-id-2573専用の追加CSS対応 */
body.page-id-2573 .skill-calendar-grid {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
}

.calendar-day-header {
    text-align: center;
    font-weight: bold;
    padding: 5px;
    color: #666;
    font-size: 1.1em;
}

.calendar-day-header.saturday {
    color: #1976d2;
}

.calendar-day-header.sunday {
    color: #e91e63;
}

.calendar-day {
    aspect-ratio: 2 / 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s;
    background: #f5f5f5;
    color: #999;
    padding: 3px;
}

.calendar-day-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.calendar-day-stars {
    font-size: 1em;
    line-height: 1;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.6), 0 0 15px rgba(255, 215, 0, 0.4);
    animation: starTwinkle 3s ease-in-out infinite;
}

@keyframes starTwinkle {
    0%, 100% {
        opacity: 1;
        text-shadow: 0 0 8px rgba(255, 215, 0, 0.6), 0 0 15px rgba(255, 215, 0, 0.4);
    }
    50% {
        opacity: 0.7;
        text-shadow: 0 0 12px rgba(255, 215, 0, 0.8), 0 0 20px rgba(255, 215, 0, 0.6);
    }
}

.calendar-day-details {
    font-size: 0.325em;
    color: #666;
    text-align: left;
    margin-top: 2px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    display: none;
}

/* PC/タブレットではコース詳細を表示 */
@media (min-width: 1025px) {
    .calendar-day-details {
        display: block;
    }
}

.calendar-day.current-month {
    background: #fff;
    color: #333;
    border: 1px solid #e0e0e0;
}

.calendar-day.has-activity {
    background: #e3f2fd;
    color: #1976d2;
    font-weight: bold;
    border: 2px solid #1976d2;
}

.calendar-day.today {
    border: 3px solid #f44336 !important;
}

.calendar-day.has-activity.today {
    border: 3px solid #f44336 !important;
}

.calendar-day.saturday {
    color: #1976d2;
}

.calendar-day.sunday {
    color: #e91e63;
}

.calendar-day:hover.current-month {
    background: #f0f0f0;
    transform: scale(1.05);
}

.calendar-day-number {
    font-weight: bold;
    font-size: 1em;
}

.calendar-day-info {
    font-size: 0.325em;
    color: #666;
    text-align: left;
    margin-top: 2px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.calendar-day.has-activity .calendar-day-info {
    color: #1565c0;
    font-weight: 600;
}

/* モーダル */
.skill-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    overflow: auto;
}

.skill-modal-content {
    background: white;
    margin: 5% auto;
    width: 90%;
    max-width: 700px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.skill-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    border-bottom: 2px solid #f9a825;
    background: linear-gradient(135deg, #fff59d 0%, #ffeb3b 100%);
    border-radius: 12px 12px 0 0;
    color: #333;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.skill-modal-header h3 {
    margin: 0;
    font-size: 0.95em;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(255,255,255,0.5);
}

.skill-modal-close {
    background: none;
    border: none;
    font-size: 1.5em;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
}

.skill-modal-close:hover {
    transform: scale(1.2);
}

.skill-modal-body {
    padding: 15px;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-section {
    margin-bottom: 15px;
}

.modal-section h4 {
    margin-top: 0;
    margin-bottom: 8px;
    color: #5c6bc0;
    font-size: 0.95em;
}

#history-list {
    background: #f5f5f5;
    padding: 10px;
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    background: white;
    padding: 8px;
    margin-bottom: 5px;
    border-radius: 6px;
    border-left: 3px solid #5c6bc0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.history-item-title {
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
    font-size: 0.85em;
}

.history-item-mode {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.7em;
    margin-right: 5px;
    font-weight: bold;
}

.history-item-mode.choice {
    background: #e8f5e9;
    color: #2e7d32;
}

.history-item-mode.reorder {
    background: #fff3e0;
    color: #ef6c00;
}

.history-item-mode.input {
    background: #fce4ec;
    color: #c2185b;
}

.history-item-question {
    color: #666;
    font-size: 0.75em;
    margin: 4px 0;
}

.history-item-answer {
    margin: 4px 0;
    padding: 5px;
    background: #f9f9f9;
    border-radius: 4px;
    font-size: 0.75em;
}

.history-item-answer strong {
    color: #5c6bc0;
}

.history-item-result {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.7em;
    font-weight: bold;
    margin-top: 4px;
}

.history-item-result.correct {
    background: #c8e6c9;
    color: #2e7d32;
}

.history-item-result.incorrect {
    background: #ffcdd2;
    color: #c62828;
}

#diary-content {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    resize: vertical;
    transition: border 0.3s;
}

#diary-content:focus {
    outline: none;
    border-color: #5c6bc0;
}

.skill-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

.skill-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(102, 126, 234, 0.4);
}

.skill-btn-primary:active {
    transform: translateY(0);
}

/* レスポンシブ */
@media (max-width: 768px) {
    .skill-calendar-grid {
        gap: 3px;
    }

    .skill-calendar-container {
        padding: 10px;
    }

    .calendar-day {
        font-size: 0.75em;
        padding: 2px;
    }

    .calendar-day-number {
        font-size: 0.9em;
    }

    .calendar-day-info {
        font-size: 0.55em;
        margin-top: 1px;
    }

    .skill-modal-content {
        width: 98%;
        max-width: 98%;
        margin: 5% auto;
        padding: 0;
    }

    .skill-modal-header {
        padding: 10px !important;
    }

    .skill-modal-body {
        padding: 10px !important;
    }

    .calendar-month-title {
        font-size: 1.3em;
    }

    .calendar-nav-btn {
        width: 30px;
        height: 30px;
        font-size: 1.2em;
    }
}

/* ==========================================
   レクチャーページ埋め込み対応（追加）
   ========================================== */

/* デスクトップ/モバイル表示切り替え */
.desktop-only {
    display: block !important;
}

.mobile-only {
    display: none !important;
}

@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
    
    .mobile-only {
        display: block !important;
    }
}

/* レクチャーiframe（PC/タブレット） */
.lecture-container {
    max-height: 600px;
    overflow-y: auto;
    border-radius: 8px;
    margin-bottom: 20px;
}

.lecture-container iframe {
    width: 100%;
    min-height: 600px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

/* レクチャーモーダル（スマホ） */
.lecture-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.lecture-modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lecture-modal-content {
    width: 95%;
    height: 90%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    animation: slideUp 0.3s ease;
}

.lecture-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.lecture-modal-content iframe {
    width: 100%;
    height: 100%;
    border: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* PC/タブレット: 左カラムの高さ制限とスクロール */
@media (min-width: 769px) {
    .skill-left-section {
        max-height: 800px;
        overflow-y: auto;
        padding-right: 10px;
    }
    
    .skill-left-section::-webkit-scrollbar {
        width: 8px;
    }
    
    .skill-left-section::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }
    
    .skill-left-section::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 4px;
    }
    
    .skill-left-section::-webkit-scrollbar-thumb:hover {
        background: #555;

/* ==========================================
   スキルタイトルヘッダー
   ========================================== */

.skill-title-header {
    text-align: center;
    margin: -20px -20px 20px -20px;
    padding: 30px 20px !important;
    border-radius: 0 0 12px 12px;
}

.skill-title-header h1 {
    color: white !important;
    font-size: 28px !important;
    font-weight: bold !important;
    margin: 0 !important;
    line-height: 1.4 !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

@media (max-width: 768px) {
    .skill-title-header h1 {
        font-size: 22px !important;
    }
}