/* Noodletown live: only a search pill, a cat card and a tiny quality toggle. Fredoka (OFL), cozy cream cards. */
@font-face { font-family: "Fredoka"; src: url("../assets/fonts/Fredoka-Variable.ttf") format("truetype"); font-weight: 300 700; font-display: swap; }
:root {
  --cream: #fbf3e4; --cream2: #f3e6cf; --ink: #4a3426; --ink2: #7a5f4b; --line: rgba(110, 78, 52, 0.18);
  --teal: #2fa59a; --gold: #e2b450; --shadow: 0 6px 22px rgba(30, 20, 12, 0.28);
  --top: max(12px, env(safe-area-inset-top)); --bot: max(12px, env(safe-area-inset-bottom));
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1d2a24; font-family: "Fredoka", ui-rounded, "Segoe UI", system-ui, sans-serif; color: var(--ink); }
body { touch-action: none; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
#gl { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; outline: none; cursor: grab; }
#gl.dragging { cursor: grabbing; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
.ui { position: fixed; z-index: 5; }

/* ---------------------------------------------------------------- loader */
#loader { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: radial-gradient(120% 90% at 50% 40%, #2f4a3c 0%, #1d2a24 70%); transition: opacity 0.7s ease; }
#loader.done { opacity: 0; pointer-events: none; }
.ld-card { display: grid; justify-items: center; gap: 14px; }
.ld-cat { width: 132px; height: 143px; animation: ld-breathe 2.8s ease-in-out infinite; transform-origin: 50% 90%; }
.ld-sil { fill: #f6e6c8; stroke: #f6e6c8; stroke-width: 3; stroke-linejoin: round; }
.ld-sil .ld-tail { fill: none; stroke-width: 8; stroke-linecap: round; }
.ld-collar { fill: none; stroke: var(--teal); stroke-width: 5; stroke-linecap: round; }
.ld-tag { fill: var(--gold); }
.ld-paws { display: flex; gap: 8px; }
.ld-paws svg { width: 22px; height: 22px; fill: rgba(246, 230, 200, 0.18); transition: fill 0.35s ease, transform 0.35s ease; }
.ld-paws svg:nth-child(odd) { transform: translateY(-5px) rotate(-8deg); }
.ld-paws svg:nth-child(even) { transform: translateY(3px) rotate(8deg); }
.ld-paws svg.on { fill: #f6e6c8; }
.ld-text { margin: 0; color: #e9dcc3; font-size: 15px; letter-spacing: 0.02em; min-height: 1.3em; text-align: center; max-width: 80vw; }
@keyframes ld-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.025, 0.985); } }

/* ---------------------------------------------------------------- the search pill */
#find { top: var(--top); left: 50%; transform: translateX(-50%); width: min(92vw, 400px); }
.pill { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 16px 0 14px; border-radius: 999px; background: rgba(251, 243, 228, 0.94);
  box-shadow: var(--shadow); border: 1.5px solid rgba(255, 255, 255, 0.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.pill:focus-within { border-color: var(--teal); }
.pill-ico { width: 18px; height: 18px; fill: var(--ink2); flex: none; }
#q { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 17px; color: var(--ink); }
#q::placeholder { color: #9a8170; }
#q::-webkit-search-cancel-button { filter: sepia(1) hue-rotate(-20deg) saturate(2); cursor: pointer; }
#results { list-style: none; margin: 8px 0 0; padding: 6px; border-radius: 20px; background: rgba(251, 243, 228, 0.97); box-shadow: var(--shadow); max-height: min(50vh, 340px); overflow: auto; }
#results li { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 14px; cursor: pointer; font-size: 16px; }
#results li small { color: var(--ink2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#results li[aria-selected="true"], #results li:hover { background: var(--cream2); }
#results li.empty { cursor: default; color: var(--ink2); justify-content: center; }
.note { margin: 8px auto 0; width: fit-content; max-width: 100%; padding: 6px 14px; border-radius: 999px; background: rgba(29, 42, 36, 0.9); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25); color: #f3e6cf; font-size: 13px; text-align: center; transition: opacity 0.6s ease; }
.note.fade { opacity: 0; }

/* ---------------------------------------------------------------- the cat card */
#card { left: 50%; bottom: var(--bot); transform: translateX(-50%); width: min(94vw, 420px); display: grid; grid-template-columns: 96px 1fr; gap: 4px 14px; align-items: center;
  padding: 14px 16px 12px 14px; border-radius: 24px; background: rgba(251, 243, 228, 0.96); box-shadow: var(--shadow); border: 1.5px solid rgba(255, 255, 255, 0.6);
  animation: card-in 0.35s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes card-in { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }
.card-img { width: 96px; height: 96px; border-radius: 20px; background: radial-gradient(circle at 50% 35%, #fff8ea, #ead8b8); grid-row: span 2; object-fit: cover; }
.card-body { min-width: 0; }
.card-body h2 { margin: 0 26px 2px 0; font-size: 21px; font-weight: 600; line-height: 1.15; overflow-wrap: anywhere; }
.card-body p { margin: 2px 0 0; font-size: 14px; line-height: 1.3; }
.card-meta { color: var(--ink2); }
.card-bio { color: #7a5234; }
.card-home::before { content: "⌂ "; color: var(--ink2); }
.card-now { font-weight: 500; color: #2e6f63; }
.card-x { position: absolute; top: 6px; right: 8px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: var(--ink2); font-size: 24px; line-height: 1; cursor: pointer; font-family: inherit; }
.card-x:hover, .card-x:focus-visible { background: var(--cream2); }
.card-share { justify-self: start; grid-column: 2; margin-top: 4px; padding: 6px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff9ee; color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; }
.card-share:hover, .card-share:focus-visible { border-color: var(--teal); }

/* ---------------------------------------------------------------- the quality toggle (tiny, corner) */
#gear { right: max(10px, env(safe-area-inset-right)); bottom: var(--bot); display: flex; gap: 8px; align-items: center; }
#camlock { width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(29, 42, 36, 0.38); cursor: pointer; display: grid; place-items: center; }
#camlock svg { width: 18px; height: 18px; }
#camlock rect { fill: rgba(251, 243, 228, 0.85); }
#camlock path { fill: none; stroke: rgba(251, 243, 228, 0.85); stroke-width: 2.2; stroke-linecap: round; }
#camlock[aria-pressed="true"] .sh-open, #camlock[aria-pressed="false"] .sh-closed { display: none; }
#camlock:hover, #camlock:focus-visible { background: rgba(29, 42, 36, 0.6); }
#camlock[aria-pressed="false"] { background: rgba(46, 111, 99, 0.75); }
#gear-btn { width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(29, 42, 36, 0.38); cursor: pointer; display: grid; place-items: center; }
#gear-btn svg { width: 18px; height: 18px; fill: rgba(251, 243, 228, 0.85); }
#gear-btn:hover, #gear-btn:focus-visible { background: rgba(29, 42, 36, 0.6); }
#gear-menu { position: absolute; right: 0; bottom: 42px; display: grid; gap: 2px; padding: 8px 10px; border-radius: 16px; background: rgba(251, 243, 228, 0.97); box-shadow: var(--shadow); font-size: 14px; white-space: nowrap; }
#gear-menu label { display: flex; gap: 6px; align-items: center; padding: 3px 4px; cursor: pointer; }
#gear-menu [role="radiogroup"] + [role="radiogroup"] { margin-top: 4px; padding-top: 6px; border-top: 1px solid var(--line); }
.gm-h { margin: 0 0 1px; padding: 0 4px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.05em; color: var(--ink2); }
body.has-card #gear { bottom: calc(var(--bot) + var(--card-h, 156px) + 12px); }
.card-meta .mi { white-space: nowrap; }
.card-meta .mi.long { white-space: normal; }
@media (min-width: 760px) { body.has-card #gear { bottom: var(--bot); } }

button:focus-visible { outline: 2.5px solid var(--teal); outline-offset: 2px; }
#q:focus-visible { outline: none; }   /* the pill's teal border shows focus */
.pill:focus-within { box-shadow: var(--shadow), 0 0 0 2px var(--teal); }
@media (prefers-reduced-motion: reduce) { .ld-cat, #card { animation: none; } #loader { transition: none; } }

/* ---------------------------------------------------------------- the roadmap chip (under the search pill) */
#chip { top: calc(var(--top) + 54px); left: 0; right: 0; margin: 0 auto; width: max-content; z-index: 4; display: flex; align-items: center; gap: 8px; max-width: min(92vw, 400px);
  padding: 6px 6px 6px 12px; border-radius: 999px; border: 1.5px solid rgba(255, 255, 255, 0.6); background: rgba(251, 243, 228, 0.94); box-shadow: var(--shadow);
  font: inherit; color: var(--ink); cursor: pointer; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
#chip:hover, #chip[aria-expanded="true"] { border-color: var(--teal); }
.chip-ico { width: 18px; height: 18px; fill: var(--teal); flex: none; }
.chip-main { display: grid; gap: 3px; min-width: 0; text-align: left; }
#chip-text { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-bar { display: block; height: 5px; border-radius: 3px; background: rgba(110, 78, 52, 0.16); overflow: hidden; }
.chip-bar i, .rm-bar i, .tag-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal), #4cc2b4); }
.chip-more { flex: none; padding: 5px 10px; border-radius: 999px; background: var(--ink); color: var(--cream); font-size: 12.5px; font-weight: 500; }
#find:has(#q:focus) ~ #chip { visibility: hidden; }   /* (typing: the results list covers it; the language pill does not count) */
body.has-chip .note { margin-top: 56px; }
body.has-sheet #chip { display: none; }

/* ---------------------------------------------------------------- floating labels over the town */
#tags { position: fixed; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; }
.tag { position: absolute; left: 0; top: 0; pointer-events: auto; transform-origin: 50% 100%; will-change: transform; border: 0; padding: 0; background: none; font: inherit; color: var(--ink); cursor: pointer; display: grid; justify-items: center; }
.tag-card { display: flex; align-items: center; gap: 9px; padding: 8px 12px 8px 9px; border-radius: 16px; background: rgba(251, 243, 228, 0.96); border: 2px solid #8a6040; box-shadow: var(--shadow); text-align: left; }
.tag-stem { width: 2px; height: 16px; background: #8a6040; }
.tag-stem::after { content: ""; display: block; width: 8px; height: 8px; margin: 14px 0 0 -3px; border-radius: 50%; background: #8a6040; }
.tag-t { display: grid; gap: 2px; min-width: 128px; }
.tag-name { font-size: 15.5px; font-weight: 600; line-height: 1.1; white-space: nowrap; }
.tag-sub { font-size: 12.5px; color: var(--ink2); white-space: nowrap; }
.tag-go { font-size: 12px; font-weight: 500; color: #2e6f63; white-space: nowrap; }
.tag-bar { display: block; height: 5px; margin: 2px 0 1px; border-radius: 3px; background: rgba(110, 78, 52, 0.16); overflow: hidden; }
.tag.inside .tag-card { border-color: #c8483a; padding: 7px 13px 7px 9px; }
.tag.inside .tag-stem, .tag.inside .tag-stem::after { background: #c8483a; }
.tag.inside .tag-name { font-size: 14.5px; }
.tag.inside.building .tag-card { border-color: #8a6040; } .tag.inside.building .tag-stem, .tag.inside.building .tag-stem::after { background: #8a6040; }
.tag:focus-visible { outline: none; } .tag:focus-visible .tag-card { outline: 2.5px solid var(--teal); outline-offset: 2px; }
.ico { display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--cream2); }
.ico svg { width: 17px; height: 17px; fill: var(--ink2); color: var(--ink2); }
.ico.gold { background: #f6dc98; } .ico.gold svg { fill: #7a5418; color: #7a5418; }
.ico.red { background: #f4c8bc; } .ico.red svg { fill: #8a2e22; color: #8a2e22; }

/* ---------------------------------------------------------------- sheets (roadmap, inside the café): bottom on phones, a side panel on wide screens */
.sheet { left: 50%; bottom: var(--bot); transform: translateX(-50%); z-index: 6; width: min(94vw, 440px); max-height: min(80vh, 680px); max-height: min(80dvh, 680px);
  display: flex; flex-direction: column; border-radius: 24px; background: rgba(251, 243, 228, 0.97); box-shadow: var(--shadow); border: 1.5px solid rgba(255, 255, 255, 0.6);
  animation: card-in 0.35s cubic-bezier(.2, .9, .3, 1.2); overflow: hidden; }
.sheet-head { position: relative; padding: 14px 52px 8px 18px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { margin: 0; font-size: 21px; font-weight: 600; line-height: 1.15; }
.sheet-sub { margin: 2px 0 0; font-size: 13.5px; color: var(--ink2); }
.sheet .card-x { top: 10px; right: 10px; }
.sheet-body { overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; touch-action: pan-y; padding: 10px 16px 16px; -webkit-overflow-scrolling: touch; }
@keyframes sheet-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@media (min-width: 760px) {
  .sheet { left: auto; right: max(12px, env(safe-area-inset-right)); top: calc(var(--top) + 58px); bottom: auto; transform: none; width: 400px; max-height: calc(100vh - var(--top) - 70px); max-height: calc(100dvh - var(--top) - 70px); animation-name: sheet-in; }
}
body.has-sheet #gear { display: none; }
.sheet:focus { outline: none; }

/* roadmap contents */
.rm-sec { margin: 10px 0 0; }
.rm-sec h3 { margin: 14px 0 8px; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink2); }
.rm-sec p { margin: 0; }
.rm-next { padding: 12px 14px; border-radius: 18px; background: #fff9ee; border: 1.5px solid #e8d2a8; }
.rm-next.focus, .rm-steps li.focus { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(47, 165, 154, 0.25); }
.rm-next-top { display: flex; align-items: center; gap: 10px; }
.rm-kicker { font-size: 12.5px; color: var(--ink2); }
.rm-big { font-size: 20px; font-weight: 600; line-height: 1.15; }
.rm-bar { height: 10px; margin: 10px 0 6px; border-radius: 6px; background: rgba(110, 78, 52, 0.14); overflow: hidden; }
.rm-count { font-size: 14px; } .rm-count b { font-weight: 600; }
.rm-small { font-size: 13px; line-height: 1.3; color: var(--ink2); }
.rm-strong { font-size: 15px; font-weight: 500; line-height: 1.2; }
.rm-go { margin-top: 8px; padding: 6px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; flex: none; }
.rm-go:hover, .rm-go:focus-visible { border-color: var(--teal); }
.rm-how-row { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; }
.rm-handle { margin-top: 4px !important; font-size: 14px; font-weight: 500; color: #2e6f63; }
.rm-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rm-steps li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; border: 1.5px solid transparent; background: rgba(243, 230, 207, 0.55); }
.rm-steps li .ico { width: 26px; height: 26px; } .rm-steps li .ico svg { width: 15px; height: 15px; }
.rm-steps li.open .ico { background: #cde9df; } .rm-steps li.open .ico svg { fill: #2e6f63; }
.rm-steps li.next { background: #fff4d8; } .rm-steps li.next .ico { background: #f6dc98; } .rm-steps li.next .ico svg { fill: #7a5418; }
.rm-steps li.later { opacity: 0.8; }
.rm-step-t { flex: 1; min-width: 0; }
.rm-steps .rm-go { margin: 0; padding: 4px 11px; }
.rm-more { margin-top: 8px !important; }
.rm-need p { padding: 10px 12px; border-radius: 14px; background: #fff9ee; border: 1.5px dashed #e8d2a8; font-size: 14px; }
.rm-credit { padding: 10px 12px; margin-bottom: 8px; border-radius: 16px; background: #fff9ee; border: 1.5px solid #e8d2a8; }
.rm-credit-head { display: flex; align-items: center; gap: 10px; }
.rm-by { font-size: 13.5px; color: #2e6f63; font-weight: 500; overflow-wrap: anywhere; }
.rm-quote { margin-top: 6px !important; font-size: 14px; font-style: italic; color: var(--ink); overflow-wrap: anywhere; }
.rm-also p { font-size: 14px; color: var(--ink); }

/* inside the café */
.in-view { position: relative; margin: 4px 0 8px; border-radius: 18px; overflow: hidden; background: #24170f; aspect-ratio: 4 / 3; }
#in-img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.25s; }
#in-img.ready { opacity: 1; }
.in-wait { position: absolute; inset: 0; margin: 0; display: grid; place-items: center; color: #f3e6cf; font-size: 14px; }
.in-blurb { margin: 2px 0 10px; font-size: 14px; line-height: 1.4; color: var(--ink2); }   /* (day 3) the apartments' text card */
.in-now { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.in-now li { position: relative; padding-left: 18px; font-size: 14px; line-height: 1.3; }
.in-now li::before { content: ""; position: absolute; left: 4px; top: 0.5em; width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }
.in-credit { margin: 10px 0 0; font-size: 13.5px; color: var(--ink2); overflow-wrap: anywhere; }
.in-credit b { color: #2e6f63; font-weight: 500; }
.in-quote { display: block; margin-top: 3px; font-style: italic; color: var(--ink); }
@media (min-width: 760px) { #inside { width: 440px; } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }

/* ---------------------------------------------------------------- EN | 日本語 (inside the search pill, right end) */
.lang { flex: none; display: flex; padding: 2px; border-radius: 999px; background: rgba(110, 78, 52, 0.1); }
.lang button { border: 0; margin: 0; padding: 3px 8px; min-height: 26px; border-radius: 999px; background: transparent; color: var(--ink2); font: inherit; font-size: 12px; font-weight: 500; line-height: 1; cursor: pointer; }
.lang button[lang="ja"] { font-family: "Fredoka", "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif; }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--cream); }
.lang button:focus-visible { outline-offset: 0; }
.pill { padding-right: 6px; }

/* ---------------------------------------------------------------- Japanese: Fredoka for the Latin letters and digits, a rounded or
   clean system Japanese font for the rest (only fonts already on the device), and strict kinsoku line breaks at phrase edges */
html:lang(ja) body, html:lang(ja) #q, html:lang(ja) button { font-family: "Fredoka", "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", "Meiryo", "Noto Sans JP", "Noto Sans CJK JP", ui-rounded, system-ui, sans-serif; }
html:lang(ja) body { line-break: strict; }
html:lang(ja) .sheet-body p, html:lang(ja) .sheet-sub, html:lang(ja) .card-body p, html:lang(ja) .note, html:lang(ja) .ld-text, html:lang(ja) .in-now li, html:lang(ja) .in-credit { word-break: auto-phrase; overflow-wrap: anywhere; }
html:lang(ja) .rm-sec h3 { letter-spacing: 0.04em; }
html:lang(ja) .card-body p, html:lang(ja) .rm-small, html:lang(ja) .in-now li { line-height: 1.42; }
html:lang(ja) .card-body h2, html:lang(ja) .sheet-head h2, html:lang(ja) .rm-big { font-size: 19px; line-height: 1.25; }
html:lang(ja) #q { font-size: 16px; }
html:lang(ja) .tag-name { font-size: 14.5px; } html:lang(ja) .tag-sub, html:lang(ja) .tag-go { font-size: 12px; }
html:lang(ja) #chip-text { font-size: 13px; } html:lang(ja) .chip-more { font-size: 12px; }
