/* 運営の星図（dev.topx.jp）。輪は入口（top.css・wheel.css）と同じ見た目：白い面に、十二宮の印と
   真ん中の星図だけ。線も枠も足さない。宮を選ぶと輪は半分だけ残して退き、その先に読みが続く。
   印は選んだ宮だけ墨、ほかは灰 */

#admin { grid-template-rows: auto minmax(0, 1fr); }
#admin .head { box-shadow: none; border-radius: 0; background: none; padding: 4px 6px; min-height: 44px; }
#admin .brand-name { font-weight: 700; letter-spacing: .1em; }
#admin .brand-name .wm-o { color: var(--brand); }
#admin .brand-ver { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
#admin .tabs[hidden] { display: none; }
#admin .body[hidden] { display: none; }
#admin .head-actions { margin-left: auto; display: flex; gap: 6px; }

/* ── 星図と、その読み ── */
body:has(#admin[data-view="sky"]) { background: var(--surface); }
.sky {
  /* 輪の大きさ。入口と同じ 72vmin を上限に、**軌道を足しても画面の高さに収まる大きさ**にする
     （2026-10-08：1280×720 で輪の下が見切れていた。高さ − 見出し − 便り − 余白 ＝ 100vh − 290px を 1 + 0.4 で割る） */
  --w: min(72vmin, 560px, calc((100vh - 290px) / 1.4));
  --pad: 26px;                    /* 印の名前が輪の外へ出る分 */
  --orbit: calc(var(--w) * 0.2 + 56px);   /* 輪の外の天体の軌道の分（輪だけの時）。長い名前が横に出る分も */
  display: flex; align-items: flex-start; gap: clamp(24px, 4vw, 64px);
  padding: clamp(4px, 1.4vw, 18px) 0;
}
.sky[hidden] { display: none; }
/* 選んでいない時は、輪だけを真ん中に置く（入口と同じ姿）。読みは出さない */
.sky[data-dock="false"] { --pad: var(--orbit); min-height: calc(100vh - 150px); min-height: calc(100dvh - 150px); align-items: center; flex-wrap: wrap; align-content: center; row-gap: 0; }
/* 星図で輪だけの時は、見出しの帯を隠す（天体は輪の外の軌道にある） */
#admin[data-sky="open"] .orbit { display: none; }
.sky[data-dock="false"] .reading { display: none; }

/* 輪を置く窓。宮を選ぶと窓が左へ寄って半分に縮み、輪の残りは窓の外へ隠れる */
.sky-stage {
  flex: none; position: sticky; top: 12px; overflow: clip;
  width: calc(var(--w) + var(--pad) * 2); height: calc(var(--w) + var(--pad) * 2);
  margin-left: calc((100% - var(--w) - var(--pad) * 2) / 2);
  /* 置き場所の移り変わりは dev-star.js が滑らせる。ここは窓の伸び縮みだけ */
  transition: width .5s cubic-bezier(.2, .7, .2, 1), height .5s cubic-bezier(.2, .7, .2, 1);
}
.sky[data-dock="true"] .sky-stage { width: calc(var(--w) / 2 + var(--pad)); margin-left: 0; }
.sky-wheel {
  --rot: 0deg;
  position: absolute; right: var(--pad); top: var(--pad);
  width: var(--w); height: var(--w); touch-action: none; user-select: none;
}

/* 十二宮の輪。輪ごと回し、印と名前は立てたまま */
.dial { position: absolute; inset: 0; rotate: var(--rot); outline: none; cursor: grab; }
.sky-wheel.gliding .dial { transition: rotate .5s cubic-bezier(.2, .7, .2, 1); }
.dial:active { cursor: grabbing; }
.dial:focus-visible { outline: 2px solid var(--brand); outline-offset: 6px; border-radius: 50%; }
.dsign {
  position: absolute; translate: -50% -50%; rotate: calc(var(--rot) * -1);
  width: 15%; aspect-ratio: 1; padding: 0; border: 0; background: none; cursor: pointer;
  display: grid; place-items: center;
  opacity: 0; scale: .86;
  transition: opacity .5s var(--ease), scale .5s var(--ease);
}
.dsign.lit { opacity: 1; scale: 1; }
.sky-wheel.gliding .dsign { transition: opacity .5s var(--ease), scale .5s var(--ease), rotate .5s cubic-bezier(.2, .7, .2, 1); }
/* 印は、選んでいる宮だけ墨。ほかはすべて灰（朱は使わない） */
.dsign i {
  display: block; width: 100%; height: 100%;
  background: var(--sign-off);
  -webkit-mask: var(--src) center / contain no-repeat; mask: var(--src) center / contain no-repeat;
  transition: background .14s;
}
.dsign:hover i, .dsign:focus-visible i { background: var(--ink-3); }
.dsign[aria-selected="true"] i { background: var(--ink); }
.dsign b {
  position: absolute; top: 102%; left: 50%; translate: -50% 0;
  font-size: clamp(10px, 1.5vmin, 12px); font-weight: 600; letter-spacing: .04em;
  white-space: nowrap; color: var(--ink-3);
}
.dsign[aria-selected="true"] b { color: var(--ink); }
.dsign:focus-visible { outline: none; }

/* 輪の外の軌道の天体。印は立てたまま、名前を下に。選ぶと消え、帯に戻る */
.planets { position: absolute; inset: 0; pointer-events: none; }
.planet {
  pointer-events: auto;
  position: absolute; translate: -50% -50%;
  width: 8%; aspect-ratio: 1; padding: 0; border: 0; background: none; cursor: pointer;
  display: grid; place-items: center;
  transition: opacity .3s var(--ease);
}
.planet i {
  display: block; width: 100%; height: 100%; background: var(--ink-3);
  -webkit-mask: var(--src) center / contain no-repeat; mask: var(--src) center / contain no-repeat;
  transition: background .14s;
}
.planet b {
  position: absolute; top: 102%; left: 50%; translate: -50% 0;
  font-size: clamp(9px, 1.3vmin, 11px); font-weight: 600; letter-spacing: .02em;
  white-space: nowrap; color: var(--ink-3);
}
.planet:hover i, .planet:focus-visible i { background: var(--ink); }
.planet:hover b, .planet:focus-visible b { color: var(--ink); }
.planet:focus-visible { outline: none; }
.sky[data-dock="true"] .planet { opacity: 0; pointer-events: none; }

.chart-core {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%;
  width: 40%; height: 40%; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer;
  -webkit-touch-callout: none; user-select: none; touch-action: manipulation;   /* 長押しで入る口（dev-star.js） */
}
.chart-core img { display: block; width: 100%; height: 100%; object-fit: contain; }
.chart-core:focus-visible { outline: 2px solid var(--brand); outline-offset: 6px; }

/* ── 読み ── */
.reading { flex: 1 1 0; min-width: 0; display: grid; gap: 10px; align-content: start; padding: var(--pad) 4px 24px; }
.r-kicker { font-size: 12px; letter-spacing: .08em; color: var(--ink-3); }
#admin .reading h2 { font-size: clamp(26px, 3.2vw, 40px); font-weight: 700; letter-spacing: .02em; line-height: 1.15; }
.r-lead { max-width: 34em; color: var(--ink-2); line-height: 1.7; }
#admin .reading h3 {
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--separator);
  font-size: 12px; font-weight: 600; letter-spacing: .06em; color: var(--ink-2);
}
.r-nums { display: flex; flex-wrap: wrap; gap: 6px 34px; margin-top: 6px; }
.r-nums div { display: grid; gap: 2px; }
.r-nums dt { font-size: 11px; letter-spacing: .04em; color: var(--ink-3); }
.r-nums dd { font-size: 30px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.r-nums .warn dd { color: var(--brand); }

.vers { display: grid; gap: 6px; max-width: 30em; }
.vers-row { display: grid; grid-template-columns: 6.5em minmax(0, 1fr) 3.2em; align-items: center; gap: 10px; }
.vers-bar { height: 8px; border-radius: 999px; background: var(--fill-1); position: relative; overflow: hidden; }
.vers-bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); border-radius: inherit; background: var(--ink); }
.vers-bar.old::after { background: var(--brand); }
.vers-n { font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.ver { font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ver.old { color: var(--brand); font-weight: 600; }

.r-scroll { overflow-x: auto; }
.r-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.r-table th {
  text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--ink-3);
  padding: 6px 12px 6px 0; white-space: nowrap; border-bottom: 1px solid var(--line-strong);
}
.r-table td { padding: 8px 12px 8px 0; border-bottom: 1px solid var(--separator); white-space: nowrap; }
.r-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.r-table tbody tr:hover { background: var(--fill-1); }
.who { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1px 8px; align-items: center; }
.who .who-natal { grid-row: 1 / 3; display: flex; }
.who small { grid-column: 2; }
.who b { font-weight: 600; }
.who small { font-size: 11px; color: var(--ink-3); }

/* ── 天体の帯（運営の仕事）。輪の印と同じ作り：印の下に名前、ふだんは灰、いる所と触れた所は墨 ── */
.orbit { display: flex; gap: 2px 4px; flex-wrap: wrap; align-items: flex-start; }
.orbit[hidden] { display: none; }
.orb {
  display: grid; justify-items: center; gap: 3px; padding: 4px 8px 2px; min-width: 58px;
  border: 0; background: none; color: var(--ink-3);
  font: inherit; font-size: 10px; font-weight: 600; letter-spacing: .02em; white-space: nowrap;
  cursor: pointer; text-decoration: none;
}
.orb i {
  width: 22px; height: 22px; background: currentColor;
  -webkit-mask: var(--src) center / contain no-repeat; mask: var(--src) center / contain no-repeat;
}
.orb:hover, .orb:focus-visible { color: var(--ink); outline: none; }
.orb[aria-current="true"] { color: var(--ink); }
#toSky[hidden] { display: none; }

/* 縦に並ぶ幅。選んでいない時は、輪だけを真ん中に（入口と同じ）。宮を選ぶと、輪は画面のいちばん下に
   留まり、下半分は画面の下へ埋まる。選んだ宮は輪のいちばん上。読みは輪の上を流れる
   （輪の後ろへ潜る字は、白へ溶かして読める所だけ残す） */
@media (max-width: 900px) {
  /* 縦に並ぶ幅：天体の軌道（半径 57%）と名前が窓に収まるよう、余白は 0.115w + 40px、
     輪はその余白を足しても画面の幅と高さに収まる大きさ（2026-10-08：820px 幅で左右と下が見切れていた） */
  .sky { --w: min(72vmin, 560px, calc((100vw - 88px) / 1.23), calc((100vh - 290px) / 1.4)); --pad: 8px; --orbit: calc(var(--w) * 0.115 + 40px); display: block; }
  .sky[data-dock="false"] { display: grid; place-items: center; }
  .sky[data-dock="false"] .sky-stage { position: relative; top: 0; margin: 0; width: calc(var(--w) + var(--pad) * 2); height: calc(var(--w) + var(--pad) * 2); }
  .sky[data-dock="false"] .sky-wheel { top: var(--pad); }
  .planet { width: 9%; }
  .sky[data-dock="true"] { padding-bottom: calc(var(--w) / 2 + 56px); }
  .sky[data-dock="true"] .sky-stage {
    position: fixed; z-index: 5; inset: auto 0 0 0; margin: 0;
    width: auto; height: calc(var(--w) / 2 + 30px);
    background: linear-gradient(to bottom, transparent, var(--surface) 22px);
  }
  .sky-wheel { right: auto; left: 50%; top: 26px; translate: -50% 0; touch-action: pan-y; }
}
@media (prefers-reduced-motion: reduce) {
  .sky-stage, .dsign, .sky-wheel.gliding .dial, .sky-wheel.gliding .dsign { transition: none; }
}

/* 運営の入口（入る前）。星図をひとつ置く */
.dev-login-core { display: block; width: 132px; height: 132px; margin: 0 auto 6px; }
.dev-login-box h1 { text-align: center; letter-spacing: .1em; }
.dev-login-box h1 .wm-o { color: var(--brand); }

.reading .chart { margin: 4px 0 8px; }
#admin .brand { -webkit-touch-callout: none; user-select: none; cursor: pointer; }   /* 押すと星図へ、長押しで画像一覧へ（dev-star.js） */

/* 星の便り：輪だけの時に、輪の下に一言。気を付ける所だけ朱 */
.sky-note {
  width: 100%; text-align: center; font-size: 12px; letter-spacing: .04em; color: var(--ink-3);
  margin: 0; padding: 18px 12px 8px;      /* 上の余白は、いちばん下の天体の名前と重ならない分 */
}
.sky[data-dock="true"] .sky-note, .sky-note:empty { display: none; }
.sky-note .sky-note-k { font-weight: 600; color: var(--ink-2); margin-right: 1em; }
.sky-note .sky-note-sep { margin: 0 .5em; }
.sky-note .warn { font-weight: 600; color: var(--brand); }
/* 気を付ける所のある天体は、印を朱に（輪の外の軌道でも、見出しの帯でも） */
.planet[data-warn="1"] i, .orb[data-warn="1"] i { background: var(--brand); }
.planet[data-warn="1"] b, .orb[data-warn="1"] { color: var(--brand); }
