/* 全国版：地形・写真をタイルで読み込む。見た目の作りは地域版（../index.html）と同じ */
:root {
  color-scheme: light dark;
  --ink: #0d1b2e;
  --panel: rgba(246, 249, 253, 0.86);
  --line: rgba(13, 27, 46, 0.14);
  --acc: #1f5fbf;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --ink: #e8eef7;
    --panel: rgba(14, 22, 36, 0.82);
    --line: rgba(232, 238, 247, 0.16);
    --acc: #7fb0ff;
  }
}
:root[data-theme='dark'] {
  --ink: #e8eef7;
  --panel: rgba(14, 22, 36, 0.82);
  --line: rgba(232, 238, 247, 0.16);
  --acc: #7fb0ff;
}
* {
  box-sizing: border-box;
  min-width: 0;
}
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #9fb8d8;
}
body {
  font:
    15px/1.5 'Jost',
    'Zen Kaku Gothic New',
    system-ui,
    sans-serif;
  color: var(--ink);
}
#c {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
/* 下のメニュー：白い線画のアイコンだけ（Lucide、ISC ライセンス）。丸や背景は付けず、ごく薄い影で地図から浮かせる */
#dock {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  translate: -50% 0;
  display: flex;
  gap: 10px;
  z-index: 5;
}
/* アイコンの下に小さく名前を添える（初見でも押すと何が起きるか分かるように） */
#dock button {
  width: 48px;
  height: 52px;
  grid-template-rows: 32px auto;
  align-content: start;
  font: inherit; /* ボタンは既定ではページの書体を受け継がない（名前を Zen Kaku Gothic New にそろえる） */
  border: none;
  background: none;
  color: #fff;
  display: grid;
  justify-items: center;
  align-items: center;
  cursor: pointer;
  padding: 0;
  opacity: 0.82;
  transition: opacity 0.15s, transform 0.15s;
}
#dock button:hover {
  opacity: 1;
}
#dock button[aria-expanded='true'],
#dock button[aria-pressed='true'] {
  opacity: 1;
  transform: translateY(-2px);
}
#dock button[aria-expanded='true']::after,
#dock button[aria-pressed='true']::after {
  content: '';
  position: absolute;
  bottom: -4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fff;
}
#dock button {
  position: relative;
}
#dock svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}
#dock span {
  font-family: inherit;
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
/* おまかせの再生中は、アイコンを ✕「止める」に替える */
#amb .i1,
body.ambient #amb .i0 {
  display: none;
}
body.ambient #amb .i1 {
  display: block;
}
/* 共有：コピーしたことを短く知らせる */
#toast {
  position: fixed;
  left: 50%;
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + 72px);
  translate: -50% 0;
  z-index: 6;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
