*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #0d0d10;
    --surface: #17171b;
    --surface-2: #1f1f25;
    --border: rgba(255,255,255,0.07);
    --border-hover: rgba(255,255,255,0.14);
    --text: #e8e6e0;
    --text-muted: rgba(232,230,224,0.38);
    --accent: #c9a96e;
    --accent-dim: rgba(201,169,110,0.10);
    --accent-glow: rgba(201,169,110,0.18);
    --danger: #e07070;
    --danger-dim: rgba(224,112,112,0.10);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

/* Header */
header {
    height: calc(52px + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
    background: rgba(13,13,16,0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
    position: relative;
    z-index: 10;
}

.logo {
    font-family: 'Syne', sans-serif;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: var(--text);
    flex-shrink: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

@media (max-width: 500px) {
    .header-name-label { display: none; }
    #header-office-label { display: none; }
    #qr-btn span { display: none; }
    #office-btn { padding: 5px 8px; }
    #qr-btn { padding: 5px 8px; }
}

.header-name-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#office-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 5px 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    max-width: 110px;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    overflow: hidden;
}
#office-btn:hover { background: var(--surface-2); border-color: var(--border-hover); color: var(--text); }
#office-btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
#header-office-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 70px;
}

#qr-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 5px 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    flex-shrink: 0;
}
#qr-btn:hover { background: var(--surface-2); border-color: var(--border-hover); color: var(--text); }

/* Arena */
#arena {
    position: relative;
    width: 100%;
    height: calc(100vh - 52px - env(safe-area-inset-top));
    height: calc(100dvh - 52px - env(safe-area-inset-top));
    padding-bottom: env(safe-area-inset-bottom);
    overflow: hidden;
}

#bg-art {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#svg-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.peer-line {
    stroke: rgba(201,169,110,0.12);
    stroke-width: 1;
    stroke-dasharray: 4 5;
}

#empty-hint {
    position: absolute;
    top: 68%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    pointer-events: none;
    width: 90vw;
    max-width: 420px;
}
.empty-hook {
    font-size: 13px;
    color: var(--text-muted);
    opacity: 0.7;
    margin-bottom: 6px;
    font-style: italic;
}
.empty-tagline {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    opacity: 0.6;
    margin-bottom: 10px;
    letter-spacing: 0.1px;
}
.empty-perks {
    list-style: none;
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.empty-perks li {
    font-size: 12px;
    color: var(--text-muted);
    opacity: 0.7;
}
.empty-perks li::before {
    content: '✓ ';
    color: var(--accent);
    opacity: 0.8;
}
.empty-instruction {
    font-size: 12px;
    color: var(--text-muted);
    opacity: 0.5;
    border-top: 1px solid var(--border);
    padding-top: 10px;
}

/* Center node */
#center-node {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    z-index: 2;
}

.pulse-wrap {
    position: relative;
    width: 96px;
    height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pulse-ring {
    position: absolute;
    border-radius: 50%;
    border: 1.5px solid rgba(201,169,110,0.25);
    pointer-events: none;
    width: 96px;
    height: 96px;
    will-change: transform, opacity;
    animation: pulse 3.5s ease-out infinite;
}
.pulse-ring:nth-child(1) { animation-delay: 0s; }
.pulse-ring:nth-child(2) { animation-delay: 1.15s; }
.pulse-ring:nth-child(3) { animation-delay: 2.3s; }

@keyframes pulse {
    0%   { transform: scale(1);     opacity: 0.8; }
    100% { transform: scale(3.2);   opacity: 0; }
}

.node-circle {
    border-radius: 50%;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.center-circle {
    width: 96px;
    height: 96px;
    font-size: 40px;
    box-shadow: 0 0 0 1px var(--accent), 0 8px 32px rgba(201,169,110,0.2), 0 2px 8px rgba(0,0,0,0.6);
    border: none;
}

#center-node .node-label {
    margin-top: 10px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    letter-spacing: -0.1px;
}

.node-edit-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
    letter-spacing: 0.1px;
}

/* Center office badge */
#center-office {
    display: none;
    font-size: 10px;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-dim);
    border-radius: 100px;
    padding: 2px 9px;
    margin-top: 4px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
#center-office.visible { display: block; }

