/* ================================================================ お知らせ（news.js）
   ホームの札：名札の左に、金の縁の漆のメダル（巻物）と太ぶちの金文字。まだ開いていない物があれば赤い数の印。
   一覧・詳細：漆の箱に金の厚い縁。左に一覧、右に和紙の上の本文。大きさはホームと同じ倍率（--stg）で縮める。
   動くのは、開く時の一瞬と印の脈打ちだけ（transform・opacity）。 */

/* ---------- ホームの札（ステージの中の大きさ：1280×720 の中で） */
.nw-btn { position: absolute; right: 350px; top: 14px; z-index: 6; width: 120px; height: 126px; padding: 0; border: 0; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; -webkit-tap-highlight-color: transparent; }
.nw-btn .nw-medal { display: block; width: 98px; height: 98px; filter: drop-shadow(0 5px 6px rgba(0, 0, 0, .6)) drop-shadow(0 0 6px rgba(255, 200, 90, .55)); }
.nw-btn .nw-medal svg { display: block; width: 100%; height: 100%; overflow: visible; }
.nw-btn .nw-label { margin-top: -12px; font: 800 22px/1.1 "M PLUS Rounded 1c", sans-serif; letter-spacing: .5px; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .7)); }
.nw-btn:active .nw-medal, .nw-btn.is-pressed .nw-medal { transform: translateY(2px) scale(.95); }
/* まだ開いていないお知らせの数：赤い艶の丸に白い数。ゆっくり脈打つ（transform・opacity だけ） */
.nw-btn .nw-badge { position: absolute; right: 4px; top: -2px; min-width: 38px; height: 38px; padding: 0 8px; box-sizing: border-box; border-radius: 19px;
  display: none; place-items: center; font: 900 23px/1 "M PLUS Rounded 1c", sans-serif; color: #fff; text-shadow: 0 1px 0 #5a0010;
  background: radial-gradient(circle at 35% 28%, #fff3f3 0 8%, #ff5a6a 26%, #e0102e 60%, #8a0018 100%);
  border: 3px solid #fff3c4; box-shadow: 0 0 0 2px #2a0408, 0 3px 6px rgba(0, 0, 0, .6), 0 0 12px rgba(255, 60, 80, .8); }
.nw-btn.has-new .nw-badge { display: grid; animation: nwBeat 1.8s ease-in-out infinite; }
.nw-btn.has-new .nw-badge::after { content: ""; position: absolute; inset: -5px; border-radius: inherit; border: 3px solid rgba(255, 90, 110, .9);
  animation: nwRing 1.8s ease-out infinite; pointer-events: none; }
@keyframes nwBeat { 0%, 60%, 100% { transform: scale(1); } 15% { transform: scale(1.16); } 30% { transform: scale(.98); } }
@keyframes nwRing { 0% { transform: scale(.85); opacity: .9; } 70%, 100% { transform: scale(1.45); opacity: 0; } }
body.lite .nw-btn .nw-badge, body.lite .nw-btn .nw-badge::after { animation: none !important; }
body.lite .nw-btn .nw-badge::after { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .nw-btn .nw-badge, .nw-btn .nw-badge::after { animation: none !important; } .nw-btn .nw-badge::after { opacity: 0; } }

/* ---------- 一覧と詳細の画面 */
.overlay.nw-ov { z-index: 9100; padding: 0; background: radial-gradient(ellipse at 50% 30%, rgba(60, 8, 26, .82), rgba(6, 2, 10, .93) 70%); }
.nw-box { position: absolute; left: 50%; top: 50%; width: 1160px; height: 650px; max-height: calc(100dvh / var(--stg, 1) - 10px);
  display: flex; flex-direction: column; overflow: hidden; border-radius: 24px;
  transform: translate(-50%, -50%) scale(var(--stg, 1)); transform-origin: 50% 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, 0) 30%), linear-gradient(170deg, #4a0c20 0%, #26040f 55%, #12020a 100%);
  border: 4px solid transparent; background-clip: padding-box;
  box-shadow: 0 0 0 3px #1a0804, 0 0 0 6px #e8b440, 0 0 0 8px #fff3c4, 0 0 0 11px #7a4206, 0 0 0 13px #1a0804,
    0 0 40px rgba(255, 190, 80, .45), 0 24px 60px rgba(0, 0, 0, .7);
  animation: nwIn .18s cubic-bezier(.2, .9, .2, 1.1) both; }
@keyframes nwIn { from { opacity: .4; transform: translate(-50%, -50%) scale(calc(var(--stg, 1) * .95)); } }
.nw-head { flex: none; position: relative; display: flex; align-items: center; justify-content: center; height: 76px; padding: 0 70px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, 0) 55%), linear-gradient(160deg, #6a1428, #2a0614);
  border-bottom: 3px solid #c99a3e; box-shadow: inset 0 -1px 0 #fff3c4, 0 4px 10px rgba(0, 0, 0, .45); }
.nw-title { font: 900 42px/1 "Shippori Mincho B1", serif; letter-spacing: 8px; filter: drop-shadow(0 4px 5px rgba(0, 0, 0, .6)) drop-shadow(0 0 14px rgba(255, 190, 80, .5)); }
.nw-x { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); width: 50px; height: 50px; border-radius: 50%; cursor: pointer;
  border: 3px solid #e8b440; background: radial-gradient(circle at 40% 30%, #5a1a2a, #1e040c); color: #fff3c4; font: 700 28px/1 sans-serif;
  box-shadow: 0 0 0 2px #1a0804, 0 4px 8px rgba(0, 0, 0, .5); }
.nw-main { flex: 1; min-height: 0; display: flex; gap: 16px; padding: 16px 18px 18px; }
.nw-empty { margin: auto; color: #ffe9b0; font: 800 24px/1.4 "M PLUS Rounded 1c", sans-serif; }

/* 左：一覧 */
.nw-list { flex: none; width: 360px; overflow-y: auto; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; gap: 10px; padding: 2px 6px 2px 2px; }
.nw-item { position: relative; flex: none; display: flex; flex-direction: column; gap: 7px; padding: 12px 14px 13px; text-align: left; cursor: pointer; border-radius: 14px;
  border: 2px solid rgba(232, 180, 64, .55); color: #fff3c4;
  background: linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, 0) 50%), linear-gradient(160deg, #3c0a1a, #1a030c);
  box-shadow: 0 3px 0 #0a0105, 0 5px 10px rgba(0, 0, 0, .4); }
.nw-item.on { border-color: #ffe27a; background: linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 50%), linear-gradient(160deg, #8a1a30, #3a0816);
  box-shadow: 0 0 0 2px #1a0804, 0 0 16px rgba(255, 200, 90, .65), 0 3px 0 #0a0105; }
.nw-item.on::before { content: ""; position: absolute; left: -2px; top: 12px; bottom: 12px; width: 6px; border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, #fffbe0, #ffc020 50%, #a05a00); }
.nw-row-top { display: flex; align-items: center; gap: 10px; }
.nw-row-title { font: 800 21px/1.4 "M PLUS Rounded 1c", sans-serif; color: #fff8e0; text-shadow: 0 2px 0 rgba(0, 0, 0, .6); }
.nw-newmark { display: none; margin-left: auto; padding: 3px 9px 2px; border-radius: 6px; font: 900 15px/1 "Orbitron", sans-serif; letter-spacing: 1px; color: #fff;
  background: linear-gradient(180deg, #ff6a7e, #d0102e 55%, #8a0018); border: 1.5px solid #ffe9b0; box-shadow: 0 0 8px rgba(255, 60, 80, .7); }
.nw-item.unread .nw-newmark { display: inline-block; }
.nw-date { font: 700 16px/1 "Orbitron", "M PLUS Rounded 1c", sans-serif; letter-spacing: .5px; color: #ffd98a; white-space: nowrap; }

/* 種類の札：新機能＝紅、更新＝藍、不具合の直し＝翠、おしらせ＝紫。金のふち */
.nw-kind { display: inline-block; flex: none; padding: 4px 10px 3px; border-radius: 6px; white-space: nowrap; font: 800 15px/1.1 "M PLUS Rounded 1c", sans-serif; color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .6); border: 1.5px solid #ffe9a0; box-shadow: 0 0 0 1px #1a0804, inset 0 1px 0 rgba(255, 255, 255, .45); }
.nw-kind.new { background: linear-gradient(180deg, #ff7a5a, #d02a1a 55%, #8a1000); }
.nw-kind.upd { background: linear-gradient(180deg, #6ab0ff, #1a5ad0 55%, #0a2a80); }
.nw-kind.fix { background: linear-gradient(180deg, #6ae09a, #16a050 55%, #065a28); }
.nw-kind.info { background: linear-gradient(180deg, #c48aff, #7a2ad0 55%, #3a0a80); }

/* 右：詳細（和紙の上に） */
.nw-detail { flex: 1; min-width: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; border-radius: 16px; padding: 16px 22px 22px; color: #2b2140;
  background: linear-gradient(180deg, #fffaf0, #fbefd8); border: 3px solid #c99a3e; box-shadow: 0 0 0 2px #fff3c4, inset 0 0 30px rgba(201, 154, 62, .25); }
.nw-fig { position: relative; width: 100%; margin: 0 0 12px; border-radius: 12px; overflow: hidden; aspect-ratio: 12 / 5; max-height: 236px;
  border: 3px solid #c99a3e; box-shadow: 0 0 0 2px #1a0804, 0 6px 14px rgba(0, 0, 0, .35); background: #2a0c1c; }
.nw-fig img { display: block; width: 100%; height: 100%; object-fit: cover; }
.nw-fig-gl { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 40%); }
.nw-meta { display: flex; align-items: center; gap: 12px; }
.nw-meta .nw-date { color: #8a1a2a; }
.nw-d-title { margin: 8px 0 10px; padding-bottom: 8px; border-bottom: 2px solid #e0c070; font: 800 30px/1.35 "Shippori Mincho B1", serif; color: #6a0a1e; letter-spacing: 1px; }
.nw-body { display: flex; flex-direction: column; gap: 6px; font: 700 20px/1.65 "M PLUS Rounded 1c", sans-serif; }
.nw-p { display: block; margin: 2px 0; }
.nw-li { display: block; position: relative; padding-left: 26px; }
.nw-li::before { content: ""; position: absolute; left: 4px; top: .55em; width: 12px; height: 12px; transform: rotate(45deg);
  background: linear-gradient(135deg, #fffbe0, #e8a420 50%, #8a4a00); box-shadow: 0 0 0 1.5px #5a2a00; }
.nw-p + .nw-li, .nw-li + .nw-p { margin-top: 6px; }
/* 言葉の途中で折り返さない（news.js の phrases で切れ目ごとに分けた物） */
.nw-ov .nb { display: inline-block; white-space: nowrap; }
.nw-go { position: relative; overflow: hidden; display: block; margin: 16px auto 2px; min-width: 340px; padding: 12px 36px 11px; cursor: pointer;
  border-radius: 16px; border: 3px solid transparent; color: #fff;
  background: linear-gradient(180deg, rgba(255, 255, 255, .45), rgba(255, 255, 255, 0) 48%) padding-box,
    linear-gradient(180deg, #ff6a7e 0%, #e0163a 46%, #8a0018 54%, #d0203a 100%) padding-box,
    linear-gradient(180deg, #fffbe0, #f2c24a 35%, #7a4000 60%, #ffe58a) border-box;
  box-shadow: 0 5px 0 #4a0010, 0 10px 20px rgba(0, 0, 0, .35), 0 0 22px rgba(255, 90, 110, .45); }
.nw-go b { position: relative; font: 900 28px/1.2 "Shippori Mincho B1", serif; letter-spacing: 4px; text-shadow: 0 2px 0 #4a0010, 0 0 10px rgba(255, 220, 140, .7); white-space: nowrap; }
.nw-go-shine { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .5) 50%, transparent 65%);
  transform: translateX(-100%); }
.nw-go:active .nw-go-shine, .nw-go.is-pressed .nw-go-shine { transform: translateX(100%); transition: transform .35s ease-out; }
.nw-go:active { transform: translateY(3px); box-shadow: 0 2px 0 #4a0010; }
.nw-done { margin: 14px 0 0; text-align: center; font: 800 18px/1.4 "M PLUS Rounded 1c", sans-serif; color: #8a5a00; }
/* 見出しの横の小さなカード（押すと大きく見られる） */
.nw-d-title.has-card { display: flex; align-items: center; justify-content: flex-start; gap: 18px; }
.nw-card { flex: none; padding: 0; border: 0; background: none; cursor: pointer; line-height: 0; transform: rotate(4deg);
  filter: drop-shadow(0 3px 4px rgba(60, 20, 0, .45)); transition: transform .12s; }
.nw-card:active { transform: rotate(4deg) scale(.94); }
.nw-card .jcard { pointer-events: none; }
