/* 星球鏈原型（草稿頁，遊戲不載入）：滿版星空、十顆星球的標籤卡、下方導覽卡；底下是說明。整頁固定深色太空主題 */
:root {
  --pc-space-1: #0b1030;
  --pc-space-2: #1b1450;
  --pc-ink: #f3f1ff;
  --pc-ink-soft: #b9b6dc;
  --pc-panel: #ffffff;
  --pc-panel-ink: #1d2140;
  --pc-panel-soft: #5a5f80;
  --pc-line: #d9dbef;
  --pc-locked: #555a7c;
  --pc-iso-bian: #13786c;
  --pc-iso-yuan: #6646c4;
  --pc-iso-suan: #ad4f17;
  --pc-iso-bao: #2c62b8;
  --pc-iso-cha: #b3336a;
  --pc-glow: #8ff0ff;
  --pc-ok: #2f9a5f;
  --display: "Huninn", "Noto Sans TC", "PingFang TC", sans-serif;
  --body: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}
.pc-body *, .pc-page *, .pc-embed * { box-sizing: border-box; }
body.pc-body { margin: 0; background: var(--pc-space-1); color: var(--pc-ink); font-family: var(--body); font-size: 16px; line-height: 1.6; color-scheme: dark; }
/* 發布時外層 body 會換掉、class 不見，所以頁面本身也要帶顏色與背景 */
.pc-page { background: var(--pc-space-1); color: var(--pc-ink); font-family: var(--body); font-size: 16px; line-height: 1.6; color-scheme: dark; }
.pc-page table, .pc-embed table { color: inherit; font-size: inherit; }
/* 嵌在晶圓廠故事線草稿裡：自成一塊深色太空區 */
.pc-embed { background: var(--pc-space-1); color: var(--pc-ink); font-family: var(--body); border-radius: 24px; padding: 12px; display: flex; flex-direction: column; gap: 12px; color-scheme: dark; }
.pc-embed .pc-stage { box-shadow: none; }
.pc-page { max-width: 1200px; margin: 0 auto; padding: 16px 16px 48px; display: flex; flex-direction: column; gap: 20px; }
.pc-head h1 { font-family: var(--display); font-size: 1.6rem; margin: 0; line-height: 1.3; }
.pc-head p { margin: 4px 0 0; color: var(--pc-ink-soft); }

.pc-stage { position: relative; width: 100%; height: min(78vh, 720px); min-height: 520px; border-radius: 24px; overflow: hidden;
  background: radial-gradient(ellipse at 18% 78%, rgb(122 64 200 / 45%), transparent 45%), radial-gradient(ellipse at 85% 25%, rgb(40 150 190 / 35%), transparent 45%), radial-gradient(ellipse at 50% 0%, var(--pc-space-2), var(--pc-space-1) 75%); box-shadow: 0 20px 60px rgb(0 0 0 / 45%); }
.pc-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.pc-pins { position: absolute; inset: 0; pointer-events: none; }
.pc-pin { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center; gap: 4px;
  pointer-events: auto; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: inherit; }
