:root {
  --bg: #0a0a0a;
  --surface: #111111;
  --border: #222222;
  --accent: #e8ff47;
  --accent2: #ff4747;
  --text: #f0f0f0;
  --muted: #555;
  --mono: 'Space Mono', monospace;
  --sans: 'Syne', sans-serif;
}

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

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

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(232,255,71,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232,255,71,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

.container {
  position: relative;
  z-index: 1;
  max-width: 780px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* ── Header ── */
header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 56px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 24px;
}

.logo {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: lowercase;
}

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

.tagline {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--mono);
  letter-spacing: 0.05em;
  margin-left: auto;
}

/* ── Mode toggle ── */
.mode-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 40px;
  width: fit-content;
}

.mode-btn {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 10px 24px;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}

.mode-btn.active {
  background: var(--accent);
  color: #000;
}

/* ── Panels ── */
.panel { display: none; }
.panel.active { display: block; }

/* ── Drop zone ── */
.drop-zone {
  border: 1px dashed var(--border);
  border-radius: 2px;
  padding: 60px 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  background: var(--surface);
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--accent);
  background: rgba(232,255,71,0.03);
}

.drop-icon {
  font-size: 32px;
  margin-bottom: 16px;
  display: block;
  opacity: 0.4;
}

.drop-label {
  font-size: 13px;
  color: var(--muted);
  font-family: var(--mono);
}

.drop-label strong {
  color: var(--text);
  display: block;
  font-size: 16px;
  margin-bottom: 6px;
  font-family: var(--sans);
  font-weight: 700;
}

#fileInput { display: none; }

/* ── File list ── */
.file-list {
  margin-top: 16px;
  display: none;
  flex-direction: column;
  gap: 8px;
}
.file-list.visible { display: flex; }

.file-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.file-list-title {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.file-list-total {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent);
}

.file-list-clear {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.file-list-clear:hover { color: var(--accent2); }

/* ── File item ── */
.file-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.file-icon {
  width: 36px;
  height: 36px;
  background: rgba(232,255,71,0.08);
  border: 1px solid rgba(232,255,71,0.2);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.file-info { flex: 1; min-width: 0; }

.file-name {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-size {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  margin-top: 3px;
}

/* ── Code box ── */
.code-box {
  margin-top: 24px;
  display: none;
}
.code-box.visible { display: block; }

.code-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.code-display {
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 2px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.code-value {
  font-family: var(--mono);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--accent);
}

.copy-btn {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 8px 14px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.15s;
  white-space: nowrap;
}
.copy-btn:hover,
.copy-btn.copied { border-color: var(--accent); color: var(--accent); }

/* ── Timer ── */
.timer-bar-wrap {
  margin-top: 12px;
}

.timer-track {
  height: 2px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.timer-fill {
  height: 100%;
  background: var(--accent);
  width: 100%;
  transition: width 1s linear, background 0.5s;
}

.timer-text {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
}

/* ── Status list ── */
.status-list {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.status-item {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  transition: all 0.2s;
}
.status-item.active { color: var(--text); border-color: var(--accent); }
.status-item.done   { color: var(--accent); border-color: rgba(232,255,71,0.3); }
.status-item.error  { color: var(--accent2); border-color: rgba(255,71,71,0.3); }

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.status-dot.pulse { animation: pulse 1s infinite; }

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

/* ── Receive panel ── */
.input-group { margin-bottom: 20px; }

.input-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: block;
}

.code-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 16px 20px;
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
  text-align: center;
  text-transform: uppercase;
}
.code-input:focus { border-color: var(--accent); }
.code-input::placeholder { color: var(--muted); letter-spacing: 0.2em; font-size: 20px; }

.connect-btn {
  width: 100%;
  padding: 16px;
  background: var(--accent);
  border: none;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #000;
  cursor: pointer;
  transition: all 0.15s;
}
.connect-btn:hover    { background: #d4e83f; }
.connect-btn:disabled { background: var(--border); color: var(--muted); cursor: not-allowed; }

/* ── Progress ── */
.progress-wrap { margin-top: 24px; display: none; }
.progress-wrap.visible { display: block; }

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.progress-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.progress-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-speed {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  min-width: 80px;
  text-align: right;
}


  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
}

.progress-track {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.3s ease;
  border-radius: 2px;
}

/* ── Download button ── */
.dl-btn {
  display: none;
  width: 100%;
  margin-top: 20px;
  padding: 16px;
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  text-decoration: none;
}
.dl-btn.visible { display: block; }
.dl-btn:hover   { background: rgba(232,255,71,0.08); }

/* ── Expired notice ── */
.expired {
  display: none;
  margin-top: 20px;
  padding: 14px 20px;
  background: rgba(255,71,71,0.05);
  border: 1px solid rgba(255,71,71,0.3);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent2);
  text-align: center;
  letter-spacing: 0.05em;
}
.expired.visible { display: block; }

/* ── How it works ── */
.how-section {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.how-title {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.how-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.how-step {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
}

.step-num {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 700;
  color: rgba(232,255,71,0.15);
  margin-bottom: 10px;
}

.step-text {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

/* ── Download list ── */
#dlBtnList {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Responsive ── */
@media (max-width: 520px) {
  .how-steps    { grid-template-columns: 1fr; }
  .code-value   { font-size: 22px; }
  .code-input   { font-size: 22px; }
}
