body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #15214f 0%, #0b1220 45%, #070a15 100%);
  color: #e8ebff;
  font-family: "Segoe UI", Arial, sans-serif;
}

html {
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: inherit;
}

body header {
  padding: 24px 24px 8px;
  text-align: center;
}

body header h1 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 3rem);
  letter-spacing: 0.03em;
}

.content {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 32px;
}

.topbar {
  display: grid;
  gap: 20px;
  align-items: start;
  margin: 20px 0 30px;
}

#search {
  width: 100%;
  border: none;
  border-radius: 16px;
  padding: 18px 20px;
  font-size: 1rem;
  background: rgba(255,255,255,0.08);
  color: #f8f9ff;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

#search::placeholder {
  color: rgba(248, 249, 255, 0.6);
}

.details {
  width: 100%;
}

.details-card {
  position: relative;
  background: rgba(18, 28, 58, 0.95);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.25);
}

.close-button {
  position: absolute;
  right: 18px;
  top: 18px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}

.details-card h2 {
  margin-top: 0;
}

.section {
  margin-top: 18px;
}

.section h3 {
  margin: 0 0 10px;
  color: #9bb0ff;
  font-size: 0.98rem;
}

.section p,
.section ol {
  margin: 0;
  line-height: 1.75;
  color: #d9e2ff;
}

.section ol {
  padding-left: 1.3rem;
}

.code,
code {
  display: block;
  background: rgba(255,255,255,0.06);
  padding: 16px;
  border-radius: 14px;
  overflow-x: auto;
  font-family: "Consolas", "Courier New", monospace;
  color: #f2f8ff;
  margin: 0;
}

#scripts {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card {
  background: rgba(17, 28, 52, 0.95);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 22px;
  padding: 22px;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  cursor: pointer;
}

.card:hover,
.card.selected {
  transform: translateY(-4px);
  border-color: #5a78ff;
  box-shadow: 0 20px 50px rgba(15, 34, 90, 0.35);
}

.card-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.card h2 {
  margin: 0 0 12px 0;
  font-size: 1.15rem;
}

.tag {
  background: rgba(90, 120, 255, 0.16);
  color: #c5d0ff;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.82rem;
}

.card code,
.card .preview {
  display: block;
}

.card code {
  background: rgba(255,255,255,0.06);
  padding: 14px;
  border-radius: 14px;
  font-family: "Consolas", "Courier New", monospace;
  color: #e9f1ff;
  margin-bottom: 12px;
  white-space: pre-wrap;
}

.preview {
  margin: 0;
  color: #b8c4e9;
}

.empty,
.error {
  color: #c5d0ff;
  text-align: center;
  padding: 26px;
  background: rgba(255,255,255,0.04);
  border-radius: 18px;
}

.hidden {
  display: none;
}

@media (min-width: 960px) {
  .topbar {
    grid-template-columns: 1.4fr 1fr;
  }
}
