/* G8L-211 奧丁之眼 MVP：LOG 標題列的 ᛟ 開關＋開眼時的上下兩層畫布（odin-eye.js）。 */
#game .log-titlebar .odin-eye-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: center;
  height: 20px;
  margin-left: 7px;
  padding: 0 8px 0 7px;
  border: 1px solid #4a4458;
  border-radius: 10px;
  background: #2a2636;
  color: #cfc6ad;
  font: 12px/1 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
  white-space: nowrap;
  cursor: pointer;
}
#game .log-titlebar .odin-eye-toggle:focus-visible {
  outline: 2px solid #3c78a8;
  outline-offset: 1px;
}
.odin-eye-toggle .odin-eye-rune {
  color: #9a90b0;
  font: bold 13px/1 'Segoe UI Historic', 'Noto Sans Runic', serif;
}
.odin-eye-toggle .odin-eye-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #555;
}
#game .log-titlebar .odin-eye-toggle.is-on {
  border-color: rgb(255 255 255 / 70%);
  background: color-mix(in srgb, var(--odin-eye-halo, #ffc45a) calc(18% + 14% * var(--odin-eye-breath, 0.5)), #2a2636);
  box-shadow: 0 0 calc(6px + 6px * var(--odin-eye-breath, 0.5)) var(--odin-eye-halo, #ffc45a);
  color: #fff;
}
.odin-eye-toggle.is-on .odin-eye-rune,
.odin-eye-toggle.is-on .odin-eye-dot {
  color: var(--odin-eye-rune, #ffd682);
  background-color: transparent;
}
.odin-eye-toggle.is-on .odin-eye-dot {
  background: var(--odin-eye-rune, #ffd682);
}

/* G8L-211 odin-smooth：等地圖第一幀時，眼睛下方的細線讀條（樣式 B：白色 3px 細線；進度由 odin-eye.js waitBar 寫 --odin-eye-load）。 */
#game .log-titlebar .odin-eye-toggle.is-waiting {
  position: relative;
}
#game .log-titlebar .odin-eye-toggle.is-waiting::after {
  content: '';
  position: absolute;
  left: 0;
  top: calc(100% + 5px);
  width: 100%;
  height: 3px;
  background: #fff;
  transform-origin: left;
  transform: scaleX(var(--odin-eye-load, 0.04));
  transition: transform 0.2s linear;
  pointer-events: none;
}

/* 開眼時：#log 疊在下層畫布（主角視角）之上、上層畫布（隆起柔光、光束、盧恩、碎片）之下。 */
#game .combat-window.odin-eye-open > #log {
  position: relative;
  z-index: 1;
}
#game .combat-window > canvas.odin-eye-layer {
  position: absolute;
  z-index: 0;
  background: transparent !important;
  pointer-events: none;
}
#game .combat-window > canvas.odin-eye-over {
  z-index: 2;
}
/* Legacy 疊層（odin-rbl-stage.mjs 的 .entity-overlay）：跟原廠一樣沒有底色（EntityOverlay.js:29-42），不吃 LOG 煙燻玻璃；
   只在 EntityManager.render 內才同步顯示，所以 Legacy 畫布藏起來（關眼、暫停）時跟著藏。 */
#game .combat-window > .entity-overlay {
  background: transparent !important;
}
#game .combat-window > canvas.odin-eye-rbl[hidden] + .entity-overlay {
  display: none;
}
/* 傷害層（odin-eye-damage.js 的 div，clip-path 只剩揭露三角形）也是 .combat-window 直屬子元素，一樣被 game-glass.css:180-183 蓋上 62% 煙燻玻璃，
   整片揭露的場景被蓋灰（使用者 11/30 16:50 「畫面偏暗」；量測 揭露區亮度 52→99）。傷害層只放數字，不該有底色。 */
#game .combat-window > .odin-eye-damage {
  background: transparent !important;
}
/* 同圖瞬移的黑幕（odin-rbl-env/Background.js 的 .odin-eye-veil）也是直屬子元素：原廠是純黑遮罩（UI/Background.js _overlay），不吃煙燻玻璃
   （R66 正式機：吃到 62% 玻璃時全黑只剩約 6 成暗）。 */
