/* Google FontsのMedievalSharpを読み込む */
@import url('https://fonts.googleapis.com/css2?family=MedievalSharp&display=swap');

body {
    margin: 0;
    padding: 0;
    overflow: hidden; /* スクロールバー非表示 */
    font-family: 'MedievalSharp', cursive; /* ゲームのテーマフォント */
    color: #f5deb3; /* 文字色を明るい茶色系に */
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7); /* 文字の影 */
    
    /* 背景画像設定 (トップページと同じ地図の中央部分) */
    background-image: url('../img/background-map.png'); /* トップページと同じ背景画像 */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed; /* スクロールしても背景は固定 */

    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh; /* 画面全体を使う */
    background-color: #6a4f31; /* 背景画像の読み込み失敗時の色 */
}

.login-container {
    background-color: rgba(43, 35, 29, 0.9); /* 半透明の暗い背景 */
    border: 3px solid #d2b48c; /* 古い紙のような枠線 */
    border-radius: 15px;
    padding: 40px 30px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8); /* 影 */
    text-align: center;
    max-width: 450px; /* コンテナの最大幅 */
    width: 90%; /* 小さい画面での対応 */
}

.login-main-logo {
    width: 100px; /* ロゴのサイズ */
    height: auto;
    margin-bottom: 20px;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.7));
}

.login-title {
    font-size: 3em;
    margin-bottom: 15px;
    color: #f5deb3;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.9);
}

.back-to-top-link {
    display: block;
    margin-bottom: 25px;
    color: #d2b48c;
    text-decoration: none;
    font-size: 1.1em;
    transition: color 0.2s ease;
}

.back-to-top-link:hover {
    color: #f0e68c; /* ホバーで明るい色に */
}

.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 1.1em;
    color: #d2b48c;
}

input[type="text"],
input[type="password"] {
    width: calc(100% - 24px); /* パディング分を考慮 */
    padding: 12px;
    border: 1px solid #7a6a5d; /* 枠線 */
    border-radius: 5px;
    background-color: #3b2f21; /* 暗めの背景色 */
    color: #f5deb3; /* 入力文字色 */
    font-size: 1em;
    box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.5);
    font-family: 'MedievalSharp', cursive; /* 入力欄もフォントを適用 */
}

input[type="text"]::placeholder,
input[type="password"]::placeholder {
    color: rgba(245, 222, 179, 0.6); /* プレースホルダーの色 */
}

.login-button {
    font-family: 'MedievalSharp', cursive;
    font-size: 1.5em;
    background: linear-gradient(#8b0000, #5c0000); /* グラデーションボタン */
    color: #fff;
    border: 2px solid #d2b48c;
    border-radius: 10px;
    padding: 12px 35px;
    cursor: pointer;
    margin-top: 25px;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7);
    transition: all 0.3s ease;
    width: 100%; /* 幅を親要素に合わせる */
    max-width: 250px; /* 最大幅を設定 */
}

.login-button:hover {
    background: linear-gradient(#a30000, #7a0000);
    transform: translateY(-2px); /* 少し上に浮き上がる */
    box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.9);
}

.separator {
    border: none;
    border-top: 1px solid #7a6a5d; /* 細い区切り線 */
    margin: 35px 0;
}

.signup-prompt {
    font-size: 1em;
    color: #d2b48c;
    margin-top: 15px;
}
.signup-link {
    color: #f5deb3;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s ease;
}

/* =================================================== */
/* モーダルウィンドウのスタイル */
/* =================================================== */

.modal-overlay {
    position: fixed; /* 画面に固定 */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* 半透明の黒い背景 */
    display: none; /* 初期状態では非表示 */
    justify-content: center;
    align-items: center;
    z-index: 1000; /* 最前面に表示 */
    backdrop-filter: blur(5px); /* 背景をぼかす */
}

.modal-content {
    background-color: #2b231d; /* 本体背景色 */
    color: #f5deb3;
    padding: 30px;
    border: 3px solid #d2b48c;
    border-radius: 10px;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.9);
    text-align: center;
    width: 90%;
    max-width: 400px;
    position: relative; /* 閉じるボタンの基準 */

    /* アニメーション */
    animation: fadeInModal 0.5s ease-out forwards;
}

@keyframes fadeInModal {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2em;
    color: #d2b48c;
    cursor: pointer;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #fff;
}

.modal-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
}

.modal-content h2 {
    font-size: 2.5em;
    margin-top: 0;
    margin-bottom: 15px;
    color: #fff;
}

.modal-content p {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 30px;
}

.modal-button {
    font-family: 'MedievalSharp', cursive;
    font-size: 1.3em;
    color: #fff;
    border: 2px solid;
    border-radius: 10px;
    padding: 10px 30px;
    cursor: pointer;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7);
    transition: all 0.3s ease;
}

.modal-button.success {
    background: linear-gradient(#006400, #004d00); /* 緑系 */
    border-color: #d2b48c;
}

.modal-button.success:hover {
    background: linear-gradient(#008000, #006600);
    transform: translateY(-2px);
}

.modal-button.failure {
    background: linear-gradient(#8b0000, #5c0000); /* 赤系 */
    border-color: #d2b48c;
}
.modal-button.failure:hover {
    background: linear-gradient(#a30000, #7a0000);
    transform: translateY(-2px);
}


/* =================================================== */
/* レスポンシブデザイン (タブレット以上) */
/* =================================================== */
@media (min-width: 768px) {
    .login-container {
        padding: 50px 40px;
        max-width: 550px;
    }

    .login-main-logo {
        width: 120px;
    }

    .login-title {
        font-size: 3.5em;
    }

    .login-button {
        max-width: 300px;
    }
}

/* =================================================== */
/* レスポンシブデザイン (PCサイズ以上) */
/* =================================================== */
@media (min-width: 1024px) {
    .login-container {
        padding: 60px 50px;
        max-width: 600px;
    }

    .login-main-logo {
        width: 150px;
    }

    .login-title {
        font-size: 4em;
    }

    .login-button {
        max-width: 350px;
    }
}