/* 16-bit Arcade Style CSS */

/* ===== IMPORTS AND VARIABLES ===== */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

:root {
  --arcade-dark: #111111;
  --arcade-frame: #222222;
  --arcade-accent: #ff0066;
  --arcade-screen: #001122;
  --arcade-text: #00ffbb;
  
  /* Additional named colors for consistency */
  --arcade-blue: #00aaff;
  --arcade-light-blue: #00ddff;
  --arcade-yellow: #ffff00;
  --arcade-orange: #ffaa00;
  --arcade-green: #00aa44;
  --arcade-light-green: #00ff66;
  --arcade-red: #aa0000;
  --arcade-light-red: #ff0033;
}

/* ===== GENERAL STYLES ===== */
body {
  font-family: 'Press Start 2P', cursive;
  background-color: #222;
  color: var(--arcade-text);
  letter-spacing: 1px;
  line-height: 1.4;
  overflow-x: hidden;
  padding: 0;
  margin: 0;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* ===== LAYOUT & STRUCTURE ===== */
/* Arcade cabinet frame */
.arcade-cabinet {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 10px;
  background-color: var(--arcade-frame);
  border: 8px solid var(--arcade-dark);
  border-radius: 0;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.8), inset 0 0 10px rgba(0, 0, 0, 0.5);
  min-height: 100vh;
  box-sizing: border-box;
}

/* Screen effect */
.arcade-screen {
  position: relative;
  background-color: var(--arcade-screen);
  border-radius: 10px;
  padding: 10px;
  overflow: hidden;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8);
  border: 4px solid var(--arcade-dark);
}

/* Control panel */
.control-panel {
  background-color: #333;
  border-top: 8px solid var(--arcade-dark);
  padding: 20px;
  display: flex;
  justify-content: center;
  box-shadow: inset 0 5px 10px rgba(0, 0, 0, 0.5);
}

.arcade-joystick {
  width: 80px;
  height: 80px;
  background-color: var(--arcade-accent);
  border-radius: 50%;
  margin: 0 20px;
  position: relative;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.3);
}

.arcade-joystick::before {
  content: "";
  position: absolute;
  top: -30px;
  left: 30px;
  width: 20px;
  height: 50px;
  background-color: #000;
  border-radius: 10px;
}

.arcade-button {
  width: 60px;
  height: 60px;
  background-color: #ff0000;
  border-radius: 50%;
  margin: 10px;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.3);
}

/* CRT Frame */
.crt-frame {
  position: absolute;
  border: 10px solid var(--arcade-dark);
  border-radius: 20px;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  pointer-events: none;
  z-index: 9;
  box-shadow: inset 0 0 10px rgba(0, 0, 255, 0.3);
  overflow: hidden;
}

/* ===== VISUAL EFFECTS ===== */
/* Scanline effect */
.arcade-screen::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15),
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
  z-index: 10;
}

/* CRT flicker overlay */
#arcade-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(120, 235, 255, 0.03);
  pointer-events: none;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.1s;
}

/* CRT effect - curved edges */
.crt-effect {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    ellipse at center,
    transparent 50%,
    rgba(0, 0, 0, 0.3) 100%
  );
  pointer-events: none;
  z-index: 8;
}

/* Pixel corner decorations */
.pixel-corner {
  position: absolute;
  width: 12px;
  height: 12px;
  background-color: var(--arcade-accent);
  z-index: 5;
}

.pixel-corner-tl {
  top: 0;
  left: 0;
  box-shadow: 12px 0 0 0 var(--arcade-accent), 0 12px 0 0 var(--arcade-accent);
}

.pixel-corner-tr {
  top: 0;
  right: 0;
  box-shadow: -12px 0 0 0 var(--arcade-accent), 0 12px 0 0 var(--arcade-accent);
}

.pixel-corner-bl {
  bottom: 0;
  left: 0;
  box-shadow: 12px 0 0 0 var(--arcade-accent), 0 -12px 0 0 var(--arcade-accent);
}

.pixel-corner-br {
  bottom: 0;
  right: 0;
  box-shadow: -12px 0 0 0 var(--arcade-accent), 0 -12px 0 0 var(--arcade-accent);
}

/* Loading screen */
#loading-overlay {
  background-color: var(--arcade-dark);
  color: var(--arcade-text);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#loading-overlay h4 {
  font-family: 'Press Start 2P', cursive;
  color: var(--arcade-text);
  text-transform: uppercase;
  letter-spacing: 2px;
  animation: blink 1s infinite;
}

/* Pixel decoration */
.pixel-decoration {
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    var(--arcade-accent),
    var(--arcade-accent) 10px,
    transparent 10px,
    transparent 20px
  );
  margin-bottom: 10px;
}

.scanline-small {
  height: 2px;
  background: repeating-linear-gradient(
    90deg,
    rgba(0, 255, 187, 0.5),
    rgba(0, 255, 187, 0.5) 5px,
    transparent 5px,
    transparent 10px
  );
  margin: 10px auto;
  width: 80%;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Press Start 2P', cursive;
  text-transform: uppercase;
  color: var(--arcade-accent);
  text-shadow: 2px 2px 0px var(--arcade-dark);
  letter-spacing: 2px;
}

.text-white {
  color: #ffffff !important;
}

.text-muted {
  color: #00aaaa !important;
}

/* Game title */
.game-title {
  position: relative;
  text-align: center;
  padding: 10px 0;
  margin-bottom: 20px;
}

.game-title h1 {
  font-size: 2.5rem;
  margin: 0;
  padding: 10px;
  color: var(--arcade-text);
  text-shadow: 4px 4px 0 #000;
}

.game-title::before, .game-title::after {
  content: "";
  position: absolute;
  height: 4px;
  left: 50px;
  right: 50px;
  background: repeating-linear-gradient(
    90deg,
    var(--arcade-accent),
    var(--arcade-accent) 10px,
    transparent 10px,
    transparent 20px
  );
}

.game-title::before {
  top: 0;
}

.game-title::after {
  bottom: 0;
}

/* ===== CARDS & PANELS ===== */
.card {
  background-color: var(--arcade-dark);
  border: 3px solid var(--arcade-accent);
  border-radius: 0;
  box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.5);
  transform: translateZ(0);
  transition: all 0.2s;
}


.card:hover::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, 
              rgba(255, 255, 255, 0.05) 0%, 
              transparent 50%, 
              rgba(0, 0, 0, 0.05) 100%);
  pointer-events: none;
  z-index: 1;
}

.card:hover::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: rgba(255, 255, 255, 0.2);
  animation: scanline 2s linear infinite;
  pointer-events: none;
  opacity: 0.3;
  z-index: 1;
}

.card-header {
  border-bottom: 3px solid var(--arcade-accent);
  background-color: var(--arcade-dark) !important;
  color: var(--arcade-text) !important;
  text-align: center;
  font-weight: bold;
  padding: 10px;
}

