/* =====================================================
   パスワード認証画面
   ===================================================== */

/* 認証画面全体 */
.auth-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ffffff 0%, #87ceeb 50%, #00bfff 100%); /* 白から水色のグラデーション */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s ease-out;
}

/* 認証画面フェードアウト */
.auth-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* 認証コンテナ */
.auth-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 480px; /* 幅を広げてタイトルが1行で表示されるように */
    width: 90%;
    animation: authSlideIn 0.8s ease-out;
}

/* 認証ヘッダー */
.auth-header h1 {
    font-family: 'Noto Serif JP', serif;
    font-size: 1.5rem;
    color: #00bfff;
    margin-bottom: 10px;
    font-weight: 700;
    white-space: nowrap; /* 改行を防ぐ */
    overflow: hidden; /* はみ出しを隠す */
    text-overflow: ellipsis; /* 必要に応じて省略記号 */
}

.auth-header h2 {
    font-family: 'Noto Serif JP', serif;
    font-size: 1.4rem;
    color: #4682b4;
    margin-bottom: 20px;
    font-weight: 600;
}

.auth-header p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 30px;
}

/* 認証フォーム */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.input-group label {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.input-group input {
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #00bfff;
    box-shadow: 0 0 0 3px rgba(0, 191, 255, 0.1);
}

.input-group button {
    padding: 12px 20px;
    background: linear-gradient(135deg, #00bfff, #4682b4);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.input-group button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 191, 255, 0.3);
}

.input-group button:active {
    transform: translateY(0);
}

/* エラーメッセージ */
.error-message {
    color: #4682b4;
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s ease;
    margin-top: -5px;
}

.error-message.show {
    display: block;
}

/* =====================================================
   モバイル横画面推奨メッセージ
   ===================================================== */

/* モバイル横画面推奨メッセージのスタイル */
.mobile-landscape-notice {
    display: none; /* デスクトップでは非表示 */
    background: linear-gradient(135deg, #ff9800, #ff5722);
    color: white;
    padding: 12px 16px;
    margin: 10px 0;
    border-radius: 8px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
    animation: slideIn 0.5s ease-out;
    position: relative;
}

/* 閉じるボタンのスタイル */
.close-notice-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
    z-index: 10;
    pointer-events: auto; /* クリックを確実に有効に */
}

.close-notice-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.close-notice-btn:active {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(0.95);
}

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

/* ===================================================== */

/* アニメーション: 認証画面スライドイン */
@keyframes authSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* =====================================================
   ローディング画面
   ===================================================== */

/* ローディング画面全体 */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #87ceeb 0%, #00bfff 50%, #4682b4 100%); /* 水色のグラデーション */
    display: none; /* 初期状態では非表示 */
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}

/* ローディング画面フェードアウト */
.loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* ローディングコンテンツ */
.loading-content {
    text-align: center;
    animation: fadeInUp 1s ease-out;
}

/* メインタイトル（習字体） */
.loading-title {
    font-family: 'Noto Serif JP', serif;
    font-size: 4.5rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
    margin-bottom: 30px;
    letter-spacing: 0.1em;
    animation: titleGlow 2s ease-in-out infinite alternate;
}

/* ローディングスピナー */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #ffffff;
    border-radius: 50%;
    margin: 0 auto;
    animation: spin 1s linear infinite;
}

/* アニメーション: フェードインアップ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* アニメーション: タイトルの光る効果 */
@keyframes titleGlow {
    from {
        text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
    }
    to {
        text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 255, 255, 0.5);
    }
}

/* アニメーション: スピナー回転 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =====================================================
   基本スタイル設定
   ===================================================== */

/* 全体のリセット設定 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ページ全体の背景とレイアウト */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #00bfff; /* 空の青色で爽やかな印象 */
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =====================================================
   建物配置設定（グリッドシステム）
   ===================================================== */

