:root {
  color-scheme: dark;
  --lime: #d8fc84;
  --muted: #b1adbd;
  --border: #393540;
  font-family: "DM Sans", "PingFang SC", system-ui, sans-serif;
  color: #f4f1f7;
  background: #131218;
}
* { box-sizing: border-box; }
body { margin: 0; }
.wrap { width: min(980px, calc(100% - 48px)); margin: auto; }

header {
  border-bottom: 1px solid var(--border);
  background: #19171e;
}
.header-bar {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand b, footer b {
  font-size: 26px;
  letter-spacing: -0.8px;
}
.wordmark {
  font-weight: 800;
  color: #f6f3fa;
}
.wordmark em {
  font-style: normal;
  font-weight: 500;
  color: var(--lime);
}
.brand span#brand-sub {
  border-left: 1px solid #494552;
  margin-left: 4px;
  padding-left: 16px;
  color: var(--muted);
  font-size: 13px;
}
.logo {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.logo svg {
  width: 38px;
  height: 38px;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(216, 252, 132, 0.28));
}
.lang-btn {
  width: auto;
  height: 34px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid #4d4758;
  border-radius: 999px;
  background: #24212c;
  color: #e9e4f0;
  font: 600 13px/1 system-ui, sans-serif;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.lang-btn:hover {
  background: #2f2b3a;
  border-color: var(--lime);
  color: var(--lime);
}

.page-shell {
  display: grid;
  grid-template-columns: 1fr minmax(0, 980px) 1fr;
  gap: 24px;
  align-items: start;
  max-width: 1420px;
  margin: 0 auto;
  padding: 0 20px;
}
.page-shell > main.wrap {
  width: 100%;
  margin: 0;
}
.ad-rail {
  position: sticky;
  top: 24px;
  margin-top: 32px;
  height: 600px;
  min-width: 140px;
  max-width: 180px;
  justify-self: center;
  width: 100%;
  border: 1px dashed #44404a;
  border-radius: 14px;
  background: rgba(25, 23, 30, 0.55);
  display: grid;
  place-items: center;
  color: #8f8a99;
  font-size: 12px;
  letter-spacing: 1.5px;
  writing-mode: horizontal-tb;
}

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin: 32px 0 20px;
  padding: 35px 40px 38px;
  border: 1px solid #494451;
  border-radius: 18px;
  background: radial-gradient(ellipse at 83% 25%, #594466 0, transparent 57%), linear-gradient(106deg, #221e2a, #33293e);
}
small {
  color: var(--lime);
  font: 700 12px/1.6 ui-monospace, monospace;
  letter-spacing: 2px;
}
h1 {
  margin: 10px 0;
  font-size: clamp(30px, 4.2vw, 50px);
  letter-spacing: -1.5px;
  line-height: 1.15;
}
.hero p {
  margin: 0;
  color: #cdc6d6;
  font-size: 15px;
}
.deck {
  position: absolute;
  z-index: -1;
  right: 13%;
  top: 20px;
  transform: rotate(13deg);
}
.deck i {
  position: absolute;
  width: 112px;
  height: 154px;
  border: 3px double #c0b2cd;
  border-radius: 8px;
  background: repeating-radial-gradient(ellipse, #61516e 0 5px, #81718a 6px 7px, #594b66 9px 13px);
  box-shadow: 0 6px 14px #201a2c80;
}
.deck i:first-child { transform: translate(-76px, 13px) rotate(-32deg); }
.deck i:nth-child(2) { transform: translate(-40px, 5px) rotate(-17deg); }
.deck i:last-child {
  display: grid;
  place-items: center;
  background: repeating-radial-gradient(ellipse, #413c48 0 3px, #74677d 4px 5px, #42394b 6px 10px);
  border-color: #dbeab7;
}
.deck em {
  font-style: normal;
  color: var(--lime);
  font-size: 82px;
  line-height: 1;
  text-shadow: 0 0 8px #34343a;
}

.workspace {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 20px;
}
form, .status {
  background: #201e26;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px 30px;
}
h2 {
  font-size: 20px;
  letter-spacing: -0.5px;
  margin: 0;
}
label {
  display: block;
  margin: 20px 0 8px;
  font-size: 14px;
  font-weight: 600;
}
input {
  width: 100%;
  border: 1px solid #524d5b;
  background: #16151c;
  color: inherit;
  border-radius: 8px;
  padding: 12px 14px;
  font: inherit;
  height: 45px;
}
input::placeholder { color: #918c9c; }
input:focus-visible, button:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}
.count {
  display: flex;
  gap: 12px;
  align-items: center;
}
.count input {
  width: 94px;
  font-family: ui-monospace, monospace;
}
.count input::-webkit-inner-spin-button { opacity: 1; }
.count span, .caption, .status p {
  font-size: 13px;
  color: var(--muted);
}
form button[type="submit"] {
  border: 0;
  background: var(--lime);
  color: #202516;
  font: 700 15px system-ui;
  cursor: pointer;
  margin-top: 22px;
  border-radius: 8px;
  width: 100%;
  height: 45px;
}
form button[type="submit"] .arrow { margin-left: 5px; }
form button[type="submit"]:hover { background: #e4ffa7; }
form button[type="submit"]:disabled { opacity: 0.65; cursor: default; }

.top, .footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
strong {
  font-size: 12px;
  font-weight: 600;
  color: #cbc6d2;
  background: #37333f;
  padding: 5px 10px;
  border-radius: 20px;
}
strong[data-state=running], strong[data-state=completed] {
  color: var(--lime);
  background: #353b2c;
}
strong[data-state=error] {
  background: #4f2b37;
  color: #ffc7cf;
}
.fraction {
  margin: 30px 0 3px;
  display: flex;
  align-items: baseline;
  gap: 13px;
  font: 500 34px/1.1 ui-monospace, monospace;
  color: #b3aebb;
}
.fraction b {
  font-size: 72px;
  color: var(--lime);
  letter-spacing: -6px;
}
.fraction span:first-of-type {
  color: #746f7e;
  font-weight: 300;
}
#segments {
  display: flex;
  gap: 6px;
  margin: 22px 0;
}
#segments i {
  height: 6px;
  border-radius: 4px;
  flex: 1;
  background: #44404b;
}
#segments .filled { background: var(--lime); }
.status p { margin: 0; line-height: 1.6; }

.info-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 20px;
  margin-top: 20px;
}
.info-card {
  background: #1b1921;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 26px;
}
.info-card h3 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  color: #ebe6f2;
  letter-spacing: 0.2px;
}
.guide-list, .disclaimer-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.guide-list li::marker {
  color: var(--lime);
  font-weight: 700;
}
.disclaimer-list li::marker {
  color: #777087;
}
.guide-note {
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px dashed #34303d;
  color: #d7c7a0;
  font-size: 12.5px;
  line-height: 1.55;
}