#upgradesTabs{
  margin-top: 10px;
}

.card-body {
  padding: 15px;
}

.card-title {
  color: white;
  font-size: 0.7rem;
  margin-top: 1rem;
}

.card-text {
  font-size: 0.6rem;
  color: orange;
}

/* Upgrade cards */
.upgrade-card {
  background-color: var(--arcade-dark);
  border: 3px solid var(--arcade-blue);
  border-radius: 0;
  transition: all 0.2s;
}

.upgrade-card:hover {
  transform: scale(1.05);
}

.background-option {
  transition: all 0.2s;
}

.background-option:hover {
  transform: scale(1.05);
}

.upgrade-card:hover::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, 
              rgba(255, 255, 255, 0.1) 0%, 
              transparent 50%, 
              rgba(0, 0, 0, 0.1) 100%);
  pointer-events: none;
  z-index: 1;
}

.upgrade-card:hover::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: rgba(255, 255, 255, 0.3);
  animation: scanline 2s linear infinite;
  pointer-events: none;
  opacity: 0.5;
  z-index: 1;
}

.upgrade-icon {
  font-size: 2.5rem;
  filter: saturate(1.5) contrast(1.2);
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
}

.upgrade-count {
  color: red;
}

.customization-title {
  color: white;
}

.customization-description {
  color: yellow;
  margin-left: 5px;
}

/* Toast notifications */
.toast {
  background-color: var(--arcade-dark);
  border: 3px solid;
  border-radius: 0;
}

.toast-header {
  border-bottom: 3px solid;
  border-radius: 0;
}

/* ===== FORM ELEMENTS ===== */
.form-control {
  background-color: #000 !important;
  border: 2px solid var(--arcade-accent);
  border-radius: 0;
  font-family: 'Press Start 2P', cursive;
  font-size: 0.8rem;
  padding: 12px;
  height: auto;
  color: var(--arcade-text) !important;
}

.form-control::placeholder {
  color: red !important;
  opacity: 1; /* Firefox */
}

.form-control:focus {
  box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
  border-color: var(--arcade-text);
  background-color: var(--arcade-screen);
  color: var(--arcade-text) !important;
  position: relative;
  overflow: hidden;
}

.form-control:focus::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, 
              rgba(255, 255, 255, 0.05) 0%, 
              transparent 50%, 
              rgba(0, 0, 0, 0.05) 100%);
  pointer-events: none;
}

.form-control:focus::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: rgb(0, 0, 0);
  animation: scanline 2s linear infinite;
  pointer-events: none;
  opacity: 0.3;
}

/* Retro input group */
.retro-input-group {
  display: flex;
  flex: 1;
  border: 2px solid var(--arcade-blue);
  border-radius: 4px;
  overflow: hidden;
  background-color: rgba(0, 17, 51, 0.8);
  transition: all 0.3s ease;
}

.retro-input-group:focus-within {
  box-shadow: 0 0 0 2px rgba(0, 170, 255, 0.5);
}

.retro-input {
  background-color: transparent !important;
  border: none !important;
  color: #ffffff !important;
  letter-spacing: 1px;
  padding: 12px 15px !important;
  height: auto !important;
  font-size: 0.9rem !important;
  flex: 1;
}

.retro-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.retro-input:focus {
  box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
  background-color: var(--arcade-screen);
  color: var(--arcade-text);
  position: relative;
  overflow: hidden;
}

.retro-input:focus::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, 
              rgba(255, 255, 255, 0.05) 0%, 
              transparent 50%, 
              rgba(0, 0, 0, 0.05) 100%);
  pointer-events: none;
}

.retro-input:focus::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: rgba(255, 255, 255, 0.2);
  animation: scanline 2s linear infinite;
  pointer-events: none;
  opacity: 0.3;
}

/* ===== TABLES ===== */
.table {
  border: 3px solid var(--arcade-accent);
  color: white;
}

.table thead th {
  background-color: var(--arcade-dark);
  border-bottom: 3px solid var(--arcade-accent);
  text-transform: uppercase;
  font-size: 0.8rem;
  color: lime;
}



.table tr.highlight {
  background-color: rgba(0, 255, 200, 0.15);
}

/* Highlighting for first place */
#players-body tr:first-child td {
  background-color: yellow;
  animation: infiniteStrobeYellowRed 1s infinite linear;
  line-height: 1.5;
}

/* ===== BUTTONS ===== */
.btn {
  font-family: 'Press Start 2P', cursive;
  border-radius: 0;
  border: 3px solid;
  box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.5);
  transition: all 0.1s;
  text-transform: uppercase;
  font-size: 0.8rem;
  padding: 10px 15px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
  position: relative;
  overflow: hidden;
}

.btn:hover::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, 
              rgba(255, 255, 255, 0.1) 0%, 
              transparent 50%, 
              rgba(0, 0, 0, 0.1) 100%);
  pointer-events: none;
}

.btn:hover::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: rgba(255, 255, 255, 0.3);
  animation: scanline 2s linear infinite;
  pointer-events: none;
  opacity: 0.5;
}

.btn:active {
  transform: scale(0.95);
  box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.5);
}

.btn-primary {
  background-color: #0066ff;
  border-color: #00ccff;
  color: white;
}

.btn-success {
  background-color: var(--arcade-green);
  border-color: var(--arcade-light-green);
  color: white;
}

.btn-danger {
  background-color: var(--arcade-red);
  border-color: var(--arcade-light-red);
  color: white;
}

.btn-warning {
  background-color: #aa5500;
  border-color: var(--arcade-orange);
  color: white;
}

/* Retro buttons */
.retro-btn {
  background-color: var(--arcade-blue);
  color: #000033;
  border: none;
  font-weight: bold;
  padding: 10px 20px;
  letter-spacing: 1px;
  transition: all 0.2s ease;
}

.retro-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
  position: relative;
  overflow: hidden;
  background-color: var(--arcade-light-blue);
}

.retro-btn:hover::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, 
              rgba(255, 255, 255, 0.1) 0%, 
              transparent 50%, 
              rgba(0, 0, 0, 0.1) 100%);
  pointer-events: none;
}

.retro-btn:hover::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: rgba(255, 255, 255, 0.3);
  animation: scanline 2s linear infinite;
  pointer-events: none;
  opacity: 0.5;
}

.retro-btn:active {
  transform: scale(0.95);
}

.retro-btn-danger {
  background-color: var(--arcade-accent);
  color: #ffffff;
  border: none;
  padding: 10px 20px;
  font-weight: bold;
  letter-spacing: 1px;
}

.retro-btn-danger:hover {
  transform: scale(1.05);
  box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
  position: relative;
  overflow: hidden;
  filter: brightness(1.5);
}

.retro-btn-danger:hover::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, 
              rgba(255, 255, 255, 0.1) 0%, 
              transparent 50%, 
              rgba(0, 0, 0, 0.1) 100%);
  pointer-events: none;
}