#toast.on {
  opacity: 1;
}
/* アイコンを押すと開くパネル：背景なし。白い文字と細い線だけで景色の上に置く */
.sheet {
  position: fixed;
  left: 50%;
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + 70px);
  translate: -50% 0;
  width: min(380px, calc(100% - 32px));
  max-height: calc(100% - 200px - max(16px, env(safe-area-inset-bottom)));   /* 上のタイトル・時刻に重ねない */
  overflow: auto;
  padding: 4px 2px;
  z-index: 4;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55), 0 0 12px rgba(0, 0, 0, 0.25);
  --ink: #fff;
  --line: rgba(255, 255, 255, 0.55);
  --acc: #fff;
  scrollbar-width: none;
}
.sheet[hidden] {
  display: none;
}
.shead {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.shead h2 {
  flex: 1;
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.sclose {
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  text-shadow: inherit;
}
.sheet h3 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin: 14px 0 0;
  opacity: 0.8;
}
.sheet .seg button,
.sheet .btns button,
.sheet .when button,
.sheet .tctl button,
.sheet select,
.sheet input[type='date'] {
  min-height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(0, 0, 0, 0.08);
  color: #fff;
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  text-shadow: inherit;
  cursor: pointer;
  padding: 0 10px;
}
.sheet .seg button[aria-pressed='true'],
.sheet .when button[aria-pressed='true'],
.sheet .tctl button[aria-pressed='true'],
.sheet .btns button[aria-pressed='true'] {
  background: #fff;
  color: #0d1b2e;
  border-color: #fff;
  text-shadow: none;
}
.sheet button:disabled,
.sheet select:disabled,
.sheet input:disabled {
  opacity: 0.4;
  cursor: default;
}
.sheet select option {
  color: #0d1b2e;
  text-shadow: none;
}
.sheet input[type='date']::-webkit-calendar-picker-indicator {
  filter: invert(1);
}
.sheet .note,
.sheet .sub,
.sheet .sunv {
  opacity: 0.9;
}
.sheet a {
  color: #fff;
}
/* つまみの付いた細い白い線のスライダー */
.sheet input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  background: none;
  height: 24px;
}
.sheet input[type='range']::-webkit-slider-runnable-track {
  height: 1.5px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
.sheet input[type='range']::-moz-range-track {
  height: 1.5px;
  background: rgba(255, 255, 255, 0.7);
}
.sheet input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  margin-top: -5.75px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
.sheet input[type='range']::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: none;
  border-radius: 50%;
  background: #fff;
}
@media (max-width: 600px) {
  .sheet {
    left: 16px;
    right: 16px;
    translate: none;
    width: auto;
    max-height: min(58%, calc(100% - 190px - max(16px, env(safe-area-inset-bottom))));
  }
}
h1 {
  font-size: 20px;
  line-height: 1.2;
  margin: 0 0 2px;
  font-weight: 700;
}
.sub {
  font-size: 13px;
  opacity: 0.75;
  margin: 4px 0 8px;
}
.row {
  display: grid;
  grid-template-columns: 7.2em minmax(0, 1fr) 3.6em;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
}
.row label {
  font-size: 13px;
}
.row output {
  font-size: 13px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
input[type='range'] {
  width: 100%;
  accent-color: var(--acc);
  height: 28px;
}
.seg {
  display: flex;
  gap: 4px;
  margin: 10px 0 6px;
  flex-wrap: wrap;
}
.seg button,
.btns button,
.when button {
  flex: 1;
  min-height: 36px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.places button {
  flex: 1 1 30%;
}
.seg button[aria-pressed='true'],
.when button[aria-pressed='true'] {
  background: var(--acc);
  color: #fff;
  border-color: var(--acc);
}
.btns {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 2px;
}
.note {
  font-size: 12px;
  opacity: 0.72;
  margin: 10px 0 0;
  line-height: 1.5;
}
.note a {
  color: inherit;
}
#load {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 15px;
  color: #0d1b2e;
  pointer-events: none;
}
#stat {
  position: fixed;
  right: 12px;
  top: 10px;
  font-size: 12px;
  color: #0d1b2e;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
details summary {
  cursor: pointer;
  font-size: 13px;
  margin-top: 8px;
}
.when {
  display: flex;
  gap: 6px;
  align-items: center;
  margin: 4px 0;
}
.when input[type='date'] {
  flex: 1.4;
  min-height: 36px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  padding: 0 8px;
}
.when select {
  flex: 1;
  min-height: 36px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  padding: 0 6px;
}
#sno {
  width: auto;
  min-width: 5.2em;
}
.legend {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  flex-wrap: wrap;
  margin: 2px 0 6px;
  font-variant-numeric: tabular-nums;
}
.legend[hidden] {
  display: none;
}
.legend span {
  margin-right: 4px;
  font-size: 12px;
}
.legend i {
  display: inline-block;
  width: 14px;
  height: 10px;
  background: var(--c);
  border: 1px solid var(--line);
}
.sunv {
  font-size: 12px;
  opacity: 0.75;
  margin: 2px 0 4px;
  font-variant-numeric: tabular-nums;
}
/* 飛行機モード：空港の名札（地図の上）と、飛行中の表示 */
#ap {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
/* 空港の名札：点の右に地名、コードは小さく（地図の注記のように） */
.aplabel {
  position: absolute;
  left: 0;
  top: 0;
  translate: -3px -50%;
  pointer-events: auto;
  border: none;
  background: none;
  color: #fff;
  font: inherit;
  font-size: 12px;
  line-height: 1.25;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: baseline; /* 地名とコード（小さい英字）は下揃え。点は ::before で上下中央 */
  gap: 6px;
  padding: 2px 4px 2px 0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
.aplabel::before {
  content: '';
  align-self: center;
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
}
.aplabel small {
  font-size: 9px;
  opacity: 0.75;
  letter-spacing: 0.08em;
  margin-left: 4px;
}
.aplabel.origin {
  font-size: 13px;
  font-weight: 500;
}
.aplabel.origin::before {
  width: 9px;
  height: 9px;
}
.aplabel.dim {
  opacity: 0.45;
  cursor: default;
}
/* 右がふさがっているときは点の左に名前 */
.aplabel.left::before {
  order: 1;
}
.aplabel.left {
  translate: calc(-100% + 3px) -50%;
  padding: 2px 0 2px 4px;
}
.aplabel.origin.left {
  translate: calc(-100% + 4.5px) -50%;
}
/* 左上・左下（伊丹・関西のように近くに並ぶ空港）：点を名札の右下・右上の角に置く */
.aplabel.ul::before,
.aplabel.dl::before {
  order: 1;
}
.aplabel.ul,
.aplabel.dl {
  padding: 2px 0 2px 4px;
}
.aplabel.ul::before {
  align-self: flex-end;
}
.aplabel.ul {
  translate: calc(-100% + 3px) calc(-100% + 5px);
}
.aplabel.dl::before {
  align-self: flex-start;
}
.aplabel.dl {
  translate: calc(-100% + 3px) -5px;
}
.aplabel.origin.ul {
  translate: calc(-100% + 4.5px) calc(-100% + 6.5px);
}
.aplabel.origin.dl {
  translate: calc(-100% + 4.5px) -6.5px;
}
.aplabel.dr::before {
  align-self: flex-start;
}
.aplabel.dr {
  translate: -3px -5px;
}
.aplabel.origin.dr {
  translate: -4.5px -6.5px;
}
/* ほかの名札と重なるときは点だけ（寄ると名前が出る） */
.aplabel.mini {
  font-size: 0;
  gap: 0;
  padding: 6px;
  translate: -9px -50%;
}
.aplabel.mini small {
  display: none;
}
#fllist small {
  display: block;
  font-size: 9px;
  opacity: 0.8;
}
/* 飛行中の表示：左下に小さくまとめる。光の時刻を少し大きく、出発地と到着地を結ぶ線の上に現在地 */
#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
  font-variant-numeric: tabular-nums;
}
#hud[hidden] {
  display: none;
}
.hcard {
  position: absolute;
  left: 50%;
  translate: -50% 0;
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + 52px);
  width: min(720px, calc(100% - 48px));
  text-align: center;
}
.hmeta {
  justify-content: center;
}
.hrt {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}
.hrt small {
  font-size: 9px;
  opacity: 0.7;
  letter-spacing: 0.08em;
  margin-left: 4px;
}
.hsep {
  position: relative;
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.5);
}
.hsep i {
  position: absolute;
  top: -3px;
  left: 0;
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.45);
}
.htime small {
  display: block;
  font-size: 11px;
  letter-spacing: 0.12em;
  opacity: 0.85;
  margin-bottom: 2px;
}
.hsep {
  pointer-events: auto;
  cursor: ew-resize;
  touch-action: none;
}
.hsep::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -12px;
  bottom: -12px; /* 細い線でもつかみやすく */
}
.htime {
  font-size: 40px;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.1;
  margin: 8px 0 4px;
}
.hmeta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 12px;
  opacity: 0.92;
}
.hmeta b {
  font-weight: 500;
  font-size: 13px;
}
.hudb {
  position: absolute;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  translate: -50% 0;
  display: flex;
  gap: 8px;
  pointer-events: auto;
}
#hud button,
#hud select {
  min-height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(0, 0, 0, 0.08);
  color: #fff;
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  padding: 0 12px;
  text-shadow: inherit;
  cursor: pointer;
  white-space: nowrap;
}
#hud select option {
  color: #0d1b2e;
}
@media (max-width: 600px) {
  .hcard {
    width: calc(100% - 32px);
  }
  .htime {
    font-size: 32px;
  }
  #hud button,
  #hud select {
    padding: 0 8px;
    font-size: 11px;
  }
  .hudb {
    gap: 6px;
  }
}
body.flying #dock,
body.flying .sheet:not(#s-time),
body.flying #s-time[hidden],
body.flying.tsheet .hcard,
body.flying #tplay,
body.flying .csel:has(#tsp) {
  display: none;
}
/* 選び直しのボタンは出発地を選んでから（.btns の display が hidden より強いので明示する） */
#flsel .flnote {
  font-size: 11px;
  opacity: 0.75;
  margin-top: 2px;
}
#flbk[hidden] {
  display: none;
}
/* 飛行中の時刻のパネルは、下の操作欄の上に置く（再生は飛行の時刻と競うので出さない） */
body.flying #s-time {
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + 48px);
}
#hud button[aria-pressed='true'] {
  background: rgba(255, 255, 255, 0.25);
}
/* 窓枠の線画（客室の窓・操縦席）。白い細い線だけで、景色は隠さない */
#sill {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
#sill[hidden] {
  display: none;
}
#sill svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: #fff;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-opacity: 0.85;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}
#sill svg path {
  vector-effect: non-scaling-stroke;
}
#sill svg .thin {
  stroke-width: 0.9;
  stroke-opacity: 0.6;
}
/* 上のタイトルと、その下の光の時刻（常に表示） */
#logo {
  position: fixed;
  left: 50%;
  top: max(16px, env(safe-area-inset-top));
  translate: -50% 0;
  text-align: center;
  color: #fff;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  z-index: 3;
  font-family: 'Jost', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
