/* GARGANTUA — High-Precision Schwarzschild Raytracer
   Mission terminal aesthetic: deep space + cyan / amber telemetry.
   Independent rebuild shell (HUD chrome).
   Operator: M2 — 2026-07-18 Mobile HQ (deck collapse / 44px hit / touch-action) */

:root {
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --cyan: #7fdcff;
  --amber: #ffb454;
  --cyan-dim: rgba(127, 220, 255, .45);
  --white: #eafaff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: #000;
  font-family: var(--mono);
  color: var(--cyan);
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  /* iOS Safari 16+：禁双击缩放；canvas 仍 touch-action:none 给 OrbitControls */
  touch-action: manipulation;
}

/* Canvas must bleed full screen — safe-area is for HUD only (not body padding) */
body {
  position: fixed;
  inset: 0;
  margin: 0;
  padding: 0;
}

/* ------------------------------------------------------------ layers */
#view {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: block;
  background: #000;
  z-index: 0;
  touch-action: none;
  /* Never let JS inline size fight layout viewport */
  max-width: none;
  max-height: none;
}

#fx {
  position: fixed; inset: 0;
  z-index: 5;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: .6;
  background:
    repeating-linear-gradient(0deg,
      rgba(255, 255, 255, .025) 0 1px,
      transparent 1px 3px),
    radial-gradient(ellipse at center,
      transparent 55%,
      rgba(0, 0, 0, .55) 100%);
}

#hud {
  position: fixed; inset: 0;
  z-index: 10;
  pointer-events: none;
  transition: opacity .6s ease;
}
#hud.off { opacity: 0; }
#hud .ctl { pointer-events: auto; }

#params { z-index: 15; }
#intro { z-index: 20; }

/* ------------------------------------------------------ corner brackets */
.corner {
  position: absolute;
  width: 34px; height: 34px;
  border: 1px solid var(--cyan-dim);
  animation: flick 6s step-end infinite;
}
.corner.tl { top: 22px; left: 22px; border-right: none; border-bottom: none; }
.corner.tr { top: 22px; right: 22px; border-left: none; border-bottom: none; }
.corner.bl { bottom: 22px; left: 22px; border-right: none; border-top: none; }
.corner.br { bottom: 22px; right: 22px; border-left: none; border-top: none; }

@keyframes flick {
  0%, 97.4% { opacity: 1; }
  97.5%, 98.4% { opacity: .35; }
  98.5%, 100% { opacity: 1; }
}

/* ------------------------------------------------------------ title */
#title-block { position: absolute; top: 30px; left: 42px; }
#title-block h1 {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: .42em;
  color: #fff;
  text-shadow: 0 0 14px rgba(127, 220, 255, .35);
}
#title-block .sub {
  margin-top: 7px;
  font-size: 11px;
  letter-spacing: .30em;
  color: var(--amber);
}
#title-block .sub2 {
  margin-top: 5px;
  font-size: 9.5px;
  letter-spacing: .24em;
  color: var(--cyan-dim);
}

/* ------------------------------------------------------------ clock */
#clock-block { position: absolute; top: 32px; right: 44px; text-align: right; }
#clock-block .label { font-size: 9px; letter-spacing: .3em; color: var(--cyan-dim); }
#clock-val {
  margin-top: 5px;
  font-size: 17px;
  letter-spacing: .18em;
  color: var(--white);
}

/* -------------------------------------------------------- telemetry */
#telemetry {
  position: absolute;
  bottom: 34px; left: 42px;
  font-size: 10.5px;
  line-height: 1.95;
  max-width: min(42vw, 320px);
  z-index: 1;
}
#telemetry .k {
  display: inline-block;
  min-width: 7.5em;
  letter-spacing: .12em;
  color: var(--cyan-dim);
  margin-right: 10px;
}
#telemetry .v { color: var(--white); letter-spacing: .06em; }

/* ------------------------------------------------------------- deck */
#deck {
  position: absolute;
  bottom: 30px; right: 40px;
  width: 260px;
  padding: 14px 14px 10px;
  border: 1px solid var(--cyan-dim);
  background: linear-gradient(160deg, rgba(8, 18, 32, .82), rgba(4, 8, 16, .72));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 2px;
}
.deck-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 9px;
  letter-spacing: .3em;
  color: var(--cyan-dim);
  margin-bottom: 10px;
  cursor: default;
}
.deck-title #deck-mode { flex: 1; min-width: 0; }
.deck-toggle {
  pointer-events: auto;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border: 1px solid rgba(127, 220, 255, .28);
  background: rgba(127, 220, 255, .06);
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  border-radius: 1px;
}
.deck-toggle:focus-visible {
  outline: 1px solid var(--white);
  outline-offset: 2px;
}
.deck-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 6px rgba(255, 180, 84, .8);
  flex: 0 0 auto;
}