/* 増設校舎1（左下エリア） */
.temporary-1 {
    grid-column: 4;
    grid-row: 4 / 5;
    background: linear-gradient(145deg, #ffe6cc, #ffcc99); /* オレンジ系グラデーション */
    position: relative;
    min-height: 200px;
}

/* キッチンカースペース（屋外飲食エリア） */
.kitchen-car-space {
    grid-column: 5;
    grid-row: 3;
    background: linear-gradient(145deg, #fff2e6, #ffe0cc); /* 暖色系グラデーション */
    border: 2px dashed #ff9500; /* 点線でキッチンカースペースを表現 */
}

/* 体育館（縦長の大きな建物） */
.gymnasium {
    grid-column: 5;
    grid-row: 2 / 4;
    background: linear-gradient(145deg, #e6f3ff, #cce7ff); /* 青系グラデーション */
    position: relative;
}

/* キッチンカースペース（重複定義のため削除予定） */
.kitchen-car-space {
    grid-column: 4;
    grid-row: 3;
    background: linear-gradient(145deg, #fff2e6, #ffe0cc);
    border: 2px dashed #ff9500;
}

/* =====================================================
   メインコンテナ設定
   ===================================================== */

/* 全体のコンテナ */
.container {
    width: 95%;
    max-width: 1200px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1); /* 立体感のある影 */
    overflow: hidden;
    position: relative;
}

/* ヘッダー部分（タイトルエリア） */
header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%); /* 青いグラデーション */
    color: white;
    padding: 20px;
    text-align: center;
}

/* メインタイトル */
header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

/* サブタイトル */
header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* マップコンテナ（背景色設定） */
.map-container {
    padding: 40px 20px;
    background: #f8f9fa; /* 薄いグレー背景 */
}

/* =====================================================
   グリッドレイアウトシステム
   ===================================================== */

/* メインマップ（10列×4行のグリッド） */
.school-map {
    display: grid;
    grid-template-columns: repeat(10, 1fr); /* 10列均等分割 */
    grid-template-rows: repeat(4, 150px); /* 4行、各150px */
    gap: 10px; /* 建物間の隙間 */
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* =====================================================
   建物基本スタイル
   ===================================================== */

/* 全建物共通のスタイル */
.building {
    background: linear-gradient(145deg, #ffffff, #e6e6e6); /* 白からグレーのグラデーション */
    border: 3px solid #ddd;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer; /* クリック可能を示す */
    transition: all 0.3s ease; /* ホバー効果のためのアニメーション */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.building:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    border-color: #007bff;
}

/* 建物名表示ラベル */
.building-label {
    font-weight: bold;
    font-size: 1.1rem;
    color: #333;
    text-align: center;
    margin-bottom: 5px;
}

/* 階数表示部分 */
.floors {
    font-size: 0.9rem;
    color: #666;
    background: rgba(0, 123, 255, 0.1); /* 薄い青色背景 */
    padding: 4px 8px;
    border-radius: 15px;
}

/* =====================================================
   個別建物の配置とデザイン
   ===================================================== */

/* グラウンド（2-4列目、2-4行目の大きなエリア） */
.ground {
    grid-column: 2 / 5; /* 2列目から4列目まで（3列分） */
    grid-row: 2 / 4; /* 2行目から4行目まで */
    background: linear-gradient(145deg, #90EE90, #7CFC00); /* 明るい緑のグラデーション */
    border: 3px solid #228B22; /* 濃い緑の枠線 */
    position: relative;
}

/* グラウンドの装飾アイコン */
.ground::after {
    content: '🏃‍♂️'; /* ランニング絵文字 */
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-size: 1.5rem;
}

/* 校門（1列目、3行目、小さめサイズ） */
.school-gate {
    grid-column: 1;
    grid-row: 3;
    background: linear-gradient(145deg, #d4a574, #b8935f); /* 茶色系グラデーション */
    border: 2px solid #8b6914; /* 濃い茶色の枠線 */
    width: 60%; /* 他の建物より小さく */
    height: 60%;
    margin: auto; /* 中央配置 */
}

/* 校門の装飾アイコン */
.school-gate::after {
    content: '🚪'; /* ドア絵文字 */
    position: absolute;
    bottom: 5px;
    right: 5px;
    font-size: 1.2rem;
}

/* 増設校舎1（4列目、3行目） */
.temporary-1 {
    grid-column: 4;
    grid-row: 3;
    background: linear-gradient(145deg, #fff2e6, #ffe6cc); /* オレンジ系グラデーション */
    min-height: 180px;
}

/* キッチンカースペース（5列目、3行目、点線枠） */
.kitchen-car-space {
    grid-column: 5;
    grid-row: 3;
    background: linear-gradient(145deg, #fff5e6, #ffebcc); /* 暖色系グラデーション */
    border: 2px dashed #ff9900; /* オレンジの点線 */
}

/* 体育館（6列目、2-3行目の縦長建物） */
.gymnasium {
    grid-column: 6;
    grid-row: 2 / 4; /* 2行目から3行目まで */
    background: linear-gradient(145deg, #e6f3ff, #cce7ff); /* 青系グラデーション */
    border: 2px solid #4a90e2; /* 青い枠線 */
}

/* 西タワー校舎（7列目、2行目） */
.west-tower {
    grid-column: 7;
    grid-row: 2;
    background: linear-gradient(145deg, #ffe6e6, #ffcccc); /* ピンク系グラデーション */
    height: 120%; /* 少し高めに設定 */
}

/* 増設校舎2（7列目、3行目） */
.temporary-2 {
    grid-column: 7;
    grid-row: 3;
    background: linear-gradient(145deg, #ffe6cc, #ffcc99); /* オレンジ系グラデーション */
    margin-top: 0px;
}

/* 中央校舎（8-9列目、2行目、L字型） */
.central {
    grid-column: 8 / 10; /* 8列目から9列目まで */
    grid-row: 2;
    background: linear-gradient(145deg, #e6ffe6, #ccffcc); /* 緑系グラデーション */
    position: relative;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 75% 100%, 75% 50%, 0 50%); /* L字型にカット */
}

/* 東タワー校舎（10列目、2行目） */
.east-tower {
    grid-column: 10;
    grid-row: 2;
    background: linear-gradient(145deg, #f0e6ff, #e0ccff); /* 薄紫系グラデーション */
    height: 140%; /* 一番高く設定 */
}

/* =====================================================
   情報パネル・モーダル設定
   ===================================================== */

/* 建物クリック時の情報パネル */
.info-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: white;
    border-radius: 15px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1001;
    transition: transform 0.3s ease;
}

.info-panel.show {
    transform: translate(-50%, -50%) scale(1);
}

.info-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-header h2 {
    font-size: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-content {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.floor-section {
    margin-bottom: 20px;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
}

.floor-header {
    background: #f8f9fa;
    padding: 15px;
    font-weight: bold;
    color: #333;
    border-bottom: 1px solid #eee;
}

.events-list {
    padding: 15px;
}

.event-item {
    padding: 10px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    border-left: 4px solid #007bff;
}

.event-title {
    font-weight: bold;
    color: #007bff;
    margin-bottom: 5px;
}

.event-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.event-image {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: 5px;
    margin-top: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.event-image:hover {
    transform: scale(1.02);
}

.image-placeholder {
    width: 100%;
    max-width: 300px;
    height: 150px;
    background: #e9ecef;
    border: 2px dashed #adb5bd;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 0.8rem;
    margin-top: 8px;
}

/* 画像拡大表示用モーダル */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.image-modal.show {
    opacity: 1;
    visibility: visible;
}

.image-modal img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.image-modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    background: none;
    border: none;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    z-index: 2001;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.overlay.show {
    opacity: 1;
    visibility: visible;
}

/* フッター */
footer {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    text-align: center;
    padding: 15px 20px;
    font-size: 0.9rem;
    border-top: 1px solid #ddd;
}

footer p {
    margin: 0;
    opacity: 0.9;
}

/* フッター内のリンクスタイル */
footer a {
    color: #87ceeb; /* 薄い青色 */
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #ffffff; /* ホバー時は白色 */
    text-decoration: underline;
}

/* =====================================================
   レスポンシブデザイン（モバイル対応）
   ===================================================== */

/* タブレット・スマートフォン向けレイアウト（768px以下） */
@media (max-width: 768px) {
    /* モバイル横画面推奨メッセージを表示 */
    .mobile-landscape-notice {
        display: block;
    }
    
    /* デスクトップの10列を8列に比例縮小 */
    .school-map {
        grid-template-columns: repeat(8, 1fr); /* 8列で比例配置 */
        grid-template-rows: repeat(4, 130px); /* 4行維持 */
        height: auto;
        gap: 6px;
        padding: 15px;
    }
    
    /* グラウンド（デスクトップ2-4列目 → モバイル2-3列目） */
    .ground {
        grid-column: 2 / 4; /* 2-3列目（デスクトップの2-4を縮小） */
        grid-row: 2 / 4;
    }
    
    /* 校門（デスクトップ1列目 → モバイル1列目） */
    .school-gate {
        grid-column: 1;
        grid-row: 3;
    }
    
    /* 増設校舎1（デスクトップ4列目 → モバイル3列目） */
    .temporary-1 {
        grid-column: 3;
        grid-row: 3;
    }
    
    /* キッチンカースペース（デスクトップ5列目 → モバイル4列目） */
    .kitchen-car-space {
        grid-column: 4;
        grid-row: 3;
    }
    
    /* 体育館（デスクトップ6列目 → モバイル5列目） */
    .gymnasium {
        grid-column: 5;
        grid-row: 2 / 4;
    }
    
    /* 西タワー（デスクトップ7列目 → モバイル6列目） */
    .west-tower {
        grid-column: 6;
        grid-row: 2;
    }
    
    /* 増設校舎2（デスクトップ7列目 → モバイル6列目） */
    .temporary-2 {
        grid-column: 6;
        grid-row: 3;
    }
    
    /* 中央校舎（デスクトップ8-9列目 → モバイル7列目） */
    .central {
        grid-column: 7;
        grid-row: 2;
        clip-path: polygon(0 0, 100% 0, 100% 100%, 75% 100%, 75% 50%, 0 50%);
    }
    
    /* 東タワー（デスクトップ10列目 → モバイル8列目）常に最右端 */
    .east-tower {
        grid-column: 8;
        grid-row: 2;
        height: 140%; /* デスクトップと同じ高さ比率 */
    }
    
    /* フォントサイズを大きく */
    .building-label {
        font-size: 1.0rem;
        font-weight: 600;
        text-shadow: 1px 1px 2px rgba(0,0,0,0.3); /* 文字を見やすく */
    }
    
    /* 階数表示も見やすく */
    .floors {
        font-size: 0.9rem;
        padding: 6px 10px; /* パディングを増やす */
    }
    
    /* ボタンのタッチ領域を大きく */
    .building {
        min-height: 130px; /* 最小高さを確保 */
        border-width: 3px; /* 枠線を太く */
    }
    
    /* タッチ時のフィードバックを強化 */
    .building:active {
        transform: scale(0.95);
        transition: transform 0.1s;
    }
    
    .building-label {
        font-size: 0.8rem; /* 文字を少し小さく */
    }
    
    header h1 {
        font-size: 1.6rem; /* ヘッダーも調整 */
    }
}

/* 小さなスマートフォン向けレイアウト（480px以下） */
@media (max-width: 480px) {
    /* デスクトップの10列を6列に比例縮小 */
    .school-map {
        grid-template-columns: repeat(6, 1fr); /* 6列で比例配置 */
        grid-template-rows: repeat(4, 110px); /* 4行維持 */
        gap: 4px;
        padding: 12px;
        height: auto;
    }
    
    /* グラウンド（デスクトップ2-4列目 → モバイル2列目のみ） */
    .ground {
        grid-column: 2;
        grid-row: 2 / 4;
    }
    
    /* 校門（デスクトップ1列目 → モバイル1列目） */
    .school-gate {
        grid-column: 1;
        grid-row: 3;
    }
    
    /* 増設校舎1（デスクトップ4列目の位置） */
    .temporary-1 {
        grid-column: 2;
        grid-row: 3;
        margin-top: 0;
    }
    
    /* キッチンカースペース（デスクトップ5列目 → モバイル3列目） */
    .kitchen-car-space {
        grid-column: 3;
        grid-row: 3;
    }
    
    /* 体育館（デスクトップ6列目 → モバイル4列目） */
    .gymnasium {
        grid-column: 4;
        grid-row: 2 / 4;
    }
    
    /* 西タワー（デスクトップ7列目 → モバイル5列目） */
    .west-tower {
        grid-column: 5;
        grid-row: 2;
    }
    
    /* 増設校舎2（デスクトップ7列目下 → モバイル5列目下） */
    .temporary-2 {
        grid-column: 5;
        grid-row: 3;
    }
    
    /* 中央校舎（デスクトップ8-9列目 → モバイル6列目上部） */
    .central {
        grid-column: 6;
        grid-row: 2;
        clip-path: polygon(0 0, 100% 0, 100% 100%, 60% 100%, 60% 50%, 0 50%);
    }
    
    /* 東タワー（デスクトップ10列目）常に最右端、独立した位置 */
    .east-tower {
        grid-column: 6;
        grid-row: 3;
        margin-top: 20px; /* 中央校舎との間隔を確保 */
        height: 120%; /* 他より高く */
        background: linear-gradient(145deg, #f0e6ff, #e0ccff); /* 薄紫系を維持 */
    }
    
    /* テキストサイズを調整 */
    .building-label {
        font-size: 0.95rem; /* フォントサイズを少し大きく */
        font-weight: 600;
        line-height: 1.2;
    }
    
    /* 階数表示を見やすく */
    .floors {
        font-size: 0.85rem;
        padding: 5px 8px;
    }
    
    /* 建物の最小サイズを確保 */
    .building {
        min-height: 110px;
        border-width: 2px;
    }
}

/* モバイル認証画面対応 */
@media (max-width: 768px) {
    .auth-container {
        padding: 30px 20px;
        max-width: 380px; /* モバイルでも少し広く */
    }
    
    .auth-header h1 {
        font-size: 1.2rem; /* モバイルでは小さく調整 */
        white-space: nowrap; /* 改行を防ぐ */
    }
    
    /* 非常に小さな画面（320px以下）での対応 */
    @media (max-width: 320px) {
        /* さらにシンプルな1列レイアウト */
        .school-map {
            grid-template-columns: 1fr; /* 1列のみ */
            grid-template-rows: repeat(10, 100px); /* 10行で東タワー専用行を追加 */
            gap: 8px;
            padding: 15px;
            height: auto;
        }
        
        /* すべての建物を縦に並べる */
        .ground {
            grid-column: 1;
            grid-row: 1 / 3; /* 上部2行分 */
        }
        
        .school-gate {
            grid-column: 1;
            grid-row: 3;
        }
        
        .gymnasium {
            grid-column: 1;
            grid-row: 4;
        }
        
        .kitchen-car-space {
            grid-column: 1;
            grid-row: 5;
        }
        
        .temporary-1 {
            grid-column: 1;
            grid-row: 6;
        }
        
        .west-tower {
            grid-column: 1;
            grid-row: 7;
        }
        
        .temporary-2 {
            grid-column: 1;
            grid-row: 8;
        }
        
        .central {
            grid-column: 1;
            grid-row: 9;
            clip-path: none;
        }
        
        /* 東タワー（常に最右端の1列に独立配置） */
        .east-tower {
            grid-column: 1;
            grid-row: 10;
            height: 100px;
            background: linear-gradient(145deg, #f0e6ff, #e0ccff); /* 薄紫系を維持 */
        }
        
        .building-label {
            font-size: 1.0rem; /* 少し大きめに */
            font-weight: 600;
        }
        
        .floors {
            font-size: 0.9rem;
        }
        
        .auth-header h1 {
            font-size: 1rem; /* さらに小さく */
        }
        
        .auth-container {
            max-width: 300px;
            padding: 25px 15px;
        }
    }
    
    .auth-header h2 {
        font-size: 1.2rem;
    }
    
    /* ローディング画面のモバイル対応 */
    .loading-title {
        font-size: 3rem; /* モバイルでは少し小さく */
        letter-spacing: 0.05em;
    }
    
    .loading-spinner {
        width: 30px;
        height: 30px;
    }
}
