* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: #14161a;
  color: #e8eaed;
}

.app {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px;
}

h1 { font-size: 20px; }

.join-bar, .controls {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

label { display: flex; flex-direction: column; font-size: 13px; gap: 4px; }

input {
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #3a3f47;
  background: #1e2127;
  color: #e8eaed;
  font-size: 14px;
}

button {
  padding: 9px 16px;
  border-radius: 6px;
  border: 0;
  background: #2f81f7;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}
button:hover { opacity: 0.9; }
button.danger { background: #e5534b; }
button.off { background: #6b7280; }

.videos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.tile { position: relative; background: #000; border-radius: 8px; overflow: hidden; aspect-ratio: 16/9; }
.tile video { width: 100%; height: 100%; object-fit: cover; }
.tile .label {
  position: absolute; left: 8px; bottom: 8px;
  background: rgba(0,0,0,.6); padding: 2px 8px; border-radius: 4px; font-size: 12px;
}
.tile canvas.anno {
  position: absolute; inset: 0; z-index: 5;
  cursor: crosshair; touch-action: none;
}
.tile .maxBtn {
  position: absolute; top: 8px; right: 8px; z-index: 6;
  background: rgba(0,0,0,.6); color: #fff; border: 0; border-radius: 4px;
  padding: 5px 12px; font-size: 13px; cursor: pointer;
}
/* フルスクリーン時はタイルを画面いっぱいに */
.tile:fullscreen { width: 100vw; height: 100vh; aspect-ratio: auto; border-radius: 0; background: #000; }
.tile:fullscreen video { width: 100%; height: 100%; object-fit: cover; }

.hint { font-size: 13px; color: #aaa; margin: 0 0 12px; }

.log {
  background: #0d0f12;
  border: 1px solid #2a2e35;
  border-radius: 6px;
  padding: 12px;
  font-size: 12px;
  min-height: 60px;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
}
