#player {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #000;
  border-radius: var(--radius);
}

#player-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: calc(100vh - 170px);
  background: #000;
}

#player:fullscreen {
  border-radius: 0;
}

#player:fullscreen #player-video {
  flex: 1;
  aspect-ratio: auto;
  max-height: none;
  min-height: 0;
}

#player-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

#player-shield {
  position: absolute;
  inset: 0;
}

#player-shield.clickable {
  cursor: pointer;
}

#player-message {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  color: var(--muted);
  text-align: center;
  pointer-events: none;
}

/* On an error the frame stays visible and clickable: YouTube may be showing its own prompt there */
#player-message.error {
  inset: 0 0 auto;
  padding: 0.5rem 0.75rem;
  color: var(--text);
  background: #000c;
}

#unmute {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
}

#player-options {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: min(300px, calc(100% - 1rem));
  max-height: calc(100% - 1rem);
  padding: 0.7rem;
  overflow-y: auto;
  background: #1c1c1cf2;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

#player-options hr {
  width: 100%;
  margin: 0.2rem 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.option-label {
  font-size: 0.9em;
}

.option select {
  max-width: 160px;
  padding: 0.2em 0.3em;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.option input[type='checkbox'] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.option-value {
  color: var(--muted);
  font-size: 0.9em;
}

.option-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.8em;
}

button.icon.text {
  font-size: 0.75em;
  font-weight: 700;
}

button.icon.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

button.icon.active:hover:not(:disabled) {
  background: var(--accent-hover);
}

#controls {
  display: flex;
  flex: none;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.5rem;
  background: var(--panel);
}

#seek {
  flex: 1;
  min-width: 60px;
  accent-color: var(--accent);
}

#volume {
  width: 80px;
  accent-color: var(--accent);
}

#time {
  flex: none;
  color: var(--muted);
  font-size: 0.85em;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 600px) {
  #volume {
    display: none;
  }
}
