:root {
  --bg: #0d1117;
  --panel: #141a21;
  --panel-2: #10161d;
  --line: #26323d;
  --text: #edf6fb;
  --muted: #9aabb7;
  --echo: #4232e4;
  --echo-2: #36c4ff;
  --gold: #ffd66b;
  --danger: #b34b58;
  --good: #36b878;
  --warn: #d8aa3c;
}

:where([hidden]) {
  display: none !important;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Segoe UI, system-ui, sans-serif;
  background: radial-gradient(circle at top left, rgba(66, 50, 228, .16), transparent 34%), var(--bg);
  color: var(--text);
}

main {
  width: min(1280px, calc(100% - 32px));
  margin: 20px auto 72px;
}

h1, h2, h3, p { margin: 0; }
h1 { font-size: 25px; }
h1 span { color: var(--echo); }
h2 { font-size: 22px; }
h3 { font-size: 16px; }
p, small { color: var(--muted); }
p { font-size: 13px; margin-top: 5px; }

.topbar, .brand, .auth, .panel-head {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(66, 50, 228, .45);
}

.brand { gap: 12px; }
.brand img { width: 46px; height: 46px; }
.auth { gap: 8px; }

.panel, .tab-panel {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(20, 26, 33, .96), rgba(16, 22, 29, .94));
  border-radius: 8px;
  padding: 20px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px 330px;
  align-items: center;
  gap: 20px;
  margin-top: 18px;
  border-color: rgba(66, 50, 228, .38);
}

.hero.signed-out {
  grid-template-columns: minmax(0, 1fr);
}

.hero.without-key {
  grid-template-columns: minmax(0, 1fr) 280px;
}

.credit-card {
  border: 1px solid rgba(66, 50, 228, .42);
  border-radius: 8px;
  background: #10161d;
  padding: 16px;
}

.credit-card span, .plan-price span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.credit-card strong {
  display: block;
  color: var(--gold);
  font-size: 34px;
  margin: 6px 0;
}

.key-card-top {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(66, 50, 228, .42);
  border-radius: 8px;
  background: #10161d;
  padding: 16px;
}

.key-card-top[hidden] {
  display: none;
}

.key-card-top span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.key-card-top code {
  display: block;
  border: 1px solid rgba(66, 50, 228, .34);
  border-radius: 6px;
  background: #0a1017;
  color: #e8e5ff;
  padding: 9px;
}

.button, button, input, select, textarea {
  border: 1px solid #33424e;
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
}

.button, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 9px 12px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 800;
  background: linear-gradient(135deg, #4232e4, #1c95d2);
  border-color: #5a50f0;
}

.button.secondary, button.secondary {
  background: #1b2630;
  border-color: rgba(66, 50, 228, .48);
}

button.small {
  width: auto;
  min-height: 30px;
  padding: 6px 9px;
  font-size: 12px;
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

input, select, textarea {
  width: 100%;
  padding: 10px 11px;
  margin-top: 8px;
}

label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  border-bottom: 1px solid var(--line);
}

.tab {
  width: auto;
  margin: 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  background: #111820;
}

.tab.active {
  background: rgba(66, 50, 228, .24);
  border-color: var(--echo);
}

.tab-panel {
  display: none;
  margin-top: 0;
  border-top-left-radius: 0;
}

.tab-panel.active { display: block; }

.panel-head {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

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

.product-card {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid rgba(66, 50, 228, .34);
  border-radius: 8px;
  background: #111820;
}

.product-art {
  position: relative;
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(135deg, rgba(66, 50, 228, .42), rgba(54, 196, 255, .14)),
    #0b1118;
}

.product-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.product-art .fallback {
  display: grid;
  place-items: center;
  height: 100%;
  color: #dcd9ff;
  font-size: 28px;
  font-weight: 900;
}

.product-body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  width: auto;
  border: 1px solid rgba(66, 50, 228, .55);
  border-radius: 999px;
  background: rgba(66, 50, 228, .18);
  color: #e4e0ff;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
}

.description {
  min-height: 55px;
  color: #c8d7e3;
  font-size: 13px;
  line-height: 1.45;
}

.plan-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d141c;
  padding: 12px;
}

.product-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.product-actions button {
  margin: 0;
}

.plan-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 10px;
  align-items: end;
}

.plan-price {
  margin: 8px 0 10px;
}

.plan-price strong {
  color: var(--gold);
  font-size: 18px;
}

.credit-form {
  display: grid;
  grid-template-columns: 1fr 180px 220px;
  gap: 12px;
  align-items: end;
}

.payment-request {
  margin-top: 16px;
  border: 1px solid rgba(66, 50, 228, .36);
  border-radius: 8px;
  background: #0d141c;
  padding: 14px;
  overflow-wrap: anywhere;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: center;
  margin-top: 12px;
  border-color: rgba(66, 50, 228, .42);
}

.detail-hero img,
.detail-fallback {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: contain;
  background: #0b1118;
}

.detail-fallback {
  display: grid;
  place-items: center;
  color: #dcd9ff;
  font-size: 36px;
  font-weight: 900;
}

.detail-section {
  margin-top: 16px;
}

.bbcode-content {
  color: #c8d7e3;
  line-height: 1.55;
}

.bbcode-content h3 {
  margin: 16px 0 8px;
}

.bbcode-content ul {
  margin: 10px 0 0 18px;
  padding: 0;
}

.bbcode-content li + li {
  margin-top: 6px;
}

.bbcode-content a {
  color: var(--echo-2);
}

.bbcode-content img,
.gallery img {
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

.gallery img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #0b1118;
}

.changelog-list {
  display: grid;
  gap: 10px;
}

.changelog-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d141c;
  padding: 12px;
}

.changelog-row strong {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.changelog-row span {
  color: var(--muted);
  font-size: 12px;
}

.payment-request.empty {
  border-style: dashed;
  color: var(--muted);
}

.table {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  vertical-align: top;
}

th { color: var(--muted); }
code {
  color: #dcd9ff;
  overflow-wrap: anywhere;
}

.proof-form {
  display: grid;
  gap: 6px;
  min-width: 240px;
}

.proof-form input {
  margin-top: 0;
  padding: 7px 8px;
  font-size: 12px;
}

.proof-form button {
  justify-self: start;
}

.notice {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: 360px;
  border: 1px solid rgba(66, 50, 228, .55);
  border-radius: 8px;
  background: #111820;
  color: var(--text);
  padding: 12px 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .4);
}

.notice.error {
  border-color: rgba(179, 75, 88, .75);
}

@media (max-width: 980px) {
  .hero, .credit-form, .detail-hero { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  main { width: min(100% - 18px, 1280px); }
  .topbar, .auth { align-items: stretch; flex-direction: column; }
  .product-grid { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; }
}
