/* --- MODAL SYSTEM --- */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.3s ease;
}

.modal-content {
  position: relative;
  z-index: 10000;
  background: rgba(26, 28, 37, 0.95);
  backdrop-filter: blur(16px);
  border: 2px solid rgba(255, 200, 0, 0.5);
  border-radius: 16px;
  padding: 40px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 0 40px rgba(255, 200, 0, 0.3);
  animation: modalSlideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 32px;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
  padding: 0;
  width: 32px;
  height: 32px;
}

.modal-close:hover {
  color: #ffc800;
  transform: rotate(90deg);
}

.modal-content h2 {
  margin: 0 0 24px;
  color: #ffc800;
  font-size: 28px;
  text-align: center;
  text-shadow: 0 0 20px rgba(255, 200, 0, 0.5);
}

.modal-content h3 {
  margin: 24px 0 16px;
  color: #ffc800;
  font-size: 18px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-form label {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: block;
}

.modal-form input {
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 14px 18px;
  color: #fff;
  font-size: 16px;
  transition: all 0.3s ease;
  width: 100%;
  box-sizing: border-box;
}

.modal-form input:focus {
  outline: none;
  border-color: #ffc800;
  box-shadow: 0 0 12px rgba(255, 200, 0, 0.3);
}

.modal-form input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.modal-form .button-primary {
  background: linear-gradient(135deg, #ffc800, #ff8c00);
  border: none;
  border-radius: 8px;
  padding: 14px 24px;
  color: #000;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 8px;
  box-shadow: 0 4px 16px rgba(255, 200, 0, 0.3);
}

.modal-form .button-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 200, 0, 0.5);
}

.modal-form .button-primary:active {
  transform: translateY(0);
}

.message {
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  margin: 12px 0 0;
  font-size: 14px;
}

.competitor-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.competitor-list button {
  background: rgba(255, 200, 0, 0.1);
  border: 1px solid rgba(255, 200, 0, 0.3);
  border-radius: 8px;
  padding: 12px;
  color: #ffc800;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 16px;
}

.competitor-list button:hover {
  background: rgba(255, 200, 0, 0.2);
  border-color: rgba(255, 200, 0, 0.6);
  box-shadow: 0 0 12px rgba(255, 200, 0, 0.2);
}

/* --- RESULT SECTION (Inline) --- */

.result-section {
  width: 1000px;
  max-width: 100%;
  margin: 48px auto 0;
  padding: 40px;
  background: rgba(26, 28, 37, 0.95);
  backdrop-filter: blur(16px);
  border: 2px solid rgba(255, 200, 0, 0.5);
  border-radius: 16px;
  box-shadow: 0 0 40px rgba(255, 200, 0, 0.3);
  animation: slideInFromBottom 0.6s ease;
}

.result-section.hidden {
  display: none;
}

@keyframes slideInFromBottom {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-section h2 {
  margin: 0 0 24px;
  color: #ffc800;
  font-size: 32px;
  text-align: center;
  text-shadow: 0 0 20px rgba(255, 200, 0, 0.5);
}

.result-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.winner-text {
  font-size: 24px;
  color: #fff;
  text-align: center;
  margin: 0;
}

.winner-subtext {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  margin: 0;
}

.result-image {
  max-width: 100%;
  border-radius: 8px;
  margin: 16px 0;
}

.cta-box {
  background: rgba(255, 200, 0, 0.1);
  border: 1px solid rgba(255, 200, 0, 0.3);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}

.cta-box p {
  margin: 0 0 12px;
  color: #fff;
}

.hashtags {
  text-align: center;
  color: #ffc800;
  font-size: 14px;
  margin: 12px 0;
}

.action-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 16px;
}

.footer-url {
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 12px;
  margin: 24px 0 12px;
}

/* --- MAIN VIEW --- */

.main-view {
  width: 100%;
  max-width: 1200px;
  opacity: 1;
  animation: fadeIn 0.5s ease;
}

.main-view h1 {
  width: 1000px;
  max-width: 100%;
  margin: 0 auto 24px;
  text-align: center;
}

.battle-start-btn-sticky {
  position: fixed;
  bottom: 32px;
  left: 32px;
  width: 80px;
  height: 80px;
  padding: 0;
  font-size: 36px;
  font-weight: 700;
  background: linear-gradient(135deg, #ffc800, #ff8c00);
  border: 3px solid rgba(255, 200, 0, 0.8);
  border-radius: 50%;
  color: #000;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 6px 30px rgba(255, 200, 0, 0.5);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.battle-start-btn-sticky:hover {
  transform: scale(1.1) rotate(15deg);
  box-shadow: 0 8px 40px rgba(255, 200, 0, 0.7);
}

.battle-start-btn-sticky:active {
  transform: scale(0.95);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
