:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: #eef3f8;
  color: #172033;
  --bg: #eef3f8;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --line: #d9e2ef;
  --line-strong: #bdc9da;
  --text: #172033;
  --muted: #66758c;
  --primary: #175cff;
  --primary-dark: #0f45d5;
  --success: #0f7a43;
  --shadow: 0 20px 50px rgba(26, 39, 68, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  background:
    linear-gradient(180deg, rgba(23, 92, 255, 0.08), rgba(255, 255, 255, 0) 360px),
    var(--bg);
  margin: 0;
  min-height: 100%;
}

button,
input,
textarea {
  font: inherit;
}

button {
  align-items: center;
  background: var(--primary);
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  transition: background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
  white-space: nowrap;
}

button:hover:not(:disabled) {
  background: var(--primary-dark);
  box-shadow: 0 10px 22px rgba(23, 92, 255, 0.22);
  transform: translateY(-1px);
}

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

.secondary {
  background: #e9eef6;
  color: var(--text);
}

.shell {
  margin: 0 auto;
  max-width: 1180px;
  padding: 28px 18px 48px;
}

.compact-shell {
  align-items: center;
  display: grid;
  min-height: 100vh;
  max-width: 680px;
}

.panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(217, 226, 239, 0.95);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 30px;
}

.redeem-panel {
  display: grid;
  gap: 22px;
}

.user-redeem {
  margin-bottom: 0;
}

.page-heading {
  display: grid;
  gap: 8px;
}

.eyebrow {
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  color: var(--text);
  font-size: clamp(30px, 6vw, 44px);
  line-height: 1.08;
}

.page-subtitle {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
  max-width: 560px;
}

.redeem-form {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto;
  padding: 10px;
}

input,
textarea {
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  outline: none;
  width: 100%;
}

input {
  min-height: 44px;
  padding: 0 14px;
}

input::placeholder {
  color: #8a97aa;
}

textarea {
  min-height: 150px;
  padding: 12px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(23, 92, 255, 0.13);
}

.result {
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 18px;
}

.result > div:first-child {
  color: var(--success);
  font-weight: 800;
}

.result strong {
  color: var(--text);
  font-size: clamp(24px, 5vw, 34px);
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.result small {
  color: var(--muted);
  line-height: 1.5;
}

.code-box {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: auto 1fr;
}

.code {
  background: #14213a;
  border: 1px solid #233455;
  border-radius: 8px;
  color: #fff;
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  min-height: 44px;
  overflow-wrap: anywhere;
  padding: 11px 14px;
}

.hidden {
  display: none;
}

.toast {
  background: #172033;
  border-radius: 8px;
  bottom: 22px;
  box-shadow: 0 16px 34px rgba(23, 32, 51, 0.22);
  color: #fff;
  left: 50%;
  max-width: calc(100vw - 32px);
  padding: 12px 16px;
  position: fixed;
  transform: translateX(-50%);
  z-index: 20;
}

@media (max-width: 640px) {
  .shell {
    padding: 18px 14px 32px;
  }

  .compact-shell {
    align-items: start;
    min-height: auto;
  }

  .panel {
    padding: 22px;
  }

  .redeem-form,
  .code-box {
    grid-template-columns: 1fr;
  }

  button {
    width: 100%;
  }
}
