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

:root {
  --fg: #ffffff;
  --bg: #000000;
  --dim: #555555;
  --dim-border: #333333;
  --hover-bg: #222222;
  --badge-bg: #ffffff;
}


* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  border-radius: 0 !important; /* STRICT RETRO SHARP CORNERS */
}

body {
  background-color: var(--bg);
  color: var(--fg);
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  line-height: 1.5;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100vw;
  height: 100vh;
}

#game-container {
  position: relative;
  width: 960px;
  height: 540px;
  background: var(--bg);
  border: 3px solid var(--fg);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* Inverted Mode (Level 7) */
#game-container.inverted-theme {
  background: var(--fg);
  border-color: var(--bg);
  color: var(--bg);
}

#gameCanvas {
  display: block;
  width: 960px;
  height: 540px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: var(--bg);
}

#game-container.inverted-theme #gameCanvas {
  background: var(--fg);
}

/* Overlays */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.92);
  z-index: 100;
}

.overlay.active {
  display: flex;
}

/* Menu Box */
.menu-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 680px;
  padding: 18px 24px;
  border: 2px solid var(--fg);
  background: var(--bg);
  gap: 12px;
}

.menu-title {
  font-size: 18px;
  letter-spacing: 3px;
  color: var(--fg);
}

/* Difficulty Selector */
.difficulty-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.diff-label {
  font-size: 8px;
  color: var(--dim);
  margin-right: 4px;
}

.diff-btn {
  background: var(--bg);
  border: 1px solid var(--fg);
  color: var(--fg);
  font-family: inherit;
  font-size: 7px;
  padding: 4px 10px;
  cursor: pointer;
}

.diff-btn:hover {
  background: var(--hover-bg);
}

.diff-btn.active {
  background: var(--fg);
  color: var(--bg);
}

/* Level Name Banner */
.level-name-banner {
  font-size: 9px;
  color: var(--fg);
  letter-spacing: 1px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--dim-border);
  width: 100%;
  padding-bottom: 4px;
}

/* 6x5 Grid */
.level-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 8px;
  width: 100%;
  margin: 4px 0;
}

.level-cell {
  background: var(--bg);
  border: 1px solid var(--fg);
  color: var(--fg);
  font-family: inherit;
  font-size: 11px;
  height: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  position: relative;
  transition: none;
}

.level-cell:hover:not(.locked) {
  background: var(--fg);
  color: var(--bg);
}

.level-cell.locked {
  border-color: var(--dim-border);
  color: var(--dim);
  cursor: default;
}

.level-cell.active-playing {
  outline: 2px solid var(--fg);
}

/* Level Completion Difficulty Badge */
.level-diff-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  display: flex;
  gap: 2px;
  align-items: center;
  pointer-events: none;
}

.diff-box {
  width: 4px;
  height: 4px;
  background-color: var(--badge-bg);
  display: inline-block;
}

.level-cell:hover:not(.locked) .diff-box {
  background-color: var(--bg);
}

/* Pagination Row */
.pagination-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 4px;
}

.nav-arrow {
  background: var(--bg);
  border: 1px solid var(--fg);
  color: var(--fg);
  font-family: inherit;
  font-size: 12px;
  padding: 4px 12px;
  cursor: pointer;
}

.nav-arrow:hover {
  background: var(--fg);
  color: var(--bg);
}

.nav-arrow:disabled {
  border-color: var(--dim-border);
  color: var(--dim-border);
  cursor: default;
  background: var(--bg);
}

.page-text {
  font-size: 8px;
  color: var(--dim);
}

/* Modals (Pause, Result & Settings) */
.modal-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 380px;
  padding: 24px;
  border: 2px solid var(--fg);
  background: var(--bg);
  gap: 16px;
  text-align: center;
}

.modal-title {
  font-size: 16px;
  letter-spacing: 2px;
  color: var(--fg);
}

.modal-sub {
  font-size: 8px;
  color: var(--dim);
}

.modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 80%;
}

.modal-btn {
  background: var(--bg);
  border: 1px solid var(--fg);
  color: var(--fg);
  font-family: inherit;
  font-size: 9px;
  padding: 8px;
  cursor: pointer;
}

.modal-btn:hover {
  background: var(--fg);
  color: var(--bg);
}


