/* 黄昏とのメッセージ画面。DMアプリ風の一枚画面 */

.chat-body { background: #0a0d11; }

.chat {
  width: min(600px, 100%);
  min-height: 100vh;
  margin: auto;
  display: flex;
  flex-direction: column;
  border-inline: 1px solid var(--line);
  background: #0d1117;
}

.chat-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .9rem 1rem;
  border-bottom: 1px solid var(--line);
  background: #0d1117ee;
  backdrop-filter: blur(6px);
}
.chat-head .avatar { width: 36px; height: 36px; }
.chat-head .who { display: flex; flex-direction: column; line-height: 1.3; }
.chat-head .handle { color: var(--muted); font-size: .8rem; }
.chat-head .status { color: #7fb3a0; font-size: .75rem; margin-top: .15rem; }
.chat-head .status.off { color: #a08080; }
.chat-head .reset { margin-left: auto; }
.chat-head .reset .linklike { font-size: 1.1rem; }

.pinned {
  padding: 1rem;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .6rem;
  background: #0b0f14;
}
.tweet {
  min-width: 0;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: .8rem .9rem;
  font-size: .85rem;
  background: var(--panel);
}
.bubble { overflow-wrap: anywhere; }
.tweet.quoted { margin-left: 1.5rem; opacity: .85; }
.tweet-head { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .78rem; margin-bottom: .3rem; }
.tweet-head b { color: var(--ink); }
.tweet-head .avatar { width: 22px; height: 22px; }
.tweet-head time { margin-left: auto; }
.tweet p { margin: 0; line-height: 1.7; }
.tweet .media { display: inline-block; margin-top: .5rem; padding: .3rem .6rem; border: 1px solid var(--line); border-radius: 3px; color: var(--blue); font-size: .78rem; }

.thread {
  flex: 1;
  padding: 1.2rem 1rem 2rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.bubble {
  max-width: 85%;
  padding: .7rem 1rem;
  border-radius: 14px;
  line-height: 1.75;
  font-size: .95rem;
  white-space: normal;
}
.bubble.them {
  align-self: flex-start;
  background: #182028;
  border-bottom-left-radius: 4px;
}
.bubble.me {
  align-self: flex-end;
  background: #24405a;
  border-bottom-right-radius: 4px;
  position: relative;
}
.bubble.me .read {
  position: absolute;
  left: -2.4rem;
  bottom: .2rem;
  font-size: .68rem;
  color: var(--muted);
}
.bubble.file { display: grid; gap: .4rem; }
.bubble.file audio { width: min(320px, 70vw); }
.file-name { color: var(--blue); font-size: .85rem; }
.file-missing { color: var(--muted); font-size: .78rem; }

.chip {
  display: inline-block;
  padding: .35rem .8rem;
  border: 1px solid var(--blue);
  border-radius: 999px;
  color: var(--blue);
  font-size: .85rem;
}
.chip-url { display: block; color: var(--muted); font-size: .72rem; margin-top: .2rem; }
.thread > .chip { align-self: center; margin-top: .5rem; }

.sys {
  align-self: center;
  text-align: center;
  color: var(--muted);
  font-size: .8rem;
  margin: .8rem 0 0;
}
.sys.small { font-size: .72rem; }

.countdown {
  align-self: center;
  font-size: 2rem;
  font-weight: 300;
  letter-spacing: .1em;
  color: var(--blue);
  margin: .2rem 0 0;
  font-variant-numeric: tabular-nums;
}

.composer {
  position: sticky;
  bottom: 0;
  border-top: 1px solid var(--line);
  background: #0d1117;
  padding: .8rem 1rem;
  display: grid;
  gap: .5rem;
}
.compose { display: flex; gap: .5rem; }
.compose input {
  flex: 1;
  background: #0e141b;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  padding: .6rem 1rem;
}
.compose button { border-radius: 999px; padding: .5rem 1.1rem; }
.composer-off { margin: 0; color: var(--muted); font-size: .85rem; text-align: center; padding: .4rem 0; }
.close-link { color: var(--blue); font-size: .85rem; text-align: center; }
.site-link { color: var(--muted); font-size: .78rem; text-align: right; }

@media (max-width: 600px) {
  .chat { border-inline: 0; }
  .bubble { max-width: 92%; }
  .bubble.me .read { display: none; }
}

/* 進行モードの選択 (初回) */
.mode-choose { align-items: stretch; }
.mode-choose h2 { font-weight: 300; font-size: 1.3rem; text-align: center; margin: 1rem 0 0; }
.mode-form { display: grid; gap: .7rem; margin-top: 1rem; }
.mode-form button { text-align: left; padding: .9rem 1.1rem; border-radius: 10px; background: #111820; display: grid; gap: .2rem; }
.mode-form button b { font-weight: 500; }
.mode-form button small { color: var(--muted); line-height: 1.6; }
