:root {
  color-scheme: dark;
  --page: #0d1117;
  --panel: #171c24;
  --panel-2: #20262e;
  --line: #2d3746;
  --text: #eef3fb;
  --muted: #9aa6b8;
  --faint: #778397;
  --blue: #4f8cff;
  --blue-strong: #3f7df0;
  --green: #36d399;
  --red: #ff7b86;
  --yellow: #f5bd4f;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background:
    radial-gradient(circle at 20% 0%, rgba(79, 140, 255, 0.13), transparent 34rem),
    linear-gradient(135deg, #0d1117 0%, #10131a 50%, #0b0e14 100%);
  color: var(--text);
}

button,
input {
  font: inherit;
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}

.redeem-panel {
  width: min(760px, 100%);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--panel) 95%, transparent);
  box-shadow: var(--shadow);
  padding: clamp(24px, 4vw, 42px);
}

.title-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 30px;
}

.ticket {
  display: grid;
  place-items: center;
  width: 38px;
  height: 28px;
  border-radius: 5px;
  background: #ff7b94;
  color: #6b1324;
  font-size: 7px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  box-shadow: inset 0 0 0 2px rgba(107, 19, 36, 0.2);
  transform: rotate(-1deg);
}

h1 {
  margin: 0;
  font-size: clamp(30px, 4.2vw, 42px);
  line-height: 1.08;
  letter-spacing: 0;
}

p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.5;
}

.form {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 9px;
  color: var(--muted);
  font-size: 18px;
  font-weight: 650;
}

.field input {
  width: 100%;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  padding: 0 20px;
  font-size: clamp(20px, 2.7vw, 26px);
  font-weight: 800;
  letter-spacing: 0;
  outline: none;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.field input::placeholder {
  color: #687489;
}

.field input:focus {
  border-color: rgba(79, 140, 255, 0.9);
  box-shadow: 0 0 0 4px rgba(79, 140, 255, 0.16);
  background: #242b35;
}

#code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: clamp(13px, 2.6vw, 24px);
}

.quantity-row {
  display: grid;
  grid-template-columns: minmax(150px, 220px) auto;
  align-items: end;
  gap: 12px;
}

.compact input {
  min-height: 50px;
  font-size: 20px;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(2, 50px);
  gap: 8px;
}

.stepper button {
  height: 50px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #222934;
  color: var(--text);
  font-size: 24px;
  font-weight: 800;
  cursor: pointer;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 12px;
  margin-top: 2px;
}

.actions button {
  min-height: 60px;
  border: 0;
  border-radius: 10px;
  color: white;
  font-size: clamp(18px, 2.5vw, 24px);
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 0.16s ease,
    filter 0.16s ease,
    opacity 0.16s ease;
}

.actions button:not(:disabled):hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

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

.primary {
  background: var(--blue);
}

.secondary {
  background: #293240;
  border: 1px solid var(--line);
}

.status {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 30px;
  margin-top: 22px;
  font-size: clamp(16px, 2.2vw, 21px);
  font-weight: 750;
}

#status-text {
  white-space: pre-line;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  flex: 0 0 auto;
}

.status.muted {
  color: var(--muted);
}

.status.loading {
  color: var(--yellow);
}

.status.success {
  color: var(--green);
}

.status.error {
  color: var(--red);
}

.details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0 0;
}

.details[hidden] {
  display: none;
}

.details div {
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #141922;
  padding: 13px 15px;
}

.details dt {
  color: var(--faint);
  font-size: 13px;
  font-weight: 750;
}

.details dd {
  margin: 6px 0 0;
  color: var(--text);
  font-size: 21px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.notes {
  margin: 28px 0 0;
  padding-left: 0;
  list-style-position: inside;
  color: var(--muted);
  text-align: center;
  font-size: clamp(14px, 1.8vw, 17px);
  line-height: 1.7;
}

@media (max-width: 680px) {
  .shell {
    align-items: start;
    padding-top: 18px;
  }

  .redeem-panel {
    border-radius: 14px;
    padding: 22px 16px;
  }

  .title-row {
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 24px;
  }

  .ticket {
    margin-top: 4px;
    width: 34px;
    height: 26px;
  }

  .field {
    font-size: 15px;
  }

  .field input {
    min-height: 52px;
    border-radius: 9px;
    padding: 0 14px;
  }

  .quantity-row,
  .actions,
  .details {
    grid-template-columns: 1fr;
  }

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

  .actions button {
    min-height: 54px;
  }

  .notes {
    text-align: left;
  }
}