#game .combat-window > .odin-eye-veil {
  background: #000 !important;
}
#log .odin-eye-taken {
  color: transparent;
  text-shadow: none;
}
.odin-eye-post {
  position: fixed;
  inset: 0;
  z-index: 40;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}

/* 手機：標題列窄，只留符文與燈號。 */
@media (max-width: 420px) {
  #game .log-titlebar .odin-eye-toggle .odin-eye-label {
    display: none;
  }
}

/* 全開（第二段）：LOG 窗下方的戰鬥訊息窗（odin-eye.js showBattle，高度由 JS 設成本次掛機統計窗的高度）。
   外觀沿用 .combat-window 的煙燻玻璃與列色；內容只留最新一頁，不出捲軸。 */
#game .combat-window.odin-eye-battle {
  display: flex;
  flex-direction: column;
}
#game .odin-eye-battle > .console {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  overflow: hidden;
}

/* U1（使用者 12/05 iPhone）：全開走完，Legacy 畫面延伸到 LOG 標題列底下（odin-eye.js showLegacy 的 bleed）；標題列疊在場景上、去掉藍色玻璃，
   按鈕照樣可點（原廠 UI 疊在滿版畫布上，Renderer.js:138-140）。 */
#game .window.combat-window.odin-eye-bleed > .titlebar.log-titlebar {
  position: relative;
  z-index: 3;
  border-bottom-color: transparent;
  background: transparent !important;
  text-shadow: 0 1px 2px #000;
}

/* W3 全螢幕（odin-fullscreen.mjs；DESIGN §17 修正，12/05）。按鈕＝頂列圓形玻璃圖示（top-bar.css:159-167 同一條規則），關閉鈕帶紅＝頂列靜音的紅玻璃值
   （top-bar.css:171）；鈕列是戰鬥窗直屬子元素，不吃煙燻玻璃（game-glass.css:179-187）。 */
#game .combat-window > .odin-fs-bar { position: absolute; z-index: 4; top: var(--odin-fs-top, 8px); right: 4px; display: flex; background: transparent !important; }
#game .combat-window > .odin-fs-bar[hidden], .odin-fs-bar > button[hidden] { display: none; }
#game .combat-window > .odin-fs-bar > button { position: relative; width: 44px; height: 44px; padding: 0; border: 0; background: transparent !important; color: var(--glass-icon-ink); cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
#game .combat-window > .odin-fs-bar > button > i { display: grid; place-items: center; margin: 6px; background-color: var(--glass-icon-fill); }
#game .combat-window > .odin-fs-bar > .odin-fs-close > i { background-color: rgb(96 30 38 / 72%); }
.odin-fs-bar svg { width: 18px; height: 18px; }
/* 隱藏介面 (12/06, odin-fullscreen.mjs hide/peek): open eye = shown, struck through = hidden. Hidden (html.odin-fs-bare) the bar's buttons and the
   minimap fade out and let touches through to the game; the eye a tap shows (.is-peek) fades back in, alone. */
.odin-fs-eye:not([aria-pressed="true"]) .odin-fs-shut { display: none; }
html.odin-fs #game .combat-window > .odin-fs-bar > button, html.odin-fs #game .combat-window > .odin-minimap { transition: opacity 250ms ease; }
html.odin-fs-bare #game .combat-window > .odin-fs-bar { pointer-events: none; }
html.odin-fs-bare #game .combat-window > .odin-fs-bar > button:not(.is-peek), html.odin-fs-bare #game .combat-window > .odin-minimap { opacity: 0; pointer-events: none; }
html.odin-fs-bare #game .combat-window > .odin-fs-bar > .is-peek { pointer-events: auto; }
.odin-fs-rec.is-recording::after { content: ''; position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: #ff3b3b; box-shadow: 0 0 4px #ff3b3b; animation: odin-fs-rec-breathe 1.6s ease-in-out infinite; }
/* 12/06 使用者：錄影中的紅點要呼吸閃爍（只在按鈕上，不入鏡）；減少動態時不閃。 */
@keyframes odin-fs-rec-breathe { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.8); } }
@media (prefers-reduced-motion: reduce) { .odin-fs-rec.is-recording::after { animation: none; } }
/* 直向／橫向全螢幕：只有遊戲。戰鬥窗＝整個畫面（CSS 滿版；有 Fullscreen API 時再加瀏覽器全螢幕），#log 盒＝眼的畫布盒，眼的 ResizeObserver 照它重設 Legacy 畫布
   （odin-rbl-stage.mjs fit＝Renderer.resize）。安全區只留給按鈕與搖桿，畫面畫到邊。 */
