/* ── Rock Paper Scissors ── */

.rps-container {
  background: linear-gradient(145deg, #1a1a2e, #16213e 50%, #0f3460);
  border-radius: var(--radius-lg, 16px);
  padding: 24px;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow:
    inset 0 2px 20px rgba(0, 0, 0, 0.3),
    0 4px 24px rgba(0, 0, 0, 0.2);
  border: 3px solid #1e3a5f;
}

/* ── Mode Bar ── */
.rps-mode-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.rps-mode-label {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 600;
}

.rps-mode-toggle {
  display: flex;
  gap: 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.rps-mode-btn {
  padding: 6px 14px;
  border: none;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.5);
  transition: background 0.15s ease, color 0.15s ease;
}

.rps-mode-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.8);
}

.rps-mode-btn.active {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* ── Scoreboard ── */
.rps-scoreboard {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  margin-bottom: 24px;
}

.rps-player-score,
.rps-cpu-score {
  text-align: center;
  min-width: 80px;
}

.rps-score-label {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 600;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rps-score-value {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  transition: transform 0.2s ease;
}

.rps-score-value.bump {
  transform: scale(1.3);
}

.rps-player-score .rps-score-value { color: #4ecdc4; }
.rps-cpu-score .rps-score-value { color: #ff6b6b; }

.rps-vs {
  text-align: center;
  min-width: 100px;
}

.rps-round-info {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
}

.rps-streak {
  font-size: 0.75rem;
  color: #ffd700;
  margin-top: 4px;
  min-height: 18px;
}

/* ── Arena ── */
.rps-arena {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 28px;
  min-height: 160px;
}

.rps-hand {
  text-align: center;
  width: 130px;
}

.rps-hand-emoji {
  font-size: 4rem;
  line-height: 1.2;
  transition: transform 0.15s ease;
}

.rps-hand-label {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 6px;
  font-weight: 600;
}

.rps-hand.throwing .rps-hand-emoji {
  animation: rps-shake 0.4s ease-in-out;
}

@keyframes rps-shake {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  20% { transform: translateY(-15px) rotate(-5deg); }
  40% { transform: translateY(5px) rotate(3deg); }
  60% { transform: translateY(-10px) rotate(-3deg); }
  80% { transform: translateY(3px) rotate(2deg); }
}

.rps-hand.win .rps-hand-emoji {
  animation: rps-pop 0.3s ease-out;
}

@keyframes rps-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1.1); }
}

.rps-hand.lose {
  opacity: 0.5;
}

.rps-vs-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
}

.rps-result-text {
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  min-height: 28px;
  transition: opacity 0.2s ease;
}

.rps-result-text.win { color: #4ecdc4; }
.rps-result-text.lose { color: #ff6b6b; }
.rps-result-text.draw { color: #ffd700; }

/* ── Choice Buttons ── */
.rps-choices {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

.rps-choice-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 24px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.rps-choice-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.rps-choice-btn:active {
  transform: translateY(0);
}

.rps-choice-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.rps-choice-emoji {
  font-size: 2.2rem;
  line-height: 1;
}

.rps-choice-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
}

/* Highlight selected */
.rps-choice-btn.selected {
  border-color: #4ecdc4;
  background: rgba(78, 205, 196, 0.15);
}

/* ── Match Over ── */
.rps-match-over {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  border-radius: var(--radius-lg, 16px);
  animation: rps-fade-in 0.3s ease;
}

.rps-match-over.visible {
  display: flex;
}

@keyframes rps-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.rps-match-result {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.rps-match-result.win { color: #4ecdc4; }
.rps-match-result.lose { color: #ff6b6b; }

.rps-match-final {
  font-size: 1.3rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 24px;
}

.rps-play-again-btn {
  padding: 10px 32px;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  background: #ffd700;
  color: #1a1a2e;
  transition: background 0.15s ease;
}

.rps-play-again-btn:hover { background: #ffed4a; }

/* ── Stats Row ── */
.rps-stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.rps-stat {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
}

.rps-stat span {
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .rps-container { padding: 16px 12px; }
  .rps-scoreboard { gap: 20px; }
  .rps-score-value { font-size: 2rem; }
  .rps-arena { gap: 16px; min-height: 130px; }
  .rps-hand { width: 100px; }
  .rps-hand-emoji { font-size: 3rem; }
  .rps-vs-divider { min-width: 60px; }
  .rps-choices { gap: 10px; }
  .rps-choice-btn { padding: 12px 18px; }
  .rps-choice-emoji { font-size: 1.8rem; }
}

@media (max-width: 480px) {
  .rps-container { padding: 12px 8px; }
  .rps-mode-bar { flex-wrap: wrap; gap: 6px; }
  .rps-mode-btn { padding: 5px 10px; font-size: 0.72rem; }
  .rps-scoreboard { gap: 12px; margin-bottom: 16px; }
  .rps-score-value { font-size: 1.6rem; }
  .rps-score-label { font-size: 0.75rem; }
  .rps-round-info { font-size: 0.78rem; }
  .rps-arena { gap: 8px; min-height: 110px; margin-bottom: 20px; }
  .rps-hand { width: 80px; }
  .rps-hand-emoji { font-size: 2.4rem; }
  .rps-hand-label { font-size: 0.7rem; }
  .rps-vs-divider { min-width: 40px; }
  .rps-result-text { font-size: 0.9rem; }
  .rps-choices { gap: 8px; }
  .rps-choice-btn { padding: 10px 14px; border-radius: 10px; }
  .rps-choice-emoji { font-size: 1.5rem; }
  .rps-choice-name { font-size: 0.7rem; }
  .rps-stats { gap: 12px; flex-wrap: wrap; justify-content: center; }
  .rps-stat { font-size: 0.72rem; }
  .rps-match-result { font-size: 1.6rem; }
  .rps-match-final { font-size: 1rem; }
}
