:root {
  --bg: #0d0d10;
  --surface: #17171c;
  --border: #2a2a32;
  --text: #e9e9ec;
  --muted: #7a7a85;
  --accent: #5b8cff;
  --accent-dim: #2c3a5c;
  --danger: #ff5b6e;
}

* { box-sizing: border-box; }

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

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 24px 20px 40px;
}

header {
  text-align: center;
  margin-bottom: 28px;
}

header .brand {
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

header .me {
  font-size: 20px;
  font-weight: 600;
}

.status {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 20px;
}

#peers {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.peer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  user-select: none;
}

.peer:active {
  transform: scale(0.98);
}

.peer .name {
  font-size: 16px;
  font-weight: 500;
}

.peer .hint {
  font-size: 12px;
  color: var(--muted);
}

.peer.waiting {
  border-color: var(--accent);
  background: var(--accent-dim);
}

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

.empty {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  margin-top: 60px;
  line-height: 1.6;
}

/* Transfer view */

#transfer {
  display: none;
  flex-direction: column;
  gap: 20px;
}

#transfer.active {
  display: flex;
}

#peers.hidden {
  display: none;
}

.transfer-peer {
  text-align: center;
  font-size: 18px;
  font-weight: 600;
}

.transfer-state {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.dropzone {
  border: 2px dashed var(--border);
  border-radius: 16px;
  padding: 36px 20px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.dropzone.drag {
  border-color: var(--accent);
  color: var(--accent);
}

.dropzone input {
  display: none;
}

.transfer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
}

.transfer-item .thumb {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  cursor: pointer;
  background: var(--border);
}

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

.transfer-item .row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 8px;
}

.transfer-item .fname {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 260px;
}

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

.progress {
  flex: 1;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress > div {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.1s linear;
}

a.download-btn {
  display: none;
  flex-shrink: 0;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
}

button {
  font: inherit;
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  cursor: pointer;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}

.btn-danger {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
}

/* Lightbox */

#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
  cursor: zoom-out;
}

#lightbox.active {
  display: flex;
}

#lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
}
