:root {
    --bg-dark: #f1f5f9; /* 眩しくないソフトグレー */
    --text-light: #334155; /* コントラストが強すぎないスレートダーク */
    --text-muted: rgba(51, 65, 85, 0.6);

    --c-blue: #2563eb;
    --c-orange: #ea580c;
    --c-green: #16a34a;
    --c-pink: #db2777;

    /* Cursor */
    --cursor-size: 8px;
    --follower-size: 40px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Hide default cursor globally, except for touch devices (handled via media query if needed) */
    cursor: none !important;
}

body {
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    height: 100vh;
    overflow: hidden;
    /* Hide scroll, it's a single screen experience */
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* Custom Cursor */
.cursor,
.cursor-follower {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.cursor {
    width: var(--cursor-size);
    height: var(--cursor-size);
    mix-blend-mode: multiply;
    background: #1e293b;
    transition: width 0.3s, height 0.3s;
}

.cursor-follower {
    width: var(--follower-size);
    height: var(--follower-size);
    background: transparent;
    border: 1px solid rgba(30, 41, 59, 0.3);
    transition: transform 0.1s linear, width 0.3s, height 0.3s, background 0.3s, border 0.3s;
}

/* Hover States for cursor */
.cursor-follower.active {
    width: 80px;
    height: 80px;
    background: rgba(30, 41, 59, 0.05);
    backdrop-filter: blur(5px);
    border-color: transparent;
}


/* Loading Screen */
.loader {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    transform-origin: top;
}

.loader-text {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 0.5em;
    color: #475569;
    position: relative;
    clip-path: inset(0 0 100% 0);
    animation: revealText 1s cubic-bezier(0.77, 0, 0.175, 1) 0.5s forwards;
}

@keyframes revealText {
    100% {
        clip-path: inset(0 0 0% 0);
    }
}

/* Ambient Edge Lighting (爽やかで明るい自然光のグラデーション) */
.ambient-light {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;

    /* 極めてほのかな温かみのある光（白浮きを防ぐ） */
    background:
        radial-gradient(circle at 0% 100%, rgba(37, 99, 235, 0.05) 0%, transparent 65%),
        radial-gradient(circle at 100% 0%, rgba(234, 179, 8, 0.04) 0%, transparent 65%);
    background-repeat: no-repeat;

    /* まじで微細に動かす（ミリ単位の揺らぎ） */
    animation: tinyFlow 12s ease-in-out infinite alternate;
}

@keyframes tinyFlow {
    0% {
        opacity: 0.7;
        transform: translate(0px, 0px) scale(1);
    }

    100% {
        opacity: 1;
        transform: translate(-3px, -5px) scale(1.03);
        /* ミリ単位の揺らぎに限定 */
    }
}

/* Background Image Layers */
.bg-layer {
    position: absolute;
    inset: -5%;
    /* Slightly larger to allow scale/parallax */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    visibility: hidden;
    z-index: 0;
    transform: scale(1.1);
    transition: opacity 1s cubic-bezier(0.25, 1, 0.5, 1), transform 1.5s cubic-bezier(0.25, 1, 0.5, 1), visibility 1s;
    /* Soften the image for light theme */
    filter: saturate(1.1) brightness(1.05) contrast(0.95);
}

.bg-layer.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    z-index: 1;
}

/* Brand Color Overlays combined with image */
.bg-gradient {
    position: absolute;
    inset: 0;
    mix-blend-mode: normal;
    opacity: 0.75;
}

/* Off-white base fading into soft brand colors */
.overlay-blue {
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.95) 0%, rgba(219, 234, 254, 0.75) 100%);
}

.overlay-orange {
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.95) 0%, rgba(254, 215, 170, 0.75) 100%);
}

.overlay-green {
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.95) 0%, rgba(187, 247, 208, 0.75) 100%);
}

.overlay-pink {
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.95) 0%, rgba(252, 211, 225, 0.75) 100%);
}

