.playground-hero {
  margin-top: 18px;
}

.playground-page main.container {
  max-width: none;
}

.playground-shell {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 16px;
  margin-top: 16px;
  position: relative;
  align-items: stretch;
  --playground-divider-position: calc(52% + 8px);
}

.playground-shell::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: var(--playground-divider-position);
  transform: translateX(-50%);
  width: 14px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,.04)),
    linear-gradient(180deg, rgba(139,92,246,.22), rgba(139,92,246,.08));
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 0 0 1px rgba(0,0,0,.08), inset 0 0 0 1px rgba(255,255,255,.03);
  cursor: col-resize;
  z-index: 3;
}

.playground-shell::after {
  content: "";
  position: absolute;
  top: 50%;
  left: var(--playground-divider-position);
  transform: translate(-50%, -50%);
  width: 4px;
  height: 64px;
  border-radius: 999px;
  background: rgba(255,255,255,.38);
  box-shadow: 0 14px 32px rgba(0,0,0,.18);
  pointer-events: none;
  z-index: 4;
}

.playground-shell.is-resizing,
.playground-shell.is-resizing * {
  cursor: col-resize !important;
  user-select: none;
}

.playground-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 620px;
}

.playground-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.playground-guided-lab {
  margin-top: 16px;
}

.playground-lab-card {
  overflow: hidden;
  position: relative;
}

.playground-lab-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 14% 0%, rgba(239,68,68,.18), transparent 34%),
    radial-gradient(circle at 92% 20%, rgba(14,165,233,.12), transparent 32%);
  pointer-events: none;
}

.playground-lab-card > * {
  position: relative;
  z-index: 1;
}

.playground-lab-topline,
.playground-lab-actions,
.playground-device-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.playground-lab-topline {
  justify-content: space-between;
  margin-bottom: 14px;
}

.playground-step-counter,
.playground-device-label {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  padding: 7px 10px;
}

.playground-lab-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, .85fr);
  gap: 16px;
  align-items: stretch;
}

.playground-lab-panel {
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  border-radius: 18px;
  padding: 16px;
}

.playground-slide-link {
  display: inline-flex;
  margin-top: 8px;
  border: 1px solid rgba(239,68,68,.32);
  background: rgba(239,68,68,.1);
  color: var(--text);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.35;
  padding: 8px 11px;
}

.playground-lab-progress {
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.04);
  overflow: hidden;
  margin: 16px 0;
}

.playground-lab-progress span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ef4444, #f59e0b);
  transition: width .25s ease;
}

.playground-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.playground-select,
.playground-editor {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  color: var(--text);
  border-radius: 16px;
}

.playground-select {
  padding: 10px 12px;
  font: inherit;
}

.playground-select option {
  color: #111827;
  background: #ffffff;
}

.playground-editor {
  flex: 1;
  min-height: 420px;
  padding: 16px;
  resize: vertical;
  font: 14px/1.7 "Cascadia Code", Consolas, "Courier New", monospace;
  tab-size: 2;
}

.playground-editor:focus,
.playground-select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(255,255,255,.04), 0 0 0 5px rgba(191,32,32,.14);
}

.playground-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.playground-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.playground-btn.primary {
  border-color: rgba(139,92,246,.45);
  background: rgba(139,92,246,.12);
}

.playground-btn:hover {
  opacity: .95;
}

.playground-btn:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.playground-btn:focus {
  outline: none;
  border-color: var(--brand);
}

.playground-device-toolbar {
  justify-content: space-between;
}

.playground-device-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.playground-device-btn {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  color: var(--text);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  padding: 8px 11px;
}

.playground-device-btn.is-active {
  border-color: rgba(239,68,68,.58);
  background: rgba(239,68,68,.18);
}

.playground-preview-stage {
  flex: 1;
  min-height: 470px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.08), rgba(255,255,255,.02)),
    repeating-linear-gradient(45deg, rgba(255,255,255,.035) 0 1px, transparent 1px 13px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 22px;
}

.playground-preview-frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 430px;
  border: 1px solid rgba(15,23,42,.22);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0,0,0,.28);
  transition: width .22s ease, height .22s ease, min-height .22s ease, border-radius .22s ease;
}

