:root {
    --bg: #0a0a0f;
    --surface: #13131a;
    --surface2: #1c1c26;
    --border: rgba(255,255,255,0.07);
    --text: #f0f0f5;
    --muted: #6b6b80;
    --tower-color: #6c8fff;
    --tower-bg: rgba(108,143,255,0.08);
    --tower-border: rgba(108,143,255,0.3);
    --surugadai-color: #4dd9a0;
    --surugadai-bg: rgba(77,217,160,0.08);
    --surugadai-border: rgba(77,217,160,0.3);
    --funabashi-color: #ff8c5a;
    --funabashi-bg: rgba(255,140,90,0.08);
    --funabashi-border: rgba(255,140,90,0.3);
    --accent: #6c8fff;
    --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Noto Sans JP', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    padding: 0 0 env(safe-area-inset-bottom) 0;
}

/* ── ノイズ背景 ── */
body::before {
    content: '';
    position: fixed; inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none; z-index: 0;
}

.wrap { max-width: 480px; margin: 0 auto; padding: 24px 16px; position: relative; z-index: 1; }

/* ── レスポンシブ ── */
@media (min-width: 768px) {
    .wrap { max-width: 760px; padding: 40px 32px; }
    .logo { font-size: 2.6rem; }
    .subtitle { font-size: 0.92rem; }
    .card { padding: 28px; }
    .form-grid { grid-template-columns: 1fr 1fr 2fr; }
    .form-full { grid-column: auto; }
    /* .room-grid の列数は「教室カード」節の末尾で定義（基本ルールより後に置かないと負ける） */
}
@media (min-width: 1100px) {
    .wrap { max-width: 1100px; padding: 48px 40px; }
    .page-cols { display: grid; grid-template-columns: 320px 1fr; gap: 32px; align-items: start; }
    .sidebar { position: sticky; top: 28px; }
    .logo { font-size: 2.8rem; }
    /* .room-grid の列数は「教室カード」節の末尾で定義 */
    .modal { border-radius: 20px; max-width: 460px; margin: auto; }
    .modal-overlay { align-items: center; }
}

/* ── ヘッダー ── */
header { margin: 8px 0 30px; }
.logo {
    font-family: 'Syne', sans-serif;
    font-size: 2rem; font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #fff 0%, var(--accent) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
    user-select: none;
    -webkit-user-select: none;
}
.logo span {
    font-weight: 700; font-size: 1.1rem;
    /* iOS Safari は background-clip:text の親の中で opacity を使った子要素を描かないことがある。
       そのためスマホで「β」が消えていた。親のグラデーションに頼らず、自前の色を塗る */
    -webkit-text-fill-color: rgba(108,143,255,0.6); color: rgba(108,143,255,0.6);
}
.logo-link { text-decoration: none; display: inline-block; }
.subtitle { color: var(--muted); font-size: 0.82rem; margin-top: 6px; letter-spacing: 0.03em; }

/* ── 現在時刻バッジ ── */
.now-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--surface2); border: 1px solid var(--border);
    border-radius: 99px; padding: 5px 12px; font-size: 0.78rem;
    color: var(--muted); margin-top: 14px;
}
.now-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: #4dd9a0; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }

/* ── 検索フォーム ── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.form-full { grid-column: 1 / -1; }

label { display: block; font-size: 0.72rem; font-weight: 700; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 6px; }

select {
    width: 100%; padding: 12px 14px;
    background: var(--surface2); border: 1px solid var(--border);
    border-radius: 10px; color: var(--text); font-size: 0.95rem;
    font-family: 'Noto Sans JP', sans-serif;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b6b80' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
    cursor: pointer; transition: border-color 0.2s;
}
select:focus { outline: none; border-color: var(--accent); }

.btn-search {
    width: 100%; padding: 15px;
    background: var(--accent);
    border: none; border-radius: 10px;
    color: #fff; font-size: 1rem; font-weight: 700;
    font-family: 'Noto Sans JP', sans-serif;
    cursor: pointer; letter-spacing: 0.04em;
    transition: opacity 0.2s, transform 0.1s;
    position: relative; overflow: hidden;
}
.btn-search:active { transform: scale(0.98); }
.btn-search:hover { opacity: 0.88; }

/* ── 報告済み教室スタイル ── */
.room-card.reported {
    opacity: 0.45;
    filter: grayscale(0.6);
    cursor: not-allowed;
}
.room-card.reported .room-number { text-decoration: line-through; }
.reported-badge {
    position: absolute; top: 6px; right: 6px;
    font-size: 0.52rem; font-weight: 700; padding: 2px 5px;
    border-radius: 4px; background: rgba(255,80,80,0.15);
    color: #ff6060; border: 1px solid rgba(255,80,80,0.3);
    line-height: 1.4;
}
.btn-report {
    width: 100%; margin-top: 12px; padding: 11px;
    background: rgba(255,80,80,0.08); border: 1px solid rgba(255,80,80,0.25);
    border-radius: 10px; color: #ff6060; font-size: 0.85rem; font-weight: 700;
    font-family: 'Noto Sans JP', sans-serif; cursor: pointer;
    transition: background 0.2s;
}
.btn-report:hover { background: rgba(255,80,80,0.15); }
.report-count-note {
    font-size: 0.72rem; color: var(--muted); text-align: center;
    margin-top: 8px;
}

/* ── 免責事項バナー ── */
.disclaimer {
    display: flex; align-items: flex-start; gap: 10px;
    background: rgba(255,200,60,0.06);
    border: 1px solid rgba(255,200,60,0.2);
    border-radius: 10px; padding: 12px 14px;
    font-size: 0.78rem; color: #b8a060;
    line-height: 1.6; margin-bottom: 14px;
}
.disclaimer-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
/* いま以外の年度・学期を見ているときの注意。危険ではないので青系にする */
.disclaimer.past-view {
    background: rgba(108,143,255,0.07);
    border-color: rgba(108,143,255,0.28);
    color: #8ea6ff;
}
.disclaimer.past-view strong { color: var(--text); }

