/* ========================================
   基本設定
======================================== */

* {
    box-sizing: border-box;
}

/* ゲーム下へ回った広告は、画面幅1180px以下で3件を横一列にする */
@media (max-width: 1180px) {
    .game-affiliate-section--sidebar .affiliate-grid.affiliate-grid--sidebar,
    .game-affiliate-section--below .affiliate-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
    }

    .game-affiliate-section--sidebar .affiliate-card,
    .game-affiliate-section--below .affiliate-card {
        min-width: 0;
        padding: 10px;
    }

    .game-affiliate-section--sidebar .affiliate-card-link,
    .game-affiliate-section--below .affiliate-card-link {
        align-items: center;
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .game-affiliate-section--sidebar .affiliate-image,
    .game-affiliate-section--below .affiliate-image {
        width: 64px;
        height: 90px;
    }

    .game-affiliate-section--sidebar .affiliate-card-content h2,
    .game-affiliate-section--below .affiliate-card-content h2 {
        font-size: clamp(10px, 2vw, 14px);
        line-height: 1.45;
    }

    .game-affiliate-section--sidebar .affiliate-button,
    .game-affiliate-section--below .affiliate-button {
        margin-top: 8px;
        padding: 6px 8px;
        font-size: 10px;
    }
}

@media (min-width: 1180px) {
    .game-affiliate-section--below .affiliate-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        "Hiragino Kaku Gothic ProN",
        "Hiragino Sans",
        Meiryo,
        sans-serif;

    color: #1e293b;

    background: #f8fafc;

    line-height: 1.8;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
}

section {
    margin-bottom: 80px;
}


/* ========================================
   ヘッダー
======================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;

    background: rgba(255, 255, 255, 0.94);

    backdrop-filter: blur(12px);

    border-bottom: 1px solid #e2e8f0;
}

.header-inner {
    max-width: 1180px;

    margin: 0 auto;

    padding: 14px 24px;

    display: flex;

    align-items: center;

    justify-content: space-between;
}

.logo {
    display: flex;

    align-items: center;

    gap: 10px;

    font-weight: 800;

    font-size: 16px;

    line-height: 1.3;
}

.logo small {
    display: block;

    font-size: 10px;

    color: #64748b;

    font-weight: 500;
}

.logo-mark {
    width: 38px;
    height: 38px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 4px;

    color: white;

    background:
        linear-gradient(
            135deg,
            #2563eb,
            #7c3aed
        );

    font-weight: 900;

    font-size: 19px;
}

.navigation {
    display: flex;

    gap: 8px;
}

.navigation a {
    padding: 2px 8px;
    border-radius: 2px;
    color: #475569;
    font-size: 14px;
    font-weight: 600;
    transition: 0.2s;
}

.navigation a:hover {
    background: #eff6ff;

    color: #2563eb;
}


/* ========================================
   スマホメニュー
======================================== */

.menu-button {
    display: none;

    width: 42px;
    height: 42px;

    border: 1px solid #e2e8f0;

    background: white;

    border-radius: 2px;

    cursor: pointer;
}

.menu-button span {
    display: block;

    width: 20px;

    height: 2px;

    margin: 4px auto;

    background: #334155;
}


/* ========================================
   ヒーロー
======================================== */

.hero {
    position: relative;

    min-height: 0;

    border-bottom: 1px solid #e2e8f0;
}

.hero::before {
    position: absolute;

    inset: 0;

    content: "";
}

.hero-image {
    display: block;

    width: 100%;

    height: 100%;

    /* 端末の縦横比が異なっても、画像を切り取らずに表示する */
    object-fit: contain;

    background: #0f172a;
}

.hero-inner {
    max-width: 1180px;

    margin: 0 auto;

    position: absolute;

    inset: 0;

    height: 100%;

    display: flex;

    align-items: flex-end;
}

.hero-label,
.section-label {
    color: #2563eb;

    font-size: 12px;

    font-weight: 800;

    letter-spacing: 2px;
}

.hero h1 {
    margin: 16px 0;

    font-size: clamp(
        38px,
        5vw,
        62px
    );

    line-height: 1.25;

    letter-spacing: -2px;
}

.hero h1 span {
    color: #2563eb;
}

.hero p {
    max-width: 600px;

    color: #64748b;

    font-size: 16px;
}

.hero-buttons {
    display: flex;

    gap: 12px;

    margin: 30px;

    flex-wrap: wrap;
}


/* ========================================
   ボタン
======================================== */

.button {
    display: inline-flex;

    align-items: center;

    gap: 12px;

    padding: 12px 22px;

    border-radius: 3px;

    font-weight: 700;

    font-size: 14px;

    transition:
        transform 0.2s,
        box-shadow 0.2s;
}

.button:hover {
    transform: translateY(-2px);
}

.button-primary {
    color: white;

    background: #2563eb;

    box-shadow:
        0 8px 20px
        rgba(37, 99, 235, 0.2);
}

.button-primary:hover {
    box-shadow:
        0 12px 25px
        rgba(37, 99, 235, 0.28);
}

.button-secondary {
    background: white;

    border: 1px solid #cbd5e1;

    color: #334155;
}


/* ========================================
   コードウィンドウ
======================================== */

.code-window {
    background: #0f172a;

    border-radius: 8px;

    overflow: hidden;

    box-shadow:
        0 25px 60px
        rgba(15, 23, 42, 0.2);

    transform: rotate(1deg);
}