#logo h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.32em;
  margin-right: -0.32em; /* 字間の分だけ右にずれないように */
}
#clock {
  pointer-events: auto;
  cursor: ew-resize;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  display: inline-block;
  padding: 2px 0; /* 点線は文字の幅に合わせる（字間の分だけ右に余るので、右の余白を詰める） */
  margin-right: -0.14em;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.6);
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  font-variant-numeric: tabular-nums;
  opacity: 0.92;
}
#stat[hidden] {
  display: none;
}
.sheet .row {
  grid-template-columns: 6.4em minmax(0, 1fr) 5.2em;
}
/* 読み込み中の表示も白い小さな文字で */
/* 読み込み中の「…」を1つずつ灯す */
#load i {
  font-style: normal;
  animation: ldot 1.2s infinite;
}
#load i:nth-child(2) {
  animation-delay: 0.2s;
}
#load i:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes ldot {
  0%,
  100% {
    opacity: 0.2;
  }
  40% {
    opacity: 1;
  }
}
#load {
  white-space: pre-line; /* お知らせは \n で改行 */
  text-align: center;
  line-height: 1.9;
  padding: 0 24px;
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
/* 行き先の一覧は小さく。PC では左下に置いて、地図の名札と重ならないように */
#fllist button {
  flex: 1 1 30%;
  min-height: 28px;
  padding: 2px 6px;
  font-size: 11px;
  line-height: 1.3;
}
/* 時刻のパネル：表示の切り替え（光・雪・雲）、1本のタイムバー、まとめた操作 */
.layers {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 6px 0 10px;
}
.layers button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  border: none;
  background: none;
  color: #fff;
  font: inherit;
  font-size: 10px;
  letter-spacing: 0.1em;
  cursor: pointer;
  opacity: 0.4;
  padding: 0;
  text-shadow: inherit;
}
.layers button[aria-pressed='true'] {
  opacity: 1;
}
.layers svg,
.tctl svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}
#lynote {
  font-size: 11px;
  opacity: 0.85;
}
.tbar {
  position: relative;
  margin: 4px 0 2px;
}
.tbar input {
  width: 100%;
  display: block;
}
.tlab {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 0.08em;
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
}
.tctl {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 2px;
}
.tctl #tplay {
  width: 40px;
  min-width: 40px;
  padding: 0;
  display: grid;
  place-items: center;
}
.tctl #tplay svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}
.tctl #tplay[aria-pressed='true'] svg {
  fill: currentColor;
}
.sheet .tctl select,
.sheet .tctl button {
  flex: 1;
}
.sheet .tctl #tplay {
  flex: none;
}
/* 期間・速さ・いま の3つは同じ横幅（中身の長さで幅が変わり、文字が矢印に重なっていた） */
.tctl > .csel,
.sheet .tctl > button:not(#tplay) {
  flex: 0 0 calc((100% - 40px - 24px) / 3); /* 再生（40px）と間（8px×3）を除いて三等分 */
  min-width: 0;
}
.sheet .tctl button.csel-btn {
  padding: 0 19px 0 10px;
  background-position: right 8px center;
  background-size: 9px 6px;
  letter-spacing: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 出典：英語で右端に縦書き */
#credits {
  position: fixed;
  right: max(10px, env(safe-area-inset-right));
  top: 50%;
  translate: 0 -50%;
  margin: 0;
  writing-mode: vertical-rl;
  white-space: nowrap; /* 1列で、上下の中央に */
  font-family: 'Jost', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  line-height: 1.6;
  color: #fff;
  opacity: 0.72;
  z-index: 3;
}
#credits a {
  color: inherit;
  text-decoration: none;
}
body.flying #credits {
  opacity: 0.45;
}
/* タイトルと時刻を大きく */
#logo h1 {
  font-size: 35px; /* 地球の縁の明るい所でも埋もれないように（にじみも大きさに比例して広がる） */
  font-weight: 700; /* Google Fonts で 700 を読み込む（読み込まないとブラウザの疑似太字になる） */
}
#clock {
  font-size: 15px;
  margin-top: 6px;
}
.sclose {
  display: none;
}
/* 文字・線・アイコンの黒い影はいったんすべてなくす */
*,
*::before,
*::after {
  text-shadow: none !important;
}
#dock svg,
#sill svg,
.layers svg,
.tctl svg {
  filter: none !important;
}
.aplabel::before,
.hsep i,
.sheet input[type='range']::-webkit-slider-runnable-track,
.sheet input[type='range']::-webkit-slider-thumb {
  box-shadow: none !important;
}
@media (max-width: 600px) {
  #logo h1 {
    font-size: 30px;
  }
  #clock {
    font-size: 13px;
  }
  #credits {
    font-size: 9px;
    right: 4px;
  }
}
/* ボタンの中は塗らない */
.sheet .seg button,
.sheet .btns button,
.sheet .when button,
.sheet .tctl button,
.sheet select,
#hud button,
#hud select {
  background-color: transparent;
}
/* プルダウン：OS の見た目をやめ、ボタンと同じ細い白枠に細い下向きの山形 */
.sheet select,
#hud select {
  -webkit-appearance: none;
  appearance: none;
  padding: 0 28px 0 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='white' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 10px 7px;
  text-align: left;
}
/* 飛行中：進行のバーは下のボタンのすぐ上に */
.hrt {
  margin-top: 10px;
}
/* ダブルタップでの拡大と、文字の選択・長押しのメニューを止める（情報のパネルの文章だけは選べる） */
html,
body {
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
#s-info .sub,
#s-info .note,
#s-info .ilist,
#credTx {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}
/* 光・雪・雲のアイコンは左右の中央に */
.layers {
  justify-content: center;
  flex-wrap: wrap;
}
#lynote {
  flex-basis: 100%;
  text-align: center;
}
#lynote:empty {
  display: none;
}
/* オリジナルのプルダウン：ボタンは他と同じ細い白枠、選択肢はボタンの上に縦に並べる（背景なし、選んでいるものは白地） */
.csel {
  position: relative;
  display: inline-flex;
  flex: 1;
}
.hudb .csel {
  flex: none;
}
.csel-btn {
  flex: 1;
  min-height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='white' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 11px center / 10px 7px;
  color: #fff;
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  padding: 0 28px 0 14px;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}
.csel-btn[aria-expanded='true'] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 6.5l5-5 5 5' fill='none' stroke='white' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.csel-list {
  position: fixed;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 10;
  min-width: max-content;
}
.csel-list[hidden] {
  display: none;
}
.csel-list button {
  min-height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: transparent;
  color: #fff;
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  padding: 0 14px;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.csel-list button[aria-selected='true'] {
  background: #fff;
  color: #0d1b2e;
  border-color: #fff;
}
#hud {
  --acc: #fff;
}
/* 地図の名札：地名と空港コードの間を詰める */
.aplabel small {
  margin-left: -2px;
}
/* パネルの見出しはやや太く */
.shead h2 {
  font-weight: 700;
}
/* プルダウンのボタンの山形（ほかのボタンの指定に上書きされて消えていたので、強めに指定する） */
.sheet button.csel-btn,
#hud button.csel-btn {
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='white' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 11px center / 10px 7px;
  padding: 0 28px 0 14px;
  color: #fff;
}
.sheet button.csel-btn[aria-expanded='true'],
#hud button.csel-btn[aria-expanded='true'] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 6.5l5-5 5 5' fill='none' stroke='white' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
/* 場所の一覧：地方の見出しの下に、山の名前を文字だけで横に成り行きで並べる */
.plist {
  display: flex;
  flex-wrap: wrap;
  column-gap: 18px;
  row-gap: 2px;
  margin: 2px 0 4px;
}
.plist h3 {
  flex-basis: 100%;
  margin: 10px 0 0;
}
.plist button {
  padding: 4px 0 2px;
  border: none;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.6); /* 押せることがわかるように点線の下線（タイトルの下の時刻と同じ） */
  background: none;
  color: #fff;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.plist button:hover {
  border-bottom: 1px solid #fff;
}
/* 白い文字と線は、いったんすべて不透明（#FFF 100%）にそろえる。
   ただし、オン・オフや選べない状態を表すもの（表示していない光・雪・雲、出発できない空港、操作できない部品）は薄いまま */
