/* Loitsusanat — SpellCast-tyylinen */

.ls-hud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  justify-content: center;
  margin: 0.5rem 0 0.75rem;
  font-size: 0.92rem;
}

.ls-hud strong {
  color: #e8f0ff;
}

.ls-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.45rem;
  max-width: min(100%, 22rem);
  margin: 0.5rem auto 1rem;
}

.ls-cell {
  position: relative;
  aspect-ratio: 1;
  border: 2px solid #3d4f6a;
  border-radius: 10px;
  background: linear-gradient(160deg, #2a3a55, #1e2a40);
  color: #f2f6ff;
  font-size: clamp(1.1rem, 4.5vw, 1.55rem);
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.ls-cell:hover:not(:disabled) {
  border-color: #7aa2ff;
}

.ls-cell.selected {
  border-color: #f0c14b;
  background: linear-gradient(160deg, #4a3a20, #3a2e18);
  box-shadow: 0 0 0 2px rgba(240, 193, 75, 0.35);
}

.ls-cell.hint-path {
  border-color: #7dcea0;
  background: linear-gradient(160deg, #2a4a3a, #1e3830);
}

.ls-cell.has-dw {
  border-color: #e891b0;
}

.ls-badge {
  position: absolute;
  top: 3px;
  left: 4px;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #b8d4ff;
  opacity: 0.95;
}

.ls-badge.dw {
  color: #ffb3d0;
}

.ls-gem {
  position: absolute;
  top: 3px;
  right: 4px;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffe8f4, #e85a9a);
  box-shadow: 0 0 6px rgba(232, 90, 154, 0.7);
}

.ls-path-num {
  position: absolute;
  bottom: 3px;
  right: 5px;
  font-size: 0.55rem;
  font-weight: 700;
  color: #f0c14b;
}

.ls-preview {
  text-align: center;
  min-height: 1.5em;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0.25rem 0 0.75rem;
  color: #e8f0ff;
}

.ls-preview.invalid {
  color: #f5a8a8;
}

.ls-preview.valid {
  color: #9eecc0;
}

.ls-abilities {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.ls-history {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 10rem;
  overflow: auto;
  font-size: 0.88rem;
}

.ls-history li {
  padding: 0.25rem 0;
  border-bottom: 1px solid rgba(200, 220, 245, 0.1);
}

.ls-status {
  text-align: center;
  min-height: 1.4em;
  margin: 0.65rem 0;
  font-weight: 600;
}

.ls-status.win {
  color: #86efac;
}

.ls-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 220px);
  gap: 1rem;
  align-items: start;
}

@media (max-width: 720px) {
  .ls-layout {
    grid-template-columns: 1fr;
  }
}

.ls-swap-mode .ls-cell {
  cursor: crosshair;
}
