/* danilopez25.es — Code Lab / HTML CSS JS Playground */

*,
*::before,
*::after {
  box-sizing: border-box;
}

.playground-page {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 100vh;
  padding: 118px 18px 110px;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.playground-overlay {
  position: absolute;
  z-index: -2;
  inset: 0;
  background:
    radial-gradient(circle at 48% 4%, rgba(123, 92, 255, .16), transparent 30%),
    radial-gradient(circle at 93% 52%, rgba(181, 108, 255, .08), transparent 28%),
    rgba(4, 3, 10, .69);
}

.playground-panel {
  position: relative;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: clamp(28px, 4vw, 48px);
  border: 1px solid rgba(181, 108, 255, .42);
  border-radius: 24px;
  background: rgba(8, 7, 16, .86);
  box-shadow: 0 36px 110px rgba(0, 0, 0, .5);
  -webkit-backdrop-filter: blur(13px);
  backdrop-filter: blur(13px);
}

.playground-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 13%;
  width: 74%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(181, 108, 255, .78), transparent);
}

.playground-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.playground-back,
.playground-help-open {
  display: inline-flex;
  min-height: 36px;
  padding: 8px 14px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(181, 108, 255, .34);
  border-radius: 999px;
  background: rgba(123, 92, 255, .08);
  color: #ddd4f7;
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: .04em;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.playground-back:hover,
.playground-help-open:hover {
  border-color: rgba(181, 108, 255, .62);
  background: rgba(123, 92, 255, .16);
  color: #fff;
  text-decoration: none;
}

.playground-back:hover {
  transform: translateX(-2px);
}

.playground-head {
  max-width: 760px;
  margin: -3px auto 26px;
  color: #fff;
  text-align: center;
}

.playground-eyebrow {
  display: inline-block;
  margin-bottom: 7px;
  color: #b98aff;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .24em;
  text-transform: uppercase;
}

.playground-head h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.playground-head h1 span {
  margin-left: 7px;
  color: #a85cff;
  font-weight: 700;
}

.playground-head p {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, .68);
  font-size: clamp(14px, 1.4vw, 16px);
  line-height: 1.55;
}

.playground-head::after {
  content: "";
  display: block;
  width: 56px;
  height: 3px;
  margin: 15px auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #7b5cff, #b56cff);
  box-shadow: 0 0 14px rgba(181, 108, 255, .35);
}

.playground-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.playground-layout.help-open {
  grid-template-columns: minmax(0, 1fr) 290px;
}

.playground-workspace {
  min-width: 0;
}

.playground-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.playground-editor-card {
  display: grid;
  min-width: 0;
  height: 390px;
  grid-template-rows: 42px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(181, 108, 255, .2);
  border-radius: 14px;
  background: rgba(10, 10, 18, .9);
  box-shadow: 0 16px 38px rgba(0, 0, 0, .2);
}

.playground-card-head {
  display: flex;
  height: 42px;
  min-height: 42px;
  padding: 0 13px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .055);
}

.playground-card-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.playground-card-title h2 {
  margin: 0;
  color: #b98aff;
  font-size: 16px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.playground-lang-icon {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 900;
}

.playground-lang-icon--html {
  background: #e75b28;
  color: #fff;
}

.playground-lang-icon--css {
  background: #3b76e6;
  color: #fff;
}

.playground-lang-icon--js {
  background: #e3cb42;
  color: #161616;
  font-size: 8px;
}

.playground-preview-icon {
  color: #b56cff;
  font-size: 15px;
}

.playground-card-tools {
  display: flex;
  align-items: center;
  gap: 5px;
}

.playground-card-tools button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: rgba(255, 255, 255, .55);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.playground-card-tools button:hover {
  background: rgba(123, 92, 255, .1);
  color: #c39aff;
}

.playground-code-wrap {
  display: grid;
  min-width: 0;
  min-height: 0;
  height: 100%;
  grid-template-columns: 44px minmax(0, 1fr);
  overflow: hidden;
  background: #0a0c13;
}

.playground-lines {
  height: 100%;
  margin: 0;
  padding: 13px 9px 18px 0;
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, .055);
  color: rgba(255, 255, 255, .27);
  font: 15px/1.6 Consolas, "Courier New", monospace;
  text-align: right;
  user-select: none;
}

