@font-face { font-family: 'Raleway'; src: url('raleway-regular.ttf'); }

:root {
  --bg: #121212;
  --bg-alt: #1e1e1e;
  --fg: #f5f5f5;
  --muted: #aaaaaa;
  --accent: #ff5252;
  --border: #333333;
  --row-hover: #262626;
  --speaking-bg: #3b1b1b;
  --speaking-border: #ff5252;
  --ok: #4caf50;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Raleway", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--fg);
}

header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(18, 18, 18, 0.95);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

h1 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: 0.03em;
}

.time-box {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 0.85rem;
  color: var(--muted);
}

main {
  padding: 12px 8px 40px;
}

.table-wrapper {
  max-width: 90vw;
  margin: 10px auto 0;
  background: rgba(18, 18, 18, 0.9);
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.table-wrapper h2 {
  margin: 10px 10px 4px;
  font-size: 0.9rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

thead {
  background: #181818;
}

th,
td {
  padding: 8px 10px;
  font-size: 0.8rem;
  text-align: left;
  border-bottom: 1px solid #262626;
  word-wrap: break-word;
}

th {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
  color: var(--muted);
}

tbody tr:nth-child(odd) {
  background: var(--bg-alt);
}

tbody tr:nth-child(even) {
  background: #161616;
}

tbody tr:hover {
  background: var(--row-hover);
}

tr.speaking {
  background: var(--speaking-bg) !important;
  border-left: 3px solid var(--speaking-border);
}

tr.selected {
  box-shadow: inset 0 0 0 1px rgba(76, 175, 80, 0.35);
  outline: 1px solid rgba(76, 175, 80, 0.25);
}

td .badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 500;
}

.badge.speaking {
  background: rgba(255, 82, 82, 0.12);
  color: var(--accent);
}

.badge.idle {
  background: rgba(170, 170, 170, 0.12);
  color: var(--muted);
}

.badge.dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 4px;
  background: currentColor;
}

.badge.ok {
  background: rgba(76, 175, 80, 0.12);
  color: var(--ok);
}

.badge.down {
  background: rgba(255, 82, 82, 0.12);
  color: var(--accent);
}

.peer-rules {
  color: var(--muted);
  font-size: 0.75rem;
}

.status-msg {
  padding: 6px 10px 10px;
  font-size: 0.75rem;
  color: var(--muted);
}

.status-msg-small {
  font-size: 0.7rem;
  color: #777777;
}

footer {
  text-align: center;
  font-size: 0.7rem;
  color: var(--muted);
  padding: 8px 0 16px;
}

.now-speaking {
  padding: 12px 10px 14px;
  font-size: 1.1rem;
  color: var(--accent);
}

.waterfall-wrap {
  position: relative;
  width: 100%;
  height: 160px;
  background: #121212;
  border-top: 1px solid var(--border);
  overflow: hidden;
}

#wfCanvas,
#wfOverlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#wfCanvas {
  image-rendering: pixelated;
}

.waterfall-controls {
  display: flex;
  justify-content: center;
  padding: 8px 0 0;
}

.waterfall-controls .toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--muted);
  user-select: none;
}

.waterfall-controls input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.level-bar {
  position: relative;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #202020;
  overflow: hidden;
}

.level-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.15s linear;
}

.level-bar-muted {
  opacity: 0.25;
}

tr.heat-low {
  box-shadow: inset 0 0 0 1px rgba(255, 193, 7, 0.4);
}

tr.heat-mid {
  box-shadow: inset 0 0 0 1px rgba(255, 152, 0, 0.5);
  background-image: linear-gradient(
    to right,
    rgba(255, 152, 0, 0.18),
    transparent
  );
}

tr.heat-high {
  box-shadow: inset 0 0 0 1px rgba(255, 82, 82, 0.7);
  background-image: linear-gradient(
    to right,
    rgba(255, 82, 82, 0.22),
    transparent
  );
}

.tg-links {
  padding: 8px 10px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.8rem;
}

.tg-link-row {
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #181818;
  white-space: nowrap;
}

.tg-link-row strong {
  color: var(--accent);
}

.now-speaking {
  margin: 0 auto;
  text-align: center;
  flex-wrap: wrap;
}

.speaker-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.speaker-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  padding: 6px 14px;
  border-radius: 999px;

  font-size: 0.85rem;
  font-weight: 500;

  background: rgba(255, 82, 82, 0.15);
  color: var(--accent);
  border: 1px solid var(--accent);
}

.speaker-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.top-row {
  max-width: 90vw;
  margin: 10px auto 0;
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.top-row .table-wrapper {
  margin: 0;
  flex: 1 1 0;
}

.now-speaking-card {
  flex: 0 0 32%;
  min-width: 260px;
}

.waveform-card {
  flex: 1 1 auto;
  min-width: 420px;
}

@media (max-width: 900px) {
  .top-row {
    flex-direction: column;
    max-width: 100vw;
  }
  .now-speaking-card,
  .waveform-card {
    min-width: 0;
  }
}

@media (max-width: 600px) {
  h1 {
    font-size: 1rem;
  }

  header {
    justify-content: flex-start;
  }

  .time-box {
    font-size: 0.8rem;
  }

  .table-wrapper {
    max-width: 100vw;
    border-radius: 0;
  }
}

html {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html::-webkit-scrollbar {
    width: 0;
    height: 0;
}
