/* samsara。明るい赤と大きな数。夜は暗い画面にする（仕掛け8） */
:root {
  --bg: #ffffff;
  --fg: #0f1419;
  --dim: #6b7785;
  --line: #e7ebef;
  --hot: #ff2d55;
  --rp: #00b37a;
  --card: #f5f7f9;
  --shadow: 0 6px 24px rgb(0 0 0 / 0.12);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #000000;
  --fg: #e7e9ea;
  --dim: #8b98a5;
  --line: #22272c;
  --card: #111518;
  --shadow: 0 6px 24px rgb(0 0 0 / 0.6);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body {
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.held { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: var(--hot); text-decoration: none; }
img { display: block; }
[hidden] { display: none !important; }
.dim { color: var(--dim); }
.small { font-size: 12px; }

/* 上の帯 */
#top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; font-size: 20px; letter-spacing: -0.02em; color: var(--hot); padding: 0; }
.grow { flex: 1; }
#streak { font-weight: 700; font-size: 14px; }
#live {
  font-size: 12px; font-weight: 700; color: #fff; background: var(--hot);
  padding: 2px 8px; border-radius: 99px; animation: throb 1.4s ease-in-out infinite;
}
#clock { font-size: 13px; color: var(--dim); font-variant-numeric: tabular-nums; }
.bell, .gear { position: relative; font-size: 18px; padding: 4px; }
#badge {
  position: absolute; top: -2px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--hot); color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center;
}
@keyframes throb { 50% { transform: scale(1.08); } }

