:root {
  color-scheme: dark;
  --bg: #0b0e14;
  --panel: rgba(22, 27, 38, .86);
  --panel-solid: #171d29;
  --panel-soft: #1d2533;
  --line: rgba(166, 181, 209, .16);
  --line-strong: rgba(166, 181, 209, .28);
  --text: #f4f6fb;
  --muted: #9da8bc;
  --faint: #69748a;
  --accent: #efba71;
  --accent-bright: #ffd596;
  --green: #8ed9b2;
  --red: #f28d86;
  --shadow: 0 28px 80px rgba(0, 0, 0, .3);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }

body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 12%, rgba(78, 99, 147, .16), transparent 34rem),
    radial-gradient(circle at 91% 76%, rgba(179, 111, 54, .1), transparent 32rem),
    var(--bg);
  color: var(--text);
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }

.ambient { position: fixed; pointer-events: none; border-radius: 999px; filter: blur(1px); opacity: .24; }
.ambient-one { width: 22rem; height: 22rem; top: -12rem; right: 14%; border: 1px solid rgba(239, 186, 113, .28); }
.ambient-two { width: 30rem; height: 30rem; bottom: -19rem; left: -12rem; border: 1px solid rgba(131, 165, 224, .18); }

.shell { position: relative; width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 28px 0 24px; }
.site-header { display: flex; align-items: center; gap: 12px; margin-bottom: 64px; }
.brand-mark { display: flex; align-items: end; gap: 3px; width: 27px; height: 28px; }
.brand-mark span { display: block; width: 6px; border-radius: 4px; background: var(--accent); }
.brand-mark span:nth-child(1) { height: 13px; opacity: .52; }
.brand-mark span:nth-child(2) { height: 22px; opacity: .78; }
.brand-mark span:nth-child(3) { height: 28px; }
.brand-kicker, .eyebrow { margin: 0; color: var(--faint); font-size: 10px; font-weight: 700; letter-spacing: .18em; line-height: 1.3; }
.brand-title { margin: 2px 0 0; color: var(--text); font-size: 14px; font-weight: 650; letter-spacing: .08em; }
.header-lock { margin-left: auto; color: var(--accent); font-size: 28px; font-weight: 300; transform: rotate(-22deg); }

