.em-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.em-level-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.em-level-btn {
  border: 2px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
}
.em-level-btn[aria-pressed="true"] {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  color: #fff;
}
.em-level-btn:disabled { cursor: default; opacity: 0.45; }

.em-grid {
  display: grid;
  gap: 0;
  background: #1c1730;
  padding: 10px;
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 0 3px var(--color-border);
  max-width: 100%;
  overflow: auto;
  --wall-color: transparent;
}
.em-grid.em-revealed { --wall-color: #ffca28; }

.em-cell {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  background: #372f52;
  cursor: pointer;
  position: relative;
  box-sizing: border-box;
  transition: border-color 0.35s ease, background 0.2s ease;
}
.em-cell--visited { background: #453b68; }
.em-cell--wall-n { border-top: 4px solid var(--wall-color); }
.em-cell--wall-s { border-bottom: 4px solid var(--wall-color); }
.em-cell--wall-e { border-right: 4px solid var(--wall-color); }
.em-cell--wall-w { border-left: 4px solid var(--wall-color); }
.em-cell--exit { background: #2e7d32; }
.em-cell:hover { filter: brightness(1.15); }

.em-echo-row { display: flex; justify-content: center; }
#em-echo-btn:disabled { opacity: 0.55; cursor: default; }

@media (max-width: 480px) {
  .em-cell { width: 34px; height: 34px; font-size: 1.05rem; }
}