.window-bar {
    height: 42px;

    display: flex;

    align-items: center;

    gap: 7px;

    padding: 0 16px;

    background: #1e293b;
}

.window-bar span {
    width: 10px;
    height: 10px;

    border-radius: 50%;

    background: #64748b;
}

.code {
    padding: 30px;

    color: #cbd5e1;

    font-family:
        Consolas,
        Monaco,
        monospace;

    font-size: 14px;
}

.code p {
    margin: 8px 0;
}

.indent {
    padding-left: 25px;
}

.code-blue {
    color: #60a5fa;
}

.code-yellow {
    color: #facc15;
}

.code-green {
    color: #4ade80;
}


/* ========================================
   共通
======================================== */

.container {
    max-width: 1180px;

    margin: 0 auto;

    padding: 0 24px;
}

.section-heading {
    display: flex;

    justify-content: space-between;

    align-items: end;

    gap: 20px;

    margin-bottom: 30px;
}

.section-heading h1,
.section-heading h2 {
    margin: 6px 0;

    font-size: 30px;

    letter-spacing: -0.5px;
}

.site-introduction {
    margin-bottom: 30px;
    padding-top: 50px;
}

.section-heading p {
    margin: 0;

    color: #64748b;

    font-size: 14px;
}

.more-link {
    color: #2563eb;

    font-size: 14px;

    font-weight: 700;

    white-space: nowrap;
}


/* ========================================
   NEWS
======================================== */

.news-section {
    padding-bottom: 30px;
}

.news-section .section-heading h1 {
    margin: 6px 0;

    font-size: 30px;

    letter-spacing: -0.5px;
}

.news-list {
    background: white;

    border: 1px solid #e2e8f0;

    border-radius: 8px;

    overflow: hidden;
}

.news-item {
    display: grid;

    grid-template-columns:
        110px
        75px
        1fr
        30px;

    align-items: center;

    gap: 15px;

    padding: 17px 22px;

    border-bottom: 1px solid #e2e8f0;

    transition: background 0.2s;
}

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

.news-item:hover {
    background: #f8fafc;
}

.news-item time {
    color: #64748b;

    font-size: 13px;
}

.news-category {
    display: inline-block;

    padding: 3px 8px;

    border-radius: 2px;

    font-size: 9px;

    font-weight: 800;

    text-align: center;
}

.category-game {
    color: #7c3aed;

    background: #f3e8ff;
}

.category-info {
    color: #0369a1;

    background: #e0f2fe;
}

.category-study {
    color: #059669;

    background: #d1fae5;
}

.category-blog {
    color: #2563eb;

    background: #dbeafe;
}

.news-title {
    font-size: 14px;

    font-weight: 600;
}

.news-arrow {
    color: #94a3b8;
}


/* ========================================
   広告
======================================== */

.ad-box {
    min-height: 100px;

    display: flex;

    align-items: center;

    justify-content: center;

    margin: 20px 0 30px;

    background: #f1f5f9;

    border-radius: 3px;

    color: #94a3b8;

    font-size: 9px;

    letter-spacing: 1px;
}

.ad-large {
    min-height: 150px;
}


.affiliate-grid {
    display: grid;

    grid-template-columns: repeat(3, minmax(0, 1fr));

    gap: 24px;

    margin: 20px 0 30px;
}

.affiliate-grid.affiliate-grid--inline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.affiliate-grid.affiliate-grid--sidebar {
    grid-template-columns: minmax(0, 1fr);
    margin: 0;
}


.affiliate-card {
    position: relative;

    padding: 16px;

    background: #f8fafc;

    border: 1px solid #e2e8f0;

    border-radius: 8px;
}

.affiliate-label {
    display: block;

    margin-bottom: 10px;

    color: #94a3b8;

    font-size: 9px;

    font-weight: 800;

    letter-spacing: 1px;
}

.affiliate-card-link {
    display: flex;

    align-items: center;

    gap: 20px;

    color: inherit;

    text-decoration: none;
}

.affiliate-image {
    width: 120px;

    height: auto;

    max-height: 150px;

    flex: 0 0 auto;

    border-radius: 4px;

    object-fit: contain;

    box-shadow: 0 4px 10px rgb(15 23 42 / 15%);
}

.affiliate-card-content {
    min-width: 0;
}

.affiliate-category {
    margin: 0 0 6px;

    color: #64748b;

    font-size: 10px;

    font-weight: 800;

    letter-spacing: 1px;
}

.affiliate-card-content h2 {
    margin: 0;

    color: #1e293b;

    font-size: 17px;

    line-height: 1.6;
}

.affiliate-recommendation {
    margin: 10px 0 0;

    color: #475569;

    font-size: 12px;

    line-height: 1.7;
}

.affiliate-button {
    display: inline-block;

    margin-top: 14px;

    padding: 9px 13px;

    border-radius: 4px;

    background: #f59e0b;

    color: #fff;

    font-size: 12px;

    font-weight: 800;
}

.affiliate-card-link:hover .affiliate-button {
    background: #d97706;
}

.affiliate-disclosure {
    margin: 12px 0 0;

    color: #94a3b8;

    font-size: 10px;
}

/* ========================================
   GAME
======================================== */
.game-section {
    margin-bottom: 80px;
}

.game-affiliate-section {
    padding-top: 56px;
    padding-bottom: 24px;
}

/* ゲーム内の右メニューは、全ページ共通のsection余白を引き継がない */
    .pp-side section,
    .np-side section,
    .bi-side section,
    .fb-side section,
