/* =========================================================
   LUNA'S TAROT 講座生専用 — 秘密の部屋
   luna-room.html（入口）／ luna-secret.html（秘密の部屋）共通スタイル
   ---------------------------------------------------------
   ・画像ファイルは使っていません（星はすべてCSSグラデーション）
   ・サイトの配色（紺・金）に合わせています
   ・スマホ幅（375px）でも崩れないように調整済み
   ========================================================= */

/* --------------------------------------------------------------------------
   0. 合言葉チェック前の中身を隠す（未解錠で一瞬見えるのを防ぐ）
      js/luna-room.js がロック解除を確認したあと <html> から外します
   -------------------------------------------------------------------------- */
html.luna-guard body {
    visibility: hidden;
}

html.luna-guard .luna-noscript {
    visibility: visible;
}

.luna-noscript {
    position: relative;
    z-index: 5;
    margin: 0;
    padding: 24px 18px;
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.9;
    color: var(--luna-ice);
}

:root {
    --luna-navy-deep: #050B1C;
    --luna-navy: #0A1633;
    --luna-navy-mid: #12244A;
    --luna-gold: #C9A227;
    --luna-gold-light: #F2E3A6;
    --luna-ice: #DCE8F5;
    --luna-ice-dim: #A9BDD4;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

/* --------------------------------------------------------------------------
   1. ページ全体（紺色の夜空）
   -------------------------------------------------------------------------- */
body.luna-page {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
    font-family: "Noto Sans JP", system-ui, -apple-system, "Hiragino Sans", "Yu Gothic", sans-serif;
    color: var(--luna-ice);
    background:
        radial-gradient(circle at 50% -10%, #1B3663 0%, rgba(27, 54, 99, 0) 58%),
        linear-gradient(180deg, var(--luna-navy) 0%, var(--luna-navy-deep) 100%);
    background-attachment: fixed;
}

/* --------------------------------------------------------------------------
   2. 星（CSSグラデーションのみ／画像なし）
   -------------------------------------------------------------------------- */
.luna-stars {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        radial-gradient(1.5px 1.5px at 12% 18%, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 100%),
        radial-gradient(1.5px 1.5px at 38% 62%, rgba(242, 227, 166, 0.85) 0%, rgba(242, 227, 166, 0) 100%),
        radial-gradient(1.2px 1.2px at 72% 26%, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 100%),
        radial-gradient(1.8px 1.8px at 88% 74%, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%),
        radial-gradient(1.3px 1.3px at 22% 86%, rgba(220, 232, 245, 0.75) 0%, rgba(220, 232, 245, 0) 100%),
        radial-gradient(1.1px 1.1px at 58% 8%, rgba(255, 255, 255, 0.65) 0%, rgba(255, 255, 255, 0) 100%),
        radial-gradient(1.4px 1.4px at 6% 48%, rgba(242, 227, 166, 0.6) 0%, rgba(242, 227, 166, 0) 100%),
        radial-gradient(1.2px 1.2px at 94% 38%, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0) 100%);
    background-repeat: repeat;
    background-size:
        460px 460px,
        380px 380px,
        520px 520px,
        300px 300px,
        420px 420px,
        340px 340px,
        480px 480px,
        360px 360px;
    animation: lunaTwinkle 9s ease-in-out infinite alternate;
}

/* 大きな星（まばたき）を重ねる */
.luna-stars::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(2.4px 2.4px at 32% 34%, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%),
        radial-gradient(2.6px 2.6px at 78% 58%, rgba(242, 227, 166, 0.95) 0%, rgba(242, 227, 166, 0) 100%),
        radial-gradient(2.2px 2.2px at 16% 70%, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 100%),
        radial-gradient(2.5px 2.5px at 64% 88%, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0) 100%);
    background-repeat: repeat;
    background-size: 700px 700px, 620px 620px, 760px 760px, 660px 660px;
    animation: lunaTwinkleBig 6.5s ease-in-out infinite alternate;
}

@keyframes lunaTwinkle {
    0% { opacity: 0.85; }
    100% { opacity: 1; }
}

@keyframes lunaTwinkleBig {
    0% { opacity: 0.35; }
    100% { opacity: 0.95; }
}

/* --------------------------------------------------------------------------
   3. レイアウト
   -------------------------------------------------------------------------- */
.luna-main {
    position: relative;
    z-index: 1;
    flex: 1 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px 18px 40px;
}

.luna-card {
    width: 100%;
    max-width: 620px;
    margin: 0 auto;
    padding: 40px 30px 36px;
    text-align: center;
    background: linear-gradient(180deg, rgba(18, 36, 74, 0.9) 0%, rgba(7, 16, 36, 0.93) 100%);
    border: 1px solid rgba(201, 162, 39, 0.42);
    border-radius: 22px;
    box-shadow:
        0 26px 64px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(242, 227, 166, 0.16);
}

