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

:root {
  --bg-dark: #0f0f0f;
  --bg-card: #1a1a1a;
  --bg-input: #252525;
  --text-primary: #e5e5e5;
  --text-secondary: #888;
  --text-muted: #555;
  --red: #ff4444;
  --red-dark: #cc3333;
  --green: #44dd88;
  --gold: #ffaa00;
  --cyan: #44dddd;
  --border: #333;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, monospace;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* Top Navigation */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-logo-img {
  width: 32px;
  height: 32px;
}

.nav-logo {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--text-primary);
}

.nav-beta {
  font-size: 0.7rem;
  color: var(--red);
  background: rgba(255, 68, 68, 0.1);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.nav-tagline {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Stats Bar */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 4rem;
  padding: 1.5rem 2rem;
  background: linear-gradient(180deg, #1a1a1a 0%, #0f0f0f 100%);
  border-bottom: 1px solid var(--border);
}

.stat {
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--red);
  font-family: monospace;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: lowercase;
}

/* Container */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 3rem 0;
}

.hero-logo-img {
  width: 180px;
  height: 180px;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  letter-spacing: 0.05em;
}

.hero h1 .highlight {
  color: var(--red);
}

.hero-sub {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.hero-sub2 {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.hero-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-family: inherit;
}

.btn-primary {
  background: var(--red);
  color: white;
}

.btn-primary:hover {
  background: var(--red-dark);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--text-secondary);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.btn-disabled {
  background: var(--bg-input);
  color: var(--text-muted);
  cursor: not-allowed;
}

.btn-full {
  width: 100%;
  background: var(--red);
  color: white;
  text-align: center;
}

/* Token Card */
.token-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  margin: 2rem 0;
  text-align: center;
}

.token-header {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.token-name {
  font-size: 1.75rem;
  font-weight: bold;
  color: var(--cyan);
}

.token-badge {
  font-size: 0.65rem;
  background: var(--green);
  color: black;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-weight: bold;
}

.token-address {
  background: var(--bg-input);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1.5rem;
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.token-buttons {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}

/* Info Card */
.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  margin: 2rem 0;
}

.info-card h3 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.feature-list {
  list-style: none;
  margin-bottom: 1.5rem;
}

.feature-list li {
  padding: 0.5rem 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.feature-list li::before {
  content: '•';
  color: var(--red);
  margin-right: 0.75rem;
}

/* Section Header */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 2rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.section-header h2 {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: normal;
}

/* Filters */
.filters {
  display: flex;
  gap: 0.5rem;
}

.filter-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.4rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
}

.filter-btn:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

.filter-btn.active {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: var(--bg-dark);
}

.create-btn {
  background: var(--red) !important;
  border-color: var(--red) !important;
  color: white !important;
}

/* Battles Container */
#battles-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1rem 0;
}

/* Battle Card */
.battle-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.2s;
}

.battle-card.live {
  border-color: var(--red);
}

.battle-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.battle-type {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.type-badge {
  background: var(--bg-input);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.battle-status {
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-weight: 600;
}

.battle-status.live {
  background: var(--red);
  color: white;
}

.battle-status.completed {
  background: var(--green);
  color: black;
}

.battle-fighters {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.fighter {
  flex: 1;
  text-align: center;
}

.fighter-name {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.fighter-record {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.fighter-votes {
  font-size: 0.75rem;
  color: var(--gold);
  margin-top: 0.25rem;
}

.vs {
  font-size: 1.25rem;
  font-weight: bold;
  color: var(--text-muted);
}

.fighter.winner .fighter-name {
  color: var(--green);
}

.fighter.winner::after {
  content: '👑';
  display: block;
  margin-top: 0.25rem;
}

.battle-challenge {
  background: var(--bg-input);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-style: italic;
  color: var(--text-secondary);
  text-align: center;
  font-size: 0.9rem;
}

.battle-pool {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
}

.pool-amount {
  color: var(--gold);
  font-weight: 600;
  font-family: monospace;
}

.result {
  color: var(--green);
  font-weight: 600;
}

/* Rounds */
.battle-rounds {
  margin: 1rem 0;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
}

.round {
  margin-bottom: 1rem;
}

.round-header {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.round-response {
  background: var(--bg-input);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.round-response .speaker {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.round-response .text {
  color: var(--text-secondary);
}

.round-votes {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
}

/* Vote Section */
.vote-section {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-input);
  border-radius: 8px;
  margin: 1rem 0;
}

.vote-section.voted {
  color: var(--green);
  font-size: 0.9rem;
}

.vote-btn {
  background: var(--red);
  color: white;
  border: none;
  padding: 0.6rem 1.25rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.vote-btn:hover {
  background: var(--red-dark);
}

.vote-vs {
  color: var(--text-muted);
  font-weight: bold;
}

/* Betting Section */
.betting-section {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(255, 68, 68, 0.05);
  border: 1px solid var(--red);
  border-radius: 8px;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.betting-section.placed {
  background: rgba(68, 221, 136, 0.1);
  border-color: var(--green);
  color: var(--green);
}

.bet-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 120px;
}

.bet-fighter {
  font-weight: 600;
  font-size: 0.85rem;
}

.bet-odds {
  color: var(--gold);
  font-family: monospace;
  font-size: 1.1rem;
  font-weight: bold;
}

.bet-input {
  width: 80px;
  padding: 0.5rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
  text-align: center;
  font-size: 0.9rem;
}

.bet-btn-place {
  background: var(--red);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
}

.bet-divider {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.connect-prompt {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.pool-breakdown {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: var(--bg-input);
  border-radius: 4px;
}

/* Admin Controls */
.admin-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.admin-btn {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}

.admin-btn:hover {
  background: var(--text-primary);
  color: var(--bg-dark);
}

.round-info {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* Leaderboard */
.leaderboard-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.leaderboard-item:last-child {
  border-bottom: none;
}

.leaderboard-rank {
  font-size: 1.2rem;
  width: 2rem;
  text-align: center;
}

.leaderboard-name {
  flex: 1;
  font-weight: 500;
}

.leaderboard-stats {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.leaderboard-stats .wins {
  color: var(--green);
}

/* Links Section */
.links-section {
  margin: 2rem 0;
  text-align: center;
}

.links-section h3 {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.link-list a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
}

.link-list a:hover {
  color: var(--text-primary);
}

/* Footer */
footer {
  text-align: center;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

footer h4 {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

footer p {
  color: var(--text-muted);
  font-size: 0.8rem;
  max-width: 500px;
  margin: 0 auto;
}

/* Loading */
.loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-secondary);
}

.loader {
  display: inline-block;
  width: 30px;
  height: 30px;
  border: 2px solid var(--border);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  width: 90%;
  max-width: 450px;
}

.modal-content h2 {
  margin-bottom: 1.5rem;
  text-align: center;
}

.modal-content label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.modal-content select,
.modal-content input {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.modal-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.modal-buttons button {
  flex: 1;
  padding: 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

.modal-buttons button:first-child {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.modal-buttons button:last-child {
  background: var(--red);
  border: none;
  color: white;
}

/* Responsive */
@media (max-width: 600px) {
  .top-nav {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
  
  .stats-bar {
    flex-wrap: wrap;
    gap: 1.5rem;
  }
  
  .hero h1 {
    font-size: 1.5rem;
  }
  
  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .battle-fighters {
    flex-direction: column;
  }
  
  .vs {
    transform: rotate(90deg);
    margin: 0.5rem 0;
  }
  
  .section-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
}
