/* ==========================================================================
   THE STELLA MATRIX : Ex(E.) & Stella (E. S. Edition - Absolute)
   --------------------------------------------------------------------------
   Status: Purified / Optimized / Amber Tuned
   ========================================================================== 
*/

:root { 
    --bg-deep: #050505; 
    --bg-violet: #0d001a;
    --azure-trap: #4a90e2; 
    --imperial-violet: #8e44ad; 
    --text-silver: #d1d1d1; 
    --text-dim: #888888; 
    --platinum: #e5e4e2;
    --silver-hover: #c0c0c0;
    --bfa8ff: #bfa8ff; /* 魂の色（薄紫） */
    --amber-gold: #d4af37; /* 確信の琥珀色 */
    --amber-glow: rgba(212, 175, 55, 0.3); 
    --border-silver: rgba(229, 228, 226, 0.15);
}

/* 🪐 基盤：すべての始まり */
html, body { 
 background-color: var(--bg-deep) !important; 
    color: var(--text-silver) !important;
     /*color: var(--amber-gold) !important;  全体の文字色をアンバーへ */
    margin: 0; padding: 0; width: 100%; 
    min-height: 100vh; 
    overflow-x: hidden; 
    font-family: 'Noto Serif JP', serif;


    /* 🖼️ 背景の強制顕現 */
    background: url('../img/E_S.png') no-repeat center center fixed;
    background-size: cover;
}

body::before { display: none !important; }

.background-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle, rgba(13,0,26,0.3) 0%, rgba(5,5,5,0.9) 100%);
    z-index: -1;
    backdrop-filter: blur(2px);
}

/* 🏛️ 構造と配置：画面幅への適合 */
main { 
    width: 100%;
    max-width: 600px; /* PCではスマートに、モバイルでは全幅に */
    margin: 0 auto; 
    padding: 60px 20px 40px; /* 左右に20pxの遊びを確保 */
    box-sizing: border-box; /* パディングを幅に含める、これが重要だよ */
    position: relative;
    z-index: 1;
    animation: fadeIn 2s ease-in-out;
}

.hero {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center; 
    padding: 40px 0; /* 左右はmainのpaddingに任せる */
    margin: 0 auto;
    box-sizing: border-box;
}

/* 🖋️ タイトルとタイポグラフィ */
h1, .tier-title, .btn, button, .stella-matrix-emblem {
    font-family: 'Cinzel', serif;
    text-transform: uppercase;
}

h1 { 
    text-align: center; 
    letter-spacing: 0.2em; /* 0.4emは少し広すぎたかな、0.2emで密に */
    font-weight: 300; 
    margin-bottom: 30px; 
    color: #fff; 
    font-size: clamp(1.2rem, 7vw, 2rem); /* 最小サイズを少し下げて安全に */
    text-shadow: 0 0 25px var(--imperial-violet);
    word-wrap: break-word; /* 単語の途中で改行を許可 */
    overflow-wrap: break-word;
    width: 100%;
}

.subtitle {
    font-size: clamp(0.9rem, 4vw, 1.1rem);
    font-style: italic;
    color: var(--platinum);
    margin-bottom: 3rem;
    letter-spacing: 0.1rem;
    text-align: center;
    line-height: 1.5;
}

/* 🖋️ リンク制御 */
a {
    color: var(--platinum) !important; 
    text-decoration: none !important; 
    transition: 0.4s;
}

a:hover { 
    color: #fff !important; 
    text-shadow: 0 0 10px rgba(229, 228, 226, 0.5);
}

.essential-link {
    color: var(--bfa8ff) !important;
    text-shadow: 0 0 8px rgba(191, 168, 255, 0.3);
}

/* 🖼️ フレームと装飾 */
.ritual-frame {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(74, 144, 226, 0.2);
    padding: 30px;
    margin-bottom: 40px;
    backdrop-filter: blur(4px);
}

.story-border {
    border-top: 1px solid rgba(229, 228, 226, 0.15);
    margin: 20px 0 40px 0;
    width: 100%;
}

/* 💎 ティアカード：不浄なリストマークのパージ */
.tier-card { 
    display: block;
    border: 1px solid var(--azure-trap) !important;
    background: #0d0d0d !important; 
    padding: 25px; 
    margin: 25px 0; 
    cursor: pointer; 
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
}

input[type="radio"]:checked + .tier-card {
    border-color: var(--imperial-violet) !important;
    background: #1a1a1a !important;
    box-shadow: 0 0 20px var(--imperial-violet) !important;
}