/* 新着 */
#fresh {
  position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 11;
  background: var(--hot); color: #fff; font-weight: 800; padding: 8px 18px; border-radius: 99px; box-shadow: var(--shadow);
}
#fresh.pop { animation: pop 0.5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pop { from { transform: translateX(-50%) scale(0.4); opacity: 0; } }
#spin { display: flex; justify-content: center; padding: 16px; }
#spin i { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--hot); animation: rot 0.7s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* 線 */
#line { max-width: 600px; margin: 0 auto; }
.post {
  display: grid; grid-template-columns: 44px 1fr; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--line); cursor: pointer;
}
.post.main { cursor: default; }
.av { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--card); }
.av.s { width: 22px; height: 22px; }
.body { min-width: 0; }
.who { display: flex; align-items: baseline; gap: 6px; min-width: 0; white-space: nowrap; }
.who b { overflow: hidden; text-overflow: ellipsis; }
.who .h, .who .t { color: var(--dim); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.who .hot { color: var(--hot); font-size: 12px; font-weight: 800; margin-left: auto; }
.text { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.text.warn { color: var(--dim); font-style: italic; }

.embed { margin-top: 10px; border-radius: 14px; overflow: hidden; }
.embed.blur img, .embed.blur video { filter: blur(24px); }
.imgs { display: grid; gap: 2px; }
.imgs.n2, .imgs.n4 { grid-template-columns: 1fr 1fr; }
.imgs.n3 { grid-template-columns: 1fr 1fr; }
.imgs.n3 img:first-child { grid-row: span 2; }
.imgs img { width: 100%; height: 100%; max-height: 520px; object-fit: cover; background: var(--card); }
.imgs.n2 img, .imgs.n3 img, .imgs.n4 img { aspect-ratio: 1; }
.video { width: 100%; max-height: 600px; background: #000; display: block; }
.card { display: grid; grid-template-columns: 1fr; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; color: var(--fg); }
.card img { width: 100%; aspect-ratio: 1.91; object-fit: cover; }
.card div { padding: 8px 12px; display: grid; }
.card small { color: var(--dim); }
.quote { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-top: 6px; }
.quote .who { gap: 6px; align-items: center; }
.quote.gone { color: var(--dim); }

/* 反応 */
.acts { display: flex; justify-content: space-between; max-width: 340px; margin-top: 10px; }
.act { position: relative; display: flex; align-items: center; gap: 6px; color: var(--dim); padding: 2px 4px; }
.act .ic { font-size: 16px; }
.act .n { font-variant-numeric: tabular-nums; font-size: 13px; }
.big .act .n { font-size: 17px; font-weight: 800; color: var(--fg); }
.act.like.on, .act.like.on .n { color: var(--hot); }
.act.rp.on, .act.rp.on .n { color: var(--rp); }
.n.bump { animation: bump 0.6s cubic-bezier(.3, 1.8, .5, 1); color: var(--hot) !important; }
@keyframes bump { 40% { transform: scale(1.6); } }
.plus {
  position: absolute; left: 50%; top: -6px; font-size: 12px; font-weight: 900; color: var(--hot);
  animation: rise 1.4s ease-out forwards; pointer-events: none;
}
@keyframes rise { to { transform: translateY(-26px); opacity: 0; } }
/* 期待を外す光。--glow は0から1.4 */
.spark {
  position: absolute; left: 10px; top: 50%; width: var(--s, 5px); height: var(--s, 5px); margin: calc(var(--s, 5px) / -2);
  border-radius: 50%; background: var(--hot); box-shadow: 0 0 6px var(--hot);
  transform: rotate(var(--a)) translateX(0); animation: spark 0.8s cubic-bezier(.1, .8, .3, 1) forwards; pointer-events: none;
}
.act.rp .spark { background: var(--rp); box-shadow: 0 0 6px var(--rp); }
@keyframes spark { to { transform: rotate(var(--a)) translateX(var(--d, 22px)) scale(0.3); opacity: 0; } }
.act.glow .ic { animation: glow 0.7s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes glow {
  30% { transform: scale(calc(1 + var(--glow) * 0.9)); filter: drop-shadow(0 0 calc(var(--glow) * 14px) var(--hot)) brightness(calc(1 + var(--glow) * 0.6)); }
}
.act.rp.glow .ic { --hot: var(--rp); }
.ring {
  position: absolute; left: 10px; top: 50%; width: 20px; height: 20px; margin: -10px; border-radius: 50%;
  border: 2px solid var(--hot); animation: ring 0.75s ease-out forwards; pointer-events: none;
}
.act.rp .ring { border-color: var(--rp); }
@keyframes ring { from { transform: scale(0.4); opacity: 1; } to { transform: scale(var(--k)); opacity: 0; border-width: 0.5px; } }
.flash {
  position: fixed; inset: 0; z-index: 40; pointer-events: none;
  background: radial-gradient(circle at 50% 60%, transparent 30%, color-mix(in srgb, var(--hot) 45%, transparent));
  animation: flash 0.9s ease-out forwards;
}
.flash.rp { background: radial-gradient(circle at 50% 60%, transparent 30%, color-mix(in srgb, var(--rp) 45%, transparent)); }
@keyframes flash { from { opacity: 1; } to { opacity: 0; } }

#stop { text-align: center; padding: 28px 16px 60px; color: var(--dim); }
#stop button { border: 1px solid var(--line); border-radius: 99px; padding: 8px 18px; color: var(--fg); }
#floor { height: 1px; }

/* もうやめたい。非常口の緑 */
#regret {
  position: fixed; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 12;
  display: flex; align-items: center; gap: 10px;
  color: #fff; background: #00a95f; border: 3px solid #fff; outline: 2px solid #00a95f;
  padding: 8px 14px 8px 10px; border-radius: 10px; box-shadow: var(--shadow);
  font-weight: 800; font-size: 15px; letter-spacing: 0.04em;
}
#regret:hover { background: #00b968; }
#regret .pict svg { width: 46px; height: 29px; display: block; }
#regret.open .pict svg { animation: run 0.6s ease-in; }
@keyframes run { 60% { transform: translateX(8px); } 100% { transform: none; } }

/* 金剛力士。線の両わきの余白に立つ。画面が狭いときは出さない。
   写真は切り抜かず、額に入れて見せる。ポーズで動かす幅は額の中に収まる大きさにとどめる */
.nio {
  position: fixed; top: 64px; bottom: 12px; width: calc((100vw - 600px) / 2); z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 0 20px; pointer-events: none; --beat: 2.4s; --k: 0.6;
}
.nio.left { left: 0; }
.nio.right { right: 0; }
@media (max-width: 1000px) { .nio { display: none; } }
.nio .fig {
  height: min(calc(100vh - 170px), 720px); max-width: 100%; display: flex; align-items: flex-end; justify-content: center;
  animation: breathe var(--beat) ease-in-out infinite; transform-origin: 50% 100%;
}
/* 昔のウェブの切り抜き。縁はギザギザのまま、白い縁取りと黒い影を付ける */
.nio img {
  max-width: 100%; max-height: 100%; object-fit: contain; transform-origin: 50% 60%;
  filter: drop-shadow(3px 0 0 #fff) drop-shadow(-3px 0 0 #fff) drop-shadow(0 3px 0 #fff) drop-shadow(0 -3px 0 #fff) drop-shadow(6px 6px 0 rgb(0 0 0 / 0.35));
  image-rendering: pixelated;
  transition: transform 0.5s cubic-bezier(.3, 1.6, .5, 1);
}

@keyframes breathe {
  0%, 100% { transform: scale(1, 1); }
  45% { transform: scale(1.02, 0.99); }
}
.nio[data-pose="side"] img { transform: perspective(900px) rotateY(16deg) scale(0.96); }
.nio.right[data-pose="side"] img { transform: perspective(900px) rotateY(-16deg) scale(0.96); }
.nio[data-pose="double"] img { transform: scale(1.04); }
.nio[data-pose="lat"] img { transform: scale(1.05, 0.99); }
.nio.flex .fig { animation: flex 0.9s cubic-bezier(.3, 1.7, .5, 1), breathe var(--beat) ease-in-out 0.9s infinite; }
@keyframes flex {
  25% { transform: scale(calc(1 + var(--k) * 0.04), calc(1 - var(--k) * 0.015)) rotate(calc(var(--k) * -1deg)); }
  55% { transform: scale(calc(1 + var(--k) * 0.025), 1) rotate(calc(var(--k) * 0.6deg)); }
}
.nio .call {
  order: -1; position: relative; min-height: 1.6em; transform: scale(0.8); opacity: 0;
  max-width: 100%; margin: 0; white-space: normal; padding: 8px 14px; border-radius: 18px;
  background: var(--fg); color: var(--bg); font-weight: 900; font-size: 17px; text-align: center;
}
.nio .call::after {
  content: ""; position: absolute; left: 50%; bottom: -8px; margin-left: -8px;
  border: 8px solid transparent; border-top-color: var(--fg); border-bottom: 0;
}
.nio .call.in { animation: call 3.6s cubic-bezier(.3, 1.6, .5, 1) forwards; }
@keyframes call {
  0% { opacity: 0; transform: translateY(10px) scale(0.6); }
  10%, 80% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(-6px) scale(0.95); }
}

/* 知らせ */
.toast {
  position: fixed; left: 50%; bottom: 70px; transform: translate(-50%, 20px); opacity: 0; z-index: 30;
  max-width: calc(100vw - 32px); background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 12px;
  font-weight: 600; box-shadow: var(--shadow); transition: 0.3s; pointer-events: none;
}
.toast.in { transform: translate(-50%, 0); opacity: 1; }
.toast.note { background: var(--hot); color: #fff; bottom: auto; top: 70px; transform: translate(-50%, -20px); }
.toast.note.in { transform: translate(-50%, 0); }
.toast.streak { background: linear-gradient(90deg, #ff9500, var(--hot)); color: #fff; font-size: 17px; }
.toast.err { background: #b00020; color: #fff; }
.toast.dim { background: var(--card); color: var(--dim); }

/* 下から出る板 */
#sheet {
  position: fixed; inset: 0; z-index: 20; background: rgb(0 0 0 / 0); transition: background 0.25s;
  display: flex; align-items: flex-end; justify-content: center;
}
#sheet.in { background: rgb(0 0 0 / 0.4); }
.panel {
  width: 100%; max-width: 600px; max-height: 88vh; overflow-y: auto; background: var(--bg);
  border-radius: 18px 18px 0 0; transform: translateY(100%); transition: transform 0.25s; padding-bottom: env(safe-area-inset-bottom);
}
#sheet.in .panel { transform: none; }
.panel header {
  position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.panel .x { font-size: 22px; line-height: 1; padding: 0 4px; }
.cliff { display: block; width: 100%; padding: 16px; color: var(--hot); font-weight: 800; }
.thread > .dim { padding: 16px; }

.notes { padding: 4px 0; }
.note-row { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.note-row small { color: var(--dim); }

.settings { padding: 12px 16px 24px; }
.mech { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.mech input { margin-top: 4px; accent-color: var(--hot); width: 18px; height: 18px; }
.mech span { display: grid; }
.mech small { color: var(--dim); }
.settings h3 { font-size: 14px; margin: 20px 0 8px; }
.log { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.log th, .log td { text-align: right; padding: 4px 4px; border-bottom: 1px solid var(--line); }
.log th:first-child, .log td:first-child { text-align: left; }
.row { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.row button { border: 1px solid var(--line); border-radius: 99px; padding: 8px 16px; }
.row .quiet { color: var(--dim); }

.morning { padding: 16px; display: grid; gap: 8px; }
.morning p { margin: 0 0 8px; }
.ans { text-align: left; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }

/* 入口と閉じた画面 */
.login, .lock { max-width: 360px; margin: 18vh auto 0; padding: 0 16px; display: grid; gap: 12px; text-align: center; }
.login h1, .lock h1 { color: var(--hot); font-size: 40px; margin: 0; letter-spacing: -0.03em; }
.login input { font: inherit; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--fg); }
.login button { background: var(--hot); color: #fff; font-weight: 800; padding: 12px; border-radius: 12px; }
.login button:disabled { opacity: 0.5; }

/* 反応計。上の帯の1つのボタン。数が多いほど熱い色になる */
#meter {
  --heat: 0;
  display: flex; align-items: center; gap: 6px; padding: 5px 12px 5px 10px; border-radius: 99px;
  color: #fff; font-weight: 900;
  background: linear-gradient(90deg, color-mix(in srgb, #ff9500 calc(var(--heat) * 100%), var(--hot)), var(--hot));
  box-shadow: 0 0 calc(4px + var(--heat) * 22px) color-mix(in srgb, var(--hot) 70%, transparent);
}
#meter .dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: throb 1s ease-in-out infinite; }
#meter .num { font-size: 18px; font-variant-numeric: tabular-nums; }
#meter .unit { font-size: 11px; opacity: 0.85; }
#meter .mine { margin-left: 4px; background: #fff; color: var(--hot); border-radius: 99px; padding: 0 7px; font-size: 12px; }
#meter.beat { animation: pop2 0.5s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes pop2 { 40% { transform: scale(1.15); } }

/* 全画面の反応計 */
#stage {
  position: fixed; inset: 0; z-index: 50; overflow-y: auto; color: #fff; opacity: 0; transition: opacity 0.3s;
  background:
    radial-gradient(circle at 50% 30%, rgb(255 45 85 / 0.55), transparent 60%),
    radial-gradient(circle at 20% 90%, rgb(255 149 0 / 0.45), transparent 50%),
    radial-gradient(circle at 85% 80%, rgb(175 82 222 / 0.45), transparent 50%),
    #0b0010;
}
#stage.in { opacity: 1; }
#stage .x { position: fixed; top: 14px; right: 18px; z-index: 2; font-size: 30px; color: #fff; }
#stage .sky { position: fixed; inset: 0; overflow: hidden; }
#stage .inner { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; padding: 8vh 16px 60px; pointer-events: none; }
#stage .inner button { pointer-events: auto; }
#stage .lab { text-align: center; font-weight: 800; letter-spacing: 0.1em; opacity: 0.85; margin: 0; }
#stage .big {
  text-align: center; font-size: clamp(96px, 26vw, 200px); font-weight: 900; line-height: 1; margin: 8px 0 12px;
  font-variant-numeric: tabular-nums; text-shadow: 0 0 40px rgb(255 45 85 / 0.9), 0 0 8px #fff;
  animation: throb 1.2s ease-in-out infinite;
}
#stage .kinds { display: flex; justify-content: center; gap: 22px; font-size: 22px; }
#stage .k b { font-size: 30px; }
#stage .k.like { color: #ff6b8b; } #stage .k.rp { color: #3ee8a5; } #stage .k.reply { color: #8fd3ff; }
#stage h3 { margin: 36px 0 10px; font-size: 15px; letter-spacing: 0.08em; opacity: 0.85; }
#stage .dim { color: rgb(255 255 255 / 0.6); }
.hotrow, .noterow {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; width: 100%; text-align: left;
  padding: 10px 12px; margin-bottom: 8px; border-radius: 14px; color: #fff;
  background: rgb(255 255 255 / 0.1); backdrop-filter: blur(6px);
  animation: slidein 0.5s cubic-bezier(.3, 1.4, .5, 1) both; animation-delay: calc(var(--i) * 70ms);
}
.noterow { grid-template-columns: 24px 1fr auto; }
.noterow.new { background: rgb(255 45 85 / 0.45); box-shadow: 0 0 18px rgb(255 45 85 / 0.6); }
.noterow small { opacity: 0.7; }
.hotrow .snip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hotrow .plus2 { font-size: 22px; color: #ffd60a; text-shadow: 0 0 10px #ff9500; }
.hotrow .av { width: 40px; height: 40px; }
@keyframes slidein { from { opacity: 0; transform: translateY(20px) scale(0.95); } }
.float {
  position: absolute; bottom: -40px; font-size: calc(var(--s) * 22px); pointer-events: none;
  animation: floatup 4s ease-out forwards; text-shadow: 0 0 12px currentColor;
}
.float.like { color: #ff2d55; } .float.rp { color: #3ee8a5; } .float.reply { color: #8fd3ff; }
@keyframes floatup {
  to { transform: translate(var(--w), -110vh) rotate(20deg); opacity: 0; }
}

/* BGM のボタン */
#music { font-size: 18px; padding: 4px 6px; color: var(--hot); font-weight: 900; }
#music.off { color: var(--dim); text-decoration: line-through; }

/* 背景のモザイク。線の後ろで流れる。線そのものは不透明の地で読める */
#mosaic { position: fixed; inset: 0; z-index: 0; display: flex; overflow: hidden; pointer-events: none; opacity: 0.55; }
:root[data-theme="dark"] #mosaic { opacity: 0.4; }
#mosaic::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 40% 70% at 50% 50%, var(--bg) 40%, transparent 100%); }
.mcol { flex: 0 0 110px; display: flex; flex-direction: column; animation: mflow var(--dur) linear infinite; }
.mcol i { flex: 0 0 110px; background: center / cover no-repeat; border: 1px solid rgb(0 0 0 / 0.15); }
@keyframes mflow { from { transform: translateY(0); } to { transform: translateY(-50%); } }
#line { position: relative; z-index: 2; background: var(--bg); min-height: 100vh; box-shadow: 0 0 40px rgb(0 0 0 / 0.15); }
#top { z-index: 10; }
.nio { z-index: 3; }

/* 擬音。明朝の太字を縁取り、傾けて震わせる */
.onoma {
  position: fixed; z-index: 45; pointer-events: none; white-space: nowrap;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif; font-weight: 900;
  font-size: calc(22px + var(--k) * 46px); letter-spacing: -0.04em; color: #fff;
  -webkit-text-stroke: calc(2px + var(--k) * 2px) var(--hot); paint-order: stroke fill;
  text-shadow: 3px 3px 0 #000, 0 0 calc(var(--k) * 24px) var(--hot);
  transform: translate(-50%, -110%) rotate(var(--tilt)) scale(0.3);
  animation: onoma calc(1.1s + var(--k) * 0.4s) cubic-bezier(.2, 1.8, .4, 1) forwards;
}
.onoma.rp { -webkit-text-stroke-color: var(--rp); text-shadow: 3px 3px 0 #000, 0 0 calc(var(--k) * 24px) var(--rp); }
@keyframes onoma {
  12% { transform: translate(-50%, -110%) rotate(var(--tilt)) scale(1.15); }
  18% { transform: translate(calc(-50% + 4px), -112%) rotate(var(--tilt)) scale(1); }
  24% { transform: translate(calc(-50% - 4px), -108%) rotate(var(--tilt)) scale(1); }
  30%, 75% { transform: translate(-50%, -110%) rotate(var(--tilt)) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -150%) rotate(var(--tilt)) scale(1.05); opacity: 0; }
}

/* 昇天。画面が上へ浮いて薄れ、上から光が満ちる。9秒 */
body.ascend #app, body.ascend .nio, body.ascend #mosaic {
  animation: rise 8.5s cubic-bezier(.5, 0, .8, .4) forwards; pointer-events: none;
}
@keyframes rise { to { transform: translateY(-70vh) scale(0.85); opacity: 0; filter: blur(6px) brightness(1.8); } }
#heaven {
  position: fixed; inset: 0; z-index: 100; pointer-events: none; display: grid; place-items: center;
  background: radial-gradient(ellipse 80% 70% at 50% -10%, #fffbe8 0%, rgb(255 244 200 / 0.9) 30%, rgb(255 255 255 / 0) 75%);
  animation: dawn 9s ease-in forwards;
}
#heaven .rays {
  position: absolute; left: 50%; top: -20vh; width: 200vmax; height: 200vmax; margin-left: -100vmax;
  background: repeating-conic-gradient(from 0deg at 50% 50%, rgb(255 236 170 / 0.35) 0deg 6deg, transparent 6deg 18deg);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 0%, transparent 55%);
  mask-image: radial-gradient(circle at 50% 50%, #000 0%, transparent 55%);
  animation: spin 30s linear infinite;
}
#heaven p {
  position: relative; margin: 0; color: #8a6a24; letter-spacing: 0.4em; font-size: 22px; opacity: 0;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  animation: words 9s ease-in-out forwards;
}
@keyframes dawn { 0% { opacity: 0; } 30% { opacity: 0.7; } 85%, 100% { opacity: 1; background-color: #fff; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes words { 0%, 45% { opacity: 0; transform: translateY(10px); } 65%, 90% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* 入口の門 */
#gate {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; color: #fff;
  background:
    radial-gradient(circle at 50% 35%, rgb(255 45 85 / 0.5), transparent 60%),
    radial-gradient(circle at 15% 85%, rgb(255 149 0 / 0.35), transparent 50%),
    radial-gradient(circle at 85% 85%, rgb(175 82 222 / 0.4), transparent 50%),
    #0b0010;
  transition: opacity 0.5s;
}
#gate.out { opacity: 0; }
#gate .box { max-width: 420px; text-align: center; display: grid; gap: 10px; }
#gate h1 { margin: 0; font-size: 56px; letter-spacing: -0.03em; color: var(--hot); text-shadow: 0 0 30px rgb(255 45 85 / 0.8); }
#gate p { margin: 0; line-height: 1.7; }
#gate .warn { font-size: 20px; font-weight: 900; }
#gate .q {
  margin-top: 14px; font-size: 26px; font-weight: 900;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
}
#gate .yn { display: flex; gap: 12px; justify-content: center; margin-top: 8px; }
#gate .yn button { min-width: 130px; padding: 14px 20px; border-radius: 14px; font-size: 18px; font-weight: 900; }
#gate .yes { background: var(--hot); color: #fff; box-shadow: 0 0 24px rgb(255 45 85 / 0.7); }
#gate .no { background: rgb(255 255 255 / 0.12); color: #fff; }
#gate .skip { display: flex; gap: 8px; justify-content: center; align-items: center; font-size: 13px; opacity: 0.8; cursor: pointer; margin-top: 6px; }
#gate .skip input { accent-color: var(--hot); }
#gate .fine { font-size: 12px; opacity: 0.6; margin-top: 8px; }

/* 端末が暗い色の設定なら、昼でも暗くする */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #000000; --fg: #e7e9ea; --dim: #8b98a5; --line: #22272c; --card: #111518;
    --shadow: 0 6px 24px rgb(0 0 0 / 0.6); color-scheme: dark;
  }
}

/* 動きを減らす設定の人には、動きを止める */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  #mosaic { display: none; }
}

#line .wait { padding: 40px 16px; text-align: center; color: var(--dim); }

/* 音の許可を取るボタン */
#unlock {
  position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); z-index: 55; white-space: nowrap;
  background: var(--hot); color: #fff; font-weight: 900; font-size: 17px; padding: 14px 26px; border-radius: 99px;
  box-shadow: 0 0 30px rgb(255 45 85 / 0.7); animation: throb 1.2s ease-in-out infinite;
}