.playground-code {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 13px 14px 18px;
  overflow: auto;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: #dbe6f0;
  caret-color: #b56cff;
  font: 16px/1.6 Consolas, "Courier New", monospace;
  tab-size: 2;
  white-space: pre;
}

.playground-code::selection {
  background: rgba(123, 92, 255, .34);
}

.playground-preview-wrap {
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 13px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 45%, rgba(123, 92, 255, .08), transparent 60%),
    #080a11;
}

#playground-preview {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 1px solid rgba(181, 108, 255, .37);
  border-radius: 10px;
  background: #fff;
}

.playground-actions {
  display: grid;
  margin-top: 12px;
  padding: 12px;
  grid-template-columns: minmax(160px, 235px) repeat(3, minmax(120px, 180px)) minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(181, 108, 255, .18);
  border-radius: 13px;
  background: rgba(10, 9, 18, .86);
}

.playground-action {
  display: inline-flex;
  min-height: 39px;
  padding: 8px 13px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(181, 108, 255, .26);
  border-radius: 9px;
  background: rgba(123, 92, 255, .05);
  color: #d9ccff;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 800;
  transition: border-color .16s ease, background .16s ease, filter .16s ease;
}

.playground-action:hover {
  border-color: rgba(181, 108, 255, .55);
  background: rgba(123, 92, 255, .12);
  color: #fff;
}

.playground-action--primary {
  border-color: rgba(202, 157, 255, .68);
  background: linear-gradient(135deg, #7549ee, #a747eb);
  color: #fff;
  box-shadow: 0 7px 20px rgba(123, 71, 244, .22);
}

.playground-action--primary:hover {
  filter: brightness(1.08);
}

.playground-action kbd {
  padding: 2px 5px;
  border: 0;
  border-radius: 5px;
  background: rgba(0, 0, 0, .22);
  color: rgba(255, 255, 255, .7);
  font: 9px/1.3 Consolas, monospace;
}

.playground-status {
  justify-self: end;
  color: #68cb77;
  font-size: 11px;
  white-space: nowrap;
}

.playground-safe-note {
  display: flex;
  margin: 8px 3px 0;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  color: rgba(255, 255, 255, .38);
  font-size: 10px;
}

.playground-safe-note i {
  color: #9072d9;
}

.playground-help {
  display: none;
  min-width: 0;
  max-height: 620px;
  overflow: hidden;
  border: 1px solid rgba(181, 108, 255, .24);
  border-radius: 14px;
  background: rgba(10, 9, 18, .95);
}

.playground-layout.help-open .playground-help {
  display: block;
}

.playground-help-head {
  display: flex;
  min-height: 48px;
  padding: 0 14px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, .065);
}

.playground-help-head h2 {
  display: flex;
  margin: 0;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 14px;
  text-transform: uppercase;
}

.playground-help-head h2 i {
  color: #b56cff;
}

.playground-help-head button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: rgba(255, 255, 255, .6);
  cursor: pointer;
}

.playground-help-head button:hover {
  background: rgba(123, 92, 255, .1);
  color: #fff;
}

.playground-help-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.playground-help-tabs button {
  position: relative;
  min-height: 44px;
  padding: 8px 4px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, .52);
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 850;
  text-transform: uppercase;
}

.playground-help-tabs button.is-active {
  color: #c29aff;
}

.playground-help-tabs button.is-active::after {
  content: "";
  position: absolute;
  right: 8px;
  bottom: 0;
  left: 8px;
  height: 2px;
  background: #a65fff;
}

.playground-help-content {
  max-height: 530px;
  overflow: auto;
  padding: 10px;
}

.playground-help-panel {
  display: none;
}

.playground-help-panel.is-active {
  display: block;
}

