:root {
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --accent: #8b5cf6;
  --accent-hover: #a78bfa;
  --accent-glow: rgba(139, 92, 246, 0.5);
  --danger: #ef4444;
}

body {
  font-family: 'Outfit', sans-serif;
  background: url('fondo_juego.png') no-repeat center center fixed;
  background-size: cover;
  color: var(--text-main);
  margin: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
}

.game-wrapper {
  max-width: 1000px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.game-header {
  text-align: center;
}

.game-header h1 {
  font-size: 3rem;
  font-weight: 900;
  margin: 0 0 5px 0;
  background: linear-gradient(to right, #a78bfa, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.author {
  color: var(--text-muted);
  margin: 0;
  font-size: 1.1rem;
  font-weight: 300;
}

.game-dashboard {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: center;
  align-items: flex-start;
}

.canvas-container {
  padding: 10px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(10px);
  display: inline-flex;
}

canvas {
  background: #1e293b;
  border-radius: 12px;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
  /* Subdued border instead of the thick black line */
  border: 2px solid rgba(255,255,255,0.05);
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 300px;
}

.glass-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(10px);
}

.stats-panel {
  display: flex;
  justify-content: space-between;
  gap: 15px;
}

.stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
  margin-bottom: 5px;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-main);
  text-shadow: 0 0 10px rgba(255,255,255,0.2);
}

.controls-title {
  margin: 0 0 20px 0;
  font-size: 1.2rem;
  text-align: center;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.d-pad {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.d-pad-middle {
  display: flex;
  gap: 5px;
  align-items: center;
}

.d-center {
  width: 50px;
  height: 50px;
  background: rgba(255,255,255,0.02);
  border-radius: 10px;
}

.d-btn {
  width: 60px;
  height: 60px;
  border-radius: 15px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  padding: 0;
}

.d-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.2);
}

.d-btn:active {
  transform: translateY(2px);
  background: rgba(255, 255, 255, 0.05);
}

.d-btn svg {
  width: 28px;
  height: 28px;
}

.btn-primary {
  width: 100%;
  padding: 16px;
  border-radius: 15px;
  border: none;
  background: var(--accent);
  color: white;
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 0 30px var(--accent-glow);
}

.btn-primary:active {
  transform: translateY(1px);
}

#mensaje {
  text-align: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fca5a5;
  min-height: 28px;
  margin: 0;
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

/* Responsiveness */
@media (max-width: 860px) {
  .game-dashboard {
    flex-direction: column;
    align-items: center;
  }
  
  .side-panel {
    max-width: 500px;
    width: 100%;
  }

  canvas {
    max-width: 100%;
    height: auto;
  }
}
