/* ── Shaded ───────────────────────────────────────────────────────────────── */

#canvas-wrap {
  background: #0c0c0c;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
  padding: 0;
  position: relative;
}

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

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

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

/* ── Loading / Error ─────────────────────────────────────────────────────── */

.sh-loading-text,
.sh-error-text {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  color: rgba(148, 163, 184, 0.5);
  text-align: center;
  margin: auto;
}

.sh-error-text { color: rgba(185, 28, 28, 0.75); }

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

#sh-game {
  justify-content: center;
  padding: 20px 24px 40px;
  gap: 28px;
}

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

.sh-hud {
  width: 100%;
  text-align: center;
  flex-shrink: 0;
}

.sh-level-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.4);
}

/* ── Hint label ──────────────────────────────────────────────────────────── */

.sh-hint {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.28);
  flex-shrink: 0;
}

/* ── Bars container ──────────────────────────────────────────────────────── */

.sh-bars-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

.sh-bars {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 10px;
}

/* ── Individual bar ──────────────────────────────────────────────────────── */

.sh-bar {
  width: 25px;
  height: 100px;
  border-radius: 5px;
  flex-shrink: 0;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  position: relative;  /* so z-index works while dragging */
  /* background-color set inline by JS */
}

.sh-bar--dragging {
  cursor: grabbing;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
  z-index: 10;
  opacity: 0.90;
}

@keyframes sh-solve-flash {
  0%   { filter: brightness(1); }
  50%  { filter: brightness(1.5); }
  100% { filter: brightness(1); }
}

.sh-bar--solved {
  animation: sh-solve-flash 0.32s ease-out forwards;
}

/* ── Accomplishment overlay ──────────────────────────────────────────────── */

.sh-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 12, 12, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 10;
  padding: 24px;
}

.sh-overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 300px;
  text-align: center;
}

.sh-overlay-head {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #4ade80;
}

.sh-overlay-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  color: rgba(148, 163, 184, 0.7);
  margin-bottom: 8px;
}

/* ── Shared buttons ──────────────────────────────────────────────────────── */

.sh-btn-primary {
  width: 100%;
  background: #1e293b;
  border: 1px solid #334155;
  color: #f1f5f9;
  padding: 13px 0;
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.sh-btn-primary:hover  { background: #253045; }
.sh-btn-primary:active { background: #1a2535; }

.sh-btn-ghost {
  width: 100%;
  background: transparent;
  border: 1px solid #2d3f55;
  color: #64748b;
  padding: 12px 0;
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.sh-btn-ghost:hover  { border-color: #4a5568; color: #94a3b8; }
.sh-btn-ghost:active { background: #1e293b; }

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

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

.sh-start-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 300px;
  text-align: center;
}

.sh-start-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  color: #f1f5f9;
  letter-spacing: 0.01em;
  margin-bottom: 4px;
}

.sh-start-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  color: rgba(148, 163, 184, 0.5);
  margin-bottom: 20px;
}

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

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

#sh-win {
  justify-content: center;
  padding: 48px 24px;
  gap: 8px;
  text-align: center;
}

.sh-win-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 300px;
}

.sh-win-headline {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  color: #f1f5f9;
  letter-spacing: 0.01em;
}

.sh-win-body {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  color: rgba(148, 163, 184, 0.5);
  margin-bottom: 16px;
  line-height: 1.5;
}
