:root {
  --bg-main: #000000;
  --bg-card: #111111;
  --bg-inner: #1a1a1a;
  --border-color: #2a2a2a;
  --text-primary: #ffffff;
  --text-secondary: #999999;
  --accent-red: #ff3344;
  --accent-blue: #3388ff;
  --accent-green: #22cc55;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  padding: 20px;
}

/* Huvudkortet (Ersätter profilen) */
.main-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  width: 100%;
  max-width: 450px;
  padding: 24px;
  box-sizing: border-box;
}

/* Sektionsrubriker */
.section-title {
  font-size: 12px;
  font-weight: bold;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Statistik-rutan */
.stats-card {
  background-color: var(--bg-inner);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
}

.stats-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.stat-row .stat-value {
  font-family: monospace;
  font-size: 16px;
  color: var(--text-primary);
}

/* Spelplanen */
.game-section {
  background-color: var(--bg-inner);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
}

#game-container {
  width: 100%;
  height: 386px;
  background-color: #0a0a0a;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

/* Overlays (Klick-skärmarna) */
.overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  z-index: 100;
  cursor: pointer;
}

.overlay.hidden { display: none !important; }

.overlay h2 { margin: 0 0 10px 0; }
.overlay p { color: var(--text-secondary); font-size: 14px; margin: 0; padding: 0 20px;}
.red { color: var(--accent-red); }
.green { color: var(--accent-green); }
.gold { color: #ffd700; }

/* Spelobjekt */
.level {
  position: absolute;
  width: 100%;
  height: 100%;
}

.level.hidden { display: none; }

.wall {
  background-color: var(--accent-red);
  position: absolute;
  border-radius: 2px;
}

.start {
  position: absolute;
  top: 0; left: 0;
  width: 50px; height: 50px;
  background-color: var(--accent-blue);
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 10px;
  font-weight: bold;
}

.goal {
  position: absolute;
  bottom: 0; right: 0;
  width: 50px; height: 50px;
  background-color: var(--accent-green);
  color: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 12px;
  font-weight: bold;
}

/* --- ANIMATIONER --- */
.move-x.slow { animation: moveX 3s infinite alternate linear; }
.move-x.slow-reverse { animation: moveXRev 3s infinite alternate linear; }
.move-x.fast { animation: moveX 1.5s infinite alternate linear; }
.move-x.fast-reverse { animation: moveXRev 1.5s infinite alternate linear; }
.move-x.crazy { animation: moveX 0.8s infinite alternate linear; }
.move-x.crazy-reverse { animation: moveXRev 0.8s infinite alternate linear; }
.move-x.insane { animation: moveX 0.5s infinite alternate linear; }
.move-x.insane-reverse { animation: moveXRev 0.5s infinite alternate linear; }

.move-y.fast { animation: moveY 1.5s infinite alternate linear; }
.move-y.fast-reverse { animation: moveYRev 1.5s infinite alternate linear; }
.move-y.crazy { animation: moveY 0.8s infinite alternate linear; }
.move-y.insane { animation: moveY 0.5s infinite alternate linear; }
.move-y.insane-reverse { animation: moveYRev 0.5s infinite alternate linear; }

@keyframes moveX { 0% { transform: translateX(0); } 100% { transform: translateX(100px); } }
@keyframes moveXRev { 0% { transform: translateX(100px); } 100% { transform: translateX(0); } }
@keyframes moveY { 0% { transform: translateY(0); } 100% { transform: translateY(80px); } }
@keyframes moveYRev { 0% { transform: translateY(80px); } 100% { transform: translateY(0); } }