/*
 * ASTRAEA Academy — グローバル装飾 FX 用 CSS
 *   30 アイデアの軽量演出をまとめて配置。
 */

/* ============================================================
 * #1 マウスカーソル星屑
 * ============================================================ */
.astraea-cursor-spark {
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: radial-gradient(circle, #d6a37d 0%, #c89b7b 35%, rgba(200, 155, 123, .2) 75%, transparent 100%);
    box-shadow: 0 0 12px rgba(200, 155, 123, .55);
    transform: translate(-50%, -50%);
    animation: astraeaCursorFade 1100ms ease-out forwards;
}
@keyframes astraeaCursorFade {
    0%   { opacity: 1;  transform: translate(-50%, -50%) scale(.6); }
    20%  { opacity: 1;  transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0;  transform: translate(-50%, -50%) scale(.3); }
}

/* ============================================================
 * #2 薔薇花弁パーティクル
 * ============================================================ */
.astraea-petal {
    position: fixed;
    pointer-events: none;
    z-index: 9990;
    width: 14px; height: 14px;
    background: radial-gradient(ellipse 60% 100% at 50% 30%, #f5e6e0 0%, #e2bda3 80%, transparent 100%);
    border-radius: 60% 40% 60% 40% / 50% 60% 40% 50%;
    opacity: .85;
    will-change: transform, opacity;
}

/* ============================================================
 * #4 見出し一文字遅延（JS で .astraea-letter spans を生成）
 * ============================================================ */
.astraea-letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 1200ms cubic-bezier(.16, 1, .3, 1), transform 1200ms cubic-bezier(.16, 1, .3, 1);
}
.astraea-letter.is-shown { opacity: 1; transform: translateY(0); }

/* ============================================================
 * #5 数字カウントアップ用：CSS は不要、JS のみ
 * ============================================================ */

/* ============================================================
 * #6 時刻帯による色温度
 *   body.tod-morning / .tod-day / .tod-evening / .tod-night
 * ============================================================ */
body.tod-morning  { --color-line: #d4b896; }
body.tod-day      { --color-line: #d4b896; }
body.tod-evening  { --color-line: #d6a37d; }  /* やや赤金 */
body.tod-night    { --color-line: #b9b6c4; }  /* 銀 */

/* ============================================================
 * #25 季節モード（body.season-spring etc）
 *    アクセントカラーを微妙に振る
 * ============================================================ */
body.season-spring { --color-rose: #d99cb0; }
body.season-summer { --color-rose: #c89b7b; }  /* デフォルト */
body.season-autumn { --color-rose: #b8825a; }
body.season-winter { --color-rose: #a8a4ba; }

/* 季節ステッカー（フッター上部に小さく） */
.astraea-season-sticker {
    position: relative;
    text-align: center;
    padding: 16px 0 8px;
    font-family: 'Cinzel', serif;
    font-size: 10px;
    letter-spacing: .35em;
    color: var(--color-rose);
    text-transform: uppercase;
}

/* ============================================================
 * #7 羊皮紙パララックス（CSS のみ：背景固定）
 * ============================================================ */
.parchment-parallax {
    background-attachment: fixed !important;
}

/* ============================================================
 * #8 ボタン星軌跡 — .astraea-btn 全部に自動適用
 * ============================================================ */
.astraea-btn,
.astraea-btn-trail {
    overflow: visible !important;  /* layouts 側で overflow: hidden だったので解除 */
}
.astraea-btn::after,
.astraea-btn-trail::after {
    content: '✦';
    position: absolute;
    top: 50%; left: -20px;
    font-size: 12px;
    color: #c89b7b;
    opacity: 0;
    transform: translateY(-50%);
    transition: none;
    pointer-events: none;
}
.astraea-btn:hover::after,
.astraea-btn-trail:hover::after {
    animation: astraeaBtnTrail 1200ms ease-out forwards;
}
@keyframes astraeaBtnTrail {
    0%   { opacity: 0; left: -20px; }
    20%  { opacity: 1; }
    100% { opacity: 0; left: calc(100% + 20px); }
}

/* #22 ページ遷移足音 ─ 撤去済（うるさいため） */

/* ============================================================
 * #23 インク染み（最初の段落 ::before）
 * ============================================================ */
.astraea-ink-stain {
    position: relative;
}
.astraea-ink-stain::before {
    content: '✦';
    position: absolute;
    left: -28px;
    top: .2em;
    font-size: 18px;
    color: var(--color-rose);
    opacity: 0;
    animation: astraeaInkBloom 1.8s ease-out .5s forwards;
}
@keyframes astraeaInkBloom {
    0%   { opacity: 0; transform: scale(.3); filter: blur(4px); }
    60%  { opacity: 1; transform: scale(1.2); filter: blur(0); }
    100% { opacity: .8; transform: scale(1); }
}

/* #20 朗読モード ─ 撤去済 */

/* ============================================================
 * #10 島の音（擬音ティッカー）
 * ============================================================ */
.astraea-soundtext {
    position: fixed;
    bottom: 16px; left: 20px;
    z-index: 80;
    font-family: 'Noto Serif JP', serif;
    font-size: 11px;
    letter-spacing: .3em;
    color: rgba(106, 88, 72, .55);
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.2s;
}
.astraea-soundtext.is-shown { opacity: 1; }

/* ============================================================
 * #9 「今日の島」ウィジェット（home top）
 * ============================================================ */
.island-today {
    max-width: 720px; margin: 32px auto 0;
    padding: 18px 28px;
    background: linear-gradient(120deg, rgba(255,255,255,.85), rgba(245,239,229,.7));
    border: 1px solid var(--color-line);
    border-radius: 4px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 18px; align-items: center;
    font-family: 'Noto Serif JP', serif;
    box-shadow: 0 6px 20px rgba(58, 40, 24, .06);
}
.island-today-date {
    text-align: center;
    border-right: 1px solid var(--color-line);
    padding-right: 18px;
}
.island-today-date .m { font-family: 'Cinzel', serif; font-size: 11px; color: var(--color-rose); letter-spacing: .25em; }
.island-today-date .d { font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 32px; color: var(--color-ink); line-height: 1; }
.island-today-text { font-size: 13px; line-height: 1.85; color: var(--color-ink-soft); }
.island-today-text .label { font-family: 'Cinzel', serif; font-size: 9px; letter-spacing: .25em; color: var(--color-rose); margin-right: 6px; }

/* ============================================================
 * #17 ─ 扉演出は廃止。
 *   hub セルのスタイルは home.blade.php の既存スタイル
 *  （左端に金の縦線が伸びる・矢印が右へ進む・薄背景に変わる）
 *   に任せる。FX 側では何もしない。
 * ============================================================ */

/* ============================================================
 * #29 「在学生たちの今」ライブ
 * ============================================================ */
.cast-live {
    max-width: 1100px; margin: 56px auto 0;
    padding: 28px;
    background: linear-gradient(135deg, rgba(250,247,242,.95), rgba(245,239,229,.85));
    border: 1px solid var(--color-line);
}
.cast-live-head {
    text-align: center; margin-bottom: 22px;
}
.cast-live-head .en { font-family: 'Cinzel', serif; font-size: 11px; letter-spacing: .35em; color: var(--color-rose); text-transform: uppercase; }
.cast-live-head .jp { font-family: 'Noto Serif JP', serif; font-size: 17px; margin-top: 6px; letter-spacing: .15em; }
.cast-live-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.cast-live-item {
    text-align: center; padding: 14px 8px;
    border: 1px solid rgba(212,184,150,.3);
    border-radius: 4px;
    transition: all .3s;
}
.cast-live-item:hover { border-color: var(--color-rose); background: rgba(255,255,255,.5); }
.cast-live-name { font-family: 'Noto Serif JP', serif; font-size: 13px; font-weight: 600; color: var(--color-ink); letter-spacing: .1em; }
.cast-live-loc  { font-family: 'Noto Serif JP', serif; font-size: 11px; color: var(--color-ink-soft); margin-top: 6px; letter-spacing: .08em; }
.cast-live-loc::before { content: '◆ '; color: var(--color-rose); font-size: 9px; }
@media (max-width: 760px) {
    .cast-live-grid { grid-template-columns: repeat(2, 1fr); }
}

/* #14 ご来訪の記録 ─ 撤去済 */

/* ============================================================
 * #19 鍵束ナビ ─ 5 キャストの紋章＋1 隠し
 * ============================================================ */
.keyring {
    display: flex; justify-content: center; gap: 18px;
    flex-wrap: wrap;              /* 狭幅では折り返す（横潰れ＝縦長楕円化を防ぐ） */
    padding: 28px 0 14px;
    margin-top: 12px;
    border-top: 1px solid rgba(212, 184, 150, .25);
}
.keyring-item {
    width: 56px; height: 56px;
    flex: 0 0 auto;              /* 絶対に縮ませない（実機で縦長楕円になる原因を根絶） */
    aspect-ratio: 1 / 1;         /* 万一の高さ計算差でも正円を保証 */
    border-radius: 50%;
    border: 1px solid var(--color-line);
    display: flex; align-items: center; justify-content: center;
    font-family: 'Cinzel', serif; font-size: 11px; letter-spacing: .15em;
    color: var(--color-rose-deep);
    /* 紋章の繊細な金線がはっきり見える薄ベージュ背景 */
    background: radial-gradient(circle at 30% 25%, #fbf4e6 0%, #ede0c8 100%);
    transition: all .3s;
    overflow: hidden;
    padding: 4px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 2px 6px rgba(58,40,24,.08);
}
.keyring-item img {
    width: 100%; height: 100%;
    object-fit: contain;
    opacity: 1;
    filter: brightness(.95) contrast(1.1);
    transition: opacity .3s, transform .4s;
}
.keyring-item:hover {
    transform: rotate(-6deg) scale(1.12);
    border-color: var(--color-rose);
    color: var(--color-rose);
    box-shadow: 0 6px 16px rgba(154, 112, 80, .28);
}
.keyring-item:hover img { opacity: 1; transform: scale(1.08); }

/* スマホでは鍵束アイコンを一回り小さく・間隔を詰めて 5 個を 1 行に収める
   （※ .keyring-item のベース定義より後に置くこと。前に置くと source order で負ける） */
@media (max-width: 480px) {
    .keyring { gap: 10px; }
    .keyring-item { width: 46px; height: 46px; padding: 3px; }
}

/* ============================================================
 * #21 今夜の星空 ミニ
 * ============================================================ */
.sky-mini {
    position: fixed;
    bottom: 88px; right: 24px;
    z-index: 70;
    width: 140px; height: 90px;
    background: linear-gradient(180deg, #0a1428, #1a2640);
    border: 1px solid rgba(226,189,163,.3);
    border-radius: 6px;
    overflow: hidden;
    opacity: .85;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
    transition: opacity .3s;
}
.sky-mini:hover { opacity: 1; }
.sky-mini-label {
    position: absolute; bottom: 4px; left: 6px;
    font-family: 'Cinzel', serif;
    font-size: 8px; letter-spacing: .25em;
    color: rgba(255,255,255,.6);
}
.sky-mini svg { width: 100%; height: 100%; }
.sky-mini-star { fill: #f5e6d5; }
.sky-mini-line { stroke: rgba(226,189,163,.4); stroke-width: .4; }

/* #18 占い結果モーダル ─ 撤去済 */

/* ============================================================
 * #13 シリアル番号
 * ============================================================ */
.serial-no {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 11px;
    letter-spacing: .25em;
    color: var(--color-rose-pale);
    text-align: center;
    margin-top: 24px;
    cursor: pointer;
    user-select: none;
}
.serial-no:hover { color: var(--color-rose); }
.serial-secret {
    font-family: 'Noto Serif JP', serif;
    font-size: 11px;
    color: var(--color-rose-deep);
    margin-top: 6px;
    opacity: 0;
    height: 0; overflow: hidden;
    transition: opacity .6s;
}
.serial-secret.is-shown { opacity: 1; height: auto; padding-top: 8px; }

/* ============================================================
 * #24 立ち絵呼吸（students 個別ページ）
 * ============================================================ */
.student-photo img {
    animation: astraeaBreathe 8s ease-in-out infinite alternate;
}
@keyframes astraeaBreathe {
    from { transform: scale(1) translateY(0); }
    to   { transform: scale(1.015) translateY(-2px); }
}

/* ============================================================
 * #26 本土便ダイヤ
 * ============================================================ */
.ferry-timer {
    display: inline-block;
    padding: 14px 22px;
    background: linear-gradient(120deg, rgba(245,239,229,.8), rgba(250,247,242,.6));
    border: 1px solid var(--color-line);
    border-radius: 4px;
    font-family: 'Noto Serif JP', serif;
    font-size: 13px;
    color: var(--color-ink);
    letter-spacing: .08em;
    line-height: 1.6;
}
.ferry-timer .label { font-family: 'Cinzel', serif; font-size: 10px; letter-spacing: .3em; color: var(--color-rose); display: block; margin-bottom: 6px; }
.ferry-timer .count { font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 22px; color: var(--color-rose-deep); }

/* #27 「研鑽中」ライブ ─ 撤去済（2026-07-05） */

/* ============================================================
 * パンくず：金色のセパレータ装飾
 * ============================================================ */
.bread-deco { font-style: italic; color: var(--color-rose-pale); margin: 0 8px; }

@media (prefers-reduced-motion: reduce) {
    .astraea-cursor-spark, .astraea-petal, .student-photo img,
    .astraea-btn-trail::after { display: none !important; animation: none !important; }
    .pulse-dot { animation: none !important; }
}
