/* ---------------------------------------------------------------------------
   Aperçu plein écran, partagé par le studio et la simulation.
--------------------------------------------------------------------------- */

.pv {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  grid-template-rows: auto 1fr;
  background: #101010;
  color: #f2f2f0;
  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
}

.pv[hidden] {
  display: none;
}

.pv-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid #2a2a28;
  background: #171716;
}

.pv-id {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.pv-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.pv-path {
  font-family: "Spline Mono", ui-monospace, monospace;
  font-size: 9.5px;
  color: #8d8d86;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pv-devices {
  display: flex;
  border: 1px solid #3a3a36;
}

.pv-devices button {
  padding: 7px 12px;
  border: 0;
  border-right: 1px solid #3a3a36;
  background: transparent;
  color: #b9b9b2;
  font-family: "Spline Mono", ui-monospace, monospace;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.pv-devices button:last-child {
  border-right: 0;
}

.pv-devices button:hover {
  color: #fff;
}

.pv-devices button[aria-pressed="true"] {
  background: #f2f2f0;
  color: #101010;
}

.pv-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.pv-actions button,
.pv-actions a {
  padding: 7px 11px;
  border: 1px solid #3a3a36;
  background: transparent;
  color: #e6e6e0;
  font-family: "Spline Mono", ui-monospace, monospace;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.pv-actions button:hover,
.pv-actions a:hover {
  border-color: #f2f2f0;
}

.pv-stage {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 22px;
  background:
    radial-gradient(circle at 50% 0%, #1d1d1b 0%, #101010 62%);
}

.pv-frame {
  transform-origin: center center;
  border: 1px solid #3a3a36;
  background: #fff;
  box-shadow: 0 30px 90px rgb(0 0 0 / 0.55);
  overflow: hidden;
}

.pv-frame iframe {
  display: block;
  border: 0;
  background: #fff;
}

.pv-qr {
  display: grid;
  justify-items: center;
  gap: 14px;
  max-width: 360px;
  padding: 26px;
  border: 1px solid #3a3a36;
  background: #171716;
  text-align: center;
}

.pv-qr[hidden] {
  display: none;
}

.pv-qr-code {
  width: 220px;
  height: 220px;
  padding: 12px;
  background: #fff;
}

.pv-qr-code svg {
  display: block;
  width: 100%;
  height: 100%;
}

.pv-qr-url {
  margin: 0;
  font-family: "Spline Mono", ui-monospace, monospace;
  font-size: 11px;
  word-break: break-all;
  color: #e6e6e0;
}

.pv-qr-hint {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: #8d8d86;
}

.pv-qr button {
  padding: 8px 12px;
  border: 1px solid #3a3a36;
  background: transparent;
  color: #e6e6e0;
  font-family: "Spline Mono", ui-monospace, monospace;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
}

.pv-qr button:hover {
  border-color: #f2f2f0;
}

.pv-toast {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 12px;
  background: #f2f2f0;
  color: #101010;
  font-family: "Spline Mono", ui-monospace, monospace;
  font-size: 10px;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.pv-toast.show {
  opacity: 1;
}

@media (max-width: 760px) {
  .pv-bar {
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 8px 10px;
  }
  .pv-devices {
    order: 3;
    grid-column: 1 / -1;
    width: 100%;
  }
  .pv-devices button {
    flex: 1;
    padding: 8px 6px;
  }
  .pv-actions {
    gap: 6px;
  }
  .pv-actions [data-pv-qr] {
    display: none;
  }
  .pv-stage {
    padding: 10px;
  }
  .pv-qr {
    padding: 18px;
    max-width: 100%;
  }
  .pv-qr-code {
    width: 180px;
    height: 180px;
  }
}
