/* Night Shift: Bits Box — roguelike additions. Palette, panel, status bar,
   choice buttons and log come from /style.css + /nightshift/game.css; this
   file only adds the map grid, inventory bar and d-pad. */

/* Map */

.map-wrap {
  padding: 0.9rem 1rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow-x: auto;
}

#map {
  margin: 0;
  font-family: var(--font-mono);
  /* 48 columns; scale with the viewport so phones see the whole level */
  font-size: clamp(9px, 2.6vw, 15px);
  line-height: 1.2;
  user-select: none;
}

.c-you {
  color: var(--bg);
  background: var(--accent);
  font-weight: 700;
}

.c-mon { color: var(--accent); }

.c-boss {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.c-item { color: var(--text); font-weight: 700; }
.c-stairs { color: var(--text); font-weight: 700; }
.c-wall { color: var(--text-faint); }
.c-floor { color: var(--text-faint); opacity: 0.55; }
.c-mem { color: var(--text-faint); opacity: 0.35; }

/* Log — fixed height so the map doesn't jump */

.rogue-log {
  min-height: 6.6em;
  margin-top: 0.9rem;
}

/* Inventory bar */

.inv {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.inv-label,
.inv-empty {
  color: var(--text-faint);
}

.inv-item {
  padding: 0.35rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}

.inv-item:hover {
  border-color: var(--accent);
}

/* Controls */

.controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  margin-top: 1rem;
}

.descend {
  width: auto;
  text-align: center;
  font-family: var(--font-display);
  border-color: var(--accent);
}

#dpad {
  display: grid;
  grid-template-columns: repeat(3, 3rem);
  grid-auto-rows: 3rem;
  gap: 0.35rem;
}

#dpad button {
  font-size: 1.05rem;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  touch-action: manipulation;
}

#dpad button:hover {
  border-color: var(--accent);
  color: var(--text);
}

#dpad button:active {
  background: var(--accent-dim);
}

#wait-btn {
  font-family: var(--font-mono);
  font-size: 0.62rem !important;
  letter-spacing: 0.06em;
  color: var(--text-faint) !important;
}

/* Overlay (start / boon / death / victory) */

.overlay {
  margin-bottom: 1.1rem;
}

.overlay-choices {
  display: grid;
  gap: 0.6rem;
  margin-top: 1.2rem;
}

.overlay-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
  margin: 1rem 0 0;
}

#playfield.dimmed {
  opacity: 0.35;
  pointer-events: none;
}

/* Legend */

.legend {
  margin-top: 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.legend summary {
  cursor: pointer;
  color: var(--text-faint);
  user-select: none;
}

.legend summary:hover {
  color: var(--accent);
}

.legend-group {
  margin: 0.7rem 0 0.25rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.legend-row {
  display: flex;
  gap: 0.65rem;
  padding: 0.09rem 0;
}

.legend-ch {
  flex: 0 0 1.2em;
  text-align: center;
}

/* Keyboard users on wide screens don't need the pad front and centre */

@media (min-width: 700px) {
  #dpad {
    grid-template-columns: repeat(3, 2.4rem);
    grid-auto-rows: 2.4rem;
  }
}