/* Phone/tablet: collapsible deck — free subject height */
body.tier-phone .deck-title,
body.tier-tablet.orient-portrait .deck-title {
  cursor: pointer;
  min-height: 44px; /* 44px hit for title row */
  margin-bottom: 6px;
  user-select: none;
  -webkit-user-select: none;
}
body.deck-collapsed #deck .grid2,
body.deck-collapsed #deck .grid4,
body.deck-collapsed #deck #btn-cine,
body.deck-collapsed #deck #btn-sound,
body.deck-collapsed #deck #deck-hint {
  display: none !important;
}
body.deck-collapsed #deck {
  padding: 6px 10px 6px;
  width: auto;
  min-width: 132px;
  max-width: min(200px, calc(100vw - 16px));
}
body.deck-collapsed #deck .deck-title {
  margin-bottom: 0;
}

.btn {
  pointer-events: auto;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  background: rgba(127, 220, 255, .04);
  border: 1px solid rgba(127, 220, 255, .28);
  color: var(--cyan);
  padding: 8px 4px;
  cursor: pointer;
  text-align: center;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, color .18s ease;
  border-radius: 1px;
  min-height: 40px;
  min-width: 40px;
}
.btn:hover {
  background: rgba(127, 220, 255, .14);
  border-color: var(--cyan);
  box-shadow: 0 0 12px rgba(127, 220, 255, .18);
}
.btn:active { transform: translateY(1px); }
.btn.active {
  border-color: var(--amber);
  color: var(--amber);
  background: rgba(255, 180, 84, .15);
}
.btn:focus-visible {
  outline: 1px solid var(--white);
  outline-offset: 2px;
}

.btn.wide { width: 100%; display: block; margin-bottom: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 8px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 8px; }
.grid4 .btn { font-size: 8.5px; letter-spacing: .05em; }

#deck-hint {
  display: none;
  font-size: 8px;
  letter-spacing: .12em;
  color: var(--cyan-dim);
  line-height: 1.7;
  margin-top: 2px;
  text-align: center;
}
#deck-hint.show { display: block; }

/* -------------------------------------------------------- bottom hint */
#hint {
  position: absolute;
  bottom: 26px; left: 50%;
  transform: translateX(-50%);
  font-size: 9.5px;
  letter-spacing: .22em;
  color: var(--cyan-dim);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 1.2s ease;
}
#hint.show { opacity: .85; }

/* ------------------------------------------------------ params panel */
#params {
  position: fixed;
  top: 88px; right: 40px;
  width: 284px;
  /* dvh + safe-area：避免 iOS 底栏裁切；JS 再按 deck 夹紧 */
  max-height: min(72dvh, calc(100dvh - 120px - env(safe-area-inset-bottom, 0px) - env(safe-area-inset-top, 0px)));
  background: linear-gradient(165deg, rgba(8, 18, 32, .82), rgba(4, 8, 16, .72));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--cyan-dim);
  border-radius: 2px;
  padding: 12px 14px 14px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--cyan-dim) transparent;
}
#params.hidden { display: none; }
#params::-webkit-scrollbar { width: 5px; }
#params::-webkit-scrollbar-track { background: transparent; }
#params::-webkit-scrollbar-thumb { background: var(--cyan-dim); border-radius: 3px; }

.p-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.p-title { font-size: 11px; letter-spacing: .28em; color: var(--cyan); }
#btn-reset { padding: 5px 10px; min-height: 0; font-size: 9px; letter-spacing: .12em; }

.p-row { margin-bottom: 10px; }
.p-row:last-child { margin-bottom: 2px; }
.p-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 9px;
  letter-spacing: .08em; /* 中文标签不宜过宽字距 */
  color: var(--cyan-dim);
  margin-bottom: 4px;
}
.p-meta label { flex: 1; min-width: 0; }
.p-val { color: var(--white); }

#params input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  background: rgba(127, 220, 255, .22);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
#params input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--cyan);
  border: none;
  box-shadow: 0 0 8px rgba(127, 220, 255, .8);
}
#params input[type="range"]::-moz-range-thumb {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--cyan);
  border: none;
  box-shadow: 0 0 8px rgba(127, 220, 255, .8);
}
#params input[type="range"]::-moz-range-track {
  height: 3px;
  background: rgba(127, 220, 255, .22);
  border-radius: 2px;
}
#params input[type="range"]:focus-visible {
  outline: 1px solid var(--white);
  outline-offset: 3px;
}