#dock button,
.sheet h3,
.sheet .sunv,
.sub,
.note,
.sunv,
.aplabel small,
#fllist small,
.hrt small,
.htime small,
.hmeta,
#clock,
#lynote,
.tlab,
#credits,
body.flying #credits {
  opacity: 1;
}
.sheet {
  --line: #fff;
}
.sheet input[type='date'],
#hud select,
.csel-btn,
.csel-list button,
.sheet .seg button,
.sheet .btns button,
.sheet .when button,
.sheet .tctl button,
#hud button {
  border-color: #fff;
}
.sheet button.csel-btn,
#hud button.csel-btn {
  border-color: #fff;
}
.sheet input[type='range']::-webkit-slider-runnable-track,
.sheet input[type='range']::-moz-range-track,
.hsep {
  background: #fff;
}
#clock,
.plist button {
  border-bottom-color: #fff;
}
#sill svg,
#sill svg .thin {
  stroke-opacity: 1;
}
/* 左端の縦書き：高度・緯度経度・向き（右端の出典と同じ見た目） */
#pos {
  position: fixed;
  left: max(10px, env(safe-area-inset-left));
  top: 50%;
  translate: 0 -50%;
  margin: 0;
  writing-mode: vertical-rl;
  transform: rotate(180deg); /* 下から上へ読む（右端の出典と向かい合う） */
  font-family: 'Jost', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  line-height: 1.6;
  color: #fff;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  z-index: 3;
}
@media (max-width: 600px) {
  #pos {
    font-size: 9px;
    left: 4px;
  }
}

