/* Shifiverse — Discussion Rooms (Nov 2026). Builds on style.css tokens. */

/* ---- badges (also used in the header note and room notes) ------------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; margin-left: 7px; padding: 2px 8px; border-radius: 999px;
  font: 700 .66rem/1.5 var(--body); letter-spacing: .04em; white-space: nowrap; vertical-align: 1px; cursor: help;
}
.badge-guide { background: var(--lavender); color: #4b3f74; }
.badge-mentor { background: var(--green-soft); color: var(--green-deep); box-shadow: inset 0 0 0 1px #b9cdbf; }
.badge-founder { background: var(--saffron-soft); color: var(--amber-ink); }

/* ---- live dot ------------------------------------------------------------- */
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #b9bdb5; flex: none; }
.live-dot.is-live { background: #2fb36d; box-shadow: 0 0 0 0 rgba(47, 179, 109, .55); animation: sv-pulse 2s infinite; }
@keyframes sv-pulse { 0% { box-shadow: 0 0 0 0 rgba(47, 179, 109, .55); } 70% { box-shadow: 0 0 0 9px rgba(47, 179, 109, 0); } 100% { box-shadow: 0 0 0 0 rgba(47, 179, 109, 0); } }

/* ---- hero ------------------------------------------------------------------ */
.rooms-hero { padding-block: clamp(48px, 7vw, 92px) 34px; }
.rooms-hero .eyebrow { color: var(--green-dark); }
.rooms-hero h1 { margin-bottom: 20px; }
.rooms-hero h1 em { color: var(--green); }
.rooms-lead { max-width: 560px; color: var(--muted); font-size: 1.12rem; line-height: 1.75; margin-bottom: 18px; }
.rooms-honest { max-width: 640px; margin: 0; padding: 12px 16px; border-radius: 14px; background: var(--surface-soft); color: var(--muted); font-size: .9rem; line-height: 1.55; }
.rooms-honest .badge { margin: 0 6px 0 0; }
.rooms-honest a { color: var(--green-dark); text-decoration: underline; text-underline-offset: 3px; }

/* ---- hot topic --------------------------------------------------------------- */
.hot-room {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(24px, 4vw, 56px);
  margin-top: 26px; padding: clamp(26px, 4.5vw, 54px); border-radius: 34px;
  background: var(--green-deep); color: #fff; box-shadow: var(--shadow); transition: box-shadow .3s;
}
.hot-eyebrow { color: var(--saffron-soft); margin-bottom: 16px; }
.hot-flame { color: var(--saffron); margin-right: 4px; }
.hot-room h2 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); margin-bottom: 18px; }
.hot-room h2 a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.hot-prompt { color: var(--light-copy); font-family: var(--serif); font-style: italic; font-size: 1.2rem; line-height: 1.55; margin-bottom: 18px; }
.hot-room .room-counts { color: var(--light-copy); margin-bottom: 24px; }
.hot-room-feed {
  display: flex; flex-direction: column; min-width: 0; padding: 20px 22px; border-radius: 22px;
  background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}
.live-head { display: flex; align-items: center; gap: 9px; margin: 0 0 12px; font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--light-copy); }
.hot-room .mini-feed { gap: 13px; }
.hot-room .mini-msg { color: #fff; font-size: .98rem; }
.hot-room .mini-name { color: var(--saffron-soft); }
.hot-room .mini-empty { color: var(--light-copy); }

/* ---- mini feeds (cards + hot topic) ------------------------------------------ */
.mini-feed {
  list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 9px;
  min-height: 0; -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22px); mask-image: linear-gradient(to bottom, transparent 0, #000 22px);
  padding-top: 14px;
}
.mini-msg {
  font-size: .9rem; line-height: 1.5; color: var(--ink); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  transition: opacity .45s ease, transform .45s ease;
}
.mini-name { font-weight: 700; color: var(--green-dark); }
.mini-msg .badge { margin: 0 2px 0 6px; font-size: .6rem; padding: 1px 6px; }
.mini-text { color: inherit; }
.mini-empty { margin: 14px 0 0; color: var(--muted); font-size: .92rem; font-style: italic; }
.is-entering { opacity: 0; transform: translateY(10px); }

/* ---- room grid ------------------------------------------------------------- */
.rooms-grid-wrap { padding-block: clamp(48px, 7vw, 84px) 10px; }
.rooms-grid-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.rooms-grid-head h2 { margin: 0; font-size: clamp(1.8rem, 3vw, 2.4rem); }
.rooms-grid-head p { margin: 0; color: var(--muted); font-size: .95rem; }
.rooms-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 20px; }
.room-card {
  position: relative; display: flex; flex-direction: column; min-width: 0; padding: 24px 24px 20px; border: 1px solid var(--line);
  border-radius: 24px; background: var(--paper); cursor: pointer; transition: box-shadow .25s, transform .25s, border-color .25s;
}
.room-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.room-card:focus-within { border-color: var(--green); }
.room-card.just-spoke { border-color: #9cc7ae; }
.room-card.is-locked { background: var(--surface-soft); }
.room-card-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.room-forum { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--green-dark); }
.room-card h3 { margin: 0; font-size: 1.28rem; line-height: 1.3; letter-spacing: -.02em; }
.room-link:hover { color: var(--green-dark); }
.room-link:focus-visible { outline: 3px solid var(--green-soft); outline-offset: 3px; border-radius: 4px; }
.room-card .mini-feed { flex: 1; margin-top: 4px; }
.room-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: .86rem; }
.room-enter { display: inline-flex; align-items: center; gap: 8px; color: var(--green-dark); font-weight: 650; }
.room-enter .icon { width: 16px; height: 16px; }