.overlay-emerald {
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.95) 0%, rgba(167, 243, 208, 0.75) 100%);
}

.overlay-yellow {
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.95) 0%, rgba(254, 240, 138, 0.75) 100%);
}

/* Auto-scroll Introduction on Hover */
.intro-container {
    position: absolute;
    top: 20%;
    bottom: 20%;
    right: 5%;
    width: 55%;
    /* タイトルを横に避ける工夫と合わせて、被らない最大幅を確保 */
    max-width: 900px;
    background: rgba(255, 255, 255, 0.5);
    /* 濁りすぎないフロストガラス */
    backdrop-filter: blur(12px);
    /* ぼかしを強めにして高級感を出す */
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03); /* 極めて薄い影 */
    overflow: hidden;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    mask-image: linear-gradient(to bottom, transparent, black 15%, black 85%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 15%, black 85%, transparent);

    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s ease 0.3s, transform 1s ease 0.3s;
}

.bg-layer.active .intro-container {
    opacity: 1;
    transform: translateY(0);
}

/* bg-1(Item 1) & bg-4(Item 2) の時は右配置 */
#bg-1 .intro-container,
#bg-4 .intro-container,
#bg-5 .intro-container {
    right: 8%;
    left: auto;
}

/* bg-3(Item 4) & bg-2(Item 3) の時は左側の文字群と被らないよう左に配置 */
#bg-3 .intro-container,
#bg-2 .intro-container,
#bg-6 .intro-container {
    right: auto;
    left: 8%;
}

.intro-scroll-content {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 500;
    /* 少し太めに */
    font-size: 1.05rem;
    line-height: 2.2;
    color: #475569; /* ウォーム系のスレートダーク */
    text-align: justify;
    letter-spacing: 0.1em;
    animation: autoScroll 25s linear infinite;
    animation-play-state: paused;
}

.bg-layer.active .intro-scroll-content {
    animation-play-state: running;
}

@keyframes autoScroll {
    0% {
        transform: translateY(100%);
    }

    100% {
        transform: translateY(-100%);
    }
}


/* UI Wrapper */
.ui-wrapper {
    position: relative;
    z-index: 10;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 2.5rem 4rem;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    padding: 1rem;
    font-family: 'Noto Sans JP', sans-serif;
    /* Hitbox */
}

/* 3ボタングループを画面右下へ固定 */
.portal-btns {
    position: fixed;
    bottom: 2.5rem;
    right: 4rem;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* 後援会ボタンを画面右下へ固定し、より洗練された配置に */
.supporter-btn {
    position: static;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.8rem 1.2rem;
    border: 1px solid rgba(51, 65, 85, 0.15);
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(5px);
    transition: background 0.3s, color 0.3s, border-color 0.3s;
    text-decoration: none;
    color: var(--text-light);
}

/* Subtle magnetic hover effect handled by JS, but CSS fallback */
.supporter-btn:hover {
    background: #334155;
    color: #fff;
    border-color: #334155;
}

/* Huge Watermark */
.watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 30vw;
    /* 'S.K.K.'に合わせてさらに巨大化 */
    font-weight: 900;
    color: rgba(30, 41, 59, 0.03);
    /* クリアな薄い影として表示 */
    font-family: 'Inter', sans-serif;
    letter-spacing: -0.05em;
    pointer-events: none;
    z-index: -1;
    white-space: nowrap;
    transition: opacity 0.4s ease;
}

/* Main Menu List */
.menu-container {
    flex-grow: 1;
    display: flex;
    align-items: center;
    /* Center horizontally */
    justify-content: center;
    width: 100%;
}

.school-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2vw;
    /* Horizontal layout for massive text */
    width: 100%;
    justify-content: space-between;
}

.school-list li:nth-child(5) {
    grid-column: 2;
}

.school-list li:nth-child(6) {
    grid-column: 3;
}

.school-item {
    position: relative;
    padding: 0;
    transition: opacity 0.4s ease, filter 0.4s ease, transform 0.4s ease;
}

