:root {
  --bg-1: #0f1220;
  --bg-2: #1b1f3b;
  --accent: #6c63ff;
  --accent-2: #00d4b8;
  --card-bg: rgba(255, 255, 255, 0.06);
  --card-border: rgba(255, 255, 255, 0.12);
  --text-main: #f4f5fb;
  --text-muted: #a8adc9;
  --warn: #ffb020;
  --error: #ff5470;
  --success: #2fd67a;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
}

* { box-sizing: border-box; }

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

body {
  font-family: var(--font);
  color: var(--text-main);
  background: radial-gradient(circle at 20% -10%, #2a2f5e 0%, transparent 45%),
              radial-gradient(circle at 90% 10%, #17324f 0%, transparent 40%),
              linear-gradient(160deg, var(--bg-1), var(--bg-2));
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

.hero {
  text-align: center;
  margin-bottom: 28px;
}

.hero h1 {
  font-size: clamp(1.6rem, 5vw, 2.3rem);
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.98rem;
  max-width: 540px;
  margin: 0 auto;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 28px;
  backdrop-filter: blur(14px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.key-block {
  margin-bottom: 22px;
}

.key-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

label {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-main);
}

.badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(108, 99, 255, 0.18);
  color: #b7b2ff;
  border: 1px solid rgba(108, 99, 255, 0.35);
}

.badge-warn {
  background: rgba(255, 176, 32, 0.15);
  color: var(--warn);
  border-color: rgba(255, 176, 32, 0.35);
}

.key-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.key-field {
  flex: 1;
  resize: none;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--accent-2);
  word-break: break-all;
  overflow-wrap: anywhere;
}

.key-field:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-copy {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  border: 1px solid var(--card-border);
  min-width: 84px;
}

.btn-copy:hover { background: rgba(255, 255, 255, 0.16); }

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #8f7bff);
  color: white;
  flex: 1;
  min-width: 180px;
  box-shadow: 0 8px 24px rgba(108, 99, 255, 0.35);
}

.btn-primary:hover { box-shadow: 0 10px 28px rgba(108, 99, 255, 0.5); }

.btn-secondary {
  background: rgba(0, 212, 184, 0.14);
  color: var(--accent-2);
  border: 1px solid rgba(0, 212, 184, 0.35);
  flex: 1;
  min-width: 180px;
}

.btn-secondary:hover { background: rgba(0, 212, 184, 0.22); }

.btn-icon { font-size: 1rem; line-height: 1; }

.status {
  margin: 16px 0 0;
  min-height: 1.2em;
  font-size: 0.85rem;
  color: var(--success);
  text-align: center;
}

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

.notice {
  margin-top: 20px;
  padding: 16px 18px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.notice-error {
  background: rgba(255, 84, 112, 0.12);
  border-color: rgba(255, 84, 112, 0.4);
  color: #ffc2cd;
}

.footer {
  margin-top: 22px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.6;
}

code {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 0.85em;
}

@media (max-width: 480px) {
  .card { padding: 20px; }
  .key-row { flex-direction: column; }
  .btn-copy { width: 100%; }
  .actions { flex-direction: column; }
}