.create-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(360px, .8fr); align-items: center; gap: clamp(46px, 8vw, 116px); min-height: 610px; }
.intro-panel { padding: 12px 0 40px; }
.intro-panel h1 { max-width: 620px; margin: 20px 0 22px; font-size: clamp(44px, 7vw, 82px); font-weight: 650; letter-spacing: -.07em; line-height: .98; }
.intro-copy { max-width: 490px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.85; }
.form-card, .chat-card, .invite-panel, .notice-card { border: 1px solid var(--line); background: linear-gradient(140deg, rgba(30, 37, 52, .9), rgba(16, 20, 29, .88)); box-shadow: var(--shadow); backdrop-filter: blur(22px); }
.form-card { border-radius: 24px; padding: 30px; }
.card-heading, .panel-heading, .chat-topline, .chat-actions, .room-meta, .composer-foot { display: flex; align-items: center; }
.card-heading, .panel-heading { justify-content: space-between; gap: 12px; }
.card-heading h2, .panel-heading h2 { margin: 8px 0 0; font-size: 25px; letter-spacing: -.04em; }
.soft-badge, .count-chip { border: 1px solid rgba(142, 217, 178, .22); border-radius: 999px; padding: 6px 9px; color: var(--green); background: rgba(142, 217, 178, .08); font-size: 10px; letter-spacing: .08em; white-space: nowrap; }
.count-chip { min-width: 28px; padding: 6px 8px; text-align: center; }
.field-label { display: block; margin: 28px 0 9px; color: var(--muted); font-size: 12px; }
.text-input { width: 100%; height: 45px; border: 1px solid var(--line); border-radius: 10px; outline: none; padding: 0 13px; color: var(--text); background: rgba(8, 11, 17, .48); transition: border-color .2s, box-shadow .2s; }
.select-input { cursor: pointer; }
.text-input:focus { border-color: rgba(239, 186, 113, .68); box-shadow: 0 0 0 3px rgba(239, 186, 113, .1); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-grid .field-label { margin-top: 20px; }
.field-hint, .form-footnote { margin: 8px 0 0; color: var(--faint); font-size: 11px; line-height: 1.55; }
.quick-times { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 20px; }
.quick-times button { border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; color: var(--muted); background: transparent; font-size: 11px; transition: .2s; }
.quick-times button:hover, .quick-times button.active { border-color: rgba(239, 186, 113, .55); color: var(--accent-bright); background: rgba(239, 186, 113, .08); }
.form-error { margin: 14px 0 -2px; color: var(--red); font-size: 12px; line-height: 1.5; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 44px; border: 1px solid transparent; border-radius: 10px; padding: 0 16px; font-weight: 650; transition: transform .2s, background .2s, border-color .2s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .5; transform: none; }
.button-primary { color: #1b1711; background: var(--accent); }
.button-primary:hover { background: var(--accent-bright); }
.button-secondary { border-color: var(--line-strong); color: var(--text); background: rgba(255,255,255,.04); }
.button-secondary:hover { border-color: rgba(239,186,113,.48); background: rgba(239,186,113,.08); }
.button-wide { width: 100%; margin-top: 24px; }
.button-arrow { font-size: 20px; font-weight: 400; line-height: 0; }
.form-footnote { margin-top: 18px; text-align: center; }
.join-block { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 22px; }
.join-block h3 { margin: 8px 0 0; font-size: 17px; letter-spacing: -.03em; }
.join-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 15px; }
.join-form .button { min-width: 62px; }
.join-block .form-error { margin: 10px 0 0; }

.chat-view { padding-bottom: 24px; }
.chat-topline { justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.chat-topline h1 { margin: 8px 0 0; font-size: clamp(29px, 4vw, 43px); letter-spacing: -.06em; }
.chat-actions { gap: 12px; }
.status-badge { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px; padding: 8px 11px; color: var(--muted); background: rgba(255,255,255,.03); font-size: 11px; }
.status-badge i { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); box-shadow: 0 0 0 3px rgba(105,116,138,.12); }
.status-badge.status-live { border-color: rgba(142,217,178,.26); color: var(--green); background: rgba(142,217,178,.07); }
.status-badge.status-live i { background: var(--green); box-shadow: 0 0 0 3px rgba(142,217,178,.12); }
.status-badge.status-error { border-color: rgba(242,141,134,.3); color: var(--red); background: rgba(242,141,134,.07); }
.status-badge.status-error i { background: var(--red); }
.icon-button { display: grid; place-items: center; width: 33px; height: 33px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: transparent; font-size: 20px; font-weight: 300; line-height: 1; }
.icon-button:hover { border-color: rgba(242,141,134,.5); color: var(--red); }
.chat-grid { display: grid; grid-template-columns: minmax(230px, .36fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.invite-panel { min-height: 620px; border-radius: 20px; padding: 22px; }
.panel-heading h2 { font-size: 20px; }
.panel-copy { margin: 20px 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.short-code-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 5px 10px; margin: 18px 0; border: 1px solid rgba(239,186,113,.28); border-radius: 12px; padding: 12px; background: rgba(239,186,113,.06); }
.short-code-card strong { display: block; margin-top: 7px; color: var(--accent-bright); font-size: 22px; letter-spacing: .18em; }
.short-code-card .copy-button { width: auto; margin-top: 0; padding: 7px 10px; }
.short-code-card small { grid-column: 1 / -1; color: var(--faint); font-size: 10px; }
.invite-list { display: grid; gap: 10px; }
.invite-row { border: 1px solid var(--line); border-radius: 12px; padding: 11px; background: rgba(7, 10, 15, .28); }
.invite-row-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.invite-row-head strong { color: var(--text); font-size: 12px; }
.invite-row-head span { color: var(--faint); font-size: 10px; }
.invite-link { width: 100%; border: 0; outline: none; padding: 0; overflow: hidden; color: var(--faint); background: transparent; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.copy-button { width: 100%; margin-top: 9px; border: 1px solid var(--line); border-radius: 8px; padding: 7px; color: var(--muted); background: rgba(255,255,255,.04); font-size: 11px; }
.copy-button:hover { border-color: rgba(239,186,113,.48); color: var(--accent-bright); }
.panel-warning { display: flex; gap: 9px; margin-top: 22px; border-top: 1px solid var(--line); padding-top: 16px; }
.panel-warning > span { flex: 0 0 auto; display: grid; place-items: center; width: 16px; height: 16px; border: 1px solid rgba(239,186,113,.48); border-radius: 50%; color: var(--accent); font-size: 10px; }
.panel-warning p { margin: 0; color: var(--faint); font-size: 10px; line-height: 1.6; }
.chat-card { min-height: 620px; display: flex; flex-direction: column; border-radius: 20px; overflow: hidden; }
.room-meta { flex-wrap: wrap; gap: 26px; border-bottom: 1px solid var(--line); padding: 18px 22px; }
.meta-item { display: grid; gap: 5px; }
.meta-label { color: var(--faint); font-size: 10px; letter-spacing: .08em; }
.meta-item strong { color: var(--muted); font-size: 12px; font-weight: 600; }
.meta-expiry { margin-left: auto; text-align: right; }
.message-list { flex: 1; min-height: 440px; overflow-y: auto; padding: 25px 22px 10px; scroll-behavior: smooth; }
.empty-state { display: grid; place-items: center; min-height: 380px; color: var(--faint); text-align: center; }
.empty-state p { margin: 16px 0 5px; color: var(--muted); font-size: 13px; }
.empty-state small { color: var(--faint); font-size: 10px; }
.empty-orbit { position: relative; width: 48px; height: 48px; border: 1px solid rgba(239,186,113,.26); border-radius: 50%; animation: orbit 5s linear infinite; }
.empty-orbit span { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.empty-orbit span:nth-child(1) { top: -3px; left: 21px; }
.empty-orbit span:nth-child(2) { right: 3px; bottom: 9px; opacity: .6; }
.empty-orbit span:nth-child(3) { bottom: 3px; left: 9px; opacity: .35; }
@keyframes orbit { to { transform: rotate(360deg); } }
.message { display: flex; margin: 0 0 15px; animation: message-in .22s ease-out both; }
.message.own { justify-content: flex-end; }
.message-bubble { max-width: min(76%, 560px); border: 1px solid var(--line); border-radius: 15px 15px 15px 4px; padding: 11px 13px 10px; background: rgba(39, 48, 65, .8); }
.message.own .message-bubble { border-color: rgba(239,186,113,.3); border-radius: 15px 15px 4px 15px; background: rgba(102, 76, 42, .32); }
.message-meta { margin-bottom: 6px; color: var(--faint); font-size: 10px; }
.message-content { color: var(--text); font-size: 14px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.burning { animation: burn-out .22s ease-in both; }
@keyframes message-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes burn-out { to { opacity: 0; transform: scale(.97); } }
.composer { border-top: 1px solid var(--line); padding: 15px 18px 16px; background: rgba(8, 11, 17, .32); }
.composer textarea { display: block; width: 100%; max-height: 150px; min-height: 46px; resize: none; border: 1px solid transparent; outline: none; border-radius: 10px; padding: 12px 12px 8px; color: var(--text); background: rgba(255,255,255,.04); line-height: 1.5; }
.composer textarea:focus { border-color: rgba(239,186,113,.32); }
.composer textarea:disabled { cursor: not-allowed; opacity: .5; }
.composer-foot { justify-content: space-between; gap: 10px; margin-top: 9px; }
.composer-foot span { color: var(--faint); font-size: 10px; }
.send-button { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; color: #1b1711; background: var(--accent); font-size: 20px; line-height: 1; }
.send-button:hover { background: var(--accent-bright); }
.send-button:disabled { cursor: not-allowed; opacity: .38; }
.chat-footnote { margin: 14px 3px 0; color: var(--faint); font-size: 10px; text-align: right; }

.notice-card { max-width: 520px; margin: 90px auto 140px; border-radius: 24px; padding: 36px; text-align: center; }
.notice-icon { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 22px; border: 1px solid rgba(239,186,113,.34); border-radius: 50%; color: var(--accent); font-size: 24px; }
.notice-card h1 { margin: 0 0 14px; font-size: 28px; letter-spacing: -.05em; }
.notice-card p { margin: 0 auto 25px; max-width: 390px; color: var(--muted); font-size: 14px; line-height: 1.8; }
.site-footer { display: flex; justify-content: center; gap: 9px; margin-top: 48px; color: var(--faint); font-size: 9px; letter-spacing: .12em; }

[hidden] { display: none !important; }

@media (max-width: 850px) {
  .site-header { margin-bottom: 36px; }
  .create-layout { grid-template-columns: 1fr; gap: 12px; min-height: 0; }
  .intro-panel { padding-bottom: 18px; }
  .intro-panel h1 { max-width: 580px; font-size: clamp(43px, 12vw, 70px); }
  .form-card { max-width: 620px; }
  .chat-grid { grid-template-columns: 1fr; }
  .invite-panel { min-height: 0; order: 2; }
  .chat-card { min-height: 600px; }
  .invite-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 540px) {
  .shell { width: min(100% - 24px, 1180px); padding-top: 18px; }
  .site-header { margin-bottom: 28px; }
  .intro-panel h1 { margin-top: 15px; font-size: 47px; }
  .intro-copy { font-size: 14px; }
  .form-card { padding: 22px 18px; border-radius: 19px; }
  .field-grid { grid-template-columns: 1fr; gap: 0; }
  .chat-topline h1 { font-size: 32px; }
  .chat-actions { gap: 7px; }
  .status-badge { padding: 7px 8px; font-size: 10px; }
  .room-meta { gap: 15px; padding: 15px; }
  .meta-expiry { width: 100%; margin-left: 0; text-align: left; }
  .message-list { min-height: 390px; padding: 20px 14px 8px; }
  .message-bubble { max-width: 88%; }
  .invite-panel { padding: 17px; }
  .invite-list { grid-template-columns: 1fr; }
  .site-footer { flex-wrap: wrap; line-height: 1.5; }
}
