:root {
  color-scheme: light;
  --bg: #0b1220;
  --card: rgba(255, 255, 255, 0.06);
  --card2: rgba(255, 255, 255, 0.08);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.7);
  --faint: rgba(255, 255, 255, 0.55);
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --primary: #c084fc;
  --primary2: #a78bfa;
  --danger: #ff6b6b;
  --ok: #34d399;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Helvetica,
    Arial,
    "Apple Color Emoji",
    "Segoe UI Emoji";
  background:
    radial-gradient(1000px 600px at 20% 10%, rgba(192, 132, 252, 0.18), transparent 55%),
    radial-gradient(800px 500px at 80% 20%, rgba(167, 139, 250, 0.18), transparent 60%),
    radial-gradient(900px 600px at 60% 85%, rgba(192, 132, 252, 0.1), transparent 55%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  background-attachment: fixed;
  background-size: cover;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: 0.95em;
}

.app {
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 16px 36px;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: block;
  object-fit: cover;
  object-position: center;
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

h1 {
  font-size: 20px;
  margin: 0;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.logger {
  padding: 18px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

@media (max-width: 1699px) {
  .card {
    display: block;
  }

  .cardColumn--right {
    border-left: 0;
  }
}

@media (min-width: 1700px) {
  .card {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    align-items: start;
  }

  .cardColumn--left,
  .cardColumn--right {
    min-width: 0;
  }

  .cardColumn--left {
    grid-column: 1;
  }

  .cardColumn--right {
    grid-column: 2;
    border-left: 1px solid var(--border);
  }

  .cardColumn--right > .logger:first-child {
    border-top: 0;
  }
}

.form {
  padding: 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 700px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
  }
  .grid {
    grid-template-columns: 1fr;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--text);
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}

input[type="checkbox"] {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.18);
  position: relative;
  cursor: pointer;
  transition: all 120ms ease;
}

input[type="checkbox"]:checked {
  background: linear-gradient(135deg, rgba(192, 132, 252, 0.35), rgba(167, 139, 250, 0.3));
  border-color: rgba(192, 132, 252, 0.6);
}

input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.95);
  font-weight: 800;
}

input[type="checkbox"]:hover {
  border-color: rgba(110, 231, 255, 0.5);
  background: rgba(0, 0, 0, 0.22);
}

input[type="checkbox"]:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(192, 132, 252, 0.15);
}

.label {
  color: var(--muted);
  font-size: 13px;
}

.labelRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.fieldValue {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 2px 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
}

input[type="number"] {
  appearance: textfield;
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.18);
  color: var(--text);
  outline: none;
  box-shadow: 0 0 0 0 rgba(110, 231, 255, 0);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

input[type="number"]:focus {
  border-color: rgba(110, 231, 255, 0.6);
  box-shadow: 0 0 0 4px rgba(110, 231, 255, 0.15);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
  cursor: pointer;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

button {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  transition: transform 60ms ease, background 120ms ease, border-color 120ms ease;
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.primary {
  border-color: rgba(110, 231, 255, 0.32);
  background: linear-gradient(135deg, rgba(110, 231, 255, 0.25), rgba(167, 139, 250, 0.22));
}

.primary:hover {
  background: linear-gradient(135deg, rgba(110, 231, 255, 0.32), rgba(167, 139, 250, 0.28));
}

.ghost {
  background: rgba(0, 0, 0, 0.14);
}

.ghost:hover {
  background: rgba(0, 0, 0, 0.2);
}

.small {
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.hint {
  margin-top: 14px;
}

details {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.12);
}

summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
}

.hintBody {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.hintBody ul {
  margin: 0;
  padding-left: 18px;
}

.hintNote {
  margin: 10px 0 0;
  color: var(--faint);
}

.results {
  padding: 18px;
}

.statusRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.status {
  color: var(--muted);
  font-size: 13px;
}

.error {
  border: 1px solid rgba(255, 107, 107, 0.35);
  background: rgba(255, 107, 107, 0.08);
  color: rgba(255, 255, 255, 0.9);
  padding: 10px 12px;
  border-radius: 12px;
  margin: 10px 0;
}

.summary {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

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

.summaryItem {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.summaryLabel {
  color: var(--muted);
  font-size: 12px;
}

.summaryValue {
  margin-top: 6px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.resultsList {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.slotGroup {
  display: grid;
  gap: 10px;
}

.slotGroup .slotHeader {
  margin-top: 0;
}

.slotHeader {
  font-weight: 800;
  color: var(--primary);
  font-size: 14px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(110, 231, 255, 0.08);
  margin-top: 8px;
}

.unavailableHeader {
  font-weight: 800;
  color: var(--danger);
  font-size: 14px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 107, 107, 0.08);
  margin-top: 16px;
}

.noItemsMsg {
  color: var(--muted);
  font-size: 13px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.12);
  margin-top: 8px;
}

.resultItem {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.12);
  color: var(--text);
  font-size: 13px;
  margin-left: 16px;
}

.slotLayout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 10px;
  margin-left: 16px;
}

.slotSecondaryList {
  display: grid;
  gap: 8px;
}

.slotLayout .resultItem {
  margin-left: 0;
}

.topPickItem {
  position: relative;
  min-height: 124px;
  padding: 14px;
  border-color: transparent;
  background: linear-gradient(
    135deg,
    rgba(192, 132, 252, 0.12),
    rgba(167, 139, 250, 0.12)
  );
  box-shadow: none;
  overflow: visible;
}

.topPickItem::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 14px;
  border: 2px solid rgba(192, 132, 252, 0.75);
  box-shadow:
    0 0 0 2px rgba(167, 139, 250, 0.45),
    0 0 18px rgba(192, 132, 252, 0.55),
    0 0 34px rgba(167, 139, 250, 0.45);
  pointer-events: none;
  animation: topPickGlow 1.9s ease-in-out infinite;
}

@keyframes topPickGlow {
  0%,
  100% {
    opacity: 0.82;
    transform: scale(1);
    box-shadow:
      0 0 0 2px rgba(167, 139, 250, 0.4),
      0 0 14px rgba(192, 132, 252, 0.42),
      0 0 24px rgba(167, 139, 250, 0.32);
  }
  50% {
    opacity: 1;
    transform: scale(1.012);
    box-shadow:
      0 0 0 2px rgba(167, 139, 250, 0.65),
      0 0 24px rgba(192, 132, 252, 0.68),
      0 0 42px rgba(167, 139, 250, 0.55);
  }
}

.topPickItem .itemIcon {
  width: 52px;
  height: 52px;
}

.topPickItem .itemText {
  font-weight: 700;
}

.topPickItem .itemText a {
  font-weight: 800;
}

.topPickItem .itemText::before {
  content: "Top Pick";
  display: inline-block;
  margin-right: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(110, 231, 255, 0.35);
  background: rgba(110, 231, 255, 0.12);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}

.topPickItem .itemText::before {
  font-size: 13px;
  padding: 4px 10px;
}

.itemText > a {
  font-weight: 700;
}

.topPickItem .itemText > a {
  font-size: 20px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.itemMeta {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.topPickItem .itemMeta {
  margin-top: 6px;
  font-size: 11px;
  color: var(--faint);
}

.secondaryItem {
  padding: 8px 10px;
  font-size: 12px;
}

.secondaryItem .itemIcon {
  width: 30px;
  height: 30px;
}

.itemIcon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border-radius: 6px;
  overflow: hidden;
}

.itemIcon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
  display: block;
}

.itemText {
  flex: 1 1 auto;
}

.rarityCelestial {
  color: transparent !important;
  background: repeating-linear-gradient(
    120deg,
    #102f66 0px,
    #2f74b8 26px,
    #6bb9f3 52px,
    #d7f2ff 78px,
    #6bb9f3 104px,
    #2f74b8 130px,
    #102f66 156px
  );
  background-size: 156px 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: celestialShine 3.2s linear infinite;
  text-shadow: 0 0 10px rgba(111, 199, 255, 0.25);
}

@keyframes celestialShine {
  0% {
    background-position: 0 50%;
  }
  100% {
    background-position: -156px 50%;
  }
}

.itemStatsLine {
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.2;
  color: var(--faint);
}

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

  .topPickItem {
    min-height: 0;
  }
}

