* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Rajdhani', sans-serif;
  background: #0d1117;
  color: #fff;
  overflow-x: hidden;
  min-height: 100vh;
}

.screen {
  display: none;
  min-height: 100vh;
  position: relative;
}

.screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Floating Symbols */
#floating-symbols {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.floating-symbol {
  position: absolute;
  font-family: 'JetBrains Mono', monospace;
  font-size: 24px;
  color: #00d2d3;
  animation: float 20s linear infinite;
}

@keyframes float {
  0% {
    transform: translateY(100vh) rotate(0deg);
  }
  100% {
    transform: translateY(-100vh) rotate(360deg);
  }
}

/* Home Screen */
#home-screen .content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 20px;
  max-width: 900px;
  width: 100%;
}

.title {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(48px, 12vw, 72px);
  font-weight: 900;
  background: linear-gradient(135deg, #ff4757, #ff6b4a, #ffa502);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 60px rgba(255, 71, 87, 0.5);
  margin-bottom: 10px;
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
    filter: drop-shadow(0 0 20px rgba(255, 71, 87, 0.5));
  }
  to {
    filter: drop-shadow(0 0 40px rgba(255, 71, 87, 0.8));
  }
}

.subtitle {
  font-size: 20px;
  color: #8b949e;
  margin-bottom: 50px;
}

.vs-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.fighter-input {
  flex: 1;
  min-width: 250px;
  max-width: 350px;
}

.fighter-label {
  display: block;
  font-family: 'Orbitron', sans-serif;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: 2px;
}

.fighter-label.red {
  color: #ff4757;
  text-shadow: 0 0 20px rgba(255, 71, 87, 0.5);
}

.fighter-label.blue {
  color: #5352ed;
  text-shadow: 0 0 20px rgba(83, 82, 237, 0.5);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.github-icon {
  position: absolute;
  left: 15px;
  width: 20px;
  height: 20px;
  color: #8b949e;
}

.input-wrapper input {
  width: 100%;
  padding: 15px 45px;
  font-size: 16px;
  font-family: 'Rajdhani', sans-serif;
  background: rgba(30, 41, 59, 0.8);
  border: 2px solid #30363d;
  border-radius: 12px;
  color: #fff;
  transition: all 0.3s ease;
}

.input-wrapper input:focus {
  outline: none;
  border-color: #00d2d3;
  box-shadow: 0 0 20px rgba(0, 210, 211, 0.3);
}

.check-mark {
  position: absolute;
  right: 15px;
  color: #22c55e;
  font-size: 20px;
  opacity: 0;
  transform: scale(0);
  transition: all 0.3s ease;
}

.check-mark.visible {
  opacity: 1;
  transform: scale(1);
}

.vs-badge {
  font-family: 'Orbitron', sans-serif;
  font-size: 36px;
  font-weight: 900;
  color: #00d2d3;
  text-shadow: 0 0 30px rgba(0, 210, 211, 0.8);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

.battle-btn {
  font-family: 'Orbitron', sans-serif;
  font-size: 20px;
  font-weight: 700;
  padding: 20px 60px;
  background: linear-gradient(135deg, #ff4757, #ff6348);
  border: none;
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 30px rgba(255, 71, 87, 0.4);
  text-transform: uppercase;
  letter-spacing: 3px;
}

.battle-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 0 50px rgba(255, 71, 87, 0.6);
}

.battle-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(50%);
}

.example-text {
  margin-top: 20px;
  color: #8b949e;
  font-size: 14px;
}

/* Loading Screen */
#loading-screen {
  background: rgba(0, 0, 0, 0.95);
}

.loading-content {
  text-align: center;
}

.loading-title {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(24px, 5vw, 36px);
  margin-bottom: 40px;
  animation: pulse 1.5s ease-in-out infinite;
}

.avatars-container {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 30px;
  margin-bottom: 40px;
}

.avatar-loader {
  text-align: center;
}

.avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid #00d2d3;
  object-fit: cover;
}

.avatar.pulse {
  animation: avatarPulse 1s ease-in-out infinite;
}

@keyframes avatarPulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(0, 210, 211, 0.5);
  }
  50% {
    box-shadow: 0 0 40px rgba(0, 210, 211, 0.8);
  }
}

.vs-loading {
  font-size: 40px;
  margin-top: 30px;
  animation: pulse 1s ease-in-out infinite;
}

.checklist {
  margin-top: 15px;
  text-align: left;
}

.check-item {
  font-size: 14px;
  color: #22c55e;
  margin: 5px 0;
  animation: fadeIn 0.3s ease;
}

.check-icon {
  margin-right: 8px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.fight-flash {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(48px, 15vw, 100px);
  font-weight: 900;
  color: #ff4757;
  text-shadow: 0 0 50px rgba(255, 71, 87, 0.8);
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.3s ease;
}

.fight-flash.visible {
  opacity: 1;
  transform: scale(1);
  animation: fightFlash 1s ease;
}

@keyframes fightFlash {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Battle Screen */
#battle-screen {
  padding: 0;
}

#scene-container {
  width: 100%;
  height: 100vh;
  position: absolute;
  top: 0;
  left: 0;
}

