* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #f5f3ee; color: #1b1b1d; touch-action: manipulation;
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Noto Sans CJK JP", "Yu Gothic", sans-serif;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
#app { position: fixed; inset: 0; display: flex; flex-direction: column; max-width: 520px; margin: 0 auto; }
#hud { height: 62px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; }
#ask b { font-size: 15px; display: block; }
#ask p { margin: 1px 0 4px; font-size: 12px; color: #45433e; }
#left { display: flex; gap: 4px; }
#left i { width: 9px; height: 9px; border: 2px solid #1b1b1d; display: block; }
#left i.on { background: #1b1b1d; }
#next { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #6f6c64; }
#next b { color: #1b1b1d; font-size: 15px; border: 2px solid #1b1b1d; padding: 2px 8px; background: #fff; min-width: 4.5em; text-align: center; }
#next.off { visibility: hidden; }
#stage { position: relative; flex: 1; min-height: 0; }
#c { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hint { position: absolute; left: 0; right: 0; bottom: 18%; margin: 0; text-align: center; font-weight: 700; font-size: 17px; pointer-events: none;
  animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }
.rain { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); margin: 0; font-weight: 700; font-size: 14px; color: #fff;
  background: #d23a2c; padding: 4px 12px; white-space: nowrap; pointer-events: none; }
.rain[hidden] { display: none; }
/* the day so far: one line per thing the family did, the newest at the bottom */
#cap { flex: none; height: clamp(120px, 30vh, 230px); margin: 0; padding: 6px 16px 12px; list-style: none; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end; font-size: 15px; line-height: 1.4;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 34px); mask-image: linear-gradient(to bottom, transparent 0, #000 34px); }
#cap li { display: flex; gap: 10px; color: #8d8a82; padding: 1px 0; }
#cap li b { font-variant-numeric: tabular-nums; min-width: 3.2em; flex: none; }
#cap li:last-child { color: #1b1b1d; font-weight: 700; animation: cap-in .25s ease-out; }
#cap li:last-child b { color: #d23a2c; }
#cap[hidden] { display: none; }
@keyframes cap-in { from { opacity: 0; transform: translateY(8px); } }

.panel { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(245,243,238,.9); overflow-y: auto; padding: 16px; z-index: 10; }
.panel[hidden] { display: none; }
.box { width: 100%; max-width: 360px; text-align: center; margin: auto; }
.box.wide { max-width: 640px; }
h1 { font-size: 56px; letter-spacing: 8px; margin: 0 0 4px; }
.sub { margin: 0 0 28px; font-size: 16px; }
button, .button { font: inherit; font-size: 16px; font-weight: 700; color: #1b1b1d; background: #fff; border: 2px solid #1b1b1d; border-radius: 0;
  padding: 10px 18px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
button.primary { background: #1b1b1d; color: #fff; }
button.big { width: 100%; padding: 14px; font-size: 18px; margin-top: 12px; }
.button.x svg { width: 16px; height: 16px; }
.row { display: flex; gap: 10px; justify-content: center; margin-top: 14px; }
.row > * { flex: 1; }
#r-theirs button:not(.big) { width: 100%; margin-top: 10px; }
#r-after { margin-top: 18px; }
#result { background: #f5f3ee; padding: 12px; }
#hud.off { visibility: hidden; }
#sheet { background: #fbfaf6; border: 3px solid #1b1b1d; padding: 12px 14px 10px; text-align: left; }
.f-top { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 19px; }
.f-new { background: #d23a2c; color: #fff; font-weight: 700; font-size: 14px; padding: 3px 8px; }
#f-head { margin: 8px 0 4px; color: #d23a2c; font-weight: 700; font-size: 21px; line-height: 1.35; }
#plan { width: 100%; height: clamp(150px, 36vh, 330px); display: block; }
.f-spec { margin: 4px 0 0; display: flex; align-items: baseline; gap: 6px; border-top: 2px solid #1b1b1d; padding-top: 6px; }
.f-spec b:first-child { font-size: 26px; margin-right: 10px; }
.f-spec span { font-size: 13px; }
.f-spec .red { color: #d23a2c; font-size: 28px; }
/* 長い間取り（リビングの雨の 0LLLLLLDK+ゾウ舎 など）は間取りだけ縮めて折り返し、家賃は横一列のまま */
.f-spec b:first-child { min-width: 0; overflow-wrap: anywhere; }
.f-spec b:first-child.long { font-size: 20px; }
.f-spec span, .f-spec .red { flex: none; white-space: nowrap; }
.f-sub { margin: 0 0 6px; font-size: 13px; color: #45433e; }
#f-bul { list-style: none; margin: 0; padding: 6px 0 0; border-top: 2px solid #1b1b1d; font-size: 14px; line-height: 1.5; }
#f-bul li { padding-left: 1.2em; text-indent: -1.2em; }
#f-bul li::before { content: "●"; color: #d23a2c; margin-right: .2em; }
#f-req { margin: 8px 0 0; font-size: 14px; }
#f-req .ok, #f-req .ng { display: inline-block; border: 2px solid #d23a2c; color: #d23a2c; font-weight: 700; padding: 0 6px; margin-left: 6px; transform: rotate(-6deg); }
@media (max-height: 640px) {
  #f-bul, .f-sub { display: none; }
  #plan { height: 34vh; }
  #f-head { font-size: 18px; margin: 4px 0 2px; }
  #f-req { margin-top: 4px; }
}
#zukan { z-index: 20; background: #f5f3ee; align-items: flex-start; }
.big { font-size: 20px; font-weight: 700; }
button.link { background: none; border: 0; padding: 4px; font-size: 14px; text-decoration: underline; color: #45433e; }
.zk { margin: 12px 0 0; display: flex; justify-content: center; align-items: center; gap: 8px; }
.new { color: #d23a2c; font-weight: 700; font-size: 13px; }
#z-list { list-style: none; padding: 0; margin: 12px 0; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 5px; text-align: left; font-size: 13px; }
#z-list li { border: 2px solid #1b1b1d; background: #fff; padding: 5px 6px; min-height: 46px; font-size: 11px; }
#z-list li b { display: block; font-size: 14px; }
#z-list li.no { border-style: dashed; color: #a9a59b; background: transparent; }
