/* ── Solo — 5×5 Star Battle puzzle ───────────────────────────────────────── */

#canvas-wrap {
  background: #060a12;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow-y: auto;
  padding: 0;
}

.sl-hide { display: none !important; }

/* ── Screen wrapper ───────────────────────────────────────────────────────── */

.sl-screen {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100%;
}

/* ── Start screen ─────────────────────────────────────────────────────────── */

#sl-start {
  justify-content: center;
  padding: 40px 24px 48px;
}

.sl-start-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 320px;
}

.sl-logo-img {
  display: block;
  height: 40px;
  width: auto;
  margin: 0 auto 2px;
}

.sl-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.96rem;
  color: rgba(148, 163, 184, 0.7);
  line-height: 1.6;
  margin: 0 0 36px;
  text-align: center;
}

.sl-start-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

/* ── HUD ──────────────────────────────────────────────────────────────────── */

.sl-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 10px 18px 4px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(148, 163, 184, 0.4);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  flex-shrink: 0;
}

/* ── Game screen ──────────────────────────────────────────────────────────── */

#sl-game {
  justify-content: flex-start;
}

/* ── Board wrap ───────────────────────────────────────────────────────────── */

.sl-board-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 16px 16px;
  box-sizing: border-box;
}

/* ── Grid ─────────────────────────────────────────────────────────────────── */

.sl-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: 100%;
  max-width: 340px;
}

/* ── Cells ────────────────────────────────────────────────────────────────── */

.sl-cell {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  transition: filter 0.1s;
  /* borders are set inline by JS based on shape neighbours */
}

.sl-cell:hover { filter: brightness(1.22); }
.sl-cell:active { filter: brightness(0.9); }

/* ── Shape tints (five distinguishable dark hues) ─────────────────────────── */

.sl-shape-1 { background: #1a0202; }
.sl-shape-2 { background: #200404; }
.sl-shape-3 { background: #260505; }
.sl-shape-4 { background: #2c0606; }
.sl-shape-5 { background: #320808; }

/* ── Star icon ────────────────────────────────────────────────────────────── */

.sl-star {
  display: block;
  font-size: 2.2rem;
  line-height: 1;
  color: #ffd700;
  text-shadow:
    0 0 10px rgba(255, 215, 0, 0.85),
    0 0 24px rgba(255, 215, 0, 0.4);
  user-select: none;
  pointer-events: none;
  animation: sl-star-pop 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes sl-star-pop {
  0%   { transform: scale(0.45); opacity: 0; }
  100% { transform: scale(1);    opacity: 1; }
}

/* ── Actions bar (Submit) ─────────────────────────────────────────────────── */

.sl-actions {
  flex-shrink: 0;
  padding: 10px 24px 4px;
  width: 100%;
  box-sizing: border-box;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.sl-btn-primary {
  display: block;
  width: 100%;
  background: #dc2626;
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 15px 0;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 0 #7f1d1d, 0 6px 16px rgba(0, 0, 0, 0.5);
  transition: transform 0.07s, box-shadow 0.07s, background 0.1s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.sl-btn-primary:hover  { background: #ef4444; }
.sl-btn-primary:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #7f1d1d;
}

.sl-btn-ghost {
  display: block;
  width: 100%;
  background: transparent;
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: rgba(148, 163, 184, 0.6);
  padding: 14px 0;
  border-radius: 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.sl-btn-ghost:hover { border-color: rgba(99, 102, 241, 0.6); color: rgba(148, 163, 184, 0.9); }

/* ── Correct-flash animation (brief, on successful submit) ───────────────── */

.sl-grid.sl-correct-flash {
  animation: sl-correct-flash 0.6s ease-out forwards;
}

@keyframes sl-correct-flash {
  0%   { filter: none; }
  25%  { filter: brightness(1.8) drop-shadow(0 0 20px rgba(251,191,36,0.9)); }
  65%  { filter: brightness(1.4) drop-shadow(0 0 12px rgba(251,191,36,0.55)); }
  100% { filter: brightness(1.0) drop-shadow(0 0 5px rgba(251,191,36,0.2)); }
}

/* ── Overlays (correct + fail) ────────────────────────────────────────────── */

.sl-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  background: rgba(6, 10, 18, 0.92);
  z-index: 30;
  padding: 40px 32px;
  box-sizing: border-box;
}

.sl-overlay-head {
  font-family: 'DM Serif Display', serif;
  font-size: 2.8rem;
  color: #e2e8f0;
  margin: 0;
  text-align: center;
}

.sl-overlay-head--correct {
  color: #fbbf24;
  text-shadow: 0 0 32px rgba(251, 191, 36, 0.55);
}

.sl-overlay-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  color: rgba(148, 163, 184, 0.8);
  margin: -12px 0 0;
  text-align: center;
  line-height: 1.5;
}

.sl-overlay-btn {
  max-width: 240px;
  width: 100%;
}

/* ── Win screen ───────────────────────────────────────────────────────────── */

#sl-win {
  justify-content: center;
  padding: 40px 24px 48px;
}

.sl-win-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 320px;
  text-align: center;
}

.sl-win-logo {
  font-family: 'DM Serif Display', serif;
  font-size: 3rem;
  color: #fbbf24;
  margin: 0 0 4px;
  text-shadow: 0 0 24px rgba(251, 191, 36, 0.4);
}

.sl-win-headline {
  font-family: 'DM Serif Display', serif;
  font-size: 2.2rem;
  color: #fbbf24;
  margin: 0 0 12px;
}

.sl-win-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  color: rgba(148, 163, 184, 0.7);
  margin: 0 0 36px;
  line-height: 1.6;
}

.sl-win-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
