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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: #0c0d10;
  color: #e2e8f0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
}

.hidden {
  display: none !important;
}

.w-full {
  width: 100%;
}

.text-white {
  color: #fff;
}

.text-right {
  text-align: right;
}

/* MODAL */
.modal {
  position: fixed;
  inset: 0;
  background-color: rgba(5, 6, 8, 0.9);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal-box {
  background: #14161c;
  border: 1px solid #232732;
  border-radius: 8px;
  width: 100%;
  max-width: 360px;
  padding: 24px;
}

.modal-header {
  margin-bottom: 12px;
}

.host-pill {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: #1d212b;
  color: #10b981;
  border: 1px solid #2b3140;
  margin-bottom: 8px;
}

.modal-box h2 {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.modal-box p {
  font-size: 12px;
  color: #7e8799;
  margin-bottom: 16px;
  line-height: 1.4;
}

.modal-box input {
  width: 100%;
  background: #0b0c0f;
  border: 1px solid #232732;
  border-radius: 6px;
  padding: 10px 12px;
  color: #fff;
  font-size: 13px;
  margin-bottom: 12px;
  outline: none;
}

.modal-box input:focus {
  border-color: #10b981;
}

.error-msg {
  font-size: 11px;
  color: #f87171;
  min-height: 16px;
  margin-bottom: 8px;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 11px;
}

.btn-green {
  background: #10b981;
  color: #000;
}
.btn-green:hover {
  background: #059669;
}

.btn-amber {
  background: #f59e0b;
  color: #000;
}
.btn-amber:hover {
  background: #d97706;
}

.btn-purple {
  background: #8b5cf6;
  color: #fff;
}
.btn-purple:hover {
  background: #7c3aed;
}

.btn-green-outline {
  background: transparent;
  border-color: #10b981;
  color: #10b981;
}
.btn-green-outline:hover {
  background: rgba(16, 185, 129, 0.1);
}

.btn-neutral {
  background: #1e222b;
  color: #cbd5e1;
  border-color: #2b303d;
}
.btn-neutral:hover {
  background: #2b303d;
  color: #fff;
}

.btn-danger {
  background: #2a1518;
  color: #f87171;
  border-color: #4c1d24;
}
.btn-danger:hover {
  background: #3f1a21;
}

.btn-text {
  background: transparent;
  border: none;
  color: #7e8799;
  font-size: 12px;
  cursor: pointer;
}
.btn-text:hover {
  color: #f87171;
}

/* APP LAYOUT */
.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
}

/* HEADER */
.header {
  height: 52px;
  border-bottom: 1px solid #1a1d24;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0f1014;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}

.brand {
  font-weight: 700;
  color: #fff;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.dot.online {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.dot.paused {
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
}

.dot.offline {
  background: #64748b;
}

.divider {
  color: #262b36;
}

.meta-item {
  color: #7e8799;
}

/* MAIN CONTENT */
.content-container {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* CARDS */
.control-card, .players-card {
  background: #12141a;
  border: 1px solid #1d212b;
  border-radius: 8px;
  padding: 16px 20px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.header-hint {
  font-size: 11px;
  color: #64748b;
}

.badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  font-family: ui-monospace, monospace;
}

.badge-neutral {
  background: #1c202a;
  color: #94a3b8;
  border: 1px solid #292f3d;
}

.badge-green {
  background: #064e3b;
  color: #34d399;
  border: 1px solid #059669;
}

.badge-amber {
  background: #78350f;
  color: #fbbf24;
  border: 1px solid #b45309;
}

/* CONTROLS GRID */
.controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 768px) {
  .controls-grid {
    grid-template-columns: 1fr;
  }
}

.action-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.group-label {
  font-size: 11px;
  color: #7e8799;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* METRICS GRID */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 768px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }
}

.metric-card {
  background: #12141a;
  border: 1px solid #1d212b;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.metric-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metric-name {
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
}

.metric-sub {
  font-size: 11px;
  color: #64748b;
}

.metric-value-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.metric-value {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}

.metric-note {
  font-size: 11px;
  color: #64748b;
}

.meter-bar-track {
  width: 100%;
  height: 6px;
  background: #1b1e28;
  border-radius: 3px;
  overflow: hidden;
}

.meter-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.meter-bar-fill.green {
  background: #10b981;
}

.meter-bar-fill.blue {
  background: #38bdf8;
}

.meter-bar-fill.purple {
  background: #8b5cf6;
}

/* PLAYERS TABLE */
.title-with-count {
  display: flex;
  align-items: center;
  gap: 8px;
}

.counter-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: #162a22;
  color: #10b981;
  border: 1px solid #1c4737;
}

.players-table-wrapper {
  overflow-x: auto;
}

.players-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.players-table th {
  text-align: left;
  padding: 8px 12px;
  color: #64748b;
  border-bottom: 1px solid #1a1d24;
  font-weight: 600;
}

.players-table td {
  padding: 12px;
  border-bottom: 1px solid #151820;
  color: #cbd5e1;
}

.player-identity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-avatar {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: #1a1d24;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

.status-badge.online {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.offline {
  background: #171922;
  color: #64748b;
  border: 1px solid #232733;
}

.empty-state {
  text-align: center;
  padding: 24px;
  color: #475569;
  font-style: italic;
}
