/* ============================================================
   わくわく！おとどけバイク — 画面の見た目
   書体：本文 Zen Maru Gothic（common・500/700）、ロゴとスタート Mochiy Pop P One（common。全角の「！」は字が無いので半角 ! を使う）
   ============================================================ */

:root {
  /* iOS 26 の Safari で、下のツールバーに隠れる分（100% と 100svh の差）。固定した要素の下端をこれだけ上げる */
  --tb: max(0px, calc(100% - 100svh));
  --font-pop: "Mochiy Pop P One", "Zen Maru Gothic", sans-serif;
  --ink: #1d263b;
  --bg-sky: #8ecae6;
  --surface: rgba(24, 34, 54, 0.86);
  --surface-light: rgba(255, 253, 247, 0.94);
  --border-crisp: rgba(255, 255, 255, 0.3);

  --text-main: #ffffff;
  --text-muted: #c8d7eb;
  --text-dark: #1d263b;

  --accent-orange: #ff6b2b;
  --accent-orange-dark: #c43f0c;
  --accent-gold: #ffbe0b;
  --accent-green: #22c55e;
  --accent-cyan: #06b6d4;
  --accent-pink: #ef233c;

  --ease-out: cubic-bezier(0.2, 0, 0, 1);
}

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

html,
body {
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background: #6da36d;
  color: var(--text-main);
  font-family: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.hidden,
[hidden] {
  display: none !important;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

button {
  touch-action: manipulation;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.ui-icon {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  flex-shrink: 0;
  vertical-align: middle;
}

.ui-icon--sm {
  width: 1.18em;
  height: 1.18em;
}

.ui-icon--lg {
  width: 1.24em;
  height: 1.24em;
}

.btn-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.app-root {
  position: fixed;
  inset: 0;
  bottom: var(--tb);
  overflow: hidden;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

/* ============================================================
   Top Arcade HUD
   ============================================================ */
.hud {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  left: max(10px, env(safe-area-inset-left));
  right: max(10px, env(safe-area-inset-right));
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  pointer-events: none;
  z-index: 10;
}

.hud-left,
.hud-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hud-box {
  background: rgba(24, 34, 54, 0.91);
  border: 2px solid var(--border-crisp);
  border-radius: 10px;
  padding: 5px 10px;
  min-width: 60px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.2;
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.3);
}

.hud-daytime {
  transition: color 300ms ease;
}

.hud-box--zone.tod-sunset {
  border-color: rgba(251, 146, 60, 0.72);
}

.hud-box--zone.tod-sunset .hud-daytime {
  color: #fdba74;
}

.hud-box--zone.tod-night {
  border-color: rgba(129, 140, 248, 0.75);
}

.hud-box--zone.tod-night .hud-daytime {
  color: #c7d2fe;
}

.hud-box--zone.tod-morning {
  border-color: rgba(125, 211, 252, 0.72);
}

.hud-box--zone.tod-morning .hud-daytime {
  color: #bae6fd;
}

.hud-label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.hud-box--time .hud-label .ui-icon { color: #fde68a; }
.hud-box--stack .hud-label .ui-icon { color: #67e8f9; }
.hud-box--score .hud-label .ui-icon { color: var(--accent-gold); }
.hud-box--zone .hud-label .ui-icon { color: #fde047; }
.hud-box--zone.tod-sunset .hud-label .ui-icon { color: #fb923c; }
.hud-box--zone.tod-night .hud-label .ui-icon { color: #a5b4fc; }
.hud-box--zone.tod-morning .hud-label .ui-icon { color: #7dd3fc; }
.gauge-head .ui-icon { color: var(--accent-gold); }

.hud-val {
  font-size: 16px;
  font-weight: 900;
  color: var(--text-main);
  white-space: nowrap;
}

.hud-val--zone {
  font-size: 12.5px;
  color: #fde68a;
}

.hud-box--stack .hud-val { color: #67e8f9; }
.hud-box--score .hud-val { color: var(--accent-gold); }

.hud-box--time.is-urgent {
  border-color: #ff4d6d;
  background: rgba(217, 25, 56, 0.94);
  animation: urgent-pulse 0.42s ease-in-out infinite alternate;
}

@keyframes urgent-pulse {
  from { transform: scale(1); }
  to { transform: scale(1.05); }
}

.cam-btn {
  pointer-events: auto;
  height: 40px;
  padding: 0 10px;
  border-radius: 10px;
  border: 2px solid var(--border-crisp);
  background: var(--surface);
  color: #fff;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 140ms var(--ease-out);
}

.cam-btn:active {
  transform: scale(0.96);
}

.icon-btn {
  pointer-events: auto;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 2px solid var(--border-crisp);
  background: var(--surface);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 140ms var(--ease-out);
}

.icon-btn:active {
  transform: scale(0.96);
}

@media (max-width: 640px) {
  .hud {
    left: max(6px, env(safe-area-inset-left));
    right: max(6px, env(safe-area-inset-right));
    gap: 4px;
  }
  .hud-left,
  .hud-right {
    gap: 3px;
  }
  .hud-box--zone {
    display: none;
  }
  .hud-box {
    min-width: 40px;
    padding: 3px 5px;
  }
  .hud-label {
    font-size: 8px;
    letter-spacing: 0.02em;
    white-space: nowrap;
  }
  .hud-val {
    font-size: 13.5px;
  }
  .cam-btn {
    height: 36px;
    padding: 0 6px;
    font-size: 10px;
  }
  .icon-btn {
    width: 36px;
    height: 36px;
  }
}

/* ============================================================
   Top Destination Compass
   ============================================================ */
.nav-compass {
  position: absolute;
  top: max(62px, calc(env(safe-area-inset-top) + 52px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 14;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: calc(100vw - 24px);
  background: rgba(20, 30, 48, 0.92);
  border: 2.5px solid var(--accent-green);
  border-radius: 16px;
  padding: 7px 14px 7px 7px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.36);
  white-space: nowrap;
}

.nav-compass.is-pickup {
  border-color: var(--accent-gold);
}

.nav-compass.is-near .nav-dist {
  color: #4ade80;
  transform: scale(1.08);
}

.nav-compass.is-pickup.is-near .nav-dist {
  color: #ffbe0b;
}

.nav-arrow-wrap {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-green);
  color: #0b2415;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-compass.is-pickup .nav-arrow-wrap {
  background: var(--accent-gold);
  color: #291a04;
}

.nav-arrow {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center;
}

.nav-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  line-height: 1.28;
  padding: 1px 0;
  min-width: 0;
}

.nav-tag {
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: #86efac;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-compass.is-pickup .nav-tag {
  color: #fde68a;
}

.nav-dest {
  font-size: 13.5px;
  font-weight: 900;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-dist {
  font-size: 15px;
  font-weight: 900;
  color: #fde68a;
  padding-left: 8px;
  border-left: 1.5px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
  transition: transform 140ms var(--ease-out), color 140ms var(--ease-out);
}

/* ============================================================
   Arcade Callout Banner
   ============================================================ */
.callout {
  position: absolute;
  top: max(124px, calc(env(safe-area-inset-top) + 114px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: min(450px, calc(100vw - 24px));
  padding: 6px 14px;
  border-radius: 10px;
  background: var(--accent-gold);
  color: var(--text-dark);
  font-size: clamp(12.5px, 3.2vw, 14.5px);
  font-weight: 900;
  line-height: 1.3;
  text-align: center;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: anywhere;
  border: 2.5px solid var(--text-dark);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.35);
}

.callout.is-pink {
  background: var(--accent-pink);
  color: #fff;
}

.callout.is-cyan {
  background: var(--accent-green);
  color: #082112;
}

/* ============================================================
   Bottom Controls & Nitro Gauge
   ============================================================ */
.bottom-hud {
  position: absolute;
  bottom: max(12px, env(safe-area-inset-bottom));
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  z-index: 12;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.steer-hint {
  align-self: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: rgba(20, 30, 48, 0.72);
  padding: 4px 12px;
  border-radius: 99px;
  transition: opacity 250ms var(--ease-out);
}

.gauges-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
}

.gauge-card {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  max-width: 236px;
  background: rgba(24, 34, 54, 0.91);
  border: 2px solid var(--border-crisp);
  border-radius: 11px;
  padding: 7px 10px;
}

.gauge-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 5px;
  white-space: nowrap;
}

.gauge-head span:last-child {
  color: var(--accent-gold);
}

.gauge-bar {
  height: 10px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
}

.gauge-bar__fill {
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(0.5);
  background: linear-gradient(90deg, #22c55e, var(--accent-gold), var(--accent-orange));
  transition: transform 80ms linear;
  will-change: transform;
}

.touch-actions {
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

.action-btn {
  min-width: 78px;
  min-height: 52px;
  padding: 6px 12px;
  border-radius: 12px;
  border: 2.5px solid var(--text-dark);
  font-family: inherit;
  font-weight: 900;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 120ms var(--ease-out), filter 120ms var(--ease-out);
}

.action-btn span {
  font-size: 14px;
  line-height: 1.1;
}

.action-btn small {
  font-size: 9.5px;
  font-weight: 800;
  opacity: 0.85;
}

.action-btn--drift {
  background: var(--accent-gold);
  color: var(--text-dark);
  box-shadow: 0 4px 0 #b88400;
}

.action-btn--boost {
  background: var(--accent-orange);
  color: #fff;
  box-shadow: 0 4px 0 var(--accent-orange-dark);
}

.action-btn:active,
.action-btn.is-pressed {
  transform: scale(0.95) translateY(2px);
  filter: brightness(1.1);
}

/* ============================================================
   Overlays (Bright Sunlit Arcade Title / Result)
   ============================================================ */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: max(26px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
}











.btn-start {
  width: 100%;
  max-width: 310px;
  min-height: 54px;
  padding: 12px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 14px;
  border: 3px solid var(--text-dark);
  background: linear-gradient(180deg, #ff7b3b 0%, var(--accent-orange) 100%);
  color: #fff;
  font-family: inherit;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--accent-orange-dark), 0 12px 24px rgba(15, 23, 42, 0.42);
  -webkit-tap-highlight-color: transparent;
  transition: transform 140ms var(--ease-out), filter 140ms var(--ease-out);
}

@media (hover: hover) {
  .btn-start:hover {
    filter: brightness(1.07);
  }
}

.btn-start:active {
  transform: scale(0.96) translateY(2px);
}


/* Result Overlay */
.overlay--result {
  justify-content: center;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(5px);
}

.result-panel {
  width: min(370px, 100%);
  background: var(--surface-light);
  color: var(--text-dark);
  border: 3px solid var(--text-dark);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.45);
}

.result-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: var(--accent-orange-dark);
}

.rank-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.rank-badge {
  min-width: 68px;
  height: 58px;
  padding: 0 8px;
  border-radius: 16px;
  background: var(--accent-gold);
  color: var(--text-dark);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--text-dark);
  flex-shrink: 0;
}

.rank-texts {
  text-align: left;
}

.res-title {
  font-size: 18px;
  font-weight: 900;
  line-height: 1.25;
}

.res-compare {
  font-size: 12.5px;
  font-weight: 800;
  color: #0284c7;
  margin-top: 3px;
}

.result-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.res-stat {
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  padding: 9px 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.res-stat span {
  font-size: 10px;
  font-weight: 800;
  color: #475569;
}

.res-stat strong {
  font-size: 15.5px;
  font-weight: 900;
  color: var(--text-dark);
}

/* ============================================================
   Multi-Agent Polish: Multiplier, Drive States, Pause & A11y
   ============================================================ */
.hud-mult {
  font-style: normal;
  color: #cbd5e1;
  margin-left: 3px;
}

.hud-mult.is-hot {
  color: var(--accent-gold);
}

.hud-box--score .hud-label em {
  font-style: normal;
  color: #86efac;
}

.hud-box--stack.is-danger {
  border-color: #ff4d6d;
}

.drive-state {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9.5px;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 99px;
  background: rgba(255, 190, 11, 0.22);
  color: #fde68a;
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}

.drive-state.is-reverse {
  background: rgba(14, 165, 233, 0.3);
  color: #7dd3fc;
}

.drive-state.is-turbo {
  background: rgba(255, 107, 43, 0.35);
  color: #ffedd5;
}

.gauge-card.is-boosting {
  border-color: var(--accent-orange);
  box-shadow: 0 0 14px rgba(255, 107, 43, 0.42);
}

.action-btn--drift.is-reverse {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 4px 0 #075985;
}

.action-btn--boost.is-empty {
  opacity: 0.56;
  filter: grayscale(0.35);
}

.touch-steer-bar {
  align-self: center;
  width: 104px;
  height: 8px;
  border-radius: 99px;
  background: rgba(20, 30, 48, 0.72);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  position: relative;
  overflow: hidden;
}

.touch-steer-bar__thumb {
  position: absolute;
  top: 0;
  left: 50%;
  width: 24px;
  height: 100%;
  border-radius: 99px;
  background: var(--accent-gold);
  transform: translateX(-50%);
}

/* Subtle screen-edge urgency vignette in the final 12 seconds */
.app-root.is-low-time::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 11;
  box-shadow: inset 0 0 42px rgba(239, 35, 60, 0.36);
}

/* Pause Overlay */
.overlay--pause {
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(5px);
}

.pause-panel {
  max-width: 390px;
}

.pause-controls {
  font-size: 12px;
  line-height: 1.65;
  color: #334155;
  font-weight: 700;
}

.pause-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-secondary {
  width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 12px;
  border: 2px solid #cbd5e1;
  background: #f1f5f9;
  color: var(--text-dark);
  font-family: inherit;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 120ms var(--ease-out), background 120ms var(--ease-out);
}

.btn-secondary:active {
  transform: scale(0.98);
}



.rank-badge {
  gap: 2px;
}

.rank-badge .rank-icon {
  width: 22px;
  height: 22px;
}

.rank-badge .rank-icon--single {
  width: 30px;
  height: 30px;
}

.rank-badge.is-sprout {
  color: #16a34a;
}

.rank-badge.is-sakura {
  color: #f43f5e;
}

.btn-assist.is-on {
  background: #fef08a;
  border-color: var(--text-dark);
  color: var(--text-dark);
}



/* Keyboard Focus Rings & Hover/Coarse-Pointer Ergonomics */
.cam-btn:focus-visible,
.icon-btn:focus-visible,
.action-btn:focus-visible,
.btn-start:focus-visible,
.btn-secondary:focus-visible {
  outline: 3px solid var(--accent-gold);
  outline-offset: 2px;
}

@media (hover: hover) {
  .cam-btn:hover,
  .icon-btn:hover {
    filter: brightness(1.12);
  }
  .btn-secondary:hover {
    background: #e2e8f0;
  }
}

@media (pointer: coarse) {
  .icon-btn {
    width: 40px;
    height: 40px;
  }
  .cam-btn {
    min-height: 40px;
  }
  .hud-right {
    gap: 4px;
  }
}

@media (max-width: 640px) {
  .nav-compass {
    top: max(62px, calc(env(safe-area-inset-top) + 54px));
    gap: 7px;
  }
  .nav-dest {
    font-size: 12.5px;
  }
  .gauges-row {
    gap: 7px;
  }
  .touch-actions {
    flex-shrink: 0;
    gap: 6px;
  }
  .action-btn {
    min-width: 66px;
    min-height: 48px;
    padding: 5px 8px;
  }
  .action-btn span {
    font-size: 12.5px;
  }
  .action-btn small {
    font-size: 8.5px;
  }
  /* On mobile portrait, anchor callout cleanly above bottom controls so it never overlaps the mini-map! */
  .callout {
    top: auto;
    bottom: max(112px, calc(env(safe-area-inset-bottom) + 100px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .hud-box--time.is-urgent {
    animation: none;
  }
}


/* ============================================================
   タイトル（2026-11-23 作りなおし：ロゴ・スタート・切りかえ2つ・フッターだけ）
   ============================================================ */
.overlay--title {
  justify-content: space-between;
  gap: 12px;
  text-align: center;
  padding-top: max(18px, env(safe-area-inset-top));
  background:
    radial-gradient(120% 60% at 50% 18%, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0) 62%),
    linear-gradient(to bottom, rgba(255, 255, 255, 0) 55%, rgba(18, 30, 56, 0.62) 100%);
}

.t-kids {
  display: block;
  width: min(220px, 56vw);
  filter: drop-shadow(0 2px 3px rgba(15, 23, 42, 0.55));
}
.t-kids img { display: block; width: 100%; height: auto; }

.logo {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--font-pop);
  font-weight: 400;
  line-height: 1;
  margin-top: 2vh;
  margin-bottom: auto;
}
.logo-sub {
  position: relative;
  z-index: 2;
  margin-bottom: -2px;
  transform: rotate(-5deg);
}
.logo-sub span {
  display: inline-block;
  padding: 6px 16px 7px;
  border-radius: 99px;
  background: #ffe14d;
  border: 3.5px solid var(--ink);
  color: var(--ink);
  font-size: clamp(17px, 5vw, 24px);
  letter-spacing: 0.06em;
  box-shadow: 0 4px 0 var(--ink);
}
.logo-row {
  display: flex;
  gap: 0.02em;
  font-size: clamp(56px, 18vw, 100px);
  letter-spacing: 0;
}
.logo-row--2 { margin-top: -0.06em; }
.logo i {
  display: inline-block;
  font-style: normal;
  color: var(--c);
  text-shadow:
    2.00px 0.00px 0 #fff, 1.93px 0.52px 0 #fff, 1.73px 1.00px 0 #fff, 1.41px 1.41px 0 #fff, 1.00px 1.73px 0 #fff, 0.52px 1.93px 0 #fff, 0.00px 2.00px 0 #fff, -0.52px 1.93px 0 #fff, -1.00px 1.73px 0 #fff, -1.41px 1.41px 0 #fff, -1.73px 1.00px 0 #fff, -1.93px 0.52px 0 #fff, -2.00px 0.00px 0 #fff, -1.93px -0.52px 0 #fff, -1.73px -1.00px 0 #fff, -1.41px -1.41px 0 #fff, -1.00px -1.73px 0 #fff, -0.52px -1.93px 0 #fff, -0.00px -2.00px 0 #fff, 0.52px -1.93px 0 #fff, 1.00px -1.73px 0 #fff, 1.41px -1.41px 0 #fff, 1.73px -1.00px 0 #fff, 1.93px -0.52px 0 #fff,
    4.00px 0.00px 0 #fff, 3.92px 0.78px 0 #fff, 3.70px 1.53px 0 #fff, 3.33px 2.22px 0 #fff, 2.83px 2.83px 0 #fff, 2.22px 3.33px 0 #fff, 1.53px 3.70px 0 #fff, 0.78px 3.92px 0 #fff, 0.00px 4.00px 0 #fff, -0.78px 3.92px 0 #fff, -1.53px 3.70px 0 #fff, -2.22px 3.33px 0 #fff, -2.83px 2.83px 0 #fff, -3.33px 2.22px 0 #fff, -3.70px 1.53px 0 #fff, -3.92px 0.78px 0 #fff, -4.00px 0.00px 0 #fff, -3.92px -0.78px 0 #fff, -3.70px -1.53px 0 #fff, -3.33px -2.22px 0 #fff, -2.83px -2.83px 0 #fff, -2.22px -3.33px 0 #fff, -1.53px -3.70px 0 #fff, -0.78px -3.92px 0 #fff, -0.00px -4.00px 0 #fff, 0.78px -3.92px 0 #fff, 1.53px -3.70px 0 #fff, 2.22px -3.33px 0 #fff, 2.83px -2.83px 0 #fff, 3.33px -2.22px 0 #fff, 3.70px -1.53px 0 #fff, 3.92px -0.78px 0 #fff,
    5.50px 0.00px 0 #fff, 5.42px 0.96px 0 #fff, 5.17px 1.88px 0 #fff, 4.76px 2.75px 0 #fff, 4.21px 3.54px 0 #fff, 3.54px 4.21px 0 #fff, 2.75px 4.76px 0 #fff, 1.88px 5.17px 0 #fff, 0.96px 5.42px 0 #fff, 0.00px 5.50px 0 #fff, -0.96px 5.42px 0 #fff, -1.88px 5.17px 0 #fff, -2.75px 4.76px 0 #fff, -3.54px 4.21px 0 #fff, -4.21px 3.54px 0 #fff, -4.76px 2.75px 0 #fff, -5.17px 1.88px 0 #fff, -5.42px 0.96px 0 #fff, -5.50px 0.00px 0 #fff, -5.42px -0.96px 0 #fff, -5.17px -1.88px 0 #fff, -4.76px -2.75px 0 #fff, -4.21px -3.54px 0 #fff, -3.54px -4.21px 0 #fff, -2.75px -4.76px 0 #fff, -1.88px -5.17px 0 #fff, -0.96px -5.42px 0 #fff, -0.00px -5.50px 0 #fff, 0.96px -5.42px 0 #fff, 1.88px -5.17px 0 #fff, 2.75px -4.76px 0 #fff, 3.54px -4.21px 0 #fff, 4.21px -3.54px 0 #fff, 4.76px -2.75px 0 #fff, 5.17px -1.88px 0 #fff, 5.42px -0.96px 0 #fff,
    7.00px 0.00px 0 var(--ink), 6.91px 1.10px 0 var(--ink), 6.66px 2.16px 0 var(--ink), 6.24px 3.18px 0 var(--ink), 5.66px 4.11px 0 var(--ink), 4.95px 4.95px 0 var(--ink), 4.11px 5.66px 0 var(--ink), 3.18px 6.24px 0 var(--ink), 2.16px 6.66px 0 var(--ink), 1.10px 6.91px 0 var(--ink), 0.00px 7.00px 0 var(--ink), -1.10px 6.91px 0 var(--ink), -2.16px 6.66px 0 var(--ink), -3.18px 6.24px 0 var(--ink), -4.11px 5.66px 0 var(--ink), -4.95px 4.95px 0 var(--ink), -5.66px 4.11px 0 var(--ink), -6.24px 3.18px 0 var(--ink), -6.66px 2.16px 0 var(--ink), -6.91px 1.10px 0 var(--ink), -7.00px 0.00px 0 var(--ink), -6.91px -1.10px 0 var(--ink), -6.66px -2.16px 0 var(--ink), -6.24px -3.18px 0 var(--ink), -5.66px -4.11px 0 var(--ink), -4.95px -4.95px 0 var(--ink), -4.11px -5.66px 0 var(--ink), -3.18px -6.24px 0 var(--ink), -2.16px -6.66px 0 var(--ink), -1.10px -6.91px 0 var(--ink), -0.00px -7.00px 0 var(--ink), 1.10px -6.91px 0 var(--ink), 2.16px -6.66px 0 var(--ink), 3.18px -6.24px 0 var(--ink), 4.11px -5.66px 0 var(--ink), 4.95px -4.95px 0 var(--ink), 5.66px -4.11px 0 var(--ink), 6.24px -3.18px 0 var(--ink), 6.66px -2.16px 0 var(--ink), 6.91px -1.10px 0 var(--ink),
    8.50px 0.00px 0 var(--ink), 8.43px 1.11px 0 var(--ink), 8.21px 2.20px 0 var(--ink), 7.85px 3.25px 0 var(--ink), 7.36px 4.25px 0 var(--ink), 6.74px 5.17px 0 var(--ink), 6.01px 6.01px 0 var(--ink), 5.17px 6.74px 0 var(--ink), 4.25px 7.36px 0 var(--ink), 3.25px 7.85px 0 var(--ink), 2.20px 8.21px 0 var(--ink), 1.11px 8.43px 0 var(--ink), 0.00px 8.50px 0 var(--ink), -1.11px 8.43px 0 var(--ink), -2.20px 8.21px 0 var(--ink), -3.25px 7.85px 0 var(--ink), -4.25px 7.36px 0 var(--ink), -5.17px 6.74px 0 var(--ink), -6.01px 6.01px 0 var(--ink), -6.74px 5.17px 0 var(--ink), -7.36px 4.25px 0 var(--ink), -7.85px 3.25px 0 var(--ink), -8.21px 2.20px 0 var(--ink), -8.43px 1.11px 0 var(--ink), -8.50px 0.00px 0 var(--ink), -8.43px -1.11px 0 var(--ink), -8.21px -2.20px 0 var(--ink), -7.85px -3.25px 0 var(--ink), -7.36px -4.25px 0 var(--ink), -6.74px -5.17px 0 var(--ink), -6.01px -6.01px 0 var(--ink), -5.17px -6.74px 0 var(--ink), -4.25px -7.36px 0 var(--ink), -3.25px -7.85px 0 var(--ink), -2.20px -8.21px 0 var(--ink), -1.11px -8.43px 0 var(--ink), -0.00px -8.50px 0 var(--ink), 1.11px -8.43px 0 var(--ink), 2.20px -8.21px 0 var(--ink), 3.25px -7.85px 0 var(--ink), 4.25px -7.36px 0 var(--ink), 5.17px -6.74px 0 var(--ink), 6.01px -6.01px 0 var(--ink), 6.74px -5.17px 0 var(--ink), 7.36px -4.25px 0 var(--ink), 7.85px -3.25px 0 var(--ink), 8.21px -2.20px 0 var(--ink), 8.43px -1.11px 0 var(--ink);
  cursor: pointer;
  pointer-events: auto;
  animation: logoBob 2.6s ease-in-out calc(var(--i) * -0.33s) infinite;
}
.overlay--title.t-in .logo i {
  animation: logoDrop 0.62s cubic-bezier(0.3, 1.5, 0.5, 1) calc(var(--i) * 70ms) both,
             logoBob 2.6s ease-in-out calc(0.7s + var(--i) * 0.33s) infinite;
}
.overlay--title.t-in .logo-sub { animation: subPop 0.5s cubic-bezier(0.3, 1.6, 0.5, 1) 0.5s both; }
.logo i.boing { animation: logoBoing 0.5s cubic-bezier(0.3, 1.6, 0.5, 1) both !important; }
@keyframes logoDrop {
  0% { opacity: 0; transform: translateY(-60px) scale(0.6); }
  60% { opacity: 1; transform: translateY(4px) scale(1.06, 0.9); }
  100% { opacity: 1; transform: none; }
}
@keyframes logoBob {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-5px) rotate(-2deg); }
}
@keyframes logoBoing {
  0% { transform: scale(1); }
  30% { transform: scale(1.25, 0.75); }
  60% { transform: scale(0.9, 1.15) translateY(-10px); }
  100% { transform: scale(1); }
}
@keyframes subPop {
  0% { opacity: 0; transform: rotate(-5deg) scale(0.3); }
  100% { opacity: 1; transform: rotate(-5deg) scale(1); }
}

.t-bottom {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.overlay--title:not(.t-in) .logo,
.overlay--title:not(.t-in) .t-bottom,
.overlay--title:not(.t-in) .t-kids { opacity: 0; }
.overlay--title.t-in .t-kids { animation: fadeUp 0.4s ease both; }
.overlay--title.t-in .t-bottom { animation: fadeUp 0.45s ease 0.75s both; }
.overlay--title:not(.t-shown) .t-bottom { pointer-events: none; }
@keyframes fadeUp {
  0% { opacity: 0; transform: translateY(14px); }
  100% { opacity: 1; transform: none; }
}

.btn-go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(300px, 82vw);
  min-height: 68px;
  padding: 10px 24px 14px;
  border-radius: 99px;
  border: 4px solid var(--ink);
  background: linear-gradient(180deg, #ff9450 0%, #ff6b2b 100%);
  color: #fff;
  font-family: var(--font-pop);
  font-size: clamp(24px, 7vw, 30px);
  letter-spacing: 0.04em;
  text-shadow: 0 3px 0 rgba(160, 52, 8, 0.75);
  box-shadow: 0 6px 0 var(--ink), 0 14px 26px rgba(15, 23, 42, 0.35);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 120ms var(--ease-out), box-shadow 120ms var(--ease-out);
  animation: goPulse 1.8s ease-in-out 1.4s infinite;
}
.btn-go .ui-icon { width: 1.1em; height: 1.1em; }
.btn-go:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--ink), 0 6px 14px rgba(15, 23, 42, 0.3); animation: none; }
.btn-go:focus-visible { outline: 4px solid #ffe14d; outline-offset: 3px; }
@keyframes goPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

.t-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 38px;
  padding: 6px 14px;
  border-radius: 99px;
  border: 2.5px solid var(--ink);
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ink);
  -webkit-tap-highlight-color: transparent;
  transition: transform 100ms var(--ease-out), box-shadow 100ms var(--ease-out), background 120ms;
}
.chip:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
.chip.is-on { background: #fff4a8; }
.chip.is-off { background: #e2e8f0; color: #64748b; }
.chip:focus-visible { outline: 3px solid #ffe14d; outline-offset: 2px; }

.t-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 14px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.6;
  color: #fff;
  text-shadow: 0 1px 3px rgba(10, 18, 36, 0.9);
}
.t-foot a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }

/* OGP 撮影（?ogp=1）：街の上にロゴだけ */
body.ogp .t-bottom,
body.ogp .t-kids { display: none; }
body.ogp .overlay--title { justify-content: flex-start; padding-top: 4.5vh; background: radial-gradient(60% 50% at 50% 28%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 70%); }
body.ogp .logo { margin: 0; transform: scale(0.92); transform-origin: 50% 0; }
body.ogp .logo i { animation: none !important; }
body.ogp .logo-sub { animation: none !important; }

/* ============================================================
   入口（読みこみ → タップして はじめる）
   ============================================================ */
#gate {
  position: fixed;
  inset: 0;
  bottom: var(--tb);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: linear-gradient(180deg, #38a8f2 0%, #6cc8ff 60%, #a8e3ff 100%);
  color: #fff;
}
html.gate-on #gate { display: flex !important; }
html.gate-on #app { visibility: hidden; }
#gate.ready { cursor: pointer; }
.g-in {
  width: min(440px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.g-kids { width: min(260px, 66vw); height: auto; filter: drop-shadow(0 2px 2px rgba(20, 60, 110, 0.45)); }
.g-scene {
  position: relative;
  width: 100%;
  height: 200px;
  border-radius: 26px;
  border: 4px solid var(--ink);
  overflow: hidden;
  background: linear-gradient(180deg, #bfeaff 0%, #e8f8ff 70%);
  box-shadow: 0 8px 0 var(--ink), 0 18px 30px rgba(15, 40, 80, 0.3);
}
.g-sun {
  position: absolute; top: 14px; left: 22px; width: 38px; height: 38px; border-radius: 50%;
  background: #ffe14d; box-shadow: 0 0 0 8px rgba(255, 225, 77, 0.35);
}
.g-cloud {
  position: absolute; width: 64px; height: 22px; border-radius: 99px; background: #fff;
  animation: gScroll 14s linear infinite;
}
.g-cloud::before { content: ""; position: absolute; left: 14px; top: -12px; width: 30px; height: 26px; border-radius: 50%; background: #fff; }
.g-cloud--a { top: 24px; left: 30%; }
.g-cloud--b { top: 54px; left: 80%; transform: scale(0.75); animation-duration: 20s; }
.g-far, .g-near { position: absolute; left: 0; right: 0; background-repeat: repeat-x; }
.g-far {
  bottom: 48px; height: 78px; background-size: 240px 78px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='78'%3E%3Cg stroke='%231d263b' stroke-width='2.5'%3E%3Crect x='8' y='22' width='40' height='56' rx='4' fill='%23ffd2a6'/%3E%3Crect x='58' y='38' width='46' height='40' rx='4' fill='%23b8f0c6'/%3E%3Cpath d='M54 40 81 18 108 40Z' fill='%23ff8f8f'/%3E%3Crect x='116' y='8' width='34' height='70' rx='4' fill='%23c9d6ff'/%3E%3Crect x='160' y='30' width='52' height='48' rx='4' fill='%23ffe7a3'/%3E%3C/g%3E%3Cg fill='%23ffffff'%3E%3Crect x='16' y='32' width='9' height='9' rx='2'/%3E%3Crect x='31' y='32' width='9' height='9' rx='2'/%3E%3Crect x='16' y='50' width='9' height='9' rx='2'/%3E%3Crect x='31' y='50' width='9' height='9' rx='2'/%3E%3Crect x='72' y='52' width='18' height='12' rx='2'/%3E%3Crect x='124' y='18' width='8' height='8' rx='2'/%3E%3Crect x='136' y='18' width='8' height='8' rx='2'/%3E%3Crect x='124' y='34' width='8' height='8' rx='2'/%3E%3Crect x='136' y='34' width='8' height='8' rx='2'/%3E%3Crect x='124' y='50' width='8' height='8' rx='2'/%3E%3Crect x='136' y='50' width='8' height='8' rx='2'/%3E%3Crect x='170' y='40' width='32' height='12' rx='3'/%3E%3C/g%3E%3C/svg%3E");
  animation: gScroll 9s linear infinite;
}
.g-near {
  bottom: 44px; height: 46px; background-size: 180px 46px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='46'%3E%3Cg stroke='%231d263b' stroke-width='2.5'%3E%3Crect x='28' y='26' width='6' height='20' fill='%23a0673f'/%3E%3Ccircle cx='31' cy='20' r='15' fill='%2356cf7a'/%3E%3Crect x='112' y='6' width='5' height='40' fill='%23c4cede'/%3E%3Ccircle cx='114.5' cy='6' r='4' fill='%23ffe14d'/%3E%3Ccircle cx='158' cy='32' r='12' fill='%23ffb3cf'/%3E%3C/g%3E%3C/svg%3E");
  animation: gScroll 4.5s linear infinite;
}
.g-road {
  position: absolute; left: 0; right: 0; bottom: 0; height: 48px;
  background:
    repeating-linear-gradient(90deg, #fff 0 26px, transparent 26px 52px) 0 23px / 100% 4px no-repeat,
    linear-gradient(180deg, #8f9ab0 0 6px, #5d6780 6px);
  border-top: 3px solid var(--ink);
  animation: gRoad 0.6s linear infinite;
}
@keyframes gScroll { from { background-position-x: 0; transform: translateX(0); } to { background-position-x: -240px; } }
.g-cloud { animation-name: gCloud; }
@keyframes gCloud { from { transform: translateX(0); } to { transform: translateX(-520px); } }
.g-near { animation-name: gNear; }
@keyframes gNear { from { background-position-x: 0; } to { background-position-x: -180px; } }
@keyframes gRoad { from { background-position: 0 23px, 0 0; } to { background-position: -52px 23px, 0 0; } }
.g-bike {
  position: absolute; left: 14%; bottom: 20px; width: 132px; height: 96px;
  animation: gBob 0.32s ease-in-out infinite alternate;
  transition: left 0.9s cubic-bezier(0.3, 0.9, 0.4, 1);
}
.g-moped { display: block; overflow: visible; }
.g-wheel { animation: gSpin 0.45s linear infinite; }
@keyframes gSpin { to { transform: rotate(360deg); } }
@keyframes gBob { from { transform: translateY(0); } to { transform: translateY(-2px); } }
.g-puff {
  position: absolute; left: -6px; bottom: 16px; width: 12px; height: 12px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.9); border: 2px solid rgba(29, 38, 59, 0.25);
  animation: gPuff 0.9s ease-out infinite;
}
.g-puff--2 { animation-delay: 0.45s; }
@keyframes gPuff { from { opacity: 1; transform: translate(0, 0) scale(0.6); } to { opacity: 0; transform: translate(-34px, -10px) scale(1.4); } }
.g-stack {
  position: absolute; left: 5px; bottom: 64px; width: 36px;
  display: flex; flex-direction: column-reverse; align-items: center;
}
.g-stack i {
  position: relative;
  display: block; width: 34px; height: 11px; margin-top: -1px;
  background: var(--c); border: 2.5px solid var(--ink); border-radius: 3px 3px 14px 14px;
  transform: translateX(calc((var(--n) - 2.5) * 0.6px));
  animation: bowlIn 0.36s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}
.g-stack i::before { content: ""; position: absolute; left: 3px; right: 3px; top: 1px; height: 2px; border-radius: 2px; background: rgba(255, 255, 255, 0.75); }
@keyframes bowlIn { from { opacity: 0; transform: translateY(-40px) scale(0.8); } to { opacity: 1; } }
.g-house {
  position: absolute; right: -130px; bottom: 44px; width: 96px; height: 72px;
  background: #fff3d6; border: 3px solid var(--ink); border-radius: 6px 6px 0 0;
  transition: right 0.9s cubic-bezier(0.3, 0.9, 0.4, 1);
}
/* 屋根：clip-path だと斜めの辺の黒縁が切れるので、縁ごと SVG の三角で描く（3辺とも同じ太さ・角は丸く） */
.g-house::before {
  content: ""; position: absolute; left: -15px; top: -38px; width: 126px; height: 42px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 126 42'%3E%3Cpath d='M3.5 39.5 63 3.5l59.5 36Z' fill='%23ff7a5c' stroke='%231d263b' stroke-width='3' stroke-linejoin='round'/%3E%3Cpath d='M22 31 63 7' stroke='%23ffffff' stroke-opacity='.35' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
.g-house::after {
  content: ""; position: absolute; left: 34px; bottom: 0; width: 26px; height: 38px;
  background: #ffb21e; border: 3px solid var(--ink); border-bottom: 0; border-radius: 12px 12px 0 0;
}
.g-heart {
  position: absolute; left: 34px; top: -64px; width: 26px; height: 26px; opacity: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21C5 15.5 2 12.4 2 8.4A4.9 4.9 0 0 1 12 6a4.9 4.9 0 0 1 10 2.4c0 4-3 7.1-10 12.6Z' fill='%23ff5c9a' stroke='%231d263b' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat;
}
#gate.ready .g-house { right: 5%; }
#gate.ready .g-bike { left: calc(95% - 96px - 150px); animation: none; }
#gate.ready .g-wheel { animation-play-state: paused; }
#gate.ready .g-puff { display: none; }
#gate.ready .g-far, #gate.ready .g-near, #gate.ready .g-road, #gate.ready .g-cloud { animation-play-state: paused; }
#gate.ready .g-heart { animation: heartUp 1.4s ease-out 0.8s infinite; }
@keyframes heartUp { 0% { opacity: 0; transform: translateY(10px) scale(0.5); } 25% { opacity: 1; transform: translateY(0) scale(1.1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-18px) scale(1); } }
.g-msg {
  font-size: 15px; font-weight: 700; letter-spacing: 0.06em; min-height: 58px;
  display: flex; align-items: center;
  text-shadow: 0 1px 3px rgba(20, 60, 110, 0.6);
}
.g-start {
  min-height: 58px; padding: 8px 30px 11px;
  border-radius: 99px; border: 4px solid var(--ink);
  background: linear-gradient(180deg, #ff9450 0%, #ff6b2b 100%);
  color: #fff; font-family: inherit; font-size: 20px; font-weight: 700; letter-spacing: 0.06em;
  text-shadow: 0 2px 0 rgba(160, 52, 8, 0.7);
  box-shadow: 0 5px 0 var(--ink);
  cursor: pointer;
  animation: fadeUp 0.35s ease both, goPulse 1.6s ease-in-out 0.4s infinite;
}
.g-start:focus-visible { outline: 4px solid #ffe14d; outline-offset: 3px; }
.chip--light { background: rgba(255, 255, 255, 0.92); }

@media (max-height: 560px) {
  .g-scene { height: 170px; }
  .g-in { gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .logo i, .overlay--title.t-in .logo i, .logo-sub, .btn-go, .g-start,
  .g-far, .g-near, .g-road, .g-cloud, .g-wheel, .g-bike, .g-puff, .g-heart { animation: none !important; }
  .overlay--title.t-in .t-bottom, .overlay--title.t-in .t-kids { animation: none; }
}

/* ============================================================
   スマホのせまい幅：上の HUD が画面からはみ出さないように（2026-11-23）
   ============================================================ */
@media (max-width: 430px) {
  #cam-mode-text { display: none; }
  .cam-btn { width: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
  .hud-box { min-width: 0; }
}
@media (max-width: 340px) {
  .hud-mult { display: none; }
  .hud-val { font-size: 12.5px; }
}

/* ポーズ・結果のパネルは、背の低い画面でもはみ出さない */
.overlay--pause,
.overlay--result { overflow-y: auto; }
.result-panel { margin: auto 0; }
.pause-panel .btn-secondary.is-off { color: #64748b; }
.pause-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pause-row .btn-secondary { font-size: 13px; padding: 8px 8px; }

/* 結果：ランクを上に大きく、題名と比べっこはその下の真ん中（言葉の途中で折れないように）（2026-11-23） */
.rank-row { flex-direction: column; gap: 10px; }
.rank-texts { text-align: center; }
.res-title, .res-compare { word-break: keep-all; overflow-wrap: anywhere; }
.res-title { font-size: 20px; } /* Mochiy は全角の「！」が消えるので使わない */
.rank-badge { min-width: 128px; height: 64px; border-radius: 99px; box-shadow: 0 4px 0 var(--ink); }
.rank-badge .rank-icon { width: 30px; height: 30px; }
.overlay--result:not(.hidden) .rank-badge { animation: rankPop 0.55s cubic-bezier(0.3, 1.6, 0.5, 1) 0.15s both; }
.overlay--result:not(.hidden) .rank-badge .rank-icon { animation: rankPop 0.45s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
.overlay--result:not(.hidden) .rank-badge .rank-icon:nth-child(1) { animation-delay: 0.45s; }
.overlay--result:not(.hidden) .rank-badge .rank-icon:nth-child(2) { animation-delay: 0.65s; }
.overlay--result:not(.hidden) .rank-badge .rank-icon:nth-child(3) { animation-delay: 0.85s; }
@keyframes rankPop { from { opacity: 0; transform: scale(0.2) rotate(-20deg); } to { opacity: 1; transform: none; } }
.res-stat strong { font-size: 17px; }
@media (prefers-reduced-motion: reduce) {
  .overlay--result .rank-badge, .overlay--result .rank-badge .rank-icon { animation: none !important; }
}
@media (max-width: 340px) {
  .gauge-head > .btn-inline span { display: none; }
}
@media (max-width: 360px) {
  .result-panel { padding: 16px 14px; }
  .btn-start { font-size: 16px; padding: 10px 12px; }
  .pause-row .btn-secondary { font-size: 12px; padding: 8px 4px; gap: 4px; }
}

/* ============================================================
   スマホの余白の手直し（2026-11-23 本人「ポーズ時の画面が崩れている・ボタンの下の余白が足りない・
   スタートボタンなども立体的なエリアからさらに余白を」）。ボタンの立体（下に出る影）のぶんも余白に数える
   ============================================================ */
.btn-go { margin-bottom: 8px; }                 /* 影 6px ＋ すき間 */
.t-bottom { gap: 14px; }
.overlay--title { padding-bottom: max(26px, calc(env(safe-area-inset-bottom) + 14px)); }
.t-chips { margin-bottom: 4px; }               /* 影 3px のぶん */
.g-start { margin-bottom: 6px; }

.pause-actions { gap: 12px; }
.pause-actions > .btn-start { margin-bottom: 4px; }   /* 影 5px のぶん、次の段と離す */
.pause-controls { word-break: keep-all; overflow-wrap: anywhere; }
.result-panel { gap: 16px; padding-bottom: 24px; }
.btn-start:focus:not(:focus-visible), .btn-secondary:focus:not(:focus-visible) { outline: none; }

/* 下の操作：画面の端から影（4px）のぶんも離す */
.bottom-hud { bottom: max(20px, calc(env(safe-area-inset-bottom) + 12px)); }
@media (max-width: 640px) {
  /* 案内の札は、下の操作とハンドルのヒントにかからない高さへ */
  .callout { bottom: max(146px, calc(env(safe-area-inset-bottom) + 136px)); text-align: left; max-width: min(320px, calc(100vw - 32px)); justify-content: flex-start; }
}

/* 案内の札（2026-11-23 本人「アイコン小さくない？」）：アイコンは白い丸に入れて大きく左へ、文字はその右に左ぞろえ */
.callout { gap: 10px; padding: 8px 16px 8px 8px; border-radius: 16px; line-height: 1.35; }
.callout:not(:has(svg)) { padding: 9px 16px; }
.callout > .ui-icon {
  width: 36px; height: 36px; padding: 7px; box-sizing: border-box; flex: none;
  border-radius: 50%; background: rgba(255, 255, 255, 0.9); color: var(--ink);
  box-shadow: inset 0 0 0 2px rgba(29, 38, 59, 0.18);
}
.callout > span { text-align: left; }
.callout.is-pink > .ui-icon { color: #c81d3a; }
.callout.is-cyan > .ui-icon { color: #15803d; }

/* ポーズ・結果のオレンジのボタンは、ほかのボタンと同じく幅いっぱい（2026-11-23 本人「右に余白があるように見える」。
   .btn-start の max-width 310px のせいで、パネルの中身が広い画面では左に寄っていた） */
.pause-actions > .btn-start { max-width: none; width: 100%; align-self: stretch; }

/* タイトルのフッター：まとまりの間は「 / 」で区切る（「AMIX｜トミナガハルキ」の｜はそのまま）。
   / はリンクの外（span の ::before）に置き、下線がかからないように（2026-11-23 本人） */
.t-foot { gap: 2px 0; }
.t-foot > span + span::before { content: "/"; margin: 0 8px; opacity: 0.75; text-decoration: none; display: inline-block; }

/* 縁取りは円周上に 24〜48 方向ずらした影（方向が少ないと凸凹・ギザギザに見える。2026-11-23 本人「文字の端がギザギザ」）。
   袋文字の下の影：字の形だけを下へずらす text-shadow だと、縁取りの丸みが無く下だけ角ばった黒い線に見えた（2026-11-23 本人）。
   縁取りごとの形を drop-shadow で下へずらす（丸く・なめらか）。
   親の .logo-row ではなく各字 .logo i 側へ移し will-change: transform で GPU レイヤー化することで、
   logoBob 中に毎フレーム 180重 text-shadow ごと再ラスタライズされるのを防ぐ（2026-11-25 軽量化） */
.logo i {
  filter: drop-shadow(0 5px 0 #1d263b) drop-shadow(0 10px 14px rgba(15, 23, 42, 0.28));
  will-change: transform;
}

/* OGP（2026-11-23 本人「ロゴを真ん中あたりに・プレイヤーをロゴの右に」）：ロゴは真ん中。バイクは main.js の game.ogpShift で右へ */
body.ogp .overlay--title { justify-content: center; padding-top: 0; background: radial-gradient(42% 46% at 50% 50%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 72%); }
body.ogp .logo { margin: 0; transform: scale(1); }

/* ============================================================
   スマホのジョイスティック（2026-11-23 本人「スマホ時はジョイスティックも表示」）
   指の端末だけ。左下にハンドル（左右に倒す）、右にゲージ（上）とブレーキ・ダッシュ（下）
   ============================================================ */
.joy { display: none; }
@media (pointer: coarse) {
  .gauges-row {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas: "joy gauge" "joy btns";
    align-items: end;
    gap: 8px 12px;
  }
  .joy { grid-area: joy; }
  .gauge-card { grid-area: gauge; max-width: none; padding: 5px 9px; }
  .gauge-card .gauge-head { margin-bottom: 3px; }
  .touch-actions { grid-area: btns; justify-content: flex-end; }
  .touch-actions .action-btn { flex: 1 1 0; }
  .joy {
    display: block; position: relative; pointer-events: auto;
    width: 124px; height: 124px; border-radius: 50%;
    background: radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.22), rgba(20, 30, 48, 0.55) 72%);
    border: 3px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.35), inset 0 0 0 6px rgba(20, 30, 48, 0.25);
    touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
    margin-bottom: 4px;
  }
  .joy-knob {
    position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, #fff6c2, #ffbe0b 60%, #e09a00);
    border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink);
    transition: transform 90ms var(--ease-out);
    pointer-events: none;
  }
  .joy.is-held .joy-knob { transition: none; }
  .joy-arrow {
    position: absolute; top: 50%; width: 0; height: 0; margin-top: -9px;
    border-top: 9px solid transparent; border-bottom: 9px solid transparent; opacity: 0.85;
    pointer-events: none;
  }
  .joy-arrow--l { left: 9px; border-right: 12px solid #fff; }
  .joy-arrow--r { right: 9px; border-left: 12px solid #fff; }
  .touch-steer-bar { display: none !important; }
}
@media (pointer: coarse) and (max-width: 340px) {
  .joy { width: 108px; height: 108px; }
  .joy-knob { width: 50px; height: 50px; margin: -25px 0 0 -25px; }
}
/* 長押しで iPhone の拡大鏡（虫めがね）や選択メニューが出ないように（2026-11-23 本人） */
.app-root, .app-root * { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }

/* 案内の札：left:50% ＋ translate だと札の幅が画面の半分までに縮み、せまい画面で文字が細切れに折れた → 左右を 16px あけて中身の幅で真ん中に。
   スマホはジョイスティックで下の操作が高くなったので、その上に出す（2026-11-23） */
.callout { left: 16px; right: 16px; margin: 0 auto; width: fit-content; transform: none; }
@media (pointer: coarse) {
  .callout { top: auto; bottom: max(206px, calc(env(safe-area-inset-bottom) + 196px)); }
}
@media (pointer: coarse) and (max-width: 340px) {
  .callout { bottom: max(190px, calc(env(safe-area-inset-bottom) + 180px)); }
}

/* スタート前の 3・2・1・スタート!（2026-11-23 本人）。数字は Mochiy・袋文字（円状の影）・ぽんと出る */
.countdown {
  position: absolute; left: 0; right: 0; top: 42%; z-index: 30; pointer-events: none;
  text-align: center; font-family: var(--font-pop); font-weight: 400; line-height: 1;
  font-size: clamp(96px, 30vw, 170px); color: #ff5f6d;
  text-shadow: 3.00px 0.00px 0 #fff, 2.90px 0.78px 0 #fff, 2.60px 1.50px 0 #fff, 2.12px 2.12px 0 #fff, 1.50px 2.60px 0 #fff, 0.78px 2.90px 0 #fff, 0.00px 3.00px 0 #fff, -0.78px 2.90px 0 #fff, -1.50px 2.60px 0 #fff, -2.12px 2.12px 0 #fff, -2.60px 1.50px 0 #fff, -2.90px 0.78px 0 #fff, -3.00px 0.00px 0 #fff, -2.90px -0.78px 0 #fff, -2.60px -1.50px 0 #fff, -2.12px -2.12px 0 #fff, -1.50px -2.60px 0 #fff, -0.78px -2.90px 0 #fff, -0.00px -3.00px 0 #fff, 0.78px -2.90px 0 #fff, 1.50px -2.60px 0 #fff, 2.12px -2.12px 0 #fff, 2.60px -1.50px 0 #fff, 2.90px -0.78px 0 #fff, 6.00px 0.00px 0 #fff, 5.91px 1.04px 0 #fff, 5.64px 2.05px 0 #fff, 5.20px 3.00px 0 #fff, 4.60px 3.86px 0 #fff, 3.86px 4.60px 0 #fff, 3.00px 5.20px 0 #fff, 2.05px 5.64px 0 #fff, 1.04px 5.91px 0 #fff, 0.00px 6.00px 0 #fff, -1.04px 5.91px 0 #fff, -2.05px 5.64px 0 #fff, -3.00px 5.20px 0 #fff, -3.86px 4.60px 0 #fff, -4.60px 3.86px 0 #fff, -5.20px 3.00px 0 #fff, -5.64px 2.05px 0 #fff, -5.91px 1.04px 0 #fff, -6.00px 0.00px 0 #fff, -5.91px -1.04px 0 #fff, -5.64px -2.05px 0 #fff, -5.20px -3.00px 0 #fff, -4.60px -3.86px 0 #fff, -3.86px -4.60px 0 #fff, -3.00px -5.20px 0 #fff, -2.05px -5.64px 0 #fff, -1.04px -5.91px 0 #fff, -0.00px -6.00px 0 #fff, 1.04px -5.91px 0 #fff, 2.05px -5.64px 0 #fff, 3.00px -5.20px 0 #fff, 3.86px -4.60px 0 #fff, 4.60px -3.86px 0 #fff, 5.20px -3.00px 0 #fff, 5.64px -2.05px 0 #fff, 5.91px -1.04px 0 #fff, 9.00px 0.00px 0 #1d263b, 8.91px 1.28px 0 #1d263b, 8.64px 2.54px 0 #1d263b, 8.19px 3.74px 0 #1d263b, 7.57px 4.87px 0 #1d263b, 6.80px 5.89px 0 #1d263b, 5.89px 6.80px 0 #1d263b, 4.87px 7.57px 0 #1d263b, 3.74px 8.19px 0 #1d263b, 2.54px 8.64px 0 #1d263b, 1.28px 8.91px 0 #1d263b, 0.00px 9.00px 0 #1d263b, -1.28px 8.91px 0 #1d263b, -2.54px 8.64px 0 #1d263b, -3.74px 8.19px 0 #1d263b, -4.87px 7.57px 0 #1d263b, -5.89px 6.80px 0 #1d263b, -6.80px 5.89px 0 #1d263b, -7.57px 4.87px 0 #1d263b, -8.19px 3.74px 0 #1d263b, -8.64px 2.54px 0 #1d263b, -8.91px 1.28px 0 #1d263b, -9.00px 0.00px 0 #1d263b, -8.91px -1.28px 0 #1d263b, -8.64px -2.54px 0 #1d263b, -8.19px -3.74px 0 #1d263b, -7.57px -4.87px 0 #1d263b, -6.80px -5.89px 0 #1d263b, -5.89px -6.80px 0 #1d263b, -4.87px -7.57px 0 #1d263b, -3.74px -8.19px 0 #1d263b, -2.54px -8.64px 0 #1d263b, -1.28px -8.91px 0 #1d263b, -0.00px -9.00px 0 #1d263b, 1.28px -8.91px 0 #1d263b, 2.54px -8.64px 0 #1d263b, 3.74px -8.19px 0 #1d263b, 4.87px -7.57px 0 #1d263b, 5.89px -6.80px 0 #1d263b, 6.80px -5.89px 0 #1d263b, 7.57px -4.87px 0 #1d263b, 8.19px -3.74px 0 #1d263b, 8.64px -2.54px 0 #1d263b, 8.91px -1.28px 0 #1d263b, 11.00px 0.00px 0 #1d263b, 10.91px 1.44px 0 #1d263b, 10.63px 2.85px 0 #1d263b, 10.16px 4.21px 0 #1d263b, 9.53px 5.50px 0 #1d263b, 8.73px 6.70px 0 #1d263b, 7.78px 7.78px 0 #1d263b, 6.70px 8.73px 0 #1d263b, 5.50px 9.53px 0 #1d263b, 4.21px 10.16px 0 #1d263b, 2.85px 10.63px 0 #1d263b, 1.44px 10.91px 0 #1d263b, 0.00px 11.00px 0 #1d263b, -1.44px 10.91px 0 #1d263b, -2.85px 10.63px 0 #1d263b, -4.21px 10.16px 0 #1d263b, -5.50px 9.53px 0 #1d263b, -6.70px 8.73px 0 #1d263b, -7.78px 7.78px 0 #1d263b, -8.73px 6.70px 0 #1d263b, -9.53px 5.50px 0 #1d263b, -10.16px 4.21px 0 #1d263b, -10.63px 2.85px 0 #1d263b, -10.91px 1.44px 0 #1d263b, -11.00px 0.00px 0 #1d263b, -10.91px -1.44px 0 #1d263b, -10.63px -2.85px 0 #1d263b, -10.16px -4.21px 0 #1d263b, -9.53px -5.50px 0 #1d263b, -8.73px -6.70px 0 #1d263b, -7.78px -7.78px 0 #1d263b, -6.70px -8.73px 0 #1d263b, -5.50px -9.53px 0 #1d263b, -4.21px -10.16px 0 #1d263b, -2.85px -10.63px 0 #1d263b, -1.44px -10.91px 0 #1d263b, -0.00px -11.00px 0 #1d263b, 1.44px -10.91px 0 #1d263b, 2.85px -10.63px 0 #1d263b, 4.21px -10.16px 0 #1d263b, 5.50px -9.53px 0 #1d263b, 6.70px -8.73px 0 #1d263b, 7.78px -7.78px 0 #1d263b, 8.73px -6.70px 0 #1d263b, 9.53px -5.50px 0 #1d263b, 10.16px -4.21px 0 #1d263b, 10.63px -2.85px 0 #1d263b, 10.91px -1.44px 0 #1d263b;
  filter: drop-shadow(0 6px 0 #1d263b);
  transform: translateY(-50%);
}
.countdown.c2 { color: #ffb21e; }
.countdown.c1 { color: #2fc46a; }
.countdown.c0 { color: #ff7a2f; font-size: clamp(56px, 16vw, 104px); }
.countdown.pop { animation: cdPop 0.9s cubic-bezier(0.3, 1.5, 0.5, 1) both; }
@keyframes cdPop {
  0% { opacity: 0; transform: translateY(-50%) scale(0.3); }
  25% { opacity: 1; transform: translateY(-50%) scale(1.12); }
  45% { transform: translateY(-50%) scale(1); }
  85% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-50%) scale(0.92); }
}
@media (prefers-reduced-motion: reduce) { .countdown.pop { animation: none; } }
/* OGP：ロゴをほんの少し上へ（2026-11-24 本人） */
body.ogp .overlay--title { padding-bottom: 7vh; }
