/* Pixel Art Chibi Battle Universe - Custom Styles */

/* Import pixel font */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

/* Global pixel styles */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Press Start 2P', monospace;
  background: #0f0820;
  color: #fff;
  line-height: 1.6;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

/* Pixelated image rendering */
.pixelated {
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

/* Main background with pixel dithering effect */
.pixel-background {
  background: linear-gradient(45deg, #0f0820 25%, #1a0d2e 25%, #1a0d2e 50%, #0f0820 50%, #0f0820 75%, #1a0d2e 75%);
  background-size: 8px 8px;
  min-height: 100vh;
}

/* Header styles */
.pixel-header {
  position: relative;
  overflow: hidden;
  border-bottom: 4px solid #ff1493;
  box-shadow: 0 4px 0 #8a2be2;
}

@keyframes pixelGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.pixel-border-pattern {
  background-image: 
    repeating-linear-gradient(90deg, transparent 0px, transparent 2px, rgba(255,255,255,0.1) 2px, rgba(255,255,255,0.1) 4px);
}

/* Text effects */
.pixel-text-shadow {
  text-shadow: 
    2px 2px 0 #000,
    -2px -2px 0 #000,
    2px -2px 0 #000,
    -2px 2px 0 #000;
}

.pixel-text-glow {
  text-shadow: 
    0 0 5px #ff1493,
    0 0 10px #ff1493,
    0 0 15px #ff1493,
    2px 2px 0 #000,
    -2px -2px 0 #000,
    2px -2px 0 #000,
    -2px 2px 0 #000;
}

.pixel-title {
  color: #ff69b4;
  text-shadow: 2px 2px 0 #000;
}

.pixel-subtitle {
  color: #dda0dd;
  text-shadow: 1px 1px 0 #000;
}

/* Button styles */
.pixel-button,
.pixel-button-normal {
  background: linear-gradient(to bottom, #8a2be2 0%, #4b0082 100%);
  border: 2px solid #fff;
  border-radius: 0;
  color: #fff;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.1s ease;
  box-shadow: 2px 2px 0 #000;
  position: relative;
}

.pixel-button:hover,
.pixel-button-normal:hover {
  background: linear-gradient(to bottom, #9932cc 0%, #6a0dad 100%);
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #000;
}

.pixel-button-active {
  background: linear-gradient(to bottom, #ff69b4 0%, #ff1493 100%);
  border: 2px solid #fff;
  border-radius: 0;
  color: #fff;
  padding: 8px 12px;
  cursor: pointer;
  box-shadow: inset 2px 2px 0 rgba(0,0,0,0.3);
}

.pixel-button-big {
  background: linear-gradient(to bottom, #ff69b4 0%, #ff1493 100%);
  border: 3px solid #fff;
  border-radius: 0;
  color: #fff;
  padding: 12px 24px;
  cursor: pointer;
  transition: all 0.1s ease;
  box-shadow: 3px 3px 0 #000;
  text-transform: uppercase;
}

.pixel-button-big:hover {
  background: linear-gradient(to bottom, #ff8fc7 0%, #ff4da6 100%);
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 #000;
}

.pixel-button-small {
  background: linear-gradient(to bottom, #4169e1 0%, #1e90ff 100%);
  border: 2px solid #fff;
  border-radius: 0;
  color: #fff;
  padding: 4px 8px;
  cursor: pointer;
  transition: all 0.1s ease;
  box-shadow: 2px 2px 0 #000;
}

.pixel-button-small:hover {
  background: linear-gradient(to bottom, #5a7fea 0%, #3ea3ff 100%);
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #000;
}

.pixel-button-enabled {
  background: linear-gradient(to bottom, #32cd32 0%, #228b22 100%);
  border: 3px solid #fff;
  border-radius: 0;
  color: #fff;
  padding: 12px 24px;
  cursor: pointer;
  transition: all 0.1s ease;
  box-shadow: 3px 3px 0 #000;
}

.pixel-button-disabled {
  background: linear-gradient(to bottom, #696969 0%, #2f2f2f 100%);
  border: 3px solid #888;
  border-radius: 0;
  color: #ccc;
  padding: 12px 24px;
  cursor: not-allowed;
  box-shadow: 3px 3px 0 #000;
}

/* Panel styles */
.pixel-panel {
  background: linear-gradient(to bottom, #2e1065 0%, #1a0d2e 100%);
  border: 3px solid #ff69b4;
  border-radius: 0;
  box-shadow: 
    3px 3px 0 #000,
    inset -2px -2px 0 rgba(0,0,0,0.5),
    inset 2px 2px 0 rgba(255,255,255,0.1);
  position: relative;
}

.pixel-section {
  position: relative;
}

.pixel-container {
  border: 3px solid #ff69b4;
  border-radius: 0;
  box-shadow: 3px 3px 0 #000;
  overflow: hidden;
}

.pixel-overlay {
  background: linear-gradient(45deg, rgba(255,20,147,0.3) 25%, transparent 25%, transparent 50%, rgba(138,43,226,0.3) 50%, rgba(138,43,226,0.3) 75%, transparent 75%);
  background-size: 8px 8px;
}

/* Card styles */
.pixel-card {
  background: linear-gradient(to bottom, #2e1065 0%, #1a0d2e 100%);
  border: 2px solid #ff69b4;
  border-radius: 0;
  box-shadow: 2px 2px 0 #000;
  position: relative;
  cursor: pointer;
}

.pixel-card:hover {
  border-color: #ff8fc7;
  box-shadow: 
    2px 2px 0 #000,
    0 0 10px rgba(255,105,180,0.5);
}

.pixel-card-selected {
  border: 3px solid #32cd32;
  box-shadow: 
    2px 2px 0 #000,
    0 0 15px rgba(50,205,50,0.7);
}

.pixel-card-frame {
  background: linear-gradient(to bottom, #4b0082 0%, #2e1065 100%);
  border-bottom: 2px solid #ff1493;
}

.pixel-card-info {
  background: linear-gradient(to bottom, #1a0d2e 0%, #0f0820 100%);
}

.pixel-stat-label {
  font-size: 10px;
  color: #dda0dd;
  text-shadow: 1px 1px 0 #000;
}

/* Tournament card styles */
.pixel-tournament-card {
  background: linear-gradient(to bottom, #2e1065 0%, #1a0d2e 100%);
  border: 2px solid #ffd700;
  border-radius: 0;
  box-shadow: 2px 2px 0 #000;
  overflow: hidden;
}

.pixel-tournament-card:hover {
  border-color: #ffff00;
  box-shadow: 
    2px 2px 0 #000,
    0 0 10px rgba(255,215,0,0.5);
}

/* Battle arena styles */
.pixel-battle-arena {
  position: relative;
}

.pixel-battle-panel {
  background: linear-gradient(to bottom, #2e1065 0%, #1a0d2e 100%);
  border: 3px solid #ff4500;
  border-radius: 0;
  box-shadow: 3px 3px 0 #000;
}

.pixel-panel-header {
  background: linear-gradient(to right, #ff4500 0%, #ff6347 50%, #ff4500 100%);
  border-bottom: 2px solid #000;
}

.pixel-player-panel {
  background: linear-gradient(to bottom, #ff1493 0%, #c71585 100%);
  border: 2px solid #fff;
  border-radius: 0;
  box-shadow: 2px 2px 0 #000;
}

.pixel-opponent-panel {
  background: linear-gradient(to bottom, #4169e1 0%, #1e90ff 100%);
  border: 2px solid #fff;
  border-radius: 0;
  box-shadow: 2px 2px 0 #000;
}

.pixel-vs {
  color: #ffd700;
  text-shadow: 2px 2px 0 #000;
  animation: pixelPulse 1s ease-in-out infinite;
}

/* RPS Selection styles */
.pixel-rps-selection {
  background: linear-gradient(to bottom, #1a0d2e 0%, #0f0820 100%);
  border: 2px solid #ff69b4;
  border-radius: 0;
  padding: 16px;
  margin-top: 16px;
}

.pixel-rps-button {
  background: linear-gradient(to bottom, #696969 0%, #2f2f2f 100%);
  border: 2px solid #fff;
  border-radius: 0;
  padding: 12px;
  cursor: pointer;
  transition: all 0.1s ease;
  box-shadow: 2px 2px 0 #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
}

.pixel-rps-red:hover,
.pixel-rps-red.pixel-rps-selected {
  background: linear-gradient(to bottom, #ff6347 0%, #dc143c 100%);
  border-color: #ff0000;
}

.pixel-rps-blue:hover,
.pixel-rps-blue.pixel-rps-selected {
  background: linear-gradient(to bottom, #4169e1 0%, #1e90ff 100%);
  border-color: #0000ff;
}

.pixel-rps-pink:hover,
.pixel-rps-pink.pixel-rps-selected {
  background: linear-gradient(to bottom, #ff69b4 0%, #ff1493 100%);
  border-color: #ff00ff;
}

/* Leaderboard styles */
.pixel-leaderboard-entry {
  background: linear-gradient(to bottom, #2e1065 0%, #1a0d2e 100%);
  border: 2px solid #8a2be2;
  border-radius: 0;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  box-shadow: 2px 2px 0 #000;
}

.pixel-leaderboard-first {
  background: linear-gradient(to bottom, #ffd700 0%, #ffb347 100%);
  border-color: #ff8c00;
  color: #000;
}

.pixel-rank-badge {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  border: 2px solid #fff;
  font-weight: bold;
  font-size: 10px;
  margin-right: 12px;
  box-shadow: 1px 1px 0 #000;
}

.pixel-rank-1 {
  background: linear-gradient(to bottom, #ffd700 0%, #ffb347 100%);
  color: #000;
}

.pixel-rank-2 {
  background: linear-gradient(to bottom, #c0c0c0 0%, #a9a9a9 100%);
  color: #000;
}

.pixel-rank-3 {
  background: linear-gradient(to bottom, #cd7f32 0%, #b87333 100%);
  color: #fff;
}

.pixel-rank-4,
.pixel-rank-5 {
  background: linear-gradient(to bottom, #8a2be2 0%, #4b0082 100%);
  color: #fff;
}

/* Profile styles */
.pixel-avatar-frame {
  border: 4px solid #ff69b4;
  border-radius: 0;
  box-shadow: 
    2px 2px 0 #000,
    0 0 15px rgba(255,105,180,0.5);
}

.pixel-stat-box {
  background: linear-gradient(to bottom, #4b0082 0%, #2e1065 100%);
  border: 2px solid #ff69b4;
  border-radius: 0;
  padding: 8px;
  text-align: center;
  box-shadow: 2px 2px 0 #000;
}

.pixel-stat-number {
  color: #ff69b4;
  text-shadow: 1px 1px 0 #000;
}

.pixel-battle-history {
  background: linear-gradient(to bottom, #2e1065 0%, #1a0d2e 100%);
  border: 2px solid #8a2be2;
  border-radius: 0;
  padding: 8px 12px;
  box-shadow: 2px 2px 0 #000;
}

.pixel-battle-win {
  border-left: 4px solid #32cd32;
  background: linear-gradient(to right, rgba(50,205,50,0.1) 0%, transparent 30%);
}

.pixel-battle-loss {
  border-left: 4px solid #ff4500;
  background: linear-gradient(to right, rgba(255,69,0,0.1) 0%, transparent 30%);
}

.pixel-achievement-badge {
  background: linear-gradient(to bottom, #4b0082 0%, #2e1065 100%);
  border: 2px solid #ffd700;
  border-radius: 0;
  padding: 8px;
  display: flex;
  align-items: center;
  box-shadow: 2px 2px 0 #000;
}

/* Settings styles */
.pixel-settings-section {
  background: linear-gradient(to bottom, #2e1065 0%, #1a0d2e 100%);
  border: 2px solid #8a2be2;
  border-radius: 0;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 2px 2px 0 #000;
}

.pixel-select {
  background: linear-gradient(to bottom, #1a0d2e 0%, #0f0820 100%);
  border: 2px solid #ff69b4;
  border-radius: 0;
  color: #fff;
  padding: 4px 8px;
  box-shadow: 2px 2px 0 #000;
}

.pixel-input {
  background: linear-gradient(to bottom, #1a0d2e 0%, #0f0820 100%);
  border: 2px solid #ff69b4;
  border-radius: 0;
  color: #fff;
  padding: 8px;
  box-shadow: inset 2px 2px 0 rgba(0,0,0,0.5);
}

.pixel-input::placeholder {
  color: #888;
}

.pixel-toggle {
  position: relative;
  width: 48px;
  height: 24px;
}

.pixel-toggle-switch {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, #696969 0%, #2f2f2f 100%);
  border: 2px solid #fff;
  border-radius: 0;
  cursor: pointer;
  box-shadow: inset 2px 2px 0 rgba(0,0,0,0.3);
}

.pixel-toggle input:checked + .pixel-toggle-switch {
  background: linear-gradient(to bottom, #32cd32 0%, #228b22 100%);
}

.pixel-toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border: 1px solid #000;
  border-radius: 0;
  transition: transform 0.2s;
}

.pixel-toggle input:checked + .pixel-toggle-switch::after {
  transform: translateX(20px);
}

/* Footer styles */
.pixel-footer {
  background: linear-gradient(to bottom, #0f0820 0%, #000 100%);
  border-top: 4px solid #ff69b4;
  position: relative;
}

.pixel-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    #ff69b4 0px,
    #ff69b4 4px,
    #8a2be2 4px,
    #8a2be2 8px
  );
}

/* Animations */
@keyframes pixelBounce {
  0%, 20%, 60%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  80% {
    transform: translateY(-5px);
  }
}

@keyframes pixelPulse {
  0%, 100% {
    transform: scale(1);
    text-shadow: 2px 2px 0 #000, 0 0 10px #ffd700;
  }
  50% {
    transform: scale(1.1);
    text-shadow: 2px 2px 0 #000, 0 0 20px #ffd700, 0 0 30px #ffd700;
  }
}

@keyframes pixelShake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
  20%, 40%, 60%, 80% { transform: translateX(2px); }
}

/* Responsive design */
@media (max-width: 768px) {
  .font-pixel {
    font-size: 8px;
  }
  
  .pixel-button,
  .pixel-button-normal,
  .pixel-button-active {
    padding: 6px 8px;
  }
  
  .pixel-button-big {
    padding: 8px 16px;
  }
  
  .pixel-card {
    margin-bottom: 8px;
  }
  
  .pixel-panel {
    border-width: 2px;
    box-shadow: 2px 2px 0 #000;
  }
}

/* Utility classes */
.pixel-art {
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.pixel-perfect {
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Hover effects for interactive elements */
.pixel-card:hover,
.pixel-tournament-card:hover,
.pixel-button:hover,
.pixel-rps-button:hover {
  animation: pixelBounce 0.6s ease-in-out;
}

/* Custom scrollbar for pixel theme */
::-webkit-scrollbar {
  width: 12px;
  background: #0f0820;
}

::-webkit-scrollbar-track {
  background: linear-gradient(to bottom, #1a0d2e 0%, #0f0820 100%);
  border: 2px solid #ff69b4;
  border-radius: 0;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, #ff69b4 0%, #ff1493 100%);
  border: 2px solid #fff;
  border-radius: 0;
  box-shadow: 2px 2px 0 #000;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(to bottom, #ff8fc7 0%, #ff4da6 100%);
}