/* Peer nodes */
.peer-node {
    position: absolute;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
    animation: nodeIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes nodeIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.peer-node .node-circle {
    width: 72px;
    height: 72px;
    font-size: 30px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.peer-node .node-circle:hover {
    border-color: var(--accent);
    box-shadow: 0 6px 24px rgba(201,169,110,0.2);
    transform: scale(1.07);
}

.peer-node .node-circle:active { transform: scale(0.95); }

.peer-node .node-circle.drag-over {
    border-color: var(--accent);
    background: var(--surface-2);
    transform: scale(1.12);
    box-shadow: 0 8px 28px rgba(201,169,110,0.28);
}

/* Progress ring */
.node-progress-ring {
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    display: none;
}
.node-progress-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg  { fill: none; stroke: var(--surface-2); stroke-width: 3; }
.ring-fill {
    fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round;
    stroke-dasharray: 175.9; stroke-dashoffset: 175.9;
    transition: stroke-dashoffset 0.15s;
}

.peer-node .node-label {
    margin-top: 8px;
    font-weight: 500;
    font-size: 12px;
    color: var(--text);
    max-width: 88px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    letter-spacing: 0.1px;
    opacity: 0.85;
}

/* Action buttons */
.node-actions {
    display: flex;
    gap: 5px;
    margin-top: 5px;
}

.action-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 3px 9px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, opacity 0.15s;
    line-height: 1.4;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}
.action-btn:hover { background: var(--surface-2); border-color: var(--border-hover); color: var(--text); }

@media (hover: hover) {
    .node-actions { opacity: 0; }
    .peer-node:hover .node-actions { opacity: 1; }
}

.node-status {
    font-size: 11px;
    color: var(--accent);
    margin-top: 3px;
    min-height: 14px;
    text-align: center;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.8;
}

/* Modal backdrop shared */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* QR modal */
#qr-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#qr-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 32px 28px;
    max-width: 300px;
    width: 90%;
    text-align: center;
    box-shadow: 0 32px 80px rgba(0,0,0,0.5);
}

.qr-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text);
}

#qr-canvas canvas {
    border-radius: 12px;
    display: block;
    margin: 0 auto;
}

#qr-url {
    font-size: 11px;
    color: var(--text-muted);
    margin: 12px 0 16px;
    word-break: break-all;
}

#qr-close {
    width: 100%;
    padding: 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    color: var(--text);
    transition: background 0.15s;
}
#qr-close:hover { background: rgba(255,255,255,0.06); }

/* Clipboard notify */
#clipboard-notify {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1500;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#clipboard-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 24px;
    max-width: 320px;
    width: 90%;
    box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}

#clipboard-from {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 10px;
    color: var(--text-muted);
}

#clipboard-text {
    background: var(--surface-2);
    border-radius: 10px;
    padding: 12px;
    font-size: 14px;
    color: var(--text);
    word-break: break-all;
    max-height: 160px;
    overflow-y: auto;
    margin-bottom: 16px;
    white-space: pre-wrap;
    border: 1px solid var(--border);
}

.clipboard-buttons {
    display: flex;
    gap: 8px;
}

.clipboard-buttons button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.15s;
}
.clipboard-buttons button:hover { opacity: 0.85; }

#clipboard-dismiss { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
#clipboard-copy    { background: var(--accent); color: #1a1406; }

/* Paste dialog */
#paste-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1500;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#paste-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 24px;
    max-width: 340px;
    width: 90%;
    box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}

#paste-box p {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 12px;
    color: var(--text);
}

#paste-input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    margin-bottom: 12px;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: var(--surface-2);
    color: var(--text);
}
#paste-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

#paste-cancel { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
#paste-send   { background: var(--accent); color: #1a1406; border: none; }

/* Shared modal brand */
.modal-brand {
    font-family: 'Syne', sans-serif;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 20px;
    opacity: 0.7;
}

.modal-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.55;
}

/* Name modal */
#name-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

#name-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 40px 32px 32px;
    max-width: 340px;
    width: 90%;
    text-align: center;
    box-shadow: 0 40px 100px rgba(0,0,0,0.6);
}

#name-box h2 {
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin-bottom: 8px;
    color: var(--text);
}

#name-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    font-size: 16px;
    text-align: center;
    outline: none;
    margin-bottom: 12px;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
    background: var(--surface-2);
    color: var(--text);
}
#name-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