.ad-banner {
  margin: 20px 0 24px;
  height: 90px;
  border: 1px dashed #44404a;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #9a95a3;
  font-size: 12px;
  letter-spacing: 2px;
}
footer {
  color: #a39ead;
  border-top: 1px solid var(--border);
  padding: 15px 0 28px;
  font-size: 12px;
}
footer b { font-size: 18px; color: #c5bfcb; }
.cookie-notice {
  margin: 10px 0 0;
  color: #8c8698;
  font-size: 12px;
  line-height: 1.5;
}

.status #network:not(:empty) {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(243, 211, 165, 0.1);
  border: 1px solid rgba(243, 211, 165, 0.28);
  color: #f3d3a5;
}
.status #request-id:not(:empty) {
  margin-top: 12px;
  font: 11px/1.5 ui-monospace, monospace;
  color: var(--muted);
  overflow-wrap: anywhere;
}

#code-error {
  margin: 6px 0 0;
  color: #ffc7cf;
  font-size: 13px;
}
#code-error:empty { display: none; }
#code[aria-invalid="true"] { border-color: #e5959f; }

.cookie-bar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 40;
  width: min(760px, calc(100% - 32px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 18px;
  border-radius: 14px;
  background: rgba(25, 23, 30, 0.96);
  border: 1px solid #4c4559;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
}
.cookie-bar[hidden] { display: none; }
.cookie-bar p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #cfc9d8;
}
.cookie-bar button {
  flex-shrink: 0;
  border: 0;
  border-radius: 8px;
  background: var(--lime);
  color: #202516;
  font: 700 13px/1 system-ui, sans-serif;
  padding: 10px 16px;
  cursor: pointer;
}
.cookie-bar button:hover { background: #e4ffa7; }

@media (max-width: 1260px) {
  .page-shell {
    display: block;
    padding: 0;
  }
  .page-shell > main.wrap {
    width: min(980px, calc(100% - 48px));
    margin: auto;
  }
  .ad-rail { display: none; }
}
@media (max-width: 650px) {
  .wrap, .page-shell > main.wrap { width: calc(100% - 32px); }
  .workspace, .info-grid { grid-template-columns: 1fr; gap: 12px; }
  .info-card { padding: 18px 20px; }
  .hero { margin: 18px 0 12px; padding: 24px 18px; }
  .hero p { max-width: 65%; font-size: 13px; }
  .deck { right: 17%; transform: scale(.55) rotate(13deg); }
  form, .status { padding: 21px; }
  .fraction { margin-top: 20px; }
  .header-bar { height: 56px; }
  .ad-banner { height: 65px; }
}