/* 大円で飛ぶ路線の注意書き（小さく） */
#hnote {
  margin: 6px 0 0;
  font-size: 10px;
  letter-spacing: 0.04em;
  opacity: 0.75;
  text-align: center;
}

/* 文字：Jost（Futura 系のジオメトリック体、OFL）。景色が主役なので、細めの字を広い字間で静かに置く。
   ロゴ・飛行中の時間は細字（300）、日付と時刻・小さな注記は読みやすさのため標準（400） */
body {
  font-weight: 400;
}
/* ロゴは小文字（大文字だと YOASOBI に見えやすいため）。字間は広めに */
#logo h1 {
  font-size: 40px;
  font-weight: 300;
  letter-spacing: 0.5em;
  margin-right: -0.5em;
  line-height: 1.1;
}
#clock {
  font-weight: 400; /* 小さい文字なので細字だとかすれる。ロゴ（細字）と差をつける */
  letter-spacing: 0.2em;
  margin-right: -0.2em;
}
#pos,
#credits {
  font-weight: 400;
  letter-spacing: 0.22em;
}
#hclk {
  font-weight: 300;
}
@media (max-width: 600px) {
  #logo h1 {
    font-size: 32px;
  }
}
/* 左右の縦書き（位置と出典）は画面の端に寄せる（行の高さの分の余白があるので、端からの距離は小さめに） */
#credits {
  right: max(4px, env(safe-area-inset-right));
}
#pos {
  left: max(4px, env(safe-area-inset-left));
}
@media (max-width: 600px) {
  #credits {
    right: max(1px, env(safe-area-inset-right));
  }
  #pos {
    left: max(1px, env(safe-area-inset-left));
  }
}