/* 秘密の部屋は本文が長いので少し広く */
.luna-card--room {
    max-width: 900px;
    text-align: left;
    padding: 42px 36px 38px;
}

/* --------------------------------------------------------------------------
   4. 三日月（Font Awesome の fa-moon をサイト共通アイコンとして使用）
   -------------------------------------------------------------------------- */
.luna-moon {
    display: block;
    margin: 0 auto 10px;
    font-size: 62px;
    line-height: 1;
    color: var(--luna-gold);
    filter: drop-shadow(0 0 18px rgba(242, 227, 166, 0.5));
}

.luna-moon--sm {
    font-size: 44px;
    margin-bottom: 6px;
}

/* 秘密の部屋の見出し横の三日月 */
.luna-moon--inline {
    margin: 0;
    font-size: 30px;
    flex: 0 0 auto;
}

/* --------------------------------------------------------------------------
   5. 文字
   -------------------------------------------------------------------------- */
.luna-eyebrow {
    margin: 18px 0 12px;
    font-family: "Playfair Display", "Noto Sans JP", serif;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--luna-gold-light);
}

.luna-title {
    margin: 0 0 16px;
    font-family: "Playfair Display", "Noto Sans JP", serif;
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.45;
    letter-spacing: 0.04em;
    color: #FFFFFF;
    text-shadow: 0 3px 16px rgba(0, 0, 0, 0.6);
}

.luna-lead {
    margin: 0 auto;
    max-width: 460px;
    font-size: 0.95rem;
    line-height: 1.95;
    color: var(--luna-ice-dim);
}

/* 秘密の部屋：見出し行 */
.luna-room-head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.luna-room-head .luna-title {
    margin: 0;
    font-size: 1.75rem;
}

.luna-room-sub {
    margin: 0 0 34px;
    text-align: center;
    font-size: 0.82rem;
    letter-spacing: 0.16em;
    font-family: "Playfair Display", "Noto Sans JP", serif;
    color: var(--luna-gold-light);
}

/* --------------------------------------------------------------------------
   6. 合言葉フォーム
   -------------------------------------------------------------------------- */
.luna-form {
    margin: 32px auto 0;
    max-width: 380px;
    text-align: left;
}

.luna-label {
    display: block;
    margin-bottom: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--luna-gold-light);
    text-align: center;
}

.luna-input {
    display: block;
    width: 100%;
    padding: 15px 18px;
    font-family: inherit;
    font-size: 16px; /* iOSで拡大表示されないよう16px以上 */
    color: #FFFFFF;
    text-align: center;
    letter-spacing: 0.14em;
    background: rgba(5, 11, 28, 0.85);
    border: 1.5px solid rgba(201, 162, 39, 0.55);
    border-radius: 12px;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
    -webkit-appearance: none;
    appearance: none;
}

.luna-input::placeholder {
    color: rgba(169, 189, 212, 0.65);
    letter-spacing: 0.06em;
}

.luna-input:focus {
    border-color: var(--luna-gold-light);
    background: rgba(5, 11, 28, 0.98);
    box-shadow: 0 0 0 4px rgba(242, 227, 166, 0.18);
}

.luna-btn {
    display: block;
    width: 100%;
    margin-top: 18px;
    padding: 16px 22px;
    font-family: inherit;
    font-size: 1.02rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #1B1405;
    background: linear-gradient(135deg, var(--luna-gold) 0%, var(--luna-gold-light) 100%);
    border: none;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(201, 162, 39, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.luna-btn:hover,
.luna-btn:focus {
    filter: brightness(1.08);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(201, 162, 39, 0.5);
}

.luna-btn:focus-visible {
    outline: 3px solid var(--luna-gold-light);
    outline-offset: 3px;
}

.luna-btn:active {
    transform: translateY(0);
}

/* エラー表示 */
.luna-error {
    margin: 16px 0 0;
    padding: 12px 16px;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.7;
    text-align: center;
    color: #FFD9D9;
    background: rgba(180, 40, 50, 0.28);
    border: 1px solid rgba(255, 140, 140, 0.55);
    border-radius: 10px;
}

.luna-error[hidden] {
    display: none;
}

/* フォームの揺れ（間違えたとき） */
@keyframes lunaShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(7px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(3px); }
}

.luna-form.is-shake {
    animation: lunaShake 0.45s ease;
}

/* --------------------------------------------------------------------------
   7. 秘密の部屋：3つのブロック
   -------------------------------------------------------------------------- */
.luna-block {
    margin: 0 0 22px;
    padding: 26px 26px 24px;
    background: rgba(10, 22, 47, 0.72);
    border: 1px solid rgba(201, 162, 39, 0.3);
    border-radius: 16px;
}

.luna-block:last-of-type {
    margin-bottom: 0;
}

.luna-block-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px;
    font-size: 1.12rem;
    font-weight: 800;
    line-height: 1.6;
    color: var(--luna-gold-light);
}

