/* 決め処 — diner wall with a kinari-and-indigo ticket machine (3_画面.md).
   Phone first: the app is one column, full height. On a wide screen it stays phone-width in the middle.
   Day/night only changes the wall, the beam and the small text on the wall (body.night). */

[hidden] { display: none !important; }

:root {
  /* wall */
  --wall: #efe4c8;
  --wall-line: rgba(120, 90, 40, .05);
  --note: #6a5a44;
  --beam: #5a3a21;
  --outside: #3b2a1c;
  /* paper and accents */
  --plate: #5a3a21;
  --plate-ink: #f6e7c8;
  --paper: #fcf8ee;
  --paper-edge: #e0d5bd;
  --ink: #231d17;
  --red: #b3302a;
  --noren: #1e3256;
  --board: #e6cf9f;
  --board-edge: #6b4a2b;
  --board-ink: #2a1d12;
  --string: #4a3624;
  /* ticket machine */
  --steel-0: #e6e2da;
  --steel: #d9d4ca;
  --steel-2: #bdb6a9;
  --led-bg: #26292e;
  --led: #e2a465;
  --kinari: #efe7d6;
  --kinari-2: #e2ddd2;
  --btn-ink: #2e2820;
  --btn-edge: rgba(60, 48, 32, .18);
  --ai: #33415a;
  --ai-ink: #ffffff;
  /* type */
  --f-brush: 'Yuji Syuku', 'Hiragino Mincho ProN', 'Yu Mincho', serif;
  --f-body: 'Zen Kaku Gothic New', system-ui, -apple-system, 'Hiragino Sans', 'Yu Gothic', sans-serif;
  --f-led: ui-monospace, Consolas, 'Courier New', monospace;
}
body.night {
  --wall: #2d2822;
  --wall-line: rgba(255, 236, 200, .04);
  --note: #cbbd9c;
  --beam: #20160d;
  --outside: #15120f;
  --string: #8a7356;
}

html, body { height: 100%; }
body {
  margin: 0;
  background: var(--outside);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }

.app {
  position: relative;
  height: 100%;
  max-width: 480px;
  margin: 0 auto;
  overflow: hidden;
  background: repeating-linear-gradient(0deg, var(--wall-line) 0 1px, transparent 1px 44px), var(--wall);
  transition: background-color .4s;
}
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top, 0px);
}
.vt { writing-mode: vertical-rl; }