.playground-preview-stage[data-device="phone"] .playground-preview-frame {
  width: 390px;
  height: 720px;
  min-height: 720px;
  border-radius: 32px;
}

.playground-preview-stage[data-device="phone"][data-orientation="landscape"] .playground-preview-frame {
  width: 720px;
  height: 390px;
  min-height: 390px;
}

.playground-preview-stage[data-device="tablet"] .playground-preview-frame {
  width: 760px;
  height: 980px;
  min-height: 980px;
  border-radius: 28px;
}

.playground-preview-stage[data-device="tablet"][data-orientation="landscape"] .playground-preview-frame {
  width: 980px;
  height: 760px;
  min-height: 760px;
}

.playground-preview-stage[data-device="laptop"] .playground-preview-frame {
  width: min(100%, 1180px);
  height: 720px;
  min-height: 720px;
}

.playground-preview-stage[data-device="laptop"][data-orientation="portrait"] .playground-preview-frame {
  width: 820px;
  height: 980px;
  min-height: 980px;
}

.playground-status {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.playground-status strong {
  color: var(--text);
}

.playground-hint {
  border: 1px dashed rgba(255,255,255,.2);
  background: rgba(255,255,255,.02);
  border-radius: 16px;
  padding: 14px;
  color: var(--muted);
  line-height: 1.8;
}

.playground-hint b,
.playground-hint strong {
  color: var(--text);
}

.playground-snippets {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.playground-snippet {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
}

.playground-snippet:hover {
  border-color: var(--brand);
}

.playground-assignment {
  margin-top: 16px;
}

.playground-assignment-card {
  overflow: hidden;
  position: relative;
}

.playground-assignment-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 10% 10%, rgba(34,197,94,.10), transparent 28%),
    radial-gradient(circle at 90% 10%, rgba(59,130,246,.08), transparent 24%);
  pointer-events: none;
}

.playground-assignment-card > * {
  position: relative;
  z-index: 1;
}

.playground-assignment-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, .95fr);
  gap: 16px;
  align-items: start;
}

.playground-assignment-panel {
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  border-radius: 18px;
  padding: 16px;
}

.playground-assignment-checklist {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.playground-assignment-checklist li {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255,255,255,.03);
}

.playground-assignment-checklist li.is-complete {
  border-color: rgba(34,197,94,.42);
  background: rgba(34,197,94,.10);
}

.playground-assignment-checklist li.is-failed {
  border-color: rgba(239,68,68,.42);
  background: rgba(239,68,68,.10);
}

.playground-assignment-checklist li.is-pending {
  opacity: .78;
}

.playground-check-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.playground-check-title {
  font-weight: 800;
  color: var(--text);
}

.playground-check-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.playground-check-state.is-complete {
  background: rgba(34,197,94,.18);
  color: #86efac;
}

.playground-check-state.is-failed {
  background: rgba(239,68,68,.18);
  color: #fca5a5;
}

.playground-check-state.is-pending {
  background: rgba(148,163,184,.16);
  color: #cbd5e1;
}

.playground-check-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.playground-assignment-summary {
  margin: 14px 0 0;
  color: var(--text);
  font-weight: 700;
  line-height: 1.7;
}

.playground-assignment-errors {
  margin: 14px 0 0;
  padding-left: 20px;
  color: #fecaca;
  display: grid;
  gap: 8px;
}

.playground-assignment-errors:empty {
  display: none;
}

@media (max-width: 920px) {
  .playground-shell {
    grid-template-columns: 1fr;
  }

  .playground-shell::before,
  .playground-shell::after {
    display: none;
  }

  .playground-card {
    min-height: auto;
  }

  .playground-preview-frame {
    min-height: 360px;
  }

  .playground-lab-grid {
    grid-template-columns: 1fr;
  }

  .playground-preview-stage {
    min-height: 380px;
    padding: 12px;
  }

  .playground-preview-stage[data-device] .playground-preview-frame {
    width: 100%;
    height: 520px;
    min-height: 520px;
  }

  .playground-assignment-grid {
    grid-template-columns: 1fr;
  }
}
