/* =====================================================================
   白梅屋 凛 — 暗い配色（夜の宿）
   <html data-theme="dark"> の時だけ効く（決めるのは js/theme.js。自動・明るい・暗いを選べる）。
   ほかの CSS（style → wa → sakura → season）の後に読み、色だけを上書きする（形・動きは変えない）。
   色の変数は季節（season.css）や夜（sakura.css の data-tod）より強くしたいので !important を付ける。
     地: 夜の藍紫 ／ 文字: 淡い藤色 ／ 差し色: 灯りに照らされた桜の紅
   ===================================================================== */
html[data-theme="dark"]{
  color-scheme:dark;
  --ink:#1E1923 !important;
  --ink-soft:#2A2330 !important;
  --paper:#EEE6F1 !important;
  --paper-warm:#E0D3E4 !important;
  --gold:#A9788C !important;
  --gold-soft:#EE9DBA !important;
  --plum:#D7C3E6 !important;
  --plum-mist:#B7A5C6 !important;
  --plum-line:rgba(238,157,186,.22) !important;
  --sakura:#7A4A5E !important;
  --sakura-soft:#3A2B36 !important;
  --text-soft:#D8CDDD !important;
  --wa-veil:linear-gradient(rgba(30,25,35,.95), rgba(30,25,35,.95)) !important;
  --wa-washi-bg:#26202B !important;
  --wa-shoji:rgba(238,157,186,.22) !important;
  --wa-umebachi:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%236E4A5C' stroke-width='0.9'%3E%3Cg id='u'%3E%3Ccircle cx='18' cy='12.5' r='3.2'/%3E%3Ccircle cx='23.2' cy='16.3' r='3.2'/%3E%3Ccircle cx='21.2' cy='22.4' r='3.2'/%3E%3Ccircle cx='14.8' cy='22.4' r='3.2'/%3E%3Ccircle cx='12.8' cy='16.3' r='3.2'/%3E%3Ccircle cx='18' cy='18' r='1.4'/%3E%3C/g%3E%3Cuse href='%23u' x='36' y='36'/%3E%3C/g%3E%3C/svg%3E") !important;
  --wa-kinran:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28'%3E%3Crect width='28' height='28' fill='%234A3B5C'/%3E%3Cpath d='M14 3 L25 14 L14 25 L3 14Z' fill='none' stroke='%23C9A24B' stroke-opacity='.35' stroke-width='.8'/%3E%3Ccircle cx='14' cy='14' r='1.6' fill='%23C9A24B' fill-opacity='.45'/%3E%3C/svg%3E") !important;
  --dk-card:#29222F;
  --dk-card-2:#332A3A;
  --dk-line:rgba(238,157,186,.24);
}
html[data-theme="dark"] body{ background-color:#1E1923 !important; color:var(--paper); }

/* ---- 灯り: 夜の灯籠の灯りは暗い地でも少し。朝・夕べの光は弱く ---- */
html[data-theme="dark"] body::before{ opacity:.45; }
html[data-theme="dark"] body::after{
  content:""; position:fixed; inset:0; z-index:3; pointer-events:none;
  background:
    radial-gradient(circle 160px at 0% 22%, rgba(255,170,90,.14), transparent 70%),
    radial-gradient(circle 160px at 100% 22%, rgba(255,170,90,.14), transparent 70%);
}

/* ---- 上のメニュー ---- */
html[data-theme="dark"] nav, html[data-theme="dark"][data-tod="night"] nav{ background:linear-gradient(to bottom, rgba(30,25,35,.94), rgba(30,25,35,0)); }
html[data-theme="dark"] .nav-scrim{ background:rgba(0,0,0,.45); }
@media (max-width:860px){
  html[data-theme="dark"] nav ul#nav-list{ background:#221C28 !important; box-shadow:-16px 0 40px rgba(0,0,0,.5); }
  html[data-theme="dark"] nav ul.nav-sub{ background:none !important; }
  html[data-theme="dark"] nav ul .ni{ background:var(--dk-card); border-color:var(--dk-line); }
  html[data-theme="dark"] nav ul .ni:active{ background:var(--dk-card-2); }
  html[data-theme="dark"] .ni[aria-current="page"]{ background:#3A2B36; border-color:rgba(238,157,186,.5); }
}
@media (min-width:861px){
  html[data-theme="dark"] .nav-sub{ background:rgba(41,34,47,.98) !important; }
  html[data-theme="dark"] nav ul.nav-sub::after{ background:#29222F !important; }
  html[data-theme="dark"] .nav-sub .ni:hover, html[data-theme="dark"] .nav-sub .ni:focus-visible{ background:var(--dk-card-2); }
}
html[data-theme="dark"] .ni[aria-current="page"]::before{ background-color:#F6C9D7; }

/* ---- 表紙 ---- */
html[data-theme="dark"] h1.title{ color:#F4ECF6; }
html[data-theme="dark"] .hero-bg{ filter:saturate(.7) brightness(.55); opacity:.5; }
html[data-theme="dark"] .hero-bg::after{ background:linear-gradient(180deg, rgba(30,25,35,.92) 0%, rgba(30,25,35,.55) 40%, #1E1923 100%) !important; }
html[data-theme="dark"] .hero::before{
  background:
    radial-gradient(ellipse 60% 50% at 78% 30%, rgba(122,74,94,.35), transparent 60%),
    radial-gradient(ellipse 40% 40% at 15% 80%, rgba(169,120,140,.15), transparent 60%) !important;
}

/* ---- ボタン: 塗りは灯りの桜色に濃い字 ---- */
html[data-theme="dark"] .btn.solid{
  background:linear-gradient(#F4B8CC, #E48BAB) !important; border-color:#E48BAB !important; color:#2A1F2D !important;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.3), 0 2px 0 #9E5470 !important;
}
html[data-theme="dark"] .btn.solid::before{ filter:none; }
html[data-theme="dark"] button.btn.solid{ background:linear-gradient(#F4B8CC, #E48BAB) !important; }

/* ---- 白い札・枠を、夜の札に ---- */
html[data-theme="dark"] .diary-entry,
html[data-theme="dark"] .otayori-form, html[data-theme="dark"] .otayori-q,
html[data-theme="dark"] .stamp-book,
html[data-theme="dark"] .social a,
html[data-theme="dark"] .rin-bubble,
html[data-theme="dark"] .quiz-box,
html[data-theme="dark"] .omiyage-item, html[data-theme="dark"] .omiyage-card-maker,
html[data-theme="dark"] .acal,
html[data-theme="dark"] .diary-share-menu, html[data-theme="dark"] .diary-share-item,
html[data-theme="dark"] .enikki-best{
  background:var(--dk-card) !important; border-color:var(--dk-line) !important; box-shadow:0 2px 14px rgba(0,0,0,.35) !important;
}
html[data-theme="dark"] .rin-bubble{ color:var(--paper); }
html[data-theme="dark"] .rin-bubble::after{ border-top-color:var(--dk-card); }
html[data-theme="dark"] .support-card{ background-color:rgba(41,34,47,.92); }
html[data-theme="dark"] .support-card:hover{ background-color:var(--dk-card-2); }
html[data-theme="dark"] .koyomi-card{ background:linear-gradient(135deg, #2B2331, #35283A); border-color:var(--dk-line); }
html[data-theme="dark"] .visitor-counter{ background:linear-gradient(180deg, #2B2331 0%, #33283A 100%); }
html[data-theme="dark"] .vc-digit{ background:linear-gradient(180deg, #3A2F42 0%, #2B2331 100%); border-color:var(--dk-line); box-shadow:none; }
html[data-theme="dark"] .enikki-dialog-inner, html[data-theme="dark"] .enikki-viewer{ background:rgba(34,28,40,.98); }
html[data-theme="dark"] .enikki-close, html[data-theme="dark"] .emaki-nav{ background:rgba(41,34,47,.92); }
html[data-theme="dark"] dialog.img-zoom{ background:rgba(34,28,40,.98); }
html[data-theme="dark"] .strip-card span{ background:rgba(30,25,35,.85); }
html[data-theme="dark"] .strip-card.chibi{ background:radial-gradient(ellipse at 50% 35%, #3A2F42 0%, #2B2331 70%, #241E29 100%); }
html[data-theme="dark"] .about-figure{ background:#26202B; }
html[data-theme="dark"] footer{ background:linear-gradient(180deg, transparent, #2A2030); }
html[data-theme="dark"] .error-crest{ background:#3A2B36; }

/* ---- 入力欄 ---- */
html[data-theme="dark"] input[type="text"], html[data-theme="dark"] input[type="email"], html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="search"], html[data-theme="dark"] textarea, html[data-theme="dark"] select,
html[data-theme="dark"] .otayori-form input[type="text"], html[data-theme="dark"] .otayori-form textarea, html[data-theme="dark"] .comment-textarea,
html[data-theme="dark"] .diary-input, html[data-theme="dark"] .diary-textarea, html[data-theme="dark"] .archive-search input{
  background-color:#1A1520 !important; color:var(--paper) !important; border-color:rgba(238,157,186,.32) !important;
}
html[data-theme="dark"] input::placeholder, html[data-theme="dark"] textarea::placeholder{ color:#8E7E9C !important; }

/* ---- おみくじ・クイズ・おみやげ・判子帳 ---- */
html[data-theme="dark"] .omikuji-box{
  background:radial-gradient(ellipse 80% 60% at 50% 0%, rgba(122,74,94,.35), transparent 70%), linear-gradient(#2B2331, #231D28) !important;
  border-color:rgba(238,157,186,.35) !important;
  box-shadow:inset 0 0 0 5px #2B2331, inset 0 0 0 6px rgba(238,157,186,.2), 0 18px 40px rgba(0,0,0,.4) !important;
}
html[data-theme="dark"] .quiz-choice{ background:#231D28; border-color:rgba(238,157,186,.3); }
html[data-theme="dark"] .quiz-choice:hover:not(:disabled){ background:#3A2B36; }
html[data-theme="dark"] .quiz-choice.wrong{ background:#4A2A30; border-color:#C46060; color:#F2B8B8; }
html[data-theme="dark"] .omiyage-preview{ background:#2B2331; }
html[data-theme="dark"] .omiyage-item.locked .omiyage-preview{ background:repeating-linear-gradient(45deg, #2B2331 0 10px, #241E29 10px 20px); }

/* ---- 小説・日記の暦 ---- */
html[data-theme="dark"] .acal-week.sun, html[data-theme="dark"] .acal-day.sun .acal-num{ color:#F08C9C; }
html[data-theme="dark"] .acal-week.sat, html[data-theme="dark"] .acal-day.sat .acal-num{ color:#9DB6E8; }
html[data-theme="dark"] .acal-day.has{ background:rgba(238,157,186,.1); }
html[data-theme="dark"] .acal-day.has:hover{ background:rgba(238,157,186,.2); }

/* ---- 画面の明るさのボタン（js/theme.js が上のメニューに置く） ---- */
html[data-theme="dark"] .theme-btn{ background:var(--dk-card); }

/* ボタンの形（明るい時も暗い時も。dark.css を読むページだけに出る） */
nav.has-theme-btn > ul{ margin-left:auto; }
.theme-btn{
  flex:0 0 auto; width:34px; height:34px; margin-left:18px; padding:0; border-radius:50%; cursor:pointer;
  font-size:16px; line-height:1; color:var(--gold-soft); background:rgba(255,255,255,.7); border:1px solid var(--plum-line);
  display:inline-flex; align-items:center; justify-content:center; transition:background .2s, color .2s;
}
.theme-btn:hover{ color:var(--paper); }
.theme-btn:focus-visible{ outline:2px solid var(--gold-soft); outline-offset:3px; }
@media (max-width:860px){ .theme-btn{ margin-left:auto; margin-right:14px; position:relative; z-index:60; } }

/* ゲームの遊ぶ画面は、もとから紺の配色（sakura.css）。金のボタンのまま */
html[data-theme="dark"] .game-canvas-wrap .btn.solid{
  background:linear-gradient(#e2c98f, #cfae66) !important; border-color:#cfae66 !important; color:#2B2530 !important;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.25), 0 2px 0 #8d6e2c !important;
}

/* 暗い地で見えなかった所（2026-11-25 本番で確認） */
html[data-theme="dark"] .koyomi-sweet{ background:rgba(255,255,255,.05); border-color:rgba(238,157,186,.3); }
/* 日記の終わりのサイン（暗い線の絵）は、明るい線に反転する */
html[data-theme="dark"] .diary-sign{ filter:invert(1) brightness(.92); opacity:.8; }
