/* ひとり社 — 墨と朱 */
:root {
  --ink: #0c0d10;
  --ink-2: #131418;
  --ink-3: #1a1b20;
  --line: rgba(214, 196, 158, .16);
  --line-2: rgba(214, 196, 158, .3);
  --paper: #e7e0d1;
  --muted: #8f897d;
  --faint: #6a665e;
  --gold: #b8a06c;
  --shu: #b4472d;
  --shu-2: #d0603f;
  --wood: #4d3a29;
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", "Noto Serif CJK JP", serif;
}
* { box-sizing: border-box; }
html { scrollbar-gutter: stable; } /* 縦のスクロールバーが出ても消えても、幅が変わらないように */
html, body { overflow-x: hidden; margin: 0; background: var(--ink); color: var(--paper); font-family: var(--serif); line-height: 1.9; -webkit-font-smoothing: antialiased; }
body::before { /* 和紙のざらつき */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: .035; /* 重ね方の計算をしない軽い方式 */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--shu); color: #fff; }
.tate { writing-mode: vertical-rl; text-orientation: mixed; }
.faint { color: var(--faint); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
[hidden] { display: none !important; }

/* ── ボタン：細い線、角は立てる */
button { cursor: pointer; background: transparent; border: 1px solid var(--line-2); border-radius: 0; padding: 6px 16px; font-size: 13px; letter-spacing: .14em; color: var(--paper); transition: background .3s, border-color .3s, color .3s; white-space: nowrap; }
button:hover { border-color: var(--gold); background: rgba(184, 160, 108, .07); }
.btn.shu, button.shu { border-color: var(--shu); color: #f3d9cf; }
.btn.shu:hover { background: var(--shu); color: #fff; }
button.on { border-color: var(--shu); background: var(--shu); color: #fff; }
button.ghost, button.link { border-color: transparent; color: var(--muted); padding: 4px 8px; }
button.ghost:hover, button.link:hover { color: var(--paper); background: transparent; border-color: transparent; text-decoration: underline; text-underline-offset: 4px; }
button.confirm { color: var(--shu-2); }
input, select, textarea { background: transparent; border: 0; border-bottom: 1px solid var(--line-2); border-radius: 0; padding: 6px 2px; width: 100%; outline: none; }
input:focus, select:focus, textarea:focus { border-bottom-color: var(--gold); }
select option { background: var(--ink-2); }
textarea { resize: vertical; border: 1px solid var(--line); padding: 8px 10px; background: rgba(0, 0, 0, .15); }
input[type=checkbox] { width: auto; accent-color: var(--shu); }
input[type=range] { -webkit-appearance: none; appearance: none; height: 22px; padding: 0; border: 0; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 1px; background: var(--line-2); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; margin-top: -6px; cursor: grab; background: var(--paper); border: 2px solid var(--shu); transform: rotate(45deg); }
input[type=range]::-moz-range-track { height: 1px; background: var(--line-2); }
input[type=range]::-moz-range-thumb { width: 9px; height: 9px; background: var(--paper); border: 2px solid var(--shu); border-radius: 0; transform: rotate(45deg); }
input.hue::-webkit-slider-runnable-track { height: 4px; background: linear-gradient(90deg, hsl(0,45%,50%), hsl(60,45%,50%), hsl(120,45%,50%), hsl(180,45%,50%), hsl(240,45%,50%), hsl(300,45%,50%), hsl(359,45%,50%)); }
input.hue::-webkit-slider-thumb { margin-top: -4px; }

/* ── 上の帯 */
.top { position: fixed; top: 0; left: 0; right: 0; z-index: 50; display: flex; align-items: center; gap: 34px; padding: 14px 32px 26px; background: linear-gradient(rgba(8, 9, 11, .88), rgba(8, 9, 11, .55) 60%, rgba(8, 9, 11, 0)); pointer-events: none; }
.top > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-size: 17px; letter-spacing: .5em; color: var(--paper); }
.brand .mark { width: 28px; height: 28px; color: var(--shu-2); }
nav { display: flex; gap: 26px; flex: 1; }
nav a { position: relative; text-decoration: none; font-size: 13px; letter-spacing: .25em; color: var(--muted); padding: 4px 0; transition: color .3s; }
nav a:hover { color: var(--paper); }
nav a.active { color: var(--paper); }
nav a.active::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 5px; height: 5px; margin-left: -3px; background: var(--shu-2); transform: rotate(45deg); }
.tools { display: flex; gap: 10px; align-items: center; }
.tools select { width: auto; min-width: 120px; font-size: 13px; letter-spacing: .1em; }
body.noauth nav, body.noauth .tools { visibility: hidden; }

main { max-width: 1180px; margin: 0 auto; padding: 96px 32px 80px; }
body.has-hero main { padding-top: 0; }
body.is-studio main { max-width: none; padding: 78px 24px 30px; }

.lead { margin: 10px 0 34px; }
.lead h1 { font-weight: 400; font-size: 30px; letter-spacing: .35em; margin: 0 0 6px; }
.lead p { margin: 0; color: var(--muted); font-size: 14px; letter-spacing: .06em; }
h2.sec { font-weight: 400; font-size: 18px; letter-spacing: .4em; margin: 0 0 22px; display: flex; align-items: baseline; gap: 18px; }
h2.sec small { font-size: 12px; letter-spacing: .2em; color: var(--faint); }
h2.sec::before { content: ""; width: 7px; height: 7px; background: var(--shu); transform: rotate(45deg) translateY(-3px); flex: none; }

/* ── 社の舞台（画面いっぱい） */
.hero { position: relative; width: 100vw; margin-left: calc(50% - 50vw); }
.stage { line-height: 0; background: #07080a; }
.stage svg { width: 100%; height: auto; display: block; }
.stage.full { animation: rise 1.6s ease-out both; }
@keyframes rise { from { opacity: 0; } to { opacity: 1; } }
.hero .stage.s3d::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 24%; z-index: 2; pointer-events: none; background: linear-gradient(rgba(12, 13, 16, 0), var(--ink)); }
.hero-title { position: absolute; top: 96px; right: 6vw; z-index: 3; display: flex; gap: 14px; align-items: flex-start; pointer-events: none; text-shadow: 0 2px 18px rgba(0, 0, 0, .65), 0 0 2px rgba(0, 0, 0, .5); }
.hero-title h1 { margin: 0; font-weight: 400; font-size: 42px; letter-spacing: .32em; line-height: 1.2; }
.hero-title h1.big { font-size: 64px; letter-spacing: .4em; }
.hero-title .owner { margin: 0; padding-top: 1.6em; font-size: 14px; letter-spacing: .3em; color: rgba(231, 224, 209, .78); }
.hero-title .lede { margin: 0; padding-top: 3.2em; font-size: 15px; letter-spacing: .25em; line-height: 2.2; color: rgba(231, 224, 209, .85); }
.hero .back { position: absolute; left: 32px; top: 86px; z-index: 4; font-size: 13px; letter-spacing: .2em; color: var(--muted); text-decoration: none; padding-left: 22px; }
.hero .back::before { content: ""; position: absolute; left: 0; top: 50%; width: 14px; height: 1px; background: currentColor; }
.hero .back:hover { color: var(--paper); }
.scroll-cue { position: absolute; left: 50%; bottom: 22px; z-index: 5; transform: translateX(-50%); font-size: 11px; letter-spacing: .4em; color: var(--muted); border: 0; background: transparent; padding: 4px 8px; }
.scroll-cue:hover { color: var(--paper); background: transparent; }
.scroll-cue::after { content: ""; display: block; width: 1px; height: 26px; margin: 8px auto 0; background: linear-gradient(var(--muted), transparent); animation: cue 2.4s ease-in-out infinite; }
@keyframes cue { 0%, 100% { transform: scaleY(.4); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } }

/* 3Dの上の操作 */
.s3d { position: relative; overflow: hidden; }
.s3d canvas { display: block; width: 100%; cursor: grab; touch-action: none; opacity: 0; transition: opacity .35s ease; }
.s3d.ready canvas { opacity: 1; }
.s3d-wait { position: absolute; left: 50%; top: 50%; z-index: 3; transform: translate(-50%, -50%); font-size: 12px; letter-spacing: .4em; color: var(--muted); opacity: 0; pointer-events: none; line-height: 1.6; }
.s3d:not(.ready) .s3d-wait { animation: waitIn .4s ease .6s forwards; } /* 準備が長いときだけ出す */
@keyframes waitIn { to { opacity: 1; } }
.s3d canvas:active { cursor: grabbing; }
.s3d[data-mode="inside"] canvas { cursor: crosshair; }
.s3d-veil { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, transparent 40%, hsla(292, 35%, 18%, 1) 100%); }
.s3d-ui { position: absolute; left: 32px; bottom: 30px; z-index: 4; display: flex; gap: 10px; align-items: center; line-height: 1.5; }
.hero .s3d-ui { bottom: 64px; }
body.is-studio .s3d-ui { left: 14px; bottom: 14px; }
.s3d-views { display: flex; }
.s3d-views button { background: rgba(10, 11, 13, .5); backdrop-filter: blur(6px); border-color: rgba(231, 224, 209, .22); font-size: 12px; padding: 5px 14px; }
.s3d-views button + button { border-left: 0; }
.s3d-views button.on { background: rgba(180, 71, 45, .9); border-color: transparent; }
.s3d-look { background: rgba(10, 11, 13, .5); backdrop-filter: blur(6px); border-color: rgba(231, 224, 209, .22); font-size: 12px; padding: 5px 12px; display: none; }
.s3d[data-mode="inside"] .s3d-look { display: inline-block; }
.s3d-look.on { border-color: var(--gold); color: #f4e6c4; background: rgba(10, 11, 13, .5); }
.s3d-help { width: 28px; height: 28px; padding: 0; border-radius: 50%; background: rgba(10, 11, 13, .5); border-color: rgba(231, 224, 209, .22); font-size: 12px; letter-spacing: 0; }
.s3d-hint { position: absolute; left: 32px; bottom: 76px; z-index: 4; padding: 12px 16px; background: rgba(10, 11, 13, .86); border: 1px solid var(--line); line-height: 1.7; font-size: 12px; letter-spacing: .06em; opacity: 0; transform: translateY(6px); transition: opacity .5s, transform .5s; pointer-events: none; }
.hero .s3d-hint { bottom: 110px; }
body.is-studio .s3d-hint { left: 14px; bottom: 56px; }
.s3d.hint-on .s3d-hint { opacity: 1; transform: none; }
.s3d-hint div { display: flex; gap: 16px; }
.s3d-hint b { font-weight: 400; color: var(--gold); min-width: 6.5em; }
.s3d-hint span { color: var(--paper); }
.s3d-walk { position: absolute; right: 30px; bottom: 30px; z-index: 4; display: none; flex-direction: column; gap: 6px; line-height: 1.2; }
.hero .s3d-walk { bottom: 70px; }
.s3d[data-mode="inside"] .s3d-walk { display: flex; }
.s3d-walk button { width: 42px; height: 42px; padding: 0; font-size: 13px; letter-spacing: 0; background: rgba(10, 11, 13, .5); border-color: rgba(231, 224, 209, .22); user-select: none; }

/* ── 境内（立札と絵馬） */
.grounds { display: grid; grid-template-columns: 220px 1fr; gap: 60px; align-items: start; margin: 40px 0 70px; }
.tatefuda { display: flex; flex-direction: column; align-items: center; filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .5)); }
.tf-roof { width: 214px; height: 20px; background: linear-gradient(#2c2219, #1d1711); clip-path: polygon(6% 0, 94% 0, 100% 100%, 0 100%); }
.tf-board { width: 196px; min-height: 330px; padding: 22px 18px; display: flex; flex-direction: row-reverse; gap: 14px;
  background: repeating-linear-gradient(90deg, rgba(0, 0, 0, .06) 0 2px, transparent 2px 9px), linear-gradient(90deg, #5a4430, #6a513a 40%, #57412d); color: #f1e8d4; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35), inset 0 0 30px rgba(0, 0, 0, .3); }
.tf-board h2 { writing-mode: vertical-rl; margin: 0; font-weight: 400; font-size: 17px; letter-spacing: .6em; padding-left: 10px; border-left: 1px solid rgba(241, 232, 212, .3); }
.tf-board p { margin: 0; font-size: 15px; letter-spacing: .2em; line-height: 2; max-height: 300px; overflow: auto; }
.tf-board p.faint { color: rgba(241, 232, 212, .55); }
.tf-post { width: 18px; height: 70px; background: linear-gradient(90deg, #3b2c1f, #4d3a29); }

.ema-row { display: flex; flex-wrap: wrap; gap: 26px 22px; align-items: flex-start; }
.ema-row.wide-row { margin-bottom: 40px; }
.ema { position: relative; width: 210px; padding-top: 16px; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .45)); transform-origin: 50% 0; }
.ema::before { content: ""; position: absolute; top: 0; left: 50%; width: 1.5px; height: 30px; background: #b13a2a; transform: translateX(-50%); z-index: 2; }
.ema:nth-child(3n+1) { transform: rotate(-1.6deg); }
.ema:nth-child(3n+2) { transform: rotate(1.1deg); }
.ema:nth-child(4n) { transform: rotate(-.6deg); }
.ema-in { position: relative; min-height: 170px; padding: 40px 18px 18px; color: #2b2118; clip-path: polygon(50% 0, 100% 20%, 100% 100%, 0 100%, 0 20%);
  background: repeating-linear-gradient(176deg, rgba(90, 60, 30, .07) 0 3px, transparent 3px 11px), linear-gradient(160deg, #d8c29b, #c8ad80 60%, #bd9f72); }
.ema-in::before { content: ""; position: absolute; top: 18px; left: 50%; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: #3a2b1d; }
.ema-kind { display: block; font-size: 11px; letter-spacing: .25em; color: #7a5a3a; margin-bottom: 4px; }
.ema-in p { margin: 0; font-size: 14px; line-height: 1.85; letter-spacing: .04em; }
.ema-in .muted { color: #8a7458; }
.ema .tag { position: absolute; top: 34px; right: 12px; font-size: 10px; letter-spacing: .15em; color: #8a3524; border: 1px solid rgba(138, 53, 36, .5); padding: 0 5px; }
.ema-date { display: block; margin-top: 10px; font-size: 11px; color: #7a5a3a; letter-spacing: .1em; }
.ema-ops { display: flex; gap: 2px; margin: 4px -8px -6px; }
.ema-ops button { color: #6b4e33; font-size: 11px; padding: 2px 8px; }
.ema-ops button:hover { color: #2b2118; }
.ema-ops button.confirm { color: #a0331f; }

/* ── ことづて（結ばれた紙） */
.kotozute { margin: 0 0 80px; }
.koto-row { display: flex; flex-direction: row-reverse; flex-wrap: wrap; justify-content: flex-end; gap: 18px; margin-bottom: 26px; }
.koto { position: relative; display: flex; flex-direction: row-reverse; gap: 6px; height: 230px; padding: 30px 12px 14px; background: linear-gradient(90deg, #ebe5d8, #f3eee3 50%, #e6dfd0); color: #2a241d; box-shadow: 0 10px 20px rgba(0, 0, 0, .4); }
.koto::before { content: ""; position: absolute; top: 12px; left: -3px; right: -3px; height: 6px; background: #b4472d; opacity: .85; }
.koto p { margin: 0; font-size: 14px; letter-spacing: .18em; line-height: 1.9; }
.koto span { font-size: 11px; color: #7b7263; letter-spacing: .2em; align-self: flex-end; }
.koto .koto-del { position: absolute; bottom: 4px; left: 6px; font-size: 10px; color: #8a5a4a; padding: 2px 4px; }
.koto .koto-del.confirm { color: #b4472d; }
.koto-form { display: flex; gap: 14px; align-items: flex-end; max-width: 640px; }
.koto-form button { flex: none; }
.koto-pick { max-width: 760px; }
.koto-pick .chips button { font-size: 13px; padding: 6px 12px; }
.koto.old { opacity: .7; }
.hint { color: var(--faint); font-size: 13px; letter-spacing: .1em; text-align: center; margin-top: -30px; }

/* ── よその社 */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 4px; }
.frame { position: relative; display: block; overflow: hidden; text-decoration: none; background: #07080a; }
.shot { line-height: 0; }
.shot img, .shot svg { width: 100%; display: block; aspect-ratio: 8 / 5; object-fit: cover; transition: transform 1.2s ease, filter 1.2s ease; filter: saturate(.9) brightness(.86); }
.frame:hover .shot img { transform: scale(1.04); filter: none; }
.cap { position: absolute; top: 18px; right: 16px; bottom: 18px; display: flex; flex-direction: row-reverse; gap: 8px; text-shadow: 0 2px 14px rgba(0, 0, 0, .8); pointer-events: none; }
.cap b { font-weight: 400; font-size: 21px; letter-spacing: .3em; }
.cap span { font-size: 12px; letter-spacing: .25em; color: rgba(231, 224, 209, .75); padding-top: 2.4em; }

/* ── 参拝記録の帳面 */
.vform { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px 28px; padding: 26px 30px; margin-bottom: 50px; border: 1px solid var(--line); background: linear-gradient(var(--ink-2), var(--ink)); }
.vform label { font-size: 12px; letter-spacing: .2em; color: var(--muted); }
.vform .wide { grid-column: 1 / -1; }
.vform label.chk { display: flex; gap: 10px; align-items: center; letter-spacing: .1em; }
.vform button { justify-self: end; align-self: end; }

/* ── 住人とデータ */
.box { border: 1px solid var(--line); padding: 22px 26px; margin-bottom: 22px; background: var(--ink-2); }
.box h2 { font-weight: 400; font-size: 16px; letter-spacing: .35em; margin: 0 0 8px; }
.box p { font-size: 13px; }
.row { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
.users { list-style: none; padding: 0; }
.users li { margin: 6px 0; }
.inline { display: flex; gap: 12px; margin-top: 12px; max-width: 480px; align-items: flex-end; }
.inline button { flex: none; }
.file { display: inline-block; border: 1px solid var(--line-2); padding: 6px 16px; cursor: pointer; font-size: 13px; letter-spacing: .14em; }
.file input { display: none; }

/* ── はじめて */
.welcome-form { position: absolute; left: 50%; bottom: 13vh; z-index: 4; transform: translateX(-50%); display: flex; gap: 14px; align-items: flex-end; width: min(440px, 86vw); padding: 18px 22px; background: rgba(10, 11, 13, .55); backdrop-filter: blur(8px); border: 1px solid var(--line); }
.welcome-form button { flex: none; }
.welcome .s3d-ui, .welcome .s3d-hint { display: none; }

/* ── 知らせ */
#toast { position: fixed; left: 50%; bottom: 34px; z-index: 60; transform: translateX(-50%) translateY(16px); background: rgba(12, 13, 16, .92); border: 1px solid var(--line-2); border-left: 3px solid var(--shu); padding: 9px 20px; opacity: 0; transition: .6s; pointer-events: none; font-size: 13px; letter-spacing: .12em; }
#toast.show { opacity: 1; transform: translateX(-50%); }

/* ── 2Dの絵（3Dが使えないとき）の動き */
.yashiro .drift { animation: drift 40s ease-in-out infinite alternate; }
.yashiro .tw { animation: tw 5s ease-in-out infinite; }
.yashiro .float { animation: float 9s ease-in-out infinite; }
.yashiro .fall { animation: fall 1.1s linear infinite; }
.yashiro .fall.slow { animation-duration: 16s; }
@keyframes drift { from { transform: translateX(-50px); } to { transform: translateX(50px); } }
@keyframes tw { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@keyframes float { 0%, 100% { transform: translate(0, 0); opacity: .25; } 50% { transform: translate(7px, -12px); opacity: 1; } }
@keyframes fall { from { transform: translateY(0); } to { transform: translateY(500px); } }
.yashiro.static * { animation: none !important; }
@media (prefers-reduced-motion: reduce) { .yashiro *, .stage.full, .scroll-cue::after { animation: none !important; } }

/* ── 工房（整える） */
.studio { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.toolbar { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; }
.seg button { font-size: 12px; padding: 6px 16px; color: var(--muted); }
.seg button + button { border-left: 0; }
.seg button.on { color: #fff; }
.studio-main .stage { border: 1px solid var(--line); }
.keys { margin: 8px 2px 0; color: var(--faint); letter-spacing: .08em; }
.studio-side { position: sticky; top: 74px; max-height: calc(100vh - 88px); display: flex; flex-direction: column; background: rgba(19, 20, 24, .92); border: 1px solid var(--line); }
.tabs { display: flex; flex-wrap: wrap; gap: 0 16px; padding: 10px 16px 0; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; padding: 6px 0 9px; font-size: 12px; letter-spacing: .2em; color: var(--muted); background: transparent; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button:hover { color: var(--paper); background: transparent; }
.tabs button.on { color: var(--paper); background: transparent; border-bottom-color: var(--shu); }
.tabbody { padding: 14px 18px 20px; overflow-y: auto; font-size: 13px; }
.tabbody label { display: block; margin: 12px 0; }
.tabbody label span { display: block; color: var(--muted); font-size: 12px; letter-spacing: .12em; margin-bottom: 2px; }
.tabbody label.chk { display: flex; gap: 8px; align-items: center; }
.pal { margin: 12px 0 16px; }
.pal h3 { font-size: 11px; font-weight: 400; color: var(--gold); margin: 0 0 8px; letter-spacing: .3em; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chips button { font-size: 12px; letter-spacing: .08em; padding: 4px 10px; border-color: var(--line); color: var(--paper); }
.chips button.on { border-color: var(--shu); background: var(--shu); }
.objtitle { margin: 0 0 6px; font-weight: 400; font-size: 18px; letter-spacing: .35em; }
fieldset.mini { border: 1px solid var(--line); padding: 4px 14px 12px; margin: 14px 0; }
fieldset.mini legend { color: var(--gold); font-size: 11px; letter-spacing: .3em; padding: 0 6px; }
/* 位置と高さ（XYZ）：名前・ツマミ・数字を1行に */
fieldset.xyz label { display: grid; grid-template-columns: 4.6em 1fr 3.2em; align-items: center; gap: 8px; margin: 8px 0; }
.tabbody fieldset.xyz label span { margin: 0; letter-spacing: .06em; }
fieldset.xyz input[type=range] { width: 100%; }
fieldset.xyz output { text-align: right; font-variant-numeric: tabular-nums; color: var(--paper); font-size: 12px; }
fieldset.xyz button { margin-top: 4px; }
.empty { color: var(--paper); line-height: 1.9; }
.empty ul { padding-left: 18px; }
.warn { margin: 12px; padding: 8px 12px; border: 1px solid rgba(180, 71, 45, .5); font-size: 12px; color: #f0b3a3; }

@media (max-width: 1000px) {
  .studio { grid-template-columns: 1fr; }
  .studio-side { position: static; max-height: none; }
  .grounds { grid-template-columns: 1fr; justify-items: center; }
  .vform { grid-template-columns: 1fr; }
  .top { gap: 16px; padding: 10px 16px 20px; flex-wrap: wrap; }
  nav { gap: 14px; }
  .hero-title h1 { font-size: 30px; }
}

/* マイクラ式の視点 */
.s3d-cue { position: absolute; left: 50%; top: 50%; z-index: 5; transform: translate(-50%, -50%); padding: 10px 22px; background: rgba(10, 11, 13, .78); border: 1px solid var(--line-2); font-size: 13px; letter-spacing: .2em; line-height: 1.6; opacity: 0; transition: opacity .4s; pointer-events: none; }
.s3d.cue-on .s3d-cue, .s3d.cue-flash .s3d-cue { opacity: 1; }
.s3d-cross { position: absolute; left: 50%; top: 50%; z-index: 5; width: 14px; height: 14px; margin: -7px 0 0 -7px; pointer-events: none; opacity: 0; transition: opacity .3s; }
.s3d-cross::before, .s3d-cross::after { content: ""; position: absolute; background: rgba(255, 255, 255, .75); box-shadow: 0 0 2px rgba(0, 0, 0, .6); }
.s3d-cross::before { left: 6px; top: 0; width: 2px; height: 14px; }
.s3d-cross::after { top: 6px; left: 0; width: 14px; height: 2px; }
.s3d.locked .s3d-cross { opacity: 1; }
.s3d.locked canvas { cursor: none; }

button:disabled, button:disabled:hover { opacity: .35; cursor: default; background: transparent; border-color: var(--line-2); }
.users li { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* 島タブ：リセットの並び */
.resets { display: flex; flex-direction: column; gap: 6px; }
.resets button { text-align: left; white-space: normal; line-height: 1.6; }
.resets button.confirm { border-color: var(--shu); color: #f3c9bb; }
.chips button.confirm { border-color: var(--shu); color: #f3c9bb; white-space: normal; }

/* ───────────────────────── スマホ（指の操作・画面の作り） ───────────────────────── */
.bnav { display: none; }
.s3d-full, .s3d-stick { display: none; }
.s3d.is-touch .s3d-look, .s3d.is-touch .s3d-walk, .s3d.is-touch .s3d-cue, .s3d.is-touch .s3d-cross { display: none !important; }
/* 全画面（スマホの見る画面） */
.s3d:not(.editable) .s3d-full { display: block; position: absolute; right: 12px; bottom: 16px; z-index: 6; padding: 6px 14px; font-size: 12px; letter-spacing: .2em; background: rgba(10, 11, 13, .6); border-color: rgba(231, 224, 209, .3); }
.hero .s3d:not(.editable) .s3d-full { bottom: 64px; right: 30px; }
.welcome .s3d-full { display: none !important; }
.s3d.s3d-fs { position: fixed !important; inset: 0; z-index: 90; width: 100vw !important; margin: 0 !important; }
.s3d.s3d-fs::after { display: none; }
.s3d.s3d-fs .s3d-full { top: calc(12px + env(safe-area-inset-top)); bottom: auto !important; right: 12px; }
.s3d.s3d-fs .s3d-ui { bottom: calc(18px + env(safe-area-inset-bottom)) !important; }
body.s3d-fullscreen { overflow: hidden; }
body.s3d-fullscreen .top, body.s3d-fullscreen .bnav { display: none !important; }
/* 歩く丸 */
.s3d.is-touch[data-mode="inside"] .s3d-stick { display: block; position: absolute; right: 18px; bottom: 64px; z-index: 6; width: 112px; height: 112px; border-radius: 50%; background: rgba(10, 11, 13, .35); border: 1px solid rgba(231, 224, 209, .3); touch-action: none; }
.hero .s3d.is-touch[data-mode="inside"] .s3d-stick { bottom: 108px; }
.s3d.s3d-fs[data-mode="inside"] .s3d-stick { bottom: calc(70px + env(safe-area-inset-bottom)) !important; }
body.is-studio .s3d.is-touch[data-mode="inside"] .s3d-stick { bottom: 16px; }
.s3d-stick .knob { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: rgba(231, 224, 209, .82); box-shadow: 0 2px 10px rgba(0, 0, 0, .5); pointer-events: none; }

@media (max-width: 760px) and (orientation: portrait), (max-width: 480px) {
  /* スマホ縦。上の帯：名前と音だけ。メニューは下のタブへ */
  .top { padding: calc(8px + env(safe-area-inset-top)) 14px 18px; gap: 10px; flex-wrap: nowrap; }
  .top nav { display: none; }
  .brand { font-size: 15px; letter-spacing: .4em; }
  .brand .mark { width: 24px; height: 24px; }
  .tools { margin-left: auto; }
  .tools select { display: none; }
  .tools #snd { padding: 5px 12px; font-size: 12px; letter-spacing: .1em; }
  /* 下のタブ */
  .bnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; height: calc(58px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: rgba(10, 11, 13, .95); border-top: 1px solid var(--line); }
  .bnav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; text-decoration: none; color: var(--muted); font-size: 10px; letter-spacing: .08em; position: relative; }
  .bnav a i { font-style: normal; font-size: 17px; line-height: 1.2; }
  .bnav a.active { color: var(--paper); }
  .bnav a.active i { color: var(--shu-2); }
  body.noauth .bnav { display: none; }
  main { padding: calc(64px + env(safe-area-inset-top)) 16px calc(96px + env(safe-area-inset-bottom)); }
  body.has-hero main { padding-top: 0; }
  /* 社の舞台 */
  .hero-title { top: calc(58px + env(safe-area-inset-top)); right: 14px; gap: 8px; }
  .hero-title h1 { font-size: 26px; letter-spacing: .26em; }
  .hero-title h1.big { font-size: 40px; }
  .hero-title .owner { font-size: 11px; }
  .hero-title .lede { font-size: 12px; letter-spacing: .18em; line-height: 2; }
  .hero .back { top: calc(60px + env(safe-area-inset-top)); left: 14px; font-size: 12px; }
  .s3d-ui { left: 12px; bottom: 16px; }
  .hero .s3d-ui { bottom: 64px; }
  .s3d-views button { padding: 6px 12px; }
  .s3d-hint { left: 12px; right: 12px; bottom: 60px; font-size: 11px; }
  .hero .s3d-hint { bottom: 108px; }
  .s3d-hint b { min-width: 6em; }
  .scroll-cue { bottom: 18px; }
  .lead h1 { font-size: 23px; letter-spacing: .25em; }
  h2.sec { font-size: 16px; letter-spacing: .3em; }
  .grounds { margin: 24px 0 50px; gap: 34px; }
  .ema-row { justify-content: center; }
  .ema { width: min(260px, 82vw); }
  .koto-row { justify-content: center; }
  .koto-form { flex-direction: column; align-items: stretch; }
  .gallery { grid-template-columns: 1fr; }
  .vform { padding: 18px 16px; }
  .welcome-form { bottom: calc(90px + env(safe-area-inset-bottom)); width: calc(100vw - 32px); }
  .inline { flex-direction: column; align-items: stretch; }
  /* 整える：3Dを大きく、設定は下から引き出す */
  body.is-studio main { padding: calc(56px + env(safe-area-inset-top)) 10px calc(120px + env(safe-area-inset-bottom)); }
  .studio { display: block; }
  .toolbar { margin-bottom: 8px; gap: 6px; }
  .seg button { padding: 6px 10px; font-size: 11px; letter-spacing: .06em; }
  .keys { display: none; }
  .studio-side { position: fixed !important; left: 0; right: 0; top: auto !important; bottom: calc(58px + env(safe-area-inset-bottom)); z-index: 55; max-height: 62vh; border-left: 0; border-right: 0; background: rgba(16, 17, 21, .97); transform: translateY(calc(100% - 48px)); transition: transform .3s ease; box-shadow: 0 -10px 30px rgba(0, 0, 0, .45); }
  .studio-side.open { transform: none; }
  .sheet-handle { display: block !important; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; gap: 0 14px; padding: 4px 14px 0; scrollbar-width: none; }
  .tabs button { flex: none; padding: 6px 0 9px; }
  .tabbody { max-height: calc(62vh - 70px); }
}
.sheet-handle { display: none; width: 100%; height: 18px; border: 0; padding: 0; background: transparent; position: relative; cursor: pointer; }
.sheet-handle::before { content: ""; position: absolute; left: 50%; top: 7px; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: rgba(231, 224, 209, .35); }

/* ───────────────────────── スマホ横向き：PC版と同じ並び ───────────────────────── */
@media (orientation: landscape) and (max-height: 520px) {
  .top { padding: calc(4px + env(safe-area-inset-top)) calc(14px + env(safe-area-inset-right)) 10px calc(14px + env(safe-area-inset-left)); gap: 18px; flex-wrap: nowrap; }
  .brand { font-size: 14px; letter-spacing: .35em; }
  .brand .mark { width: 22px; height: 22px; }
  nav { gap: 16px; }
  nav a { font-size: 12px; letter-spacing: .15em; }
  .tools select { display: none; }
  .tools #snd { padding: 4px 10px; font-size: 11px; }
  .bnav { display: none !important; }
  main { padding: 52px calc(18px + env(safe-area-inset-right)) 40px calc(18px + env(safe-area-inset-left)); }
  body.has-hero main { padding-top: 0; }
  .hero-title { top: 46px; right: calc(16px + env(safe-area-inset-right)); }
  .hero-title h1 { font-size: 24px; letter-spacing: .24em; }
  .hero-title h1.big { font-size: 34px; }
  .hero-title .lede { font-size: 11px; line-height: 1.9; }
  .hero .back { top: 48px; }
  .hero .s3d-ui { bottom: 14px; }
  .hero .s3d-hint { bottom: 56px; }
  .hero .s3d:not(.editable) .s3d-full { bottom: 14px; }
  .hero .s3d.is-touch[data-mode="inside"] .s3d-stick { bottom: 56px; }
  .scroll-cue { bottom: 10px; }
  .welcome-form { bottom: 16px; }
  /* 整える：左に3D、右に設定（PC版と同じ） */
  body.is-studio main { padding: 46px calc(10px + env(safe-area-inset-right)) 8px calc(10px + env(safe-area-inset-left)); }
  .studio { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 10px; }
  .studio-side { position: sticky !important; top: 46px; max-height: calc(100vh - 54px); transform: none !important; }
  .sheet-handle { display: none !important; }
  .toolbar { margin-bottom: 6px; }
  .seg button { padding: 4px 9px; font-size: 11px; letter-spacing: .04em; }
  .keys { display: none; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tabs button { flex: none; }
  .tabbody { max-height: none; }
  body.is-studio .s3d-ui { bottom: 8px; left: 8px; }
}

/* ───────────────────────── 指で触る端末のこまかい調整 ───────────────────────── */
@media (pointer: coarse) {
  button, a, label, select { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
  .s3d, .s3d * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
  input, textarea, select { font-size: 16px !important; } /* iPhoneで文字を打つときに画面が勝手に拡大しないように */
  input[type=range] { height: 32px; }
  input[type=range]::-webkit-slider-thumb { width: 22px; height: 22px; margin-top: -10px; }
  input[type=range]::-moz-range-thumb { width: 18px; height: 18px; }
  .chips button { min-height: 36px; padding: 6px 12px; }
  .resets button { min-height: 42px; }
  .seg button { min-height: 34px; }
  .s3d-views button, .s3d-help, .s3d-full { min-height: 34px; }
  .s3d-help { width: 34px; height: 34px; }
}

/* 保存した社の一覧 */
.saves { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.save-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); }
.save-item.cur { border-color: var(--shu); }
.save-name { display: flex; flex-direction: column; min-width: 0; }
.save-name b { font-weight: 400; letter-spacing: .1em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.save-name span { font-size: 11px; color: var(--muted); }
.save-item .row { margin: 0; flex: none; }
.save-item button { padding: 4px 10px; font-size: 12px; }
/* 端末の情報 */
.devinfo { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 12px; margin: 10px 0 0; }
.devinfo dt { color: var(--muted); }
.devinfo dd { margin: 0; word-break: break-all; }

/* 視野のつまみ */
.s3d-fovbtn { background: rgba(10, 11, 13, .5); border-color: rgba(231, 224, 209, .22); font-size: 12px; padding: 5px 12px; }
.s3d-orbit { background: rgba(10, 11, 13, .5); border-color: rgba(231, 224, 209, .22); font-size: 12px; padding: 5px 12px; }
.s3d-orbit.on { background: var(--shu); border-color: var(--shu); color: #fff; }
.s3d-fovbtn.on { border-color: var(--gold); color: #f4e6c4; background: rgba(10, 11, 13, .5); }
.s3d-fov { position: absolute; left: 32px; bottom: 74px; z-index: 6; display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: rgba(10, 11, 13, .82); border: 1px solid var(--line-2); line-height: 1.4; }
.s3d-fov[hidden] { display: none !important; }
.s3d-fov-label { font-size: 12px; color: var(--muted); letter-spacing: .1em; white-space: nowrap; }
.s3d-fov input { width: 170px; }
.s3d-fov-val { font-weight: 400; font-size: 12px; min-width: 6.5em; color: var(--paper); }
.s3d-fov-auto { padding: 3px 10px; font-size: 11px; }
.hero .s3d-fov { bottom: 108px; }
body.is-studio .s3d-fov { left: 14px; bottom: 56px; }
@media (max-width: 760px) and (orientation: portrait), (max-width: 480px) {
  .s3d-fov { left: 12px; right: 12px; bottom: 60px; }
  .hero .s3d-fov { bottom: 108px; }
  .s3d-fov input { flex: 1; width: auto; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .hero .s3d-fov { bottom: 56px; }
  body.is-studio .s3d-fov { bottom: 48px; left: 8px; }
}

/* 全画面ボタン（上の帯） */
.tools #fsBtn[hidden] { display: none; }
@media (orientation: landscape) and (max-height: 520px) { .tools #fsBtn { padding: 4px 10px; font-size: 11px; } }
/* スマホを縦にしたとき：横向きにするよう案内（スマホは横向きで使う） */
.rotate-cue { display: none; }
@media (orientation: portrait) {
  body.touch .rotate-cue { display: flex; position: fixed; inset: 0; z-index: 300; align-items: center; justify-content: center; text-align: center; padding: 32px; background: radial-gradient(ellipse at center, #1a1b20, var(--ink) 70%); }
  body.touch .rotate-cue p { margin: 10px 0 0; letter-spacing: .2em; font-size: 16px; }
  body.touch .rotate-cue p.small { font-size: 12px; color: var(--muted); letter-spacing: .1em; }
  body.touch .rotate-cue button { margin-top: 26px; }
  body.touch .rotate-cue button[hidden] { display: none; }
  .rot-icon { width: 46px; height: 76px; margin: 0 auto 18px; border: 2px solid var(--paper); border-radius: 8px; animation: rotIcon 2.4s ease-in-out infinite; }
  @keyframes rotIcon { 0%, 25% { transform: rotate(0); } 55%, 80% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }
}

/* ── 迷い込む：画面いっぱいの3D。上の帯と下のタブは隠す。移りは霧だけ */
body.is-mayoi .top, body.is-mayoi .bnav { display: none; }
body.is-mayoi main { padding: 0; }
.mayoi { position: fixed; inset: 0; z-index: 5; background: #0c0d10; overflow: hidden; }
.mayoi .stage { position: absolute; inset: 0; }
.m-fog { position: absolute; inset: 0; z-index: 6; pointer-events: none; background: radial-gradient(ellipse at 50% 58%, #eef0ee 0%, #dfe3e3 55%, #cfd5d6 100%); opacity: 1; transition: opacity 2.6s ease; }
.m-fog.clear { opacity: 0; transition: opacity 2.4s ease; }
.m-cap { position: absolute; left: 50%; bottom: 20%; transform: translateX(-50%); z-index: 7; margin: 0; color: rgba(240, 236, 226, .94); font-size: 15px; letter-spacing: .4em; text-shadow: 0 1px 14px rgba(0, 0, 0, .75), 0 0 2px rgba(0, 0, 0, .6); opacity: 0; transition: opacity 1.2s ease; pointer-events: none; white-space: nowrap; }
.m-cap.on { opacity: 1; }
.m-act { position: absolute; left: 50%; bottom: 27%; transform: translateX(-50%); z-index: 7; display: flex; flex-direction: column; align-items: center; gap: 8px; opacity: 0; transition: opacity .7s ease; pointer-events: none; }
.m-act.on { opacity: 1; pointer-events: auto; }
.m-act button { font-size: 18px; letter-spacing: .6em; padding: 12px 18px 12px 30px; color: var(--paper); background: rgba(12, 13, 16, .42); border: 1px solid rgba(240, 236, 226, .55); backdrop-filter: blur(3px); }
.m-act button:hover { background: rgba(180, 71, 45, .55); border-color: rgba(240, 236, 226, .8); }
.m-act small { font-size: 11px; letter-spacing: .25em; color: rgba(240, 236, 226, .7); text-shadow: 0 1px 8px rgba(0, 0, 0, .8); }
.m-reveal { position: absolute; top: 9vh; right: 6vw; z-index: 7; display: flex; flex-direction: row-reverse; align-items: flex-start; gap: 18px; opacity: 0; transition: opacity 2.4s ease; pointer-events: none; color: var(--paper); text-shadow: 0 2px 18px rgba(0, 0, 0, .75), 0 0 2px rgba(0, 0, 0, .6); }
.m-reveal.on { opacity: 1; }
.m-reveal h1 { writing-mode: vertical-rl; margin: 0; font-weight: 400; font-size: 44px; letter-spacing: .32em; line-height: 1.2; }
.m-reveal .owner { writing-mode: vertical-rl; margin: 0; padding-top: 1.6em; font-size: 14px; letter-spacing: .3em; color: rgba(231, 224, 209, .8); }
.m-reveal .origin { writing-mode: vertical-rl; margin: 0; padding-top: 3.4em; max-height: 62vh; font-size: 15px; line-height: 2.2; letter-spacing: .22em; color: rgba(231, 224, 209, .9); }
.m-next { position: absolute; left: 6vw; bottom: 12vh; z-index: 7; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; max-width: min(560px, 60vw); opacity: 0; transition: opacity 1.2s ease; pointer-events: none; }
.m-next.on { opacity: 1; pointer-events: auto; }
.m-next > button, .m-corner button { font-size: 13px; letter-spacing: .25em; color: rgba(240, 236, 226, .92); background: rgba(12, 13, 16, .45); border: 1px solid rgba(240, 236, 226, .35); backdrop-filter: blur(3px); }
.m-next > button[data-n="go"] { border-color: rgba(240, 236, 226, .7); }
.m-next .m-msg { margin: 0 0 4px; font-size: 13px; letter-spacing: .25em; color: rgba(240, 236, 226, .9); text-shadow: 0 1px 10px rgba(0, 0, 0, .8); }
.m-next .chips button { background: rgba(12, 13, 16, .5); color: rgba(240, 236, 226, .92); border-color: rgba(240, 236, 226, .3); }
.m-corner { position: absolute; left: 18px; top: 16px; z-index: 8; display: flex; gap: 8px; }
.m-corner button { font-size: 12px; padding: 6px 12px; }
.mayoi-lead .btn { display: inline-block; margin-top: 18px; padding: 10px 28px; border: 1px solid var(--shu); color: #f3d9cf; font-size: 15px; letter-spacing: .4em; text-decoration: none; }
.shuin-row { display: flex; flex-direction: row-reverse; flex-wrap: wrap; justify-content: flex-end; gap: 16px; }
.shuin-page { position: relative; display: flex; flex-direction: row-reverse; gap: 10px; height: 250px; width: 120px; padding: 22px 14px; background: linear-gradient(90deg, #ece6d8, #f4efe4 50%, #e8e1d2); color: #2a241d; box-shadow: 0 10px 20px rgba(0, 0, 0, .4); }
.shuin-page b { font-weight: 400; font-size: 20px; letter-spacing: .25em; }
.shuin-date { font-size: 11px; letter-spacing: .15em; color: #7b7263; align-self: flex-end; }
.shuin-seal { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%) rotate(-6deg); width: 58px; height: 58px; display: flex; align-items: center; justify-content: center; border: 3px solid rgba(180, 50, 35, .78); color: rgba(180, 50, 35, .78); font-style: normal; font-size: 16px; line-height: 1.1; letter-spacing: 0; text-align: center; mix-blend-mode: multiply; }

.shuin-seal.ink { border-color: rgba(28, 26, 24, .82); color: rgba(28, 26, 24, .82); font-size: 26px; transform: translate(-50%, -50%) rotate(4deg); border-radius: 50%; }
/* 迷い込む：スマホの横画面。右下の歩く丸と左下の操作に重ならないように */
@media (orientation: landscape) and (max-height: 520px) {
  .m-reveal { top: 8vh; right: 150px; }
  .m-reveal h1 { font-size: 30px; }
  .m-reveal .origin { max-height: 64vh; font-size: 13px; padding-top: 2.6em; }
  .m-next { bottom: auto; top: 22vh; left: 4vw; }
  .m-act { bottom: 34%; }
  .m-cap { bottom: 30%; font-size: 13px; }
}

.hero-title .real { margin: 0; padding-top: 3.2em; font-size: 13px; letter-spacing: .25em; color: rgba(231, 224, 209, .72); }

/* 整える：細かいつまみは「くわしく」の中 */
details.adv { margin: 16px 0 4px; border-top: 1px solid var(--line); padding-top: 8px; }
details.adv summary { cursor: pointer; color: var(--gold); font-size: 12px; letter-spacing: .25em; padding: 6px 0; }
#who[hidden] { display: none; }

/* 奉納・知らせる・みんなの社 */
.hounou { max-width: 900px; margin: 10px auto 28px; padding: 0 22px; }
.hounou .row, .modal .row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; }
.hounou .warn { color: #e6a28d; font-size: 13px; }
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: rgba(6, 7, 9, .72); padding: 16px; }
.modal-in { width: min(560px, 100%); max-height: 92vh; overflow-y: auto; background: var(--ink); border: 1px solid var(--line-2); padding: 22px 24px; }
.modal-in h2 { margin: 0 0 10px; font-weight: 400; letter-spacing: .3em; }
.modal-in label { display: block; margin: 12px 0; }
.modal-in label span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.modal-in label.chk { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }
.modal-in input[type=text], .modal-in input:not([type]) { width: 100%; }
.hn-list { margin: 6px 0 4px; padding-left: 1.2em; font-size: 13px; line-height: 1.9; color: var(--paper); }
#hn-ts { margin: 8px 0; min-height: 0; }
.report-box { max-width: 900px; margin: 0 auto 40px; padding: 0 22px; }
.report-box .chips { margin-top: 8px; }
.sortchips { margin-top: 10px; }
.sortchips a { display: inline-block; font-size: 12px; letter-spacing: .1em; padding: 4px 12px; border: 1px solid var(--line); color: var(--paper); text-decoration: none; margin-right: 6px; }
.sortchips a.on { background: var(--shu); border-color: var(--shu); }
.more-row { text-align: center; margin: 10px 0 30px; }
.samples-h { margin-top: 26px; }
.cap .real-cap { font-size: 10px; color: var(--muted); }
.welcome-form select { margin: 0 8px; max-width: 220px; }
.m-next .m-rp { font-size: 11px; opacity: .8; }

/* いつの社か */
.hero-title .era { margin: 0; padding-top: .6em; font-size: 15px; letter-spacing: .35em; color: rgba(231, 224, 209, .85); }
.cap .era-cap { font-size: 11px; color: rgba(231, 224, 209, .75); }
.m-reveal .era { padding-top: .6em; font-size: 15px; }

/* 想像の札：近づくと、その言葉が縦書きで浮かぶ */
.s3d-fuda { position: absolute; left: 7%; top: 15%; z-index: 4; writing-mode: vertical-rl; max-height: 60%; padding: 18px 14px; font-size: 17px; line-height: 2; letter-spacing: .25em; color: #2a241d; background: linear-gradient(90deg, rgba(236, 229, 214, .94), rgba(244, 239, 228, .94)); box-shadow: 0 10px 30px rgba(0, 0, 0, .45); opacity: 0; transform: translateY(8px); transition: opacity .9s ease, transform .9s ease; pointer-events: none; }
.s3d.fuda-on .s3d-fuda { opacity: 1; transform: none; }
.s3d-fuda:empty { display: none; }
@media (orientation: landscape) and (max-height: 520px) { .s3d-fuda { left: 6%; top: 16%; max-height: 58%; font-size: 14px; } }
/* 札の言葉が出ている間は、社の名前を薄くする（狭い画面でも重ならないように） */
.hero:has(.s3d.fuda-on) .hero-title, .mayoi:has(.s3d.fuda-on) .m-reveal { opacity: .12; transition: opacity .6s ease; }
.hero .hero-title { transition: opacity .6s ease; }
@media (max-width: 640px) { .s3d-fuda { left: 4%; top: 12%; max-height: 64%; font-size: 14px; padding: 14px 10px; } }

/* ── 英語版：縦書きをやめて横書きにする（字の間を詰め、並びを上から下へ） */
.lang-en .tate, .lang-en .tf-board h2, .lang-en .m-reveal h1, .lang-en .m-reveal .owner, .lang-en .m-reveal .origin, .lang-en .s3d-fuda { writing-mode: horizontal-tb; letter-spacing: .04em; }
.lang-en .hero-title { flex-direction: column; align-items: flex-end; text-align: right; max-width: 46vw; gap: 4px; }
.lang-en .hero-title h1 { font-size: 34px; line-height: 1.25; }
.lang-en .hero-title h1.big { font-size: 48px; letter-spacing: .08em; }
.lang-en .hero-title .owner, .lang-en .hero-title .era, .lang-en .hero-title .real, .lang-en .hero-title .lede { padding-top: 0; letter-spacing: .06em; }
.lang-en .hero-title .lede { line-height: 1.8; padding-top: .8em; }
.lang-en .tf-board { flex-direction: column; width: 300px; min-height: 0; }
.lang-en .tf-board h2 { padding: 0 0 6px; border-left: 0; border-bottom: 1px solid rgba(241, 232, 212, .3); }
.lang-en .tf-board p { letter-spacing: .02em; line-height: 1.8; }
.lang-en .koto { flex-direction: column; height: auto; min-height: 120px; width: 180px; padding: 26px 14px 14px; }
.lang-en .koto p { letter-spacing: .02em; line-height: 1.6; }
.lang-en .cap { flex-direction: column; align-items: flex-end; text-align: right; left: 16px; bottom: auto; gap: 2px; }
.lang-en .cap b { font-size: 18px; letter-spacing: .04em; }
.lang-en .m-reveal { flex-direction: column; align-items: flex-end; text-align: right; max-width: 42vw; gap: 6px; }
.lang-en .m-reveal h1 { font-size: 34px; letter-spacing: .04em; }
.lang-en .m-reveal .owner, .lang-en .m-reveal .origin { padding-top: 0; max-height: none; }
.lang-en .shuin-page { flex-direction: column; width: 150px; height: 220px; }
.lang-en .shuin-page b { font-size: 15px; letter-spacing: .02em; }
.lang-en .s3d-fuda { max-width: 34%; max-height: none; line-height: 1.7; font-size: 16px; }
.lang-en .tabs button, .lang-en .chips button { letter-spacing: .04em; }
.lang-en nav a, .lang-en .btn { letter-spacing: .04em; }
/* 英語版の手直し（v0.32） */
fieldset.mini { min-width: 0; }
fieldset.mini input[type=range] { max-width: 100%; box-sizing: border-box; }
.lang-en .s3d-hint b { min-width: 9em; flex: none; }
.lang-en .welcome-form { width: min(600px, 92vw); }
.lang-en .welcome-form input { flex: 1 1 180px; min-width: 0; }
.lang-en .welcome-form select { max-width: 260px; flex: 1 1 200px; }
.lang-en .m-cap { letter-spacing: .12em; font-size: 16px; }
.lang-en .s3d:not(.editable) .s3d-full { letter-spacing: .06em; }
.lang-en fieldset.xyz label { grid-template-columns: 4.2em 1fr 3.2em; }
input[type=range] { margin-left: 0; margin-right: 0; }
.lang-en button.ghost { white-space: normal; text-align: left; }
@media (max-width: 760px) and (orientation: portrait), (max-width: 480px) {
  /* スマホ縦の上の帯：ボタンを小さくして、言葉の切り替えが画面の外に出ないように */
  .tools { gap: 6px; }
  .tools .btn { padding: 5px 9px; font-size: 11px; letter-spacing: .04em; white-space: nowrap; }
  .lang-en .brand { font-size: 13px; letter-spacing: .1em; white-space: nowrap; }
  .lang-en .brand span { white-space: nowrap; }
  .lang-en .bnav a span { font-size: 9px; letter-spacing: 0; white-space: nowrap; }
}
@media (max-width: 760px) and (orientation: portrait), (max-width: 480px) {
  /* 全画面は3Dの右下にもあるので、狭い画面では上の帯から外す。社の下の「縁起と絵馬」と見方のボタンが重ならないよう、ボタンを上げる */
  .tools #fsBtn { display: none; }
  .hero .s3d-ui { bottom: 92px; }
  .hero .s3d:not(.editable) .s3d-full { bottom: 136px; right: 12px; }
  .lang-en .hero-title { max-width: 86vw; }
  .lang-en .hero-title h1 { font-size: 28px; letter-spacing: .04em; }
  .lang-en .hero-title h1.big { font-size: 36px; }
}
/* 授かりもの（v0.33）：まだ授かっていないものは薄く */
.chips button.locked, .chips button.locked:hover { opacity: .32; border-style: dashed; background: transparent; cursor: not-allowed; text-decoration: none; }
.adv-locked { margin: 18px 0 4px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; letter-spacing: .08em; }
.m-reveal .juyo-got { writing-mode: vertical-rl; margin: 0; padding: 3.4em 10px 0 0; border-right: 1px solid rgba(214, 90, 60, .6); font-size: 15px; letter-spacing: .2em; line-height: 1.9; color: #f6d9cd; }
.m-reveal .juyo-got span { display: block; font-size: 11px; letter-spacing: .3em; color: rgba(231, 224, 209, .7); }
.m-reveal .juyo-got b { display: block; font-weight: 400; }
.lang-en .m-reveal .juyo-got { writing-mode: horizontal-tb; padding: 8px 0 0; border-right: 0; border-top: 1px solid rgba(214, 90, 60, .6); letter-spacing: .04em; text-align: right; }
.juyo-box { margin: 8px 0 26px; }
.juyo-row { display: flex; flex-wrap: wrap; gap: 8px; }
.juyo-row span { border: 1px solid var(--line-2); padding: 4px 10px; font-size: 12px; letter-spacing: .08em; color: var(--paper); }
/* はじめの案内 */
.guide { position: fixed; left: 50%; bottom: 26px; z-index: 90; transform: translateX(-50%); width: min(560px, 92vw); padding: 14px 18px 12px; background: rgba(12, 13, 16, .93); border: 1px solid var(--line-2); border-left: 3px solid var(--shu); color: var(--paper); font-size: 14px; line-height: 1.8; letter-spacing: .06em; box-shadow: 0 8px 30px rgba(0, 0, 0, .45); }
.guide[hidden] { display: none; }
.guide p { margin: 0 0 8px; }
.guide .g-btns { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.guide .g-btns .link { margin-left: auto; font-size: 12px; }
body.is-mayoi .guide { top: 70px; bottom: auto; left: 18px; transform: none; width: min(440px, 46vw); }
body.is-studio .guide { top: 140px; bottom: auto; left: 44px; transform: none; width: min(440px, 52vw); }
@media (max-width: 760px) and (orientation: portrait), (max-width: 480px) { .guide { bottom: calc(70px + env(safe-area-inset-bottom)); font-size: 13px; } }
@media (orientation: landscape) and (max-height: 520px) { .guide { bottom: 10px; padding: 8px 12px; font-size: 12px; } body.is-mayoi .guide, body.is-studio .guide { top: 56px; width: min(380px, 44vw); } }
@media (max-width: 760px) and (orientation: portrait), (max-width: 480px) { body.is-mayoi .guide, body.is-studio .guide { left: 50%; transform: translateX(-50%); width: 92vw; top: 64px; } }
/* 地図の版（v0.41）：絵の日本地図 */
.jmap { position: relative; height: calc(100vh - 140px); min-height: 480px; margin: 0 -24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; }
.jm-svg { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; user-select: none; }
.jm-svg:active { cursor: grabbing; }
.jm-sea { fill: #0f1114; }
.jm-land { fill: #24211d; stroke: rgba(231, 224, 209, .55); stroke-width: 1.2; stroke-linejoin: round; }
.jm-pref { fill: rgba(231, 224, 209, .62); text-anchor: middle; letter-spacing: .15em; cursor: pointer; font-family: inherit; paint-order: stroke; stroke: #0f1114; stroke-width: 3px; }
.jm-pref:hover { fill: var(--paper); }
.jm-torii { fill: none; stroke: #c9452c; stroke-width: 1.6; stroke-linecap: round; }
.jm-pin { cursor: pointer; }
.jm-pin.has .jm-torii { stroke: #ff6a45; stroke-width: 2.2; }
.jm-pin:hover .jm-torii { stroke: #ffd2c4; }
.jm-hit { fill: transparent; }
.jm-n { fill: #ffd2c4; font-size: 11px; font-weight: 600; }
.jm-name { fill: var(--paper); font-size: 11px; text-anchor: middle; letter-spacing: .05em; paint-order: stroke; stroke: #0f1114; stroke-width: 3px; }
.jm-pin.fancy rect { fill: rgba(231, 224, 209, .8); }
.jm-temp circle { fill: none; stroke: #ffd2c4; stroke-width: 2; stroke-dasharray: 3 3; }
.jm-ui { position: absolute; left: 14px; top: 14px; display: flex; gap: 6px; }
.jm-ui button { background: rgba(12, 13, 16, .85); min-width: 36px; }
.jm-ui .jm-fancy.on { border-color: var(--shu); background: var(--shu); }
.jm-help { position: absolute; left: 14px; bottom: 8px; margin: 0; font-size: 11px; color: var(--muted); letter-spacing: .06em; pointer-events: none; }
.jm-side { position: absolute; right: 0; top: 0; bottom: 0; width: min(380px, 92vw); overflow-y: auto; padding: 18px 20px 24px; background: rgba(12, 13, 16, .95); border-left: 1px solid var(--line-2); }
.jm-side h2 { margin: 6px 0 4px; font-weight: 400; letter-spacing: .12em; }
.jm-x { position: absolute; right: 14px; top: 10px; }
.jm-where { margin: 0 0 8px; color: var(--muted); }
.jm-mark { display: inline-block; margin-left: 8px; padding: 1px 8px; border: 1px solid #c9452c; color: #ffb7a3; font-size: 11px; letter-spacing: .1em; }
.jm-list { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.jm-card { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); text-decoration: none; color: var(--paper); }
.jm-card:hover { border-color: var(--shu); }
.jm-card span, .jm-card small { color: var(--muted); font-size: 12px; }
.jm-acts { display: flex; flex-direction: column; gap: 8px; }
.vstats { max-width: 760px; margin: 18px auto 0; padding: 0 16px; }
.vstats p { margin: 4px 0; }
.vcount b { color: var(--paper); font-weight: 400; }
.cnt-cap { font-size: 11px; opacity: .8; }

/* 地図：和紙に墨と朱（v0.42。オーナーが見せた参考の絵の方向） */
.jmap { --paper: #2a2622; --muted: #6b6358; --line: rgba(60, 48, 36, .25); --line-2: rgba(60, 48, 36, .45); color: #2a2622; background: #15161a; }
.jm-desk { fill: #15161a; }
.jm-paper { fill: #ebe4d3; }
.jm-mistl ellipse { fill: #8e887c; opacity: .22; }
.jm-wave { fill: none; stroke: #8a8478; stroke-width: 1.2; opacity: .55; stroke-linecap: round; }
.jm-land { fill: #4a4640; opacity: .9; stroke: none; }
.jm-edge { fill: none; stroke: #1f1d1a; stroke-width: 1.8; stroke-linejoin: round; opacity: .85; }
.jm-fuji { fill: #2e2b27; opacity: .85; }
.jm-fuji-snow { fill: #ebe4d3; stroke: #c23a22; stroke-width: 1; }
.jm-pref { fill: #2a2622; font-weight: 600; paint-order: stroke; stroke: #ebe4d3; stroke-width: 4px; letter-spacing: .2em; }
.jm-pref:hover { fill: #c23a22; }
.jm-torii { stroke: #c23a22; stroke-width: 1.9; }
.jm-pin.has .jm-torii { stroke: #e0391a; stroke-width: 2.6; }
.jm-pin:hover .jm-torii { stroke: #7a1d0c; }
.jm-n { fill: #c23a22; font-size: 12px; font-weight: 700; paint-order: stroke; stroke: #ebe4d3; stroke-width: 3px; }
.jm-name { fill: #2a2622; font-size: 11.5px; stroke: #ebe4d3; stroke-width: 3.5px; }
.jm-dot { fill: #2a2622; }
.jm-temp circle { stroke: #c23a22; }
.jm-title text { fill: #24211e; font-size: 34px; font-weight: 700; text-anchor: middle; letter-spacing: 0; }
.jm-title text.sub { font-size: 22px; font-weight: 600; }
.jm-title text.shu { fill: #c23a22; }
.jm-seal rect { fill: none; stroke: #c23a22; stroke-width: 2.5; }
.jm-seal text { fill: #c23a22; font-size: 15px; font-weight: 700; writing-mode: vertical-rl; letter-spacing: .05em; }
.jmap .jm-ui button { background: rgba(235, 228, 211, .92); color: #2a2622; border-color: rgba(60, 48, 36, .45); }
.jmap .jm-ui .jm-fancy.on { background: #c23a22; color: #fff; border-color: #c23a22; }
.jmap .jm-help { color: #6b6358; left: 24px; bottom: 18px; }
.jmap .jm-side { background: #efe9da; border-left: 1px solid rgba(60, 48, 36, .3); box-shadow: -8px 0 24px rgba(0, 0, 0, .25); }
.jmap .jm-mark { border-color: #c23a22; color: #c23a22; }
.jmap .jm-card { background: rgba(255, 255, 255, .35); }
.jmap .btn.shu { background: #c23a22; border-color: #c23a22; color: #fff; }
.jm-land { fill: #34312c; opacity: .92; }
.jm-region { fill: #2a2622; font-size: 19px; font-weight: 700; text-anchor: middle; letter-spacing: .25em; cursor: pointer; paint-order: stroke; stroke: #ebe4d3; stroke-width: 5px; }
.jm-region:hover { fill: #c23a22; }
.ktable { width: 100%; border-collapse: collapse; font-size: 13px; }
.ktable th, .ktable td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left; vertical-align: top; }
.jm-border { fill: none; stroke: rgba(235, 228, 211, .28); stroke-width: .8; stroke-dasharray: 3 2; }
/* 左の47都道府県（地図と連動） */
.jmap { display: grid; grid-template-columns: 150px 1fr; }
.jm-stage { position: relative; min-width: 0; overflow: hidden; }
.jm-prefs { position: relative; overflow-y: auto; padding: 10px 8px 24px; background: #e4dccb; border-right: 1px solid rgba(60, 48, 36, .35); scrollbar-width: thin; }
.jm-prefs h4 { margin: 12px 6px 4px; font-size: 11px; font-weight: 400; letter-spacing: .2em; color: #8a7f70; }
.jm-prefs button { display: block; width: 100%; text-align: left; margin: 0; padding: 5px 10px; border: 0; border-left: 3px solid transparent; background: none; color: #2a2622; font-size: 14px; letter-spacing: .12em; }
.jm-prefs button:hover { background: rgba(194, 58, 34, .08); color: #2a2622; }
.jm-prefs button.on { border-left-color: #c23a22; background: rgba(194, 58, 34, .14); color: #a52a14; font-weight: 600; }
.jm-cur { fill: none; stroke: #c23a22; stroke-width: 2.2; opacity: .75; stroke-linejoin: round; }
/* 地図の版：画面の横幅いっぱい、一覧：地図＝2：8。一覧は1県ずつ横長のブロック（v0.45） */
.jmap { width: 100%; margin: 0; height: calc(100vh - 72px); grid-template-columns: 20% 1fr; border: 0; }
.jm-prefs { padding: 10px 10px 40px; display: flex; flex-direction: column; gap: 8px; }
.jm-prefs .jm-blk { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 64px; padding: 8px 12px 8px 16px; border: 1px solid rgba(60, 48, 36, .28); border-left: 4px solid rgba(60, 48, 36, .28); background: #ece5d5; color: #2a2622; text-align: left; letter-spacing: .08em; transition: min-height .3s, background .3s, border-color .3s, transform .3s; }
.jm-prefs .jm-blk:hover { background: #f3ede0; border-left-color: #c23a22; color: #2a2622; }
.jm-blk-t { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.jm-blk-t small { font-size: 10px; letter-spacing: .2em; color: #8a7f70; }
.jm-blk-t b { font-size: 17px; font-weight: 600; transition: font-size .3s; }
.jm-blk-t em { font-style: normal; font-size: 11px; color: #7a6f60; letter-spacing: .04em; }
.jm-sil { width: 44px; height: 44px; flex: none; transition: width .3s, height .3s; }
.jm-sil path { fill: #4a4640; opacity: .8; }
.jm-prefs .jm-blk.on { min-height: 104px; border-color: #c23a22; border-left-width: 6px; background: #f6efe1; box-shadow: 0 4px 16px rgba(60, 30, 20, .18); }
.jm-prefs .jm-blk.on .jm-blk-t b { font-size: 24px; color: #a52a14; }
.jm-prefs .jm-blk.on .jm-sil { width: 72px; height: 72px; }
.jm-prefs .jm-blk.on .jm-sil path { fill: #c23a22; opacity: .85; }
.jm-prefs h4 { display: none; }
body:has(.jmap) main { max-width: none; padding: 72px 0 0; }
body:has(.jmap) { overflow: hidden; }
.jm-prefs .jm-blk { height: auto; line-height: 1.4; padding: 10px 12px 10px 16px; white-space: normal; }
.jm-prefs .jm-blk.on { padding: 14px 14px 14px 18px; }
/* 神社の印の三段（v0.46）：まだ＝灰色、建てられた＝朱、栄え＝金 */
.jm-pin.mi .jm-torii { stroke: #8f8a82; stroke-width: 1.7; opacity: .9; }
.jm-pin.ken .jm-torii { stroke: #d8401f; stroke-width: 2.6; }
.jm-pin.famous.mi .jm-torii { stroke: #7c776f; stroke-width: 2.1; }
.jm-rays { stroke: #e2b443; stroke-width: 1.4; stroke-linecap: round; opacity: .9; }
.jm-ring1 { fill: #2a2016; stroke: url(#jmGold); stroke-width: 2.2; }
.jm-ring2 { fill: none; stroke: #e9bf4f; stroke-width: .8; opacity: .8; }
.jm-gt-under { fill: none; stroke: #4a2f08; stroke-width: 3.6; stroke-linecap: round; }
.jm-gt { fill: none; stroke: url(#jmGold); stroke-width: 2.2; stroke-linecap: round; }
.jm-pin.sakae .jm-n { fill: #8a5a10; stroke: #fff4bf; }
.jm-name.gold { fill: #7a4e0c; font-weight: 700; }
.jm-pin.sakae:hover .jm-ring1 { stroke: #fff4bf; }
.jm-tu .jm-torii { stroke: #1c1a17 !important; stroke-width: 4.2 !important; opacity: .75 !important; }
.jm-pin.mi .jm-torii, .jm-pin.famous.mi .jm-torii { stroke: #d6d0c4; stroke-width: 2.1; opacity: 1; }
.jm-pin.ken .jm-torii { stroke: #ff5a33; stroke-width: 2.8; }
.jm-gt-under { stroke: #3a2706; stroke-width: 4.2; opacity: .8; }
.jm-gt { stroke: url(#jmGold); stroke-width: 2.6; }
.jm-spark { fill: #fff3b8; stroke: #c99a2e; stroke-width: .6; }
/* 全国の神社（v0.48）：墨の丸のまとまり、まだの神社の小さな点、名前の入/切 */
.jm-mdot { fill: #d6d0c4; stroke: #1c1a17; stroke-width: 1; }
.jm-name.sm { font-size: 10px; }
.jmap .jm-ui .jm-names { min-width: 76px; }
.jm-name, .jm-n { pointer-events: none; } /* 名前と数は押せないように（下の丸や印を押せる） */
/* 背景（机・和紙・霞・朱の日・波）は別の層。大きさが変わったときだけ描く（v0.49、軽くするため） */
.jm-bg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.jm-stage > .jm-svg { position: relative; will-change: transform; }
.jmap .jm-ui .jm-clusb { min-width: 84px; }
.jm-mdot { pointer-events: visiblePainted; }
/* まとめ：墨の粒（v0.55、オーナーが見比べて「粒。」に決定） */
.jm-grain { fill: rgba(228, 221, 204, .55); stroke: none; pointer-events: visiblePainted; cursor: pointer; }
.jmap .jm-ui .jm-clusb { min-width: 84px; }
/* 重なった神社の一覧（v0.54。オーナー「一覧で選べるように」） */
.jm-choose { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.jm-ch { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 9px 12px; background: rgba(255, 255, 255, .45); border: 1px solid rgba(60, 48, 36, .3); color: #2a2622; cursor: pointer; }
.jm-ch:hover { border-color: #c23a22; background: rgba(255, 255, 255, .7); }
.jm-ch b { font-weight: 600; letter-spacing: .05em; }
.jm-ch small { color: #6b6156; font-size: 12px; }
.jm-back { display: block; margin: 4px 0 2px; }
/* 整える画面の奉納ボタン（v0.59、オーナー「奉納は整える画面でもできるようにしたい」） */
.toolbar .hn-edit { background: var(--shu); border-color: var(--shu); color: #fff; }
.toolbar .hn-edit:hover { background: var(--shu-2); }
/* 地図の画面のまわりに先に描いた分も、ドラッグでずらしたときに見えるように（v0.62） */
.jm-stage > .jm-svg { overflow: visible; }

/* ── 縦画面でも使う（2026-12-03 オーナー「縦画面でも使えるようにして」）：「横向きにしてください」の案内を出さない */
body.touch .rotate-cue { display: none !important; }
/* 地図：縦画面では、上に地図、下に県の一覧（横に並べて、指で横に送る） */
@media (orientation: portrait) and (max-width: 900px) {
  body:has(.jmap) main { padding: calc(52px + env(safe-area-inset-top)) 0 calc(58px + env(safe-area-inset-bottom)); }
  .jmap { height: calc(100dvh - 52px - 58px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); min-height: 0; grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .jm-stage { order: 1; }
  .jm-prefs { order: 2; flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 6px 8px; gap: 6px; border-right: 0; border-top: 1px solid rgba(60, 48, 36, .35); scrollbar-width: none; }
  .jm-prefs .jm-blk { flex: none; width: 128px; min-height: 0; padding: 6px 8px 6px 10px; gap: 6px; }
  .jm-prefs .jm-blk.on { min-height: 0; width: 160px; padding: 6px 8px 6px 10px; }
  .jm-prefs .jm-blk .jm-sil { width: 34px; height: 34px; }
  .jm-prefs .jm-blk.on .jm-sil { width: 42px; height: 42px; }
  .jm-blk-t b { font-size: 15px; }
  .jm-prefs .jm-blk.on .jm-blk-t b { font-size: 18px; }
  .jm-blk-t em { font-size: 10px; }
  .jmap .jm-ui { left: 8px; right: 8px; top: 8px; flex-wrap: wrap; gap: 4px; }
  .jmap .jm-ui button { min-width: 0; padding: 5px 9px; font-size: 11px; letter-spacing: .04em; }
  .jmap .jm-help { display: none; }
  .jmap .jm-side { top: auto; left: 0; right: 0; width: auto; max-height: 62%; border-left: 0; border-top: 1px solid rgba(60, 48, 36, .3); box-shadow: 0 -8px 24px rgba(0, 0, 0, .25); }
}
/* いまサイトを開いている人の数（v0.69） */
.online-n { font-size: 12px; letter-spacing: .12em; color: var(--muted); white-space: nowrap; }
.online-n::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #6fae7a; box-shadow: 0 0 6px rgba(111, 174, 122, .7); vertical-align: 1px; }
.online-n[hidden] { display: none; }
