/* GridIron Dynasty - Styles */
:root {
  --bg-dark: #0a0f0d;
  --bg-field: #2d5a27;
  --field-lines: #ffffff;
  --endzone-home: #004C54;
  --endzone-away: #C41E3A;
  --gold: #d4af37;
  --text-light: #f0f0f0;
  --text-muted: #8b9a8b;
  --scoreboard-bg: rgba(0, 0, 0, 0.9);
}

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

body {
  font-family: 'Barlow', sans-serif;
  background: var(--bg-dark);
  color: var(--text-light);
  min-height: 100vh;
  overflow: hidden;
}

h1, h2, h3 {
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 2px;
}

#game-container {
  width: 100vw;
  height: 100vh;
  position: relative;
}

/* Screens */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
}

.screen.active {
  display: flex;
}

/* Start Screen */
#start-screen {
  background: linear-gradient(135deg, #0a0f0d 0%, #1a2f1a 50%, #0a0f0d 100%);
  background-size: 400% 400%;
  animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.start-content {
  text-align: center;
  padding: 2rem;
}

.game-title {
  font-size: clamp(3rem, 12vw, 8rem);
  line-height: 0.9;
  color: var(--text-light);
  text-shadow: 4px 4px 0 var(--gold), 8px 8px 20px rgba(0,0,0,0.5);
  margin-bottom: 2rem;
}

.game-title span {
  color: var(--gold);
  font-size: 0.6em;
}

.team-setup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.team-input {
  background: rgba(255,255,255,0.05);
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
}

.team-input label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  letter-spacing: 2px;
}

.team-input input {
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--gold);
  color: var(--text-light);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.5rem;
  text-align: center;
  width: 150px;
  padding: 0.5rem;
  outline: none;
}

.color-picker {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  justify-content: center;
}

.color-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.color-btn:hover {
  transform: scale(1.1);
}

.color-btn.selected {
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.vs-badge {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  color: var(--gold);
}

.primary-btn {
  background: linear-gradient(135deg, var(--gold) 0%, #b8962e 100%);
  color: #0a0f0d;
  border: none;
  padding: 1rem 3rem;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.5rem;
  letter-spacing: 3px;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.controls-hint {
  margin-top: 1.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Game Screen */
#game-screen {
  flex-direction: column;
  background: #000;
}

/* Scoreboard */
#scoreboard {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--scoreboard-bg);
  padding: 0.75rem 1.5rem;
  z-index: 100;
  border-bottom: 3px solid var(--gold);
}

.team-score {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.team-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.25rem;
  letter-spacing: 2px;
}

.team-score .score {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.5rem;
  color: var(--gold);
}

.team-score.home .team-name {
  color: var(--endzone-home);
}

.team-score.away .team-name {
  color: var(--endzone-away);
}

.game-info {
  text-align: center;
}

.quarter {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.clock {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  color: var(--gold);
}

.down-info {
  font-size: 0.875rem;
  color: var(--text-light);
}

/* Canvas */
#game-canvas {
  display: block;
  background: var(--bg-field);
}

/* Play Selection Overlay */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.overlay.hidden {
  display: none;
}

.play-menu {
  text-align: center;
  padding: 2rem;
  max-width: 600px;
  width: 90%;
}

.play-menu.hidden {
  display: none;
}

.play-menu h2 {
  font-size: 2rem;
  color: var(--gold);
  margin-bottom: 1.5rem;
}

.plays-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.play-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.play-btn:hover {
  background: rgba(212, 175, 55, 0.1);
  border-color: var(--gold);
  transform: translateY(-2px);
}

.play-icon {
  font-size: 2rem;
}

.play-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.125rem;
  color: var(--text-light);
  letter-spacing: 1px;
}

.play-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Mobile Controls */
#mobile-controls {
  position: absolute;
  bottom: 1rem;
  left: 0;
  right: 0;
  display: none;
  justify-content: space-between;
  align-items: center;
  padding: 0 1rem;
  z-index: 150;
}

@media (max-width: 768px) {
  #mobile-controls {
    display: flex;
  }
}

.d-pad {
  display: grid;
  grid-template-areas:
    ". up ."
    "left . right"
    ". down .";
  gap: 4px;
}

.d-btn {
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: var(--text-light);
  font-size: 1.25rem;
  cursor: pointer;
}

.d-btn.up { grid-area: up; }
.d-btn.left { grid-area: left; }
.d-btn.right { grid-area: right; }
.d-btn.down { grid-area: down; }

.d-btn:active {
  background: rgba(212, 175, 55, 0.3);
}

.action-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--gold);
  border: none;
  color: #0a0f0d;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.875rem;
  cursor: pointer;
}

/* Game Messages */
#game-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--scoreboard-bg);
  border: 3px solid var(--gold);
  border-radius: 16px;
  padding: 2rem 3rem;
  text-align: center;
  z-index: 300;
  animation: messagePopIn 0.3s ease;
}

#game-message.hidden {
  display: none;
}

@keyframes messagePopIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

#message-title {
  font-size: 3rem;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

#message-text {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* Game Over Screen */
#gameover-screen {
  background: linear-gradient(135deg, #0a0f0d 0%, #1a2f1a 100%);
}

.gameover-content {
  text-align: center;
  padding: 2rem;
}

#result-title {
  font-size: clamp(3rem, 10vw, 6rem);
  color: var(--gold);
  text-shadow: 4px 4px 20px rgba(212, 175, 55, 0.3);
  margin-bottom: 1rem;
}

.final-score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  margin-bottom: 2rem;
}

.final-vs {
  color: var(--text-muted);
}

.stats-summary {
  display: flex;
  gap: 2rem;
  justify-content: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.stat span:last-child {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  color: var(--gold);
}

/* Responsive */
@media (max-width: 600px) {
  #scoreboard {
    padding: 0.5rem;
    flex-wrap: wrap;
  }
  
  .team-name {
    font-size: 1rem;
  }
  
  .team-score .score {
    font-size: 1.75rem;
  }
  
  .clock {
    font-size: 1.5rem;
  }
  
  .plays-grid {
    grid-template-columns: 1fr;
  }
}