html.odin-fs, html.odin-fs body { overflow: hidden; overscroll-behavior: none; }
html.odin-fs #game .window.combat-window.odin-eye-full { position: fixed !important; z-index: 39; inset: 0 0 auto; width: 100vw !important; max-width: none; height: 100dvh !important; margin: 0; border: 0 !important; border-radius: 0 !important; touch-action: none; }
html.odin-fs #game .combat-window.odin-eye-full > .titlebar, html.odin-fs #game .odin-eye-battle { display: none !important; }
html.odin-fs #game .combat-window.odin-eye-full > #log { position: absolute; inset: 0; height: auto !important; }
html.odin-fs #game .combat-window > .odin-fs-bar { top: calc(8px + env(safe-area-inset-top)); right: calc(4px + env(safe-area-inset-right)); }
html.odin-fs .odin-explore { --bottom-reserve: env(safe-area-inset-bottom); }
/* 12/06 iPhone：轉向提示（不能鎖方向時「請把手機轉成橫向／直向」，不擋操作）與拍照預覽／影片儲存卡（獨立 App 不下載）。共用液態玻璃 .glass-pane
   （game-glass.css:30）；在搖桿層（game-glass.css:1055 z 40）之上；卡片置中、不蓋右上鈕列，關閉全螢幕隨時按得到。 */
.odin-fs-hint, .odin-fs-sheet { position: fixed; inset: 0; z-index: 41; display: grid; place-items: center; pointer-events: none; font-family: var(--glass-font); color: #fff; }
.odin-fs-hint > div, .odin-fs-sheet > div { display: grid; justify-items: center; gap: 8px; padding: 14px 18px; border-radius: 18px; text-shadow: 0 1px 2px #000; }
.odin-fs-hint svg { width: 40px; height: 40px; }
.odin-fs-sheet > div { pointer-events: auto; max-width: 70vw; }
.odin-fs-sheet :is(img, video) { display: block; max-width: 100%; max-height: 52dvh; border-radius: 8px; -webkit-touch-callout: default; -webkit-user-select: auto; user-select: auto; touch-action: auto; }
.odin-fs-sheet p { margin: 0; font-size: 14px; }
.odin-fs-sheet nav { display: flex; gap: 10px; }
.odin-fs-sheet button { min-width: 88px; min-height: 40px; border: 1px solid rgb(255 255 255 / 50%); border-radius: 20px; background: var(--glass-icon-fill, rgb(12 20 38 / 58%)); color: #fff; font: inherit; }

/* 使用者 12/05：全開時 LOG 頂列不顯示地圖座標與「上次同步」，改顯示跟伺服器的延遲（log-ping.js）；半開與關眼照舊。
   顏色：<100 綠、100～250 黃、>250 紅；細字、半透明底、單行。 */
#game .log-titlebar > .log-ping {
  display: none;
  color: #c9c9c9;
}
#game .combat-window.odin-eye-full > .log-titlebar > :is(#logMapPosition, #logLatency) {
  display: none;
}
#game .combat-window.odin-eye-full > .log-titlebar > .log-ping {
  display: inline-block;
  align-self: center;
  padding: 1px 6px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  font: 300 11px/1.3 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
#game .log-titlebar > .log-ping[data-level='good'] { color: #7ee08a; }
#game .log-titlebar > .log-ping[data-level='warn'] { color: #f2d36b; }
#game .log-titlebar > .log-ping[data-level='bad'] { color: #ff7b72; }