/* 場所の一覧を詰める：1地方1行（地方名は行の頭に小さく）。高さ・向きのボタンも低くして、スマホで1画面に収める */
.plist {
  display: block;
  margin: 4px 0 2px;
}
.prow {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 14px;
  row-gap: 2px;
  padding: 3px 0;
}
.prow .preg {
  flex: 0 0 9em;
  font-size: 10px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.prow button {
  padding: 3px 0 1px;
}
#s-place h3 {
  margin-top: 12px;
}
#s-place .seg,
#s-place .btns {
  margin: 6px 0 2px;
}
#s-place .seg button,
#s-place .btns button {
  min-height: 30px;
}
/* スマホ：パネルの左右は、両端の縦書き（位置と出典）にかからないよう広めに空ける */
@media (max-width: 600px) {
  .sheet {
    left: 36px;
    right: 36px;
  }
  .prow .preg {
    flex-basis: 8.2em;
  }
  .prow {
    column-gap: 12px;
  }
}

/* 流しっぱなしのモード：カットの間の暗転と、再生中はアイコン・パネル・空港の名札を隠す（触れると数秒だけアイコンを出す） */
/* おまかせ：見ている場所の名前 */
#ambname {
  position: fixed;
  left: 50%;
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + 70px); /* 下のアイコンの上（アイコンを出しても重ならず、出したままにできる） */
  translate: -50% 0;
  z-index: 4;
  color: #fff;
  font-size: 13px;
  letter-spacing: 0.2em;
  padding-left: 0.2em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s ease;
}
#ambname {
  text-align: center;
  line-height: 1.5;
}
#ambname small {
  display: block;
  font-family: 'Jost', sans-serif;
  font-size: 11px;
  letter-spacing: 0.22em;
  padding-left: 0.22em;
}
#ambname.on {
  opacity: 1;
}
body:not(.ambient) #ambname {
  opacity: 0;
}
/* おまかせ：次へ（触れたときだけ、アイコンと一緒に出す） */
#ambnext {
  position: fixed;
  right: 28px;
  top: 50%;
  translate: 0 -50%;
  z-index: 5;
  display: none;
  align-items: center;
  gap: 2px;
  padding: 10px 4px 10px 10px;
  border: none;
  background: none;
  color: #fff;
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.1em;
  cursor: pointer;
}
#ambnext svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
body.ambient #ambnext {
  display: flex;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}
