:root {
  --bg: #0f1114;
  --panel: #161a1f;
  --text: #e7ecef;
  --muted: #9aa5b1;
  --accent: #21c186;
  --danger: #ff5d5d;
  --border: #232a33;
}

html, body, #app {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
}

.app {
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
}

.tv-stage {
  position: relative;
  overflow: hidden;
  background: #0b0d10;
}

.video-wrap {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: black;
}

.info-badge {
  position: absolute;
  left: 12px;
  padding: 8px 10px;
  background: color-mix(in lab, var(--panel) 85%, transparent);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(6px);
}

.info-badge.top { top: 12px; }
.info-badge.bottom { bottom: 12px; }

.info-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #222;
  border: 1px solid var(--border);
}

.info-texts {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.channel-line {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.2px;
}

.owner-line {
  font-size: 11px;
  color: var(--muted);
}

.crt {
  position: absolute;
  right: -10px;
  bottom: -10px;
  width: 140px;
  opacity: 0.25;
  pointer-events: none;
}

.controls {
  padding: 10px;
  background: var(--panel);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

/* Left cluster: channel selection + actions */
.left-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: #0f1419;
  color: var(--text);
  padding: 10px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  min-height: 44px;
  letter-spacing: 0.2px;
}

.btn:active { transform: translateY(1px); }

.btn.accent {
  background: var(--accent);
  color: #06140f;
  border-color: #1ea873;
}

.btn.ghost {
  background: transparent;
}

/* Right cluster: settings */
.right-actions {
  display: flex;
  gap: 8px;
}

/* Sheets / Modals */
.sheet {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: var(--panel);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  border: 1px solid var(--border);
  padding: 12px;
  transform: translateY(105%);
  transition: transform 220ms ease;
  max-height: 85%;
  overflow: auto;
}

.sheet.open { transform: translateY(0); }

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 10px;
}

.sheet-title {
  font-size: 14px;
  font-weight: 700;
}

.form {
  display: grid;
  gap: 10px;
}

.field {
  display: grid;
  gap: 6px;
}

label {
  font-size: 12px;
  color: var(--muted);
}

.input, .select, .textarea {
  width: 100%;
  background: #0f1419;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  min-height: 44px;
}

.textarea { min-height: 80px; resize: vertical; }

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.helper {
  font-size: 12px;
  color: var(--muted);
}

/* Remote quick swap */
.remote {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, 1fr);
}

.remote .display {
  grid-column: 1 / -1;
  text-align: center;
  padding: 8px;
  background: #0f1419;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-weight: 700;
}

.remote .key {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0f1419;
  font-weight: 700;
  min-height: 44px;
}

.remote .wide {
  grid-column: span 3;
}

/* Reviews */
.stars {
  display: inline-flex;
  gap: 4px;
}

.star {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background: #0f1419;
  font-size: 16px;
}

.review-item {
  border: 1px solid var(--border);
  background: #0f1419;
  border-radius: 10px;
  padding: 10px;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

/* White theme */
.theme-white {
  --bg: #f7f7f8;
  --panel: #ffffff;
  --text: #101316;
  --muted: #5c6670;
  --accent: #1f8a62;
  --danger: #e23a3a;
  --border: #e7e8ea;
}

.theme-white .video { background: #000; }