:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #111;
  color: #f5f5f5;
}

body {
  margin: 0;
  min-height: 100vh;
}

.container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.top-bar {
  padding: 18px 24px 8px;
  background: rgba(17, 17, 17, 0.95);
  border-bottom: 1px solid #222;
}

.top-bar h1 {
  margin: 0;
  font-size: 1.1rem;
}

.video-layout {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 0;
  background: #000;
  overflow: hidden;
}

.remote-wrapper {
  position: absolute;
  inset: 0;
}

.remote-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pip-btn,
.settings-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.settings-btn {
  right: 104px;
}

.pip-btn:hover,
.settings-btn:hover {
  background: rgba(0,0,0,0.75);
}

.settings-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.65);
  z-index: 10;
  padding: 20px;
}

.settings-modal.hidden {
  display: none;
}

.settings-panel {
  width: min(420px, 100%);
  background: #121212;
  border: 1px solid #333;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  padding: 22px;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.settings-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.settings-close {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
}

.settings-panel label {
  display: block;
  margin: 10px 0 6px;
  font-size: 0.95rem;
  color: #d2d2d2;
}

.settings-panel input {
  width: 90%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #444;
  background: #101010;
  color: #f5f5f5;
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.settings-actions button {
  padding: 10px 16px;
  border-radius: 999px;
  border: none;
  background: #2f80ed;
  color: #fff;
  cursor: pointer;
}

.settings-actions button[type="button"] {
  background: #444;
}

.settings-status {
  margin-top: 12px;
  min-height: 18px;
  color: #b0b0b0;
  font-size: 0.95rem;
}

.local-overlay {
  position: absolute;
  bottom: 20px;
  left: 20px;
  width: clamp(180px, 22vw, 280px);
  aspect-ratio: 16 / 9;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
  z-index: 2;
  touch-action: none;
  cursor: grab;
}

.local-overlay video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  padding: 14px 16px;
  background: rgba(17, 17, 17, 0.95);
  border-top: 1px solid #222;
}

.controls input,
.controls select {
  flex: 1;
  min-width: 180px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #444;
  background: #1a1a1a;
  color: #f5f5f5;
}

.controls button {
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  background: #2f80ed;
  color: #fff;
  cursor: pointer;
}

.controls button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#status {
  flex: 1 1 100%;
  margin-top: 6px;
  font-size: 0.95rem;
  text-align: center;
  color: #b0b0b0;
}

.controls input,
.controls select {
  flex: 1;
  min-width: 180px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #444;
  background: #1a1a1a;
  color: #f5f5f5;
}

.controls button {
  padding: 12px 20px;
  border: none;
  border-radius: 999px;
  background: #2f80ed;
  color: #fff;
  cursor: pointer;
  min-width: 110px;
}

.controls button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

video {
  width: 100%;
  height: auto;
  background: #000;
  border-radius: 16px;
  border: 1px solid #333;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #090909;
}

.login-card {
  width: min(420px, 100%);
  padding: 32px;
  border-radius: 20px;
  background: rgba(18, 18, 18, 0.96);
  border: 1px solid #2f2f2f;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.login-card h1 {
  margin: 0 0 20px;
  font-size: 1.55rem;
  text-align: center;
}

.login-card label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.95rem;
  color: #d0d0d0;
}

.login-card input {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 18px;
  border-radius: 12px;
  border: 1px solid #444;
  background: #111;
  color: #f5f5f5;
}

.login-card button {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: none;
  background: #2f80ed;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
}

.login-note {
  margin: 16px 0 0;
  color: #9f9f9f;
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: center;
}