/* ホバーされていない他の学校項目を暗くぼかしてメインの文字を読みやすくする */
.school-list:has(.school-item:hover) .school-item:not(:hover) {
    opacity: 0.3;
    filter: blur(4px);
    transform: scale(0.98);
}

.school-link {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 36vh;
    padding: 1.5rem 0;
    /* Stretch to fill space */
    text-decoration: none;
    color: var(--text-light);
    position: relative;
}

.school-index {
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    color: var(--text-muted);
    transition: color 0.4s ease, transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.school-en {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    transition: color 0.4s ease, transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), letter-spacing 0.4s ease;
    text-align: right;
}

/* Extravagant Typography Effect */
.text-wrapper {
    position: relative;
    margin: auto 0;
    padding-left: 1rem;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* --- 画面外へのはみ出し・文字被り防止のための全体移動距離（CSS変数） --- */
.school-list li:nth-child(1) { --hover-x: 2vw; }
.school-list li:nth-child(2) { --hover-x: -24vw; }
.school-list li:nth-child(3), .school-list li:nth-child(6) { --hover-x: 12vw; }
.school-list li:nth-child(4) { --hover-x: -14vw; }
.school-list li:nth-child(5) { --hover-x: -15vw; }

.school-list li:hover .text-wrapper {
    transform: translateX(var(--hover-x, 0));
}

.sub-catch {
    font-size: 0.85vw;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.15em;
    margin-bottom: 0.8rem;
    font-family: 'Noto Sans JP', sans-serif;
    transition: color 0.4s ease, transform 0.4s cubic-bezier(0.25, 1.2, 0.35, 1), letter-spacing 0.4s ease;
    transform-origin: left bottom;
}

.school-item:hover .sub-catch {
    color: var(--text-light);
    transform: scale(1.15) translateY(-12px);
    letter-spacing: 0.25em;
}

.title-container {
    position: relative;
    display: inline-block;
}

.school-title {
    font-family: 'Noto Sans JP', sans-serif;
    /* Solid Noto Sans font */
    font-size: 1.45vw;
    /* 文字を少しだけ大きく */
    line-height: 1.15;
    /* 行間を限界まで詰めて一体感を出す */
    font-weight: 900;
    /* Extra bold */
    letter-spacing: -0.05em;
    /* 文字間隔をさらに詰めてよりソリッドな塊にする */
    text-transform: uppercase;
    white-space: nowrap;

    /* 最先端のホログラフィック/メタルエフェクト (オンマウス前) - 視認性UP */
    color: transparent;
    background: linear-gradient(135deg,
            rgba(51, 65, 85, 0.95) 0%,
            rgba(51, 65, 85, 0.6) 45%,
            rgba(51, 65, 85, 1) 50%,
            rgba(51, 65, 85, 0.6) 55%,
            rgba(51, 65, 85, 0.9) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;

    /* 縁取りが重なるのを防ぐため、線はなしにして純粋な発光のみで際立たせる */
    -webkit-text-stroke: 0px transparent;

    /* Snappy, spring-like transition */
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        background-position 2s linear,
        filter 0.3s ease;
    transform-origin: left top;
}

/* 各学校のテーマカラーに合わせた柔らかい影/光沢（オンマウス前） */
.school-list li[data-bg="bg-1"] .school-title {
    filter: drop-shadow(0 0 10px rgba(37, 99, 235, 0.15));
}

.school-list li[data-bg="bg-2"] .school-title {
    filter: drop-shadow(0 0 10px rgba(234, 88, 12, 0.15));
}

.school-list li[data-bg="bg-3"] .school-title {
    filter: drop-shadow(0 0 10px rgba(22, 163, 74, 0.15));
}

.school-list li[data-bg="bg-4"] .school-title {
    filter: drop-shadow(0 0 10px rgba(219, 39, 119, 0.15));
}

.school-list li[data-bg="bg-5"] .school-title {
    filter: drop-shadow(0 0 10px rgba(16, 185, 129, 0.15));
}

.school-list li[data-bg="bg-6"] .school-title {
    filter: drop-shadow(0 0 10px rgba(234, 179, 8, 0.15));
}

/* ホログラムがゆらめくアニメーション（オンマウス前も常に動く） */
.school-list li .school-title {
    animation: holoFlow 8s linear infinite;
}

@keyframes holoFlow {
    to {
        background-position: 200% center;
    }
}

/* The Clone sits exactly on top for the fill reveal */
.school-title.clone {
    position: absolute;
    top: 0;
    left: 0;
    color: #1e293b;
    /* Solid Dark Fill */
    -webkit-text-stroke: 0px transparent;

    /* Initialize with a slanted zero-width slice (cyber UI styled clip) */
    clip-path: polygon(0 0, 0 0, -10% 100%, -10% 100%);

    /* Snappy reveal */
    transition: clip-path 0.5s cubic-bezier(0.86, 0, 0.07, 1);
}

/* Hover Dynamics */
/* When any item is hovered, dim others via JS class, but handle basic hover here */

.school-item:hover .school-index {
    color: var(--text-light);
    transform: translateX(var(--hover-x, 0)) scale(1.2) translateY(-12px);
}

.school-item:hover .school-en {
    color: var(--text-light);
    transform: translateX(var(--hover-x, 0)) translateY(10px);
    letter-spacing: 0.2em;
    /* 英語の幅も広がる */
}

.school-item:hover .school-title {
    /* ホバー時は発光を強くし、アニメーション停止 */
    animation-play-state: paused;
}

/* Base Hover Glow logic per item (優しいパステル発光) */
.school-list li[data-bg="bg-1"]:hover .school-title {
    filter: drop-shadow(0 0 15px rgba(37, 99, 235, 0.3));
    transform: scale(2.2);
}

.school-list li[data-bg="bg-2"]:hover .school-title {
    filter: drop-shadow(0 0 15px rgba(234, 88, 12, 0.3));
    transform: scale(2.2);
}

.school-list li[data-bg="bg-3"]:hover .school-title {
    filter: drop-shadow(0 0 15px rgba(22, 163, 74, 0.3));
    transform: scale(2.2);
}

.school-list li[data-bg="bg-4"]:hover .school-title {
    filter: drop-shadow(0 0 15px rgba(219, 39, 119, 0.3));
    transform: scale(2.2);
}

.school-list li[data-bg="bg-5"]:hover .school-title {
    filter: drop-shadow(0 0 15px rgba(16, 185, 129, 0.3));
    transform: scale(2.2);
}

.school-list li[data-bg="bg-6"]:hover .school-title {
    filter: drop-shadow(0 0 15px rgba(234, 179, 8, 0.3));
    transform: scale(2.2);
}

/* Game UI style diagonal wipe reveal */
.school-item:hover .school-title.clone {
    clip-path: polygon(0 -20%, 120% -20%, 100% 120%, -20% 120%);
}

/* ============================================
   Responsive adjustments (Mobile / Touch Devices)
   ============================================ */
@media (hover: none) and (pointer: coarse),
(max-width: 1024px) {

    /* カスタムカーソルを非表示にして通常カーソルへ */
    * { cursor: auto !important; }
    .cursor, .cursor-follower { display: none !important; }

    /* 背景レイヤーは非表示のまま（カードUIが代替） */
    .bg-layer { display: none; }

    body {
        overflow-y: auto;
        height: auto;
        /* 四隅からブランドカラーが滲むペールグラデーション */
        background:
            radial-gradient(ellipse at 0% 0%, rgba(37, 99, 235, 0.05) 0%, transparent 60%),
            radial-gradient(ellipse at 100% 0%, rgba(234, 88, 12, 0.04) 0%, transparent 55%),
            radial-gradient(ellipse at 0% 100%, rgba(22, 163, 74, 0.04) 0%, transparent 55%),
            radial-gradient(ellipse at 100% 100%, rgba(219, 39, 119, 0.04) 0%, transparent 55%),
            #f1f5f9;
        background-attachment: fixed;
    }

    /* ヘッダー：上部固定・コンパクトに */
    .ui-wrapper {
        height: auto;
        min-height: 100vh;
        padding: 1.5rem 1.2rem 2rem;
        display: flex;
        flex-direction: column;
    }

    .header {
        margin-bottom: 0.5rem;
        mix-blend-mode: normal;
    }

    .logo {
        font-size: 1.1rem;
        padding: 0.3rem 0;
        letter-spacing: 0.2em;
        color: var(--text-light);
    }

    /* ポータルボタングループ */
    .portal-btns {
        position: static;
        gap: 0.4rem;
        flex-wrap: wrap;
    }

    /* 後援会ボタン：コンパクトに */
    .supporter-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.65rem;
        background: rgba(255, 255, 255, 0.6);
        border: 1px solid rgba(51, 65, 85, 0.15);
        border-radius: 50px;
        color: var(--text-light);
    }

    .watermark { display: none; }
    .ambient-light { display: none; }

    /* ==============================
       学校リスト：縦並びカードUI
       ============================== */
    .menu-container {
        align-items: flex-start;
        justify-content: flex-start;
        margin-top: 1.5rem;
    }

    .school-list {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        width: 100%;
        justify-content: flex-start;
    }

    /* 各カード */
    .school-item {
        flex: none;
        padding: 0;
        opacity: 1 !important;
        filter: none !important;
        transform: none !important;
        pointer-events: auto !important;
        border-radius: 16px;
        overflow: hidden;
        /* カードの基本シャドウ */
        box-shadow: 0 4px 24px rgba(0,0,0,0.5);
        transition: box-shadow 0.3s ease, transform 0.3s ease;
    }

    /* タップ時の微細なリフトアップ */
    .school-item:active {
        transform: scale(0.985) !important;
    }

    /* アクティブカードを強調 */
    .school-item.mobile-active {
        box-shadow: 0 8px 40px rgba(255,255,255,0.1);
    }

    /* カード内リンク */
    .school-link {
        height: auto;
        flex-direction: column;
        align-items: flex-start;
        text-decoration: none;
        color: #1e293b;
        padding: 1.5rem 1.4rem 1.4rem;
        position: relative;
        border: 1px solid rgba(255, 255, 255, 0.7);
        border-radius: 16px;
        overflow: hidden;
        gap: 0;
        /* z-contextを作るためisolate */
        isolation: isolate;
    }

    /* ── 背景写真レイヤー（::before） ── */
    .school-link[data-bg-set]::before {
        content: '';
        position: absolute;
        inset: 0;
        background-image: var(--card-bg-img);
        background-size: cover;
        background-position: center;
        z-index: -2;
        transform: scale(1.05);
        transition: transform 1.2s cubic-bezier(0.25, 1, 0.5, 1);
        filter: saturate(1.1);
    }

    /* アクティブ時：写真がゆっくりズームイン（Ken Burnsエフェクト） */
    .school-item.mobile-active .school-link[data-bg-set]::before {
        transform: scale(1.15);
        animation: kenBurns 8s ease-in-out infinite alternate;
    }

    @keyframes kenBurns {
        0%   { transform: scale(1.05) translate(0%, 0%); }
        50%  { transform: scale(1.18) translate(-1%, -1%); }
        100% { transform: scale(1.12) translate(1%, 0.5%); }
    }

    /* ── カラーオーバーレイ（::after）：写真の上に重ねてテキスト可読性を確保 ── */
    .school-link::after {
        content: '';
        position: absolute;
        inset: 0;
        z-index: -1;
        border-radius: 16px;
        transition: background 0.6s ease;
    }

    /* 各カードのオーバーレイカラー（写真の上にうっすら濁り白を被せる） */
    .school-list li[data-bg="bg-1"] .school-link::after {
        background: linear-gradient(160deg, rgba(248,250,252,0.85) 0%, rgba(219,234,254,0.9) 100%);
    }
    .school-list li[data-bg="bg-2"] .school-link::after {
        background: linear-gradient(160deg, rgba(248,250,252,0.85) 0%, rgba(254,215,170,0.9) 100%);
    }
    .school-list li[data-bg="bg-3"] .school-link::after {
        background: linear-gradient(160deg, rgba(248,250,252,0.85) 0%, rgba(187,247,208,0.9) 100%);
    }
    .school-list li[data-bg="bg-4"] .school-link::after {
        background: linear-gradient(160deg, rgba(248,250,252,0.85) 0%, rgba(252,211,225,0.9) 100%);
    }
    .school-list li[data-bg="bg-5"] .school-link::after {
        background: linear-gradient(160deg, rgba(248,250,252,0.85) 0%, rgba(167,243,208,0.9) 100%);
    }
    .school-list li[data-bg="bg-6"] .school-link::after {
        background: linear-gradient(160deg, rgba(248,250,252,0.85) 0%, rgba(254,240,138,0.9) 100%);
    }

    /* アクティブ時：オーバーレイを少し薄くして写真を見せる */
    .school-list li[data-bg="bg-1"].mobile-active .school-link::after {
        background: linear-gradient(160deg, rgba(255,255,255,0.6) 0%, rgba(219,234,254,0.7) 100%);
    }
    .school-list li[data-bg="bg-2"].mobile-active .school-link::after {
        background: linear-gradient(160deg, rgba(255,255,255,0.6) 0%, rgba(254,215,170,0.7) 100%);
    }
    .school-list li[data-bg="bg-3"].mobile-active .school-link::after {
        background: linear-gradient(160deg, rgba(255,255,255,0.6) 0%, rgba(187,247,208,0.7) 100%);
    }
    .school-list li[data-bg="bg-4"].mobile-active .school-link::after {
        background: linear-gradient(160deg, rgba(255,255,255,0.6) 0%, rgba(252,211,225,0.7) 100%);
    }
    .school-list li[data-bg="bg-5"].mobile-active .school-link::after {
        background: linear-gradient(160deg, rgba(255,255,255,0.6) 0%, rgba(167,243,208,0.7) 100%);
    }
    .school-list li[data-bg="bg-6"].mobile-active .school-link::after {
        background: linear-gradient(160deg, rgba(255,255,255,0.6) 0%, rgba(254,240,138,0.7) 100%);
    }

    /* 各school-itemのカードカラー（写真非表示時のフォールバック） */
    .school-list li[data-bg="bg-1"] .school-link {
        background: linear-gradient(135deg, rgba(248,250,252,1) 0%, rgba(240,248,255,1) 100%);
        border-color: rgba(255,255,255,1);
    }
    .school-list li[data-bg="bg-2"] .school-link {
        background: linear-gradient(135deg, rgba(248,250,252,1) 0%, rgba(255,245,238,1) 100%);
        border-color: rgba(255,255,255,1);
    }
    .school-list li[data-bg="bg-3"] .school-link {
        background: linear-gradient(135deg, rgba(248,250,252,1) 0%, rgba(240,255,240,1) 100%);
        border-color: rgba(255,255,255,1);
    }
    .school-list li[data-bg="bg-4"] .school-link {
        background: linear-gradient(135deg, rgba(248,250,252,1) 0%, rgba(255,240,245,1) 100%);
        border-color: rgba(255,255,255,1);
    }
    .school-list li[data-bg="bg-5"] .school-link {
        background: linear-gradient(135deg, rgba(248,250,252,1) 0%, rgba(245,255,250,1) 100%);
        border-color: rgba(255,255,255,1);
    }
    .school-list li[data-bg="bg-6"] .school-link {
        background: linear-gradient(135deg, rgba(248,250,252,1) 0%, rgba(255,250,240,1) 100%);
        border-color: rgba(255,255,255,1);
    }

    /* アクティブ時カードを強調（枠線とシャドウのみ、背景はオーバーレイで制御） */
    .school-item.mobile-active .school-link {
        border-color: rgba(255,255,255,1);
    }
    .school-list li[data-bg="bg-1"].mobile-active .school-link {
        box-shadow: 0 0 0 1px rgba(37,99,235,0.3), 0 8px 30px rgba(37,99,235,0.1);
    }
    .school-list li[data-bg="bg-2"].mobile-active .school-link {
        box-shadow: 0 0 0 1px rgba(234,88,12,0.3), 0 8px 30px rgba(234,88,12,0.1);
    }
    .school-list li[data-bg="bg-3"].mobile-active .school-link {
        box-shadow: 0 0 0 1px rgba(22,163,74,0.3), 0 8px 30px rgba(22,163,74,0.1);
    }
    .school-list li[data-bg="bg-4"].mobile-active .school-link {
        box-shadow: 0 0 0 1px rgba(219,39,119,0.3), 0 8px 30px rgba(219,39,119,0.1);
    }
    .school-list li[data-bg="bg-5"].mobile-active .school-link {
        box-shadow: 0 0 0 1px rgba(16,185,129,0.3), 0 8px 30px rgba(16,185,129,0.1);
    }
    .school-list li[data-bg="bg-6"].mobile-active .school-link {
        box-shadow: 0 0 0 1px rgba(234,179,8,0.3), 0 8px 30px rgba(234,179,8,0.1);
    }

    /* 番号バッジ */
    .school-index {
        font-size: 0.7rem;
        font-weight: 800;
        letter-spacing: 0.15em;
        color: rgba(51, 65, 85, 0.5);
        margin-bottom: 0.6rem;
        transform: none !important;
    }

    /* .text-wrapper */
    .text-wrapper {
        margin: 0 0 0.8rem;
        padding-left: 0;
        transform: none !important;
        width: 100%;
    }

    /* サブキャッチ */
    .sub-catch {
        font-size: 2.8vw;
        color: rgba(51, 65, 85, 0.7);
        letter-spacing: 0.12em;
        margin-bottom: 0.4rem;
        transform: none !important;
    }

    /* 学校名タイトル */
    .school-title {
        font-size: 6.5vw;
        white-space: normal;
        line-height: 1.3;
        font-weight: 900;
        letter-spacing: -0.02em;
        color: #1e293b;
        background: none;
        -webkit-background-clip: unset;
        background-clip: unset;
        -webkit-text-stroke: 0;
        filter: none;
        animation: none;
        transform: none !important;
    }

    /* ブランドカラーのテキストシャドウ */
    .school-list li[data-bg="bg-1"] .school-title { text-shadow: 0 0 20px rgba(255,255,255,0.8); }
    .school-list li[data-bg="bg-2"] .school-title { text-shadow: 0 0 20px rgba(255,255,255,0.8); }
    .school-list li[data-bg="bg-3"] .school-title { text-shadow: 0 0 20px rgba(255,255,255,0.8); }
    .school-list li[data-bg="bg-4"] .school-title { text-shadow: 0 0 20px rgba(255,255,255,0.8); }
    .school-list li[data-bg="bg-5"] .school-title { text-shadow: 0 0 20px rgba(255,255,255,0.8); }
    .school-list li[data-bg="bg-6"] .school-title { text-shadow: 0 0 20px rgba(255,255,255,0.8); }

    .school-title.clone { display: none; }

    /* 英語サブタイトル */
    .school-en {
        text-align: left;
        align-self: flex-start;
        font-size: 0.65rem;
        letter-spacing: 0.2em;
        color: rgba(51, 65, 85, 0.4);
        transform: none !important;
        margin-top: 0.3rem;
    }

    /* ==============================
       説明文パネル：横流し（マーキー）表示
       ============================== */
    .intro-container {
        position: static !important;
        width: 100%;
        max-width: 100%;
        height: auto;
        background: transparent;
        backdrop-filter: none;
        border: none;
        border-top: 1px solid rgba(255,255,255,0.12);
        border-radius: 0;
        /* 左右をフェードさせるマスク */
        mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
        -webkit-mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
        padding: 0.7rem 0 0;
        margin-top: 0.8rem;
        overflow: hidden;           /* マーキーのはみ出しを隠す */
        display: none;              /* 初期非表示 */
        opacity: 0;
        transition: opacity 0.5s ease;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
    }

    /* アクティブなカードの説明文を表示 */
    .school-item.mobile-active .intro-container {
        display: flex;
        opacity: 1;
    }

    /* 横スクロールコンテンツ */
    .intro-scroll-content {
        display: flex;
        flex-direction: row;
        align-items: center;
        white-space: nowrap;        /* 改行させない */
        font-size: 0.78rem;
        line-height: 1.6;
        letter-spacing: 0.08em;
        color: #334155; /* Readability */
        /* 横にゆっくり流れるアニメーション */
        animation: marqueeScroll 28s linear infinite;
        animation-play-state: running;
        transform: translateX(0);
        will-change: transform;
    }

    /* intro-containerがactiveの時もスクロール継続 */
    .school-item.mobile-active .intro-scroll-content {
        animation-play-state: running;
    }

    /* 横流しアニメーション */
    @keyframes marqueeScroll {
        0%   { transform: translateX(100vw); }
        100% { transform: translateX(-100%); }
    }

    /* p内の<br>は横流し時に空白に置換（CSSではできないのでJSで対処、ここでは非表示） */
    .intro-scroll-content p br {
        display: none;
    }
    .intro-scroll-content p {
        display: inline;
    }

    /* 背景レイヤーは使わない（カードのグラデが代替） */
    .bg-layer.active .intro-container {
        transform: none;
    }
}

@media (max-width: 768px) {
    .ui-wrapper {
        padding: 1rem 0.9rem 2rem;
    }

    .header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    .logo {
        font-size: 0.95rem;
    }

    .portal-btns {
        gap: 0.3rem;
    }

    .supporter-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.55rem;
        border: 1px solid rgba(51, 65, 85, 0.15);
        background: rgba(255, 255, 255, 0.8);
        color: var(--text-light);
    }

    .school-title {
        font-size: 7.5vw;
        line-height: 1.3;
    }

    .sub-catch {
        font-size: 3vw;
    }

    .school-link {
        padding: 1.2rem 1.1rem 1.1rem;
    }

    .intro-scroll-content {
        font-size: 0.75rem;
        line-height: 1.85;
    }
}