/* ── 結果ヘッダー ── */
.result-meta {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 14px;
}
.result-label { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.count-chip {
    font-family: 'Syne', sans-serif; font-size: 0.9rem; font-weight: 700;
    background: var(--surface2); border: 1px solid var(--border);
    padding: 4px 12px; border-radius: 99px; color: var(--text);
}
.count-chip em { color: var(--accent); font-style: normal; }

/* ── 検索フィードバック（更新が分かるように） ── */
.btn-search.loading { pointer-events: none; }
.btn-search .btn-in { display: inline-flex; align-items: center; justify-content: center; gap: 9px; }
.btn-search .spinner {
    width: 15px; height: 15px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.45); border-top-color: #fff;
    display: none; animation: btnspin 0.7s linear infinite;
}
.btn-search.loading .spinner { display: inline-block; }
@keyframes btnspin { to { transform: rotate(360deg); } }

.result-meta { scroll-margin-top: 18px; border-radius: 12px; }
@keyframes resultFlash {
    0%   { box-shadow: 0 0 0 0 rgba(108,143,255,0); background: rgba(108,143,255,0); }
    18%  { box-shadow: 0 0 0 3px rgba(108,143,255,0.45); background: rgba(108,143,255,0.14); }
    100% { box-shadow: 0 0 0 0 rgba(108,143,255,0); background: rgba(108,143,255,0); }
}
.result-meta.flash { padding: 8px 12px; margin: -8px -12px 6px; animation: resultFlash 1.8s ease-out; }
@keyframes chipPop {
    0%   { transform: scale(1);    box-shadow: 0 0 0 0 rgba(108,143,255,0); }
    30%  { transform: scale(1.2);  box-shadow: 0 0 0 5px rgba(108,143,255,0.35); }
    100% { transform: scale(1);    box-shadow: 0 0 0 0 rgba(108,143,255,0); }
}
.count-chip.pop { animation: chipPop 0.8s ease-out; }

/* ── 校舎セクション ── */
.building-section { margin-bottom: 20px; }
.building-label {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em;
    text-transform: uppercase; margin-bottom: 10px;
    padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.building-label .badge {
    font-size: 0.68rem; padding: 2px 8px; border-radius: 99px; font-weight: 700;
}
.badge-tower    { background: var(--tower-bg);     color: var(--tower-color);     border: 1px solid var(--tower-border); }
.badge-surugadai{ background: var(--surugadai-bg); color: var(--surugadai-color); border: 1px solid var(--surugadai-border); }
.badge-funabashi{ background: var(--funabashi-bg); color: var(--funabashi-color); border: 1px solid var(--funabashi-border); }

/* ── 教室カード ── */
/* 列は minmax(0, 1fr)。1fr だけだと「S1704/07/13/16」「521/2/3/4/5/7/8/9/10」のような
   折り返し位置のない教室名が列を押し広げ、スマホ幅で右にはみ出す */
.room-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 340px)  { .room-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 768px)  { .room-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .room-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; } }

.room-card {
    border-radius: 10px; padding: 12px 8px;
    text-align: center; cursor: pointer;
    transition: transform 0.15s, opacity 0.15s;
    border: 1px solid transparent;
    position: relative;
    min-width: 0;
}
.room-card:active { transform: scale(0.96); }

.room-card.tower     { background: var(--tower-bg);     border-color: var(--tower-border); }
.room-card.surugadai { background: var(--surugadai-bg); border-color: var(--surugadai-border); }
.room-card.funabashi { background: var(--funabashi-bg); border-color: var(--funabashi-border); }

.room-number {
    font-family: 'Syne', sans-serif; font-size: 1.15rem; font-weight: 700;
    display: block; line-height: 1.2;
    overflow-wrap: anywhere;  /* 長い教室名はカード内で折り返す */
}
.room-card.tower     .room-number { color: var(--tower-color); }
.room-card.surugadai .room-number { color: var(--surugadai-color); }
.room-card.funabashi .room-number { color: var(--funabashi-color); }

.room-bldg { font-size: 0.65rem; color: var(--muted); margin-top: 3px; display: block; overflow-wrap: anywhere; }
/* 何限まで続けて空いているか。空き時間が長い教室ほど使いやすいので目に入る位置に */
.room-span {
    display: inline-block; margin-top: 4px;
    font-size: 0.62rem; font-weight: 700; letter-spacing: 0.02em;
    padding: 1px 7px; border-radius: 99px;
    background: rgba(255,255,255,0.08); color: var(--text);
}

/* ── モーダル（教室の1週間へのリンクと報告） ── */
.modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(6px);
    z-index: 100; align-items: flex-end; justify-content: center;
}
.modal-overlay.open { display: flex; }

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px 20px 0 0;
    padding: 28px 24px 36px;
    width: 100%; max-width: 480px;
    animation: slideUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.modal-handle { width: 40px; height: 4px; background: var(--border); border-radius: 2px; margin: 0 auto 20px; }
.modal-title { font-family: 'Syne', sans-serif; font-size: 1.3rem; font-weight: 800; margin-bottom: 6px; }
.modal-room-info { color: var(--muted); font-size: 0.85rem; margin-bottom: 20px; }

.modal-actions { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 18px; }
.btn-cancel {
    padding: 13px; background: var(--surface2); border: 1px solid var(--border);
    border-radius: 10px; color: var(--muted); font-size: 0.9rem; font-weight: 700;
    font-family: 'Noto Sans JP', sans-serif; cursor: pointer;
}
/* ── キャンセルコード表示 ── */
.cancel-code-box {
    background: rgba(108,143,255,0.08); border: 1px solid rgba(108,143,255,0.3);
    border-radius: 10px; padding: 14px; margin-top: 14px; text-align: center;
}
.cancel-code-label { font-size: 0.72rem; color: var(--muted); margin-bottom: 6px; }
.cancel-code-value {
    font-family: 'Syne', sans-serif; font-size: 1.8rem; font-weight: 800;
    color: var(--tower-color); letter-spacing: 0.15em;
}
.cancel-code-note { font-size: 0.72rem; color: var(--muted); margin-top: 6px; }

/* ── トースト ── */
.toast {
    display: none; position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%);
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 99px; padding: 10px 20px; font-size: 0.85rem;
    color: var(--text); z-index: 200; white-space: nowrap;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.toast.show { display: block; animation: fadeInOut 2.5s ease forwards; }
