:root {
  --bg: #050805;
  --panel: #0c100c;
  --ink: #e8f5e9;
  --muted: #7d9a82;
  --line: #1b2a1d;
  --accent: #2ecc71;
  --accent-ink: #041208;
  --danger: #e26a5c;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
}

body {
  background-image:
    radial-gradient(circle at top, rgba(46, 204, 113, 0.1), transparent 36%),
    linear-gradient(#000000, #050805);
}

button,
input {
  font: inherit;
}

.app {
  height: 100dvh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.top {
  display: grid;
  grid-template-columns: 1fr minmax(0, 2fr) 1fr;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.92);
  position: sticky;
  top: 0;
  z-index: 5;
}

.top-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.top-center {
  min-width: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.announce-view {
  margin: 0;
  max-width: 100%;
  color: var(--muted);
  font-size: 22px;
  line-height: 1.2;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.announce-view.has-note {
  color: var(--accent);
  font-size: 26px;
}

.announce-form {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.announce-form input {
  flex: 1;
  min-width: 0;
  max-width: 420px;
  padding: 8px 10px;
  font-size: 16px;
  text-align: center;
}

.announce-form button[type="submit"] {
  padding: 8px 12px;
}

.announce-form .ghost {
  padding: 8px 12px;
}

.room-pick {
  position: relative;
  min-width: 0;
  max-width: min(260px, 100%);
}

.room-pick::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.room-select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  padding: 8px 36px 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #000000;
  color: var(--ink);
  font-family: "Segoe UI", sans-serif;
  font-size: 16px;
  cursor: pointer;
}

.room-select:focus {
  outline: none;
  border-color: var(--accent);
}

.mute {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-family: "Segoe UI", sans-serif;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
}

.mute input {
  width: 16px;
  height: 16px;
  padding: 0;
  accent-color: var(--accent);
}

.kicker,
.you {
  margin: 0;
  justify-self: end;
  color: var(--muted);
  font-family: "Segoe UI", sans-serif;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-weight: 500;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 26px;
}

.icon-btn,
.ghost,
button[type="submit"] {
  border: 0;
  cursor: pointer;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
}

.you {
  max-width: 28vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log {
  min-height: 0;
  overflow-y: auto;
  padding: 22px 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.empty,
.day {
  color: var(--muted);
  text-align: center;
  font-family: "Segoe UI", sans-serif;
  font-size: 13px;
}

.bubble {
  position: relative;
  max-width: min(72ch, 92%);
  padding: 10px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}

.delete-msg {
  display: none;
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--danger);
  font-family: "Segoe UI", sans-serif;
  font-size: 12px;
  cursor: pointer;
}

body.admin-on .delete-msg {
  display: inline-block;
}

.bubble.mine {
  margin-left: auto;
  background: #0d1f14;
  border-color: #1f4a30;
}

.who {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 4px;
  color: var(--accent);
  font-family: "Segoe UI", sans-serif;
  font-size: 12px;
}

.when {
  color: var(--muted);
  font-weight: 400;
  white-space: nowrap;
}

.bubble p {
  margin: 0;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-link {
  color: #4ea1ff;
  text-decoration: underline;
  word-break: break-all;
}

.attach-preview {
  margin-top: 8px;
}

.attach-preview img {
  display: block;
  max-width: min(320px, 100%);
  max-height: 280px;
  border-radius: 10px;
}

.file-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #4ea1ff;
  text-decoration: underline;
  font-family: "Segoe UI", sans-serif;
  font-size: 14px;
}

.composer,
.stack,
.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.composer {
  padding: 14px 16px 18px;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.94);
}

.compose-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.compose-fields {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-input {
  display: none;
}

.attach-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.attach-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #000000;
  color: var(--muted);
  font-family: "Segoe UI", sans-serif;
  font-size: 13px;
}

.attach-chip button {
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #000000;
  color: var(--ink);
  outline: none;
}

input:focus {
  border-color: var(--accent);
}

button[type="submit"] {
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
}

.ghost {
  padding: 10px 14px;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.drawer,
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
}

.drawer {
  z-index: 20;
}

.overlay {
  z-index: 30;
}

.drawer-card,
.card {
  width: min(440px, 100%);
  padding: 22px;
  border-radius: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.drawer-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card.wide {
  width: min(560px, 100%);
}

.drawer-head,
.row,
.room-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hint,
.error,
label {
  font-family: "Segoe UI", sans-serif;
  font-size: 14px;
}

.hint {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.error {
  margin: 0;
  color: var(--danger);
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
}

.room-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.room-row {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.room-row strong {
  display: block;
}

.room-row span,
.room-row button {
  font-family: "Segoe UI", sans-serif;
  font-size: 13px;
}

.room-row button {
  background: transparent;
  color: var(--danger);
  border: 0;
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

@media (max-width: 640px) {
  h1 {
    font-size: 22px;
  }

  .compose-row {
    flex-wrap: wrap;
  }

  .compose-fields {
    flex: 1 1 100%;
    order: -1;
  }
}