.retro-btn-danger:hover::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: rgba(255, 255, 255, 0.3);
  animation: scanline 2s linear infinite;
  pointer-events: none;
  opacity: 0.5;
}

.retro-btn-danger:active {
  transform: scale(0.95);
}

.retro-btn-secondary {
  background-color: #333;
  color: #ffffff;
  border: none;
  padding: 10px 20px;
  letter-spacing: 1px;
}

.retro-btn-secondary:hover {
  transform: scale(1.05);
  box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
  position: relative;
  overflow: hidden;
}

.retro-btn-secondary:hover::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, 
              rgba(255, 255, 255, 0.1) 0%, 
              transparent 50%, 
              rgba(0, 0, 0, 0.1) 100%);
  pointer-events: none;
}

.retro-btn-secondary:hover::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: rgba(255, 255, 255, 0.3);
  animation: scanline 2s linear infinite;
  pointer-events: none;
  opacity: 0.5;
}

.retro-btn-secondary:active {
  transform: scale(0.95);
}

/* ===== NAVIGATION & TABS ===== */
.nav-tabs {
  border-bottom: 3px solid var(--arcade-accent);
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.nav-tabs .nav-item {
  margin-bottom: -3px;
  flex-grow: 1;
  flex-basis: 0;
  min-width: 100px;
}

.nav-tabs .nav-link {
  font-family: 'Press Start 2P', cursive;
  border-radius: 0;
  border: 3px solid var(--arcade-accent);
  padding: 8px 10px;
  margin-right: 2px;
  background-color: var(--arcade-dark);
  color: var(--arcade-text);
  font-size: 0.7rem;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.nav-tabs .nav-link:hover:not(.active) {
  transform: scale(1.05);
  box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
  position: relative;
  overflow: hidden;
  color: red;
  transition: all 0.2s ease-in-out;
  text-shadow: 2px 2px 0 rgba(255, 255, 255, 0.5);
}

.nav-tabs .nav-link:hover:not(.active)::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, 
              rgba(255, 255, 255, 0.1) 0%, 
              transparent 50%, 
              rgba(0, 0, 0, 0.1) 100%);
  pointer-events: none;
}

.nav-tabs .nav-link:hover:not(.active)::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: rgba(255, 255, 255, 0.3);
  animation: scanline 2s linear infinite;
  pointer-events: none;
  opacity: 0.5;
}

.nav-tabs .nav-link.active {
  background-color: var(--arcade-accent);
  color: white;
  border-color: var(--arcade-accent);
}

.tab-content {
  background-color: var(--arcade-dark);
  border: 3px solid var(--arcade-accent);
  border-top: none;
}

#upgradesTabContent {
  border: none;
}

/* ===== GAMEPLAY ELEMENTS ===== */
/* Emoji styling */
.emoji-container {
  position: relative;
  width: 100%;
  height: 60vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: visible;
}

.emoji {
  font-size: 8rem;
  filter: saturate(1.5) contrast(1.2);
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.3);
  transform-style: preserve-3d;
  position: relative;
  z-index: 35;
  cursor: pointer;
}

.emoji:active {
  transform: scale(0.9) rotateY(10deg);
}

/* Floating Emoji Animation */
#floating-emojis {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  pointer-events: none;
}

.floating-emoji {
  position: absolute;
  animation: float 2s ease-out forwards;
  pointer-events: none;
  opacity: 1;
  font-size: 2rem;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
  z-index: 25;
}

/* Player/game elements */
.player-item {
  background-color: var(--arcade-dark);
  border: 2px solid var(--arcade-blue);
  color: var(--arcade-text);
  z-index: 999999;
}

.player-item:hover {
  transform: scale(1.05);
  border-color: var(--arcade-accent);
  background-color: #001144;
  box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
  position: relative;
  overflow: hidden;
}

.player-item:hover::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, 
              rgba(255, 255, 255, 0.1) 0%, 
              transparent 50%, 
              rgba(0, 0, 0, 0.1) 100%);
  pointer-events: none;
}

.player-item:hover::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: rgba(255, 255, 255, 0.3);
  animation: scanline 2s linear infinite;
  pointer-events: none;
  opacity: 0.5;
}

.sabotage-item {
  background-color: var(--arcade-dark);
  border: 2px solid var(--arcade-light-red);
  color: var(--arcade-orange);
}

.game-key {
  background-color: var(--arcade-dark);
  color: var(--arcade-text);
  border: 2px solid var(--arcade-accent);
}

.counter {
  color: var(--arcade-text);
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
}

.stats {
  color: var(--arcade-yellow);
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
}

.auto-click-indicator {
  animation: pulse 2s infinite;
  color: var(--arcade-orange);
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
}

/* ===== CHAT SYSTEM ===== */
.arcade-chat-container {
  position: relative;
  background-color: var(--arcade-dark);
  border: 3px solid var(--arcade-accent);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  border-radius: 4px;
}

.chat-title-section {
  padding: 12px 15px;
  background-color: rgba(0, 17, 34, 0.8);
  border-bottom: 3px solid var(--arcade-accent);
  position: relative;
}

.chat-title-section h3 {
  color: var(--arcade-text);
  text-shadow: 3px 3px 0 #000;
  letter-spacing: 3px;
  margin-bottom: 10px;
}

.chat-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.chat-mode-selector {
  display: flex;
  gap: 8px;
}

.chat-mode-btn {
  background-color: var(--arcade-dark);
  border: 2px solid var(--arcade-blue);
  color: var(--arcade-text);
  padding: 8px 15px;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: 'Press Start 2P', cursive;
  transition: all 0.2s ease;
  border-radius: 4px;
}

.chat-mode-btn:hover:not(.active) {
  transform: scale(1.05);
  box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
  position: relative;
  overflow: hidden;
  background-color: rgba(0, 170, 255, 0.2);
}

.chat-mode-btn:hover:not(.active)::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, 
              rgba(255, 255, 255, 0.1) 0%, 
              transparent 50%, 
              rgba(0, 0, 0, 0.1) 100%);
  pointer-events: none;
}

.chat-mode-btn:hover:not(.active)::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: rgba(255, 255, 255, 0.3);
  animation: scanline 2s linear infinite;
  pointer-events: none;
  opacity: 0.5;
}

.chat-mode-btn.active {
  background-color: var(--arcade-blue);
  color: #000033;
  transform: translateY(2px);
  box-shadow: 0 0 8px rgba(0, 170, 255, 0.5);
}

.status-indicator {
  color: var(--arcade-yellow);
  font-size: 0.8rem;
  letter-spacing: 1px;
}

.chat-screen {
  position: relative;
  padding: 15px;
  background-color: rgba(0, 0, 0, 0.25);
}

.chat-screen::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.1),
      rgba(0, 0, 0, 0.1) 1px,
      transparent 1px,
      transparent 2px
  );
  pointer-events: none;
  z-index: 1;
}