#name-save {
    width: 100%;
    padding: 15px;
    background: var(--accent);
    color: #1a1406;
    border: none;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.15s, transform 0.1s;
    letter-spacing: 0.1px;
}
#name-save:hover { opacity: 0.9; }
#name-save:active { transform: scale(0.98); }

/* Office modal */
#office-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

#office-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 40px 32px 32px;
    max-width: 340px;
    width: 90%;
    text-align: center;
    box-shadow: 0 40px 100px rgba(0,0,0,0.6);
}

#office-box h2 {
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin-bottom: 8px;
    color: var(--text);
}


#office-save {
    width: 100%;
    padding: 15px;
    background: var(--accent);
    color: #1a1406;
    border: none;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    margin-bottom: 10px;
    transition: opacity 0.15s, transform 0.1s;
}
#office-save:hover { opacity: 0.9; }
#office-save:active { transform: scale(0.98); }

#office-leave {
    width: 100%;
    padding: 13px;
    background: var(--danger-dim);
    color: var(--danger);
    border: 1px solid rgba(224,112,112,0.2);
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    margin-bottom: 8px;
    transition: background 0.15s;
}
#office-leave:hover { background: rgba(224,112,112,0.15); }

#office-cancel {
    width: 100%;
    padding: 12px;
    background: none;
    color: var(--text-muted);
    border: none;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.15s;
}
#office-cancel:hover { color: var(--text); }

/* Accept modal */
#accept-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#accept-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 28px 24px;
    max-width: 320px;
    width: 90%;
    box-shadow: 0 32px 80px rgba(0,0,0,0.5);
}

#accept-from {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 14px;
    color: var(--text);
}

#accept-files { list-style: none; margin-bottom: 20px; }

#accept-files li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text);
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

#accept-files li:last-child { border-bottom: none; }

#accept-files li span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size { color: var(--text-muted); flex-shrink: 0; }

.accept-buttons { display: flex; gap: 8px; }

.accept-buttons button {
    flex: 1;
    padding: 13px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.15s;
}
.accept-buttons button:hover { opacity: 0.85; }

#decline-btn { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
#accept-btn  { background: var(--accent); color: #1a1406; }

/* Zip dialog */
#zip-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
#zip-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 28px 24px;
    max-width: 320px;
    width: 90%;
    box-shadow: 0 32px 80px rgba(0,0,0,0.5);
}
#zip-box .accept-buttons { flex-wrap: wrap; }
#zip-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 6px;
    color: var(--text);
}
#zip-cancel { background: transparent; color: var(--text-muted); border: 1px solid transparent; }
#zip-no     { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
#zip-yes    { background: var(--accent); color: #1a1406; }

/* Toasts */
#toast-container {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 9999;
    pointer-events: none;
    align-items: center;
}

.toast {
    background: rgba(30,30,36,0.95);
    color: var(--text);
    padding: 10px 20px;
    border-radius: 100px;
    font-size: 13px;
    white-space: nowrap;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    animation: fadeUp 0.2s ease;
}

.toast-error { background: rgba(100,30,30,0.95); border-color: rgba(224,112,112,0.2); }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Office nodes in arena */
.office-node {
    position: absolute;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
    cursor: pointer;
    animation: nodeIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.office-circle {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    background: var(--surface-2);
    border: 1px solid rgba(201,169,110,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4), 0 0 16px rgba(201,169,110,0.06);
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.office-node:hover .office-circle {
    border-color: var(--accent);
    box-shadow: 0 6px 24px rgba(201,169,110,0.22), 0 0 20px rgba(201,169,110,0.1);
    transform: scale(1.07);
}
.office-node:active .office-circle { transform: scale(0.95); }

.office-label {
    margin-top: 8px;
    font-weight: 600;
    font-size: 12px;
    color: var(--text);
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    opacity: 0.85;
}

.office-member-count {
    font-size: 10px;
    color: var(--accent);
    margin-top: 2px;
    opacity: 0.65;
    letter-spacing: 0.2px;
}

/* Two-input office modal */
#office-create-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}
#office-name-input,
#office-pin-input {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
    background: var(--surface-2);
    color: var(--text);
}
#office-name-input::placeholder,
#office-pin-input::placeholder { color: var(--text-muted); }
#office-name-input:focus,
#office-pin-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

/* Field error */
.field-error {
    font-size: 12px;
    color: var(--danger);
    min-height: 16px;
    margin-bottom: 8px;
    text-align: center;
}

/* Join office PIN modal */
#office-join-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

#office-join-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 40px 32px 32px;
    max-width: 340px;
    width: 90%;
    text-align: center;
    box-shadow: 0 40px 100px rgba(0,0,0,0.6);
}