body.ambient.amb-ui #ambnext {
  opacity: 1;
  pointer-events: auto;
}
#ambfade {
  position: fixed;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
  z-index: 2;
}
#ambfade.on {
  opacity: 1;
}
#ambfade.slow {
  transition-duration: 1.5s; /* 明るくするときはゆっくり（その間に細かいタイルが入る） */
}
body.ambient .sheet,
body.ambient #ap,
body.ambient #stat {
  display: none !important;
}
body.ambient #dock {
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}
body.ambient.amb-ui #dock {
  opacity: 1;
  pointer-events: auto;
}

/* 流しっぱなしのモードの評価（?review のときだけ） */
#rv {
  position: fixed;
  left: 40px;
  top: 16px;
  z-index: 60;
  width: 300px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(10, 16, 28, 0.72);
  color: #e8eef7;
  font: 400 12px/1.5 Jost, 'Zen Kaku Gothic New', sans-serif;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
#rvc {
  margin-bottom: 4px;
}
#rvs button {
  background: none;
  border: 0;
  padding: 0 3px;
  font-size: 22px;
  line-height: 1;
  color: rgba(232, 238, 247, 0.3);
  cursor: pointer;
}
#rvs button.on {
  color: #ffd36a;
}
#rvt {
  box-sizing: border-box;
  width: 100%;
  margin: 6px 0;
  padding: 6px;
  border: 1px solid rgba(232, 238, 247, 0.25);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
  color: inherit;
  font: inherit;
  resize: vertical;
}
#rvb {
  display: flex;
  gap: 6px;
  align-items: center;
}
#rvn {
  flex: 1;
  opacity: 0.7;
}
#rvb button {
  border: 1px solid rgba(232, 238, 247, 0.3);
  border-radius: 6px;
  background: none;
  color: inherit;
  font: inherit;
  padding: 3px 8px;
  cursor: pointer;
}
#rv:not(:has(#rvc:not(:empty))) {
  display: none;
}
body:not(.ambient) #rv {
  display: none;
}
@media (max-width: 640px) {
  #rv {
    left: 36px;
    right: 36px;
    top: auto;
    bottom: 84px;
    width: auto;
  }
}