/* ------------------------------------------------------------- intro */
#intro {
  position: fixed; inset: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 1.6s ease;
}
body.ready #intro { opacity: 0; pointer-events: none; visibility: hidden; display: none; }
body.shot #intro { display: none; }

.intro-card {
  text-align: center;
  animation: introCard 5.2s ease-in-out both;
}
@keyframes introCard {
  0%   { opacity: 0; transform: scale(1.06); filter: blur(8px); }
  25%  { opacity: 1; transform: scale(1);    filter: blur(0); }
  80%  { opacity: 1; transform: scale(1);    filter: blur(0); }
  100% { opacity: 0; transform: scale(.99); }
}
.intro-tag {
  font-size: 10px;
  letter-spacing: .5em;
  color: rgba(127, 220, 255, .6);
}
.intro-title {
  margin: 18px 0 16px;
  padding-left: .36em;
  font-size: clamp(44px, 9vw, 104px);
  font-weight: 700;
  letter-spacing: .36em;
  color: #fff;
  text-shadow:
    0 0 18px rgba(127, 220, 255, .55),
    0 0 46px rgba(127, 220, 255, .30);
}
.intro-quote {
  font-size: 12px;
  font-style: italic;
  letter-spacing: .22em;
  color: rgba(255, 180, 84, .75);
}

/* ------------------------------------------------------------- toast */
#toast {
  position: fixed;
  top: 24px; left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  font-size: 10px;
  letter-spacing: .2em;
  color: var(--amber);
  border: 1px solid rgba(255, 180, 84, .4);
  background: rgba(10, 8, 4, .88);
  padding: 8px 16px;
  opacity: 0;
  transition: opacity .4s ease;
  pointer-events: none;
  white-space: nowrap;
  max-width: 92vw;
}
#toast.show { opacity: 1; }

/* ------------------------------------------------------------- fatal */
#fatal {
  position: fixed; inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, .92);
  display: none;
  align-items: center;
  justify-content: center;
}
#fatal.show { display: flex; }
.fatal-card {
  border: 1px solid rgba(255, 180, 84, .5);
  background: rgba(8, 10, 16, .9);
  padding: 28px 34px;
  max-width: 560px;
  text-align: center;
}
.fatal-title {
  color: var(--amber);
  letter-spacing: .3em;
  font-size: 14px;
  margin-bottom: 12px;
}
.fatal-msg {
  font-size: 10px;
  color: var(--cyan-dim);
  line-height: 1.8;
  word-break: break-word;
  margin-bottom: 18px;
  text-align: left;
  max-height: 30vh;
  overflow-y: auto;
}
.fatal-btns { display: flex; gap: 10px; justify-content: center; }
.fatal-btns .btn { padding: 10px 18px; }

/* ---------------------------------------------------- reduced motion */
body.reduced .intro-card { animation: none; }
body.reduced .corner { animation: none; }

/* -------------------------------------------------------- responsive */

/* 宽屏：略增遥测字号、deck 稍右移，避免控件被拉得过大 */
@media (min-width: 1400px) {
  #title-block h1 { font-size: 36px; }
  #telemetry {
    font-size: 11.5px;
    left: 48px;
    bottom: 40px;
    max-width: 360px;
  }
  #telemetry .k { min-width: 8em; letter-spacing: .14em; }
  #deck {
    right: 48px;
    bottom: 36px;
    width: 268px;
  }
  #params {
    top: 96px;
    right: 48px;
    width: 300px;
  }
  #clock-block { right: 48px; }
  #clock-val { font-size: 18px; }
}

/* 平板 / 窄窗：deck 与 telemetry 不重叠 */
@media (max-width: 900px) {
  #telemetry {
    font-size: 9.5px;
    left: 28px;
    bottom: 28px;
    max-width: min(38vw, 220px);
    line-height: 1.85;
  }
  #telemetry .k { min-width: 6.2em; letter-spacing: .08em; }
  #deck {
    width: min(240px, 42vw);
    right: 22px;
    bottom: 22px;
  }
  #params {
    top: 80px;
    right: 18px;
    width: min(280px, calc(100vw - 36px));
    max-height: min(58dvh, calc(100dvh - 160px - env(safe-area-inset-bottom, 0px)));
  }
  #title-block .sub2 { letter-spacing: .14em; }
  #hint { display: none; }
}