.chat-header {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--arcade-blue);
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.channel-name {
  color: var(--arcade-text);
  font-weight: bold;
  letter-spacing: 1px;
  font-size: 0.9rem;
  text-transform: uppercase;
  position: relative;
}

.channel-name::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--arcade-text), transparent);
}

.connection-status {
  font-size: 0.8rem;
  color: #bbbbbb;
  padding: 3px 8px;
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  border-left: 2px solid var(--arcade-blue);
}

.chat-messages-container {
  min-height: 60vh;
  max-height: 60vh;
  overflow-y: auto;
  padding: 15px;
  margin-bottom: 15px;
  background-color: rgba(0, 17, 34, 0.7);
  border: 2px solid var(--arcade-blue);
  position: relative;
  z-index: 2;
  scroll-behavior: smooth;
  border-radius: 2px;
}

/* Message styles */
.chat-message {
  margin-bottom: 15px;
  padding: 10px 12px;
  border-radius: 4px;
  position: relative;
  word-break: break-word;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(2px);
  transition: all 0.2s ease;
}

.chat-message:hover {
  box-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
  position: relative;
  overflow: hidden;
}

.chat-message:hover::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, 
              rgba(255, 255, 255, 0.05) 0%, 
              transparent 50%, 
              rgba(0, 0, 0, 0.05) 100%);
  pointer-events: none;
  z-index: 1;
}

.chat-message:hover::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: rgba(255, 255, 255, 0.2);
  animation: scanline 2s linear infinite;
  pointer-events: none;
  opacity: 0.3;
  z-index: 1;
}

.message-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.7rem;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.2);
  padding-bottom: 5px;
}

.message-sender-info {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.message-sender {
  font-weight: bold;
  color: var(--arcade-yellow);
  letter-spacing: 1px;
}

.message-id {
  font-size: 0.65rem;
  color: #999;
  font-family: 'Courier New', monospace;
  background-color: rgba(0, 0, 0, 0.3);
  padding: 2px 5px;
  border-radius: 3px;
  opacity: 0.7;
  transition: opacity 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}

.chat-message:hover .message-id {
  opacity: 1;
  max-width: none;
}

.message-time {
  color: #bbbbbb;
  font-size: 0.6rem;
  background-color: rgba(0, 0, 0, 0.3);
  padding: 2px 5px;
  border-radius: 3px;
}

.message-content {
  font-size: 0.85rem;
  line-height: 1.5;
  color: white;
  padding: 2px;
}

.message-emoji {
  font-size: 1rem;
  display: inline-block;
}

.message-emoji img.smallIconImg {
  width: 18px;
  height: 18px;
  vertical-align: middle;
}

.message-clicks {
  font-size: 0.8em;
  color: var(--arcade-text);
  margin-left: 5px;
  font-family: 'Courier New', monospace;
}

.self-message {
  background-color: rgba(0, 85, 51, 0.6);
  border-left: 3px solid #00aa66;
}

.self-message .message-sender {
  color: var(--arcade-text);
}

.other-message {
  background-color: rgba(34, 0, 51, 0.6);
  border-left: 3px solid #6600aa;
}

.system-message {
  margin-bottom: 12px;
  padding: 8px 10px;
  background-color: rgba(0, 0, 0, 0.5);
  border-left: 3px solid var(--arcade-orange);
  text-align: center;
}

.system-content {
  color: var(--arcade-orange);
  font-size: 0.75rem;
  font-style: italic;
}

/* Input area */
.chat-input-container {
  position: relative;
  z-index: 2;
  margin-top: 10px;
}

.chat-input-container form {
  display: flex;
}

.chars-counter {
  background-color: transparent;
  color: var(--arcade-text);
  border: none;
  border-left: 2px solid var(--arcade-blue);
  font-size: 0.7rem;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
}

/* Chat decorations */
.chat-decorations {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 1;
}

.corner-decoration {
  position: absolute;
  width: 15px;
  height: 15px;
  border: 3px solid var(--arcade-accent);
  z-index: 2;
}

.top-left {
  top: 0;
  left: 0;
  border-right: none;
  border-bottom: none;
}

.top-right {
  top: 0;
  right: 0;
  border-left: none;
  border-bottom: none;
}

.bottom-left {
  bottom: 0;
  left: 0;
  border-right: none;
  border-top: none;
}

.bottom-right {
  bottom: 0;
  right: 0;
  border-left: none;
  border-top: none;
}

/* Custom scrollbar for chat */
.chat-messages-container::-webkit-scrollbar {
  width: 8px;
}

.chat-messages-container::-webkit-scrollbar-track {
  background: rgba(0, 17, 34, 0.3);
  border-radius: 10px;
}

.chat-messages-container::-webkit-scrollbar-thumb {
  background: var(--arcade-blue);
  border-radius: 10px;
  border: 2px solid var(--arcade-dark);
}

.chat-messages-container::-webkit-scrollbar-thumb:hover {
  background: var(--arcade-light-blue);
}

/* Unread message indicator */
#chat-badge {
  background-color: var(--arcade-accent);
  color: white;
  font-size: 0.7rem;
  padding: 2px 5px;
  border-radius: 10px;
  margin-left: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  min-height: 18px;
  animation: pulse-badge 2s infinite;
}

/* Typing indicator */
.typing-indicator {
  display: inline-block;
  width: 8px;
  height: 15px;
  background-color: var(--arcade-text);
  margin-left: 5px;
  animation: blink-cursor 1s infinite;
}

.ownedbg {
  background-color: #006e42;
}

/* ===== LEADERBOARD ===== */
.leaderboard-actions {
  justify-content: center;
  gap: 5px;
  height: 100%;
}

.leaderboard-actions .btn {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.7rem;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 1px 1px 0 #000;
  transition: all 0.2s;
}

.leaderboard-actions .btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.leaderboard-actions .btn:active:not(:disabled) {
  transform: scale(0.95);
}

.leaderboard-actions .btn {
  position: relative;
  overflow: hidden;
}

.leaderboard-actions .btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, 
              rgba(255, 255, 255, 0.1) 0%, 
              transparent 50%, 
              rgba(0, 0, 0, 0.1) 100%);
  pointer-events: none;
}

.leaderboard-actions .btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: rgba(255, 255, 255, 0.3);
  animation: scanline 2s linear infinite;
  pointer-events: none;
  opacity: 0.5;
}

.player-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  vertical-align: middle;
  width: 24px;
  height: 24px;
  max-height: 24px;
  min-height: 24px;
}

tr:hover .player-emoji {
  transform: scale(1.2);
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.7));
  z-index: 2;
}

.spectator-icon, .copy-icon {
  font-size: 0.9rem;
  margin-right: 4px;
}

.leaderboard-icon {
  max-height: 24px;
  min-height: 24px;
}

.badgeYou {
  padding: 0.6rem;
}

/* ===== SPECTATOR MODE ===== */
#spectator-banner .alert-warning {
  background-color: var(--arcade-dark);
  border: 3px solid var(--arcade-orange);
  color: var(--arcade-yellow);
}

