/* ARビュー — フルスクリーンカメラ＋オーバーレイ */

.ar-body { overflow: hidden; height: 100vh; height: 100dvh; }

#cam, #overlay {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh; height: 100dvh;
}
#cam { object-fit: cover; background: linear-gradient(180deg, #14203c 0%, #0c1226 55%, #0a0d18 100%); }
#overlay { touch-action: none; }

/* 開始画面 */
.ar-start {
  position: fixed; inset: 0; z-index: 30;
  display: grid; place-items: center;
  background: radial-gradient(800px 500px at 50% 30%, #1a2245, #07090f);
  padding: 24px;
}
.ar-start-box { max-width: 420px; text-align: center; display: flex; flex-direction: column; gap: 16px; }
.ar-start-box h1 {
  font-family: var(--serif); font-size: 34px; letter-spacing: .14em; color: var(--moon);
}
.ar-start-box h1 small { font-family: var(--mono); font-size: 14px; letter-spacing: .3em; color: var(--gold); }
.ar-start-box p { font-size: 13.5px; color: var(--moon-dim); line-height: 1.9; }
.ar-start-box .ar-note { font-size: 11.5px; color: var(--moon-faint); }
.ar-start-box .primary { font-size: 17px; padding: 15px; }
a.ar-back { color: var(--moon-faint); font-size: 13px; text-decoration: none; }
a.ar-back:hover { color: var(--gold); }

/* 上部バー */
.ar-top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
  background: linear-gradient(180deg, rgba(7,9,15,.85), rgba(7,9,15,0));
}
.ar-top .ar-back { font-size: 20px; padding: 2px 8px; }
.ar-falls {
  flex: 1; min-width: 0;
  background: rgba(12,16,32,.8); border: 1px solid var(--line);
  color: var(--moon); border-radius: 8px; padding: 7px 10px; font-size: 13px;
}
.ar-delta {
  font-family: var(--mono); font-size: 11px; color: var(--gold);
  background: rgba(12,16,32,.8); border: 1px solid var(--gold-dim);
  border-radius: 999px; padding: 4px 10px; white-space: nowrap;
}

/* センサー警告バナー */
.sensor-banner {
  position: fixed; left: 12px; right: 12px; z-index: 25;
  top: calc(64px + env(safe-area-inset-top));
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  background: rgba(34,22,10,.94);
  border: 1px solid var(--warn);
  border-radius: 12px;
  padding: 12px 14px;
}
.sensor-banner .sb-text { font-size: 12.5px; color: #f0c8c8; text-align: left; line-height: 1.6; white-space: pre-line; }
.sensor-banner button {
  width: auto; font-size: 14px; padding: 9px 18px;
  background: var(--warn); color: #1a0d0d; font-weight: 700;
  border: none; border-radius: 999px;
}

/* 下部コントロール */
.ar-bottom {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px 14px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(0deg, rgba(7,9,15,.92), rgba(7,9,15,0));
}
.ar-status {
  text-align: center; font-size: 13px; color: var(--moon);
  text-shadow: 0 1px 4px #000;
}
.ar-status b { color: var(--gold); font-family: var(--mono); font-weight: 500; }
.ar-status .hit-badge {
  display: inline-block; background: var(--hit); color: var(--ink);
  font-weight: 700; font-size: 11px; border-radius: 999px; padding: 1px 10px; margin-left: 8px;
}

#timeSlider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 26px; background: transparent; padding: 0;
  border: none;
}
#timeSlider::-webkit-slider-runnable-track {
  height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, #232c4e, #3a4368);
}
#timeSlider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 26px; height: 26px; margin-top: -10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff7df, #d9b96a);
  border: 2px solid #6e4f0e;
}

.ar-controls { display: flex; gap: 8px; }
.ar-controls input[type="date"] {
  flex: 1.4; background: rgba(12,16,32,.8); border: 1px solid var(--line);
  color: var(--moon); border-radius: 8px; padding: 7px 8px;
  font-family: var(--mono); font-size: 12px;
}
.ar-controls .ghost {
  flex: 1; font-size: 12px; padding: 7px 4px;
  background: rgba(12,16,32,.8);
}