@media (max-width: 720px) {
  #title-block { top: 20px; left: 26px; }
  #title-block h1 { font-size: 22px; letter-spacing: .32em; }
  #title-block .sub { font-size: 9px; letter-spacing: .16em; }
  #title-block .sub2 { font-size: 8px; letter-spacing: .12em; }
  #clock-block { top: 22px; right: 26px; }
  #clock-block .label { letter-spacing: .18em; }
  #clock-val { font-size: 14px; }
  #telemetry {
    font-size: 9px;
    bottom: 26px;
    left: 22px;
    max-width: min(36vw, 180px);
  }
  #telemetry .k { min-width: 5.5em; }
  #deck { width: 210px; right: 18px; bottom: 18px; }
  .btn { letter-spacing: .08em; }
  .corner { width: 24px; height: 24px; }
  .corner.tl { top: 14px; left: 14px; }
  .corner.tr { top: 14px; right: 14px; }
  .corner.bl { bottom: 14px; left: 14px; }
  .corner.br { bottom: 14px; right: 14px; }
  #params {
    top: 76px; right: 14px;
    width: min(284px, calc(100vw - 28px));
  }
}

/* 手机竖屏：压缩 HUD，保证画面中央 ~55% 高度无厚遮挡（主体完整入画） */
@media (max-width: 520px) {
  #title-block {
    top: calc(8px + env(safe-area-inset-top, 0px));
    left: calc(12px + env(safe-area-inset-left, 0px));
    max-width: calc(100vw - 108px);
  }
  #title-block h1 { font-size: 16px; letter-spacing: .24em; }
  #title-block .sub { font-size: 7.5px; letter-spacing: .1em; }
  #title-block .sub2 { display: none; }
  #clock-block {
    top: calc(10px + env(safe-area-inset-top, 0px));
    right: calc(12px + env(safe-area-inset-right, 0px));
  }
  #clock-val { font-size: 12px; }
  #telemetry {
    font-size: 7.5px;
    left: calc(8px + env(safe-area-inset-left, 0px));
    /* 紧贴底栏上方，不侵占画面中段 */
    bottom: calc(108px + env(safe-area-inset-bottom, 0px));
    line-height: 1.55;
    max-width: min(38vw, 132px);
    max-height: 5.5em;
    overflow: hidden;
  }
  /* 只保留距离 / 倾角 / FPS 三行，缩短遥测占位 */
  #telemetry .row:nth-child(n+4) { display: none; }
  #telemetry .k { min-width: 0; display: none; }
  #telemetry .row { display: flex; justify-content: flex-start; gap: 5px; }
  #telemetry .v { letter-spacing: .03em; }
  /* 折叠后 telemetry 贴底，主体多 ~80–120px 可见高度 */
  body.deck-collapsed #telemetry {
    bottom: calc(52px + env(safe-area-inset-bottom, 0px));
  }
  #deck {
    width: min(188px, calc(100vw - 20px));
    right: calc(8px + env(safe-area-inset-right, 0px));
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    padding: 7px 8px 6px;
    z-index: 2;
  }
  .deck-title { margin-bottom: 6px; font-size: 8px; letter-spacing: .22em; }
  .deck-toggle {
    /* 视觉 ~28px，热区用 padding 扩到 ≥44 */
    width: 28px;
    height: 28px;
    padding: 8px;
    box-sizing: content-box;
    margin: -8px -4px -8px 0;
  }
  .corner.bl { bottom: calc(6px + env(safe-area-inset-bottom, 0px)); left: calc(6px + env(safe-area-inset-left, 0px)); }
  .corner.br { bottom: calc(6px + env(safe-area-inset-bottom, 0px)); right: calc(6px + env(safe-area-inset-right, 0px)); }
  /* 视觉 ~30px；::after 扩展触控热区到 44px（不撑开布局） */
  .btn {
    font-size: 8.5px;
    padding: 6px 3px;
    letter-spacing: .05em;
    min-height: 30px;
    position: relative;
  }
  .btn::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: max(100%, 44px);
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }
  .grid2 { gap: 5px; margin-bottom: 5px; }
  .grid4 { grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 5px; }
  .grid4 .btn { font-size: 8.5px; min-height: 30px; letter-spacing: .03em; padding: 6px 2px; }
  .grid2 .btn { min-height: 30px; }
  .btn.wide { margin-bottom: 5px; min-height: 30px; }
  #btn-cine, #btn-sound { min-height: 30px; }
  #params {
    top: calc(52px + env(safe-area-inset-top, 0px));
    left: calc(8px + env(safe-area-inset-left, 0px));
    right: calc(8px + env(safe-area-inset-right, 0px));
    width: auto;
    /* 可滚动 sheet，不永久挡住黑洞中心 */
    max-height: min(42dvh, calc(100dvh - 188px - env(safe-area-inset-bottom, 0px) - env(safe-area-inset-top, 0px)));
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 16;
  }
  #toast {
    top: calc(8px + env(safe-area-inset-top, 0px));
    white-space: normal;
    text-align: center;
    letter-spacing: .1em;
    font-size: 9px;
    max-width: min(92vw, 360px);
  }
  #hint {
    left: 50%;
    bottom: calc(168px + env(safe-area-inset-bottom, 0px));
    width: min(90vw, 320px);
    transform: translateX(-50%);
    font-size: 8.5px;
    letter-spacing: .08em;
    white-space: normal;
    text-align: center;
  }
  body.deck-collapsed #hint {
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }
  #intro .intro-card { width: min(88vw, 360px); padding: 28px 22px; }
  #intro .intro-title { font-size: clamp(28px, 9vw, 42px); }
  #intro .intro-tag { letter-spacing: .28em; font-size: 9px; }
  .fatal-card { margin: 16px; padding: 22px 18px; max-width: calc(100vw - 32px); }
  .fatal-btns { flex-wrap: wrap; }
}