.spectator-icon {
  font-style: normal;
  margin-right: 4px;
}

.spectator-badge {
  background-color: rgba(255, 193, 7, 0.8);
  color: #000;
  border-radius: 16px;
  padding: 2px 8px;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.rank-container {
  display: flex;
  align-items: center;
  gap: 4px;
}

#spectator-banner {
  position: relative;
  z-index: 100;
}

#spectator-banner:hover {
  transform: scale(1.02);
  box-shadow: 0 0 5px rgba(255, 193, 7, 0.5);
  position: relative;
  overflow: hidden;
}

#spectator-banner:hover::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, 
              rgba(255, 255, 255, 0.05) 0%, 
              transparent 50%, 
              rgba(0, 0, 0, 0.05) 100%);
  pointer-events: none;
}

#spectator-banner:hover::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: rgba(255, 193, 7, 0.3);
  animation: scanline 2s linear infinite;
  pointer-events: none;
  opacity: 0.5;
}

#spectator-info {
  font-weight: normal;
  font-style: italic;
  margin: 0 8px;
}

/* ===== SABOTAGE/ATTACK SYSTEM ===== */
.arcade-attack-container {
  position: relative;
  padding: 0;
  color: var(--arcade-text);
}

.attack-title {
  position: relative;
  border-bottom: 2px solid var(--arcade-accent);
  padding-bottom: 15px;
  margin-bottom: 20px;
}

.attack-title h3 {
  font-size: 1.8rem;
  color: var(--arcade-accent);
  text-shadow: 3px 3px 0 #000;
  letter-spacing: 3px;
  margin-bottom: 5px;
}

.attack-subtitle {
  color: var(--arcade-yellow);
  font-size: 0.9rem;
  letter-spacing: 2px;
  margin-top: -5px;
}

.attack-screen {
  background-color: rgba(0, 0, 0, 0.3);
  border: 3px solid var(--arcade-accent);
  padding: 15px;
  position: relative;
  overflow: hidden;
}

.attack-screen::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15),
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
  z-index: 1;
}

.attack-screen-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 5px;
  border-bottom: 2px solid var(--arcade-blue);
}

.blink-text {
  animation: blink-text 1.2s infinite;
  color: var(--arcade-yellow);
  font-weight: bold;
  letter-spacing: 1px;
}

.health-bar {
  width: 120px;
  height: 12px;
  background-color: #333;
  border: 2px solid var(--arcade-blue);
}

.health-bar-fill {
  height: 100%;
  width: 80%;
  background-color: #00ff00;
  transition: width 0.3s;
}

.players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 15px;
  padding: 10px 0;
}

.player-grid-item {
  background-color: #001133;
  border: 2px solid var(--arcade-blue);
  padding: 15px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.player-grid-item:hover {
  transform: scale(1.05);
  border-color: var(--arcade-accent);
  box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
  position: relative;
  overflow: hidden;
}

.player-grid-item:hover::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, 
              rgba(255, 255, 255, 0.1) 0%, 
              transparent 50%, 
              rgba(0, 0, 0, 0.1) 100%);
  pointer-events: none;
}

.player-grid-item:hover::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: rgba(255, 255, 255, 0.3);
  animation: scanline 2s linear infinite;
  pointer-events: none;
  opacity: 0.5;
}

.player-grid-item.selected {
  border-color: var(--arcade-accent);
  box-shadow: 0 0 10px var(--arcade-accent);
}

.player-avatar {
  font-size: 2rem;
  margin-bottom: 10px;
}

.player-name {
  font-size: 0.8rem;
  margin-bottom: 5px;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-clicks {
  font-size: 0.7rem;
  color: var(--arcade-text);
}

.player-grid-placeholder {
  grid-column: 1 / -1;
  background-color: rgba(0, 0, 0, 0.3);
  padding: 30px;
  border: 2px dashed var(--arcade-blue);
}

.target-info {
  display: flex;
  align-items: center;
  background-color: #001133;
  border: 2px solid var(--arcade-blue);
  padding: 15px;
  margin-bottom: 20px;
}

.target-avatar {
  font-size: 3rem;
  margin-right: 20px;
}

.target-data {
  flex: 1;
}

.target-name {
  font-size: 1.2rem;
  color: #ffffff;
  margin-bottom: 5px;
}

.target-stats {
  display: flex;
  gap: 15px;
}

.stat {
  font-size: 0.8rem;
  color: var(--arcade-text);
}

.attack-types-nav {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.attack-type-btn {
  background-color: #001133;
  border: 2px solid var(--arcade-blue);
  color: var(--arcade-text);
  padding: 8px 15px;
  flex: 1;
  text-align: center;
  cursor: pointer;
  font-size: 0.8rem;
  letter-spacing: 1px;
}

.attack-type-btn:hover:not(.active) {
  transform: scale(1.05);
  box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
  position: relative;
  overflow: hidden;
}

.attack-type-btn:hover:not(.active)::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, 
              rgba(255, 255, 255, 0.1) 0%, 
              transparent 50%, 
              rgba(0, 0, 0, 0.1) 100%);
  pointer-events: none;
}

.attack-type-btn:hover:not(.active)::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: rgba(255, 255, 255, 0.3);
  animation: scanline 2s linear infinite;
  pointer-events: none;
  opacity: 0.5;
}

.attack-type-btn.active {
  background-color: var(--arcade-blue);
  color: #000033;
  font-weight: bold;
}

.attack-cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 15px;
}

.attack-card {
  background-color: #001133;
  border: 2px solid #ff3355;
  padding: 15px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.attack-card:hover {
  transform: scale(1.05);
  box-shadow: 0 0 5px rgba(255, 51, 85, 0.5);
  position: relative;
  overflow: hidden;
}

.attack-card:hover::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, 
              rgba(255, 255, 255, 0.1) 0%, 
              transparent 50%, 
              rgba(0, 0, 0, 0.1) 100%);
  pointer-events: none;
}

.attack-card:hover::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: rgba(255, 51, 85, 0.3);
  animation: scanline 2s linear infinite;
  pointer-events: none;
  opacity: 0.5;
}

.attack-card.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.attack-icon {
  font-size: 2rem;
  margin-bottom: 10px;
  color: #ff3355;
}

.attack-name {
  font-size: 0.8rem;
  color: #ffffff;
  margin-bottom: 5px;
}

.attack-desc {
  font-size: 0.7rem;
  color: #bbbbbb;
  margin-bottom: 10px;
}

.attack-cost {
  font-size: 0.9rem;
  color: #ff3355;
  font-weight: bold;
}

.attack-modal {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
}

.attack-modal-content {
  background-color: #001133;
  border: 3px solid var(--arcade-accent);
  width: 90%;
  max-width: 500px;
  position: relative;
}

