*,
*:before,
*:after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
:root {
  --bg: #f5f5f4;
  --surface: #ffffff;
  --border: #e4e4e0;
  --text: #1a1a18;
  --muted: #8a8a84;
  --accent: #2563eb;
  --accent-soft: #dbeafe;
  --danger: #dc2626;
  --you: #1d4ed8;
  --ring-color: #d4d4cf;
  --radius: 12px;
  --font: "DM Sans", sans-serif;
  --mono: "DM Mono", monospace;
}
html,
body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.header-right {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  gap: 10px;
}
.my-id-label code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--bg);
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid var(--border);
  color: var(--text);
  letter-spacing: 0.04em;
}
main {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 57px;
  gap: 20px;
}
.radar-area {
  position: relative;
  width: 420px;
  height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.radar-rings {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--ring-color);
}
.ring-1 {
  width: 130px;
  height: 130px;
}
.ring-2 {
  width: 250px;
  height: 250px;
}
.ring-3 {
  width: 380px;
  height: 380px;
}
.radar-pulse {
  position: absolute;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  opacity: 0;
  animation: pulse-out 3s ease-out infinite;
}
@keyframes pulse-out {
  0% {
    transform: scale(0.3);
    opacity: 0.5;
  }
  to {
    transform: scale(1);
    opacity: 0;
  }
}
.node {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  transform: translate(-50%, -50%);
}
.node span {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  font-weight: 400;
}
.avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border);
  background: var(--surface);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 2px 8px #0000000f;
}
.node:not(.you):hover .avatar {
  transform: scale(1.08);
  box-shadow: 0 4px 16px #2563eb2e;
  border-color: var(--accent);
}
.you-avatar {
  background: var(--you);
  border-color: var(--you);
  color: #fff;
  width: 58px;
  height: 58px;
  display: flex;
  flex-direction: column;
}
.you {
  left: 50%;
  top: 50%;
  z-index: 10;
  cursor: default;
}
.you span {
  color: var(--bg);
  font-weight: 500;
}
.peer-node .avatar {
  color: var(--accent);
}
.status-msg {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  min-height: 20px;
}
.modal {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: #00000040;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.modal.hidden {
  display: none;
}
.modal-box {
  background: var(--surface);
  border-radius: 16px;
  padding: 28px 32px;
  min-width: 300px;
  max-width: 360px;
  width: 100%;
  box-shadow: 0 8px 40px #00000024;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal-peer-name {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.modal-hint {
  font-size: 13px;
  color: var(--muted);
  margin-top: -6px;
}
.file-pick-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  transition: border-color 0.15s, background 0.15s;
}
.file-pick-label:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.file-pick-label svg {
  flex-shrink: 0;
}
#file-name-display {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.btn-primary {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 18px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-primary:disabled {
  opacity: 0.4;
  cursor: default;
}
.btn-primary:not(:disabled):hover {
  opacity: 0.85;
}
.btn-ghost {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 400;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s;
}
.btn-ghost:hover {
  border-color: var(--text);
  color: var(--text);
}
.progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.progress-wrap.hidden {
  display: none;
}
.progress-bar-track {
  flex: 1;
  height: 4px;
  background: var(--bg);
  border-radius: 99px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  width: 0%;
  transition: width 0.1s linear;
}
#progress-label {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
  min-width: 34px;
  text-align: right;
}
.receive-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translate(-50%);
  z-index: 300;
}
.receive-toast.hidden {
  display: none;
}
.toast-inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 22px;
  box-shadow: 0 6px 28px #0000001f;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 260px;
}
.toast-title {
  font-size: 13px;
  font-weight: 500;
}
.toast-file {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 240px;
}
.toast-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
@keyframes node-in {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.6);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}
.peer-node {
  animation: node-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

#sia-footer, #sia-footer a {
	margin-top: 5px; text-align: center; text-decoration: none;
}

@media (max-width: 480px) {
  .radar-area {
    width: 320px;
    height: 320px;
  }
  .ring-1 {
    width: 100px;
    height: 100px;
  }
  .ring-2 {
    width: 200px;
    height: 200px;
  }
  .ring-3,
  .radar-pulse {
    width: 300px;
    height: 300px;
  }
}