.luna-block-title i {
    font-size: 1rem;
    color: var(--luna-gold);
}

.luna-block-text {
    margin: 0 0 20px;
    font-size: 0.92rem;
    line-height: 1.95;
    color: var(--luna-ice-dim);
}

/* ツールを開くボタン */
.luna-tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 48px;
    padding: 14px 32px;
    font-size: 0.98rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    color: #1B1405;
    text-decoration: none;
    background: linear-gradient(135deg, var(--luna-gold) 0%, var(--luna-gold-light) 100%);
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(201, 162, 39, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.luna-tool-btn:hover,
.luna-tool-btn:focus {
    filter: brightness(1.08);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(201, 162, 39, 0.48);
    color: #1B1405;
}

.luna-tool-btn:focus-visible {
    outline: 3px solid var(--luna-gold-light);
    outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   8. 動画枠（16:9）
   -------------------------------------------------------------------------- */
.luna-video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.luna-video {
    margin: 0;
}

.luna-video-frame {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    background: #030A18;
    border: 1px solid rgba(201, 162, 39, 0.28);
    border-radius: 12px;
    overflow: hidden;
}

.luna-video-frame iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* 近日公開 */
.luna-video-soon {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--luna-ice-dim);
    background:
        radial-gradient(circle at 50% 40%, rgba(27, 54, 99, 0.85) 0%, rgba(3, 10, 24, 0.95) 70%);
}

.luna-video-soon i {
    font-size: 1.3rem;
    color: var(--luna-gold);
    opacity: 0.75;
}

.luna-video-title {
    margin: 10px 0 0;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.6;
    color: var(--luna-ice);
}

/* --------------------------------------------------------------------------
   9. お知らせ
   -------------------------------------------------------------------------- */
.luna-notice {
    margin: 0;
    padding: 16px 18px;
    font-size: 0.9rem;
    line-height: 1.9;
    color: var(--luna-ice);
    background: rgba(201, 162, 39, 0.1);
    border-left: 3px solid var(--luna-gold);
    border-radius: 8px;
}

/* --------------------------------------------------------------------------
   10. ページ下部
   -------------------------------------------------------------------------- */
.luna-footer {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    padding: 8px 18px 42px;
    text-align: center;
}

.luna-back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 12px 26px;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--luna-ice);
    text-decoration: none;
    background: rgba(10, 22, 47, 0.7);
    border: 1px solid rgba(201, 162, 39, 0.45);
    border-radius: 999px;
    transition: color 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.luna-back-link:hover,
.luna-back-link:focus {
    color: var(--luna-gold-light);
    border-color: var(--luna-gold-light);
    background: rgba(18, 36, 74, 0.9);
}

.luna-back-link:focus-visible {
    outline: 3px solid var(--luna-gold-light);
    outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   11. レスポンシブ（スマホ）
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
    .luna-main {
        padding: 34px 14px 28px;
    }

    .luna-card {
        padding: 32px 20px 28px;
        border-radius: 18px;
    }

    .luna-card--room {
        padding: 30px 18px 26px;
    }

    .luna-moon {
        width: 62px;
        height: 62px;
    }

    .luna-moon--inline {
        width: 26px;
        height: 26px;
    }

    .luna-eyebrow {
        font-size: 0.72rem;
        letter-spacing: 0.16em;
        margin: 14px 0 10px;
    }

    .luna-title {
        font-size: 1.42rem;
    }

    .luna-room-head .luna-title {
        font-size: 1.3rem;
    }

    .luna-lead {
        font-size: 0.9rem;
        line-height: 1.9;
    }

    .luna-form {
        margin-top: 26px;
    }

    .luna-block {
        padding: 22px 16px 20px;
    }

    .luna-block-title {
        font-size: 1.02rem;
        gap: 8px;
    }

    .luna-tool-btn {
        width: 100%;
        padding: 15px 18px;
    }

    .luna-video-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .luna-room-sub {
        font-size: 0.74rem;
        margin-bottom: 26px;
    }

    .luna-footer {
        padding-bottom: 34px;
    }

    .luna-back-link {
        width: 100%;
        max-width: 340px;
    }
}

/* 動きを減らす設定のユーザー向け */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .luna-stars,
    .luna-stars::after {
        animation: none;
    }

    .luna-btn,
    .luna-tool-btn,
    .luna-back-link,
    .luna-input {
        transition: none;
    }

    .luna-btn:hover,
    .luna-tool-btn:hover {
        transform: none;
    }

    .luna-form.is-shake {
        animation: none;
    }
}