.attack-modal-header {
  background-color: var(--arcade-accent);
  color: #ffffff;
  padding: 10px 15px;
  text-align: center;
}

.attack-modal-header h4 {
  margin: 0;
  color: #ffffff;
  font-size: 1.2rem;
  letter-spacing: 2px;
}

.attack-modal-body {
  padding: 20px;
}

.attack-animation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.attacker, .target {
  font-size: 1.5rem;
  padding: 10px;
  background-color: #000;
  border: 2px solid var(--arcade-blue);
  width: 100px;
  text-align: center;
}

.attack-beam {
  flex: 1;
  display: flex;
  height: 10px;
  margin: 0 10px;
}

.beam-segment {
  flex: 1;
  height: 100%;
  background-color: var(--arcade-accent);
  animation: beam-pulse 0.5s infinite alternate;
}

.beam-segment:nth-child(2) {
  animation-delay: 0.2s;
}

.beam-segment:nth-child(3) {
  animation-delay: 0.4s;
}

.attack-details {
  background-color: rgba(0, 0, 0, 0.3);
  padding: 15px;
  border: 2px solid var(--arcade-blue);
}

.attack-details p {
  margin-bottom: 5px;
  font-size: 0.9rem;
}

.attack-modal-footer {
  display: flex;
  gap: 10px;
  padding: 15px;
  justify-content: center;
}

.attack-animation-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 0, 102, 0.7);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: flash 0.5s forwards;
}

.attack-success-text {
  font-size: 3rem;
  color: #ffffff;
  text-shadow: 3px 3px 0 #000;
  animation: shake 0.5s forwards;
}

/* ===== UTILITY CLASSES ===== */
.iconImg {
  max-height: 4rem;
  min-height: 4rem;
}

.smallIconImg {
  max-height: 2rem;
  min-height: 2rem;
}

.midIconImg {
  max-height: 5rem;
  min-height: 5rem;
}

.mainIconImg {
  max-height: 9rem;
  min-height: 9rem;
}

/* Background utility classes */
.bg-primary {
  background-color: #0066ff !important;
}

.bg-success {
  background-color: var(--arcade-green) !important;
}

.bg-info {
  background-color: #0099cc !important;
}

.bg-danger {
  background-color: var(--arcade-red) !important;
}

/* ===== ANIMATIONS ===== */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes float {
  0% { transform: translateY(0px); opacity: 1; scale: 1;}
  100% { transform: translateY(-65vh); opacity: 0; scale: 0.2;}
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

@keyframes infiniteStrobeYellowRed {
  0%, 100% { background-color: yellow; }
  50% { background-color: red; }
}

@keyframes infiniteStrobeYellowRedText {
  0%, 100% { color: yellow; }
  50% { color: red; }
}

@keyframes glitch {
  0% { transform: translate(0); }
  20% { transform: translate(-2px, 2px); }
  40% { transform: translate(-2px, -2px); }
  60% { transform: translate(2px, 2px); }
  80% { transform: translate(2px, -2px); }
  100% { transform: translate(0); }
}

@keyframes pulse-badge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes blink-text {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.5; }
}

@keyframes message-appear {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes beam-pulse {
  from { opacity: 0.5; }
  to { opacity: 1; }
}

@keyframes flash {
  0% { opacity: 0; }
  50% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-10px); }
  40%, 80% { transform: translateX(10px); }
}

@keyframes scanline {
  0% { top: 0; }
  100% { top: 100%; }
}

.glitch {
  animation: glitch 0.2s linear;
}

/* ===== MEDIA QUERIES ===== */
/* Make input fields larger on mobile for better touch targets */
@media (max-width: 768px) {
  body {
    font-size: 14px;
  }
  
  .form-control {
    font-size: 16px; /* Prevents iOS from zooming in on focus */
    padding: 10px;
  }
  
  .input-group .btn {
    height: auto;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  
  .emoji-container {
    height: 150px;
  }
  
  .emoji {
    font-size: 5rem;
  }
  
  h1, h2, h3 {
    font-size: 1.5rem;
  }
  
  .game-title h1 {
    font-size: 1.8rem;
  }
  
  .counter {
    font-size: 1.5rem;
  }
  
  .stats {
    font-size: 0.9rem;
  }
  
  .btn {
    font-size: 0.7rem;
    padding: 8px 12px;
  }
  
  .card-body {
    padding: 10px;
  }
  
  .nav-tabs .nav-link {
    font-size: 0.6rem;
    padding: 5px 8px;
  }
  
  .upgrade-icon {
    font-size: 1.8rem;
  }
  
  .control-panel {
    display: none; /* Hide on mobile to save space */
  }
  
  .table {
    font-size: 0.7rem;
  }
  
  .pixel-corner {
    width: 8px;
    height: 8px;
  }
  
  .pixel-corner-tl {
    box-shadow: 8px 0 0 0 var(--arcade-accent), 0 8px 0 0 var(--arcade-accent);
  }
  
  .pixel-corner-tr {
    box-shadow: -8px 0 0 0 var(--arcade-accent), 0 8px 0 0 var(--arcade-accent);
  }
  
  .pixel-corner-bl {
    box-shadow: 8px 0 0 0 var(--arcade-accent), 0 -8px 0 0 var(--arcade-accent);
  }
  
  .pixel-corner-br {
    box-shadow: -8px 0 0 0 var(--arcade-accent), 0 -8px 0 0 var(--arcade-accent);
  }
  
  /* Fix for upgrade cards */
  .col-md-4.col-sm-6 {
    padding-left: 8px;
    padding-right: 8px;
  }
  
  .upgrade-card {
    margin-bottom: 16px;
    min-height: 150px;
  }
  
  .upgrade-card .card-body {
    padding: 10px 8px;
  }
  
  .upgrade-icon {
    margin-bottom: 5px;
  }
  
  .upgrade-card .card-title {
    font-size: 0.7rem;
    margin-bottom: 5px;
    color: white;
  }
  
  .upgrade-card .card-text {
    font-size: 0.4rem;
  }
  
  /* Chat system mobile optimizations */
  .chat-messages-container {
    height: 300px;
    max-height: 50vh;
  }
  
  .chat-controls {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .chat-mode-selector {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 5px;
    -webkit-overflow-scrolling: touch;
  }
  
  .chat-mode-btn {
    padding: 6px 12px;
    font-size: 0.7rem;
    white-space: nowrap;
  }
  
  .chat-message {
    padding: 8px 10px;
    margin-bottom: 10px;
  }
  
  .message-header {
    flex-direction: column;
    gap: 5px;
  }
  
  .message-time {
    align-self: flex-end;
  }
  
  .message-content {
    font-size: 0.8rem;
  }
  
  .retro-input {
    font-size: 7px !important; /* Prevents iOS zoom on focus */
  }
  
  .chat-input-container form {
    flex-direction: column;
  }
  
  .retro-input-group {
    margin-bottom: 8px;
  }
  
  /* Attack system mobile optimizations */
  .players-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
  
  .attack-cards-container {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }
  
  .attack-types-nav {
    flex-direction: column;
  }
  
  .attacker, .target {
    width: 80px;
    font-size: 1rem;
  }
  
  .attack-title h3 {
    font-size: 1.5rem;
  }
  
  .attack-modal-content {
    width: 95%;
  }
  
  /* Fix for floating emoji positioning */
  #floating-emojis {
    width: 100%;
    height: 100%;
  }
  
  .floating-emoji {
    font-size: 1.5rem;
  }
  
  /* Fix for table */
  .table td, .table th {
    padding: 5px;
  }
  
  #chat-global-btn {
    border-radius: 30px;
    margin-right: 3px;
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  .emoji {
    font-size: 4rem;
  }
  
  .game-title h1 {
    font-size: 1.5rem;
  }
  
  .counter {
    font-size: 1.2rem;
  }
  
  .stats {
    font-size: 0.8rem;
  }
  
  .game-key {
    font-size: 0.7rem;
    padding: 3px;
  }
  
  .btn-sm {
    font-size: 0.6rem;
    padding: 3px 6px;
  }
  
  .chat-title-section h3 {
    font-size: 1rem;
  }
  
  .chat-messages-container {
    height: 250px;
  }
  
  .message-id {
    max-width: 60px;
  }
}

/* Adjust for notches and safe areas on modern phones */
@supports (padding: max(0px)) {
  .arcade-cabinet {
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
    padding-top: max(10px, env(safe-area-inset-top));
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
}

/* Custom scrollbars */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--arcade-dark);
  border: 1px solid var(--arcade-accent);
}