.pc-pin.is-off { visibility: hidden; }
.pc-card { background: var(--c); color: #fff; border-radius: 12px; padding: 6px 14px 5px; text-align: center; box-shadow: 0 6px 16px rgb(0 0 0 / 35%); min-width: 96px; }
.pc-card strong { display: block; font-family: var(--display); font-size: 1.05rem; line-height: 1.25; white-space: nowrap; }
.pc-card small { display: block; font-size: 0.62rem; letter-spacing: 0.14em; opacity: 0.92; white-space: nowrap; }
.pc-pin.is-locked .pc-card { background: var(--pc-locked); }
.pc-pin.is-selected .pc-card { outline: 3px solid var(--pc-glow); outline-offset: 2px; }
.pc-pin:focus-visible { outline: none; }
.pc-pin:focus-visible .pc-card { outline: 3px solid #fff; outline-offset: 3px; }
.pc-pills { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.pc-pill { background: rgb(255 255 255 / 94%); color: var(--pc-panel-ink); border-radius: 999px; padding: 1px 10px 1px 8px; font-size: 0.74rem; font-weight: 600; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px; box-shadow: 0 3px 8px rgb(0 0 0 / 25%); }
.pc-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.pc-pill b { background: var(--c); color: #fff; border-radius: 999px; padding: 0 6px; font-size: 0.68rem; }
.pc-pin.is-locked .pc-pill { opacity: 0.8; }
.pc-pin.is-locked .pc-pill::before, .pc-pin.is-locked .pc-pill b { background: var(--pc-locked); }

.pc-hud { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; gap: 8px; pointer-events: none; }
.pc-hud > * { pointer-events: auto; }
.pc-chip { background: rgb(12 16 48 / 72%); border: 1px solid rgb(255 255 255 / 18%); color: var(--pc-ink); border-radius: 999px; padding: 4px 12px; font-size: 0.82rem; }
.pc-btn { font: inherit; font-weight: 700; border-radius: 999px; padding: 6px 14px; border: 1px solid var(--pc-line); background: var(--pc-panel); color: var(--pc-panel-ink); cursor: pointer; min-height: 40px; white-space: nowrap; }
.pc-btn:disabled, .pc-btn.is-primary:disabled { background: var(--pc-line); color: var(--pc-panel-soft); border-color: var(--pc-line); cursor: not-allowed; }
.pc-btn.is-primary { background: var(--pc-panel-ink); color: #fff; border-color: var(--pc-panel-ink); }
.pc-btn:focus-visible { outline: 3px solid var(--pc-glow); outline-offset: 2px; }
.pc-hud .pc-btn { background: rgb(12 16 48 / 72%); color: var(--pc-ink); border-color: rgb(255 255 255 / 25%); min-height: 34px; padding: 3px 12px; font-size: 0.82rem; }

.pc-sheet { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); width: min(560px, calc(100% - 24px)); background: var(--pc-panel); color: var(--pc-panel-ink);
  border-radius: 18px; padding: 12px 14px; box-shadow: 0 12px 32px rgb(0 0 0 / 40%); display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: start; }
.pc-sheet__num { grid-row: span 2; width: 44px; height: 44px; border-radius: 12px; background: var(--c); color: #fff; font-family: var(--display); font-size: 1.3rem; display: grid; place-items: center; }
.pc-sheet__eyebrow { font-size: 0.76rem; color: var(--pc-panel-soft); font-weight: 600; }
.pc-sheet__title { font-family: var(--display); font-size: 1.12rem; line-height: 1.3; }
.pc-sheet__body { grid-column: 1 / -1; font-size: 0.86rem; margin: 2px 0 0; color: var(--pc-panel-ink); }
.pc-sheet__meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.8rem; color: var(--pc-panel-soft); }
.pc-sheet__meta strong { color: var(--pc-panel-ink); }
.pc-sheet__nav { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: space-between; align-items: center; margin-top: 4px; }
.pc-sheet__nav span { font-size: 0.74rem; color: var(--pc-panel-soft); }

.pc-notes { background: rgb(255 255 255 / 5%); border: 1px solid rgb(255 255 255 / 12%); border-radius: 18px; padding: 16px 18px; }
.pc-notes h2 { font-family: var(--display); font-size: 1.2rem; margin: 0 0 8px; }
.pc-notes ul { margin: 0; padding-left: 1.2em; }
.pc-notes li { margin: 4px 0; color: var(--pc-ink-soft); }
.pc-notes li strong { color: var(--pc-ink); }
.pc-legend { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; padding: 0; list-style: none; }
.pc-legend li { margin: 0; color: var(--pc-ink); background: var(--c); border-radius: 999px; padding: 2px 12px; font-size: 0.84rem; font-weight: 600; }
.pc-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.pc-table th, .pc-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid rgb(255 255 255 / 12%); vertical-align: top; }
.pc-table th { color: var(--pc-ink-soft); font-weight: 600; }
.pc-tablebox { overflow-x: auto; }
.pc-new { display: inline-block; background: var(--pc-glow); color: var(--pc-panel-ink); border-radius: 6px; padding: 0 6px; font-size: 0.7rem; font-weight: 700; margin-left: 4px; }
.pc-fallback { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--pc-ink-soft); }

@media (max-width: 640px) {
  .pc-stage { height: 76vh; min-height: 560px; border-radius: 18px; }
  .pc-card { padding: 4px 10px 3px; min-width: 0; }
  .pc-card strong { font-size: 0.9rem; }
  .pc-card small { font-size: 0.55rem; letter-spacing: 0.1em; }
  .pc-pin:not(.is-selected) .pc-pills { display: none; }
  .pc-sheet { bottom: 10px; padding: 10px 12px; }
  .pc-sheet__body { display: none; }
  .pc-hint, .pc-sheet__hint { display: none; }
  .pc-hud { justify-content: flex-end; }
  .pc-sheet__title { font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* 故事頁裡的精簡模式：沒有導覽卡，只有選到的星球展開膠囊；文字在旁邊 */
.pc-compact .pc-sheet, .pc-compact .pc-hint { display: none; }
.pc-compact .pc-hud { justify-content: flex-end; }
.pc-compact .pc-pin:not(.is-selected) .pc-pills { display: none; }

/* 對比：深色太空區塊裡的文字一律是淺色，不讓外層頁面的深色字樣式蓋掉 */
.pc-embed, .pc-embed h2, .pc-embed p, .pc-embed li, .pc-embed td, .pc-embed th, .pc-embed strong { color: var(--pc-ink); }
.pc-legend li, .cs-game .pc-legend li { color: #fff; }
.pc-hud .pc-btn, .cs-game .pc-hud .pc-btn { color: var(--pc-ink); }
.pc-pill, .cs-game .pc-pill { color: var(--pc-panel-ink); }
.pc-card, .pc-card strong, .pc-card small, .cs-game .pc-card strong, .cs-game .pc-card small { color: #fff; }
.pc-sheet, .pc-sheet .pc-sheet__title, .pc-sheet__body { color: var(--pc-panel-ink); }
.pc-pills .pc-pill b { color: #fff; }

/* 看全景：沒選到的星球縮成編號圓點 */
.pc-dot { display: none; width: 26px; height: 26px; border-radius: 50%; background: var(--c); color: #fff; font-weight: 700; font-size: 0.8rem; place-items: center; border: 2px solid rgb(255 255 255 / 85%); box-shadow: 0 3px 8px rgb(0 0 0 / 35%); }
.pc-far .pc-pin:not(.is-selected) .pc-dot { display: grid; }
.pc-far .pc-pin:not(.is-selected) .pc-card, .pc-far .pc-pin:not(.is-selected) .pc-pills { display: none; }
.pc-far .pc-pin.is-locked .pc-dot { background: var(--pc-locked); }
.pc-pin.is-selected { z-index: 2; }

/* 星球上 3D 角色的名牌：放在腳下；正在說話的人名牌是青色；鏡頭拉遠時只留說話的人 */
.pc-cast { position: absolute; inset: 0; pointer-events: none; }
.pc-cast[hidden] { display: none; }
.pc-actor { position: absolute; left: 0; top: 0; transform: translate(-50%, 2px); }
.pc-actor.is-off { visibility: hidden; }
.pc-actor small { display: block; background: rgb(12 16 48 / 78%); color: var(--pc-ink); border-radius: 999px; padding: 0 8px; font-size: 0.7rem; font-weight: 700; white-space: nowrap; }
.pc-actor.is-speaking small { background: var(--pc-glow); color: var(--pc-panel-ink); }
.pc-actor.is-speaking { z-index: 1; }
.pc-cast.is-tight .pc-actor:not(.is-speaking) small { display: none; }
@media (max-width: 640px) { .pc-actor small { font-size: 0.62rem; padding: 0 6px; } }

/* 地圖上的說話泡泡：白底深字、尾巴指向說話的人；波可的泡泡是雲朵造型 */
.pc-say { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); max-width: min(260px, 70%); background: #fff; color: var(--pc-panel-ink); border-radius: 16px; padding: 6px 12px 7px; box-shadow: 0 8px 20px rgb(0 0 0 / 40%); pointer-events: none; z-index: 2000; font-size: 0.86rem; line-height: 1.45; }
.pc-say[hidden] { display: none; }
.pc-say::after { content: ""; position: absolute; left: calc(50% + var(--tail, 0px)); bottom: -9px; width: 18px; height: 18px; background: inherit; transform: translateX(-50%) rotate(45deg); border-radius: 3px; }
.pc-say__who { display: block; font-size: 0.7rem; color: var(--pc-panel-soft); }
.pc-say__text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; position: relative; z-index: 1; }
.pc-say.is-poko { border-radius: 22px; box-shadow: 0 0 0 3px rgb(143 240 255 / 60%), 0 8px 20px rgb(0 0 0 / 40%); }
.pc-say.is-new { animation: pc-say-in 0.3s ease both; }
@keyframes pc-say-in { from { opacity: 0; margin-top: 8px; } }
.pc-say, .pc-say .pc-say__text, .cs-game .pc-say .pc-say__text { color: var(--pc-panel-ink); }
.pc-say .pc-say__who, .cs-game .pc-say .pc-say__who { color: var(--pc-panel-soft); }
@media (max-width: 640px) { .pc-say { font-size: 0.76rem; padding: 4px 10px 5px; max-width: min(220px, 70%); } .pc-say__text { -webkit-line-clamp: 2; } }
@media (prefers-reduced-motion: reduce) { .pc-say.is-new { animation: none; } }
.pc-hud { z-index: 2100; }
.pc-talking .pc-pin.is-selected { visibility: hidden; }

/* 結局短片播放中：星球標籤淡出 */
.pc-showing .pc-pins { opacity: 0; pointer-events: none; transition: opacity 0.4s ease; }
