/* Placeholder color palette: soft blue, light gray, white, and accent purple */
:root {
  --primary: #5a7d9a;
  --background: #f7f9fb;
  --surface: #ffffff;
  --accent: #a084ca;
  --text: #22223b;
  --muted: #bfc9d9;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
  color: var(--text);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Background Video */
#bg-video {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}

/* Video overlay for better readability */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  z-index: -1;
}

.container {
  max-width: 480px;
  margin: 2rem auto;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 1.5rem;
  box-shadow: 0 4px 24px rgba(90, 125, 154, 0.2);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  min-height: 80vh;
  backdrop-filter: blur(5px);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

header {
  text-align: center;
  margin-bottom: 1.5rem;
}

h1 {
  margin: 0;
  font-size: 2.2rem;
  color: var(--primary);
  letter-spacing: 2px;
}

.logo {
  max-width: 120px;
  height: auto;
  margin: 1rem 0;
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.subtitle {
  color: var(--accent);
  font-size: 1.1rem;
  margin-top: 0.2rem;
}

#mode-select {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.mode-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 0.7rem;
  padding: 0.8rem 2rem;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s;
}
.mode-btn:hover {
  background: var(--accent);
}

#game {
  margin-top: 1rem;
}

.players {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.player {
  flex: 1;
  text-align: center;
}

.keyboard-hint {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 500;
  margin: 0.5rem 0;
  padding: 0.3rem;
  background: rgba(160, 132, 202, 0.1);
  border-radius: 0.3rem;
  border: 1px solid rgba(160, 132, 202, 0.3);
}

.player.ai-mode .keyboard-hint {
  display: none;
}

.player.ai-mode .selection-box {
  display: none;
}

.player:not(.ai-mode) .choices {
  display: none;
}

.selection-box {
  background: var(--muted);
  border: 2px solid var(--accent);
  border-radius: 0.7rem;
  padding: 1rem;
  margin: 1rem 0;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.selection-box.selected {
  background: var(--accent);
  color: white;
  border-color: var(--primary);
}

.selection-status {
  font-size: 1.1rem;
  font-weight: 500;
  text-align: center;
}

.player.ai-mode {
  flex: 1;
  width: 100%;
}

.choices {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 0.7rem;
}

.choice {
  background: var(--muted);
  color: var(--text);
  border: none;
  border-radius: 0.5rem;
  padding: 0.7rem 0;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.choice:hover, .choice.selected {
  background: var(--accent);
  color: #fff;
}

/* Battle area with maitighar background */
.result {
  text-align: center;
  margin: 1.5rem 0 0.5rem 0;
  min-height: 10rem;
  background: 
    linear-gradient(rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.6)),
    url('back/maitighar.png');
  background-size: cover;
  background-position: center;
  border-radius: 1rem;
  padding: 1rem;
  border: 2px solid var(--muted);
  position: relative;
}

.result::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 1rem;
  z-index: 0;
}

.result > * {
  position: relative;
  z-index: 1;
}

#result-text {
  font-size: 1.2rem;
  font-weight: 500;
  min-height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

#play-again {
  display: block;
  margin: 0.5rem auto 0 auto;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 0.7rem;
  padding: 0.7rem 2rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}
#play-again:hover {
  background: var(--primary);
}

footer {
  text-align: center;
  margin-top: auto;
  color: var(--muted);
  font-size: 0.95rem;
}

footer p {
  background: linear-gradient(45deg, #a084ca, #8b5cf6, #7c3aed);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 600;
}

.hidden {
  display: none !important;
}

#countdown {
  text-align: center;
  font-size: 2rem;
  font-weight: bold;
  color: var(--accent);
  margin-bottom: 0.5rem;
  min-height: 2.5rem;
}

.battle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 3.5rem;
  margin-bottom: 0.5rem;
}

.battle-char {
  width: 40%;
  min-height: 2.5rem;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--primary);
  opacity: 0;
  transform: translateX(0);
  transition: opacity 0.3s, transform 0.6s cubic-bezier(.68,-0.55,.27,1.55);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.battle-char img {
  max-width: 100%;
  max-height: 80px;
  object-fit: contain;
  border-radius: 0.5rem;
}

.battle-char span {
  margin-top: 0.5rem;
  font-size: 1rem;
}

.battle-char.slide-in-left {
  opacity: 1;
  transform: translateX(30%);
}
.battle-char.slide-in-left.active {
  opacity: 1;
  transform: translateX(0);
}

.battle-char.slide-in-right {
  opacity: 1;
  transform: translateX(-30%);
}
.battle-char.slide-in-right.active {
  opacity: 1;
  transform: translateX(0);
}

#name-input {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.name-inputs {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 300px;
}

.name-input {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.name-input label {
  font-weight: 500;
  color: var(--text);
  font-size: 0.95rem;
}

.name-input input {
  padding: 0.8rem;
  border: 2px solid var(--muted);
  border-radius: 0.5rem;
  font-size: 1rem;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.2s;
}

.name-input input:focus {
  outline: none;
  border-color: var(--accent);
}

.name-input input::placeholder {
  color: var(--muted);
}

.points-counter {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--primary);
  color: white;
  padding: 1rem;
  border-radius: 1rem;
  margin-bottom: 1rem;
}

.score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.score span:first-child {
  font-size: 2rem;
  font-weight: bold;
}

.score-label {
  font-size: 0.9rem;
  opacity: 0.9;
}

@media (max-width: 700px) {
  .container {
    max-width: 98vw;
    padding: 1rem 0.5rem;
  }
  .players {
    flex-direction: column;
    gap: 1.5rem;
  }
  .player.ai-mode {
    width: 100%;
  }
  .battle-char {
    font-size: 1.1rem;
    width: 48%;
  }
  .name-inputs {
    max-width: 100%;
  }
  .points-counter {
    padding: 0.8rem;
  }
  .score span:first-child {
    font-size: 1.5rem;
  }
  .score-label {
    font-size: 0.8rem;
  }
} 