/* ---------- wall parts ---------- */
.beam { flex: 0 0 auto; height: 12px; background: var(--beam); box-shadow: 0 3px 0 rgba(0, 0, 0, .12); }
.plate {
  align-self: center;
  background: var(--plate);
  color: var(--plate-ink);
  font-size: 13px;
  letter-spacing: .3em;
  padding: 4px 14px 4px 18px;
  border-radius: 0 0 4px 4px;
  white-space: nowrap;
}
.plate.red {
  background: var(--red);
  color: #fff;
  font-family: var(--f-brush);
  font-size: 21px;
  letter-spacing: .12em;
  padding: 4px 20px 6px;
}
.note { font-size: 12px; color: var(--note); text-align: center; padding: 0 20px; }
.text-btn {
  background: none;
  border: 0;
  padding: 8px;
  color: var(--note);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* tanzaku: vertical paper strips hung from the beam */
.tz-row { display: flex; flex-direction: row-reverse; justify-content: center; align-items: flex-start; gap: 8px; padding: 0 10px; }
.tz {
  writing-mode: vertical-rl;
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  box-shadow: 0 2px 0 rgba(0, 0, 0, .08);
  font-family: var(--f-brush);
  color: var(--ink);
  padding: 10px 4px 8px;
}
.tz small { font-family: var(--f-body); font-size: 10px; color: var(--red); }
/* min-height, not height: a long word (おやつ・つまみ, 中東・アフリカの伝統料理) makes the strip longer instead of wrapping into a 2nd column */
.tz-past { display: flex; justify-content: space-between; align-items: center; gap: 6px; width: 28px; min-height: 96px; font-size: 13px; white-space: nowrap; opacity: .85; }
.tz-past.decided { border: 2px solid var(--red); opacity: 1; }
.tz-q {
  height: clamp(210px, 40dvh, 290px);
  padding: 12px 8px;
  line-height: 1.25;
  border-top: 4px solid var(--red);
  animation: hang .35s ease-out;
}
.tz-q .no { display: block; font-family: var(--f-body); font-size: 13px; color: var(--red); margin-left: 6px; }
.tz-q.check { border-top-color: var(--ai); }
.tz-q.check .no { color: var(--ai); font-weight: 700; }
.tz-q .s { display: block; font-size: 17px; margin-left: 4px; }
.tz-q .big { display: block; line-height: 1.15; margin-left: 4px; }
.tz-q .col { display: block; margin-left: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tz-q .low { padding-top: 6em; }
@keyframes hang { from { transform: translateY(-14px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- ticket machine ---------- */
.machine {
  margin: auto 14px 0;
  background: linear-gradient(180deg, var(--steel-0), var(--steel) 40%, var(--steel-2));
  border-radius: 12px 12px 0 0;
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .7), 0 -2px 0 rgba(0, 0, 0, .08);
}
.led {
  background: var(--led-bg);
  color: var(--led);
  font-family: var(--f-led);
  font-size: 12px;
  letter-spacing: .1em;
  padding: 5px 8px;
  border-radius: 3px;
  text-align: center;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn {
  min-height: 52px;
  border-radius: 6px;
  border: 1px solid var(--btn-edge);
  background: var(--kinari);
  color: var(--btn-ink);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.25;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .08), 0 1px 1px rgba(0, 0, 0, .12);
  transition: transform .08s, filter .08s;
}
.btn small { font-size: 11px; font-weight: 500; opacity: .75; margin-top: 2px; }
.btn.soft { background: var(--kinari-2); font-size: 15px; min-height: 42px; }
.btn.ai { background: var(--ai); color: var(--ai-ink); border-color: var(--ai); }
.btn.wide { grid-column: 1 / -1; }
.btn:active, .btn.pressed { transform: translateY(2px); filter: brightness(.94); box-shadow: inset 0 3px 6px rgba(0, 0, 0, .28); }
.btn:disabled { opacity: .45; cursor: default; }
.btn:focus-visible, .text-btn:focus-visible, .tz-btn:focus-visible, .avoid-btn:focus-visible { outline: 3px solid var(--ai); outline-offset: 2px; }
.tray { align-self: center; width: 130px; height: 16px; border-radius: 4px; background: #2f3237; box-shadow: inset 0 2px 4px rgba(0, 0, 0, .7); position: relative; }
.ticket-out {
  position: absolute;
  left: 50%;
  bottom: 5px;
  transform: translateX(-50%);
  min-width: 66px;
  padding: 0 6px;
  height: 18px;
  background: #fff;
  border: 1px solid #ddd;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  white-space: nowrap;
  animation: issue .3s ease-out;
}
@keyframes issue { from { transform: translate(-50%, 14px); } to { transform: translate(-50%, 0); } }

/* ---------- 1. entrance: a wooden sign hanging from the beam on two strings ---------- */
.sign { flex: 0 0 auto; padding-top: 18px; }
.sign-hang { position: relative; height: 150px; transform-origin: top center; animation: sway 6s ease-in-out infinite alternate; }
.sign-hang::before, .sign-hang::after { content: ""; position: absolute; top: 0; width: 2px; height: 44px; background: var(--string); transform-origin: top; }
.sign-hang::before { left: calc(50% - 90px); transform: rotate(-12deg); }
.sign-hang::after { right: calc(50% - 90px); transform: rotate(12deg); }
.sign-board {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  width: 250px;
  height: 104px;
  background: var(--board);
  border: 3px solid var(--board-edge);
  border-radius: 4px;
  box-shadow: inset 0 0 0 4px var(--board), inset 0 0 0 5px rgba(107, 74, 43, .5), 0 4px 8px rgba(0, 0, 0, .2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--board-ink);
}
.sign-sub { font-size: 13px; letter-spacing: .5em; padding-left: .5em; }
.sign-title { font-family: var(--f-brush); font-size: 46px; line-height: 1.1; margin: 0; font-weight: 400; }
@keyframes sway { from { transform: rotate(-.8deg); } to { transform: rotate(.8deg); } }
.entrance .menu-beam { margin-top: 6px; }
.entrance .tz { width: 32px; height: 120px; font-size: 16px; display: flex; align-items: center; }
.greet { margin-top: 14px; }

/* ---------- 相席: notices on the wall, codes, pasting ---------- */
.group .beam, .host .beam, .join .beam, .sendback .beam, .collect .beam { margin-top: 18px; }
.bill {
  margin: 22px 22px 0;
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  box-shadow: 0 3px 8px rgba(60, 40, 10, .12);
  padding: 16px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}
.bill .big { font-family: var(--f-brush); font-size: 27px; line-height: 1.35; margin: 0; }
.bill .s { font-size: 12px; line-height: 1.7; color: #4a3f33; margin: 0; }
.bill .num { font-family: var(--f-brush); font-size: 64px; line-height: 1; margin: 0; }
.bill .num span { font-size: 20px; margin-left: 4px; }
.code { font-family: var(--f-led); font-size: 13px; background: #fff; border: 1px dashed var(--paper-edge); padding: 4px 8px; margin: 0; user-select: all; word-break: break-all; max-width: 100%; }
.code-input { width: 100%; box-sizing: border-box; font: 15px var(--f-led); padding: 8px 10px; border: 1px solid var(--paper-edge); border-radius: 4px; background: #fff; color: var(--ink); }
.code-input:focus-visible, .paste textarea:focus-visible { outline: 3px solid var(--ai); outline-offset: 1px; }
.error { color: var(--red); font-size: 12px; margin: 0; min-height: 1.4em; }
.tickets { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.tickets i { font-style: normal; width: 30px; height: 18px; background: #fff; border: 1px solid #ddd; border-left: 3px solid var(--ai); font-size: 10px; display: flex; align-items: center; justify-content: center; color: var(--ink); }
.paste { margin: 10px 22px 0; display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--note); }
.paste textarea { font: 12px var(--f-led); padding: 6px 8px; border: 1px solid var(--paper-edge); border-radius: 4px; background: var(--paper); color: var(--ink); resize: vertical; }
.paste .text-btn { align-self: flex-end; padding: 2px 4px; }
.host .toast, .sendback .toast { margin-top: 8px; }

/* ---------- regional edition: region list ---------- */
.region-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 20px 16px 8px; overflow-y: auto; }
.region-btn {
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: 4px;
  padding: 12px 4px 10px;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .06);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--ink);
}
.region-btn b { font-family: var(--f-brush); font-weight: 400; font-size: 22px; line-height: 1.2; }
.region-btn small { font-size: 11px; color: #6a5a44; }
.region-btn:focus-visible { outline: 3px solid var(--ai); outline-offset: 2px; }
.welcome { margin-top: 12px; font-size: 14px; }

/* ---------- 10. dislikes ---------- */
.avoid-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 18px 16px 6px; overflow-y: auto; }
.avoid-btn {
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .06);
  position: relative;
}
.avoid-btn[aria-pressed="true"] { border: 2px solid var(--red); padding: 7px 11px; text-decoration: line-through; text-decoration-color: var(--red); }
.avoid-btn[aria-pressed="true"]::after {
  content: "外す";
  position: absolute;
  top: -8px;
  right: -6px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  padding: 0 4px;
  border-radius: 2px;
  text-decoration: none;
}
.avoid .note { margin-top: 6px; }

/* ---------- 2/3/5. question and order check share the layout ---------- */
.q-top { flex: 0 0 auto; }

/* ---------- 4. decided ---------- */
.region .beam, .avoid .beam, .ask .beam, .decided .beam, .shortlist .beam, .records .beam { margin-top: 18px; }
.ticket {
  margin: 24px auto 0;
  width: min(250px, 80%);
  min-height: 190px;
  background: #fff;
  border-radius: 3px;
  display: flex;
  box-shadow: 0 6px 14px rgba(60, 40, 10, .18);
  animation: hang .35s ease-out;
}
.ticket-stub { width: 40px; background: #f5d9d3; border-right: 2px dashed #d7b1a9; display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--red); letter-spacing: .1em; }
.ticket-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 16px 8px; position: relative; text-align: center; }
.ticket-main .s { font-size: 13px; margin: 0; }
.ticket-main .big { font-family: var(--f-brush); line-height: 1.2; margin: 0; word-break: keep-all; overflow-wrap: anywhere; }
.stamp {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--red);
  color: var(--red);
  font-family: var(--f-brush);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.others { margin-top: 14px; font-size: 12px; color: var(--note); text-align: center; padding: 0 16px; }
.others button { background: none; border: 0; padding: 2px 4px; color: var(--note); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 12px; }
.acts { margin: auto 16px calc(14px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 8px; }
.acts .btn { font-size: 16px; min-height: 50px; }
.acts .btns .btn { font-size: 14px; min-height: 44px; }
.acts .text-btn { align-self: center; }
.toast { text-align: center; font-size: 12px; color: var(--note); min-height: 1.6em; }

/* ---------- 6. shortlist ---------- */
.shortlist .tz-row { margin-top: 12px; gap: 10px; }
.tz-btn {
  writing-mode: vertical-rl;
  width: 62px;
  height: clamp(200px, 38dvh, 250px);
  font-size: 23px;
  padding: 10px 4px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 6px;
  position: relative;
  cursor: pointer;
}
.tz-btn small { font-family: var(--f-brush); font-size: 14px; }
.tz-btn.top { border: 3px solid var(--red); padding-bottom: 56px; }
.tz-btn .mark {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  writing-mode: horizontal-tb;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--red);
  color: var(--red);
  font-family: var(--f-body);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}
.shortlist .note { margin-top: 12px; }

/* ---------- test records (only while testing with family) ---------- */
.records-body { margin: 16px; padding: 14px; background: var(--paper); border: 1px solid var(--paper-edge); overflow-y: auto; font-size: 13px; display: flex; flex-direction: column; gap: 10px; }
.records-body dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; }
.records-body dt { color: #6a5a44; }
.records-body dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.records-body ol { margin: 0; padding-left: 1.4em; display: flex; flex-direction: column; gap: 2px; }
.records-body textarea { width: 100%; box-sizing: border-box; min-height: 120px; font: 12px var(--f-led); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- consent line under the ticket buttons (step 6) ---------- */
.consent { font-size: 11px; line-height: 1.5; color: #4a4338; text-align: center; margin: 0; }
.consent a { color: var(--ai); }

/* ---------- nothing fitted: what did you want? (step 6, 7_育てる.md) ---------- */
.wish .beam { margin-top: 18px; }
.wish .bill { gap: 10px; }
.wish-input { font-family: var(--f-body); font-size: 17px; text-align: center; }
.wish .toast { margin-top: 8px; }

/* ---------- 意見箱 and お返事 (step 6: a contact point that never asks who you are) ---------- */
.entrance .links { display: flex; justify-content: center; flex-wrap: wrap; gap: 0 18px; }
.inbox .beam, .replies .beam { margin-top: 18px; }
.inbox .bill { margin-top: 16px; gap: 6px; }
.inbox .bill .big { font-size: 24px; }
.note-input { width: 100%; box-sizing: border-box; font: 15px/1.6 var(--f-body); padding: 8px 10px; border: 1px solid var(--paper-edge); border-radius: 4px; background: #fff; color: var(--ink); resize: none; }
.note-input:focus-visible, .code-input:focus-visible { outline: 3px solid var(--ai); outline-offset: 1px; }
.count { align-self: flex-end; font-size: 11px; color: #6a5a44; margin: 0; font-variant-numeric: tabular-nums; }
.replies .toast { margin: 10px 16px 0; }
.replies-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 8px 16px; display: flex; flex-direction: column; gap: 10px; }
.reply-card { background: var(--paper); border: 1px solid var(--paper-edge); box-shadow: 0 2px 6px rgba(60, 40, 10, .1); padding: 10px 12px; font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.reply-card .head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.reply-card .num { font-family: var(--f-led); font-size: 13px; letter-spacing: .04em; user-select: all; }
.reply-card .when { font-size: 11px; color: #6a5a44; }
.reply-card .mine { color: #4a3f33; margin: 0; overflow-wrap: anywhere; }
.reply-card .answer { margin: 0; padding: 8px 10px; background: #fff; border-left: 3px solid var(--ai); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.reply-card .wait { margin: 0; color: #6a5a44; }
.replies .paste { margin-top: 4px; }
.replies-empty { text-align: center; color: var(--note); font-size: 12px; margin: 16px 0; }
