:root { --ink: #eef1ec; --muted: #a9b8bd; --other: rgba(14, 26, 38, 0.82); --mate: #cfe6df; --mine: #fbf6ea; --accent: #e9c98f; --deep: #0f1a2b; }
* { box-sizing: border-box; min-width: 0; }
html, body { margin: 0; height: 100%; color: var(--ink); background: var(--deep); }
/* 夕暮れの山あい：上は深い藍、下へ明るく、いちばん下に重なった山の影 */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  display: flex; flex-direction: column;
  background:
    url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 400 120%22 preserveAspectRatio=%22none%22%3E%3Cpath d=%22M0 70 L40 52 L80 64 L130 38 L170 58 L220 30 L270 56 L310 44 L360 60 L400 48 L400 120 L0 120Z%22 fill=%22%2322384a%22/%3E%3Cpath d=%22M0 86 L50 70 L95 84 L150 62 L200 82 L250 66 L300 86 L350 72 L400 84 L400 120 L0 120Z%22 fill=%22%23172a3a%22/%3E%3Cpath d=%22M0 102 L60 92 L120 104 L180 94 L240 106 L300 96 L360 104 L400 98 L400 120 L0 120Z%22 fill=%22%230d1b27%22/%3E%3C/svg%3E") bottom / 100% 26vh no-repeat,
    radial-gradient(circle at 82% 9%, rgba(244, 234, 210, 0.22) 0, rgba(244, 234, 210, 0.06) 9vh, transparent 22vh),
    linear-gradient(180deg, #0c1626 0%, #16283c 38%, #2a4652 72%, #4d6766 100%);
}
[hidden] { display: none !important; }
header { padding: calc(14px + env(safe-area-inset-top)) 16px 10px; text-align: center; background: rgba(8, 14, 24, 0.35); border-bottom: 1px solid rgba(255, 255, 255, 0.07); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
h1 { margin: 0; font-size: 22px; letter-spacing: 0.32em; color: #f4ead2; }
.lead { margin: 6px 0 0; font-size: 12px; color: var(--muted); line-height: 1.6; }
.status { margin: 6px 0 0; font-size: 14px; font-variant-numeric: tabular-nums; color: #f4ead2; }
.status:empty { display: none; }
.miss { margin: 8px 12px 0; padding: 8px 12px; border-radius: 12px; background: rgba(255, 170, 150, 0.14); border: 1px solid rgba(255, 170, 150, 0.4); font-size: 13px; text-align: center; }
.answer { margin: 8px 12px 0; padding: 10px 12px; border-radius: 14px; background: rgba(233, 201, 143, 0.1); border: 1px solid rgba(233, 201, 143, 0.4); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.q { margin: 0 0 8px; font-size: 14px; font-weight: 700; }
.nos { display: flex; flex-wrap: wrap; gap: 6px; }
.nos button { min-width: 44px; min-height: 40px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(8, 14, 24, 0.35); color: var(--ink); font: inherit; font-weight: 700; }
.nos button.on { background: var(--accent); color: #1a1a14; border-color: var(--accent); }
.tiny { margin: 6px 0 0; font-size: 11px; color: var(--muted); }
main { flex: 1; overflow-y: auto; padding: 12px 14px 16px; display: flex; flex-direction: column; }
.msg { margin: 0; text-align: center; color: #ffc2b4; font-size: 13px; }
.msg:empty { display: none; }
.log { display: flex; flex-direction: column; gap: 6px; margin-top: auto; }
.line { display: flex; flex-direction: column; align-items: flex-start; }
.line.mine, .line.mate { align-items: flex-end; }
.who { font-size: 11px; color: var(--muted); margin: 0 4px 2px; }
.bub { max-width: 80%; padding: 8px 12px; border-radius: 16px; line-height: 1.5; font-size: 15px; white-space: pre-wrap; word-break: break-word; }
.mine .bub { background: var(--mine); color: #1c1f1a; border-bottom-right-radius: 5px; }
.mate .bub { background: var(--mate); color: #14231f; border-bottom-right-radius: 5px; }
.other .bub { background: var(--other); border: 1px solid rgba(255, 255, 255, 0.08); border-bottom-left-radius: 5px; }
.new { animation: pop 0.35s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.empty { text-align: center; color: var(--muted); font-size: 13px; margin: auto 0; }
.done { flex: 1; overflow-y: auto; padding: 12px; }
.result { margin: 4px 0 6px; font-size: 18px; font-weight: 800; text-align: center; color: #f4ead2; }
.small { margin: 0 0 10px; font-size: 12px; color: var(--muted); text-align: center; line-height: 1.6; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.col { border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 14px; padding: 8px; min-height: 50vh; display: flex; flex-direction: column; background: rgba(8, 14, 24, 0.45); }
.cap { margin: 0 0 6px; font-size: 12px; font-weight: 700; text-align: center; color: var(--muted); }
.col .log { margin-top: 0; }
.col .bub { font-size: 13px; padding: 6px 9px; max-width: 92%; }
.again { display: block; margin: 12px auto 4px; border: none; border-radius: 16px; padding: 8px 16px; font: inherit; font-weight: 700; background: var(--accent); color: #1a1a14; }
footer { padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: rgba(8, 14, 24, 0.55); border-top: 1px solid rgba(255, 255, 255, 0.07); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
form { display: flex; gap: 8px; }
textarea { flex: 1; resize: none; border: none; border-radius: 18px; padding: 10px 14px; font: inherit; font-size: 16px; max-height: 120px; min-height: 42px; background: var(--mine); color: #1c1f1a; outline: none; }
#send { border: none; border-radius: 18px; padding: 0 16px; font: inherit; font-weight: 700; background: var(--accent); color: #1a1a14; }
#send:disabled { opacity: 0.45; }
@media (prefers-reduced-motion: reduce) { .new { animation: none; } }