.rv-side section {
    margin-bottom: 10px;
}

@media (min-width: 1181px) {
    .tetris-page,
    .arkanoid-page,
    .solitaire-page,
    .minesweeper-page,
    .sudoku-page,
    .cd-page,
    .rw-page,
    .cl-page,
    .cf-page,
    .pp-page,
    .np-page,
    .bi-page,
    .merge-page,
    .rv-page,
    .fb-page {
        padding-right: 320px !important;
    }

    .game-affiliate-section--sidebar {
        position: fixed;
        z-index: 30;
        top: 86px;
        right: 14px;
        width: 290px;
        max-height: calc(100vh - 100px);
        margin: 0;
        padding: 14px;
        overflow-y: auto;
        border: 1px solid #dbe3ef;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.97);
        box-shadow: 0 14px 40px rgba(15, 23, 42, 0.2);
    }

    .game-affiliate-section--sidebar .section-heading {
        margin-bottom: 10px;
    }

    .game-affiliate-section--sidebar .section-heading h2 {
        margin: 3px 0;
        font-size: 18px;
    }

    .game-affiliate-section--sidebar .section-heading p {
        font-size: 11px;
        line-height: 1.5;
    }

    .game-affiliate-section--sidebar .affiliate-grid {
        gap: 10px;
        margin: 10px 0 0;
    }

    .game-affiliate-section--sidebar .affiliate-card {
        padding: 10px;
    }

    .game-affiliate-section--sidebar .affiliate-card-link {
        gap: 10px;
    }

    .game-affiliate-section--sidebar .affiliate-image {
        width: 64px;
        height: 90px;
    }

    .game-affiliate-section--sidebar .affiliate-card-content h2 {
        font-size: 12px;
        line-height: 1.45;
    }

    .game-affiliate-section--sidebar .affiliate-button {
        margin-top: 7px;
        padding: 6px 8px;
        font-size: 10px;
    }

    .game-affiliate-section--sidebar .affiliate-label,
    .game-affiliate-section--sidebar .affiliate-disclosure {
        font-size: 8px;
    }

    .game-affiliate-section--sidebar .affiliate-label {
        margin-bottom: 5px;
    }

    .game-affiliate-section--sidebar .affiliate-disclosure {
        margin-top: 6px;
    }
}


/* ========================================
   ゲームカード
======================================== */

.card-grid {
    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 24px;
}

.game-card {
    background: white;

    border:
        1px solid #e2e8f0;

    border-radius: 8px;

    overflow: hidden;

    transition:
        transform 0.25s,
        box-shadow 0.25s;
}

.game-card:hover {
    transform: translateY(-5px);

    box-shadow:
        0 15px 35px
        rgba(15, 23, 42, 0.08);
}

.card-image {
    height: 170px;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 65px;
}

.game-image span {
    display: flex;

    align-items: center;

    justify-content: center;
}

.game-image img {
    display: block;

    width: 120px;

    height: 120px;

    object-fit: contain;
}

