/* Retro 8-bit Terminal Aesthetic */

:root {
  --bg-color: #0a0a0a;
  --primary-color: #00ff41;
  --secondary-color: #00d4aa;
  --accent-color: #ff00ff;
  --warning-color: #ffff00;
  --error-color: #ff0040;
  --text-color: #00ff41;
  --text-dim: #008f24;
  --border-color: #00ff41;
  --glow-color: rgba(0, 255, 65, 0.5);
}

/* Dark amber theme alternative */
.theme-amber {
  --primary-color: #ffb000;
  --secondary-color: #ff8c00;
  --text-color: #ffb000;
  --text-dim: #8b6914;
  --border-color: #ffb000;
  --glow-color: rgba(255, 176, 0, 0.5);
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
}

/* Scanline effect */
.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15),
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 2px
  );
}

/* CRT screen glow effect */
#app::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
  z-index: 9998;
}

/* Text glow effect */
h1,
h2,
h3,
.game-title,
.big-letter,
.code-text {
  text-shadow:
    0 0 5px var(--glow-color),
    0 0 10px var(--glow-color),
    0 0 20px var(--glow-color);
}

/* Retro Buttons */
.retro-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 0.8rem;
  padding: 0.75rem 1.5rem;
  background: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  cursor: pointer;
  text-transform: uppercase;
  position: relative;
  transition: all 0.1s ease;
}

.retro-btn:hover {
  background: var(--primary-color);
  color: var(--bg-color);
  box-shadow:
    0 0 10px var(--glow-color),
    inset 0 0 10px var(--glow-color);
}

.retro-btn:active {
  transform: scale(0.98);
}

.retro-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.retro-btn:disabled:hover {
  background: transparent;
  color: var(--primary-color);
  box-shadow: none;
}

.retro-btn.primary {
  background: var(--primary-color);
  color: var(--bg-color);
}

.retro-btn.primary:hover {
  background: transparent;
  color: var(--primary-color);
}

.retro-btn.secondary {
  border-color: var(--secondary-color);
  color: var(--secondary-color);
}

.retro-btn.secondary:hover {
  background: var(--secondary-color);
  color: var(--bg-color);
}

.retro-btn.small {
  font-size: 0.6rem;
  padding: 0.4rem 0.8rem;
}

.retro-btn.large {
  font-size: 1rem;
  padding: 1rem 2rem;
}

/* Retro Inputs */
.retro-input {
  font-family: "Press Start 2P", cursive;
  font-size: 0.8rem;
  padding: 0.75rem;
  background: transparent;
  color: var(--text-color);
  border: 2px solid var(--border-color);
  outline: none;
  width: 100%;
}

.retro-input:focus {
  box-shadow:
    0 0 5px var(--glow-color),
    0 0 10px var(--glow-color);
}

.retro-input::placeholder {
  color: var(--text-dim);
}

/* Player list styling */
.player-list li {
  border: 1px solid var(--border-color);
  background: rgba(0, 255, 65, 0.05);
}

.player-list li.ready::after {
  content: "READY";
  font-size: 0.6rem;
  color: var(--primary-color);
  animation: pulse 1s infinite;
}

.player-list li.host::before {
  content: "[HOST] ";
  color: var(--accent-color);
}

/* Vote buttons */
.vote-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 0.8rem;
  width: 2rem;
  height: 2rem;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-color);
  cursor: pointer;
}

.vote-btn:hover:not(:disabled) {
  background: var(--primary-color);
  color: var(--bg-color);
}

.vote-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.vote-btn.upvote.active {
  background: var(--primary-color);
  color: var(--bg-color);
}

.vote-btn.downvote.active {
  background: var(--error-color);
  color: var(--bg-color);
  border-color: var(--error-color);
}

/* Timer styling */
.timer-display {
  color: var(--primary-color);
}

.timer-display.warning {
  color: var(--warning-color);
  text-shadow:
    0 0 5px var(--warning-color),
    0 0 10px var(--warning-color);
}

.timer-display.critical {
  color: var(--error-color);
  text-shadow:
    0 0 5px var(--error-color),
    0 0 10px var(--error-color);
}

/* Score styling */
.score-entry.valid {
  color: var(--primary-color);
}

.score-entry.invalid {
  color: var(--error-color);
}

/* Winner display */
.winner-display {
  border-color: var(--accent-color);
  background: rgba(255, 0, 255, 0.1);
}

.winner-display h3 {
  color: var(--accent-color);
  text-shadow:
    0 0 10px var(--accent-color),
    0 0 20px var(--accent-color);
}

/* Toast styling */
.toast {
  background: var(--bg-color);
  border-color: var(--primary-color);
}

.toast.error {
  border-color: var(--error-color);
  color: var(--error-color);
}

.toast.warning {
  border-color: var(--warning-color);
  color: var(--warning-color);
}

.toast.success {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* Flicker effect for screen transitions */
.screen.entering {
  animation: screenOn 0.3s ease-out;
}

@keyframes screenOn {
  0% {
    opacity: 0;
    filter: brightness(2);
  }
  50% {
    opacity: 0.5;
    filter: brightness(1.5);
  }
  100% {
    opacity: 1;
    filter: brightness(1);
  }
}

/* Pixelated border effect */
.pixel-border {
  border-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='6'%3E%3Crect width='2' height='2' fill='%2300ff41'/%3E%3Crect x='4' width='2' height='2' fill='%2300ff41'/%3E%3Crect y='4' width='2' height='2' fill='%2300ff41'/%3E%3Crect x='4' y='4' width='2' height='2' fill='%2300ff41'/%3E%3C/svg%3E")
    2 stretch;
}

/* Leaderboard position colors */
.leaderboard li:nth-child(1) .player-score,
.final-standings li:nth-child(1) .player-score {
  color: var(--accent-color);
}

.leaderboard li:nth-child(2) .player-score,
.final-standings li:nth-child(2) .player-score {
  color: var(--secondary-color);
}

.leaderboard li:nth-child(3) .player-score,
.final-standings li:nth-child(3) .player-score {
  color: var(--warning-color);
}

/* Connection status - just the dot indicator, no text */

/* Category card in answer grid */
.answer-item {
  border: 1px solid var(--border-color);
  padding: 0.75rem;
  background: rgba(0, 255, 65, 0.02);
}

.answer-item label {
  color: var(--text-dim);
}

/* Voting category card */
.voting-category {
  background: rgba(0, 255, 65, 0.02);
}

.voting-category h4 {
  color: var(--secondary-color);
}

/* Vote card */
.vote-card {
  border: 1px solid var(--border-color);
}

.vote-card.own-answer {
  border-style: dashed;
}

.vote-count.positive {
  color: var(--primary-color);
}

.vote-count.negative {
  color: var(--error-color);
}

.vote-count.neutral {
  color: var(--text-dim);
}
