* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #1a1a2e;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow: hidden;
  font-family: monospace;
}

#game-ui {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

#gameCanvas {
  display: block;
  image-rendering: pixelated;
}

#bottom-bar {
  display: flex;
  gap: 12px;
  align-items: center;
}

#load-label {
  cursor: pointer;
  color: #7777aa;
  font-size: 12px;
  padding: 4px 10px;
  border: 1px solid #3a3a5a;
  border-radius: 3px;
  background: #11111f;
  transition: color 0.15s, border-color 0.15s;
}

#load-label:hover {
  color: #aaaadd;
  border-color: #5555aa;
}

#load-label input[type="file"] {
  display: none;
}

#editor-link {
  color: #7777aa;
  font-size: 12px;
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid #3a3a5a;
  border-radius: 3px;
  background: #11111f;
  transition: color 0.15s, border-color 0.15s;
}

#editor-link:hover {
  color: #aaaadd;
  border-color: #5555aa;
}

/* ── Skins overlay ─────────────────────────────────────────────────────────── */
#skins-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 50;
  align-items: center;
  justify-content: center;
}

#skins-overlay.active {
  display: flex;
}

#skins-panel {
  background: #0e0e1a;
  border: 1px solid #3a3a58;
  border-radius: 6px;
  padding: 16px;
  width: 420px;
  font-family: monospace;
}

#skins-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  color: #c0c0dd;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 1px;
  text-transform: uppercase;
}

#btn-close-skins {
  background: #1e1e30;
  border: 1px solid #3a3a58;
  color: #7777aa;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 3px;
  font: inherit;
  transition: border-color 0.12s, color 0.12s;
}

#btn-close-skins:hover {
  border-color: #6655aa;
  color: #e0e0ff;
}

#skins-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
}

.skin-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 4px 6px;
  border: 2px solid transparent;
  border-radius: 4px;
  background: #13131f;
  cursor: pointer;
  transition: border-color 0.12s;
}

.skin-card:not(.locked):hover { border-color: #5555aa; }
.skin-card.active             { border-color: #e8d060; }
.skin-card.locked             { cursor: default; }

.skin-card canvas {
  display: block;
  image-rendering: pixelated;
}

.skin-mystery {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #1a1a30;
  background: #0a0a16;
  border-radius: 2px;
}

.skin-card span {
  font-size: 9px;
  color: #5555aa;
  text-align: center;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.skin-card.active span { color: #e8d060; }
.skin-card.locked span { color: #1e1e36; }
