* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;

  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

body {
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Inter";

  color: rgb(231, 231, 231);
  background-color: #0f0f0f;
}

.player-container {
  position: relative;
  width: 70%;
  max-width: 700px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  padding: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: float 6s ease-in-out infinite;
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.player-container.mega-mode {
  width: 85%;
  max-width: 85%;
  transform: scale(1.1);
}

@keyframes float {
  0% { 
    transform: translateY(0px) rotate(0deg) translateX(0px); 
  }
  8% { 
    transform: translateY(-12px) rotate(2deg) translateX(8px); 
  }
  15% { 
    transform: translateY(-25px) rotate(-12deg) translateX(-55px); 
  }
  23% { 
    transform: translateY(-18px) rotate(3deg) translateX(15px); 
  }
  32% { 
    transform: translateY(-30px) rotate(-1deg) translateX(-15px); 
  }
  40% { 
    transform: translateY(-22px) rotate(14deg) translateX(65px); 
  }
  48% { 
    transform: translateY(-28px) rotate(-3deg) translateX(-8px); 
  }
  56% { 
    transform: translateY(-20px) rotate(1deg) translateX(22px); 
  }
  65% { 
    transform: translateY(-26px) rotate(-16deg) translateX(-72px); 
  }
  73% { 
    transform: translateY(-15px) rotate(4deg) translateX(28px); 
  }
  82% { 
    transform: translateY(-10px) rotate(-2deg) translateX(-20px); 
  }
  90% { 
    transform: translateY(-8px) rotate(11deg) translateX(58px); 
  }
  100% { 
    transform: translateY(0px) rotate(0deg) translateX(0px); 
  }
}

.video-wrapper {
  position: relative;
  width: 100%;
  border-radius: 15px;
  overflow: hidden;
  background: #000;
  border: 5px solid #ff00ff;
  box-shadow: 0 0 30px rgba(255, 0, 255, 0.5);
}

#videoPlayer {
  width: 100%;
  border-radius: 10px;
  display: block;
}

.loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-spinner img {
  width: 32px;
  height: 32px;
  animation: spin360 1s linear infinite;
}

@keyframes spin360 {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.loading-spinner.hidden {
  display: none;
}

.controls {
  margin-top: 15px;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 15px;
  padding: 15px;
  border: 3px dashed #00ff00;
}

.progress-container {
  margin-bottom: 15px;
  position: relative;
}

.progress-bar {
  width: 100%;
  height: 20px;
  background: linear-gradient(90deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3);
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  overflow: visible;
  animation: rainbow-slide 3s linear infinite;
  border: 3px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.4), inset 0 0 10px rgba(0, 0, 0, 0.5);
}

@keyframes rainbow-slide {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

.progress-filled {
  height: 100%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.6));
  width: 0%;
  border-radius: 10px;
  transition: width 0.1s;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.9);
  position: relative;
}

.progress-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  cursor: grab;
  transition: left 0.1s;
  z-index: 5;
}

.progress-thumb:active {
  cursor: grabbing;
}

.progress-thumb.dragging {
  transition: none;
}

.progress-thumb img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.8), 0 0 30px rgba(255, 0, 255, 0.6);
  animation: thumbBounce 0.8s ease-in-out infinite;
}

@keyframes thumbBounce {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.15) rotate(180deg); }
}

.control-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: space-between;
}

button {
  background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
  border: 2px solid #fff;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

button:hover {
  transform: scale(1.2) rotate(360deg);
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.8);
}

button:active {
  transform: scale(0.9) rotate(-360deg);
}

.btn-play {
  background: linear-gradient(135deg, #00ff88, #00cc66, #00ff88);
  background-size: 200% 200%;
  animation: playGlow 2s ease-in-out infinite;
  width: 55px;
  height: 55px;
  font-size: 24px;
  border: 3px solid #00ff88;
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.6), 0 5px 15px rgba(0, 0, 0, 0.4);
}

@keyframes playGlow {
  0%, 100% { 
    background-position: 0% 50%;
    transform: scale(1);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.6), 0 5px 15px rgba(0, 0, 0, 0.4);
  }
  50% { 
    background-position: 100% 50%;
    transform: scale(1.08);
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.9), 0 8px 20px rgba(0, 0, 0, 0.5);
  }
}

.btn-backward, .btn-forward {
  background: linear-gradient(135deg, #ff6b35, #f7931e);
  width: 48px;
  height: 48px;
  font-size: 18px;
  border: 3px solid #ffaa00;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(255, 170, 0, 0.5), 0 5px 15px rgba(0, 0, 0, 0.3);
}

.btn-backward::before, .btn-forward::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shine 3s infinite;
}

@keyframes shine {
  0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
  100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.volume-container {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.1);
  padding: 10px 18px;
  border-radius: 25px;
  border: 2px solid #ff00ff;
  flex: 1;
  min-width: 200px;
  max-width: 280px;
}

.volume-icon {
  font-size: 20px;
  animation: wiggle 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-15deg); }
  75% { transform: rotate(15deg); }
}

.volume-slider {
  flex: 1;
  height: 8px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(90deg, #ff0000, #00ff00);
  border-radius: 5px;
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: #fff;
  border: 2px solid #ff00ff;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(255, 0, 255, 0.8);
}

.volume-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: #fff;
  border: 2px solid #ff00ff;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(255, 0, 255, 0.8);
}

.volume-text {
  font-weight: bold;
  color: #00ff00;
  min-width: 45px;
  text-shadow: 0 0 10px #00ff00;
  font-size: 14px;
  flex-shrink: 0;
}



.quality-selector {
  position: relative;
}

.quality-btn {
  background: linear-gradient(45deg, #8e2de2, #4a00e0);
  border-radius: 20px;
  width: auto;
  height: auto;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: bold;
  white-space: nowrap;
  flex-shrink: 0;
}

.quality-menu {
  position: absolute;
  bottom: 60px;
  right: 0;
  background: rgba(0, 0, 0, 0.95);
  border: 3px solid #8e2de2;
  border-radius: 15px;
  padding: 10px;
  display: none;
  flex-direction: column;
  gap: 8px;
  min-width: 200px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

.quality-menu.show {
  display: flex;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.quality-option {
  background: linear-gradient(45deg, #667eea, #764ba2);
  border-radius: 10px;
  width: 100%;
  padding: 10px;
  font-size: 14px;
  text-align: left;
  border: 2px solid transparent;
}

.quality-option:hover {
  transform: scale(1.05) rotate(0deg);
  border-color: #00ff00;
}

.quality-option.active {
  border-color: #00ff00;
  box-shadow: 0 0 15px rgba(0, 255, 0, 0.6);
}

.btn-fullscreen {
  background: linear-gradient(45deg, #ff0080, #ff8c00);
  font-size: 22px;
  width: 45px;
  height: 45px;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .control-buttons {
    gap: 8px;
  }
  
  button {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
  
  .btn-play {
    width: 45px;
    height: 45px;
    font-size: 20px;
  }
  
  .volume-container {
    min-width: 150px;
    padding: 8px 12px;
  }
  
  .volume-icon {
    font-size: 18px;
  }
  
  .volume-text {
    font-size: 12px;
    min-width: 38px;
  }
  
  .quality-btn {
    font-size: 12px;
    padding: 8px 12px;
  }
}

.pirt-h2 {
  font-size: 4rem;
  text-align: center;
  padding: 0 1rem;
}