.resultItem:hover {
  border-color: rgba(110, 231, 255, 0.35);
  background: rgba(110, 231, 255, 0.06);
}

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

.slot {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.itemName {
  font-weight: 800;
  letter-spacing: -0.01em;
}

.itemSub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.kv {
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
}

.k {
  color: var(--faint);
  font-size: 12px;
}

.v {
  color: var(--text);
  font-weight: 700;
}

.badge {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(52, 211, 153, 0.25);
  background: rgba(52, 211, 153, 0.08);
  color: rgba(255, 255, 255, 0.86);
}

.footer {
  margin-top: 14px;
  color: var(--faint);
  font-size: 12px;
  text-align: center;
}

/* Unavailable items folding menu */
.unavailableSection {
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.unavailableSummary {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  margin-bottom: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 107, 107, 0.38);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.16), rgba(255, 107, 107, 0.08));
  box-shadow: 0 8px 22px rgba(255, 107, 107, 0.14);
  transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease, transform 80ms ease;
}

.unavailableSummary:hover {
  border-color: rgba(255, 107, 107, 0.56);
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.24), rgba(255, 107, 107, 0.12));
  box-shadow: 0 10px 28px rgba(255, 107, 107, 0.2);
}

.unavailableSummary:active {
  transform: translateY(1px);
}

.unavailableSection:not([open]) .unavailableSummary {
  border-left: 4px solid rgba(255, 107, 107, 0.85);
}

.unavailableSection[open] .unavailableSummary {
  background: rgba(255, 107, 107, 0.08);
  border-color: rgba(255, 107, 107, 0.24);
  box-shadow: none;
}

.unavailableContent {
  display: grid;
  gap: 12px;
}

.unavailableSection[open] .unavailableContent {
  margin-top: 12px;
}

/* Documentation section */
.documentation {
  padding: 18px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.documentationTitle {
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 16px 0;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.documentationContent {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.documentationContent h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 16px 0 10px 0;
  color: var(--text);
  letter-spacing: -0.01em;
}

.documentationContent p {
  margin: 8px 0;
}

.documentationContent p:first-child {
  margin-top: 0;
}

.documentationContent p:last-child {
  margin-bottom: 0;
}

.creatorInfo {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(110, 231, 255, 0.08);
}

.features ul {
  margin: 8px 0 8px 20px;
  padding: 0;
}

.features li {
  margin-bottom: 6px;
}

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

.techStack {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.techStack p {
  font-weight: 600;
  color: var(--primary2);
}

/* Details/Summary styling */
details {
  outline: none;
}

summary {
  list-style: none;
  cursor: pointer;
}

summary::-webkit-details-marker {
  display: none;
}

summary::marker {
  display: none;
}