#office-join-box h2 {
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin-bottom: 8px;
    color: var(--text);
}

#office-join-pin {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    font-size: 20px;
    text-align: center;
    letter-spacing: 4px;
    outline: none;
    margin-bottom: 8px;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
    background: var(--surface-2);
    color: var(--text);
}
#office-join-pin::placeholder { letter-spacing: 0; color: var(--text-muted); font-size: 14px; }
#office-join-pin:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

#office-join-btn {
    width: 100%;
    padding: 15px;
    background: var(--accent);
    color: #1a1406;
    border: none;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    margin-bottom: 10px;
    transition: opacity 0.15s, transform 0.1s;
}
#office-join-btn:hover { opacity: 0.9; }
#office-join-btn:active { transform: scale(0.98); }

#office-join-cancel {
    width: 100%;
    padding: 12px;
    background: none;
    color: var(--text-muted);
    border: none;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.15s;
}
#office-join-cancel:hover { color: var(--text); }

/* ── Ring-focus transitions ──────────────────────────────────────────────── */
.ring-transitioning .peer-node,
.ring-transitioning .office-node {
    transition: left 0.45s cubic-bezier(0.34, 1.15, 0.64, 1),
                top  0.45s cubic-bezier(0.34, 1.15, 0.64, 1),
                opacity 0.3s ease;
}

/* Clickable ring orbit circles drawn in svg-lines */
.ring-orbit {
    fill: none;
    stroke: rgba(201,169,110,0.13);
    stroke-width: 1;
    stroke-dasharray: 6 8;
    pointer-events: all;
    cursor: pointer;
    transition: stroke 0.2s;
}
.ring-orbit:hover { stroke: rgba(201,169,110,0.38); stroke-width: 1.5; }

/* Dimmed nodes when another ring is focused */
.node-dimmed {
    opacity: 0.08;
    pointer-events: none;
}
.node-dimmed .node-circle,
.node-dimmed .office-circle { transform: scale(0.35); }
.node-dimmed .node-label,
.node-dimmed .node-actions,
.node-dimmed .office-label,
.node-dimmed .office-member-count { display: none; }

/* Smaller nodes for dense inner rings */
.node-sm .node-circle { width: 58px; height: 58px; font-size: 24px; }
.node-sm .node-label  { font-size: 11px; }

.node-xs .node-circle { width: 46px; height: 46px; font-size: 19px; }
.node-xs .node-label  { font-size: 10px; }
.node-xs .node-actions { display: none; }

/* Back-to-all button (shown during ring focus) */
#ring-back-btn {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-2);
    border: 1px solid var(--border-hover);
    border-radius: 100px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    font-family: inherit;
    z-index: 20;
    transition: background 0.15s, border-color 0.15s;
}
#ring-back-btn:hover { background: var(--surface); border-color: var(--accent); color: var(--accent); }

/* Help button */
#help-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
#help-btn:hover { color: var(--text); border-color: var(--border-hover); background: var(--surface-2); }

#install-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--accent-dim);
    border: 1px solid var(--accent);
    border-radius: 20px;
    padding: 5px 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, opacity 0.15s;
    flex-shrink: 0;
}
#install-btn:hover { opacity: 0.85; }

@media (max-width: 500px) {
    #install-btn span { display: none; }
    #install-btn { padding: 5px 8px; }
}

#support-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    text-decoration: none;
}
#support-btn:hover { color: var(--text); border-color: var(--border-hover); background: var(--surface-2); }

/* Help modal */
#help-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

#help-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 40px 32px 32px;
    max-width: 360px;
    width: 90%;
    box-shadow: 0 40px 100px rgba(0,0,0,0.6);
}

#help-box h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text);
    letter-spacing: -0.3px;
}

#help-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 28px;
}

#help-list li {
    font-size: 14px;
    color: var(--text);
    line-height: 1.5;
    padding-left: 14px;
    position: relative;
}
#help-list li::before {
    content: '–';
    position: absolute;
    left: 0;
    color: var(--text-muted);
}

#help-list strong { color: var(--accent); font-weight: 600; }

#help-close {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    color: #1a1406;
    border: none;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.15s;
}
#help-close:hover { opacity: 0.9; }
