/* --- GLOBAL STYLES --- */

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: radial-gradient(ellipse at center, #1a0f2e 0%, #100118 50%, #0a0510 100%);
  background-attachment: fixed;
  min-height: 100vh;
  color: #f0f1f5;
}

h1, h2, h3 {
  font-family: 'Georgia', 'Times New Roman', serif;
  margin: 0;
}

.page {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

/* --- VIEW SYSTEM (Deprecated - using modal now) --- */

/*
.view {
  display: none;
  width: 100%;
  flex-direction: column;
  align-items: center;
  animation: fadeIn 0.4s ease;
}

.view.active {
  display: flex;
}
*/

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

.panel {
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 20px;
  margin-bottom: 20px;
  background: rgba(26, 28, 37, 0.4);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  width: 100%;
  max-width: 600px;
}

.hidden {
  display: none;
}

/* --- FORM INPUTS --- */

label {
  display: block;
  font-size: 11px;
  color: rgba(192, 194, 207, 0.9);
  margin: 20px 0 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

input,
button,
.button-link {
  display: block;
  width: 100%;
  margin: 12px 0;
  padding: 16px 24px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(37, 42, 56, 0.5);
  backdrop-filter: blur(8px);
  color: #f0f1f5;
  text-decoration: none;
  text-align: center;
  border-radius: 12px;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
}

input {
  text-align: left;
  font-size: 16px;
}

input:focus {
  outline: none;
  border-color: rgba(171, 86, 167, 0.5);
  box-shadow: 0 0 20px rgba(171, 86, 167, 0.25);
  background: rgba(37, 42, 56, 0.7);
}

button[type="submit"],
.page-index button[type="submit"] {
  background: linear-gradient(135deg, #ab56a7, #cb2052);
  border: none;
  font-weight: 600;
  font-size: 16px;
  padding: 18px 24px;
  margin-top: 24px;
  box-shadow: 0 6px 24px rgba(171, 86, 167, 0.4);
}

button[type="submit"]:hover,
.page-index button[type="submit"]:hover {
  box-shadow: 0 8px 32px rgba(171, 86, 167, 0.6);
  transform: translateY(-2px);
  background: linear-gradient(135deg, #ab56a7, #cb2052);
}

button:hover,
.button-link:hover {
  background: rgba(55, 60, 80, 0.6);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 16px rgba(171, 86, 167, 0.3);
}

.competitor-list button {
  margin: 8px 0;
  background: rgba(37, 42, 56, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.competitor-list button:hover {
  background: rgba(55, 60, 80, 0.6);
  border-color: rgba(171, 86, 167, 0.4);
  box-shadow: 0 4px 16px rgba(171, 86, 167, 0.3);
  transform: translateX(4px);
}

/* --- INDEX PAGE --- */

.page-index {
  justify-content: center;
}

.page-index h1 {
  font-size: 48px;
  margin: 0 0 48px;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 3px;
  text-align: center;
  text-shadow: 0 0 30px rgba(171, 86, 167, 0.3);
}

.page-index .panel {
  max-width: 560px;
  padding: 32px;
}

.page-index h2 {
  font-size: 22px;
  margin: 0 0 20px;
  color: #fff;
  text-align: center;
}

#status-message {
  text-align: center;
  color: rgba(192, 194, 207, 0.9);
  margin-top: 24px;
  font-size: 15px;
}

/* --- BATTLE HEADER --- */

.page-battle h1 {
  font-size: 42px;
  margin: 20px 0 32px;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-align: center;
}

.battle-header {
  display: flex;
  flex-direction: row;
  gap: 40px;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 900px;
  margin: 40px auto 60px;
  position: relative;
}

.center-box {
  text-align: center;
  min-width: 120px;
  z-index: 10;
  position: relative;
}

.vs-shield {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #cb2052, #ab56a7);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 0 32px rgba(203, 32, 82, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.vs-shield span {
  transform: rotate(45deg);
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.countdown {
  font-size: 48px;
  margin: 0;
  letter-spacing: 2px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

/* --- FIGHTER CARDS --- */

.fighter-card {
  flex: 1;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(26, 28, 37, 0.3);
  backdrop-filter: blur(16px);
  padding: 24px;
  border-radius: 20px;
  position: relative;
  transition: all 0.4s ease;
}

#fighter-a-card {
  border-color: rgba(203, 32, 82, 0.3);
  box-shadow: 0 0 30px rgba(203, 32, 82, 0.15);
}

#fighter-a-card:hover {
  box-shadow: 0 0 40px rgba(203, 32, 82, 0.4);
}

#fighter-b-card {
  border-color: rgba(171, 86, 167, 0.3);
  box-shadow: 0 0 30px rgba(107, 21, 92, 0.15);
}

#fighter-b-card:hover {
  box-shadow: 0 0 40px rgba(171, 86, 167, 0.4);
}

.fighter-card h2 {
  font-size: 28px;
  margin: 0 0 16px 0;
  color: #fff;
}

/* --- PROGRESS BARS --- */

.bar {
  width: 100%;
  height: 28px;
  background: rgba(50, 54, 71, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  overflow: visible;
  position: relative;
  margin: 16px 0;
}

.bar-fill {
  width: 0;
  height: 100%;
  transition: width 0.6s ease;
  position: relative;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 12px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

#fighter-a-card .bar-fill {
  background: linear-gradient(90deg, #cb2052, #ff4d78);
  box-shadow: 0 0 20px rgba(203, 32, 82, 0.5);
}

#fighter-b-card .bar-fill {
  background: linear-gradient(90deg, #6b155c, #ab56a7);
  box-shadow: 0 0 20px rgba(171, 86, 167, 0.5);
}

.score-label {
  margin: 12px 0 4px;
  font-size: 12px;
  color: rgba(192, 194, 207, 0.8);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.score-value {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  color: #fff;
}

/* --- QUESTION PANEL --- */

.question-panel {
  margin: 20px 0 32px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(26, 28, 37, 0.3);
  backdrop-filter: blur(16px);
  padding: 24px;
  border-radius: 16px;
  width: 100%;
  max-width: 900px;
}

.question-title {
  margin: 0 0 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(192, 194, 207, 0.7);
}

.question-text {
  margin: 0;
  font-size: 26px;
  min-height: 60px;
  line-height: 1.4;
  color: #fff;
}

.question-enter {
  animation: question-slide 0.4s ease;
}

.question-counter {
  margin: 8px 0 0;
  font-size: 14px;
  color: rgba(192, 194, 207, 0.8);
}

/* --- ANSWERS PANEL --- */

.answers-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

.answer-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(26, 28, 37, 0.3);
  backdrop-filter: blur(16px);
  padding: 20px;
  min-height: 280px;
  border-radius: 16px;
  transition: all 0.3s ease;
}

.answer-card:nth-child(1) {
  border-color: rgba(203, 32, 82, 0.2);
}

.answer-card:nth-child(1):hover {
  box-shadow: 0 0 24px rgba(203, 32, 82, 0.3);
}

.answer-card:nth-child(2) {
  border-color: rgba(171, 86, 167, 0.2);
}

.answer-card:nth-child(2):hover {
  box-shadow: 0 0 24px rgba(171, 86, 167, 0.3);
}

.answer-card h4 {
  font-size: 18px;
  margin: 0 0 16px;
  color: #fff;
}

.answer-text {
  min-height: 160px;
  line-height: 1.5;
  color: rgba(240, 241, 245, 0.95);
  font-size: 15px;
}

.round-score {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 12px;
  margin-top: 12px;
  font-size: 13px;
  color: rgba(192, 194, 207, 0.85);
}

.flash {
  box-shadow: 0 0 32px rgba(255, 198, 74, 0.6);
}

/* --- BATTLE STATUS --- */

.battle-status {
  width: 1000px;
  max-width: 100%;
  margin: 24px auto 0;
  color: rgba(192, 194, 207, 0.9);
  text-align: center;
}

.battle-hit {
  margin: 12px 0 0;
  font-size: 36px;
  color: #ffc64a;
  font-weight: 700;
  text-shadow: 0 0 20px rgba(255, 198, 74, 0.8);
}

/* --- ANIMATIONS --- */

.countdown-pulse {
  animation: pulse 0.4s ease infinite alternate;
}

.hit-pop {
  animation: hit-pop 0.5s ease;
}

@keyframes question-slide {
  0% {
    opacity: 0;
    transform: translateY(-20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
  }
  100% {
    transform: scale(1.1);
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.8);
  }
}

@keyframes hit-pop {
  0% {
    opacity: 0;
    transform: scale(0.6);
  }
  60% {
    opacity: 1;
    transform: scale(1.1);
  }
  100% {
    opacity: 0;
    transform: scale(1);
  }
}

/* --- RESULT PAGE --- */

.page-result {
  text-align: center;
}

.page-result h1 {
  font-size: 42px;
  margin: 20px 0 16px;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.winner-badge {
  display: inline-block;
  padding: 10px 28px;
  background: linear-gradient(135deg, #cb2052, #ff4d78);
  border-radius: 24px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin: 0 0 40px;
  box-shadow: 0 4px 20px rgba(203, 32, 82, 0.4);
  color: #fff;
}

.winner-text {
  font-size: 38px;
  margin: 40px 0 12px;
  color: #fff;
  font-weight: 400;
}

.winner-subtext {
  font-size: 16px;
  color: rgba(192, 194, 207, 0.85);
  margin: 0 0 40px;
}

.cta-button {
  display: inline-block;
  padding: 16px 36px;
  background: linear-gradient(135deg, #ab56a7, #cb2052);
  border-radius: 28px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  margin: 30px 0;
  box-shadow: 0 6px 24px rgba(171, 86, 167, 0.4);
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.cta-button:hover {
  box-shadow: 0 8px 32px rgba(171, 86, 167, 0.6);
  transform: translateY(-2px);
}

.footer-url {
  font-size: 13px;
  color: rgba(192, 194, 207, 0.6);
  margin-top: 40px;
}

#result-image {
  max-width: 100%;
  border-radius: 16px;
  margin: 20px 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