::-webkit-scrollbar-thumb {
  background: var(--arcade-accent);
  border: 2px solid var(--arcade-dark);
}

::-webkit-scrollbar-thumb:hover {
  background: #ff3385;
}

/* Arcade Chat Container */
.arcade-chat-container {
  background-color: #0a0a20;
  border: 4px solid #00ff00;
  border-radius: 5px;
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.5), inset 0 0 15px rgba(0, 0, 0, 0.8);
  padding: 0px;
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100%;
}

/* Chat title section */
.chat-title-section {
  text-align: center;
  margin-bottom: 15px;
  position: relative;
}

.chat-title-section h3 {
  color: #fff;
  text-shadow: 2px 2px 0px #000, 0 0 10px #00ff00;
  font-size: 1.2rem;
  position: relative;
  z-index: 2;
}

.pixel-decoration {
  height: 4px;
  background: linear-gradient(90deg, transparent 0%, #00ff00 20%, #00ff00 80%, transparent 100%);
  margin: 10px auto;
  width: 80%;
}

.scanline-small {
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, #00ff00 20%, #00ff00 80%, transparent 100%);
  margin: 10px auto;
  width: 60%;
  opacity: 0.7;
}

/* Chat screen */
.chat-screen {
  background: #000015;
  border: 2px solid #00aa00;
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Chat header */
.chat-header {
  background-color: #001500;
  border-bottom: 2px solid #008800;
  padding: 8px 12px;
  font-size: 0.7rem;
}

.channel-name {
  color: #00ff00;
}

.connection-status {
  font-size: 0.6rem;
}

/* Chat messages container */
.chat-messages-container {
  flex-grow: 1;
  overflow-y: auto;
  padding: 10px;
  scrollbar-width: thin;
  scrollbar-color: #00aa00 #001500;
}

.chat-messages-container::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.chat-messages-container::-webkit-scrollbar-track {
  background: #001500;
  border-left: 1px solid #00aa00;
}

.chat-messages-container::-webkit-scrollbar-thumb {
  background: #00aa00;
  border: 1px solid #00ff00;
}

.chat-messages-container::-webkit-scrollbar-thumb:hover {
  background: #00cc00;
}

/* Updated Chat Messages Styling */
.message {
  padding: 8px 10px;
  margin-bottom: 10px;
  border-radius: 3px;
  font-size: 0.65rem;
  line-height: 1.3;
  position: relative;
  display: flex;
  flex-direction: column;
  border-left: 3px solid #008800;
  background-color: rgba(0, 25, 0, 0.7);
}

.message:hover {
  transform: scale(1.02);
  background-color: rgba(0, 40, 0, 0.9);
  box-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
  position: relative;
  overflow: hidden;
}

.message:hover::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, 
              rgba(0, 255, 0, 0.05) 0%, 
              transparent 50%, 
              rgba(0, 0, 0, 0.05) 100%);
  pointer-events: none;
}

.message:hover::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: rgba(0, 255, 0, 0.3);
  animation: scanline 2s linear infinite;
  pointer-events: none;
  opacity: 0.5;
}

.message-header {
  display: flex;
  justify-content: space-betwoeen;
  margin-bottom: 2px;
  padding-bottom: 3px;
  border-bottom: 1px dashed rgba(0, 255, 0, 0.3);
}

.player-name {
  color: #00ff00;
  font-weight: bold;
  text-shadow: 1px 1px 0px #000;
}

.timestamp {
  color: #00aa00;
  font-size: 0.55rem;
  opacity: 0.8;
}

.message-content {
  color: #cfffcf;
  word-break: break-word;
}

/* System message is different */
.system-message {
  padding: 5px 8px;
  margin-bottom: 10px;
  border-radius: 3px;
  font-size: 0.6rem;
  background-color: rgba(0, 0, 50, 0.7);
  border-left: 3px solid #0066ff;
  color: #88aaff;
  text-align: center;
}

.system-content {
  font-style: italic;
}

/* Chat input container */
.chat-input-container {
  padding: 10px;
  background-color: #001500;
  border-top: 2px solid #008800;
}

.retro-input-group {
  border: 2px solid #00aa00;
  border-radius: 3px;
  overflow: hidden;
}

.retro-input {
  background-color: #000;
  color: #00ff00;
  border: none;
  font-size: 0.7rem;
  padding: 8px 12px;
}

.retro-input:focus {
  box-shadow: none;
  background-color: #001500;
  color: #00ff00;
}

.chars-counter {
  background-color: #002200;
  color: #00aa00;
  border: none;
  font-size: 0.6rem;
}

.retro-btn {
  background-color: #005500;
  color: #fff;
  border: none;
  padding: 8px 15px;
  font-size: 0.7rem;
  transition: all 0.2s;
}

.retro-btn:hover, .retro-btn:focus {
  background-color: #007700;
  color: #fff;
}

/* CRT Lines effect */
.chat-screen::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0) 0%,
      rgba(0, 0, 0, 0.1) 50%,
      rgba(0, 0, 0, 0) 100%
  );
  background-size: 100% 3px;
  z-index: 10;
  pointer-events: none;
  opacity: 0.3;
}