/* 矮横屏：压缩标题、藏遥测、精简 deck；略减占位避免鱼眼感由 JS FOV 处理 */
@media (max-height: 430px) {
  #title-block h1 { font-size: 15px; letter-spacing: .22em; }
  #title-block .sub, #title-block .sub2 { display: none; }
  #telemetry { display: none; }
  #clock-block .label { display: none; }
  #clock-val { font-size: 11px; }
  #deck {
    width: min(220px, 44vw);
    bottom: calc(4px + env(safe-area-inset-bottom, 0px));
    right: calc(6px + env(safe-area-inset-right, 0px));
    padding: 6px 6px 5px;
  }
  .deck-title { margin-bottom: 4px; font-size: 8px; }
  .grid2, .grid4 { gap: 4px; margin-bottom: 4px; }
  .btn { min-height: 32px; padding: 4px 2px; font-size: 8px; }
  #btn-cine, #btn-sound { min-height: 34px; }
  #params {
    top: calc(40px + env(safe-area-inset-top, 0px));
    max-height: min(68dvh, calc(100dvh - 84px - env(safe-area-inset-bottom, 0px)));
    width: min(240px, 44vw);
  }
  #hint { display: none; }
  .corner { width: 16px; height: 16px; }
}

/* 超窄竖屏（如 320px） */
@media (max-width: 360px) {
  #title-block h1 { font-size: 15px; letter-spacing: .2em; }
  #deck { width: min(196px, calc(100vw - 16px)); }
  .grid4 .btn { font-size: 8px; }
}

body.ios #fx { opacity: .35; } /* scanlines cost less visually on OLED */

/* 平板 / 窄桌面 */
@media (min-width: 521px) and (max-width: 900px) {
  #deck {
    width: min(240px, 42vw);
    right: calc(16px + env(safe-area-inset-right, 0px));
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
  #telemetry {
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    left: calc(20px + env(safe-area-inset-left, 0px));
    max-width: min(42vw, 220px);
  }
  #params {
    width: min(320px, calc(100vw - 40px));
    top: calc(84px + env(safe-area-inset-top, 0px));
    max-height: min(58dvh, 420px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  #params .p-row label {
    font-size: 10px;
    letter-spacing: .04em;
    white-space: normal;
    line-height: 1.35;
  }
}

/* 宽屏：控件别贴死边缘，遥测更易读 */
@media (min-width: 1400px) {
  #title-block { top: 36px; left: 48px; }
  #title-block h1 { font-size: 36px; }
  #clock-block { top: 40px; right: 48px; }
  #telemetry {
    left: 48px;
    bottom: 40px;
    font-size: 11px;
  }
  #telemetry .k { min-width: 120px; }
  #deck {
    width: 260px;
    right: 40px;
    bottom: 36px;
  }
  #params {
    right: 40px;
    top: 100px;
    width: 320px;
  }
}

/* 超矮窗（分屏 / 浏览器工具栏挤压） */
@media (max-height: 560px) {
  #intro .intro-quote { display: none; }
  #title-block .sub2 { display: none; }
  #clock-block .label { display: none; }
  #params {
    max-height: min(42dvh, 280px);
  }
}

/* 参数面板：中文标签更长时换行 */
#params .p-row label {
  max-width: 70%;
  white-space: normal;
  line-height: 1.3;
}
#params .p-row {
  gap: 6px;
}
body.mobile #params { overscroll-behavior: contain; }
