:root {
  --bg: #0b0b0e;
  --text: #eaeaea;
  --muted: #9aa0a6;
  --white: #ffffff;
  --border: rgba(255,255,255,0.2);
  --blur: 18px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  font-family: "Noto Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.bg {
  background: linear-gradient(180deg, rgba(0,0,0,0.45), rgba(0,0,0,0.6));
  background-image: none;
}

.overlay { display: none; }

.center {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.modal {
  background: rgba(10,10,14,0.6);
  border: 1px solid var(--border);
  padding: 24px;
  border-radius: 16px;
  backdrop-filter: blur(12px);
  max-width: 420px;
  width: 92%;
  text-align: center;
}

.title { 
  color: var(--white);
  text-transform: uppercase;
}

.glow {
  text-shadow: 0 0 8px rgba(255,255,255,0.5), 0 0 20px rgba(255,255,255,0.15);
}

.subtitle {
  margin: 2px 0 16px 0;
  color: var(--muted);
}

.hint {
  margin: 0 0 18px 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  outline: none;
  transition: border-color .2s ease, background .2s ease;
  margin: 8px 0 16px 0;
}

.input::placeholder { color: #b8bcc4; }

.input:focus {
  border-color: rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.1);
}

.btn {
  appearance: none;
  padding: 12px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  transition: transform .06s ease, background-color .2s ease, color .2s ease, border-color .2s ease;
  display: block;
  width: 100%;
  margin: 10px 0;
}

.btn-outline {
  background: transparent;
  border: 2px solid rgba(255,255,255,0.18);
  color: var(--white);
}

.btn-outline:hover {
  border-color: rgba(255,255,255,0.32);
  background: rgba(255,255,255,0.04);
}

.meta {
  color: rgba(255,255,255,0.75);
  font-size: 0.9rem;
  margin-top: 10px;
  margin-bottom: 0;
}

.back {
  display: inline-block;
  margin-top: 18px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  transition: color .2s ease;
}

.back:hover { color: var(--white); }

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.row .btn { width: 100%; margin: 0; }

.key-box {
  margin: 8px 0 14px 0;
  border: 1px dashed rgba(255,255,255,0.18);
  border-radius: 12px;
  padding: 18px;
  background: rgba(255,255,255,0.02);
}

.key-text {
  display: block;
  font-family: "Space Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(1.4rem, 4vw, 2rem);
  letter-spacing: 0.35em;
  text-align: center;
  color: var(--white);
  user-select: text;
  white-space: pre;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.key-text.compact {
  font-size: clamp(1rem, 3.2vw, 1.4rem);
  letter-spacing: 0.25em;
}

#dots {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: transparent;
}

.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.popup {
  background: rgba(10,10,14,0.6);
  color: var(--white);
  padding: 18px 22px;
  border-radius: 16px;
  min-width: 220px;
  text-align: center;
  box-shadow: 0 8px 30px rgba(0,0,0,0.35);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
  overflow: hidden;
}

.popup button {
  margin-top: 12px;
  padding: 8px 14px;
  border-radius: 8px;
  background: #000;
  color: #fff;
  border: none;
  cursor: pointer;
}