/* Custom styles for Resenha.io */

* {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

html {
  scroll-behavior: smooth;
}

body {
  overscroll-behavior: none;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #374151;
  border-radius: 2px;
}

/* Input styling */
input::placeholder {
  color: #6b7280;
}

input:focus {
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

/* Button active states */
button:active:not(:disabled) {
  transform: scale(0.97);
}

/* Avatar styles */
.avatar {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 2px solid #374151;
  transition: all 0.2s ease;
}

.avatar.selected {
  border-color: #6366f1;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.5);
  transform: scale(1.1);
}

.avatar-small {
  width: 36px;
  height: 36px;
  font-size: 18px;
}

/* Player card */
.player-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #1e293b;
  border-radius: 16px;
  transition: all 0.2s ease;
}

.player-card.host {
  border: 2px solid #f59e0b;
}

.player-card.self {
  background: linear-gradient(135deg, #1e293b, #312e81);
}

/* Game select button */
.game-select-btn.selected {
  border-color: #6366f1;
  background: linear-gradient(135deg, #1e293b, #312e81);
}

/* Progress bar */
.progress-bar {
  height: 8px;
  background: #1e293b;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar .fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #ec4899);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* Vote result bar */
.vote-bar {
  height: 32px;
  background: #1e293b;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.vote-bar .fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  transition: width 0.5s ease;
}

.vote-bar .label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-weight: 600;
  font-size: 14px;
}

/* Choice button */
.choice-btn {
  width: 100%;
  padding: 16px;
  background: #1e293b;
  border: 2px solid #374151;
  border-radius: 16px;
  text-align: center;
  font-weight: 500;
  transition: all 0.2s ease;
}

.choice-btn:active {
  border-color: #6366f1;
  background: #312e81;
}

.choice-btn.selected {
  border-color: #6366f1;
  background: linear-gradient(135deg, #312e81, #1e293b);
}

.choice-btn.correct {
  border-color: #22c55e;
  background: linear-gradient(135deg, #14532d, #1e293b);
}

.choice-btn.wrong {
  border-color: #ef4444;
  background: linear-gradient(135deg, #7f1d1d, #1e293b);
}

/* Player vote button */
.player-vote-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  background: #1e293b;
  border: 2px solid #374151;
  border-radius: 16px;
  transition: all 0.2s ease;
}

.player-vote-btn:active,
.player-vote-btn.selected {
  border-color: #6366f1;
  background: #312e81;
  transform: scale(0.95);
}

/* Team card */
.team-card {
  padding: 16px;
  border-radius: 16px;
  background: #1e293b;
}

.team-card.team-1 {
  border: 2px solid #3b82f6;
}

.team-card.team-2 {
  border: 2px solid #ef4444;
}

/* Word display */
.word-display {
  font-size: 2rem;
  font-weight: bold;
  text-align: center;
  padding: 24px;
  background: linear-gradient(135deg, #312e81, #1e293b);
  border-radius: 24px;
  border: 2px solid #6366f1;
}

/* Timer circle */
.timer-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: conic-gradient(
    #6366f1 calc(var(--progress, 100) * 3.6deg),
    #1e293b 0deg
  );
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}

.timer-circle-inner {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: bold;
}

/* Toast */
.toast {
  padding: 12px 16px;
  background: #1e293b;
  border-radius: 12px;
  margin-bottom: 8px;
  animation: slideDown 0.3s ease;
  pointer-events: auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.toast.success {
  border-left: 4px solid #22c55e;
}

.toast.error {
  border-left: 4px solid #ef4444;
}

.toast.info {
  border-left: 4px solid #3b82f6;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Reveal animation */
.reveal-card {
  perspective: 1000px;
}

.reveal-card-inner {
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.reveal-card.revealed .reveal-card-inner {
  transform: rotateY(180deg);
}

.reveal-card-front,
.reveal-card-back {
  backface-visibility: hidden;
}

.reveal-card-back {
  transform: rotateY(180deg);
}

/* Pulse animation for waiting */
.pulse-ring {
  animation: pulse-ring 1.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.8);
    opacity: 1;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

/* Score popup */
.score-popup {
  position: fixed;
  font-size: 2rem;
  font-weight: bold;
  color: #22c55e;
  animation: scoreFloat 1s ease forwards;
  pointer-events: none;
  z-index: 100;
}

@keyframes scoreFloat {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-50px) scale(1.5);
  }
}

/* Confetti */
.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  top: -10px;
  animation: confettiFall 3s linear forwards;
  pointer-events: none;
  z-index: 100;
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* Leaderboard position badges */
.position-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
}

.position-badge.gold {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
}

.position-badge.silver {
  background: linear-gradient(135deg, #9ca3af, #6b7280);
  color: #000;
}

.position-badge.bronze {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #fff;
}

/* Match indicator */
.match-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
}

.match-indicator.match {
  background: linear-gradient(135deg, #22c55e, #16a34a);
}

.match-indicator.no-match {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

/* Input answer */
.answer-input {
  width: 100%;
  padding: 16px;
  background: #1e293b;
  border: 2px solid #374151;
  border-radius: 16px;
  color: white;
  font-size: 18px;
  text-align: center;
  transition: all 0.2s ease;
}

.answer-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

/* Safe area for mobile */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  #game-actions,
  #start-section,
  #waiting-section,
  footer {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
}

/* Hide scrollbar for tabs */
.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
  display: none;
}
