:root {
  --bg: #0f0f11;
  --text: #e0e0e5;
  --text-secondary: #8a8fa3;
  --accent: #6366f1;
  --card: #17171c;
  --border: #27272e;
  --progress: #6366f1;
  --success: #22c55e;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, sans-serif;
  display: grid;
  place-items: center;
  padding: 20px;
}

.container {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 24px;
  box-shadow: 0 20px 40px -12px rgba(0,0,0,0.6);
}

h1 {
  font-size: 1.48rem;
  font-weight: 500;
  text-align: center;
  margin-bottom: 2.2rem;
  letter-spacing: -0.02em;
}

.input-wrapper {
  position: relative;
  margin-bottom: 1.8rem;
}

input {
  width: 100%;
  padding: 14px 16px;
  font-size: 1.05rem;
  background: #111114;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: white;
  font-family: 'SF Mono', 'Roboto Mono', Consolas, monospace;
  letter-spacing: 0.5px;
  transition: all 0.18s ease;
}

input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

input::placeholder {
  color: #555566;
}

#code-container {
  position: relative;
  cursor: pointer;
  user-select: none;
  margin: 1.4rem 0 1.2rem;
}

#code {
  font-family: 'SF Mono', 'Roboto Mono', Consolas, monospace;
  font-size: 3.4rem;
  font-weight: 500;
  letter-spacing: 10px;
  text-align: center;
  color: var(--text);
  background: rgba(99, 102, 241, 0.07);
  border-radius: 12px;
  padding: 20px 0;
  border: 1px solid rgba(99, 102, 241, 0.13);
  transition: all 0.15s ease;
}

#code.copied {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.35);
}

#copy-tooltip {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.75);
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  white-space: nowrap;
  z-index: 10;
}

#copy-tooltip.visible {
  opacity: 1;
}

.progress-container {
  height: 3px;
  background: rgba(99, 102, 241, 0.12);
  border-radius: 2px;
  overflow: hidden;
  margin: 0 8px 1.6rem;
}

.progress-bar {
  height: 100%;
  width: 100%;
  background: var(--progress);
  transition: transform 1s linear;
  transform-origin: left;
}

#remaining {
  text-align: center;
  font-size: 0.94rem;
  color: var(--text-secondary);
  min-height: 1.4em;
}

.small {
  text-align: center;
  font-size: 0.78rem;
  color: #444455;
  margin-top: 2rem;
  opacity: 0.6;
}

@media (max-width: 480px) {
  .container {
    padding: 28px 18px;
  }
  #code {
    font-size: 2.8rem;
    letter-spacing: 6px;
    padding: 16px 0;
  }
}