/* =========================================================
   クリスマスのテーマ（config/site_theme.php が 'xmas' のときだけ base.blade.php が読む）
   spec: docs/features/xmas-theme/spec.md（見た目の正は v5 モックの既定の組み合わせ）

   - ヘッダー（全画面）: .simple-header--xmas。星・吊りボールの入れ物は Blade の [data-xmas-illum] / [data-xmas-hang]、
     中身は public/assets/js/xmas-theme.js が描く
   - TOP だけ: body.page-top に限る（新規ユーザーのセクションは争奪戦の一覧にもあるため）
   - color-mix() は @supports の中だけ。外には単色の代わりを置く（iOS 16.2 未満）
   - 無限アニメ xmasStar / xmasOrbGlow / xmasCatchShine は idle-decor-pause.js の許可リストに載せてある
   ========================================================= */

/* ---- ヘッダー: クリスマスグリーンの地。本番の下の線（layout.css の border-bottom）は消し、影だけにする ----
   セーフエリア（上）は白: 地の色（background-color）を白にし、緑のグラデーションはセーフエリアの下（中身の上端）から下端までに敷く。
   iOS 26 Safari は画面上端の fixed 要素の background-color で時計の帯を塗るので、帯が白になる（theme-color も白。meta-tags.blade.php）。
   アプリ（WebView がステータスバーの下まで広がり --header-safe-top > 0）では、その高さの帯が白で、緑は中身の上端から始まる */
body.theme-xmas .simple-header.simple-header--xmas {
    background:
        linear-gradient(180deg, #23874A 0%, #176236 100%) 0 var(--header-safe-top, 0px) / 100% calc(100% - var(--header-safe-top, 0px)) no-repeat,
        #FFFFFF;
    border-bottom: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}
/* ロゴ: クリスマスの仮ロゴ（283×156）を高さ 46px で上下中央から 2px 下に（position: relative の top なので並びは変わらない）。
   光の筋は 1周年と同じ .metal-sheen（simple-header.blade.php。マスクはテーマのロゴ画像なのでクリスマスのロゴの形に流れる。
   止め方も同じ: 動きを減らす設定で止める・操作しないと idle-decor-pause.js が止める）。後ろにやわらかい暖かい光を足す */
body.theme-xmas .simple-header--xmas .logo-section {
    top: 2px;
    align-self: center;
}
body.theme-xmas .simple-header--xmas .logo-section .logo-svg {
    height: 46px;
    width: auto;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .35)) drop-shadow(0 0 4px rgba(255, 236, 170, .55));
}

/* 新規登録・ログイン: 色は今のまま、大きさだけ 76×34。通常のゲストの 2 ボタンだけ
   （新規登録強調版 .auth-buttons--promote は虹の輪と吹き出しの位置が崩れるので今の大きさのまま） */
body.theme-xmas .simple-header--xmas .auth-buttons:not(.auth-buttons--promote) {
    gap: 6px;
    align-items: center;
    align-self: center;
}
body.theme-xmas .simple-header--xmas .auth-buttons:not(.auth-buttons--promote) > .gummy-btn {
    width: 76px;
    min-height: 34px;
    height: 34px;
    font-size: 12.5px;
    border-radius: 17px;
    padding: 0 6px;
}

/* ---- 星・吊りボールの層。重なり順: ヘッダーの地 → 吊りボール（z-index: auto）→ 星（2）→ ロゴ・ボタン（4）。ボールはすべてロゴの後ろ。ボタン・カプセルの上の吊りボールもボタンの後ろ。タップは下へ通す ----
   層では切らない（overflow: visible・clip-path なし）。星・ボールの光はどの端でも自然に薄れて消え、
   ヘッダーの下へ数 px はみ出してよい。上端に触れないよう星の位置は xmas-theme.js で上に余白をとる */
.simple-header--xmas .xmas-illum,
.simple-header--xmas .xmas-hang {
    position: absolute;
    inset: 0;
    overflow: visible;
    pointer-events: none;
}
.simple-header--xmas .xmas-illum {
    z-index: 2;
}
.simple-header--xmas .xmas-illum span,
.simple-header--xmas .xmas-hang span {
    position: absolute;
    display: block;
}

