/* The anchor is transparent player chrome; only its controls receive pointer events. */
.nexus-player-wheel {
    --gateway-accent: var(--nexus-user-accent, #bf913f);
    --pg-ink: #0d1316;
    background: transparent !important; background-image: none !important; border: 0 !important;
    box-shadow: none !important; backdrop-filter: none !important; padding: 0 !important;
    position: fixed; display: block; width: 404px; height: 404px; min-width: 0; min-height: 0; overflow: visible;
    pointer-events: none; color: #f2eee5;
    /* Native modal dialogs use the browser top layer and remain above this personal HUD. */
    z-index: 100000 !important;
}
.nexus-player-wheel.is-collapsed, .nexus-player-wheel.is-collapsed .pg-wheel { width: 116px; height: 116px; }
.nexus-player-wheel.is-collapsed .pg-character { left: 6px; top: 6px; height: 104px; }
.nexus-player-wheel .pg-portrait { touch-action: none; user-select: none; cursor: grab; }
.nexus-player-wheel.is-dragging .pg-portrait { cursor: grabbing; }
.nexus-player-wheel .pg-wheel { position: relative; width: 404px; height: 404px; pointer-events: none; }
.nexus-player-wheel button, .nexus-player-wheel summary { pointer-events: auto; cursor: pointer; color: #f2eee5; font: 12px/1.2 var(--font-primary, sans-serif); margin: 0; box-shadow: none; }
.nexus-player-wheel button { min-height: 0; padding: 0; border: 1px solid color-mix(in srgb, var(--gateway-accent) 65%, #121d29); background: var(--pg-ink); }
.nexus-player-wheel button:hover { border-color: var(--gateway-accent); filter: brightness(1.2); }
.nexus-player-wheel button:focus-visible, .nexus-player-wheel summary:focus-visible { outline: 2px solid var(--gateway-accent); outline-offset: 4px; }
.nexus-player-wheel button:disabled { opacity: .45; cursor: default; }
.nexus-player-wheel .pg-orbit { position: absolute; left: 99px; top: 102px; width: 206px; height: 206px; border: 1px solid color-mix(in srgb, var(--gateway-accent) 60%, transparent); border-radius: 50%; box-shadow: 0 0 0 6px #0002, inset 0 0 0 5px #0002; pointer-events: none; }
.nexus-player-wheel .pg-pin-orbit { position: absolute; left: 38px; top: 38px; width: 328px; height: 328px; border: 1px solid color-mix(in srgb, var(--gateway-accent) 24%, transparent); border-radius: 50%; pointer-events: none; }
.nexus-player-wheel .pg-character { position: absolute; left: 150px; top: 146px; width: 104px; height: 112px; }
.nexus-player-wheel .pg-portrait { display: block; width: 104px; height: 104px; border: 2px solid var(--gateway-accent); border-radius: 50%; position: relative; overflow: hidden; box-shadow: 0 0 0 5px #0b141ccc, 0 0 0 6px color-mix(in srgb, var(--gateway-accent) 45%, transparent), 0 7px 20px #0009; }
.nexus-player-wheel .pg-portrait img { width: 100%; height: 100%; object-fit: cover; border: 0; }
.nexus-player-wheel .pg-character-choices { display: flex; position: absolute; left: 5px; right: 5px; bottom: 0; border: 1px solid var(--gateway-accent); border-radius: 5px 5px 15px 15px; overflow: hidden; box-shadow: 0 4px 9px #0007; }
.nexus-player-wheel .pg-character-choices button { flex: 1; padding: 6px 0; border: 0; border-radius: 0; background: #12212d; font-size: 10px; }
.nexus-player-wheel .pg-character-choices button + button { border-left: 1px solid #ffffff30; }
.nexus-player-wheel .pg-destination { position: absolute; width: 52px; height: 52px; border-radius: 50%; background: radial-gradient(circle at 35% 20%, #35444b, #101b24 75%); box-shadow: 0 4px 12px #0008, inset 0 0 0 3px #0003; display: grid; place-content: center; gap: 4px; }
.nexus-player-wheel .pg-destination i { font-size: 21px; color: var(--gateway-accent); }
.nexus-player-wheel .pg-primary-entity { width: 56px; height: 56px; display: block; padding: 4px; }
.nexus-player-wheel .pg-primary-entity > img { width: 100%; height: 100%; object-fit: contain; border: 0; border-radius: 50%; }
.nexus-player-wheel .pg-pin { position: absolute; width: 44px; height: 44px; pointer-events: auto; border-radius: 50%; }
.nexus-player-wheel .pg-pin-target { position: relative; width: 44px; height: 44px; border-radius: 50%; background: #142332; box-shadow: 0 0 0 3px #0c1722aa, 0 4px 12px #0009; }
.nexus-player-wheel .pg-pin.is-drop-target { outline: 2px solid var(--gateway-accent); outline-offset: 4px; background: var(--gateway-accent); box-shadow: 0 0 18px var(--gateway-accent); }
.nexus-player-wheel .pg-pin-target > img { width: 100%; height: 100%; object-fit: cover; border: 0; border-radius: 50%; }
.nexus-player-wheel .pg-type-badge { position: absolute; bottom: -3px; right: -3px; display: grid; place-content: center; width: 20px; height: 20px; border-radius: 50%; background: #13202b; border: 1px solid var(--gateway-accent); color: var(--gateway-accent); font-size: 9px; }
.nexus-player-wheel .pg-empty-pin { position: absolute; left: 8px; top: 8px; width: 28px; height: 28px; border-radius: 50%; border-style: dashed; opacity: .35; font-size: 16px; }
.nexus-player-wheel .pg-empty-pin:hover, .nexus-player-wheel .pg-empty-pin:focus-visible { opacity: 1; }
.nexus-player-wheel .pg-pin-menu { position: absolute; top: -9px; right: -11px; pointer-events: auto; }
.nexus-player-wheel summary { list-style: none; display: grid; place-content: center; width: 22px; height: 20px; border-radius: 8px; background: #101c28e8; border: 1px solid color-mix(in srgb, var(--gateway-accent) 40%, transparent); font-size: 16px; }
.nexus-player-wheel summary::-webkit-details-marker { display: none; }
.nexus-player-wheel .pg-pin-menu > summary { opacity: 0; }
.nexus-player-wheel .pg-pin:hover summary, .nexus-player-wheel .pg-pin:focus-within summary, .nexus-player-wheel .pg-pin-menu[open] > summary { opacity: 1; }
.nexus-player-wheel details[open] { z-index: 20; }
.nexus-player-wheel .pg-menu-items { position: absolute; top: 24px; left: 0; width: 190px; padding: 5px; display: grid; gap: 2px; border: 1px solid color-mix(in srgb, var(--gateway-accent) 60%, #111); border-radius: 8px; background: #101b26; box-shadow: 0 8px 24px #000a; pointer-events: auto; }
.nexus-player-wheel .pg-menu-left .pg-menu-items { left: auto; right: 0; }
.nexus-player-wheel .pg-menu-up .pg-menu-items { top: auto; bottom: 24px; }
.nexus-player-wheel .pg-menu-items button { padding: 8px; border: 0; text-align: left; background: transparent; border-radius: 4px; font-size: 12px; }
.nexus-player-wheel .pg-menu-items button:hover { background: #ffffff15; }
.nexus-player-wheel .pg-wheel-utilities { display: flex; position: absolute; top: 280px; left: 242px; pointer-events: none; }
.nexus-player-wheel .pg-wheel-menu .pg-menu-items { top: auto; bottom: 26px; left: -70px; }
.nexus-player-wheel .pg-preview { position: absolute; top: 345px; left: 120px; width: 164px; text-align: center; color: #fff; background: #493955e8; border-radius: 5px; padding: 3px; font-size: 10px; }
.nexus-player-wheel[data-theme="tech"] .pg-orbit { border-style: dashed; box-shadow: 0 0 0 5px #112d4055; }
.nexus-player-wheel[data-theme="tech"] .pg-destination { background: linear-gradient(135deg, #25495c, #0b1a27); }

/* Independent working panels retain normal Foundry window behavior. */
.nexus-player-panel, .nexus-player-setup { --gateway-accent: var(--nexus-user-accent, #bf913f); --pg-bg: var(--nexus-surface-base, #090d0f); --pg-muted: var(--nexus-text-secondary, #b8ad9c); color: var(--nexus-text-primary, #e7dfcf); background: var(--pg-bg); border: 1px solid var(--nexus-border-strong, #65707880); box-shadow: 0 10px 35px #0008; min-width: 320px; min-height: 280px; }

.nexus-player-panel .window-header, .nexus-player-setup .window-header { background: var(--nexus-surface-base, #090d0f); color: var(--nexus-text-primary, #e7dfcf); border-bottom: 1px solid #ffffff17; }
.nexus-player-panel .window-content, .nexus-player-setup .window-content { background: none; color: inherit; padding: 0; min-height: 0; overflow: hidden; }
.nexus-player-panel .pg-panel-body, .nexus-player-setup .pg-setup-content { height: 100%; min-height: 0; overflow-y: auto; padding: 16px; scrollbar-width: thin; }
.nexus-player-panel h2 { font: 600 22px/1.25 var(--nexus-heading-font, serif); color: #f1ede1; border: 0; margin: 0 0 5px; }
.nexus-player-panel p, .nexus-player-setup p { margin: 6px 0; line-height: 1.5; }
.nexus-player-panel button, .nexus-player-setup button { color: var(--nexus-text-primary, #e7dfcf); border: 1px solid #ffffff29; background: #ffffff08; border-radius: 5px; min-height: 28px; line-height: 1.3; box-shadow: none; font-size: 12px; padding: 5px 8px; cursor: pointer; }
.nexus-player-panel button:hover, .nexus-player-setup button:hover { border-color: var(--gateway-accent); background: #ffffff12; }
.nexus-player-panel button:focus-visible { outline: 2px solid var(--gateway-accent); outline-offset: 2px; }
.nexus-player-panel button:disabled, .nexus-player-setup button:disabled { opacity: .45; cursor: default; }
.nexus-player-panel .pg-panel-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.nexus-player-panel .pg-panel-heading > div { flex: 1; }
.nexus-player-panel .pg-panel-heading p, .nexus-player-panel .pg-pin-count { font-size: 11px; color: var(--pg-muted); }
.nexus-player-panel .pg-pin-count { white-space: nowrap; color: var(--gateway-accent); }
.nexus-player-panel .pg-filters { display: flex; gap: 6px; margin-bottom: 14px; }
.nexus-player-panel .pg-filters [aria-pressed="true"] { border-color: var(--gateway-accent); color: var(--nexus-accent-bright); }
.nexus-player-panel .pg-list { display: grid; gap: 8px; }
.nexus-player-panel .pg-entry { position: relative; border: 1px solid var(--nexus-border-subtle); border-radius: var(--nexus-radius-card, 4px); background: linear-gradient(130deg, var(--nexus-surface-raised, #0d1316), var(--nexus-surface-panel, #090d0f)); }
.nexus-player-panel .pg-entry-open { display: flex; height: auto; min-height: 82px; width: calc(100% - 32px); padding: 10px; gap: 10px; align-items: center; border: 0; background: transparent; text-align: left; }
.nexus-player-panel .pg-entry-open img { width: 52px; height: 58px; flex: 0 0 52px; object-fit: cover; border: 0; border-radius: 3px; object-fit: contain; background: #05090b; }
.nexus-player-panel .pg-entry-open > span { flex: 1; min-width: 0; }
.nexus-player-panel .pg-entry-open strong { display: block; font-size: 13px; }
.nexus-player-panel .pg-entry-open small { display: block; margin-top: 4px; color: var(--pg-muted); font-size: 10px; line-height: 1.5; }
.nexus-player-panel .pg-entry-open > i { color: var(--gateway-accent); font-size: 11px; }
.nexus-player-panel .pg-help, .nexus-player-setup .pg-help { font-size: 11px; color: var(--pg-muted); line-height: 1.5; margin-top: 13px; }
.nexus-player-panel .pg-current { display: flex; gap: 8px; align-items: center; border-left: 2px solid var(--gateway-accent); padding: 6px 8px; margin-bottom: 14px; background: var(--nexus-accent-surface); font-size: 11px; }
.nexus-player-panel .pg-current span { flex: 1; }
.nexus-player-panel .pg-empty { color: var(--pg-muted); font-size: 12px; line-height: 1.6; padding: 25px 5px; }
.nexus-player-panel .pg-empty > i { font-size: 25px; color: var(--gateway-accent); margin-bottom: 10px; }
.nexus-player-panel label, .nexus-player-setup label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; margin: 10px 0; color: var(--nexus-text-primary, #e7dfcf); }
.nexus-player-panel textarea, .nexus-player-setup textarea, .nexus-player-setup input, .nexus-player-setup select { width: 100%; color: var(--nexus-text-primary, #e7dfcf); background: var(--nexus-surface-panel, #090d0f); border: 1px solid #ffffff30; border-radius: 5px; font: 12px/1.6 var(--font-primary, sans-serif); padding: 8px; box-shadow: none; }
.nexus-player-panel textarea, .nexus-player-setup textarea { resize: vertical; min-height: 56px; }
.nexus-player-panel .pg-buttons, .nexus-player-setup .pg-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.nexus-player-panel .pg-description { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.7; margin: 15px 0; }
.nexus-player-panel .pg-profile-heading { display: flex; gap: 12px; align-items: center; margin-bottom: 15px; }
.nexus-player-panel .pg-profile-heading img { width: 55px; height: 65px; object-fit: cover; border: 0; border-radius: 7px; }
.nexus-player-panel .pg-profile-heading p { color: var(--pg-muted); font-size: 11px; }
.nexus-player-panel .pg-preview, .nexus-player-panel .pg-message, .nexus-player-setup .pg-message { padding: 9px; font-size: 12px; background: #27333e; color: #f3dfaa; border-left: 2px solid var(--gateway-accent); }

@media (prefers-reduced-motion: reduce) { .nexus-player-wheel *, .nexus-player-panel * { animation: none !important; transition: none !important; } }

.nexus-player-panel .pg-eyebrow { display: block; margin-bottom: 5px; font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--gateway-accent); }
.nexus-player-panel .pg-panel-heading { border-bottom: 1px solid var(--nexus-border-subtle); padding-bottom: 12px; margin-bottom: 12px; }
.nexus-player-panel .pg-pin-count { border: 1px solid var(--nexus-border-subtle); border-radius: 4px; padding: 6px; }
.nexus-player-panel .pg-entry:hover { border-color: var(--nexus-border-strong); }
.nexus-player-panel .pg-entry-open strong { font: 600 16px/1.25 var(--nexus-heading-font, serif); color: var(--nexus-text-primary); }
.nexus-player-panel .pg-entry-status { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.nexus-player-panel .pg-entry-status:empty { display: none; }
.nexus-player-panel .pg-entry-status em { font: 10px/1.2 var(--nexus-body-font, sans-serif); color: var(--nexus-accent-bright); background: var(--nexus-accent-surface); border: 1px solid var(--nexus-border-subtle); padding: 3px 5px; border-radius: 3px; }

.nexus-player-panel .pg-entry-menu { position: absolute; right: 7px; top: 12px; display: grid; place-items: center; width: 26px; height: 28px; min-height: 0; padding: 0; margin: 0; border-radius: 4px; color: var(--nexus-accent-bright); border: 1px solid var(--nexus-border-subtle); }

/* GM setup uses the same portrait cards and campaign tokens as the dossiers. */
.nexus-player-setup .pg-setup-content { display: flex; flex-direction: column; gap: 14px; }
.nexus-player-setup .pg-wheel-availability { flex-shrink: 0; border-bottom: 1px solid var(--nexus-border-subtle); padding-bottom: 12px; }
.nexus-player-setup .pg-wheel-availability label { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0; cursor: pointer; }
.nexus-player-setup .pg-wheel-availability input[type="checkbox"] { flex: 0 0 auto; width: 16px; height: 16px; margin: 0; padding: 0; accent-color: var(--gateway-accent); }
.nexus-player-setup .pg-wheel-availability .pg-help { margin: 6px 0 0; }
.nexus-player-setup .pg-setup-header { display: flex; align-items: end; gap: 12px; flex-shrink: 0; }
.nexus-player-setup .pg-setup-header label { flex: 1; margin: 0; color: var(--nexus-accent-bright); }
.nexus-player-setup select { height: 32px; padding: 4px 8px; border-color: var(--nexus-border-strong); }
.nexus-player-setup .pg-setup-header > button { margin: 0; height: 32px; }
.nexus-player-setup .pg-identity-section { flex-shrink: 0; }
.nexus-player-setup .pg-ship-section { border-top: 1px solid var(--nexus-border-subtle); padding-top: 12px; }
.nexus-player-setup .pg-section-toggle { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; min-height: 24px; height: auto; border: 0; background: transparent; padding: 0; text-align: left; font: 600 12px/1.3 var(--nexus-body-font); color: var(--nexus-accent-bright); }
.nexus-player-setup .pg-section-toggle > span { flex-shrink: 0; }
.nexus-player-setup .pg-section-toggle > small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--nexus-text-muted); }
.nexus-player-setup .pg-section-toggle > i:last-child { margin-left: auto; }
.nexus-player-setup .pg-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.nexus-player-setup h3 { font: 600 12px/1.3 var(--nexus-body-font); color: var(--nexus-accent-bright); border: 0; margin: 0; }
.nexus-player-setup h3 i { margin-right: 5px; }
.nexus-player-setup .pg-state-label { font-size: 10px; color: var(--nexus-text-secondary); }
.nexus-player-setup .pg-identity-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.nexus-player-setup .pg-identity-slot { min-width: 0; min-height: 132px; padding: 10px; border: 1px dashed var(--nexus-border-strong); border-radius: var(--nexus-radius-card); background: var(--nexus-surface-panel); }
.nexus-player-setup .pg-slot-label { display: block; color: var(--nexus-accent-bright); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.nexus-player-setup .pg-setup-card { display: flex; align-items: start; min-width: 0; border: 1px solid var(--nexus-border-subtle); border-radius: var(--nexus-radius-card); background: linear-gradient(130deg, var(--nexus-surface-raised), var(--nexus-surface-panel)); }
.nexus-player-setup .pg-setup-card:hover { border-color: var(--nexus-border-strong); }
.nexus-player-setup .pg-setup-record { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; height: auto; min-height: 78px; padding: 8px; border: 0; background: none; text-align: left; }
.nexus-player-setup .pg-setup-record img { flex: 0 0 48px; width: 48px; height: 56px; object-fit: contain; border: 0; border-radius: 3px; background: var(--nexus-surface-base); }
.nexus-player-setup .pg-setup-record > span { flex: 1; min-width: 0; }
.nexus-player-setup .pg-setup-record strong { display: block; overflow-wrap: anywhere; font: 600 16px/1.2 var(--nexus-heading-font); color: var(--nexus-text-primary); }
.nexus-player-setup .pg-setup-record small { display: block; font-size: 10px; color: var(--nexus-text-secondary); margin-top: 4px; line-height: 1.4; }
.nexus-player-setup .pg-setup-options { flex: 0 0 26px; width: 26px; height: 28px; margin: 8px 6px 0 0; padding: 0; border-color: var(--nexus-border-subtle); color: var(--nexus-accent-bright); }
.nexus-player-setup .pg-identity-slot .pg-setup-card { background: none; border: 0; }
.nexus-player-setup .pg-identity-slot .pg-setup-record { padding: 0; min-height: 60px; gap: 7px; }
.nexus-player-setup .pg-identity-slot .pg-setup-record img { width: 40px; height: 48px; flex-basis: 40px; }
.nexus-player-setup .pg-identity-slot .pg-setup-record strong { font-size: 15px; }
.nexus-player-setup .pg-identity-slot .pg-setup-options { margin: 0 0 0 4px; }
.nexus-player-setup .pg-drop-hint { display: block; font-size: 10px; color: var(--nexus-text-muted); margin-top: 6px; }
.nexus-player-setup .pg-drop-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 82px; text-align: center; color: var(--nexus-text-secondary); padding: 8px; }
.nexus-player-setup .pg-drop-empty > i { color: var(--nexus-accent-bright); font-size: 22px; }
.nexus-player-setup .pg-drop-empty strong { font-size: 12px; font-weight: 500; }
.nexus-player-setup .pg-drop-empty small { font-size: 10px; color: var(--nexus-text-muted); }
.nexus-player-setup .pg-identity-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; margin-top: 8px; }
.nexus-player-setup .pg-identity-footer > .pg-primary-action { margin-left: auto; }
.nexus-player-setup .pg-help { margin: 0; }
.nexus-player-setup .pg-primary-action { border-color: var(--nexus-border-strong); background: var(--nexus-accent-surface); }
.nexus-player-setup .pg-assignment-section { display: flex; flex-direction: column; flex: 1 0 auto; min-height: 220px; border-top: 1px solid var(--nexus-border-subtle); padding-top: 12px; }
.nexus-player-setup .pg-assigned { display: flex; flex-direction: column; flex: 1 0 auto; min-height: 100px; gap: 7px; margin: 10px 0 6px; }
.nexus-player-setup .pg-assigned > * { flex-shrink: 0; }
.nexus-player-setup .pg-access-label { display: inline-block; font: 10px/1.2 var(--nexus-body-font); color: var(--nexus-accent-bright); background: var(--nexus-accent-surface); border: 1px solid var(--nexus-border-subtle); padding: 3px 5px; border-radius: 3px; margin-top: 5px; }
.nexus-player-setup .pg-assignment-drop-hint { border: 1px dashed var(--nexus-border-subtle); padding: 8px; text-align: center; color: var(--nexus-text-muted); font-size: 11px; border-radius: var(--nexus-radius-card); }
.nexus-player-setup [data-drop-target].accepting-drop { background: var(--nexus-accent-surface); outline: 2px solid var(--nexus-accent-primary); outline-offset: 2px; }
.nexus-player-setup button:focus-visible, .nexus-player-setup input:focus-visible, .nexus-player-setup select:focus-visible { outline: 2px solid var(--nexus-accent-primary); outline-offset: 2px; }
.nexus-player-setup .pg-message { flex-shrink: 0; margin: 0; color: var(--nexus-text-primary); background: var(--nexus-accent-surface); }

.nexus-player-setup .pg-identity-footer > button { flex: 0 0 auto; width: auto; }
