/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  max-width: 100%;
  overflow-x: clip;
}

body {
  background-color: rgb(8, 8, 8);
  color: #b9b9b9;
  font-family: "Roboto", Helvetica, "Trebuchet MS", Verdana, sans-serif;
  text-rendering: optimizelegibility;
  line-height: 1.5;
}

a { color: #6ea8fe; text-decoration: none; }
a:hover { color: #9ec5fe; }

ul { list-style: none; }

/* ── Login screen ── */
.login-screen {
  display: none;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
}

#usernameInputContainer {
  margin: 0 auto;
  padding: 0 1rem;
  max-width: 400px;
  width: 100%;
}

#login-title {
  color: #e0e0e0;
  font-size: 1.6rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 1.2rem;
  letter-spacing: 0.02em;
}

#usernameInput {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  color: #e0e0e0;
  background-color: #1a1a1a;
  border: 1px solid #333;
  border-radius: 4px;
  outline: none;
  text-align: center;
}

#usernameInput:focus {
  border-color: #6ea8fe;
  box-shadow: 0 0 0 2px rgba(110, 168, 254, 0.25);
}

#usernameInput::placeholder { color: #666; }

#info {
  padding-top: 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: #b9b9b9;
}

#info p {
  margin-top: 0.25rem;
  color: #666;
  font-size: 0.8rem;
}

#info label { cursor: pointer; }

/* ── Spinner ── */
#spinner {
  display: none;
  justify-content: center;
  align-items: center;
  height: 80vh;
}

.spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid #333;
  border-top-color: #888;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Top bar ── */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background-color: #1a1a1a;
  border-bottom: 1px solid #2a2a2a;
  height: 48px;
  flex-wrap: wrap;
}

.topbar #showing {
  font-size: 0.85em;
  color: #aaa;
  white-space: nowrap;
  flex-shrink: 0;
}

.topbar a {
  color: #ccc;
  font-size: 0.9em;
  flex-shrink: 0;
}

.topbar a:hover { color: #fff; }

.topbar button {
  background: none;
  border: 1px solid #444;
  color: #aaa;
  font-size: 0.8em;
  padding: 0.2em 0.6em;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.topbar button:hover { color: #fff; border-color: #888; }

.topbar button.active {
  color: #4caf50;
  border-color: #4caf50;
}

#filterInput {
  padding: 0.2rem 0.5rem;
  font-size: 0.85em;
  color: #e0e0e0;
  background: #111;
  border: 1px solid #333;
  border-radius: 4px;
  outline: none;
  width: 140px;
}

#filterInput:focus {
  border-color: #6ea8fe;
  width: 200px;
  transition: width 0.2s;
}

#filterInput::placeholder { color: #555; }

/* ── List container ── */
.list-div { display: none; }

/* ── Chat items (shared between .mention-item and .log-item) ── */
.chat-item {
  position: relative;
  padding: 0.5rem 1rem;
  font-size: 18px;
  border-bottom: 1px solid #1a1a1a;
  background-color: #000;
  content-visibility: auto;
  contain-intrinsic-size: auto 42px;
}

.chat-item:hover { background-color: #0d0d0d; }

.chat-item.twitch {
  background-color: #360d3e;
  border-color: #4a1a57;
}

.chat-item.twitch:hover { background-color: #3d0f47; }

.chat-item.twitch .timestamp,
.chat-item.twitch .message { color: #fff; }

.chat-item.highlighted {
  border-color: #3a4aff;
  border-left: 3px solid #3a4aff;
  background-color: #0d1133;
}

/* ── Date splitters ── */
li.splitter {
  background-color: rgb(8, 8, 8);
  border: none;
  display: flex;
  align-items: center;
  gap: 0.75em;
  padding: 0.6em 1em;
  font-size: 0.8em;
  color: #555;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  position: sticky;
  top: 48px;
  z-index: 10;
}

li.splitter::before,
li.splitter::after {
  content: '';
  flex: 1;
  border-top: 1px solid #2a2a2a;
}

li.splitter .message { color: #555; }

/* ── Message parts ── */
.timestamp {
  color: #686868;
  padding-right: 0.3em;
  cursor: default;
}

a.timestamp {
  cursor: pointer;
  text-decoration: none;
}

a.timestamp:hover {
  color: #999;
  text-decoration: underline;
}

.nick {
  color: #fff;
  padding-left: 0.3em;
}

a.nick { text-decoration: none; }
a.nick:hover { text-decoration: underline; }

.snowflake-nick { color: #e463cf; }

.message { color: #b9b9b9; }

.dgg-badge { margin-left: 0.2em; }

/* ── Share button ── */
.share-btn {
  display: none;
  position: absolute;
  right: 0.6em;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 1px solid #333;
  border-radius: 4px;
  color: #777;
  font-size: 0.75em;
  padding: 0.15em 0.4em;
  cursor: pointer;
  line-height: 1.4;
  transition: color 0.15s, border-color 0.15s;
}

.share-btn:hover { color: #ccc; border-color: #666; }

.chat-item:hover .share-btn { display: inline-block; }
