/* 返事をする人: the game's own widgets and screen effects (extensions.js). Standard parts come from css/kit.css + chat-skins.css + chat-lib.css; the colours of the app are tokens in css/theme-game.css. */
html, body { height: 100%; margin: 0; background: #0e0f12; color: #e8e4dc; overscroll-behavior: none; -webkit-text-size-adjust: 100%; }
/* the phone-width column (full screen on phones, centred on PCs) */
#stage { position: fixed; inset: 0; margin: 0 auto; max-width: 480px; background: #16181c; overflow: hidden; }
#app { position: absolute; inset: 0; }
@media (min-width: 560px) {
  #stage { top: 2vh; bottom: 2vh; border-radius: 22px; border: 1px solid #262a30; box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6); }
  body::before { content: ""; position: fixed; inset: 0; background: radial-gradient(ellipse at 50% 30%, #1b1e24 0%, #0e0f12 70%); }
}
#stage { font-size: calc(15px * var(--fs, 1)); }

/* standard menu rows (js/chat-menu.js) */
.cm-seg { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.cm-seg button { border: 1px solid var(--gf-border-strong, #3a4048); background: transparent; color: inherit; border-radius: 999px; padding: 6px 14px; min-height: 40px; font: inherit; }
.cm-seg button.on { background: var(--gf-accent, #7fb09d); border-color: var(--gf-accent, #7fb09d); color: var(--gf-accent-ink, #0e1512); }
.cm-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; flex-wrap: wrap; }
.cm-note { font-size: 0.82em; opacity: 0.7; line-height: 1.7; }

/* ---- screenshots of the fictional app 「ことづて」 (M01-M05), drawn in HTML; a bubble shows one, the viewer shows M03 next to the other screen ---- */
.hj-shot-wrap { width: min(180px, 50vw); }
.hj-shot { position: relative; margin: 0; width: 100%; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: #f4f4f1; border: 1px solid #2c3036; container-type: inline-size; }
.hj-cmp { display: none; }
.cx-viewer-body .hj-shot-wrap { width: min(100%, calc(70vh * 3 / 4), 440px); }
.cx-viewer-body .hj-shot-wrap:has(.hj-cmp) { width: 100%; }
.cx-viewer-body .hj-shot-wrap:has(.hj-cmp) > .hj-shot { display: none; }
.cx-viewer-body .hj-cmp { display: flex; gap: 10px; width: 100%; justify-content: center; }
.hj-cmp > div { flex: 1; max-width: min(340px, calc(64vh * 3 / 4)); display: flex; flex-direction: column; gap: 4px; text-align: center; font-size: 0.82em; color: #d4d8dd; }
@media (max-width: 600px) { .cx-viewer-body .hj-cmp { flex-direction: column; align-items: center; } .hj-cmp > div { width: 100%; max-width: 300px; } }
.sc { position: absolute; inset: 0; text-align: left; display: flex; flex-direction: column; background: #f3f3f0; color: #1d1f22; font-family: 'Zen Kaku Gothic New', sans-serif; font-size: 4.1cqw; line-height: 1.45; }
.sc-status { display: flex; justify-content: space-between; padding: 1.6cqw 4cqw 1cqw; font-size: 0.72em; color: #3c3f44; }
.sc-head { display: flex; align-items: center; gap: 2cqw; padding: 1.8cqw 3cqw; background: #e6e9e7; border-bottom: 0.3cqw solid #d4d8d5; }
.sc-head b { font-size: 1.02em; }
.sc-head em { font-style: normal; color: #6b7076; font-size: 0.86em; }
.sc-back, .sc-dots { color: #59606a; }
.sc-dots { margin-left: auto; }
.sc-body { flex: 1; overflow: hidden; padding: 2cqw 3cqw; display: flex; flex-direction: column; gap: 2.2cqw; }
.sc-day { display: flex; justify-content: center; margin: 1cqw 0; }
.sc-day span { font-size: 0.74em; color: #50555b; background: #e0e3e1; padding: 0.6cqw 3cqw; border-radius: 4cqw; }
.sc-row { display: flex; gap: 2cqw; align-items: flex-start; }
.sc-row.r { justify-content: flex-end; align-items: flex-end; }
.sc-av { flex: none; width: 8cqw; height: 8cqw; border-radius: 50%; background: #b9bec2 center/cover; }
.sc-av.blank { background: transparent; border: 0.4cqw dashed #8a9097; box-sizing: border-box; }
.sc-c { min-width: 0; }
.sc-c small { display: block; font-size: 0.7em; color: #5b6168; margin-bottom: 0.4cqw; }
.sc-line { display: flex; align-items: flex-end; gap: 1.4cqw; }
.sc-b { margin: 0; padding: 1.8cqw 2.8cqw; border-radius: 3.4cqw; border-top-left-radius: 1cqw; background: #fff; border: 0.25cqw solid #dfe2e0; }
.sc-b.me { background: #cfe6dc; border-color: #b9d6c9; border-radius: 3.4cqw; border-bottom-right-radius: 1cqw; max-width: 74%; }
.sc-meta { font-size: 0.6em; color: #5c6269; white-space: nowrap; text-align: right; }
.sc-foot { padding: 2cqw 3cqw 3cqw; border-top: 0.3cqw solid #dcdfdd; }
.sc-field { display: block; padding: 1.6cqw 3cqw; border-radius: 4cqw; background: #e4e7e5; color: #5f666d; font-size: 0.8em; }
.sc.large { font-size: 5.2cqw; } /* 孝一's phone: large text setting */
.sc.last .sc-body { justify-content: center; gap: 5cqw; }
.sc.last .sc-b { font-size: 1.25em; }
.sc.last .sc-day span { font-size: 0.66em; }
.sc.y1999 .sc-day span { background: #e9dcc4; color: #6b4e22; }
.sc.mine { background: #eef1f0; }
.sc-quote { margin: 3cqw 0 0 10cqw; padding: 2cqw 3cqw; border-left: 1cqw solid #8aa69a; background: #e8ece9; border-radius: 1.2cqw; }
.sq-lab { font-size: 0.66em; color: #4c6b5e; font-weight: 700; }
.sq-who { font-size: 0.7em; color: #5d6268; }
.sq-who .smudge { filter: blur(0.9cqw); color: #3a3e44; }
.sc-quote p { margin: 1cqw 0 0; }
.sc-menu { margin: 1cqw 0 0 10cqw; display: flex; flex-wrap: wrap; gap: 1.4cqw; font-size: 0.7em; }
.sc-menu span { padding: 0.8cqw 2cqw; border-radius: 2cqw; background: #2a2d31; color: #e6e6e6; }
.sc-menu span.on { background: #3b6e5e; }

/* ---- things that belong to the story ---- */
.hj-qicon { align-self: center; flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1px solid #8a8780; color: #d6cfc0; display: inline-flex; align-items: center; justify-content: center; animation: hj-blink 1.6s ease-in-out infinite; }
body.lowstim .hj-qicon { animation: none; }
@keyframes hj-blink { 50% { opacity: 0.35; } }
.hj-asname { color: #d6cfc0; text-align: right; margin-right: 4px; }
.cx-row.hj-as-mother .cx-bubble { background: #2a2c30; color: #e9e3d6; border: 1px solid #5a5e66; }
.cx-row.hj-as-mother .cx-col { align-items: flex-end; }
.cx-input[data-note]::after { content: attr(data-note); display: block; color: var(--cx-accent, #d49a72); font-size: 0.9em; }
/* END 10: the other rows look like a cache the app could not refresh (grey, at once), not a fade */
.hj-e10 .cx-row:not([data-who="母"]), .hj-e10 .cx-date { opacity: 0.5; filter: grayscale(1); }
.hj-rd { color: #d6cfc0; }

/* ---- records: the branch map and 分岐へ戻る ---- */
.rec-map { display: flex; flex-direction: column; gap: 12px; }
.mp-common { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.mp-node { display: inline-flex; flex-direction: column; padding: 4px 8px; border-radius: 8px; border: 1px dashed var(--cx-line, #343a41); font-size: 0.8em; color: #aab0b6; }
.mp-node small { font-size: 0.9em; }
.mp-node.seen { color: #e8e4dc; border-style: solid; border-color: var(--cx-accent, #7fb09d); }
.mp-arrow { color: #aab0b6; font-style: normal; }
.mp-routes { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.mp-route { padding: 8px; border-radius: 10px; border: 1px solid var(--cx-line, #343a41); display: flex; flex-direction: column; gap: 6px; }
.mp-rhead { font-size: 0.8em; opacity: 0.85; }
.mp-end { display: flex; flex-direction: column; font-size: 0.78em; color: #aab0b6; padding: 4px 8px; border-radius: 6px; border: 1px dashed var(--cx-line, #343a41); }
.mp-end span { font-size: 1.1em; font-family: 'Zen Old Mincho', serif; }
.mp-end.got { color: #e8e4dc; border-style: solid; }
.br-h { margin: 6px 0 0; font-size: 0.95em; }
.br-list { display: flex; flex-direction: column; gap: 6px; max-height: 40vh; overflow-y: auto; }
.br-row { font: inherit; text-align: left; display: grid; grid-template-columns: 3em minmax(0, 1fr); gap: 0 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--cx-line, #343a41); background: transparent; color: inherit; cursor: pointer; }
.br-row .no { grid-row: span 2; opacity: 0.7; font-size: 0.8em; align-self: center; }
.br-row small { opacity: 0.75; font-size: 0.78em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.br-row:hover, .br-row:focus-visible { border-color: var(--cx-accent, #7fb09d); }

/* the tab bar between the group and the 1:1 talk appears when that talk opens (END 01 / 02) */
.cx-app:not(.hj-thread) .cx-tabs { display: none; }

/* text colours that the shared CSS fixes for another skin: on this night skin they are set here (rule U30) */
.cx-app[data-chat-skin="henji"] .cx-chip { color: #e8e4dc; }
.cx-app[data-chat-skin="henji"] .cx-new { background: #c23a40; color: #fff; }
.cx-app[data-chat-skin="henji"] .cx-end-dots span { opacity: 0.9; }
.cx-app[data-chat-skin="henji"] .cx-end-dots span.on { color: #0e1512; }
.cx-app[data-chat-skin="henji"] .cx-gal-off { color: #aab0b6; }
.cx-app[data-chat-skin="henji"] .cx-x { color: #e8e4dc; }
.sc-meta { color: #5c6269; }
.sc-head em { color: #555b62; }

/* the confirmation sheet of the operations that end the talk */
.hj-cf-h { margin: 0 0 8px; font-size: 1.05em; }
.hj-cf-t { margin: 0 0 14px; line-height: 1.7; font-size: 0.92em; }
.hj-cf-b { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.hj-cf-b .cx-btn { min-height: 44px; padding: 8px 18px; }
.hj-cf-ok.danger { background: #8a3a32; border-color: #8a3a32; color: #fff; }

/* a phone held sideways: the whole height is the talk, the choices are compact */
@media (max-height: 480px) {
  #stage { top: 0; bottom: 0; border-radius: 0; border: 0; box-shadow: none; max-width: none; }
  .cx-app[data-chat-skin="henji"] .cx-choice { padding-top: 6px; padding-bottom: 6px; min-height: 44px; }
  .cx-app[data-chat-skin="henji"] .cx-choices { gap: 6px; padding-top: 6px; padding-bottom: 6px; }
}

/* title on a short landscape screen: tighter, the start button stays in view */
@media (max-height: 480px) {
  .cxt-box { padding: 12px 16px 14px; gap: 6px; }
  .cxt-logo { font-size: 1.9em; }
  .cxt-lead { margin: 0; font-size: 0.95em; line-height: 1.5; }
  .cxt-text { font-size: 0.78em; line-height: 1.5; }
  .cxt-btn { padding: 9px; }
  .cxt-actions { gap: 6px; }
}

/* ---- phones: text readable (rule A12, feedback 2026-11-04 「携帯でダイアログが小さく文字が見えない」). Short side < 500 px:
   no text under 14 px (badges and dots in fixed circles excepted), the text base 17 px. ---- */
@media (max-height: 499px), (max-width: 499px) {
  .cx-app, .cxt { font-size: calc(17px * var(--fs, 1)); }
  .wm-layer { font-size: calc(17.7px * var(--fs, 1)); }
  .cx-sub { font-size: max(14px, 0.75em); }
  .cx-hbtn { font-size: max(14px, 0.8em); }
  .cx-name { font-size: max(14px, 0.75em); }
  .cx-meta { font-size: max(14px, 0.66em); }
  .cx-sys span, .cx-date span { font-size: max(14px, 0.78em); }
  .cx-act-note span { font-size: max(14px, 0.78em); }
  .cx-after-date { font-size: max(14px, 0.75em); }
  .cx-summary-k, .cx-end-k { font-size: max(14px, 0.75em); }
  .cx-cap { font-size: max(14px, 0.78em); }
  .cx-ph .cx-ph-k { font-size: max(14px, 0.85em); }
  .cx-play { font-size: max(14px, 0.8em); }
  .cx-dur { font-size: max(14px, 0.75em); }
  .cx-trans { font-size: max(14px, 0.78em); }
  .cx-file-k { font-size: max(14px, 0.7em); }
  .cx-prompt { font-size: max(14px, 0.75em); }
  .cx-banner { font-size: max(14px, 0.85em); }
  .cx-sheet-sub { font-size: max(14px, 0.85em); }
  .cx-gal li p { font-size: max(14px, 0.85em); }
  .cx-gal-k { font-size: max(14px, 0.72em); }
  .cx-retry { font-size: max(14px, 0.72em); }
  .cx-broken .cx-ph-k { font-size: max(14px, 0.8em); }
  .rn-cur { font-size: max(14px, .85em); }
  .rn-date { font-size: max(14px, .85em); }
  .rn-new { font-size: max(14px, .7em); }
  .rn-chip { font-size: max(14px, .75em); }
  .cx-datechip { font-size: max(14px, 0.75em); }
  .cx-newpill { font-size: max(14px, 0.8em); }
  .cx-nf-main span { font-size: max(14px, 0.86em); }
  .cx-unread { font-size: max(14px, 0.75em); }
  .cx-skipbtn { font-size: max(14px, 0.8em); }
  .cx-note { font-size: max(14px, 0.78em); }
  .cx-st-word { font-size: max(14px, 0.8em); }
  .cx-callrec span:last-child { font-size: max(14px, 0.85em); }
  .cx-cs-app { font-size: max(14px, 0.8em); }
  .cx-cs-btn { font-size: max(14px, 0.85em); }
  .cx-pf-status { font-size: max(14px, 0.85em); }
  .cx-pf-you { font-size: max(14px, 0.82em); }
  .cx-rtab { font-size: max(14px, 0.85em); }
  .cx-ph-cap { font-size: max(14px, 0.75em); }
  .cx-empty { font-size: max(14px, 0.85em); }
  .cx-gal-group { font-size: max(14px, 0.8em); }
  .cx-end-progress { font-size: max(14px, 0.85em); }
  .cx-h-main i { font-size: max(14px, 0.78em); }
  .cx-h-main span { font-size: max(14px, 0.86em); }
  .cx-h-side { font-size: max(14px, 0.78em); }
  .cx-h-hint { font-size: max(14px, 0.85em); }
  .cxt-kicker { font-size: max(14px, 0.82em); }
  .cxt-info { font-size: max(14px, 0.82em); }
  .cxt-points { font-size: max(14px, 0.86em); }
  .cxt-notice { font-size: max(14px, 0.76em); }
  .cxt-loading { font-size: max(14px, 0.85em); }
  .cx-text-skip { font-size: max(14px, 0.85em); }
  .cx-v-cap { font-size: max(14px, 0.86em); }
  .cx-post-h { font-size: max(14px, 0.78em); }
  .cx-call-state { font-size: max(14px, 0.8em); }
  .cx-wg-card span { font-size: max(14px, 0.82em); }
  .cx-text-place { font-size: max(14px, 0.78em); }
  .cx-hbtn.cx-hicon { font-size: max(14px, 0.85em); }
  .cx-missing { font-size: max(14px, 12px); }
  .cx-end-cap { font-size: max(14px, 0.78em); }
  .cx-tcnt { font-size: max(14px, 0.78em); }
  .cx-tsearch .cx-ttxt { font-size: max(14px, 0.82em); }
  .cx-rx { font-size: max(14px, 0.78em); }
  .cx-pact button { font-size: max(14px, 0.82em); }
  .cx-you { font-size: max(14px, 0.72em); }
  .cm-note { font-size: max(14px, 0.82em); }
  .cx-lib-mt span { font-size: max(14px, 0.8em); }
  .cx-lib-menu small { font-size: max(14px, 0.74em); }
  .cx-h-prev { font-size: max(14px, 0.86em); }
  .cx-h-prog { font-size: max(14px, 0.82em); }
  .cx-lib-tabs button { font-size: max(14px, 0.82em); }
  .cx-lib-sec { font-size: max(14px, 0.78em); }
  .cx-lib-foot { font-size: max(14px, 0.74em); }
  .cx-lib-nav button { font-size: max(14px, 0.7em); }
  .cx-lib-fsec { font-size: max(14px, 0.78em); }
  .cx-lib-rhead small { font-size: max(14px, 0.78em); }
  .cx-lib-rec li { font-size: max(14px, 0.85em); }
  .cx-lib-tag { font-size: max(14px, 0.7em); }
  .cx-lib-toast { font-size: max(14px, 0.85em); }
  .hj-cmp > div { font-size: max(14px, 0.82em); }
  .sc-status { font-size: max(14px, 0.72em); }
  .sc-head em { font-size: max(14px, 0.86em); }
  .sc-day span { font-size: max(14px, 0.74em); }
  .sc-c small { font-size: max(14px, 0.7em); }
  .sc-meta { font-size: max(14px, 0.6em); }
  .sc-field { font-size: max(14px, 0.8em); }
  .sc.last .sc-day span { font-size: max(14px, 0.66em); }
  .sq-lab { font-size: max(14px, 0.66em); }
  .sq-who { font-size: max(14px, 0.7em); }
  .sc-menu { font-size: max(14px, 0.7em); }
  .mp-node { font-size: max(14px, 0.8em); }
  .mp-rhead { font-size: max(14px, 0.8em); }
  .mp-end { font-size: max(14px, 0.78em); }
  .br-row .no { font-size: max(14px, 0.8em); }
  .br-row small { font-size: max(14px, 0.78em); }
  .cxt-text { font-size: max(14px, 0.78em); }
}
