:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #101412;
  color: #f5f7f2;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #101412;
}

button,
input {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  min-height: 100vh;
}

.player-area {
  position: relative;
  overflow: hidden;
  background: #050606;
}

.ad-player {
  width: 100%;
  height: 100vh;
  object-fit: contain;
  background: #050606;
}

.empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 10px;
  padding: 32px;
  text-align: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(63, 131, 248, 0.22), transparent 34%),
    linear-gradient(135deg, #111a16, #050606 62%);
}

.empty-state[hidden] {
  display: none;
}

.empty-icon {
  font-size: 56px;
  color: #89d185;
}

.empty-state h1,
.empty-state p,
.panel-header h1,
.panel-section h2,
.player-overlay h2 {
  margin: 0;
}

.empty-state h1 {
  font-size: 34px;
}

.empty-state p {
  color: #b9c5b8;
}

.player-overlay {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 4px;
  color: #a9b6a6;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.presence-pill {
  min-width: 150px;
  border: 1px solid rgba(245, 247, 242, 0.18);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(8, 10, 9, 0.72);
  color: #dbe8d6;
  text-align: center;
}

.presence-pill.active {
  border-color: rgba(137, 209, 133, 0.7);
  color: #ccffca;
}

.control-panel {
  height: 100vh;
  overflow: auto;
  border-left: 1px solid rgba(245, 247, 242, 0.12);
  background: #17201b;
  padding: 22px;
}

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

.panel-header h1 {
  font-size: 26px;
}

.icon-button,
.primary-button,
.secondary-button {
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}

.icon-button {
  width: 48px;
  background: #223229;
  color: #f5f7f2;
  font-size: 22px;
}

.panel-section {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}

.panel-section h2 {
  font-size: 16px;
}

.admin-link {
  display: grid;
  place-items: center;
  min-height: 48px;
  border: 1px solid #40614b;
  border-radius: 8px;
  background: #20352a;
  color: #eaffdf;
  font-weight: 700;
  text-decoration: none;
}

.ad-list {
  display: grid;
  gap: 8px;
}

.ad-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(245, 247, 242, 0.12);
  border-radius: 8px;
  padding: 10px;
  background: #111914;
}

.ad-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ad-item span {
  color: #a9b6a6;
  font-size: 13px;
}

.delete-button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: #3b1f24;
  color: #ffd9df;
  cursor: pointer;
}

.camera-box {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background: #080a09;
}

.camera-box video,
.camera-box canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-box canvas {
  opacity: 0;
}

.primary-button {
  background: #89d185;
  color: #071008;
  font-weight: 800;
}

.secondary-button {
  border-color: #647568;
  background: #223229;
  color: #f5f7f2;
  font-weight: 700;
}

.stats-grid {
  grid-template-columns: 1fr 1fr;
}

.stats-grid article {
  border: 1px solid rgba(245, 247, 242, 0.12);
  border-radius: 8px;
  padding: 14px;
  background: #111914;
}

.stats-grid span {
  display: block;
  font-size: 30px;
  font-weight: 800;
}

.stats-grid p,
.sync-message {
  margin: 4px 0 0;
  color: #a9b6a6;
  font-size: 13px;
}

.text-field {
  display: grid;
  gap: 6px;
  color: #c7d2c4;
  font-size: 13px;
}

.text-field input {
  min-height: 44px;
  border: 1px solid rgba(245, 247, 242, 0.16);
  border-radius: 8px;
  background: #0d130f;
  color: #f5f7f2;
  padding: 0 12px;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .control-panel {
    height: auto;
    border-left: 0;
    border-top: 1px solid rgba(245, 247, 242, 0.12);
  }

  .ad-player {
    height: 58vh;
  }
}
