/* Sendaijo — 仙台城 3D (2026-11-29 sdj_terrain / sdj_fix1)
   ★ご主人様は弱視でいらっしゃる: 淡い色・細い字・低いコントラストを使わない。濃い紺の板に白の太字。部品は詰めて作る (行間・余白を広く取らない)
   ★携帯でも出典と断りは太く・濃く・13px 以上 (副長レビュー 14)。上の段 (#top) は一つの箱に積み、下の断り (#notes) は高さに上限を付けて重ならないようにする */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0d1726; color: #fff;
  font-family: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif; font-weight: 700; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; touch-action: none; }
.hidden { display: none !important; }
.panel { background: rgba(9, 16, 28, 0.92); border: 2px solid #ffffff; border-radius: 8px; color: #fff; }
a { color: #ffe08a; }
button { font: inherit; font-weight: 700; color: #0b1320; background: #ffffff; border: 2px solid #ffffff; border-radius: 6px; padding: 3px 9px; cursor: pointer; line-height: 1.25; }
button:hover, button:focus-visible { background: #ffe08a; border-color: #ffe08a; outline: none; }

/* 上の段 */
#top { position: fixed; left: 10px; right: 10px; top: 10px; z-index: 10; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; pointer-events: none; max-height: 55vh; }
#top > * { pointer-events: auto; }
#brand { padding: 5px 10px; flex: none; }
#brand h1 { margin: 0; font-size: 22px; font-weight: 900; line-height: 1.2; letter-spacing: .02em; white-space: nowrap; }
.badge { display: inline-block; margin-left: 8px; padding: 1px 7px; font-size: 14px; font-weight: 900; color: #0b1320; background: #ffe08a; border-radius: 4px; vertical-align: 3px; }
.badge.wip { background: #ff9a6b; }
#hud { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; min-width: 0; }
#views { padding: 5px 6px; display: flex; gap: 5px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
#views .lbl { font-size: 15px; padding: 0 4px; }
#views button { font-size: 15px; }
#ops { padding: 3px 9px; font-size: 14px; }
#views #viewsMore { background: #0b1320; color: #fff; }
#views #viewsMore[aria-expanded="true"], #views #viewsMore:hover { background: #ffe08a; color: #0b1320; }
/* ほかの行き先の一覧 (副長レビュー 91) */
#viewsAll { padding: 5px 6px; display: flex; flex-direction: column; gap: 4px; max-width: 640px; }
#viewsAll .vgrp { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; justify-content: flex-end; }
#viewsAll .vgrp b { font-size: 15px; padding: 0 4px; color: #ffe08a; }
#viewsAll button { font-size: 15px; }
/* 準備の進み (副長レビュー 90) */
#prep { padding: 3px 8px; font-size: 14px; display: flex; gap: 8px; align-items: center; border-color: #ffe08a; }
#prep button { font-size: 14px; padding: 1px 8px; }
#prep.done #prepText { display: none; }
/* 姿の切替と「想像の姿」の札 (いつも見える。sdj_shiro1) */
#sugata { padding: 4px 6px; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; justify-content: flex-end; max-width: 640px; }
#sugata .lbl { font-size: 15px; padding: 0 4px; }
#sugata button { font-size: 15px; }
#sugata button[aria-pressed="true"] { background: #ffe08a; border-color: #ffe08a; }
#sugata button[aria-pressed="false"] { background: #0b1320; color: #fff; border-color: #fff; }
#sgNote { flex-basis: 100%; font-size: 14px; line-height: 1.35; text-align: right; }
#sgNote b { padding: 0 6px; border-radius: 4px; color: #0b1320; margin-right: 4px; }
#sgNote .imag { background: #ff9a6b; }
#sgNote .real { background: #9fe0a8; }
#sgWhat { flex-basis: 100%; font-size: 14px; line-height: 1.3; text-align: right; }
#sgWhat b { color: #ffe08a; }
#certSum { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; font-size: 14px; }
#certSum .cs { border: 2px solid #fff; border-radius: 6px; padding: 2px 8px; }
#cert tr.grp th { background: #23344f; font-size: 15px; white-space: normal; }
/* 確かさの一覧 */
#cert { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 30; width: min(1100px, calc(100vw - 20px)); max-height: min(82vh, 800px); display: flex; flex-direction: column; padding: 8px 10px; background: #0b1320; }   /* ★不透明 (後ろの字が透けて読みにくかった) */
#cert .chead { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 18px; }
#cert .clegend { margin: 4px 0 6px; font-size: 14px; }
#cert .cscroll { overflow-y: auto; }
#cert table { border-collapse: collapse; width: 100%; font-size: 14px; line-height: 1.35; }
#cert th, #cert td { border: 1px solid #ffffff; padding: 3px 6px; vertical-align: top; text-align: left; }
#cert thead th { position: sticky; top: 0; background: #0b1320; }
#cert tbody th { white-space: normal; min-width: 8em; max-width: 14em; }   /* 名前は折り返す (根拠の欄を細くしない) */
#cert td:last-child { min-width: 22em; }
#cert td.gA, #cert td.gB, #cert td.gC, #cert td.g未確認, #cert thead th, #cert tbody td:nth-child(6) { white-space: nowrap; }
.gA { color: #9fe0a8; } .gB { color: #ffe08a; } .gC, .g未確認 { color: #ff9a6b; }
/* 選んだ物の確かさ (sdj_shiro2): 右下の決まった所。左下の断りには重ねない (重なる幅では断りの上へ上げる。main.js) */
#info { background: #0b1320; position: fixed; right: 10px; bottom: 10px; z-index: 25; width: min(440px, calc(100vw - 20px)); max-height: 46vh; overflow-y: auto; padding: 6px 10px; font-size: 14px; line-height: 1.35; }
#info .ihead { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 18px; margin-bottom: 4px; }
#info .itab { border-collapse: collapse; width: 100%; margin-bottom: 4px; }
#info .itab th, #info .itab td { border: 1px solid #ffffff; padding: 2px 5px; text-align: center; white-space: nowrap; }
#info .ihow { font-size: 14px; }
#ops .finger { display: none; }
body.touch #ops .mouse { display: none; }
body.touch #ops .finger { display: inline; }
#fps { padding: 2px 8px; font-size: 14px; }

/* 下の断りと出典 (いつも見える) */
#notes { position: fixed; left: 10px; bottom: 10px; z-index: 10; padding: 5px 10px; max-width: min(860px, calc(100vw - 20px)); max-height: 38vh; overflow-y: auto; font-size: 14px; line-height: 1.35; }
#notes p { margin: 0; }
#notes .n1 b { color: #ffe08a; }
#notes .n2 b { color: #ff9a6b; }
#notes .n3 { font-weight: 700; font-size: 13px; color: #fff; }
#notes .n1 .im { color: #ff9a6b; }
#notes .n4 { font-size: 13px; }
#notes #notesMore { font-size: 13px; padding: 0 7px; margin-left: 4px; }
#notesBody { margin: 3px 0; }

.center { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 14px 18px; min-width: 300px; max-width: min(560px, calc(100vw - 24px)); text-align: center; z-index: 20; }
.ltitle { font-size: 26px; font-weight: 900; }
.lead { font-size: 16px; margin: 4px 0 8px; }
.bar { height: 12px; border: 2px solid #fff; border-radius: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: #ffe08a; transition: width .2s; }
.lmsg { font-size: 14px; margin-top: 6px; min-height: 1.3em; }
#fatal { border-color: #ff9a6b; }
.ftitle { font-size: 20px; font-weight: 900; color: #ff9a6b; margin-bottom: 4px; }
#fatal p { margin: 0 0 10px; font-size: 15px; line-height: 1.45; text-align: left; }
#slow { position: fixed; left: 50%; top: calc(50% + 90px); transform: translateX(-50%); max-width: calc(100vw - 20px); padding: 4px 10px; font-size: 15px; border-color: #ffe08a; z-index: 21; }
#notice { position: fixed; left: 50%; bottom: calc(38vh + 24px); transform: translateX(-50%); max-width: calc(100vw - 20px); padding: 4px 10px; font-size: 14px; border-color: #ff9a6b; z-index: 15; }
.noscript { position: fixed; inset: 40% 10px auto; text-align: center; font-size: 18px; }

/* 狭い画面 (携帯): 上の段は縦に積む。字は 13px より小さくしない */
@media (max-width: 760px) {
  /* ★縦の携帯 (sdj_shiro2 茜 b): 上の板が画面の半分を占めていた → 行き先は横に流す一行、操作の説明は隠す、姿の説明は一行に詰める */
  #top { flex-direction: column; align-items: stretch; gap: 4px; max-height: none; left: 6px; right: 6px; top: 6px; }
  #brand { align-self: flex-start; padding: 3px 8px; }
  #brand h1 { font-size: 17px; }
  .badge { font-size: 13px; margin-left: 5px; }
  #hud { align-items: stretch; gap: 4px; }
  #views { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding: 3px 4px; gap: 4px; scrollbar-width: none; }
  #views::-webkit-scrollbar { display: none; }
  #views .lbl { display: none; }
  #views button { font-size: 14px; padding: 3px 7px; flex: none; white-space: nowrap; }
  #ops { display: none; }
  #sugata { justify-content: flex-start; max-width: none; padding: 3px 4px; gap: 4px; }
  #sugata .lbl { display: none; }
  #sugata button { font-size: 14px; padding: 3px 7px; }
  #sgNote { text-align: left; font-size: 13px; line-height: 1.3; }
  #sgWhat { text-align: left; font-size: 13px; }
  #views #viewsMore { order: -1; }   /* ★狭い画面では「ほかの行き先」を先頭に (横に流す一列の外に隠れないように。副長レビュー 91) */
  #viewsAll { max-width: none; padding: 3px 4px; }
  #viewsAll .vgrp { justify-content: flex-start; gap: 4px; }
  #viewsAll button, #viewsAll .vgrp b { font-size: 14px; padding: 3px 7px; }
  #prep { font-size: 13px; padding: 2px 6px; }
  #info { left: 6px; right: 6px; width: auto; max-height: 34vh; font-size: 13px; }
  #info .ihow { font-size: 13px; }
  #cert table { font-size: 13px; }
  #ops { font-size: 14px; }
  #notes { font-size: 13px; max-height: 32vh; left: 6px; right: 6px; bottom: 6px; padding: 3px 7px; }
  #notes .n3 { font-size: 13px; }
  .center { min-width: 0; width: calc(100vw - 24px); }
}
/* 低い画面 (横向きの携帯など): 上の段を左右に並べ直して詰め、操作の説明も残す (副長レビュー 14 の残り。以前は説明を消していた) */
@media (max-height: 520px) {
  #top { flex-direction: row; flex-wrap: wrap; align-items: flex-start; max-height: none; gap: 5px; }
  #brand h1 { font-size: 16px; }
  .badge { font-size: 13px; margin-left: 5px; }
  #hud { flex-direction: row; flex-wrap: wrap; align-items: flex-start; gap: 5px; }
  #views { padding: 3px 4px; gap: 3px; }
  #views .lbl { display: none; }
  #views button { font-size: 13px; padding: 2px 6px; }
  #sugata { padding: 3px 4px; gap: 3px; }
  #sugata .lbl { display: none; }
  #sugata button { font-size: 13px; padding: 2px 6px; }
  #sgNote { font-size: 13px; }
  #ops { font-size: 13px; padding: 2px 7px; }
  #notes { font-size: 13px; max-height: 34vh; padding: 3px 8px; line-height: 1.3; }
  #notes .n3 { font-size: 13px; }
}
