:root {
  --ink: #0b0c10;
  --white: #f3eee5;
  --dim: rgba(243, 238, 229, 0.62);
  --faint: rgba(243, 238, 229, 0.38);
  --paper: #f2eee6;
  --paper-2: #e8e3d8;
  --p-ink: #18181b;
  --p-mute: #66625b;
  --p-line: #d6d0c3;
  --red: #9b1520;
  --red-hi: #c21d2b;
  --jp: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  --num: "Manrope", "Noto Sans JP", sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--ink);
  color: var(--white);
  font-family: var(--jp);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
.key, .paper, .caption, .toast { word-break: keep-all; overflow-wrap: anywhere; }
h1, h2, h3, p, dl, dd, ol, ul, blockquote, figure, fieldset { margin: 0; padding: 0; }
ol, ul { list-style: none; }
fieldset { border: 0; min-width: 0; }

/* 走るあいだは画面を動かさない */
.js body { overflow: hidden; height: 100svh; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.js.karte-on body { overflow: visible; height: auto; touch-action: auto; -webkit-user-select: auto; user-select: auto; }

#gl { position: fixed; inset: 0; width: 100vw; height: 100svh; display: block; outline: none; }
.veil {
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background:
    radial-gradient(120% 70% at 50% 46%, rgba(6, 7, 10, 0.25), rgba(6, 7, 10, 0.86) 72%),
    linear-gradient(180deg, rgba(6, 7, 10, 0.5), rgba(6, 7, 10, 0.12) 38%, rgba(6, 7, 10, 0.78));
  opacity: 0; transition: opacity 1.4s ease;
}
.mode-key .veil { opacity: 1; }
.fade .veil { opacity: 1; background: #07080b; transition: opacity 0.4s ease; }

/* 上の帯 */
.topbar {
  position: fixed; z-index: 6; left: 0; right: 0; top: 0;
  display: flex; align-items: center; gap: 14px;
  padding: calc(14px + var(--safe-t)) 18px 0;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand { font-size: 13px; letter-spacing: 0.16em; font-weight: 500; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35); }
.demo-badge { font-size: 11px; color: var(--faint); letter-spacing: 0.04em; }
.mute { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--dim); padding: 6px 2px; }
.mute svg { width: 20px; height: 20px; }
.mute .x { display: none; }
.mute[aria-pressed="true"] .w { display: none; }
.mute[aria-pressed="true"] .x { display: inline; }
.karte-on .brand, .karte-on .demo-badge { opacity: 0; pointer-events: none; }
@media (min-width: 980px) { .karte-on .topbar { right: 440px; } .karte-on .brand, .karte-on .demo-badge { opacity: 1; } }

/* キー */
.key {
  position: fixed; inset: 0; z-index: 4;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 72px 24px calc(40px + var(--safe-b));
  text-align: center;
  transition: opacity 0.9s ease, visibility 0s linear 0.9s;
}
.js:not(.ready-gl) .key { opacity: 0; }
.js:not(.mode-key) .key { opacity: 0; visibility: hidden; pointer-events: none; }
.key-lead {
  font-size: clamp(25px, 6.6vw, 44px);
  font-weight: 500; letter-spacing: 0.08em; line-height: 1.5;
  text-wrap: balance;
}
.key-car { margin-top: 18px; font-size: 13px; color: var(--dim); letter-spacing: 0.06em; line-height: 1.9; }
.key-car span { color: var(--faint); margin-right: 0.3em; }
.key-btn {
  position: relative; margin-top: clamp(34px, 7vh, 64px);
  width: 128px; height: 128px; border-radius: 50%;
  display: grid; place-items: center;
  -webkit-tap-highlight-color: transparent; touch-action: none;
  transition: transform 0.25s ease;
}
.key-btn:focus-visible { outline: 1px solid var(--dim); outline-offset: 6px; }
.ring { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 1.2; }
.ring-bg { stroke: rgba(243, 238, 229, 0.22); }
.ring-fg { stroke: var(--red-hi); stroke-width: 2.4; stroke-dasharray: 100; stroke-dashoffset: 100; stroke-linecap: round; }
.fob { width: 34px; height: 51px; color: var(--white); }
.fob-start { fill: var(--red-hi); transition: filter 0.3s ease; }
.cranking .key-btn { transform: scale(0.965); }
.cranking .fob-start { filter: drop-shadow(0 0 6px rgba(255, 60, 60, 0.9)); }
.key-hint { margin-top: 22px; font-size: 13px; letter-spacing: 0.1em; color: var(--white); min-height: 1.7em; }
.key-hint .h1 { display: none; }
.cranking .key-hint .h0 { display: none; }
.cranking .key-hint .h1 { display: inline; }
.key-sub { margin-top: 6px; font-size: 11.5px; color: var(--faint); letter-spacing: 0.04em; }
.key-skip {
  position: absolute; left: 50%; bottom: calc(26px + var(--safe-b)); transform: translateX(-50%);
  font-size: 12px; color: var(--dim); text-decoration: none; letter-spacing: 0.06em; width: max-content; max-width: 90vw;
  border-bottom: 1px solid rgba(243, 238, 229, 0.25); padding-bottom: 2px;
}
.key-skip:hover { color: var(--white); }

/* 走るあいだの表示 */
.hud { position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity 0.8s ease; }
.hud::before, .hud::after { content: ""; position: absolute; left: 0; right: 0; pointer-events: none; }
.hud::before { top: 0; height: 140px; background: linear-gradient(180deg, rgba(8, 9, 12, 0.42), rgba(8, 9, 12, 0)); }
.hud::after { bottom: 0; height: 200px; background: linear-gradient(0deg, rgba(8, 9, 12, 0.45), rgba(8, 9, 12, 0)); }
.hud > * { position: absolute; z-index: 1; }
.mode-ready .hud, .mode-drive .hud { opacity: 1; }
.hud-top { position: absolute; left: 18px; right: 18px; top: calc(52px + var(--safe-t)); display: flex; align-items: center; gap: 12px; pointer-events: auto; }
.route { position: absolute; left: 0; right: 0; top: -9px; height: 1px; background: rgba(243, 238, 229, 0.22); }
.route i { position: absolute; inset: 0; background: var(--white); transform: scaleX(0); transform-origin: left; }
.route-txt { font-size: 12px; color: var(--dim); letter-spacing: 0.06em; }
.route-txt b { font-family: var(--num); font-weight: 600; color: var(--white); font-size: 14px; margin: 0 1px; font-variant-numeric: tabular-nums; }
.to-shop { margin-left: auto; font-size: 12px; color: var(--dim); padding: 6px 0 6px 10px; letter-spacing: 0.06em; }
.to-shop:hover { color: var(--white); }
.caption {
  left: 0; right: 0; top: 24%;
  text-align: center; font-size: clamp(21px, 4.4vw, 32px); font-weight: 500; letter-spacing: 0.12em; line-height: 1.6;
  color: var(--white); opacity: 0; padding: 0 20px;
  text-shadow: 0 2px 22px rgba(0, 0, 0, 0.55), 0 0 2px rgba(0, 0, 0, 0.3);
}
.hint {
  position: absolute; left: 0; right: 0; bottom: calc(150px + var(--safe-b));
  text-align: center; font-size: 13px; letter-spacing: 0.12em; color: var(--white);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6);
  transition: opacity 0.8s ease;
}
.hint .d { display: none; }
.mode-drive .hint .r { display: none; }
.mode-drive .hint .d { display: inline; }
.hint-gone .hint { opacity: 0; }
.mode-ready .hint .r { animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.45; } }
.meter {
  position: absolute; left: 50%; bottom: calc(34px + var(--safe-b)); transform: translateX(-50%);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 0 16px; width: 280px;
}
.spd { grid-column: 2; text-align: center; line-height: 1; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45); }
.spd b { display: block; font-family: var(--num); font-weight: 600; font-size: 58px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.spd span { display: block; margin-top: 6px; font-size: 11px; color: var(--dim); letter-spacing: 0.12em; }
.gear { grid-column: 3; grid-row: 1; justify-self: start; font-size: 11px; color: var(--dim); padding-bottom: 20px; }
.gear b { font-family: var(--num); font-weight: 600; font-size: 20px; color: var(--white); margin-right: 2px; }
.tach { grid-column: 1 / -1; margin: 14px auto 0; width: 150px; height: 2px; background: rgba(243, 238, 229, 0.2); position: relative; overflow: hidden; }
.tach i { position: absolute; inset: 0; background: var(--white); transform: scaleX(0.12); transform-origin: left; }
.tach i.red { background: var(--red-hi); }

/* 傷の印 */
.marks { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
.mark {
  position: absolute; left: 0; top: 0; margin: -17px 0 0 -17px; width: 34px; height: 34px;
  display: none; place-items: center; pointer-events: auto; -webkit-tap-highlight-color: transparent;
  transition: opacity 0.3s ease;
}
.show-marks .mark { display: grid; }
.mark span {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--red-hi); color: #fff; font-family: var(--num); font-weight: 700; font-size: 12px;
  box-shadow: 0 0 0 4px rgba(194, 29, 43, 0.25), 0 2px 10px rgba(0, 0, 0, 0.35);
}
.mark.on span { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.85), 0 2px 10px rgba(0, 0, 0, 0.35); }
.mark.away { opacity: 0.28; }