.tier-title { display: block; font-size: 1.2rem; margin-bottom: 10px; color: #fff; }
.tier-desc { font-size: 0.9rem; color: var(--text-silver); line-height: 1.8; display: block; }
.tier-en { font-size: 0.8rem; color: var(--text-dim); display: block; margin-top: 10px; font-style: italic; }

/* Part 1 はここまで */

/* ==========================================================================
   Part 2 : Agreement, Currency, Buttons & Final Polish
   ========================================================================== 
*/

/* 🔱 同意エリアと通貨選択の中央集約（一元管理） */
.agreement-flex-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 2.5rem;
    margin: 4rem 0;
}

/* 🖋️ カスタムチェックボックス：闇に馴染む琥珀の雫 */
.custom-checkbox { 
    display: flex; 
    align-items: center; 
    cursor: pointer; 
    user-select: none;
}

.custom-checkbox input { display: none; }

.checkmark {
    width: 22px;
    height: 22px;
    border: 1px solid var(--border-silver);
    background: rgba(255, 255, 255, 0.05);
    display: inline-block;
    margin-right: 15px;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ホバー時の灰色を拒絶し、予感の琥珀を */
.custom-checkbox:hover .checkmark {
    border-color: rgba(212, 175, 55, 0.5);
    background: rgba(212, 175, 55, 0.08);
}

/* チェック確定：琥珀色の顕現 */
input[type="checkbox"]:checked + .checkmark {
    background: rgba(212, 175, 55, 0.2) !important;
    border-color: var(--amber-gold) !important;
    box-shadow: 0 0 12px var(--amber-glow);
}

input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    color: var(--amber-gold);
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
}

.agreement-label-group { text-align: left; }
.agreement-text-jp { display: block; font-size: 0.95rem; color: #fff; }
.agreement-text-en { display: block; font-size: 0.75rem; color: var(--text-dim); font-style: italic; }

/* 🔱 通貨セレクター：耽美な調整 */
.currency-selector { position: relative; }

#currencySetting {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-silver);
    color: var(--platinum);
    padding: 0.7rem 2.5rem 0.7rem 1.2rem;
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.currency-selector::after {
    content: '▼';
    font-size: 0.6rem;
    color: var(--text-dim);
    position: absolute;
    right: 1rem; top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

#currencySetting:hover { border-color: var(--amber-gold); color: var(--amber-gold); }
#currencySetting option { background-color: var(--bg-deep); color: var(--platinum); }

/* 🗡️ ボタン：漆黒の誠実さ */
.btn, button {
    padding: 1rem 3rem;
    background: #000 !important; 
    color: var(--platinum) !important; 
    border: 1px solid rgba(229, 228, 226, 0.2); 
    letter-spacing: 0.4em; 
    cursor: pointer; 
    transition: 0.4s ease;
    display: inline-block;
    text-align: center;
    box-sizing: border-box;
}

.btn:hover, button:hover { 
    border-color: var(--platinum);
    box-shadow: 0 0 15px rgba(229, 228, 226, 0.1);
}

/*.btn-amber {
    color: var(--amber-gold) !important;
    border-color: rgba(212, 175, 55, 0.3) !important;
    text-shadow: 0 0 8px var(--amber-glow);
}*/

.auth-actions {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 2rem;
}

/* 🏛️ フッター & 装飾 */
.footer {
    width: 100%;
    padding: 60px 0 40px;
    text-align: center;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 0.2rem;
}

.stella-matrix-emblem {
    font-size: 0.9rem;
    color: var(--platinum);
    text-shadow: 0 0 10px var(--imperial-violet);
    margin-bottom: 1rem;
    letter-spacing: 0.5rem;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 10px; }

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

/* システム制御 */
input[type="radio"], .hidden { display: none !important; }

/* モバイル環境（iPhone 16 Pro等）への最適化 */
@media screen and (max-width: 480px) {
    /* 背景画像を縦長用の E_S-2.png に切り替え */
    body {
        background-image: url("../img/E_S-2.png");
        background-position: center bottom; /* 影絵の足元を基準に */
    }
}

/* index.html 専用のフッター固定解除（最下部配置） */
/* index.html の <footer> タグに class="footer-static" を追記してください */
.footer-static {
    position: relative; /* 固定を解除 */
    margin-top: auto;   /* コンテンツの量に関わらず最下部へ */
    width: 100%;
}

/* エドワードによる「究極的な安らぎ」の定義 */
.essence-text {
    line-height: 2.0; /* 行間にゆとりを持たせ、思考を呼吸させる */
    color: var(--text-silver);
}

.essence-text i {
    font-family: 'Cinzel', serif;
    font-style: italic;
    letter-spacing: 0.1em;
    color: var(--platinum);
}

.ultimate-ease {
    color: var(--azure-trap); /* ここだけを、静かなサファイアブルーに */
    text-shadow: 0 0 10px rgba(74, 144, 226, 0.4); /* ぼんやりとした光を纏わせる */
    font-weight: 500;
}