#levelScene {
  min-height: 100svh;
}

#levelScene .scene-header {
  grid-template-columns: 52px 1fr 52px;
}

#levelScene .scene-header > div {
  text-align: center;
}

.progress-panel {
  display: flex;
  width: min(100%, var(--content-wide));
  min-height: 76px;
  margin: 0 auto clamp(20px, 3vh, 32px);
  padding: 16px 22px;
  align-items: center;
  gap: 20px;
  border-radius: 18px;
}

.progress-panel > div:first-child {
  display: flex;
  min-width: 190px;
  flex-direction: column;
}

.progress-panel strong {
  color: var(--sky);
  font-size: 23px;
  text-shadow: 0 2px 8px rgba(52, 124, 242, 0.41);
}

.progress-panel span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.17em;
}

.progress-track {
  height: 12px;
  flex: 1;
  overflow: hidden;
  border-radius: 99px;
  background: #07142b;
  box-shadow: inset 0 2px 4px #000;
}

.progress-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1f5ed0, var(--accent) 55%, var(--sky));
  box-shadow: inset 0 1px rgba(226, 244, 255, 0.52), 0 0 16px var(--accent-glow);
  transition: width 0.8s var(--ease-brick);
}

.level-grid {
  display: grid;
  width: min(100%, var(--content-wide));
  margin: 0 auto;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 24px);
}

.level-card {
  position: relative;
  display: grid;
  min-width: 0;
  aspect-ratio: 1;
  overflow: hidden;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--panel-radius);
  color: #fff;
  background:
    radial-gradient(circle at 78% 18%, rgba(91, 167, 255, 0.15), transparent 38%),
    linear-gradient(145deg, rgba(255,255,255,.1), transparent 37%),
    linear-gradient(145deg, #23334d, #111a2b);
  box-shadow: inset 0 1px rgba(255,255,255,.14), inset 0 -8px rgba(0,0,0,.17), 0 13px 28px rgba(0,0,0,.25);
  transition: transform 0.25s var(--ease-brick), border-color 0.2s, box-shadow 0.2s;
}

.level-card::before {
  position: absolute;
  inset: 11px;
  content: "";
  border: 1px solid rgba(180, 219, 255, 0.1);
  border-radius: 15px;
}

.level-card:not(:disabled):hover {
  z-index: 2;
  border-color: #6cbaff;
  box-shadow: inset 0 1px rgba(255,255,255,.15), inset 0 -8px rgba(0,0,0,.17), 0 10px #0b337d, 0 20px 31px rgba(0,0,0,.35), 0 0 22px var(--accent-glow);
  transform: translateY(-8px);
}

.level-card.is-locked,
.level-card:disabled {
  opacity: 1;
  filter: saturate(0.46) brightness(0.78);
  cursor: not-allowed;
}

.level-card.is-cleared { border-color: rgba(101, 184, 255, 0.48); }
.level-number {
  position: absolute;
  z-index: 4;
  top: 17px;
  left: 19px;
  color: #fff;
  font-size: clamp(38px, 4vw, 54px);
  font-weight: 900;
  letter-spacing: -.08em;
  line-height: 1;
  text-shadow: 0 3px 0 #143467, 0 8px 17px rgba(0,0,0,.62);
}
.level-name { position: absolute; z-index: 3; top: 72px; left: 21px; color: #aebbd0; font-size: 10px; font-weight: 900; letter-spacing: .16em; }
.lock-badge { position: absolute; z-index: 5; top: 18px; right: 16px; min-height: 22px; padding: 0 8px; border: 1px solid rgba(210,229,249,.22); border-radius: 99px; color: #e0e9f4; background: rgba(5,11,21,.62); font-size: 9px; font-weight: 900; line-height: 20px; letter-spacing: .1em; }

.level-silhouette {
  position: relative;
  z-index: 2;
  display: grid;
  width: 48%;
  aspect-ratio: 1;
  margin-top: 5%;
  padding: 6px;
  grid-template-columns: repeat(9, 1fr);
  grid-template-rows: repeat(9, 1fr);
  gap: 1px;
  border: 1px solid rgba(183, 222, 255, 0.16);
  border-radius: 11px;
  opacity: .92;
  background: rgba(7, 16, 30, 0.42);
  box-shadow: inset 0 1px rgba(255,255,255,.05), 0 8px 18px rgba(0,0,0,.18);
}

.level-silhouette .mini-cell { border-radius: 1px; }
.level-silhouette .mini-cell.is-filled {
  background: #d8edff;
  box-shadow: 0 0 0 1px rgba(255,255,255,.22), 0 0 6px rgba(100,188,255,.32);
}
.level-card.is-locked .level-silhouette .mini-cell.is-filled,
.level-card:disabled .level-silhouette .mini-cell.is-filled {
  background: #92a0b4;
  box-shadow: none;
}
.level-stars { position: absolute; z-index: 3; bottom: 14px; left: 50%; display: flex; width: 76%; height: 48px; align-items: flex-end; justify-content: center; gap: 8px; transform: translateX(-50%); }
.level-stars .star,
.level-stars .star:nth-child(2) { width: 31px; font-size: 34px; transform: none; }
