:root {
  --bg: #0a0c0f;
  --bg2: #0f1318;
  --bg3: #161c24;
  --border: #1e2a38;
  --border-bright: #2e4a6a;
  --text: #c8d8e8;
  --text-dim: #5a7a9a;
  --text-bright: #e8f4ff;
  --accent: #00c8ff;
  --accent2: #0a8aaa;
  --success: #00e5a0;
  --fail: #ff4060;
  --warn: #ffaa00;
  --mono: 'Share Tech Mono', monospace;
  --sans: 'Syne', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Scanlines overlay */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.08) 2px,
    rgba(0,0,0,0.08) 4px
  );
}

header {
  padding: 3rem 2rem 2rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(0,200,255,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.logo {
  font-family: var(--sans);
  font-weight: 800;
  font-size: 2.8rem;
  letter-spacing: -0.02em;
  color: var(--text-bright);
  text-transform: uppercase;
}

.logo span { color: var(--accent); }

.tagline {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
  letter-spacing: 0.05em;
}

main {
  max-width: 780px;
  margin: 0 auto;
  padding: 2rem 1.5rem 6rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.step {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 2rem;
  position: relative;
  transition: border-color 0.3s;
}

.step:not(.hidden) { animation: stepIn 0.35s ease both; }

@keyframes stepIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.step-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  margin-bottom: 0.6rem;
}

.step h2 {
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--text-bright);
  margin-bottom: 1.5rem;
}

/* Dropzone */
.dropzone {
  border: 2px dashed var(--border-bright);
  border-radius: 2px;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}

.dropzone:hover, .dropzone.drag-over {
  border-color: var(--accent);
  background: rgba(0,200,255,0.04);
}

.drop-icon {
  font-size: 2.5rem;
  color: var(--accent2);
  margin-bottom: 1rem;
  display: block;
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.dropzone p { color: var(--text-dim); font-size: 0.95rem; margin-bottom: 0.3rem; }
.dropzone p code {
  font-family: var(--mono);
  color: var(--accent);
  background: rgba(0,200,255,0.1);
  padding: 0.1em 0.3em;
  border-radius: 2px;
}
.dropzone .sub { font-size: 0.82rem; margin-top: 0.5rem; }
.file-link { color: var(--accent); cursor: pointer; text-decoration: underline; }

/* Pack info grid */
.pack-info {
  margin-top: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
  animation: stepIn 0.3s ease both;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
}

.info-item {
  padding: 0.9rem 1rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.info-item:nth-child(3n) { border-right: none; }
.info-item:nth-last-child(-n+3) { border-bottom: none; }

.info-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.info-item span:last-child {
  font-family: var(--mono);
  font-size: 0.92rem;
  color: var(--accent);
}

/* Config grid */
.config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.field { display: flex; flex-direction: column; gap: 0.4rem; }

.field label {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.optional { color: var(--text-dim); opacity: 0.6; }

.field input, .field select {
  background: var(--bg3);
  border: 1px solid var(--border-bright);
  color: var(--text-bright);
  font-family: var(--mono);
  font-size: 0.9rem;
  padding: 0.65rem 0.8rem;
  border-radius: 2px;
  outline: none;
  transition: border-color 0.2s;
  appearance: none;
  -webkit-appearance: none;
}

.field input:focus, .field select:focus { border-color: var(--accent); }

.cf-key-section {
  border: 1px solid var(--border);
  border-left: 3px solid var(--warn);
  padding: 1rem;
  margin: 1rem 0;
  background: rgba(255,170,0,0.03);
}

.hint {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 0.4rem;
}

.hint a { color: var(--accent); }

/* Buttons */
.btn-primary {
  background: var(--accent);
  color: #000;
  border: none;
  font-family: var(--sans);
  font-weight: 800;
  font-size: 0.95rem;
  padding: 0.85rem 2rem;
  cursor: pointer;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: background 0.2s, transform 0.1s;
  margin-top: 1rem;
}

.btn-primary:hover { background: #00e5ff; }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled {
  background: var(--border-bright);
  color: var(--text-dim);
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  color: var(--fail);
  border: 1px solid var(--fail);
  font-family: var(--mono);
  font-size: 0.82rem;
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.2s;
}

.btn-secondary:hover { background: rgba(255,64,96,0.1); }

/* Progress bar */
.progress-bar {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 2px;
  height: 36px;
  position: relative;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  width: 0%;
  transition: width 0.4s ease;
}

.progress-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-bright);
  mix-blend-mode: difference;
}

/* Results summary */
.results-summary {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 1rem;
  text-align: center;
  border-radius: 2px;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.stat span {
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: bold;
}

.stat small {
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.stat.success { border-color: var(--success); }
.stat.success span { color: var(--success); }
.stat.fail { border-color: var(--fail); }
.stat.fail span { color: var(--fail); }
.stat.total span { color: var(--accent); }

/* Failed panel */
.failed-panel {
  border: 1px solid var(--fail);
  border-left: 4px solid var(--fail);
  background: rgba(255,64,96,0.04);
  margin-bottom: 1.5rem;
  border-radius: 2px;
  overflow: hidden;
  animation: stepIn 0.3s ease both;
}

.failed-header {
  padding: 0.9rem 1rem;
  background: rgba(255,64,96,0.08);
  border-bottom: 1px solid rgba(255,64,96,0.2);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.failed-icon { font-size: 1.1rem; color: var(--fail); }
.failed-header strong { color: var(--fail); }

.failed-list { padding: 0.5rem 0; }

.failed-item {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid rgba(255,64,96,0.1);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.failed-item:last-child { border-bottom: none; }

.failed-name {
  font-family: var(--mono);
  font-size: 0.88rem;
  color: var(--text-bright);
  font-weight: bold;
}

.failed-reason {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--fail);
}

.failed-ids {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-dim);
}

.failed-actions {
  padding: 0.8rem 1rem;
  border-top: 1px solid rgba(255,64,96,0.15);
}

/* Resolved details */
.resolved-details {
  margin-bottom: 1.5rem;
}

.resolved-details summary {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0.5rem 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.resolved-details summary::before {
  content: '▶';
  font-size: 0.6rem;
  color: var(--success);
  transition: transform 0.2s;
}

.resolved-details[open] summary::before { transform: rotate(90deg); }

.resolved-list {
  margin-top: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.resolved-item {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.8rem;
  gap: 1rem;
}

.resolved-item:last-child { border-bottom: none; }

.resolved-item:hover { background: var(--bg3); }

.resolved-item-name { color: var(--text); flex: 1; }
.resolved-item-version { color: var(--text-dim); font-size: 0.72rem; }
.platform-badge {
  font-size: 0.65rem;
  padding: 0.15em 0.5em;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.platform-badge.modrinth { background: rgba(0,229,160,0.15); color: var(--success); }
.platform-badge.curseforge { background: rgba(255,170,0,0.15); color: var(--warn); }

/* Download section */
.download-section {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.suggestions {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.suggestions-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--warn);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.2rem;
  display: block;
}

.suggestion-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.5rem 0.7rem;
  background: rgba(0,200,255,0.05);
  border: 1px solid rgba(0,200,255,0.15);
  border-radius: 2px;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.suggestion-item:hover {
  background: rgba(0,200,255,0.1);
  border-color: var(--accent);
}

.suggestion-name {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent);
}

.suggestion-desc {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* Error toast */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--fail);
  color: #fff;
  font-family: var(--mono);
  font-size: 0.82rem;
  padding: 0.8rem 1.2rem;
  border-radius: 2px;
  z-index: 200;
  max-width: 360px;
  animation: toastIn 0.3s ease both;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
  .info-grid { grid-template-columns: 1fr 1fr; }
  .config-grid { grid-template-columns: 1fr; }
  .results-summary { flex-direction: column; }
}