/* 着いてから（カルテ） */
.js .karte { display: none; position: relative; z-index: 5; }
.js.karte-on .karte { display: block; }
.karte-spacer { height: 64svh; pointer-events: auto; touch-action: pan-y; }
.paper {
  position: relative;
  background: var(--paper); color: var(--p-ink);
  border-radius: 20px 20px 0 0;
  padding: 18px 22px calc(40px + var(--safe-b));
  box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.35);
  transform: translateY(60px); opacity: 0;
  transition: transform 0.9s cubic-bezier(.2, .7, .2, 1), opacity 0.6s ease;
}
.karte-in .paper { transform: none; opacity: 1; }
.paper::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--p-line); margin: 0 auto 16px; }

@media (min-width: 980px) {
  .js .karte { position: fixed; top: 0; right: 0; bottom: 0; width: 440px; overflow-y: auto; overscroll-behavior: contain; }
  .karte-spacer { display: none; }
  .paper { min-height: 100%; border-radius: 0; padding: 30px 34px 48px; box-shadow: -20px 0 50px rgba(0, 0, 0, 0.3); transform: translateX(40px); }
  .paper::before { display: none; }
  .js.karte-on body { overflow: hidden; height: 100svh; }
}

.ticket {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px;
  font-size: 12px; color: var(--p-mute); letter-spacing: 0.04em;
  padding-bottom: 14px; margin-bottom: 22px;
  border-bottom: 1px dashed var(--p-line);
}
.ticket span { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ticket .ticket-k { color: var(--red); font-weight: 700; }
.ticket-go { font-size: 12px; color: var(--red); font-weight: 700; border-bottom: 1px solid currentColor; line-height: 1.4; }

.k-tag { font-size: 12px; color: var(--p-mute); letter-spacing: 0.06em; }
.k-name { margin-top: 4px; font-size: 23px; font-weight: 700; letter-spacing: 0.02em; line-height: 1.4; }
.k-spec { margin-top: 2px; font-size: 13px; color: var(--p-mute); letter-spacing: 0.08em; }
.k-price { margin-top: 20px; display: flex; align-items: baseline; gap: 8px; line-height: 1; }
.k-price-l { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; }
.k-price b { font-family: var(--num); font-weight: 600; font-size: 60px; letter-spacing: -0.03em; font-variant-numeric: lining-nums; }
.k-price-u { font-size: 18px; font-weight: 700; }
.k-price-n { margin-top: 8px; font-size: 12px; color: var(--p-mute); }

.btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 52px; padding: 10px 14px; border-radius: 10px;
  font-size: 15px; font-weight: 700; letter-spacing: 0.06em; text-decoration: none; text-align: center; line-height: 1.35;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn small { font-size: 11px; font-weight: 500; opacity: 0.75; letter-spacing: 0.04em; }
.btn-main { background: var(--red); color: #fff; }
.btn-main:hover { background: #82111b; }
.btn-sub { border: 1px solid var(--p-ink); color: var(--p-ink); }
.btn-sub:hover { background: var(--p-ink); color: var(--paper); }
.k-cta { margin-top: 22px; display: grid; grid-template-columns: 1fr; gap: 8px; }
.k-cta .btn-sub { min-height: 46px; font-size: 14px; }

.facts { margin-top: 26px; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--p-line); }
.facts > div { padding: 12px 0 12px; border-bottom: 1px solid var(--p-line); }
.facts > div:nth-child(odd) { padding-right: 12px; }
.facts > div:nth-child(even) { padding-left: 14px; border-left: 1px solid var(--p-line); }
.facts dt { font-size: 11.5px; color: var(--p-mute); letter-spacing: 0.08em; }
.facts dd { font-family: var(--num); font-weight: 600; font-size: 22px; line-height: 1.3; font-variant-numeric: lining-nums; }
.facts dd small { font-family: var(--jp); font-size: 12px; font-weight: 500; margin: 0 1px; }

.k-sec { margin-top: 46px; }
.nw { white-space: nowrap; }
.k-sec h3 { font-size: 18px; font-weight: 700; letter-spacing: 0.04em; line-height: 1.5; text-wrap: balance; }
.k-lead { margin-top: 4px; font-size: 13px; color: var(--p-mute); }

.scars { margin-top: 14px; border-top: 1px solid var(--p-line); }
.scars button {
  display: grid; grid-template-columns: 24px 1fr; gap: 2px 12px; width: 100%; text-align: left;
  padding: 14px 6px 14px 0; border-bottom: 1px solid var(--p-line); transition: background 0.2s ease;
}
.scars button:hover, .scars button[aria-pressed="true"] { background: var(--paper-2); }
.scars i { grid-row: 1 / span 2; width: 22px; height: 22px; margin-top: 2px; border-radius: 50%; background: var(--red); color: #fff; font-style: normal; font-family: var(--num); font-weight: 700; font-size: 12px; display: grid; place-items: center; }
.scars b { font-size: 15px; }
.scars span { font-size: 13px; color: var(--p-mute); line-height: 1.65; text-wrap: balance; }

.log { margin-top: 16px; display: grid; grid-template-columns: repeat(9, 1fr); gap: 5px; }
.log li {
  aspect-ratio: 1 / 1.15; display: grid; place-items: end center; padding-bottom: 5px;
  background: var(--p-ink); color: var(--paper); border-radius: 3px;
  font-family: var(--num); font-weight: 600; font-size: 11px; position: relative;
}
.log li::before { content: ""; position: absolute; top: 7px; left: 50%; width: 7px; height: 4px; border: solid var(--paper); border-width: 0 0 1.5px 1.5px; transform: translateX(-50%) rotate(-45deg); }
.log-n { margin-top: 14px; font-size: 13px; color: var(--p-mute); }
.log-n li { padding: 3px 0; }
.log-n b { color: var(--p-ink); font-family: var(--num); font-weight: 600; margin-right: 12px; }

.letter blockquote { margin-top: 14px; padding: 4px 0 4px 18px; border-left: 2px solid var(--red); font-size: 15.5px; line-height: 2; }
.letter blockquote p + p { margin-top: 0.8em; }
.letter .who { margin-top: 10px; padding-left: 20px; font-size: 12.5px; color: var(--p-mute); }

.km { margin-top: 16px; display: grid; grid-template-columns: 1fr auto; align-items: baseline; }
.km label { font-size: 13px; color: var(--p-mute); }
.km output { font-family: var(--num); font-weight: 600; font-size: 20px; }
.km input { grid-column: 1 / -1; margin-top: 10px; width: 100%; height: 28px; -webkit-appearance: none; appearance: none; background: transparent; --p: 21%; }
.km input::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--red) var(--p), var(--p-line) var(--p)); }
.km input::-moz-range-track { height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--red) var(--p), var(--p-line) var(--p)); }
.km input::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -10.5px; border-radius: 50%; background: var(--paper); border: 2px solid var(--red); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); }
.km input::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--paper); border: 2px solid var(--red); }
.month { margin-top: 14px; border-top: 1px solid var(--p-line); }
.month > div { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--p-line); }
.month dt { font-size: 13px; color: var(--p-mute); }
.month dd { font-family: var(--num); font-weight: 600; font-size: 18px; font-variant-numeric: tabular-nums; }
.month .sum dt { color: var(--p-ink); font-weight: 700; }
.month .sum dd { font-size: 24px; color: var(--red); }
.fine { margin-top: 12px; font-size: 11.5px; color: var(--p-mute); line-height: 1.75; }