/* Coming Soon Badge */
.coming-soon-badge {
    position: absolute;
    top: 2rem;
    right: 2rem;
    transform: rotate(10deg);
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    color: #1e293b;
    padding: 0.5rem 1.8rem;
    border-radius: 50px;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.15em;
    z-index: 20;
    pointer-events: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    white-space: nowrap;
    opacity: 1; /* 常時表示 */
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.4s ease, box-shadow 0.4s ease;
}

/* PC ホバー時：バッジを発光させ、少し大きくする */
.school-item:hover .coming-soon-badge {
    transform: rotate(8deg) scale(1.05);
    background: rgba(255, 255, 255, 0.85); /* 視認性を高める */
    box-shadow: 0 10px 40px rgba(234, 179, 8, 0.5); /* きっずチャレンジの黄色で発光 */
}

@media (max-width: 1024px) {
    .coming-soon-badge {
        top: 1.5rem;
        right: 1.5rem;
        font-size: 0.85rem;
        padding: 0.4rem 1.4rem;
        background: rgba(255, 255, 255, 0.6); /* モバイルは少し背景を濃く */
    }
    
    /* モバイル アクティブ時：スマホでスクロール連動で発光 */
    .school-item.mobile-active .coming-soon-badge {
        transform: rotate(8deg) scale(1.05);
        background: rgba(255, 255, 255, 0.9);
        box-shadow: 0 10px 40px rgba(234, 179, 8, 0.5);
    }
}