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

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

#app-container {
  width: 100%;
  height: 100vh;
  position: relative;
}

.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.screen.active {
  display: flex;
}

/* Background Canvas */
#bg-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

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

.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);
  animation: titlePulse 2s ease-in-out infinite;
  letter-spacing: 8px;
}

@keyframes titlePulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.2); }
}

.subtitle {
  color: #8b949e;
  font-size: 18px;
  margin-top: 10px;
  font-weight: 500;
}

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

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

.fighter-input label {
  font-family: 'Orbitron', sans-serif;
  font-size: 14px;
  color: #00d2d3;
  display: block;
  margin-bottom: 10px;
  letter-spacing: 2px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: #161b22;
  border: 2px solid #30363d;
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.3s;
}

.input-wrapper:focus-within {
  border-color: #00d2d3;
}

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

.fighter-input input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 16px 15px;
  color: #fff;
  font-size: 16px;
  outline: none;
  font-family: 'Inter', sans-serif;
}

.fighter-input input::placeholder {
  color: #6e7681;
}

.validation-icon {
  width: 24px;
  height: 24px;
  margin-right: 15px;
  font-size: 18px;
  font-weight: bold;
}

.validation-icon.valid {
  color: #3fb950;
}

.validation-icon.invalid {
  color: #f85149;
}

.vs-text {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(32px, 8vw, 48px);
  font-weight: 900;
  color: #00d2d3;
  text-shadow: 0 0 30px rgba(0, 210, 211, 0.6);
  animation: vsPulse 1.5s ease-in-out infinite;
}

@keyframes vsPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.05); }
}

.suggestions {
  color: #6e7681;
  font-size: 14px;
  margin-bottom: 30px;
}

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

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

.battle-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: #30363d;
  box-shadow: none;
}

.footer {
  position: absolute;
  bottom: 20px;
  color: #6e7681;
  font-size: 14px;
  z-index: 1;
}

.footer a {
  color: #00d2d3;
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

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

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

.loading-content h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(24px, 5vw, 36px);
  margin-bottom: 40px;
  letter-spacing: 4px;
}

.fighters-loading {
  display: flex;
  gap: 60px;
  justify-content: center;
  flex-wrap: wrap;
}

.fighter-card {
  text-align: center;
}

.avatar-pulse {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin: 0 auto 15px;
  background-size: cover;
  background-position: center;
  animation: avatarPulse 1.5s ease-in-out infinite;
}

.avatar-pulse.red {
  box-shadow: 0 0 30px rgba(255, 71, 87, 0.6);
}

.avatar-pulse.blue {
  box-shadow: 0 0 30px rgba(83, 82, 237, 0.6);
}

@keyframes avatarPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.fighter-name {
  font-family: 'Orbitron', sans-serif;
  font-size: 16px;
  margin-bottom: 20px;
  color: #00d2d3;
}

.checklist {
  list-style: none;
  text-align: left;
}

.checklist li {
  padding: 8px 0;
  color: #6e7681;
  opacity: 0.5;
  transition: all 0.3s;
}

.checklist li::before {
  content: '○';
  margin-right: 10px;
}

.checklist li.checked {
  opacity: 1;
  color: #3fb950;
}

.checklist li.checked::before {
  content: '✓';
}

#fight-flash {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(60px, 15vw, 120px);
  font-weight: 900;
  color: #ff4757;
  text-shadow: 0 0 60px rgba(255, 71, 87, 0.8);
  opacity: 0;
  pointer-events: none;
  z-index: 100;
}

#fight-flash.show {
  animation: fightFlash 1s ease-out forwards;
}

@keyframes fightFlash {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(2); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

/* Battle Screen */
#battle-screen {
  background: #000;
}

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

#battle-hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: 20px;
  pointer-events: none;
  z-index: 10;
}

.score-display {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(36px, 8vw, 60px);
  font-weight: 900;
}

#score1 {
  color: #ff4757;
  text-shadow: 0 0 20px rgba(255, 71, 87, 0.6);
}