.live-pill { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px; border-radius: 999px; background: #e3f4ea; color: #1d7a49; font-size: .72rem; font-weight: 700; letter-spacing: .04em; }
.room-label { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--surface-soft); color: var(--muted); font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.room-label--hot { background: #fdeee0; color: #a4520a; }
.room-label--featured { background: var(--saffron-soft); color: var(--amber-ink); }
.room-label--new { background: var(--green-soft); color: var(--green-deep); }
.room-label--locked { background: #ecebe6; color: #5d5d57; }

.rooms-empty { padding-block: 40px 90px; max-width: 640px; }
.rooms-empty h2, .room-missing { font-size: clamp(1.8rem, 3.6vw, 2.6rem); margin-bottom: 14px; }
.rooms-empty p { color: var(--muted); margin-bottom: 26px; }
.rooms-cta { display: flex; align-items: center; justify-content: space-between; gap: 18px 28px; flex-wrap: wrap; margin-block: 54px 90px; padding: 26px 30px; border-radius: 24px; background: var(--green-soft); }
.rooms-cta p { margin: 0; max-width: 620px; color: var(--green-deep); font-weight: 600; }

/* ---- one room ----------------------------------------------------------------- */
.room-page { max-width: 900px; padding-block: clamp(30px, 5vw, 60px) 90px; }
.room-crumbs { display: flex; gap: 10px; font-size: .86rem; color: var(--muted); margin-bottom: 26px; }
.room-crumbs a { color: var(--green-dark); font-weight: 650; }
.room-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 26px; margin-bottom: 34px; }
.room-head:has(.room-cover) { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
.room-head h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); margin: 12px 0 18px; }
.room-intro { color: var(--muted); font-size: 1.06rem; line-height: 1.75; margin-bottom: 20px; }
.room-prompt { margin: 0; padding: 16px 20px; border-left: 4px solid var(--saffron); border-radius: 4px 16px 16px 4px; background: #fdf6ea; font-family: var(--serif); font-style: italic; font-size: 1.16rem; line-height: 1.55; }
.room-prompt span { display: block; margin-bottom: 4px; font: 700 .7rem/1.4 var(--body); font-style: normal; letter-spacing: .1em; text-transform: uppercase; color: var(--amber-ink); }
.room-cover { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 24px; background: var(--surface-soft); }

.chat { position: relative; border: 1px solid var(--line); border-radius: 26px; background: var(--paper); overflow: hidden; }
.chat-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.chat-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1.15rem; letter-spacing: -.02em; }
.room-counts { margin: 0; color: var(--muted); font-size: .88rem; }
.chat-scroll { max-height: min(68vh, 720px); min-height: 220px; overflow-y: auto; overscroll-behavior: contain; padding: 8px 24px 18px; scroll-behavior: auto; }
.chat-scroll:focus-visible { outline: 3px solid var(--green-soft); outline-offset: -3px; }
.chat-earlier { text-align: center; margin: 10px 0 4px; }
.link-button { padding: 0; border: 0; background: none; color: var(--green-dark); font: inherit; font-size: .88rem; font-weight: 650; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.link-button:disabled { color: var(--muted); cursor: default; }
.chat-list { list-style: none; margin: 0; padding: 0; }
.chat-empty { margin: 48px auto; max-width: 340px; text-align: center; color: var(--muted); font-style: italic; }

.msg { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 12px; padding: 14px 12px; margin: 0 -12px; border-radius: 16px; transition: opacity .45s ease, transform .45s ease, background .4s; }
.msg + .msg { margin-top: 2px; }
.msg-avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--green-soft); color: var(--green-deep); font: 700 .95rem/1 var(--display); }
.msg--guide .msg-avatar { background: var(--lavender); color: #4b3f74; }
.msg--founder .msg-avatar { background: var(--saffron); color: #fff; }
.msg--mentor { background: #f2f7f3; box-shadow: inset 3px 0 0 var(--green); }
.msg--mentor .msg-avatar { background: var(--green); color: #fff; }
.msg--founder { background: #fff8ec; box-shadow: inset 3px 0 0 var(--saffron); }
.msg-body { min-width: 0; }
.msg-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 0 2px; margin: 0 0 3px; font-size: .9rem; }
.msg-name { font-weight: 700; }
.msg-meta .badge { margin-right: 4px; }
.msg-time { margin-left: 8px; color: var(--muted); font-size: .78rem; }
.msg-reply-to { margin: 0 0 3px; color: var(--muted); font-size: .8rem; }
.msg-text { margin: 0; white-space: pre-line; overflow-wrap: anywhere; line-height: 1.6; }
.msg-likes { margin: 6px 0 0; color: #b4473f; font-size: .8rem; font-weight: 650; }

.chat-new {
  position: absolute; left: 50%; bottom: 112px; transform: translateX(-50%); z-index: 2; padding: 9px 18px; border: 0; border-radius: 999px;
  background: var(--green-deep); color: #fff; font: 650 .86rem/1 var(--body); box-shadow: 0 10px 24px rgba(32, 61, 49, .3); cursor: pointer;
}
.chat-new[hidden] { display: none; }
.composer { display: flex; align-items: center; justify-content: space-between; gap: 14px 22px; flex-wrap: wrap; padding: 18px 24px; border-top: 1px solid var(--line); background: var(--surface-soft); }
.composer p { margin: 0; color: var(--muted); font-size: .93rem; line-height: 1.55; max-width: 560px; }
.composer strong { color: var(--ink); }
.composer .button { min-height: 46px; padding: 9px 22px; }

.room-notes { display: grid; gap: 10px; margin-top: 26px; color: var(--muted); font-size: .88rem; line-height: 1.55; }
.room-notes p { margin: 0; }
.room-notes .badge { margin: 0 6px 0 0; }
.room-notes a { color: var(--green-dark); text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 900px) {
  .hot-room { grid-template-columns: 1fr; border-radius: 28px; }
  .room-head:has(.room-cover) { grid-template-columns: 1fr; }
  .room-cover { aspect-ratio: 16 / 9; order: -1; }
}
@media (max-width: 560px) {
  .hot-room { padding: 24px 20px; margin-inline: 0; }
  .hot-room-feed { padding: 16px; }
  .room-card { padding: 20px 18px 16px; }
  .chat { border-radius: 20px; margin-inline: -4px; }
  .chat-head, .composer { padding-inline: 16px; }
  .chat-scroll { padding-inline: 16px; max-height: 62vh; }
  .msg { grid-template-columns: 32px minmax(0, 1fr); gap: 10px; }
  .msg-avatar { width: 32px; height: 32px; font-size: .85rem; }
  .rooms-cta { padding: 22px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .live-dot.is-live { animation: none; }
  .room-card, .msg, .mini-msg { transition: none; }
}

/* ---- taking part (Nov 2026): actions, composer, report, toast ----------- */
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.has-actions .msg-likes { display: none; }
.msg-actions { display: flex; align-items: center; gap: 4px; margin: 6px 0 0 -8px; }
.act {
  display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 3px 9px; border: 0; border-radius: 999px;
  background: transparent; color: var(--muted); font: 650 .78rem/1 var(--body); cursor: pointer; transition: background .15s, color .15s;
}
.act:hover, .act:focus-visible { background: var(--surface-soft); color: var(--ink); }
.act:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }
.act-heart { font-size: .95rem; line-height: 1; }
.act-like[aria-pressed="true"] { color: #c0392b; }
.act-like[aria-pressed="true"] .act-heart { animation: sv-pop .3s ease; }
@keyframes sv-pop { 50% { transform: scale(1.35); } }
.act-more { font-size: 1.05rem; letter-spacing: .05em; padding-inline: 10px; }
.act-more-wrap { position: relative; }
.act-menu {
  position: absolute; left: 0; bottom: calc(100% + 4px); z-index: 5; min-width: 180px; padding: 6px; border-radius: 14px;
  background: #fff; box-shadow: 0 14px 40px rgba(26, 26, 24, .16), 0 0 0 1px var(--line);
}
.act-menu button { display: block; width: 100%; padding: 9px 12px; border: 0; border-radius: 9px; background: none; font: 600 .86rem/1.3 var(--body); color: var(--ink); text-align: left; cursor: pointer; }
.act-menu button:hover, .act-menu button:focus-visible { background: var(--surface-soft); outline: none; }
.act-menu .act-danger { color: #b4322f; }
@media (hover: hover) {
  .msg .msg-actions .act-reply, .msg .msg-actions .act-more-wrap { opacity: 0; transition: opacity .15s; }
  .msg:hover .msg-actions .act-reply, .msg:hover .msg-actions .act-more-wrap,
  .msg:focus-within .msg-actions .act-reply, .msg:focus-within .msg-actions .act-more-wrap { opacity: 1; }
}
.msg.is-reply-target { background: #eef5f0; box-shadow: inset 3px 0 0 var(--green-dark); }
.msg.is-leaving { opacity: 0; transform: translateX(-8px); }

.composer--open { display: block; padding: 14px 18px 12px; }
.composer--open textarea {
  display: block; width: 100%; min-height: 48px; max-height: 220px; padding: 12px 15px; border: 1.5px solid var(--line); border-radius: 16px;
  background: #fff; color: var(--ink); font: inherit; font-size: 1rem; line-height: 1.5; resize: none; overflow-y: auto;
  transition: border-color .15s, box-shadow .15s;
}
.composer--open textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.composer-row { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 10px; }
.composer-hint { margin-right: auto; color: var(--muted); font-size: .76rem; }
.composer-count { color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.composer-count.is-low { color: #b4322f; font-weight: 700; }
.composer-send { min-height: 44px !important; padding: 8px 20px !important; gap: 12px !important; }
.composer-send .icon { width: 18px; height: 18px; }
.composer-send:disabled { opacity: .6; cursor: progress; transform: none; }
.composer-replying { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 8px; padding: 7px 12px; border-radius: 10px; background: #eef5f0; color: var(--green-deep); font-size: .84rem; }
.composer-replying[hidden] { display: none; }
.composer-error { margin: 8px 0 0; color: #b4322f; font-size: .86rem; font-weight: 600; }
.composer-care { margin: 0 0 12px; padding: 14px 16px; border-radius: 14px; background: #fff4e5; border: 1px solid #f3d7ae; color: #5a3b0b; font-size: .9rem; line-height: 1.55; }
.composer-care[hidden] { display: none; }
.composer-care p { margin: 0 0 6px; }
.composer-care a { color: #8a4b00; font-weight: 700; }
.composer--open .composer-care .link-button { color: #8a4b00; }

.report-dialog { width: min(440px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, .25); color: var(--ink); }
.report-dialog::backdrop { background: rgba(26, 26, 24, .45); }
.report-dialog form { padding: 24px; }
.report-dialog h2 { font-size: 1.35rem; margin: 0 0 6px; letter-spacing: -.02em; }
.report-help { color: var(--muted); font-size: .9rem; margin: 0 0 14px; }
.report-reasons { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; padding: 0; border: 0; min-width: 0; }
.report-reasons label { position: relative; cursor: pointer; }
.report-reasons input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.report-reasons span { display: inline-block; padding: 7px 13px; border: 1.5px solid var(--line); border-radius: 999px; font-size: .86rem; font-weight: 600; }
.report-reasons input:checked + span { border-color: var(--green-dark); background: var(--green-dark); color: #fff; }
.report-reasons input:focus-visible + span { outline: 3px solid var(--green-soft); outline-offset: 2px; }
.report-note { display: grid; gap: 6px; font-size: .86rem; font-weight: 650; }
.report-note em { font-style: normal; font-weight: 400; color: var(--muted); }
.report-note textarea { width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; font: inherit; font-size: .95rem; resize: vertical; }
.report-actions { display: flex; justify-content: flex-end; align-items: center; gap: 18px; margin-top: 18px; }
.report-actions .button { min-height: 44px; padding: 8px 20px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 50; transform: translateX(-50%); max-width: calc(100vw - 32px);
  padding: 12px 20px; border-radius: 999px; background: var(--ink); color: #fff; font-size: .9rem; font-weight: 600;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .25);
}
.toast[hidden] { display: none; }

@media (max-width: 560px) {
  .composer--open { padding: 12px 12px 10px; }
  .msg-actions { margin-left: -6px; }
  .act-menu { left: auto; right: 0; }
}
