:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #10b981;
  --danger: #dc2626;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(15, 23, 42, .06);
}

[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --border: #334155;
  --shadow: 0 4px 20px rgba(0, 0, 0, .4);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background .2s, color .2s;
}

a { color: var(--primary); text-decoration: none; }

.container { max-width: 720px; margin: 0 auto; padding: 0 16px; }

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 14px;
}
.theme-toggle {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 8px 14px; cursor: pointer; font-size: 13px;
}

/* Hero */
.hero { text-align: center; padding: 48px 16px 24px; }
.hero h1 { font-size: 30px; margin: 0 0 8px; }
.hero p { color: var(--muted); font-size: 15px; margin: 0 0 28px; }

/* Upload card */
.upload-card {
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: border-color .15s, background .15s;
  cursor: pointer;
}
.upload-card.dragover { border-color: var(--primary); background: rgba(37, 99, 235, .06); }
.upload-icon { font-size: 40px; margin-bottom: 8px; }
.btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 12px;
}
.btn:hover { background: var(--primary-dark); }
.btn.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn.block { width: 100%; }
.hint { color: var(--muted); font-size: 13px; margin-top: 14px; }

/* Choice cards on homepage */
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; }
@media (max-width: 520px) { .choices { grid-template-columns: 1fr; } }
.choice-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; text-align: center; box-shadow: var(--shadow);
}
.choice-card .icon { font-size: 28px; }
.choice-card h3 { margin: 8px 0 4px; }
.choice-card p { color: var(--muted); font-size: 13px; margin: 0 0 12px; }

/* Progress */
.file-list { margin-top: 20px; text-align: left; }
.file-row {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 10px;
}
.file-row .name { font-weight: 600; font-size: 14px; display: flex; justify-content: space-between; }
.file-row .meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.progress-track { background: var(--border); border-radius: 999px; height: 8px; margin-top: 8px; overflow: hidden; }
.progress-fill { background: var(--primary); height: 100%; width: 0%; transition: width .15s; }
.progress-fill.done { background: var(--accent); }

/* Result panel */
.result-panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; margin-top: 20px; box-shadow: var(--shadow);
}
.link-box {
  display: flex; gap: 8px; align-items: center;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
  font-family: monospace; font-size: 13px; word-break: break-all;
}
.code-badge {
  display: inline-block; background: rgba(37,99,235,.1); color: var(--primary);
  font-family: monospace; font-weight: 700; padding: 6px 12px; border-radius: 8px; margin: 8px 0;
}

/* Download / receive page */
.receive-form { display: flex; gap: 8px; margin-top: 16px; }
.receive-form input { flex: 1; padding: 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 15px; }

.file-detail-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.file-detail-row:last-child { border-bottom: none; }
.file-detail-row span:first-child { color: var(--muted); }

.countdown { font-size: 26px; font-weight: 800; text-align: center; margin: 16px 0; color: var(--primary); font-variant-numeric: tabular-nums; }

.status-page { text-align: center; padding: 60px 16px; }
.status-page .emoji { font-size: 52px; }
.status-page h1 { margin: 12px 0 8px; }
.status-page p { color: var(--muted); }

footer { text-align: center; color: var(--muted); font-size: 12px; padding: 30px 16px; }
footer a { color: var(--muted); margin: 0 6px; }

.ad-slot { margin: 16px 0; text-align: center; overflow: hidden; }

.alert { border-radius: 8px; padding: 12px 14px; font-size: 14px; margin-bottom: 14px; }
.alert-error { background: rgba(220,38,38,.1); color: var(--danger); border: 1px solid rgba(220,38,38,.25); }
.alert-success { background: rgba(16,185,129,.1); color: var(--accent); border: 1px solid rgba(16,185,129,.25); }

#file-input { display: none; }