#scene-container.shake {
  animation: shake 0.2s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

#battle-ui {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

.score-display {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(14px, 3vw, 24px);
  background: rgba(0, 0, 0, 0.7);
  padding: 10px 30px;
  border-radius: 30px;
  border: 2px solid #00d2d3;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.score-display.visible {
  opacity: 1;
}

.round-announce {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(24px, 5vw, 48px);
  font-weight: 700;
  color: #00d2d3;
  text-shadow: 0 0 30px rgba(0, 210, 211, 0.8);
  opacity: 0;
  transition: opacity 0.5s ease;
  text-align: center;
  white-space: nowrap;
}

.round-announce.visible {
  opacity: 1;
}

.stat-display {
  position: absolute;
  top: 30%;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 10%;
  font-family: 'Orbitron', sans-serif;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.stat-display.visible {
  opacity: 1;
}

.stat-left {
  font-size: clamp(24px, 6vw, 48px);
  color: #ff4757;
  text-shadow: 0 0 20px rgba(255, 71, 87, 0.8);
}

.stat-right {
  font-size: clamp(24px, 6vw, 48px);
  color: #5352ed;
  text-shadow: 0 0 20px rgba(83, 82, 237, 0.8);
}

.stat-type {
  font-size: clamp(14px, 3vw, 20px);
  color: #8b949e;
}

/* Results Screen */
#results-screen {
  background: linear-gradient(180deg, #0d1117 0%, #161b22 100%);
  padding: 40px 20px;
  overflow-y: auto;
}

.results-content {
  max-width: 800px;
  width: 100%;
  text-align: center;
}

.winner-title {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(36px, 8vw, 60px);
  font-weight: 900;
  background: linear-gradient(135deg, #ffd700, #ffaa00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
  animation: glow 2s ease-in-out infinite alternate;
}

.winner-avatar-container {
  margin-bottom: 40px;
}

.winner-avatar {
  width: clamp(120px, 30vw, 200px);
  height: clamp(120px, 30vw, 200px);
  border-radius: 50%;
  border: 4px solid #ffd700;
  box-shadow: 0 0 50px rgba(255, 215, 0, 0.5);
  object-fit: cover;
}

.winner-name {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(24px, 5vw, 36px);
  font-weight: 700;
  margin-top: 15px;
}

.victory-quote {
  color: #ffd700;
  font-size: 18px;
  margin-top: 5px;
  text-transform: uppercase;
  letter-spacing: 3px;
}

.stats-table {
  background: rgba(30, 41, 59, 0.5);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 30px;
  border: 1px solid #30363d;
}

.table-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  padding: 15px 0;
  border-bottom: 2px solid #00d2d3;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: clamp(12px, 3vw, 16px);
}

.table-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid #30363d;
  font-size: clamp(12px, 3vw, 16px);
}

.table-row:last-child {
  border-bottom: none;
}

.table-row.total {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  background: rgba(0, 210, 211, 0.1);
  margin: 10px -20px -20px;
  padding: 15px 20px;
  border-radius: 0 0 16px 16px;
}

.table-row .winner {
  color: #ffd700;
  font-weight: 700;
}

.stat-label {
  color: #8b949e;
  font-size: clamp(10px, 2.5vw, 14px);
}

.battle-summary {
  margin-bottom: 30px;
  color: #8b949e;
}

.battle-summary p {
  margin: 5px 0;
}

.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
  margin-bottom: 30px;
}

.btn-new {
  font-family: 'Orbitron', sans-serif;
  font-size: 16px;
  font-weight: 700;
  padding: 15px 40px;
  background: linear-gradient(135deg, #ff4757, #ff6348);
  border: none;
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 20px rgba(255, 71, 87, 0.4);
}

.btn-rematch {
  font-family: 'Orbitron', sans-serif;
  font-size: 16px;
  font-weight: 700;
  padding: 15px 40px;
  background: linear-gradient(135deg, #5352ed, #6c5ce7);
  border: none;
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 20px rgba(83, 82, 237, 0.4);
}

.btn-share {
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px;
  font-weight: 600;
  padding: 15px 30px;
  background: rgba(30, 41, 59, 0.8);
  border: 2px solid #00d2d3;
  border-radius: 12px;
  color: #00d2d3;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-new:hover,
.btn-rematch:hover,
.btn-share:hover {
  transform: scale(1.05);
}

/* Footer */
.footer {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
}

.footer a {
  color: #8b949e;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.3s ease;
}

.footer a:hover {
  color: #00d2d3;
}

#results-screen .footer {
  position: relative;
  bottom: auto;
  left: auto;
  transform: none;
  margin-top: 20px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .vs-container {
    flex-direction: column;
  }
  
  .vs-badge {
    transform: rotate(90deg);
    margin: 10px 0;
  }
  
  .fighter-input {
    max-width: 100%;
  }
  
  .avatars-container {
    flex-direction: column;
  }
  
  .vs-loading {
    transform: rotate(90deg);
    margin: 20px 0;
  }
  
  .stat-display {
    padding: 0 5%;
  }
}