/* Individual screen tile */

.screen-tile {
  position: relative;
  background: #0a0a10;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  outline: 2px solid transparent;
  outline-offset: -2px;
  transition: outline-color 0.15s ease;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  min-width: 0;   /* allow grid to shrink this cell */
}

.screen-tile:hover {
  outline-color: rgba(255, 255, 255, 0.15);
}

.screen-tile--focused {
  outline-color: var(--primary, #5E6AD2);
  z-index: 1;
}

/* Video element fills the tile */
.screen-tile__video {
  width: 100%;
  height: 100%;
  min-height: 0;   /* allow flex to shrink below intrinsic video height */
  min-width: 0;
  flex: 1;
  object-fit: contain;
  background: #0a0a10;
  display: block;
}

/* Footer bar */
.screen-tile__footer {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  pointer-events: none;
}

.screen-tile__avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.screen-tile__name {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--font-family, "Inter", sans-serif);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.screen-tile__badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--green, #3a9e5c);
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  flex-shrink: 0;
}

/* Footer buttons need pointer events despite parent having none */
.screen-tile__footer button,
.screen-tile__footer a {
  pointer-events: auto;
}

/* ── Comment overlay ─────────────────────────────────────────────────────── */

.tile-subtitle {
  position: absolute;
  bottom: 50px;  /* clears the footer bar */
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  padding: 0 12px;
  pointer-events: none;
  z-index: 2;
}

.tile-subtitle__text {
  display: block;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  padding: 4px 14px;
  border-radius: 4px;
  text-align: center;
  max-width: 90%;
  pointer-events: auto;
  cursor: text;
  white-space: pre-wrap;
  word-break: break-word;
}

.tile-subtitle__input {
  position: absolute;
  bottom: 44px;   /* sits just above the footer bar */
  left: 0;
  right: 0;
  width: 100%;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.85);
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-family);
  padding: 8px 14px;
  text-align: center;
  outline: none;
  pointer-events: auto;
  z-index: 3;
}

.tile-subtitle__input:focus {
  border-top-color: rgba(255, 255, 255, 0.4);
  background: rgba(0, 0, 0, 0.92);
}