/* きらめく星: 4 つの角の星。中心を白く光らせ、ゆっくり明滅する（暗いときも 0.7 倍・不透明度 .75 まで。2026-11-30 ユーザー指示「暗い時が結構暗い」） */
.simple-header--xmas .xmas-illum .xstar {
    width: var(--s);
    height: var(--s);
    margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
    background: radial-gradient(circle, #FFFFFF 0 10%, var(--c) 45%);
    clip-path: polygon(50% 0, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0 50%, 42% 42%);
    filter: drop-shadow(0 0 3px var(--c)) drop-shadow(0 0 1px rgba(255, 255, 255, .6));
    animation: xmasStar var(--d) ease-in-out infinite;
    animation-delay: var(--dl);
}
@supports (background: color-mix(in srgb, #000 50%, #fff)) {
    .simple-header--xmas .xmas-illum .xstar {
        background: radial-gradient(circle, #FFFFFF 0 10%, color-mix(in srgb, var(--c) 60%, #fff) 22%, var(--c) 45%);
    }
}
@keyframes xmasStar {
    0%, 100% { transform: scale(.7) rotate(0); opacity: .75; }
    50% { transform: scale(1) rotate(45deg); opacity: 1; }
}

/* 吊りボール: ヘッダーの上端から金の細い糸＋8px のボール。ボールの光がゆっくり明滅する。
   光は brightness 1〜1.25（暗いときも元の明るさ。2026-11-30 ユーザー指示）。開いたときの揺れは xmas-theme.js が Web Animations API で付ける（止まった後は揺らさない） */
.simple-header--xmas .xmas-hang .ob {
    top: 0;
    width: 1px;
    margin-left: -.5px;
    background: rgba(212, 175, 55, .85);
    transform-origin: 50% 0;
}
.simple-header--xmas .xmas-hang .ob::after {
    content: "";
    position: absolute;
    left: -3.5px;
    bottom: -7px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #FFFFFF 0, var(--c) 65%);
    box-shadow: 0 0 5px 1px var(--c);
    animation: xmasOrbGlow 3s ease-in-out infinite;
    animation-delay: var(--dl);
}
@supports (background: color-mix(in srgb, #000 50%, #fff)) {
    .simple-header--xmas .xmas-hang .ob::after {
        background: radial-gradient(circle at 35% 30%, #FFFFFF 0, color-mix(in srgb, var(--c) 40%, #fff) 25%, var(--c) 65%, color-mix(in srgb, var(--c) 70%, #000) 100%);
        box-shadow: 0 0 5px 1px color-mix(in srgb, var(--c) 70%, transparent), 0 0 10px 3px color-mix(in srgb, var(--c) 30%, transparent);
    }
}
@keyframes xmasOrbGlow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.25); }
}

/* 軽量モードでは星とボールの光をその位置で止める。動きを減らす設定では明滅を外す */
html.fc-decor-lite .simple-header--xmas .xmas-illum .xstar,
html.fc-decor-lite .simple-header--xmas .xmas-hang .ob::after {
    animation-play-state: paused;
}
@media (prefers-reduced-motion: reduce) {
    .simple-header--xmas .xmas-illum .xstar,
    .simple-header--xmas .xmas-hang .ob::after {
        animation: none;
    }
}

/* =========================================================
   TOP だけ（body.page-top）
   ========================================================= */

/* 背景: 赤いグラデーション（ダークモードでは今と同じく top.blade.php の規則で出さない） */
body.page-top.theme-xmas .top-gold-backdrop {
    background:
        radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, .14) 0%, transparent 55%),
        linear-gradient(180deg, #D7303C 0%, #B8202D 45%, #8A1420 100%);
}
/* ページの外側（引っぱったときのはみ出し）だけ濃い赤に。top.blade.php の金（html:not(.dark-mode-on):has(body.page-top)）に勝つ詳細度 */
html:not(.dark-mode-on):has(body.page-top.theme-xmas) {
    background: #8A1420;
}
/* 赤の上でもバナーのページ送りの丸が見えるように白と金に */
html:not(.dark-mode-on) body.page-top.theme-xmas .banner-carousel .swiper-pagination-bullet {
    background: rgba(255, 255, 255, .5);
    opacity: 1;
}
html:not(.dark-mode-on) body.page-top.theme-xmas .banner-carousel .swiper-pagination-bullet-active {
    background: #F2C94C;
}

/* ---- 新規ユーザーのセクション: 全体を均一な金（明るい金と濃い金が斜めに交互に入る模様。始まりと終わりを同じ色にしてつなぎ目を出さない） ---- */
body.page-top.theme-xmas .new-user-special-section {
    background: repeating-linear-gradient(115deg,
        #C9A633 0px, #E6CB62 90px, #FAF0BC 140px, #E3C75A 190px, #C4A02E 290px,
        #D8BB48 380px, #F1E098 440px, #D3B442 520px, #C9A633 600px);
    box-shadow: inset 0 1px 0 rgba(255, 246, 214, .9);
}
/* キャッチの淡い光（.gold-shine）は白い文字の上で見えないので出さない（代わりにリボンのシャイン） */
body.page-top.theme-xmas .new-user-special-section .gold-shine {
    display: none;
}
/* キャッチ: 濃い赤のリボン（金の細い縁）に白い文字 */
body.page-top.theme-xmas .new-user-special-section .new-user-catch__text {
    position: relative;
    display: inline-block;
    overflow: hidden;
    padding: 3px 14px 4px;
    border-radius: 999px;
    background: linear-gradient(180deg, #B8232F 0%, #8E1A24 100%);
    box-shadow: inset 0 0 0 1px rgba(242, 214, 120, .9), 0 2px 4px rgba(90, 20, 10, .3);
    color: #FFFFFF;
    -webkit-text-fill-color: #FFFFFF;
    font-weight: 800;
    letter-spacing: .04em;
    text-shadow: 0 1px 1px rgba(60, 0, 0, .5);
}
/* リボンを白い光の帯が斜めに横切る（2.8 秒に 1 回） */
body.page-top.theme-xmas .new-user-special-section .new-user-catch__text::after {
    content: "";
    position: absolute;
    top: -20%;
    bottom: -20%;
    left: 0;
    width: 42%;
    background: linear-gradient(105deg, transparent 0%, rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, .85) 50%, rgba(255, 255, 255, 0) 80%, transparent 100%);
    transform: translateX(-130%) skewX(-18deg);
    animation: xmasCatchShine 2.8s ease-in-out infinite;
    pointer-events: none;
}
@keyframes xmasCatchShine {
    0%, 35% { transform: translateX(-130%) skewX(-18deg); }
    75%, 100% { transform: translateX(300%) skewX(-18deg); }
}
html.fc-decor-lite body.page-top.theme-xmas .new-user-special-section .new-user-catch__text::after {
    animation-play-state: paused;
}
@media (prefers-reduced-motion: reduce) {
    body.page-top.theme-xmas .new-user-special-section .new-user-catch__text::after {
        display: none;
    }
}
/* タイトル: 白い文字に濃い赤の縁取り（8 方向）＋下の影 */
body.page-top.theme-xmas .new-user-special-section .new-user-main-title,
body.page-top.theme-xmas .new-user-special-section .new-user-title-chunk {
    color: #FFFFFF;
    -webkit-text-fill-color: #FFFFFF;
    text-shadow:
        1.5px 0 0 #7A1420, -1.5px 0 0 #7A1420, 0 1.5px 0 #7A1420, 0 -1.5px 0 #7A1420,
        1px 1px 0 #7A1420, -1px 1px 0 #7A1420, 1px -1px 0 #7A1420, -1px -1px 0 #7A1420,
        0 3px 4px rgba(90, 20, 10, .45);
}
/* 枠の見出し: 金の上で読めるよう濃い赤＋淡い光。左右の線は細く短く */
body.page-top.theme-xmas .new-user-special-section .new-user-slot-heading {
    color: #5E0E16;
    font-weight: 800;
    text-shadow: 0 0 3px #FFF6D6, 0 0 3px #FFF6D6, 0 0 1px #FFF6D6;
}
body.page-top.theme-xmas .new-user-special-section .new-user-slot-heading::before,
body.page-top.theme-xmas .new-user-special-section .new-user-slot-heading::after {
    height: 1px;
    max-width: 32px;
    background: rgba(122, 20, 32, .45);
}

/* ---- 起動時の打ち上げ: 画像に白い縁を付けて赤い背景でも見えるように（動き・回数は top-launch-confetti.js のまま） ---- */
body.page-top.theme-xmas .top-launch-confetti img {
    filter: drop-shadow(0 0 1.5px #fff) drop-shadow(0 0 1.5px #fff) drop-shadow(0 2px 3px rgba(0, 0, 0, .35));
}

/* ---- 雪: 画面全体の手前の canvas（xmas-theme.js が TOP だけに作る）。タップは下へ通す。打ち上げ（9997）より奥 ---- */
.xmas-snow {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9990;
}
html.fc-decor-lite .xmas-snow {
    display: none;
}
@media (prefers-reduced-motion: reduce) {
    .xmas-snow {
        display: none;
    }
}
