.player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
  font-family: 'JetBrains Mono', monospace;
  user-select: none;
}
.player__video {
  width: 100%;
  height: 100%;
  display: block;
}
.player__overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(transparent, rgba(0,0,0,.7));
  pointer-events: none;
  transition: opacity .3s;
  z-index: 1;
}
.player__big-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  background: #E50914;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s, opacity .2s;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
}
.player__big-play--visible {
  opacity: 1;
  pointer-events: auto;
  animation: pulse-play 2s ease-in-out infinite;
}
.player__big-play:hover {
  transform: translate(-50%, -50%) scale(1.05);
}
.player__center-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.player__center-btn {
  width: 80px;
  height: 80px;
  background: rgba(229,9,14,.9);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  transition: transform .2s;
}
.player__center-btn:hover {
  transform: scale(1.05);
}
@keyframes pulse-play {
  0%, 100% { box-shadow: 0 0 0 0 rgba(229,9,14,.4); }
  50%      { box-shadow: 0 0 0 16px rgba(229,9,14,0); }
}
.player__poster {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-color: #000;
  z-index: 2;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.player__poster[style*="display:none"],
.player__poster[style*="display: none"] { display: none !important; }
.player__play-btn {
  width: 64px;
  height: 64px;
  background: rgba(229,9,14,.9);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s;
}
.player__play-btn:hover { transform: scale(1.05); }
.player__controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  background: rgba(17,17,17,.85);
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
  z-index: 3;
}
.player__controls--visible {
  opacity: 1;
  pointer-events: auto;
}
.player__timeline {
  position: relative;
  width: 100%;
  height: 6px;
  background: #333;
  border-radius: 3px;
  cursor: pointer;
  margin-bottom: 10px;
}
.player__buffer {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: #444;
  border-radius: 3px;
}
.player__progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: #E50914;
  border-radius: 3px;
}
.player__thumb {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  background: #E50914;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  display: none;
}
.player__timeline:hover .player__thumb {
  display: block;
}
.player__seek-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  margin: 0;
  padding: 0;
}
.player__buttons {
  display: flex;
  align-items: center;
  gap: 12px;
}
.player__btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  opacity: .9;
  transition: opacity .15s;
}
.player__btn:hover {
  opacity: .7;
}
.player__btn svg {
  display: block;
}
.player__time {
  font: 13px/1 'JetBrains Mono', monospace;
  color: #ccc;
  margin-left: auto;
  white-space: nowrap;
}
.player__volume {
  display: flex;
  align-items: center;
  gap: 6px;
}
.player__volume-slider {
  width: 60px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: #333;
  border-radius: 2px;
  outline: none;
}
.player__volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: #E50914;
  border-radius: 50%;
  cursor: pointer;
}
.player__volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: #E50914;
  border-radius: 50%;
  border: none;
  cursor: pointer;
}
.player--fullscreen {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999;
  width: 100vw !important;
  height: 100vh !important;
  aspect-ratio: auto !important;
  background: #000;
}
.player--fullscreen .player__video {
  width: 100%;
  height: 100%;
}

/* Spinner */
.player__spinner {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.5);
}
.player__spinner::after {
  content: '';
  width: 48px;
  height: 48px;
  border: 4px solid #333;
  border-top-color: #E50914;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Unavailable overlay */
.player__unavailable,
.player__placeholder {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
  color: #888;
  font: 14px 'JetBrains Mono', monospace;
  text-align: center;
  padding: 24px;
}

/* Error overlay */
.player__error {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
}

/* Fade-in for modal overlay */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(.95); }
  to   { opacity: 1; transform: scale(1); }
}
#detail-overlay:not(.hidden) .detail-container {
  animation: fadeIn .25s ease-out;
}

/* Tooltip for unavailable movies */
.tooltip {
  display: inline-block;
  padding: 12px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font: 14px var(--font);
  margin-top: 8px;
}

@media (max-width: 480px) {
  .player__volume-slider { width: 40px; }
  .player__buttons { gap: 8px; }
  .player__btn svg { width: 16px; height: 16px; }
  .player__time { font-size: 11px; }
  .player__big-play { width: 48px; height: 48px; }
  .player__big-play svg { width: 36px; height: 36px; }
}
@media (max-width: 768px) and (orientation: landscape) {
  .player__btn svg { width: 14px; height: 14px; }
  .player__time { font-size: 10px; }
}