@keyframes fadeInOut {
    0%{opacity:0;transform:translateX(-50%) translateY(10px)}
    15%{opacity:1;transform:translateX(-50%) translateY(0)}
    75%{opacity:1}
    100%{opacity:0}
}

/* ── 空き無し ── */
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); font-size: 0.9rem; }
.empty-state .icon { font-size: 2.5rem; display: block; margin-bottom: 10px; }

/* ── 公式サービスとの誤認防止のための常設表記 ── */
.compliance-footer {
    margin-top: 24px; padding: 16px 0 32px;
    font-size: 0.7rem; color: var(--muted); text-align: center; line-height: 1.6;
}

/* ── 試験運用中・大学公式ではないことの控えめ表記（文言は 2026-10-22 に学生課が提案） ── */
.test-banner {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 20px;
    font-size: 0.72rem; color: var(--muted); line-height: 1.5;
    word-break: auto-phrase;   /* 長い文なので、言葉の途中で折り返さない */
}
.test-tag {
    flex-shrink: 0; font-family: 'Syne', sans-serif; font-weight: 700;
    font-size: 0.56rem; letter-spacing: 0.1em;
    background: var(--surface2); color: var(--muted);
    border: 1px solid var(--border);
    padding: 3px 7px; border-radius: 5px;
}
.test-banner strong { color: #9a9ab0; font-weight: 600; }

/* ── 使い方フッター ── */
.help-footer {
    margin-top: 40px; padding-top: 24px;
    border-top: 1px solid var(--border);
}
.help-title {
    font-size: 0.72rem; font-weight: 700; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 14px;
}
.help-item {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 12px 0; border-bottom: 1px solid var(--border);
}
.help-item:last-child { border-bottom: none; }
.help-icon {
    width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
}
.help-icon.blue  { background: var(--tower-bg);     border: 1px solid var(--tower-border); }
.help-icon.green { background: var(--surugadai-bg); border: 1px solid var(--surugadai-border); }
.help-icon.red   { background: rgba(255,80,80,0.08); border: 1px solid rgba(255,80,80,0.25); }
.help-icon.yellow{ background: rgba(255,200,60,0.08); border: 1px solid rgba(255,200,60,0.2); }
.help-text-title { font-size: 0.85rem; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.help-text-desc  { font-size: 0.75rem; color: var(--muted); line-height: 1.6; }

/* ── エラー ── */
.error-card { background: rgba(255,80,80,0.08); border: 1px solid rgba(255,80,80,0.2); border-radius: var(--radius); padding: 16px; color: #ff6060; font-size: 0.85rem; }
.modal-week-link { display: inline-block; margin: -6px 0 14px; font-size: 13px; color: var(--accent); text-decoration: none; }
details.biweekly { margin-top: 18px; border: 1px dashed var(--border); border-radius: var(--radius); padding: 12px 14px; font-size: 13px; color: var(--muted); }
details.biweekly summary { cursor: pointer; color: var(--text); }
details.biweekly summary em { font-style: normal; color: var(--accent); font-weight: 700; }
details.biweekly p { margin: 8px 0; line-height: 1.6; }
.biweekly-list { display: flex; flex-wrap: wrap; gap: 6px; }
.biweekly-list a { padding: 6px 10px; border-radius: 10px; background: var(--surface2); color: var(--text); text-decoration: none; font-weight: 700; }
.biweekly-list small { margin-left: 6px; color: var(--muted); font-weight: 400; font-size: 11px; }
.result-note { display: block; color: var(--text); font-weight: 700; margin-bottom: 2px; }

/* ── 教室から探す ── */
.room-search label { margin-bottom: 8px; }
.room-search-row { display: flex; gap: 8px; }
.room-search input[type=search] {
    flex: 1; min-width: 0; padding: 12px 14px;
    background: var(--surface2); border: 1px solid var(--border); border-radius: 10px;
    color: var(--text); font-size: 16px; /* 16px 未満だと iPhone が勝手に拡大する */
    font-family: 'Noto Sans JP', sans-serif; -webkit-appearance: none; appearance: none;
}
.room-search input[type=search]:focus { outline: none; border-color: var(--accent); }
.room-search-btn {
    flex: none; padding: 0 14px; border-radius: 10px; border: 1px solid var(--accent);
    background: transparent; color: var(--accent); font-weight: 700; font-size: 0.88rem;
    font-family: 'Noto Sans JP', sans-serif; cursor: pointer; white-space: nowrap;
}
.room-search-btn:active { transform: scale(0.97); }
/* PC の Chrome/Safari は datalist の ▼ の幅を常に空けるので、例示の文字が切れる。▼ は隠す（補完は出る） */
.room-search input::-webkit-calendar-picker-indicator { display: none !important; }
.room-search input::-webkit-list-button { display: none; }
/* 「個別の教室を検索」: 主ボタンより控えめだが、ただの文字リンクより目立つ（淡い色の枠付き） */
.room-search-link {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    margin-top: 10px; padding: 11px 14px; border-radius: 10px;
    border: 1px solid rgba(108,143,255,0.45); background: rgba(108,143,255,0.10);
    color: var(--accent); font-size: 0.95rem; font-weight: 700; text-decoration: none;
    transition: background 0.2s;
}
.room-search-link:hover { background: rgba(108,143,255,0.18); }
.room-search-link:active { transform: scale(0.98); }
.room-search-link .arrow { transition: transform 0.2s; }
.room-search-link:hover .arrow { transform: translateX(3px); }
.room-recent { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.room-recent[hidden] { display: none; }
.room-recent-label { font-size: 0.72rem; color: var(--muted); margin-right: 2px; }
.room-recent-chips { display: contents; }
.room-chip {
    display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 99px; font-size: 0.82rem; font-weight: 700;
    text-decoration: none; color: var(--text); background: var(--surface2); border: 1px solid var(--border);
}
.room-chip.tower     { color: var(--tower-color);     border-color: var(--tower-border); }
.room-chip.surugadai { color: var(--surugadai-color); border-color: var(--surugadai-border); }
.room-chip.funabashi { color: var(--funabashi-color); border-color: var(--funabashi-border); }

/* ── 使った目的のワンタップ調査（任意・匿名。2026-10-25） ── */
.purpose-bar {
    position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    margin: 2px 0 14px; padding: 10px 36px 10px 12px;
    background: var(--surface); border: 1px solid rgba(108,143,255,0.22); border-radius: 12px;
}
.purpose-bar[hidden], .purpose-chips[hidden], .purpose-thanks[hidden] { display: none; }
.purpose-q { font-weight: 700; font-size: 0.82rem; white-space: nowrap; margin-right: 4px; }
.purpose-q small { margin-left: 6px; font-weight: 500; font-size: 0.66rem; color: var(--muted); }
.purpose-close {
    position: absolute; top: 4px; right: 4px; background: none; border: none; color: var(--muted);
    font-size: 1.05rem; line-height: 1; padding: 6px 8px; cursor: pointer;
}
.purpose-chips { display: contents; }   /* 問いと選択肢を同じ行に流して、帯を低く保つ */
.purpose-chips button {
    font: inherit; font-size: 0.74rem; color: var(--text); cursor: pointer;
    background: var(--surface2); border: 1px solid var(--border); border-radius: 99px; padding: 6px 11px;
    transition: border-color .15s, background .15s;
}
.purpose-chips button:hover, .purpose-chips button:focus-visible { border-color: var(--accent); background: rgba(108,143,255,0.12); }
.purpose-thanks { font-size: 0.78rem; color: var(--surugadai-color); }
.disclaimer.below-results { margin-top: 32px; }

/* ── 期間限定の見た目：ハロウィーン（app.py の SEASON_THEMES。表記・注意書き・校舎の色は変えない。
      飾り・帯・スイッチは季節のクラスが付いているときだけ出す。利用者がスイッチで切ると通常に戻る） ── */
.season-deco, .season-ribbon, .logo-season, .icon-season { display: none; }
/* 飾りは季節ごとに s-<名前> を付け、選んでいる見た目のものだけ出す（2026-11-07〜 通常｜🎃｜🎄 の切り替え） */
.theme-halloween .season-deco.s-halloween { display: block; }
.theme-halloween .season-ribbon.s-halloween { display: inline-flex; }
.theme-halloween .logo-season.s-halloween { display: inline-block; }
.theme-halloween .icon-season.s-halloween { display: inline; }
.theme-halloween .icon-normal { display: none; }

.theme-halloween {
    --bg: #120a1f; --surface: rgba(30,18,48,0.92); --surface2: #2a1942;
    --border: rgba(251,146,60,0.20); --muted: #a891c7; --accent: #f97316;
    background:
        radial-gradient(700px 520px at 0% 100%, rgba(249,115,22,0.16), transparent 70%),
        radial-gradient(640px 520px at 100% 55%, rgba(124,58,237,0.22), transparent 70%),
        linear-gradient(180deg, #0d0719 0%, #1a0f30 45%, #120a1f 100%);
    background-color: #0d0719;   /* 引っ張ったときの画面の外（iOS のはみ出し）を白にしない */
    background-attachment: fixed;
}
/* 画面の外の色は html の背景で決まる。通常は黒、ハロウィーンは夜の紫にそろえる */
html { background-color: #0a0a0f; }
html:has(> body.theme-halloween) { background-color: #0d0719; }
.theme-halloween .card { box-shadow: 0 0 0 1px rgba(251,146,60,0.10), 0 18px 40px rgba(0,0,0,0.45); }
.theme-halloween .logo { background: linear-gradient(135deg, #fff 0%, #fb923c 65%, #fde047 100%); -webkit-background-clip: text; background-clip: text; }
.theme-halloween .logo span { -webkit-text-fill-color: rgba(251,146,60,0.8); color: rgba(251,146,60,0.8); }
.logo-season { font-size: 1.7rem; margin-left: 6px; vertical-align: 6px; animation: seasonWobble 3.2s ease-in-out infinite; }
.theme-halloween .btn-search {
    background: linear-gradient(90deg, #ea580c, #f97316 40%, #fb923c); color: #1b0f38;
    box-shadow: 0 0 0 1px rgba(253,186,116,0.35), 0 8px 26px rgba(249,115,22,0.45);
}
.theme-halloween .btn-search .btn-text::before { content: '👻 '; }
.theme-halloween select:focus { border-color: #fb923c; }
.theme-halloween .room-search-link { border-color: rgba(251,146,60,0.45); background: rgba(249,115,22,0.08); }
.theme-halloween .now-badge .dot { background: #fb923c; }
.theme-halloween .room-card { box-shadow: inset 0 -3px 0 rgba(249,115,22,0.18); }

/* ヘッダーの帯（1行の控えめな帯。運営が最初の版を採用） */
.season-ribbon {
    margin-top: 14px; flex-wrap: wrap; align-items: center; gap: 4px 8px;
    padding: 8px 14px; border-radius: 12px; font-size: 0.82rem; font-weight: 700; color: #fde68a;
    background: rgba(249,115,22,0.12); border: 1px solid rgba(251,146,60,0.35);
}
.season-ribbon b { color: #fb923c; }
.season-ribbon-sub { font-weight: 500; color: #d8b4fe; font-size: 0.76rem; }

/* 背景の飾り：月・クモの巣・飛ぶコウモリ・ただようおばけ・かぼちゃ */
.season-deco { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.season-deco .moon {
    position: absolute; right: 7%; top: 64px; width: 92px; height: 92px; border-radius: 50%;
    background: radial-gradient(circle at 38% 36%, #fffbe6, #fde68a 55%, #f59e0b);
    box-shadow: 0 0 60px 18px rgba(253,224,71,0.22); opacity: 0.85;
}
.season-deco .web { position: absolute; width: 200px; height: 200px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200' fill='none' stroke='%23d8b4fe' stroke-width='1.4' stroke-opacity='0.55'%3E%3Cpath d='M0 0L200 0M0 0L200 70M0 0L170 170M0 0L70 200M0 0L0 200'/%3E%3Cpath d='M40 0Q36 14 37 30Q24 30 14 37Q8 22 0 40'/%3E%3Cpath d='M85 0Q80 30 82 62Q55 62 40 80Q22 58 0 85'/%3E%3Cpath d='M135 0Q128 45 130 94Q90 92 66 120Q36 92 0 135'/%3E%3Cpath d='M185 0Q176 60 178 126Q120 122 92 160Q50 124 0 185'/%3E%3C/svg%3E") no-repeat; background-size: contain; opacity: 0.5; }
.season-deco .web-tl { left: 0; top: 0; }
.season-deco .web-br { right: 0; bottom: 0; transform: rotate(180deg); opacity: 0.35; }
.season-deco span { position: absolute; line-height: 1; }
.season-deco .bat { font-size: 26px; opacity: 0.55; animation: batFly 22s linear infinite; }
.season-deco .b1 { top: 18%; animation-delay: -4s; }
.season-deco .b2 { top: 34%; font-size: 20px; animation-duration: 28s; animation-delay: -15s; }
.season-deco .b3 { top: 9%; font-size: 18px; animation-duration: 34s; animation-delay: -24s; }
.season-deco .ghost { right: 5%; top: 46%; font-size: 40px; opacity: 0.30; animation: ghostFloat 7s ease-in-out infinite; }
.season-deco .pk { bottom: 18px; font-size: 44px; opacity: 0.45; filter: drop-shadow(0 0 14px rgba(249,115,22,0.6)); }
.season-deco .p1 { left: 3%; } .season-deco .p2 { right: 4%; font-size: 34px; }
@keyframes batFly {
    0%   { transform: translate(-12vw, 0) scale(1); }
    25%  { transform: translate(22vw, -18px) scale(1.05); }
    50%  { transform: translate(52vw, 10px) scale(0.95); }
    75%  { transform: translate(82vw, -14px) scale(1.05); }
    100% { transform: translate(112vw, 0) scale(1); }
}
@keyframes ghostFloat { 0%,100% { transform: translateY(0); opacity: 0.30; } 50% { transform: translateY(-18px); opacity: 0.45; } }
@keyframes seasonWobble { 0%,100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }

/* 見た目の切り替え（通常｜🎃｜🎄。2026-11-07 運営。選んでいるものが光る） */
.theme-picker {
    display: inline-flex; align-items: center; gap: 2px; margin: 14px 0 0 8px; vertical-align: middle; padding: 3px;
    background: var(--surface2); border: 1px solid var(--border); border-radius: 99px;
}
.theme-picker button {
    border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 0.78rem; line-height: 1;
    min-width: 38px; padding: 6px 11px; border-radius: 99px; cursor: pointer; transition: background 0.2s, color 0.2s;
}
.theme-picker button:not([data-theme="off"]) { font-size: 1rem; padding: 4px 10px; }
.theme-picker button[aria-checked="true"] { background: rgba(255,255,255,0.14); color: #fff; font-weight: 700; }
.theme-picker button[data-theme="halloween"][aria-checked="true"] { background: #f97316; }
.theme-picker button[data-theme="christmas"][aria-checked="true"] { background: #dc2626; }
.theme-picker button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 767px) {
    /* スマホは中身が横幅いっぱいなので、飾りは小さく・薄く */
    .season-deco .web { width: 130px; height: 130px; opacity: 0.35; }
    .season-deco .moon { width: 48px; height: 48px; top: 22px; right: 5%; opacity: 0.6; }
    .season-deco .ghost, .season-deco .p1 { display: none; }
    .season-deco .bat { opacity: 0.4; }
}
@media (prefers-reduced-motion: reduce) {
    .season-deco .bat, .season-deco .ghost, .logo-season { animation: none; }
    .season-deco .b1 { left: 12%; } .season-deco .b2 { left: 70%; } .season-deco .b3 { left: 40%; }
    .theme-picker button { transition: none; }
}

/* ── 期間限定の見た目：クリスマス（2026-11-06 運営が選んだ「雪の夜のイルミネーション」＋「夜空→もみの森」の色）。
      ハロウィーンと同じく、表記・注意書き・校舎の色は変えない。飾りは季節のクラスが付いているときだけ ── */
.theme-christmas .season-deco.s-christmas { display: block; }
.theme-christmas .season-ribbon.s-christmas { display: inline-flex; }
.theme-christmas .logo-season.s-christmas { display: inline-block; }
.theme-christmas .icon-season.s-christmas { display: inline; }
.theme-christmas .icon-normal { display: none; }
.theme-christmas {
    --bg: #08202a; --surface: rgba(12,36,52,0.92); --surface2: #123247;
    --border: rgba(253,224,71,0.20); --muted: #a9c6d6; --accent: #fbbf24;
    background:
        radial-gradient(700px 520px at 0% 100%, rgba(251,191,36,0.14), transparent 70%),
        radial-gradient(640px 520px at 100% 30%, rgba(56,189,248,0.12), transparent 70%),
        linear-gradient(180deg, #081633 0%, #0b2242 28%, #0a2d38 55%, #0b3a2c 85%, #0a3326 100%);   /* 上は紺の夜空、下はもみの森 */
    background-color: #081633;
    background-attachment: fixed;
}
html:has(> body.theme-christmas) { background-color: #081633; }
.theme-christmas .card { box-shadow: 0 0 0 1px rgba(253,224,71,0.10), 0 18px 40px rgba(0,0,0,0.45); }
.theme-christmas .logo { background: linear-gradient(135deg, #fff 0%, #fde68a 60%, #fbbf24 100%); -webkit-background-clip: text; background-clip: text; }
.theme-christmas .logo span { -webkit-text-fill-color: #fde68a; color: #fde68a; }
.theme-christmas .logo-season { animation: xmasTwinkle 2.6s ease-in-out infinite; filter: drop-shadow(0 0 8px rgba(253,224,71,0.7)); }
.theme-christmas .btn-search {
    background: linear-gradient(90deg, #b91c1c, #dc2626 45%, #ef4444); color: #fff;
    box-shadow: 0 0 0 1px rgba(253,224,71,0.45), 0 8px 26px rgba(220,38,38,0.45);
}
.theme-christmas .btn-search .btn-text::before { content: '🎁 '; }
.theme-christmas select:focus { border-color: #fbbf24; }
.theme-christmas .room-search-link { border-color: rgba(253,224,71,0.45); background: rgba(251,191,36,0.07); }
.theme-christmas .now-badge .dot { background: #fbbf24; }
.theme-christmas .room-card { box-shadow: inset 0 -3px 0 rgba(251,191,36,0.22); }
.theme-christmas .season-ribbon { color: #fef3c7; background: rgba(251,191,36,0.10); border-color: rgba(253,224,71,0.40); }
.theme-christmas .season-ribbon b { color: #fbbf24; }
.theme-christmas .season-ribbon-sub { color: #bae6fd; }
/* 背景の飾り：上の電飾・ゆっくり降る雪・空を横切るそり・星・ツリー・プレゼント */
.season-deco .x-snow {
    position: absolute; inset: -180px 0 0 0; opacity: 0.55; animation: xmasSnow 18s linear infinite;
    background-image: radial-gradient(2px 2px at 20px 30px, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 90px 80px, #fff 50%, transparent 51%),
                      radial-gradient(2.5px 2.5px at 150px 20px, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 60px 140px, #fff 50%, transparent 51%);
    background-size: 180px 180px;
}
.season-deco .x-s2 { background-size: 260px 260px; opacity: 0.35; animation-duration: 28s; }
.season-deco .x-wire { position: absolute; left: 0; right: 0; top: 8px; height: 14px; border-bottom: 1.5px solid rgba(203,213,225,0.35); border-radius: 0 0 50% 50% / 0 0 100% 100%; }
.season-deco .x-lights {
    position: absolute; left: 0; right: 0; top: 0; height: 34px; animation: xmasLights 2.4s ease-in-out infinite;
    background: radial-gradient(ellipse 6px 9px at 20px 20px, #f87171 60%, transparent 62%) 0 0 / 160px 34px,
                radial-gradient(ellipse 6px 9px at 60px 24px, #fde047 60%, transparent 62%) 0 0 / 160px 34px,
                radial-gradient(ellipse 6px 9px at 100px 20px, #4ade80 60%, transparent 62%) 0 0 / 160px 34px,
                radial-gradient(ellipse 6px 9px at 140px 24px, #60a5fa 60%, transparent 62%) 0 0 / 160px 34px;
    filter: drop-shadow(0 0 6px rgba(253,224,71,0.8));
}
.season-deco .x-sleigh { top: 13%; font-size: 26px; opacity: 0.6; animation: xmasSleigh 26s linear infinite; animation-delay: -6s; }
.season-deco .x-star { right: 7%; top: 64px; font-size: 54px; opacity: 0.9; filter: drop-shadow(0 0 22px rgba(253,224,71,0.8)); animation: xmasTwinkle 3.2s ease-in-out infinite; }
.season-deco .x-tree { left: 3%; bottom: 14px; font-size: 54px; opacity: 0.55; filter: drop-shadow(0 0 14px rgba(74,222,128,0.5)); }
.season-deco .x-gift { right: 4%; bottom: 16px; font-size: 36px; opacity: 0.5; }
@keyframes xmasSnow { to { transform: translateY(180px); } }
@keyframes xmasLights { 0%,100% { opacity: 0.95; } 50% { opacity: 0.65; } }
@keyframes xmasTwinkle { 0%,100% { opacity: 0.9; transform: scale(1); } 50% { opacity: 1; transform: scale(1.08); } }
@keyframes xmasSleigh { 0% { transform: translate(-14vw, 0); } 50% { transform: translate(50vw, -16px); } 100% { transform: translate(114vw, 0); } }
@media (max-width: 767px) {
    /* スマホは右上の星がロゴに重なるので出さない。ツリーも下の隅だけに */
    .season-deco .x-star, .season-deco .x-tree { display: none; }
    .season-deco .x-sleigh { font-size: 20px; opacity: 0.45; }
}
@media (prefers-reduced-motion: reduce) {
    .season-deco .x-snow, .season-deco .x-lights, .season-deco .x-sleigh, .season-deco .x-star,
    .theme-christmas .logo-season { animation: none; }
    .season-deco .x-sleigh { left: 60%; }
}

/* 試験運用中の表記を検索結果の下に置いたとき（2026-10-31）。注意書きとひとまとまりに見せ、使い方の欄とは間を空ける */
.test-banner-bottom { margin: 14px 2px 8px; align-items: flex-start; }
.test-banner-bottom .test-tag { margin-top: 2px; }

/* 季節の見た目を切り替えるときの演出（static/app.js の play）。スイッチの位置から円が広がって画面を覆い、晴れる */
.season-fx {
    position: fixed; inset: 0; z-index: 200; pointer-events: none; overflow: hidden;
    clip-path: circle(0px at var(--fx-x) var(--fx-y));
    animation: fxWipe 0.42s cubic-bezier(0.55, 0, 0.3, 1) forwards;
}
.season-fx.fx-halloween { background: radial-gradient(circle at var(--fx-x) var(--fx-y), #2a1550 0%, #160b2b 45%, #0d0719 100%); }
.season-fx.fx-christmas { background: radial-gradient(circle at var(--fx-x) var(--fx-y), #14405a 0%, #0b2242 45%, #081633 100%); }
.season-fx.fx-normal { background: #0a0a0f; }
.season-fx.fx-out { animation: fxWipe 0.42s cubic-bezier(0.55, 0, 0.3, 1) forwards, fxOut 0.45s ease forwards; }
@keyframes fxWipe { to { clip-path: circle(150vmax at var(--fx-x) var(--fx-y)); } }
@keyframes fxOut { to { opacity: 0; } }
.season-fx span { position: absolute; left: 50%; top: 46%; line-height: 1; }
.season-fx .fx-pumpkin, .season-fx .fx-pop {
    font-size: 96px; transform: translate(-50%, -50%) scale(0);
    filter: drop-shadow(0 0 30px rgba(249,115,22,0.75));
    animation: fxPop 0.6s 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.season-fx .fx-text {
    top: calc(46% + 72px); transform: translate(-50%, 0); opacity: 0; white-space: nowrap;
    font-family: 'Noto Sans JP', sans-serif; font-weight: 900; font-size: 1.5rem; color: #fb923c; letter-spacing: 0.02em;
    animation: fxText 0.45s 0.55s ease forwards;
}
.season-fx.fx-christmas .fx-pop { filter: drop-shadow(0 0 30px rgba(253,224,71,0.75)); }
.season-fx.fx-christmas .fx-text { color: #fde68a; }
.season-fx .fx-bat, .season-fx .fx-flake { font-size: 30px; opacity: 0; transform: translate(-50%, -50%); animation: fxBat 0.95s 0.42s ease-out forwards; }
.season-fx .b1 { --dx: -42vw; --dy: -30vh; } .season-fx .b2 { --dx: 40vw; --dy: -34vh; animation-delay: 0.48s; }
.season-fx .b3 { --dx: -46vw; --dy: 8vh; animation-delay: 0.52s; } .season-fx .b4 { --dx: 46vw; --dy: 4vh; animation-delay: 0.45s; }
.season-fx .b5 { --dx: -22vw; --dy: -44vh; animation-delay: 0.58s; font-size: 22px; } .season-fx .b6 { --dx: 24vw; --dy: -46vh; animation-delay: 0.55s; font-size: 24px; }
@keyframes fxPop { 0% { transform: translate(-50%, -50%) scale(0) rotate(-20deg); } 100% { transform: translate(-50%, -50%) scale(1) rotate(0deg); } }
@keyframes fxText { to { opacity: 1; transform: translate(-50%, -6px); } }
@keyframes fxBat {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
    20% { opacity: 1; }
    100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.2); }
}

/* 前回の条件で開いたことの案内（2026-11-09 定着の改善 A3） */
.pref-note { margin: -4px 2px 12px; font-size: 0.78rem; color: var(--muted); }
.pref-note a { color: var(--accent); font-weight: 700; text-decoration: none; }
.pref-note a:hover { text-decoration: underline; }

/* 開いたままの画面に戻ったとき、自分で検索した結果が前の時限のものだと知らせる帯（2026-11-09 A4） */
.stale-bar { margin: 0 0 10px; padding: 9px 12px; border-radius: 10px; font-size: 0.82rem;
  background: rgba(251,191,36,0.10); border: 1px solid rgba(251,191,36,0.35); color: #fde68a; }
.stale-bar a { color: #fbbf24; font-weight: 700; }

/* ── 2026-11-11 テスト運用中の改善（B1〜B8） ── */
.basis-note { margin: -6px 2px 12px; font-size: 0.76rem; color: var(--muted); }
/* 時限の切り替え［いま｜次｜明日］と校舎のタブ */
.slot-chips, .bldg-tabs { display: flex; gap: 8px; margin: 0 0 10px; overflow-x: auto; scrollbar-width: none; }
.slot-chips::-webkit-scrollbar, .bldg-tabs::-webkit-scrollbar { display: none; }
.slot-chips a { flex: 1; min-width: 0; text-align: center; padding: 8px 6px; border-radius: 12px; text-decoration: none; white-space: nowrap;
    background: var(--surface2); border: 1px solid var(--border); color: var(--text, #e5e7eb); font-weight: 700; font-size: 0.9rem; }
.slot-chips a small { display: block; font-size: 0.66rem; font-weight: 600; color: var(--muted); margin-bottom: 1px; }
.slot-chips a.on { border-color: var(--accent); background: rgba(99,140,255,0.16); }
.slot-chips a.on small { color: var(--accent); }
.bldg-tabs { margin-bottom: 14px; }
.bldg-tabs a { flex-shrink: 0; padding: 7px 14px; border-radius: 99px; text-decoration: none; font-size: 0.82rem; font-weight: 700;
    color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.bldg-tabs a.on { color: #fff; background: var(--accent); border-color: var(--accent); }
/* 条件の欄（スマホでは畳む） */
.form-fold > summary { display: none; }
@media (max-width: 1099px) {
    .form-fold > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; list-style: none;
        padding: 12px 16px; margin-bottom: 14px; border-radius: 14px; background: var(--surface2); border: 1px solid var(--border);
        font-weight: 700; font-size: 0.9rem; }
    .form-fold > summary::-webkit-details-marker { display: none; }
    .form-fold > summary::after { content: '＋'; color: var(--accent); font-weight: 800; }
    .form-fold[open] > summary::after { content: '−'; }
    .form-fold > summary small { flex: 1; font-weight: 500; font-size: 0.72rem; color: var(--muted); }
    .form-fold:not([open]) + script + .pc-qr { display: none; }
}
/* PC で開いた人に、スマホで開く QR */
.pc-qr { display: none; }
@media (min-width: 1100px) {
    .pc-qr { display: flex; gap: 14px; align-items: center; margin-top: 16px; padding: 14px; border-radius: 16px; background: var(--surface2); border: 1px solid var(--border); }
    .pc-qr img { border-radius: 8px; background: #fff; flex-shrink: 0; }
    .pc-qr b { display: block; font-size: 0.88rem; margin-bottom: 4px; }
    .pc-qr span { font-size: 0.74rem; color: var(--muted); line-height: 1.6; }
}
/* 報告のあとの「別の空き教室」 */
.alt-rooms p { margin: 6px 0 12px; font-size: 0.9rem; line-height: 1.6; }
.alt-rooms p b { display: block; }
.alt-rooms p span { color: var(--muted); font-size: 0.8rem; }
.alt-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.alt-list a { display: block; text-align: center; padding: 12px 4px; border-radius: 12px; text-decoration: none; font-weight: 800;
    color: var(--accent); background: var(--surface2); border: 1px solid var(--border); }
.alt-list a small { display: block; font-size: 0.68rem; font-weight: 600; color: var(--muted); margin-top: 2px; }
.alt-rooms .btn-cancel { width: 100%; }
/* ホーム画面に追加の案内 */
.a2hs { position: relative; margin: 18px 0 0; padding: 14px 40px 14px 16px; border-radius: 14px; background: rgba(99,140,255,0.10); border: 1px solid rgba(99,140,255,0.35); }
.a2hs b { display: block; font-size: 0.9rem; margin-bottom: 4px; }
.a2hs span { font-size: 0.8rem; color: var(--muted); line-height: 1.6; }
.a2hs-close { position: absolute; right: 8px; top: 6px; width: 32px; height: 32px; border: 0; background: none; color: var(--muted); font-size: 1.1rem; cursor: pointer; }

/* ── 2026-11-11 整理：見出しを短く。上から 時限 → 校舎 →「○室」と注意の一行 → 教室 ── */
@media (min-width: 1100px) { .slot-chips a { flex: 0 0 auto; padding: 8px 18px; } }
.result-meta { align-items: center; margin-bottom: 12px; }
.result-label { text-transform: none; letter-spacing: 0; font-size: 0.8rem; line-height: 1.5; }
.result-label b { color: var(--text, #e5e7eb); font-size: 0.95rem; }
.result-label .basis { display: block; font-size: 0.74rem; }
.result-label .span-off { color: var(--accent); font-weight: 700; text-decoration: none; }
.bldg-tabs { margin-bottom: 12px; }
/* タイトルまわりにゆとり（2026-11-11 運営）：上の余白、ロゴ→副題→時計の間、ヘッダーの下 */
header { margin: 36px 0 38px; }
.subtitle { margin-top: 14px; }
/* 時計と見た目の切り替えを、同じ高さ・同じ位置にそろえる（前は上下にずれていた） */
.now-badge, .theme-picker { margin-top: 26px; vertical-align: middle; height: 36px; box-sizing: border-box; }
.now-badge { padding: 0 14px; }
.theme-picker { padding: 3px; }
.theme-picker button { height: 28px; display: inline-flex; align-items: center; justify-content: center; padding-top: 0; padding-bottom: 0; }
@media (max-width: 767px) { header { margin: 34px 0 34px !important; } }

/* ── 通常の見た目にも、季節の見た目と同じ配置の飾りと帯を置く（2026-11-12 運営。通常だけ上が空いて見えたため）。
      季節の見た目を選んでいるとき（body に theme-…）は出ない。色は通常の青のまま ── */
body:not([class*="theme-"]) .season-deco.s-normal { display: block; }
body:not([class*="theme-"]) .season-ribbon.s-normal { display: inline-flex; }
.season-ribbon.s-normal { color: #e6ecff; background: rgba(108,143,255,0.10); border-color: rgba(108,143,255,0.38); }
.season-ribbon.s-normal b { color: #9db5ff; }
.season-ribbon.s-normal .season-ribbon-sub { color: #9aa3c7; }
.season-deco .n-radar {
    position: absolute; right: 7%; top: 64px; width: 92px; height: 92px; border-radius: 50%; opacity: 0.9;
    background:
        radial-gradient(circle, rgba(108,143,255,0.95) 0 3px, transparent 4px),
        repeating-radial-gradient(circle, transparent 0 13px, rgba(108,143,255,0.38) 13px 14px),
        radial-gradient(circle, rgba(108,143,255,0.16), rgba(108,143,255,0.03) 70%);
    box-shadow: 0 0 50px 12px rgba(108,143,255,0.14);
}
.season-deco .n-radar::after {
    content: ''; position: absolute; inset: 0; border-radius: 50%;
    background: conic-gradient(from 0deg, rgba(108,143,255,0.55), transparent 28%);
    animation: radarSweep 5s linear infinite;
}
.season-deco .n-dots {
    position: absolute; inset: 0; opacity: 0.5;
    background-image: radial-gradient(rgba(160,180,255,0.55) 1px, transparent 1.4px), radial-gradient(rgba(160,180,255,0.35) 1px, transparent 1.4px);
    background-size: 190px 170px, 130px 210px; background-position: 30px 40px, 90px 120px;
    -webkit-mask-image: linear-gradient(180deg, #000 0, transparent 520px); mask-image: linear-gradient(180deg, #000 0, transparent 520px);
}
@keyframes radarSweep { to { transform: rotate(360deg); } }
@media (max-width: 767px) { .season-deco .n-radar { width: 64px; height: 64px; top: 12px; right: 4%; opacity: 0.75; } }
@media (prefers-reduced-motion: reduce) { .season-deco .n-radar::after { animation: none; } }
/* 帯は1行を使い、時計と見た目の切り替えはその下の行に置く（PC 幅で横に並んでいた。2026-11-12 運営） */
.theme-halloween .season-ribbon.s-halloween, .theme-christmas .season-ribbon.s-christmas,
body:not([class*="theme-"]) .season-ribbon.s-normal { display: flex; width: fit-content; max-width: 100%; box-sizing: border-box; }
/* PC 幅のヘッダー（2026-11-12 運営。左に寄って右が空き、下の2列と釣り合っていなかった）：
   1段目＝左にロゴ・右端に時計と見た目の切り替え、2段目＝副題、3段目＝帯を横幅いっぱい。その下の2列は同じ高さから始める */
@media (min-width: 1100px) {
    header { display: flex; flex-wrap: wrap; align-items: center; column-gap: 10px; margin: 20px 0 28px; }
    header .logo-link { order: 1; }
    header .logo-season { order: 2; }
    header .now-badge { order: 3; margin-left: auto; margin-top: 0; }
    header .theme-picker { order: 4; margin-top: 0; }
    header .subtitle { order: 5; flex: 0 0 100%; margin-top: 10px; }
    header .season-ribbon { order: 6; flex: 0 0 100%; width: auto !important; margin-top: 18px; padding: 11px 18px; font-size: 0.9rem; }
    header .season-ribbon-sub { margin-left: auto; font-size: 0.82rem; }
}
/* PC 幅：右上の飾り（レーダー・月・星）は、時計と見た目の切り替えに重ならないよう、内容の幅の外（画面の右端）へ */
@media (min-width: 1100px) {
    .season-deco .n-radar, .season-deco .moon { width: 64px; height: 64px; right: 10px; top: 22px; }
    .season-deco .x-star { font-size: 44px; right: 14px; top: 22px; }
}
@media (min-width: 1500px) {
    .season-deco .n-radar, .season-deco .moon { width: 92px; height: 92px; right: 6%; top: 48px; }
    .season-deco .x-star { font-size: 54px; right: 6%; top: 48px; }
}
