* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: Poppins, sans-serif;
  background: linear-gradient(135deg, #667eea, #764ba2);
  min-height: 100vh;
  color: #333;
}
#app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}
#start-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  animation: fadeIn 0.5s ease-in;
}
.logo h1 {
  font-family: Bangers, cursive;
  font-size: 6rem;
  color: #fff;
  text-shadow:
    4px 4px 0px #ff6b6b,
    8px 8px 0px rgba(0, 0, 0, 0.2);
  letter-spacing: 3px;
  margin-bottom: 10px;
  transform: rotate(-2deg);
}
.tagline {
  font-size: 1.5rem;
  color: #ffd93d;
  font-weight: 600;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  margin-bottom: 60px;
}
.player-inputs {
  display: flex;
  align-items: center;
  gap: 30px;
  margin-bottom: 40px;
  background: #fff;
  padding: 40px 50px;
  border-radius: 20px;
  box-shadow: 0 10px 40px #0000004d;
}
.input-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.input-group label {
  font-weight: 600;
  color: #667eea;
  font-size: 1.1rem;
}
.input-group input {
  padding: 15px 20px;
  border: 3px solid #667eea;
  border-radius: 12px;
  font-size: 1.2rem;
  font-family: Poppins, sans-serif;
  width: 250px;
  transition: all 0.3s;
}
.input-group input:focus {
  outline: none;
  border-color: #ff6b6b;
  transform: scale(1.02);
  box-shadow: 0 0 0 4px #ff6b6b33;
}
.vs {
  font-family: Bangers, cursive;
  font-size: 3rem;
  color: #ff6b6b;
  text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.1);
}
.btn-primary {
  padding: 18px 60px;
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #ff6b6b, #ff8e53);
  color: #fff;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 6px 20px #ff6b6b66;
  transition: all 0.3s;
  font-family: Poppins, sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px #ff6b6b99;
}
.btn-primary:active {
  transform: translateY(-1px);
}
#game-screen {
  animation: fadeIn 0.5s ease-in;
}
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  background: #fff;
  padding: 20px 30px;
  border-radius: 15px;
  box-shadow: 0 4px 15px #0003;
}
.category-display {
  display: flex;
  align-items: center;
  gap: 15px;
}
.category-label {
  font-weight: 600;
  color: #667eea;
  font-size: 1.2rem;
}
.category-name {
  font-family: Bangers, cursive;
  font-size: 2rem;
  color: #ff6b6b;
  background: #fff9e6;
  padding: 10px 25px;
  border-radius: 10px;
  border: 3px solid #ffd93d;
}
.btn-secondary {
  padding: 12px 30px;
  font-size: 1rem;
  font-weight: 600;
  background: #6c757d;
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s;
}
.btn-secondary:hover {
  background: #5a6268;
  transform: translateY(-2px);
}
.game-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}
.player-area {
  background: #fff;
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 4px 15px #0003;
  transition: all 0.3s;
  border: 4px solid transparent;
}
.player-area.active {
  border-color: #4caf50;
  box-shadow: 0 8px 30px #4caf5066;
  transform: scale(1.02);
}
.player-area.inactive {
  opacity: 0.6;
}
.player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.player-name {
  font-family: Bangers, cursive;
  font-size: 2rem;
  color: #667eea;
}
.timer {
  font-family: "Courier New", monospace;
  font-size: 2rem;
  font-weight: 700;
  color: #333;
  background: #f0f0f0;
  padding: 10px 20px;
  border-radius: 10px;
  min-width: 100px;
  text-align: center;
}
.timer-warning {
  color: #ff6b6b;
  animation: pulse 1s infinite;
}
.score {
  font-size: 1.8rem;
  font-weight: 700;
  color: #4caf50;
  text-align: center;
  background: #e8f5e9;
  padding: 15px;
  border-radius: 10px;
}
.word-input-section {
  background: #fff;
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 4px 15px #0003;
  margin-bottom: 30px;
}
.turn-indicator {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #667eea;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.input-wrapper {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}
#word-input {
  flex: 1;
  padding: 18px 25px;
  border: 3px solid #667eea;
  border-radius: 12px;
  font-size: 1.3rem;
  font-family: Poppins, sans-serif;
  transition: all 0.3s;
}
#word-input:focus {
  outline: none;
  border-color: #4caf50;
  box-shadow: 0 0 0 4px #4caf5033;
}
.btn-submit {
  padding: 18px 40px;
  font-size: 1.2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #4caf50, #45a049);
  color: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
  text-transform: uppercase;
}
.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px #4caf5066;
}
.feedback {
  text-align: center;
  font-size: 1.2rem;
  font-weight: 600;
  padding: 12px;
  border-radius: 8px;
  display: none;
}
.feedback.success {
  background: #d4edda;
  color: #155724;
  border: 2px solid #c3e6cb;
}
.feedback.error {
  background: #f8d7da;
  color: #721c24;
  border: 2px solid #f5c6cb;
}
.words-used {
  background: #fff;
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 4px 15px #0003;
}
.words-used h3 {
  font-family: Bangers, cursive;
  font-size: 1.8rem;
  color: #667eea;
  margin-bottom: 20px;
  text-align: center;
}
#words-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 300px;
  overflow-y: auto;
}
.word-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 1.1rem;
}
.word-item.player1 {
  background: linear-gradient(135deg, #e3f2fd, #bbdefb);
  border-left: 5px solid #667eea;
}
.word-item.player2 {
  background: linear-gradient(135deg, #fce4ec, #f8bbd0);
  border-left: 5px solid #ff6b6b;
}
.word-text {
  font-weight: 600;
  text-transform: uppercase;
}
.word-info {
  font-size: 0.9rem;
  color: #666;
}
@keyframes fadeIn {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}
@media (max-width: 768px) {
  .logo h1 {
    font-size: 3.5rem;
  }
  .player-inputs {
    flex-direction: column;
    gap: 20px;
    padding: 30px;
  }
  .vs {
    transform: rotate(90deg);
    font-size: 2rem;
  }
  .game-container {
    grid-template-columns: 1fr;
  }
  .input-wrapper {
    flex-direction: column;
  }
  .input-group input {
    width: 100%;
  }
}

/* Resultat-modal */
.result-modal {
  position: fixed;
  inset: 0;
  display: none; /* dold som standard */
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.result-modal.show {
  display: flex; /* visas när .show läggs till */
}

.result-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.result-dialog {
  position: relative;
  z-index: 1;
  background: #fff;
  padding: 30px 32px;
  border-radius: 20px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  max-width: 420px;
  width: 100%;
  text-align: center;
}

.result-title {
  font-size: 1.8rem;
  font-weight: 700;
}

.result-reason {
  margin-top: 4px;
  margin-bottom: 14px;
  font-size: 0.95rem;
  color: #666;
}

.result-scores {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.result-player {
  flex: 1;
  background: #f3f4ff;
  border-radius: 12px;
  padding: 10px;
}

.result-name {
  display: block;
  font-weight: 600;
  color: #667eea;
  margin-bottom: 4px;
}

.result-score {
  font-weight: 700;
  font-size: 1.1rem;
  color: #4caf50;
}

.result-winner {
  margin-bottom: 18px;
  font-size: 1.1rem;
  font-weight: 600;
}

.result-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
}
