/* ゲームのみに適用。既存サイトのスタイルは変更しません。 */
.runner-main { padding: 36px 0 72px; background: #F4F9FB; }
.runner-container { max-width: 1120px; width: calc(100% - 48px); margin: auto; }
.runner-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.runner-heading h1 { font-size: clamp(28px, 4vw, 44px); margin-top: 6px; letter-spacing: .05em; }
.runner-heading > a { font-size: 12px; }
.runner-lead { margin: 12px 0 26px; font-size: 14px; }
.runner-hud { background: #FFFFFF; border: 1px solid #D9E4E9; padding: 18px 24px 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 22px; }
.hud-label { display: block; color: #566571; font-size: 11px; }
.runner-hud strong { display: block; font-size: 23px; line-height: 1.5; font-variant-numeric: tabular-nums; }
#runner-location { font-size: 19px; }
.runner-progress { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; font-size: 11px; font-variant-numeric: tabular-nums; }
.runner-progress progress { display: block; width: 100%; height: 7px; border: 0; appearance: none; background: #E4EDF1; color: #00BFFF; accent-color: #00BFFF; }
.runner-progress progress::-webkit-progress-bar { background: #E4EDF1; }
.runner-progress progress::-webkit-progress-value { background: #00BFFF; }
.runner-progress progress::-moz-progress-bar { background: #00BFFF; }
.runner-progress span { min-width: 34px; text-align: right; }
.runner-shell { position: relative; border: 1px solid #D9E4E9; border-top: 0; background: #FFFFFF; }
.runner-stage { background: #EAF8FC; }
#runner-canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; touch-action: none; }
#runner-canvas:focus-visible { outline-offset: -5px; }
.runner-overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 30px; background: #FFFFFFEC; }
.runner-overlay-inner { max-width: 650px; text-align: center; }
.runner-overlay h2 { font-size: clamp(23px, 3vw, 36px); margin-block: 14px; line-height: 1.5; }
.runner-overlay p:not(.eyebrow) { font-size: 14px; margin-top: 12px; overflow-wrap: anywhere; }
.runner-overlay-actions { display: flex; justify-content: center; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 26px; }
.runner-overlay-actions .button { min-width: 150px; justify-content: center; }
.runner-overlay-actions .text-link { font-size: 12px; }
.runner-controls { display: flex; gap: 14px; margin-top: 16px; }
.runner-jump { display: flex; align-items: center; justify-content: center; gap: 20px; border: 0; background: #00BFFF; color: #102A35; font-size: 18px; font-weight: 700; min-height: 64px; flex: 1; padding: 12px 24px; touch-action: manipulation; }
.runner-jump span { font-size: 10px; font-weight: 500; letter-spacing: .1em; }
.runner-controls .button { justify-content: center; min-width: 130px; }
.runner-controls button:disabled { opacity: .45; cursor: default; }
.runner-status { min-height: 48px; font-size: 13px; padding-block: 12px; }
.runner-instructions { border-top: 1px solid #D9E4E9; padding-top: 12px; font-size: 13px; }
.runner-instructions summary { min-height: 44px; padding-block: 10px; cursor: pointer; font-weight: 600; }
.runner-instructions p { margin-block: 9px; }
.runner-disclaimer { color: #566571; font-size: 12px; }
.runner-warning { background: #FFFFFF; padding: 20px; border: 1px solid #D9E4E9; }
.runner-warning a { text-decoration: underline; }
@media (max-width: 767px) {
  .runner-main { padding-block: 24px 48px; }
  .runner-container { width: calc(100% - 24px); }
  .runner-heading { align-items: flex-start; flex-wrap: wrap; gap: 4px; }
  .runner-heading > a { margin-left: auto; font-size: 11px; }
  .runner-lead { font-size: 12px; margin-block: 8px 18px; }
  .runner-hud { padding: 12px 14px 8px; gap: 6px 16px; grid-template-columns: 1.5fr 1fr; }
  .hud-location { display: block; }
  .runner-hud strong { font-size: 22px; }
  #runner-location { font-size: 15px; }
  .hud-label { font-size: 10px; }
  /* 小画面ではCanvasを覆わず、オーバーレイを直下の操作パネルにします。 */
  .runner-overlay { position: static; padding: 22px 14px; border-top: 1px solid #D9E4E9; }
  .runner-overlay h2 { font-size: 21px; margin-block: 10px; }
  .runner-overlay p:not(.eyebrow) { font-size: 12px; }
  .runner-overlay-actions { gap: 10px; margin-top: 18px; }
  .runner-overlay-actions .button { min-width: 120px; padding-inline: 18px; }
  .runner-controls { gap: 8px; }
  .runner-controls .button { min-width: 92px; padding: 12px 10px; font-size: 12px; }
  .runner-jump { flex-direction: column; gap: 2px; font-size: 17px; padding-inline: 12px; }
  .runner-jump span { font-size: 9px; }
  .runner-instructions { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .runner-main *, .runner-main *::before, .runner-main *::after { animation: none !important; transition: none !important; }
}

/* v1.1 アーケード調。選挙サイトのヘッダー/フッターには適用しません。 */
.runner-main { --arcade-ink: #24394B; background-color: #F0F7FA; background-image: linear-gradient(#DDEAF166 1px, transparent 1px), linear-gradient(90deg, #DDEAF166 1px, transparent 1px); background-size: 24px 24px; }
.runner-heading h1 { font-weight: 800; text-shadow: 2px 2px 0 #B8EFFF; }
.runner-heading .eyebrow { font-family: ui-monospace, Consolas, monospace; font-weight: 700; }
.runner-hud { border: 3px solid var(--arcade-ink); padding: 18px 22px 16px; box-shadow: 5px 5px 0 #C3D9E5; }
.runner-hud strong, .runner-progress-text { font-family: ui-monospace, Consolas, monospace; font-weight: 800; }
#runner-clock { font-size: 32px; line-height: 1.3; }
.runner-progress { margin-top: 4px; }
.runner-progress progress { height: 10px; outline: 2px solid var(--arcade-ink); outline-offset: 1px; }
.runner-shell { border: 3px solid var(--arcade-ink); border-top: 0; box-shadow: 5px 5px 0 #C3D9E5; }
.runner-notice-lane { position: relative; z-index: 2; min-height: 60px; display: grid; place-items: center; padding: 7px 10px; background: #24394B; color: #FFFFFF; text-align: center; }
#runner-notice-idle { font: 12px ui-monospace, Consolas, monospace; letter-spacing: .06em; }
.runner-toast { pointer-events: none; max-width: 100%; padding: 5px 18px; background: #00BFFF; color: #102A35; border: 2px solid #FFFFFF; box-shadow: 3px 3px 0 #071C2D; font-size: 18px; line-height: 1.4; font-weight: 800; }
.runner-toast.is-showing { animation: checkpoint-pop var(--notice-duration, 1200ms) ease-out both; }
.runner-overlay { top: 60px; padding: 22px; background: #FFFFFFF2; }
.runner-overlay-inner { max-width: 720px; }
.runner-overlay { overflow-y: auto; place-items: start center; }
.runner-overlay-inner { margin-block: auto; }
#runner-overlay-message { white-space: pre-line; }
.runner-overlay-tag, #runner-overlay-tag { font-family: ui-monospace, Consolas, monospace; }
.runner-overlay h2 { font-size: clamp(23px, 2.7vw, 34px); font-weight: 800; }
.runner-overlay .eyebrow { display: inline-block; border: 2px solid var(--arcade-ink); padding: 4px 10px; background: #B8EFFF; }
.runner-main .button, .runner-jump { border: 2px solid var(--arcade-ink); border-radius: 0; box-shadow: 4px 4px 0 var(--arcade-ink); }
.runner-main .button:hover, .runner-jump:not(:disabled):hover { transform: translate(-1px, -1px); }
.runner-main .button:active, .runner-jump:not(:disabled):active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--arcade-ink); }
.runner-controls { gap: 18px; margin-top: 20px; padding-right: 4px; }
#runner-result-stats { white-space: pre-line; }
.runner-result-title { border: 2px solid var(--arcade-ink); background: #B8EFFF; padding: 12px 20px; font-weight: 800; }
.runner-hit-notice { display: flex; align-items: flex-start; gap: 14px; border: 2px solid var(--arcade-ink); background: #FFFFFF; padding: 14px; margin-bottom: 18px; font-size: 12px; }
.runner-hit-notice img { flex: 0 0 48px; object-fit: contain; image-rendering: pixelated; }
.runner-hit-notice p { margin: 3px 0; }
.runner-hit-title { font-weight: 800; color: #17607A; }
.runner-history-dialog { --arcade-ink: #24394B; width: 720px; max-width: calc(100vw - 32px); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); margin: auto; padding: 0; border: 3px solid var(--arcade-ink); background: #FFFFFF; color: var(--arcade-ink); box-shadow: 6px 6px 0 #102A35; overflow-y: auto; overscroll-behavior: contain; }
.runner-history-dialog::backdrop { background: #14244199; }
.runner-history-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; position: sticky; top: 0; z-index: 1; padding: 16px 20px; border-bottom: 2px solid var(--arcade-ink); background: #FFFFFF; }
.runner-history-header h2 { font-size: 22px; line-height: 1.5; }
.runner-history-header button { flex-shrink: 0; min-height: 44px; padding: 8px 14px; border: 2px solid var(--arcade-ink); background: #B8EFFF; color: var(--arcade-ink); font: inherit; cursor: pointer; }
.runner-history-content { padding: 20px; }
.runner-history-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.runner-history-list li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px; border: 1px solid #C4D7E0; padding: 16px; background: #F2F8FA; overflow-wrap: anywhere; }
.runner-history-list img { width: 64px; height: 64px; object-fit: contain; image-rendering: pixelated; border: 1px solid #C4D7E0; background: #FFFFFF; }
.runner-history-list h3 { margin: 0 0 4px; font-size: 18px; }
.runner-history-list p { margin: 6px 0 0; font-size: 13px; line-height: 1.8; }
.runner-history-violation { font-weight: 700; }
#runner-history-empty { margin: 0; font-size: 14px; }
[data-state="RUNNING"] .runner-stage { animation: arcade-start .25s ease-out; }
[data-state="CLEAR"] .runner-overlay-inner, [data-state="GAME_OVER"] .runner-overlay-inner { animation: arcade-result .28s steps(4, end) both; }
@keyframes checkpoint-pop { 0% { opacity: 0; transform: translateY(6px) scale(.94); } 12%, 85% { opacity: 1; transform: translateY(0) scale(1); } 100% { opacity: 0; transform: translateY(-4px); } }
@keyframes arcade-start { from { opacity: .5; } to { opacity: 1; } }
@keyframes arcade-result { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 767px) {
  .runner-hud { padding: 12px 10px; grid-template-columns: 1fr 1fr; gap: 6px 12px; box-shadow: 3px 3px 0 #C3D9E5; }
  .hud-location { grid-column: auto; display: block; }
  #runner-location { font-size: 15px; padding-top: 4px; }
  .hud-label { font-size: 9px; }
  #runner-clock { font-size: 25px; }
  .runner-hud strong { font-size: 21px; }
  .runner-shell { box-shadow: 3px 3px 0 #C3D9E5; }
  .runner-notice-lane { min-height: 44px; padding: 5px 8px; }
  #runner-notice-idle { font-size: 11px; }
  .runner-toast { font-size: 13px; padding: 3px 12px; }
  .runner-overlay { top: auto; padding: 20px 12px; border-top: 3px solid var(--arcade-ink); }
  .runner-controls { gap: 12px; margin-top: 16px; }
  .runner-controls .button { min-width: 90px; }
  .runner-hit-notice { gap: 10px; padding: 10px; font-size: 11px; }
  .runner-history-header { padding: 12px; gap: 10px; }
  .runner-history-header h2 { font-size: 18px; }
  .runner-history-content { padding: 12px; }
  .runner-history-list li { padding: 12px 10px; gap: 10px; grid-template-columns: 48px minmax(0, 1fr); }
  .runner-history-list img { width: 48px; height: 48px; }
  .runner-history-list h3 { font-size: 16px; }
}

/* v1.7: 最初の画面で開始できる配置。論理座標・ゲームの速度は変更しません。 */
.runner-page { --header-height: 56px; }
.runner-page .header-inner { min-height: 56px; padding: 4px 24px; gap: 12px; }
.runner-page .brand { font-size: 11px; gap: 10px; }
.runner-page .brand-sub { font-size: 14px; }
.runner-page .brand-mark { transform: scale(.8); transform-origin: left center; margin-right: -5px; }
.runner-main { padding: 12px 0 32px; }
.runner-container { width: calc(100% - 32px); max-width: min(1120px, calc((100vh - 320px) * 16 / 9 + 6px)); max-width: min(1120px, calc((100svh - 320px) * 16 / 9 + 6px)); }
.runner-heading { min-height: 38px; margin-bottom: 10px; }
.runner-heading h1 { font-size: 26px; margin: 0; }
.runner-heading .eyebrow, .runner-lead { display: none; }
.runner-hud { padding: 8px 14px 10px; gap: 4px 16px; box-shadow: 3px 3px 0 #C3D9E5; }
.runner-hud strong, #runner-clock { font-size: 22px; line-height: 1.3; }
#runner-location { font-size: 18px; padding: 0; }
.hud-label { font-size: 10px; }
.runner-progress { margin-top: 2px; line-height: 1.4; }
.runner-progress progress { height: 8px; }
.runner-notice-lane { min-height: 32px; padding: 3px 8px; }
.runner-toast { padding: 1px 12px; font-size: 14px; }
.runner-overlay { top: 32px; }
.runner-controls { margin-top: 12px; gap: 12px; }
.runner-jump { min-height: 48px; padding: 6px 16px; font-size: 16px; }
.runner-controls .button { padding: 6px 16px; min-height: 48px; }
.runner-status { min-height: 28px; font-size: 12px; padding-block: 6px; }
.runner-instructions { margin-top: 4px; padding-top: 4px; }
[data-state="TITLE"] .runner-overlay { position: absolute; inset: 32px 0 0; padding: 12px; border-top: 0; place-items: center; background: #FFFFFFC9; }
[data-state="TITLE"] .runner-overlay-inner { margin: 0; }
[data-state="TITLE"] #runner-overlay-tag,
[data-state="TITLE"] #runner-overlay-message,
[data-state="TITLE"] .runner-overlay-actions > a { display: none; }
[data-state="TITLE"] .runner-overlay h2 { margin: 0 0 10px; font-size: 20px; line-height: 1.4; }
[data-state="TITLE"] .runner-overlay-actions { margin: 0; }
[data-state="TITLE"] #runner-primary { min-height: 48px; padding: 8px 24px; }
.runner-page .header-inner { padding-top: max(4px, env(safe-area-inset-top)); }
.runner-main { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
@media (max-width: 767px) {
  .runner-main { padding-top: 8px; }
  .runner-container { max-width: 1120px; width: calc(100% - 24px); }
  .runner-heading { min-height: 32px; margin-bottom: 8px; align-items: center; flex-wrap: nowrap; gap: 8px; }
  .runner-heading h1 { font-size: 21px; }
  .runner-heading > a { font-size: 10px; white-space: nowrap; }
  .runner-hud { padding: 8px 10px; gap: 4px 10px; }
  .hud-label { font-size: 9px; }
  #runner-location { font-size: 16px; }
  #runner-clock { font-size: 22px; }
  .runner-jump { flex-direction: row; flex-wrap: wrap; gap: 2px 8px; }
  .runner-controls .button { min-width: 82px; padding-inline: 10px; }
  .runner-overlay { top: auto; }
  [data-state="TITLE"] .runner-overlay h2 { font-size: 18px; }
}
@media (max-height: 500px) and (min-aspect-ratio: 3/2) {
  .runner-page { --header-height: 48px; }
  .runner-page .header-inner { min-height: 48px; padding-block: 0; }
  .runner-page .brand-sub { font-size: 12px; }
  .runner-main { padding-top: 4px; }
  .runner-container { max-width: 1120px; width: calc(100% - 32px); }
  .runner-heading { min-height: 28px; margin-bottom: 4px; }
  .runner-heading h1 { font-size: 20px; }
  .runner-hud { grid-template-columns: 1fr 1fr 1.4fr; align-items: center; padding: 4px 10px; gap: 8px; }
  .runner-progress { grid-column: auto; }
  .runner-notice-lane { min-height: 28px; }
  .runner-stage { display: flex; justify-content: center; }
  #runner-canvas { width: auto; max-width: 100%; height: calc(100vh - 252px); height: calc(100svh - 252px); }
  .runner-overlay { top: 28px; }
  [data-state="TITLE"] .runner-overlay { top: 28px; padding: 6px; }
  [data-state="TITLE"] .runner-overlay h2 { font-size: 18px; margin-bottom: 6px; }
  .runner-controls { margin-top: 8px; }
  .runner-jump, .runner-controls .button { min-height: 44px; padding-block: 4px; }
}