#score2 {
  color: #5352ed;
  text-shadow: 0 0 20px rgba(83, 82, 237, 0.6);
}

.score-separator {
  color: #fff;
}

#round-indicator {
  text-align: center;
  font-family: 'Orbitron', sans-serif;
  font-size: 18px;
  color: #00d2d3;
  margin-top: 10px;
  letter-spacing: 3px;
}

#round-announcement {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(24px, 5vw, 42px);
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 30px rgba(0, 210, 211, 0.8);
  opacity: 0;
  transition: opacity 0.3s;
  text-align: center;
  white-space: nowrap;
}

#round-announcement.show {
  opacity: 1;
}

#stat-display {
  position: fixed;
  bottom: 100px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 10%;
}

.stat-value {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(20px, 4vw, 32px);
  font-weight: 700;
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s;
}

.stat-value.show {
  opacity: 1;
  transform: translateY(0);
}

.stat-value.winner {
  transform: scale(1.2);
  text-shadow: 0 0 30px currentColor;
}

.stat-value .red {
  color: #ff4757;
}

.stat-value .blue {
  color: #5352ed;
}

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

.results-content {
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
}

.winner-section {
  text-align: center;
  margin-bottom: 40px;
}

.winner-section h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(36px, 8vw, 60px);
  color: #ffd700;
  text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
  margin-bottom: 20px;
}

.winner-avatar {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  margin: 0 auto 20px;
  background-size: cover;
  background-position: center;
  border: 4px solid #ffd700;
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.4);
}

.winner-name {
  font-family: 'Orbitron', sans-serif;
  font-size: 28px;
  color: #00d2d3;
  margin-bottom: 10px;
}

.victory-quote {
  color: #8b949e;
  font-size: 18px;
  font-style: italic;
}

.stats-table {
  background: #161b22;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 30px;
  border: 1px solid #30363d;
}

.table-header, .table-row {
  display: grid;
  grid-template-columns: 2fr 1.5fr 0.5fr 1.5fr;
  gap: 10px;
  padding: 12px 0;
  align-items: center;
}

.table-header {
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  color: #8b949e;
  border-bottom: 1px solid #30363d;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.table-row {
  font-size: 14px;
  border-bottom: 1px solid #21262d;
}

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

.table-row.total {
  font-weight: 700;
  font-size: 16px;
  border-top: 2px solid #30363d;
  margin-top: 10px;
  padding-top: 20px;
}

.red-text {
  color: #ff4757;
}

.blue-text {
  color: #5352ed;
}

.vs-col {
  text-align: center;
  color: #6e7681;
}

.winner-cell {
  color: #ffd700;
  font-weight: 600;
}

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

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

.battle-summary strong {
  color: #00d2d3;
}

.action-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary {
  font-family: 'Orbitron', sans-serif;
  font-size: 18px;
  font-weight: 700;
  padding: 18px 40px;
  background: linear-gradient(135deg, #ff4757, #ff6b4a);
  border: none;
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s;
  letter-spacing: 2px;
}

.btn-primary:hover {
  transform: scale(1.05);
  box-shadow: 0 0 30px rgba(255, 71, 87, 0.5);
}

.btn-secondary {
  font-family: 'Orbitron', sans-serif;
  font-size: 18px;
  font-weight: 700;
  padding: 18px 40px;
  background: #5352ed;
  border: none;
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s;
  letter-spacing: 2px;
}

.btn-secondary:hover {
  transform: scale(1.05);
  box-shadow: 0 0 30px rgba(83, 82, 237, 0.5);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .vs-container {
    flex-direction: column;
    gap: 15px;
  }
  
  .vs-text {
    margin: 10px 0;
  }
  
  .fighter-input {
    max-width: 100%;
  }
  
  .fighters-loading {
    gap: 30px;
  }
  
  .table-header, .table-row {
    grid-template-columns: 1.5fr 1fr 0.3fr 1fr;
    font-size: 12px;
  }
  
  #stat-display {
    padding: 0 5%;
  }
  
  .battle-button {
    padding: 16px 40px;
    font-size: 16px;
  }
}