/* Corner decorations */
.chat-decorations {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.corner-decoration {
  position: absolute;
  width: 15px;
  height: 15px;
}

.top-left {
  top: 0;
  left: 0;
  border-top: 3px solid #00ff00;
  border-left: 3px solid #00ff00;
}

.top-right {
  top: 0;
  right: 0;
  border-top: 3px solid #00ff00;
  border-right: 3px solid #00ff00;
}

.bottom-left {
  bottom: 0;
  left: 0;
  border-bottom: 3px solid #00ff00;
  border-left: 3px solid #00ff00;
}

.bottom-right {
  bottom: 0;
  right: 0;
  border-bottom: 3px solid #00ff00;
  border-right: 3px solid #00ff00;
}

/* Player badges */
.player-badge {
  display: inline-block;
  font-size: 0.5rem;
  padding: 2px 4px;
  border-radius: 3px;
  margin-right: 5px;
  vertical-align: middle;
}

.badge-admin {
  background-color: #ff0000;
  color: #fff;
}

.badge-moderator {
  background-color: #0066ff;
  color: #fff;
}

.badge-vip {
  background-color: #aa00aa;
  color: #fff;
}

/* New alternating message styles */
.message:nth-child(even) {
  background-color: rgba(0, 35, 0, 0.7);
}

/* New animations for messages */
@keyframes message-appear {
  from {
      opacity: 0;
      transform: translateY(10px);
  }
  to {
      opacity: 1;
      transform: translateY(0);
  }
}

/* Notification message styling */
.notification-message {
  background-color: rgba(50, 25, 0, 0.7);
  border-left: 3px solid #ffaa00;
  text-align: center;
  padding: 5px;
  font-size: 0.6rem;
  margin: 5px 0;
  color: #ffcc88;
}

#pet{
  position: fixed;
  bottom: 50%;
  right: 50%;
  z-index: 999999999;
  min-height: 4rem;
  min-width: 4rem;
  --border: 2px solid #ff0000;
  /*clicks pass through*/
  pointer-events: none;
}

.wallet-arcade-section {
  background-color: var(--arcade-dark);
  border: 3px solid var(--arcade-accent);
  padding: 15px;
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
}

.wallet-arcade-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.15),
      rgba(0, 0, 0, 0.15) 1px,
      transparent 1px,
      transparent 2px
  );
  pointer-events: none;
  z-index: 10;
}

.wallet-title {
  color: var(--arcade-text);
  text-shadow: 2px 2px 0px var(--arcade-dark);
  font-weight: bold;
  font-family: 'Press Start 2P', cursive;
  text-align: center;
  margin-bottom: 0;
}

.wallet-input-group {
  position: relative;
  background-color: black;
}



.input-wrapper {
  position: relative;
  display: flex;
  overflow: visible;
}

.input-with-icon {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.7rem;
  color: var(--arcade-text);
  height: auto;
  flex-grow: 1;
  border-right: none;
}

#connect-wallet-btn {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.7rem;
  border-radius: 0;
  border: 3px solid var(--arcade-orange);
  border-left: none;
  background-color: var(--arcade-dark);
  color: var(--arcade-yellow);
  box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.5);
  transition: all 0.1s;
  text-transform: uppercase;
  padding: 8px 12px;
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

#connect-wallet-btn:hover {
  box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

#connect-wallet-btn:hover::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, 
              rgba(255, 255, 255, 0.1) 0%, 
              transparent 50%, 
              rgba(0, 0, 0, 0.1) 100%);
  pointer-events: none;
}

#connect-wallet-btn:hover::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: rgba(255, 255, 255, 0.3);
  animation: scanline 2s linear infinite;
  pointer-events: none;
  opacity: 0.5;
}

#connect-wallet-btn:active {
  transform: scale(0.95);
  box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.5);
}

.wallet-icon {
  display: inline-block;
  margin-right: 8px;
  animation: bounce 1s infinite alternate;
  text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.5);
}

.wallet-check {
  display: inline-block;
  color: #00ff00;
  text-shadow: 0 0 5px #00ff00;
  animation: pulse 1.5s infinite;
  margin-right: 5px;
}

.arcade-badge {
  background-color: var(--arcade-dark);
  border: 2px solid #00aa00;
  color: #00ff00;
  display: inline-block;
  padding: 8px 12px;
  font-family: 'Press Start 2P', cursive;
  font-size: 0.6rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.arcade-badge::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
      0deg,
      rgba(0, 255, 0, 0.1),
      rgba(0, 255, 0, 0.1) 1px,
      transparent 1px,
      transparent 2px
  );
  pointer-events: none;
  z-index: 10;
}

/* Connection success effect */
@keyframes connection-success {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgb(0, 204, 255); }
  50% { transform: scale(1.1); box-shadow: 0 0 10px 5px rgb(0, 255, 255); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 255, 0, 0); }
}

.connected-effect {
  animation: connection-success 1s ease-out;
}

/* Wallet status glow effect */
.wallet-status.d-none {
  display: none;
}

/* Arcade-style corner pixels for wallet section */
.wallet-arcade-section {
  position: relative;
}

.wallet-arcade-section::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  background-color: var(--arcade-accent);
  box-shadow: 8px 0 0 0 var(--arcade-accent), 0 8px 0 0 var(--arcade-accent);
}

.form-label {
  font-size: 0.7rem;
  color: var(--arcade-text);
  font-weight: bold;
  text-transform: uppercase;
}
.customization-container .card {
  margin-bottom: 10px;
}

.customization-container .card-body {
  padding: 10px;
}

/* Smaller titles and margins on card content */
.customization-container .card-title {
  font-size: 0.8rem;
  margin-bottom: 5px;
}

/* Reduce size of emoji/icon display */
.customization-container .card-body > div:first-child,
.customization-container .iconImg {
  transform: scale(0.85);
  margin-bottom: 5px;
}

/* Smaller badge for costs */
.customization-container .badge {
  font-size: 0.7rem;
  padding: 2px 5px;
}

/* Make owned text smaller */
.customization-container .text-muted {
  font-size: 0.7rem;
}

/* Collapsible section headers */
.customization-title {
  font-size: 1rem;
  margin-bottom: 30px;
  margin-top: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 5px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  position: relative;
  z-index: 999;
  background-color: rgba(0, 0, 0, 0.3);
}

.customization-title:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.customization-title .collapse-icon {
  transition: transform 0.3s;
  margin-left: 10px;
  font-size: 0.8rem;
}

.customization-title.collapsed .collapse-icon {
  transform: rotate(-90deg);
}

/* Adjust grid spacing */
.customization-container .row {
  margin-left: -5px;
  margin-right: -5px;
}

.customization-container [class*="col-"] {
  padding-left: 5px;
  padding-right: 5px;
}

/* Collapsible content */
.collapsible-section {
  max-height: 60vh; /* Large enough to fit content */
  transition: all 0.3s ease-in-out;
  overflow-y: auto;
  filter: brightness(1);
}

.collapsible-section.collapsed {
  max-height: 0;
  margin: 0;
  padding: 0;
  filter: brightness(0.5);
}