.playground-help-panel h3 {
  margin: 4px 3px 10px;
  color: #b98aff;
  font-size: 12px;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.playground-help-item {
  display: grid;
  padding: 13px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid rgba(255, 255, 255, .055);
}

.playground-help-item:last-child {
  border-bottom: 0;
}

.playground-help-item code {
  display: block;
  margin-bottom: 4px;
  color: #e4ebf6;
  font: 13px/1.4 Consolas, "Courier New", monospace;
}

.playground-help-item p {
  margin: 0;
  color: rgba(255, 255, 255, .5);
  font-size: 12px;
  line-height: 1.5;
}

.playground-help-item button {
  min-height: 29px;
  padding: 6px 9px;
  border: 1px solid rgba(181, 108, 255, .5);
  border-radius: 7px;
  background: rgba(123, 92, 255, .08);
  color: #c69cff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.playground-help-item button:hover {
  background: rgba(123, 92, 255, .18);
  color: #fff;
}

.playground-expand-layer {
  position: fixed;
  z-index: 99999;
  inset: 0;
  padding: 24px;
  background: rgba(2, 2, 7, .92);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
}

.playground-expand-dialog {
  display: grid;
  width: min(1200px, 100%);
  height: min(760px, calc(100vh - 48px));
  margin: 0 auto;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(181, 108, 255, .45);
  border-radius: 16px;
  background: #090a12;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .62);
}

.playground-expand-head {
  display: flex;
  min-height: 48px;
  padding: 0 14px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  color: #c79fff;
}

.playground-expand-head button {
  display: inline-flex;
  padding: 7px 10px;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(181, 108, 255, .25);
  border-radius: 8px;
  background: rgba(123, 92, 255, .07);
  color: rgba(255, 255, 255, .72);
  cursor: pointer;
  font-size: 10px;
}

#playground-expand-editor {
  width: 100%;
  height: 100%;
  padding: 20px;
  resize: none;
  border: 0;
  outline: 0;
  background: #090b12;
  color: #e1e9f2;
  font: 15px/1.6 Consolas, "Courier New", monospace;
}

@media (max-width: 1180px) {
  .playground-layout.help-open {
    grid-template-columns: minmax(0, 1fr);
  }

  .playground-layout.help-open .playground-help {
    display: block;
    max-height: none;
  }

  .playground-help-content {
    max-height: 430px;
  }

  .playground-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .playground-status {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

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

  .playground-editor-card {
    height: 330px;
  }

  .playground-code-wrap,
  .playground-preview-wrap,
  .playground-code,
  #playground-preview {
    min-height: 0;
    height: 100%;
  }

  .playground-safe-note {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .playground-page {
    padding: 94px 12px 90px;
    background-attachment: scroll;
  }

  .playground-panel {
    padding: 22px 12px;
    border-radius: 18px;
  }

  .playground-head {
    margin: 23px auto 24px;
  }

  .playground-toolbar {
    align-items: stretch;
  }
}

@media (max-width: 520px) {
  .playground-toolbar {
    flex-direction: column;
  }

  .playground-back,
  .playground-help-open {
    width: 100%;
  }

  .playground-head h1 {
    font-size: 36px;
  }

  .playground-code-wrap {
    grid-template-columns: 35px minmax(0, 1fr);
  }

  .playground-lines {
    padding-right: 6px;
    font-size: 13.5px;
  }

  .playground-code {
    padding-right: 9px;
    padding-left: 9px;
    font-size: 12.5px;
  }

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

  .playground-status {
    grid-column: auto;
  }

  .playground-help-tabs {
    grid-template-columns: repeat(2, 1fr);
  }

  .playground-expand-layer {
    padding: 10px;
  }

  .playground-expand-dialog {
    height: calc(100vh - 20px);
  }

  .playground-expand-head button span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .playground-back,
  .playground-help-open,
  .playground-action,
  .playground-card-tools button {
    transition: none;
  }

  .playground-back:hover {
    transform: none;
  }
}
