:root {
  --bg: #070911;
  --panel: rgba(13, 17, 32, 0.92);
  --panel-soft: rgba(255, 255, 255, 0.04);
  --line: rgba(255, 255, 255, 0.08);
  --text: #f6f8ff;
  --muted: #a7b0ca;
  --accent: #8b5cf6;
  --accent-2: #22d3ee;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(139, 92, 246, 0.18), transparent 30%),
    radial-gradient(circle at top right, rgba(34, 211, 238, 0.14), transparent 24%),
    linear-gradient(180deg, var(--bg) 0%, #0b0f1a 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
textarea {
  font: inherit;
}

.room-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 320px 1fr;
}

.room-sidebar,
.chat-panel {
  padding: 28px;
}

.room-sidebar {
  border-right: 1px solid var(--line);
  background: rgba(8, 10, 18, 0.84);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-badge {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(139, 92, 246, 0.35), rgba(34, 211, 238, 0.28)),
    url("../assets/logos/bored-buddy.svg") center/82% no-repeat;
  color: transparent;
  font-size: 0;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.sidebar-card,
.chat-header,
.message-card,
.composer {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.sidebar-card {
  margin-bottom: 18px;
  padding: 20px;
  border-radius: 24px;
  background: var(--panel);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-2);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-card h1,
.chat-header h2 {
  margin: 0;
  letter-spacing: -0.05em;
}

.sidebar-card p:last-child,
.message-card p,
.composer-actions small,
.composer-field span {
  color: var(--muted);
}

.sidebar-link {
  display: block;
  margin-top: 12px;
  color: var(--text);
  font-weight: 700;
}

.button-link {
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}

.chat-panel {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 20px;
  min-height: 0;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px;
  border-radius: 24px;
  background: var(--panel);
}

.header-pill {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

.message-stream {
  display: grid;
  align-content: start;
  gap: 14px;
  padding-right: 8px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.message-card {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
}

.message-card-announcement {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-style: dashed;
  background: rgba(139, 92, 246, 0.08);
}

.message-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.message-meta strong {
  display: block;
}

.message-meta span {
  color: var(--muted);
  font-size: 0.9rem;
}

.message-card p {
  margin: 0;
  line-height: 1.7;
  white-space: pre-wrap;
}

.announcement-text {
  color: var(--text);
  font-weight: 700;
  text-align: center;
}

.announcement-time {
  color: var(--muted);
  font-size: 0.85rem;
}

.message-gif {
  display: block;
  max-width: min(100%, 320px);
  margin-top: 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
}

.composer {
  padding: 20px;
  border-radius: 24px;
  background: var(--panel);
}

.composer-field {
  display: grid;
  gap: 10px;
}

.composer-hint {
  color: var(--muted);
}

.composer-field textarea {
  width: 100%;
  resize: vertical;
  min-height: 92px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--text);
  outline: 0;
}

.composer-field textarea:focus {
  border-color: rgba(139, 92, 246, 0.6);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.08);
}

.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
}

.composer-button-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gif-panel {
  margin-top: 16px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.gif-panel-header,
.gif-search-form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.gif-search-form {
  margin-top: 14px;
}

.gif-search-form input {
  flex: 1;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--text);
  outline: 0;
}

.gif-search-form input:focus {
  border-color: rgba(139, 92, 246, 0.6);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.08);
}

.gif-results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
  max-height: 280px;
  overflow: auto;
}

.gif-result-button,
.gif-toggle-button,
.gif-close-button,
.gif-search-button {
  border: 1px solid var(--line);
  cursor: pointer;
}

.gif-result-button {
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.gif-result-button img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.gif-empty-state {
  grid-column: 1 / -1;
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.gif-empty-state p {
  margin: 8px 0 0;
  color: var(--muted);
}

.gif-toggle-button,
.gif-close-button,
.gif-search-button {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.send-button {
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #07101a;
  font-weight: 800;
  cursor: pointer;
}

@media (max-width: 920px) {
  .room-shell {
    grid-template-columns: 1fr;
  }

  .room-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (min-width: 921px) {
  body {
    height: 100vh;
    overflow: hidden;
  }

  .room-shell {
    height: 100vh;
  }

  .room-sidebar,
  .chat-panel {
    min-height: 0;
  }

  .room-sidebar {
    overflow-y: auto;
  }
}

@media (max-width: 560px) {
  .chat-header,
  .composer-actions,
  .gif-panel-header,
  .gif-search-form,
  .composer-button-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .gif-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