.game-image-21 {
    background: linear-gradient(135deg, #dbeafe, #cffafe);
}

.game-image-16 {
    background: linear-gradient(135deg, #d9f3e9, #dce6fa);
}

.game-image-17 {
    background: linear-gradient(135deg, #dbeafe, #fef3c7);
}

.game-image-18 {
    background: linear-gradient(135deg, #dff9fc, #edf7c7);
}

.game-image-19 {
    background: linear-gradient(135deg, #dff9fc, #ffe1eb);
}

.game-image-20 {
    background: linear-gradient(135deg, #dff8ed, #dbeafe);
}

.game-image-1 {
    background:
        linear-gradient(
            135deg,
            #dbeafe,
            #ede9fe
        );
}


.game-image-2 {
    background:
        linear-gradient(
            135deg,
            #dcfce7,
            #dbeafe
        );
}

.game-image-3 {
    background:
        linear-gradient(
            135deg,
            #fef3c7,
            #fce7f3
        );
}

.game-image-4 {
    background:
        linear-gradient(
            135deg,
            #e2e8f0,
            #cffafe
        );
}

.game-image-5 {
    background:
        linear-gradient(
            135deg,
            #dbeafe,
            #f3e8ff
        );
}

.game-image-6 {
    background:
        linear-gradient(
            135deg,
            #cffafe,
            #ede9fe
        );
}

.game-image-7 {
    background:
        linear-gradient(
            135deg,
            #d1fae5,
            #cffafe
        );
}

.game-image-8 {
    background: linear-gradient(135deg, #ffedd5, #fde68a);
}

.game-image-9 {
    background: linear-gradient(135deg, #fce7f3, #fef3c7);
}

.game-image-10 {
    background: linear-gradient(135deg, #172554, #4c1d95);
}

.game-image-11 {
    background: linear-gradient(135deg, #cffafe, #bae6fd);
}

.game-image-12 {
    background: linear-gradient(135deg, #dff3ff, #ffe6d9);
}

.game-image-15 {
    background: linear-gradient(135deg, #ede9fe, #fce7f3);
}

.game-image-14 {
    background: linear-gradient(135deg, #dbeafe, #e0f2fe);
}

.game-image-13 {
    background: linear-gradient(135deg, #fef3c7, #dcfce7);
}

.game-image-12 span {
    width: 120px;
    height: 120px;
    border: 3px solid white;
    border-radius: 8px;
    background: url('/img/game/english-conversation-scenes.png') 0 0 / 400% 200%;
    box-shadow: 0 8px 20px rgba(15, 74, 105, 0.2);
}

.card-body {
    padding: 22px;
}

.card-tag {
    color: #2563eb;

    font-size: 10px;

    font-weight: 800;

    letter-spacing: 1px;
}

.card-body h3 {
    margin: 7px 0;

    font-size: 20px;
}

.card-body p {
    color: #64748b;

    font-size: 13px;

    margin-bottom: 18px;
}

.card-link {
    color: #2563eb;

    font-size: 13px;

    font-weight: 700;
}


/* ========================================
   学習カード
======================================== */

.learning-grid {
    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 15px;
}

.learning-card {
    display: grid;

    grid-template-columns:
        60px 1fr 30px;

    align-items: center;

    gap: 15px;

    padding: 20px;

    background: white;

    border:
        1px solid #e2e8f0;

    border-radius: 8px;

    transition: 0.2s;
}

.learning-card:hover {
    border-color: #93c5fd;

    transform: translateX(3px);
}

.learning-card h3 {
    margin: 0;

    font-size: 16px;
}

.learning-card p {
    margin: 3px 0 0;

    color: #64748b;

    font-size: 12px;
}

.learning-card > span {
    color: #2563eb;

    font-size: 20px;
}

.learning-icon {
    width: 54px;
    height: 54px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 3px;

    font-weight: 900;

    font-family: monospace;

    font-size: 18px;
}

.learning-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.html-icon {
    color: #ea580c;
    background: #ffedd5;
}

.js-icon {
    color: #a16207;
    background: #fef3c7;
}

.python-icon {
    color: #2563eb;
    background: #dbeafe;
}

.typescript-icon {
    color: #ffffff;
    background: #3178c6;
}

.go-icon {
    color: #087e8b;
    background: #cffafe;
}

.csharp-icon {
    color: #6d28d9;
    background: #ede9fe;
}

.cpp-icon {
    color: #075985;
    background: #e0f2fe;
}

.algorithm-icon {
    color: #7c3aed;
    background: #f3e8ff;
}


/* ========================================
   学習一覧・PHP入門
======================================== */

.study-list-section {
    min-height: 55vh;
}

.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    padding: 24px 0 18px;
    color: #64748b;
    font-size: 12px;
}

.breadcrumb-container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

.breadcrumb a:hover {
    color: #2563eb;
}

.course-hero {
    display: flex;
    align-items: center;
    gap: 28px;
    margin-bottom: 42px;
    padding: 38px 42px;
    border: 1px solid #ddd6fe;
    border-radius: 8px;
    background: linear-gradient(135deg, #f5f3ff, #eff6ff);
}

.course-hero-icon {
    width: 112px;
    height: 112px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 12px 30px rgb(79 70 229 / 12%);
}

.course-hero-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.course-hero .section-label {
    display: block;
    margin: 0 0 3px;
    color: #6d28d9;
}

.course-hero h1 {
    margin: 0;
    font-size: clamp(32px, 5vw, 48px);
    line-height: 1.3;
}

.course-hero p {
    margin: 8px 0 0;
    color: #64748b;
    font-size: 15px;
}

.course-hero-compact {
    padding-top: 30px;
    padding-bottom: 30px;
}

.course-topic-icon {
    width: 112px;
    height: 112px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: linear-gradient(135deg, #6d28d9, #2563eb);
    box-shadow: 0 12px 30px rgb(79 70 229 / 18%);
    color: #fff;
    font-family: Consolas, Monaco, monospace;
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 0.5px;
}

.course-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    align-items: start;
    gap: 36px;
    margin-bottom: 80px;
}

.course-sidebar {
    position: sticky;
    top: 92px;
}

.course-toc {
    padding: 22px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
}

.course-toc-title {
    margin: 0 0 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
    font-weight: 800;
}

.course-toc ol {
    margin: 0;
    padding-left: 24px;
    color: #94a3b8;
    font-size: 12px;
}

.course-toc li + li {
    margin-top: 5px;
}

.course-toc a {
    display: block;
    padding: 3px 0;
    color: #475569;
}

.course-toc a:hover {
    color: #6d28d9;
}

.course-content {
    min-width: 0;
}

.lesson-section {
    scroll-margin-top: 90px;
    margin: 0 0 28px;
    padding: 34px 38px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
}

.lesson-number {
    display: inline-block;
    margin-bottom: 5px;
    color: #7c3aed;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1.5px;
}

.r-course-page .lesson-number {
    color: #276dc3;
}

.r-course-page .lesson-section h2 {
    border-bottom-color: #dbeafe;
}

.r-course-page .lesson-section h3 {
    border-left-color: #276dc3;
}

.rust-course-page {
    --course-accent: #8b2e2e;
    --course-divider: #f1c7c7;
}

.rust-course-page .lesson-number {
    color: var(--course-accent);
}

.rust-course-page .lesson-section h2 {
    border-bottom-color: var(--course-divider);
}

.rust-course-page .lesson-section h3 {
    border-left-color: var(--course-accent);
}

.rust-course-page .course-hero-icon,
.rust-course-page .lesson-note,
.rust-course-page .lesson-tip,
.rust-course-page .lesson-warning {
    border-radius: 8px;
}

.visual-basic-course-page .lesson-number {
    color: #512bd4;
}

.visual-basic-course-page .lesson-section h2 {
    border-bottom-color: #e5ddff;
}

.visual-basic-course-page .lesson-section h3 {
    border-left-color: #512bd4;
}

.sql-course-page .lesson-number {
    color: #336791;
}

.sql-course-page .lesson-section h2 {
    border-bottom-color: #d9e8f2;
}

.sql-course-page .lesson-section h3 {
    border-left-color: #336791;
}

.swift-course-page {
    --course-accent: #b94718;
    --course-divider: #fed7aa;
}

.kotlin-course-page {
    --course-accent: #6d28d9;
    --course-divider: #ddd6fe;
}

.flutter-course-page {
    --course-accent: #0369a1;
    --course-divider: #bae6fd;
}

.rails-course-page {
    --course-accent: #b91c1c;
    --course-divider: #fecaca;
}

.laravel-course-page {
    --course-accent: #ef4444;
    --course-divider: #fecaca;
}

:is(.rails-course-page, .laravel-course-page) .lesson-number {
    color: var(--course-accent);
}

:is(.rails-course-page, .laravel-course-page) .lesson-section h2 {
    border-bottom-color: var(--course-divider);
}

:is(.rails-course-page, .laravel-course-page) .lesson-section h3 {
    border-left-color: var(--course-accent);
}

:is(.rails-course-page, .laravel-course-page) .course-hero-icon {
    border-radius: 8px;
}

:is(.rails-course-page, .laravel-course-page)
:is(.lesson-note, .lesson-tip, .lesson-warning) {
    border-radius: 8px;
}

:is(.swift-course-page, .kotlin-course-page, .flutter-course-page) .lesson-number {
    color: var(--course-accent);
}

:is(.swift-course-page, .kotlin-course-page, .flutter-course-page) .lesson-section h2 {
    border-bottom-color: var(--course-divider);
}

:is(.swift-course-page, .kotlin-course-page, .flutter-course-page) .lesson-section h3 {
    border-left-color: var(--course-accent);
}

:is(.swift-course-page, .kotlin-course-page, .flutter-course-page)
:is(.course-hero-icon, .lesson-note, .lesson-tip, .lesson-warning) {
    border-radius: 8px;
}

.lesson-section h2 {
    margin: 0 0 22px;
    padding-bottom: 13px;
    border-bottom: 2px solid #ede9fe;
    font-size: 27px;
    line-height: 1.45;
}

.lesson-section h3 {
    margin: 30px 0 10px;
    padding-left: 12px;
    border-left: 4px solid #8b5cf6;
    font-size: 19px;
}

.lesson-section p {
    margin: 14px 0;
    color: #475569;
    font-size: 15px;
}

.lesson-section p code,
.lesson-section li code,
.lesson-section td code {
    padding: 2px 6px;
    border-radius: 3px;
    background: #f1f5f9;
    color: #be123c;
    font-family: Consolas, Monaco, monospace;
    font-size: 0.9em;
}

.code-block {
    margin: 18px 0 22px;
    overflow: hidden;
    border-radius: 8px;
    background: #172033;
    box-shadow: 0 6px 16px rgb(15 23 42 / 10%);
}

.code-header {
    display: flex;
    justify-content: space-between;
    padding: 9px 15px;
    border-bottom: 1px solid #334155;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.code-block pre {
    margin: 0;
    padding: 19px;
    overflow-x: auto;
    color: #e2e8f0;
    font: 13px/1.75 Consolas, Monaco, "Courier New", monospace;
    tab-size: 4;
}

.code-block code {
    font: inherit;
}

.lesson-note,
.lesson-tip,
.lesson-warning {
    margin: 20px 0;
    padding: 17px 19px;
    border-left: 4px solid #3b82f6;
    border-radius: 3px;
    background: #eff6ff;
    color: #334155;
    font-size: 14px;
}

.lesson-note ul {
    margin: 8px 0 0;
    padding-left: 21px;
}

.lesson-tip {
    border-color: #10b981;
    background: #ecfdf5;
}

.lesson-warning {
    border-color: #f59e0b;
    background: #fffbeb;
}

.process-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 22px;
    padding: 18px;
    border-radius: 6px;
    background: #f8fafc;
    font-size: 12px;
    font-weight: 700;
}

.process-flow span {
    padding: 9px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    background: #fff;
    text-align: center;
}

.process-flow b {
    color: #8b5cf6;
}

.course-table-wrap {
    margin: 18px 0 24px;
    overflow-x: auto;
}

.course-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.course-table th,
.course-table td {
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    text-align: left;
}

.course-table th {
    background: #f8fafc;
    font-weight: 800;
}

.practice-list details {
    margin-top: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.practice-list summary {
    padding: 16px 18px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
}

.practice-list summary span {
    margin-right: 12px;
    color: #7c3aed;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.practice-list details > p,
.practice-list details > .code-block {
    margin-right: 18px;
    margin-left: 18px;
}

.practice-list details > .code-block {
    margin-bottom: 18px;
}

.lesson-finish {
    border-color: #c4b5fd;
    background: linear-gradient(135deg, #fff, #f5f3ff);
}

.next-step-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 22px 0 28px;
}

.next-step-grid a {
    position: relative;
    display: block;
    padding: 16px;
    border: 1px solid #ddd6fe;
    border-radius: 8px;
    background: #fff;
    transition: 0.2s;
}

.next-step-grid a::after {
    position: absolute;
    top: 50%;
    right: 15px;
    content: "→";
    color: #7c3aed;
    transform: translateY(-50%);
}

.next-step-grid a:hover {
    border-color: #8b5cf6;
    transform: translateY(-2px);
}

.next-step-grid strong,
.next-step-grid span {
    display: block;
    padding-right: 20px;
}

.next-step-grid strong {
    font-size: 14px;
}

.next-step-grid span {
    margin-top: 2px;
    color: #64748b;
    font-size: 11px;
}

.course-back-link {
    display: inline-block;
    color: #6d28d9;
    font-size: 13px;
    font-weight: 800;
}

.course-page-nav {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid #ddd6fe;
}

.course-page-nav a {
    color: #6d28d9;
    font-size: 13px;
    font-weight: 800;
}


/* ========================================
   ブログ
======================================== */

.article-grid {
    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 24px;
}

.article-card {
    background: white;

    border:
        1px solid #e2e8f0;

    border-radius: 8px;

    overflow: hidden;

    transition: 0.25s;
}

.article-card:hover {
    transform: translateY(-4px);

    box-shadow:
        0 12px 30px
        rgba(15, 23, 42, 0.07);
}

.article-image {
    height: 150px;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 55px;

    background: #eef2ff;
}

.article-content {
    padding: 20px;
}

.article-category {
    color: #2563eb;

    font-size: 9px;

    font-weight: 800;

    letter-spacing: 1px;
}

.article-content h3 {
    margin: 8px 0;

    font-size: 17px;

    line-height: 1.6;
}

.article-content p {
    color: #64748b;

    font-size: 12px;
}

.article-meta {
    margin-top: 15px;

    color: #94a3b8;

    font-size: 11px;
}
/* ========================================
   情報
======================================== */
.high-school-map-main-section {
    margin-bottom: 80px;
}


/* ========================================
   ブログ
======================================== */
.blog-list-section {
    min-height: 55vh;
}

.blog-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.blog-card {
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    transition: transform 0.2s, box-shadow 0.2s;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgb(15 23 42 / 9%);
}

.blog-card-image {
    height: 230px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, #eff6ff, #f5f3ff);
}

.blog-card-image img {
    width: auto;
    height: 100%;
    object-fit: contain;
    box-shadow: 0 9px 24px rgb(15 23 42 / 18%);
    border-radius: 8px;
}

.blog-card-body {
    padding: 22px;
}

.blog-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: #94a3b8;
    font-size: 11px;
}

.blog-category {
    color: #2563eb;
    font-weight: 800;
    letter-spacing: 1px;
}

.blog-category-intro {
    margin: 0 0 24px;
    color: #475569;
}

.blog-category-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 22px 0 30px;
    padding: 12px 0;
}

.blog-category-nav a {
    display: block;
    padding: 12px 16px;
    border: 1px solid #d8e3e8;
    border-radius: 8px;
    background: #f7fbfc;
    color: #1269a0;
    font-weight: 700;
    text-decoration: none;
}

.blog-category-nav a:hover,
.blog-category-nav a.is-active {
    border-color: #1269a0;
    background: #e8f4fa;
}

.blog-card[hidden] {
    display: none;
}

.game-card.is-clickable {
    cursor: pointer;
}

.game-card.is-clickable:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 3px;
}

.high-school-related {
    width: min(1200px, 94%);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 28px auto 10px;
    padding: 18px;
    box-sizing: border-box;
    border: 1px solid #d8e3e8;
    border-radius: 8px;
    background: #f7fbfc;
}

.high-school-related a {
    color: #1269a0;
    font-weight: 700;
}

.high-school-source-note {
    width: min(1200px, 94%);
    margin: 0 auto 28px;
    color: #607d8b;
    font-size: .86rem;
}

.blog-card h3 {
    margin: 9px 0;
    font-size: 19px;
    line-height: 1.55;
}

.blog-card p {
    margin: 0 0 16px;
    color: #64748b;
    font-size: 13px;
}

.blog-article {
    max-width: 840px;
    margin: 0 auto 80px;
}

.blog-article-header {
    padding: 30px 0 34px;
    border-bottom: 1px solid #e2e8f0;
}

.blog-article-header h1 {
    margin: 12px 0 14px;
    font-size: clamp(29px, 5vw, 44px);
    line-height: 1.4;
    letter-spacing: -0.5px;
}

.blog-lead {
    margin: 0;
    color: #64748b;
    font-size: 16px;
}

.book-intro {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 34px;
    align-items: center;
    margin: 38px 0;
    padding: 30px;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    background: linear-gradient(135deg, #f8fafc, #eff6ff);
}

.book-intro img {
    width: 100%;
    max-height: 290px;
    object-fit: contain;
    filter: drop-shadow(0 10px 14px rgb(15 23 42 / 18%));
}

.book-details {
    margin: 0;
}

.book-details div {
    display: grid;
    grid-template-columns: 75px 1fr;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid #dbeafe;
    font-size: 13px;
}

.book-details dt {
    color: #64748b;
}

.book-details dd {
    margin: 0;
    font-weight: 700;
}

.blog-content {
    color: #334155;
    font-size: 15px;
    line-height: 2;
}

.blog-content h2 {
    margin: 45px 0 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid #dbeafe;
    color: #1e293b;
    font-size: 27px;
    line-height: 1.5;
}

.blog-content h3 {
    margin: 28px 0 8px;
    color: #1e293b;
    font-size: 19px;
}

.blog-content ul {
    padding-left: 1.4em;
}

.blog-content ol {
    padding-left: 1.5em;
}

.comparison-guide {
    margin: 0 0 14px;
    color: #475569;
    font-size: .92rem;
}

.comparison-table-wrap {
    margin: 24px 0 32px;
    overflow-x: auto;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
}

.comparison-table {
    width: 100%;
    min-width: 650px;
    border-collapse: collapse;
    font-size: .92rem;
    line-height: 1.75;
}

.comparison-table caption {
    padding: 14px 16px;
    background: #f8fafc;
    color: #1e293b;
    font-size: 1rem;
    font-weight: 700;
    text-align: left;
}

.comparison-table th,
.comparison-table td {
    padding: 14px 15px;
    border-top: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    vertical-align: top;
    text-align: left;
}

.comparison-table tr > :last-child {
    border-right: 0;
}

.comparison-table thead th {
    border-top: 0;
    background: #f1f5f9;
    color: #1e293b;
    font-weight: 700;
}

.comparison-table tbody > tr > th {
    width: 18%;
    background: #f8fafc;
    color: #334155;
    font-weight: 700;
}

.comparison-table .public-column {
    background: #eff6ff;
    color: #1d4ed8;
}

.comparison-table .private-column {
    background: #fdf2f8;
    color: #be185d;
}

.comparison-table tbody td:nth-child(2) {
    background: #f8fbff;
}

.comparison-table tbody td:nth-child(3) {
    background: #fffafd;
}

.comparison-table-compact {
    min-width: 590px;
}

.blog-content li + li {
    margin-top: 8px;
}

.hs70-school-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.hs70-school {
    padding: 18px;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    background: #f8fafc;
}

.hs70-school-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.hs70-school-heading h3 {
    flex: 1;
    margin: 0;
    font-size: 1.15rem;
}

.hs70-rank {
    display: inline-grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    font-size: .85rem;
    font-weight: 700;
}

.hs70-school-heading strong {
    color: #1d4ed8;
    white-space: nowrap;
}

.hs70-intro {
    margin: 0 0 14px;
    color: #475569;
    font-size: .95rem;
}

.hs70-details {
    display: grid;
    gap: 8px;
    margin: 0;
}

.hs70-details > div {
    display: grid;
    grid-template-columns: 7em 1fr;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid #e2e8f0;
}

.hs70-details dt {
    color: #64748b;
    font-weight: 700;
}

.hs70-details dd {
    margin: 0;
}

.hs70-official {
    margin: 16px 0 0;
    font-weight: 700;
}

.hs70-affiliate {
    margin: 50px auto 80px;
}

@media (max-width: 700px) {
    .hs70-school-grid {
        grid-template-columns: 1fr;
    }

    .hs70-school-heading {
        align-items: flex-start;
    }

    .hs70-school-heading strong {
        font-size: .9rem;
    }
}

.blog-content a,
.affiliate-article-note a {
    color: #2563eb;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.blog-note {
    margin: 28px 0;
    padding: 18px 20px;
    border-left: 4px solid #2563eb;
    background: #eff6ff;
    color: #334155;
    font-size: 13px;
}

.book-cta {
    margin-top: 42px;
    padding: 28px;
    border-radius: 8px;
    background: #0f172a;
    color: #e2e8f0;
    text-align: center;
}

.book-cta h2 {
    margin: 0 0 8px;
    padding: 0;
    border: 0;
    color: #fff;
    font-size: 23px;
}

.book-cta p {
    margin: 0;
}

.book-cta .amazon-button {
    display: inline-block;
    margin-top: 18px;
    padding: 11px 20px;
    border-radius: 4px;
    background: #f59e0b;
    color: #fff;
}

.affiliate-article-note {
    color: #94a3b8;
    font-size: 11px;
}


/* ========================================
   商品
======================================== */

.product-grid {
    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 20px;
}

.product-card {
    display: grid;

    grid-template-columns: 90px 1fr;

    gap: 20px;

    padding: 25px;

    background: white;

    border:
        1px solid #e2e8f0;

    border-radius: 8px;
}

.product-icon {
    width: 90px;
    height: 90px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 3px;

    background: #f1f5f9;

    font-size: 42px;
}

.product-card span {
    color: #64748b;

    font-size: 9px;

    font-weight: 800;

    letter-spacing: 1px;
}

.product-card h3 {
    margin: 4px 0;

    font-size: 17px;
}

.product-card p {
    margin: 4px 0 12px;

    color: #64748b;

    font-size: 12px;
}

.amazon-button {
    color: #b45309;

    font-size: 12px;

    font-weight: 800;
}

.affiliate-note {
    margin-top: 15px;

    text-align: center;

    color: #94a3b8;

    font-size: 10px;
}


/* ========================================
   プロフィール
======================================== */

.about-section {
    padding: 70px 40px;

    background:
        linear-gradient(
            135deg,
            #eff6ff,
            #f5f3ff
        );

    border-radius: 8px;

    margin-bottom: 80px;
}

.about-content {
    max-width: 650px;
}

.about-content h2 {
    font-size: 30px;

    margin: 8px 0;
}

.about-content p {
    color: #64748b;

    font-size: 14px;
}


/* ========================================
   フッター
======================================== */

.site-footer {
    background: #0f172a;

    color: #cbd5e1;

    padding: 50px 24px 20px;
}

.footer-inner {
    max-width: 1180px;

    margin: 0 auto;

    display: flex;

    justify-content: space-between;

    gap: 40px;
}

.footer-logo {
    color: white;

    font-weight: 800;

    font-size: 18px;
}

.footer-inner p {
    color: #64748b;

    font-size: 11px;
}

.footer-links {
    display: flex;

    flex-wrap: wrap;

    justify-content: flex-end;

    gap: 15px;
}

.footer-links a {
    font-size: 12px;

    color: #94a3b8;
}

.footer-links a:hover {
    color: white;
}

.copyright {
    max-width: 1180px;

    margin: 35px auto 0;

    padding-top: 20px;

    border-top:
        1px solid #1e293b;

    color: #64748b;

    font-size: 10px;

    text-align: center;
}


/* ========================================
   プライバシーポリシー
======================================== */

.privacy-page {
    max-width: 860px;
    padding-top: 64px;
    padding-bottom: 80px;
}

.privacy-header {
    margin-bottom: 40px;
}

.privacy-header h1 {
    margin: 8px 0 12px;
    font-size: clamp(30px, 5vw, 44px);
}

.privacy-header p,
.privacy-content p,
.privacy-content li {
    color: #475569;
    line-height: 1.9;
}

.privacy-content section + section {
    margin-top: 40px;
}

.privacy-content h2 {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 22px;
}

.privacy-content ul {
    padding-left: 1.5em;
}

.privacy-content a {
    color: #2563eb;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.privacy-updated {
    margin-top: 48px;
    text-align: right;
    font-size: 13px;
}


/* ========================================
   スマートフォン
======================================== */

@media (max-width: 800px) {

    .menu-button {
        display: block;
    }

    .navigation {
        display: none;

        position: absolute;

        top: 67px;

        left: 0;
        right: 0;

        padding: 12px 20px;

        background: white;

        border-bottom:
            1px solid #e2e8f0;

        grid-template-columns: repeat(4, 50px);

        justify-content: center;

        gap: 12px 16px;
    }

    .navigation.active {
        display: grid;
    }

    .navigation a {
        display: flex;

        width: 50px;
        height: 50px;

        align-items: center;
        justify-content: center;

        padding: 0;
    }

    .navigation a img {
        display: block;
    }

    .card-grid,
    .article-grid,
    .blog-card-grid {
        grid-template-columns: 1fr;
    }

    .book-intro {
        grid-template-columns: 1fr;
    }

    .book-intro img {
        width: 180px;
        margin: auto;
    }


    .learning-grid {
        grid-template-columns: 1fr;
    }

    .course-layout {
        grid-template-columns: 1fr;
    }

    .course-sidebar {
        position: static;
    }

    .course-toc ol {
        columns: 2;
    }


    .product-grid {
        grid-template-columns: 1fr;
    }

    .affiliate-card-link {
        align-items: flex-start;
    }

    .affiliate-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }


    .section-heading {
        align-items: flex-start;

        flex-direction: column;
    }


    .news-item {
        grid-template-columns:
            90px
            60px
            1fr
            20px;

        gap: 8px;

        padding: 14px;
    }

    .news-title {
        font-size: 12px;
    }


    .about-section {
        padding: 50px 25px;
    }


    .footer-inner {
        flex-direction: column;
    }

    .footer-links {
        justify-content: flex-start;
    }

}


/* ========================================
   小さいスマホ
======================================== */

@media (max-width: 500px) {

    .container {
        padding: 0 16px;
    }

    .course-hero {
        align-items: flex-start;
        gap: 16px;
        margin-bottom: 24px;
        padding: 24px 20px;
    }

    .course-hero-icon {
        width: 68px;
        height: 68px;
        padding: 8px;
        border-radius: 10px;
    }

    .course-topic-icon {
        width: 68px;
        height: 68px;
        border-radius: 10px;
        font-size: 9px;
    }

    .course-hero p {
        font-size: 12px;
    }

    .course-layout {
        gap: 22px;
    }

    .course-toc ol {
        columns: 1;
    }

    .lesson-section {
        padding: 25px 20px;
    }

    .lesson-section h2 {
        font-size: 23px;
    }

    .process-flow {
        align-items: stretch;
        flex-direction: column;
    }

    .process-flow b {
        align-self: center;
        transform: rotate(90deg);
    }

    .next-step-grid {
        grid-template-columns: 1fr;
    }

    .header-inner {
        padding: 12px 16px;
    }

    .hero h1 {
        font-size: 37px;
    }

    .hero p {
        font-size: 14px;
    }

    .affiliate-card {
        padding: 14px;
    }

    .affiliate-grid {
        grid-template-columns: 1fr;

        gap: 16px;
    }

    .affiliate-grid.affiliate-grid--inline {
        grid-template-columns: 1fr;
    }

    .affiliate-card-link {
        gap: 14px;
    }

    .affiliate-image {
        width: 76px;

        height: auto;

        max-height: 108px;
    }

    .affiliate-card-content h2 {
        font-size: 14px;
    }

    .news-item {
        grid-template-columns:
            1fr 60px 20px;

        row-gap: 4px;
    }

    .news-item time {
        grid-column: 1;
    }

    .news-category {
        grid-column: 2;
        grid-row: 1;
    }

    .news-title {
        grid-column: 1 / 3;
        grid-row: 2;
    }

    .news-arrow {
        grid-column: 3;
        grid-row: 1 / 3;
    }

    .product-card {
        grid-template-columns: 1fr;
    }

    .product-icon {
        width: 70px;
        height: 70px;
    }

}