/* 情報のパネル：見出しに英語の小見出し、箇条書き、クレジットのコピー、制作者のリンク */
#s-info h3 .en {
  margin-left: 8px;
  font-weight: 400;
  letter-spacing: 0.06em;
  opacity: 0.7;
}
#s-info .ilist {
  margin: 6px 0 0;
  padding-left: 1.2em;
  font-size: 12px;
  line-height: 1.6;
}
#s-info .ilist li + li {
  margin-top: 2px;
}
#s-info .ilist a {
  color: inherit;
}
#s-info .cred {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 0;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
}
#credTx {
  flex: 1;
  word-break: break-all;
}
#credCopy {
  flex: none;
  width: 30px;
  height: 30px;
  border: none;
  background: none;
  color: #fff;
  cursor: pointer;
  padding: 3px;
}
#credCopy svg {
  width: 18px;
  height: 18px;
}
#credCopy.done {
  opacity: 0.5;
}
#s-info .ext {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin: 0 2px;
}
#s-info .maker .ext,
#s-info .maker a {
  margin-left: 10px;
}
#s-info .maker a:first-child {
  margin-left: 0;
}
#s-info .ico {
  width: 11px;
  height: 11px;
}
#s-info .copy {
  margin-top: 12px;
  margin-bottom: 4px;
}
/* 飛行中の時刻のパネル：期間・再生の速さ・再生は出さない（時刻は飛行に合わせて進み、速さは飛行の倍率で決まる）。バーと「いま」だけ */
body.flying .tctl > .csel,
body.flying .tctl #tplay {
  display: none;
}
body.flying .tctl {
  justify-content: flex-end; /* 「いま」はほかの画面と同じ幅で右に */
}
