.sm-game { padding: 16px; }

.sm-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.sm-levels { display: flex; gap: 8px; }

.sm-themes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid #E0E0E0;
}

.sm-level {
  min-width: 44px;
  min-height: 44px;
  padding: 8px 16px;
  font: inherit;
  font-size: 1rem;
  color: #111827;
  background: #fff;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  cursor: pointer;
}
.sm-level:hover { border-color: #2563EB; }
.sm-level[aria-pressed="true"] { background: #2563EB; border-color: #2563EB; color: #fff; }

.sm-status { margin: 0; font-size: 1.1rem; font-weight: 600; }

.sm-label { font-size: 1.1rem; margin: 16px 0 8px; color: #6B7280; }

.sm-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (min-width: 640px) {
  .sm-row { grid-template-columns: repeat(6, 1fr); }
}

.sm-tile {
  position: relative;
  aspect-ratio: 1;
  min-height: 88px;
  padding: 8px;
  background: #fff;
  border: 3px solid #E0E0E0;
  border-radius: 12px;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.sm-tile img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
}
.sm-tile:hover { border-color: #93C5FD; }
.sm-tile:focus-visible { outline: 3px solid #2563EB; outline-offset: 2px; }
.sm-tile.is-selected { border-color: #2563EB; background: #EFF6FF; }
.sm-tile.is-target { border-color: #2563EB; border-style: dashed; }

.sm-shadow { background: #F3F4F6; }
.sm-shadow img.sm-auto { filter: brightness(0); opacity: 0.85; }

.sm-tile.is-done {
  border-color: #16A34A;
  background: #F0FDF4;
  cursor: default;
}
.sm-pic.is-done { opacity: 0.35; }
.sm-shadow.is-done img { filter: none; opacity: 1; }

.sm-tile.is-wrong { border-color: #DC2626; animation: sm-shake 0.35s; }
@keyframes sm-shake {
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
@media (prefers-reduced-motion: reduce) {
  .sm-tile.is-wrong { animation: none; }
}

.sm-ghost {
  position: fixed;
  width: 80px;
  height: 80px;
  pointer-events: none;
  z-index: 50;
  opacity: 0.85;
  transform: translate(-50%, -50%);
}

.sm-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(17, 24, 39, 0.45);
  z-index: 60;
}
.sm-overlay[hidden] { display: none; }
.sm-dialog { max-width: 360px; width: 100%; text-align: center; padding: 24px; }
.sm-dialog h2 { margin: 0 0 8px; font-size: 1.75rem; }
.sm-dialog.win h2 { color: #16A34A; }
.sm-dialog.lose h2 { color: #DC2626; }

.sm-btn {
  min-height: 48px;
  padding: 10px 24px;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  background: #2563EB;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.sm-btn:hover { background: #1D4ED8; }
.sm-btn:active { background: #1E40AF; }
.sm-btn:focus-visible { outline: 3px solid #1E40AF; outline-offset: 2px; }