.mode { margin-top: 16px; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--p-ink); border-radius: 10px; overflow: hidden; }
.mode button { padding: 10px 6px; font-size: 13.5px; font-weight: 700; letter-spacing: 0.04em; }
.mode button[aria-selected="true"] { background: var(--p-ink); color: var(--paper); }
.form { margin-top: 18px; }
.form legend { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.form legend small { font-weight: 400; color: var(--p-mute); margin-left: 10px; font-size: 11.5px; }
.chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.f-time .chips { grid-template-columns: repeat(4, 1fr); }
.f-time { margin-top: 16px; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips label {
  display: flex; align-items: baseline; justify-content: center; gap: 4px;
  padding: 9px 4px; border: 1px solid var(--p-line); border-radius: 6px; background: #fbf9f4;
  font-family: var(--num); font-weight: 600; font-size: 15px; cursor: pointer; transition: all 0.15s ease;
}
.chips label small { font-family: var(--jp); font-size: 11px; font-weight: 500; color: var(--p-mute); }
.chips input:checked + label { background: var(--p-ink); border-color: var(--p-ink); color: var(--paper); }
.chips input:checked + label small { color: inherit; opacity: 0.75; }
.chips input:focus-visible + label { outline: 2px solid var(--red); outline-offset: 2px; }
.f-hold { display: none; font-size: 13.5px; line-height: 1.8; }
.form.hold .f-day, .form.hold .f-time { display: none; }
.form.hold .f-hold { display: block; }
.field { display: block; margin-top: 16px; font-size: 13px; font-weight: 700; }
.field input {
  display: block; width: 100%; margin-top: 6px; padding: 10px 2px; font: inherit; font-weight: 400; font-size: 16px;
  color: var(--p-ink); background: transparent; border: 0; border-bottom: 1px solid var(--p-ink); border-radius: 0;
}
.field input:focus { outline: none; border-bottom-color: var(--red); box-shadow: 0 1px 0 var(--red); }
.field input::placeholder { color: #aaa49a; }
.form .btn-main { width: 100%; margin-top: 22px; }
.done { margin-top: 18px; padding: 20px; background: var(--paper-2); border-radius: 10px; outline: none; }
.done-big { font-size: 16px; font-weight: 700; line-height: 1.8; }
.light { margin-top: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-line { border: 1px solid #00853a; color: #00692e; }
.btn-line:hover { background: #00853a; color: #fff; }
.btn-tel { border: 1px solid var(--p-ink); color: var(--p-ink); }
.btn-tel:hover { background: var(--p-ink); color: var(--paper); }

.k-foot { margin-top: 54px; padding-top: 22px; border-top: 1px solid var(--p-line); font-size: 12px; color: var(--p-mute); }
.again { display: block; width: 100%; padding: 14px; margin-bottom: 26px; border: 1px solid var(--p-line); border-radius: 10px; font-size: 14px; font-weight: 700; color: var(--p-ink); letter-spacing: 0.06em; }
.again:hover { border-color: var(--p-ink); }
.k-foot .shop { font-size: 14px; color: var(--p-ink); font-weight: 700; letter-spacing: 0.12em; }
.k-foot .demo { margin-top: 12px; line-height: 1.75; }

.toast {
  position: fixed; z-index: 9; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translate(-50%, 20px);
  background: rgba(16, 17, 20, 0.92); color: var(--white); font-size: 13px; padding: 10px 18px; border-radius: 8px;
  opacity: 0; pointer-events: none; transition: all 0.3s ease; white-space: nowrap;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* JS が動かない・立体が出せない端末では、カルテだけをふつうのページとして出す */
.no-js .key, .no-js .hud, .no-js .marks, .no-js .veil, .no-gl .key, .no-gl .hud, .no-gl .marks, .no-gl #gl { display: none !important; }
.no-js .karte, .no-gl .karte { display: block !important; position: relative !important; width: auto !important; max-width: 560px; margin: 0 auto; padding-top: 64px; }
.no-js .karte-spacer, .no-gl .karte-spacer { display: none; }
.no-js .paper, .no-gl .paper { transform: none; opacity: 1; border-radius: 20px 20px 0 0; }
.no-js body, .no-gl body { overflow: auto; height: auto; }

@media (max-width: 380px) {
  .k-price b { font-size: 54px; }
}
