/* The personal header keeps the avatar, five seals and XP on one compact grid.
   The unchanged shell remains responsible for safe areas and navigation. */
#commander-table #ct-lobby .op-profile-overview #ct-primary-summary:has(>.op-profile-levels){grid-template-columns:82px minmax(0,1fr);grid-template-rows:minmax(34px,auto) 53px 5px auto;align-items:stretch;column-gap:12px;row-gap:0;min-height:0;padding:16px 14px}
#commander-table #ct-lobby .op-profile-overview #ct-primary-summary:has(>.op-profile-levels)>.ct-avatar{grid-column:1;grid-row:1/4;align-self:end;width:82px;height:82px;padding:5px}
#commander-table #ct-lobby .op-profile-overview #ct-primary-summary:has(>.op-profile-levels)>.op-profile-identity{grid-column:2;grid-row:1;align-self:center;display:flex;align-items:baseline;gap:4px;min-width:0;padding-right:26px}
#commander-table #ct-lobby .op-profile-overview #ct-primary-summary:has(>.op-profile-levels) h1{min-width:0;flex:0 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:23px;font-weight:600;line-height:1.2}
#commander-table #ct-lobby .op-profile-overview #ct-primary-summary:has(>.op-profile-levels) .op-profile-tag{flex:none;margin:0;font-size:12px;line-height:1.3;white-space:nowrap}
#commander-table #ct-lobby .op-profile-levels{display:contents}
#commander-table #ct-lobby button.op-profile-level-button{position:relative;display:block;grid-column:1;grid-row:1/4;align-self:end;box-sizing:border-box;width:82px;height:82px;min-width:44px;min-height:44px;margin:0;padding:0;background:none!important;background-image:none!important;border:0!important;border-radius:50%;box-shadow:none!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;color:#f1f2fa;font:inherit;cursor:pointer;z-index:1}
#commander-table #ct-lobby .op-profile-level-label{position:absolute;right:-4px;bottom:-3px;display:flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:54px;min-height:28px;padding:4px 8px;border:2px solid #151925;border-radius:14px;background:#e5c84a;color:#232017;white-space:nowrap}
#commander-table #ct-lobby .op-profile-level-label strong{font-size:14px;font-weight:700;line-height:1}
#commander-table #ct-lobby .op-profile-level-counter{display:block;grid-column:2;grid-row:4;min-width:0;margin-top:6px;text-align:right;font-size:11px;line-height:1.45;color:#bdc3d4;font-variant-numeric:tabular-nums;white-space:nowrap}
#commander-table #ct-lobby .op-profile-level-track{display:block;grid-column:2;grid-row:3;align-self:end;min-width:0;width:100%;height:5px;margin:0;overflow:hidden;border-radius:6px;background:#383d4c}
#commander-table #ct-lobby .op-profile-level-track>span{display:block;height:100%;border-radius:6px;background:#e5c84a}
#commander-table #ct-lobby button.op-profile-token-button{grid-column:2;grid-row:2;align-self:start;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));justify-items:center;align-items:start;gap:8px;box-sizing:border-box;width:100%;min-width:0;height:53px;min-height:44px;margin:0;padding:3px 0 0;background:none!important;background-image:none!important;border:0!important;border-radius:7px;box-shadow:none!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;text-align:left;color:inherit;font:inherit;cursor:pointer}
@media(max-width:370px){#commander-table #ct-lobby .op-profile-overview #ct-primary-summary:has(>.op-profile-levels){padding:14px 10px}#commander-table #ct-lobby .op-profile-overview #ct-primary-summary:has(>.op-profile-levels) h1{font-size:22px}}
@media(max-width:340px){#commander-table #ct-lobby .op-profile-overview #ct-primary-summary:has(>.op-profile-levels) h1{font-size:20px}#commander-table #ct-lobby .op-profile-overview #ct-primary-summary:has(>.op-profile-levels) .op-profile-tag{font-size:11px}}
dialog.op-dialog.op-level-dialog{--op-level-safe-top:env(safe-area-inset-top,0px);--op-level-safe-left:env(safe-area-inset-left,0px);--op-level-safe-width:calc(100vw - env(safe-area-inset-left,0px) - env(safe-area-inset-right,0px));--op-level-safe-height:calc(100dvh - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px));position:fixed;inset:calc(var(--op-level-safe-top) + 16px) calc(100vw - var(--op-level-safe-left) - var(--op-level-safe-width) + 16px) calc(100dvh - var(--op-level-safe-top) - var(--op-level-safe-height) + 16px) calc(var(--op-level-safe-left) + 16px);box-sizing:border-box;width:min(480px,calc(var(--op-level-safe-width) - 32px));max-width:calc(var(--op-level-safe-width) - 32px);height:fit-content;max-height:calc(var(--op-level-safe-height) - 32px);min-width:0;min-height:0;margin:auto;padding:0;background:#151925;color:#f1f2fa;border:1px solid #7883a866;border-radius:22px;box-shadow:none;overflow:hidden;text-align:left}
dialog.op-dialog.op-level-dialog[open]{display:flex;flex-direction:column}
dialog.op-level-dialog::backdrop{background:#000b;backdrop-filter:none;-webkit-backdrop-filter:none}
.op-level-header{flex:none;padding:20px 20px 14px}
.op-level-header h2{margin:0;font-size:25px;line-height:1.2;overflow-wrap:anywhere}
.op-level-body{flex:1;min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain;padding:0 20px 6px;scrollbar-gutter:stable}
.op-level-footer{display:flex;flex-direction:column;gap:8px;flex:none;padding:12px 20px 18px}
.op-level-footer button{box-sizing:border-box;width:100%;min-width:44px;min-height:44px;padding:11px 14px;color:#e5c84a;background:#29291f;border:1px solid #8d7d3d;border-radius:12px}
.op-level-footer button[hidden]{display:none}
.op-level-footer button[data-level-retry]{background:#202532;color:#d9ddec;border-color:#596275}
.op-level-hero{background:#202532;border:1px solid #434b5c;border-radius:16px;padding:17px;min-width:0}
.op-level-eyebrow{margin:0;color:#bdc3d4;font-size:11px;line-height:16px;letter-spacing:.04em;text-transform:uppercase}
.op-level-hero h3{font-size:34px;line-height:1.15;margin:6px 0 10px;font-weight:650;overflow-wrap:anywhere}
.op-level-hero-line{display:flex;justify-content:space-between;align-items:center;gap:10px;font-size:12px;line-height:18px;color:#bdc3d4;font-variant-numeric:tabular-nums}
.op-level-hero-track{height:7px;border-radius:8px;overflow:hidden;background:#3b4151;margin:13px 0 10px}
.op-level-hero-track>span{display:block;height:100%;border-radius:8px;background:#e5c84a}
.op-level-copy,.op-level-empty{font-size:12px;line-height:1.55;color:#bdc3d4;margin:0}
.op-level-cache-note{font-size:11px;line-height:1.5;color:#bdc3d4;margin:9px 0 0}
.op-level-empty{margin-top:12px}
.op-level-section-title{font-size:19px;line-height:1.3;margin:22px 0 6px;font-weight:650}
.op-level-rule{display:flex;gap:10px;border-bottom:1px solid #363d4c;padding:13px 0;min-width:0}
.op-level-rule>svg{flex:none;width:19px;height:19px;color:#e5c84a;stroke-width:1.6;margin-top:2px}
.op-level-rule>div{min-width:0}
.op-level-rule h3{font-size:14px;line-height:1.4;font-weight:600;margin:0;overflow-wrap:anywhere}
.op-level-rule p{font-size:12px;line-height:1.55;color:#bdc3d4;margin:4px 0 0;overflow-wrap:anywhere}
.op-level-rates{display:grid;gap:0;margin:0}
.op-level-rates>div{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:12px;border-bottom:1px solid #363d4c;padding:12px 0}
.op-level-rates dt{font-size:14px;line-height:1.4;font-weight:600;overflow-wrap:anywhere}
.op-level-rates dd{display:flex;flex-direction:column;gap:2px;margin:0;text-align:right;white-space:nowrap;font-size:13px;line-height:1.5;font-variant-numeric:tabular-nums}
.op-level-win-rate{color:#e5c84a}
.op-level-rate-note{margin:9px 0 0;font-size:11px;line-height:1.5;color:#bdc3d4}
.op-level-proof{margin:0;background:#202532;border:1px solid #434b5c;border-radius:14px;padding:0 12px}
.op-level-proof>div{display:flex;justify-content:space-between;gap:12px;padding:12px 0;font-size:13px;line-height:1.45}
.op-level-proof>div+div{border-top:1px solid #434b5c}
.op-level-proof dt{min-width:0;overflow-wrap:anywhere}
.op-level-proof dt small{display:block;color:#bdc3d4;font-size:11px;line-height:1.5;margin-top:3px}
.op-level-proof dd{margin:0;white-space:nowrap;font-variant-numeric:tabular-nums}
.op-level-total dd{color:#e5c84a}
.op-level-breakdown>.op-level-copy{margin-top:12px}
@media(max-width:360px),(max-height:440px){.op-level-header{padding:16px 16px 12px}.op-level-header h2{font-size:22px}.op-level-body{padding-inline:16px}.op-level-footer{padding:10px 16px 14px}.op-level-hero{padding:14px}}
/* Shared metallic seals from the approved profile design. */
.op-profile-token{--op-token-surface:#151925;box-sizing:border-box}
    .op-profile-token{--op-token-color:#e7cb4c;position:relative;display:grid;place-items:center;width:40px;height:40px;flex:none;border:0;border-radius:50%;background:conic-gradient(from 135deg,color-mix(in srgb,var(--op-token-color) 34%,#171923),var(--op-token-color) 15%,color-mix(in srgb,var(--op-token-color) 40%,#fff) 29%,var(--op-token-color) 43%,color-mix(in srgb,var(--op-token-color) 32%,#151721) 59%,var(--op-token-color) 78%,color-mix(in srgb,var(--op-token-color) 28%,#181a23));color:var(--op-token-color);box-shadow:0 2px 0 color-mix(in srgb,var(--op-token-color) 25%,#11131d),0 4px 4px #0007,inset 0 1px 1px #fff6;isolation:isolate}
    .op-profile-token::before{content:"";position:absolute;inset:2px;border-radius:inherit;background:radial-gradient(ellipse at 30% 15%,color-mix(in srgb,var(--op-token-color) 30%,#333746),transparent 62%),linear-gradient(145deg,#252937,#10121c);box-shadow:inset 0 1px 2px #000b,inset 0 -1px 1px color-mix(in srgb,var(--op-token-color) 65%,transparent);pointer-events:none}
    .op-profile-token::after{content:"";position:absolute;inset:4px;border:1px solid color-mix(in srgb,var(--op-token-color) 22%,transparent);border-radius:inherit;background:linear-gradient(145deg,#fff1,transparent 48%);pointer-events:none}
    .op-profile-token-button>.op-profile-token{width:min(38px,100%);height:auto;aspect-ratio:1}
    .op-profile-token[data-family="chaos"]{--op-token-color:#b699f4}
    .op-profile-token[data-family="tactics"]{--op-token-color:#81baf0}
    .op-profile-token[data-family="curse"]{--op-token-color:#e995ac}
    .op-profile-token[data-family="comeback"]{--op-token-color:#edb17c}
    .op-profile-token-count{position:absolute;z-index:2;right:-3px;bottom:-3px;display:flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:21px;min-height:21px;padding:1.5px 3px;border:2px solid var(--op-token-surface);border-radius:11px;background:var(--op-token-color);color:#1b2028;font-size:12px;line-height:1;font-weight:700;font-variant-numeric:tabular-nums}
    .op-profile-token-button .op-profile-token-count{right:-3px;bottom:-3px;min-width:18px;min-height:18px;padding-inline:2px;font-size:11px}
    .op-profile-token[data-owned="false"]{--op-token-color:#8992a2;color:#8992a2}
    .op-profile-token[data-owned="false"] .op-profile-token-count{background:#3c4452;color:#b2bac8}
    .op-profile-token-details-list{margin:0;display:grid;gap:0}
    .op-profile-token-detail{display:grid;grid-template-columns:52px minmax(0,1fr) auto;gap:11px;align-items:center;padding:10px 0;border-top:1px solid #363d4c}
    .op-profile-token-detail .op-profile-token{width:50px;height:50px}
    .op-profile-token-detail dt{font-size:14px}
    .op-profile-token-detail dd{margin:0;font-size:14px;font-variant-numeric:tabular-nums}
    .op-profile-token-detail small{display:block;font-size:11px;color:#bdc3d4;margin-top:2px}

/*
 * Orbunity: five bespoke CSS emblems, independent of the coin rim and counter.
 * Each seal contains one .op-profile-token-sigil with three native facets.
 * The .op-profile-token parent keeps data-family="start|chaos|tactics|curse|comeback"
 * and --op-token-color. No SVG, stock icon, image, text glyph or blur is used.
 * Silhouettes use a 22px canvas; all details scale with that canvas.
 */
.op-profile-token-sigil {
  --op-token-sigil-light: color-mix(in srgb, var(--op-token-color, #e7cb4c) 48%, #fff6d4);
  --op-token-sigil-mid: var(--op-token-color, #e7cb4c);
  --op-token-sigil-dark: color-mix(in srgb, var(--op-token-color, #e7cb4c) 58%, #292018);
  --op-token-sigil-metal: linear-gradient(135deg,
    var(--op-token-sigil-light) 0%, var(--op-token-sigil-mid) 43%,
    var(--op-token-sigil-dark) 78%, var(--op-token-sigil-mid) 100%);
  position: relative;
  display: block;
  width: 60%;
  height: 60%;
  flex: none;
  pointer-events: none;
  isolation: isolate;
  filter: drop-shadow(0 -0.45px 0 rgb(255 246 212 / .45))
    drop-shadow(0.65px 1.1px 0 rgb(13 13 20 / .9));
}
.op-profile-token-sigil > span {
  position: absolute;
  display: block;
  inset: 0;
  background: var(--op-token-sigil-metal);
  transform-origin: 50% 50%;
}

/* AUFTAKT: an open ascendant seal; two staggered shards break out of a low arc. */
[data-family="start"] .op-profile-token-sigil { transform:none; }
[data-family="start"] .op-profile-token-sigil > span {
  inset:0;width:auto;height:auto;transform:none;clip-path:none;border-radius:0;
  background:var(--op-token-sigil-metal);
}
[data-family="start"] .op-profile-token-sigil > span:nth-child(1) {
  z-index:1;
  clip-path:polygon(42% 7%,45% 33%,41% 51%,51% 68%,41% 86%,26% 64%,24% 46%,31% 24%);
  background:linear-gradient(100deg,var(--op-token-sigil-dark),var(--op-token-sigil-light) 35%,var(--op-token-sigil-mid) 65%,var(--op-token-sigil-dark));
}
[data-family="start"] .op-profile-token-sigil > span:nth-child(2) {
  clip-path:polygon(66% 0%,68% 25%,58% 47%,57% 62%,47% 76%,41% 64%,44% 45%,55% 27%);
  background:linear-gradient(105deg,var(--op-token-sigil-light),var(--op-token-sigil-mid) 55%,var(--op-token-sigil-dark));
}
[data-family="start"] .op-profile-token-sigil > span:nth-child(3) {
  clip-path:polygon(9% 52%,22% 70%,39% 85%,55% 90%,74% 74%,88% 51%,83% 79%,63% 98%,35% 98%,14% 80%);
  background:linear-gradient(130deg,var(--op-token-sigil-light),var(--op-token-sigil-mid) 48%,var(--op-token-sigil-dark));
}

/* CHAOS: a black centre with two broad, tapered accretion arms.
 * Native gradients/masks only; scales with the existing 22px/30px sigil.
 * The outer medallion, token colour, counter and layout stay untouched.
 */
[data-family="chaos"] .op-profile-token-sigil > span {
  inset: 0;
  width: auto;
  height: auto;
  z-index: auto;
  transform: none;
  clip-path: none;
  border: 0;
  border-radius: 0;
  background: none;
  -webkit-mask: none;
  mask: none;
}
[data-family="chaos"] .op-profile-token-sigil > span:nth-child(1),
[data-family="chaos"] .op-profile-token-sigil > span:nth-child(2) {
  border-radius: 50%;
  /* An offset inner cut makes each arm broad at its shoulder and narrow
     toward its end; the black centre remains open between the two arms. */
  -webkit-mask: radial-gradient(ellipse at 54% 58%,
    transparent 0% 40%, #000 43% 80%, transparent 83%);
  mask: radial-gradient(ellipse at 54% 58%,
    transparent 0% 40%, #000 43% 80%, transparent 83%);
}
[data-family="chaos"] .op-profile-token-sigil > span:nth-child(1) {
  inset: 5% -2% 20%;
  background: conic-gradient(from 28deg,
    transparent 0deg 12deg,
    var(--op-token-sigil-light) 19deg 56deg,
    var(--op-token-sigil-mid) 104deg,
    var(--op-token-sigil-dark) 174deg,
    transparent 222deg 360deg);
  transform: rotate(-28deg);
}
[data-family="chaos"] .op-profile-token-sigil > span:nth-child(2) {
  inset: 20% -2% 5%;
  background: conic-gradient(from 28deg,
    transparent 0deg 12deg,
    var(--op-token-sigil-mid) 19deg 56deg,
    var(--op-token-sigil-dark) 123deg,
    var(--op-token-sigil-light) 174deg,
    transparent 222deg 360deg);
  transform: rotate(152deg);
}
[data-family="chaos"] .op-profile-token-sigil > span:nth-child(3) {
  z-index: 1;
  inset: 31%;
  border-radius: 50%;
  background: #010104;
  box-shadow: .6px .9px 0 var(--op-token-sigil-dark);
}
[data-family="chaos"] .op-profile-token-sigil > span:nth-child(3)::before {
  content: "";
  position: absolute;
  inset: -.7px;
  border: .8px solid transparent;
  border-top-color: var(--op-token-sigil-light);
  border-left-color: var(--op-token-sigil-mid);
  border-radius: 50%;
  transform: rotate(24deg);
}

/* TAKTIK: two folded angular hooks interlock around a deliberate dark diamond. */
[data-family="tactics"] .op-profile-token-sigil > span {
  inset:0;width:auto;height:auto;display:block;transform:none;clip-path:none;border-radius:0;
  background:var(--op-token-sigil-metal);
}
[data-family="tactics"] .op-profile-token-sigil > span:nth-child(1) {
  clip-path:polygon(evenodd,35% 3%,72% 40%,35% 77%,0% 40%,35% 3%,35% 24%,17% 40%,35% 57%,53% 40%,35% 24%);
  background:linear-gradient(135deg,var(--op-token-sigil-light),var(--op-token-sigil-mid) 47%,var(--op-token-sigil-dark));
}
[data-family="tactics"] .op-profile-token-sigil > span:nth-child(2) {
  clip-path:polygon(evenodd,65% 23%,100% 60%,65% 97%,28% 60%,65% 23%,65% 43%,47% 60%,65% 76%,83% 60%,65% 43%);
  background:linear-gradient(140deg,var(--op-token-sigil-light),var(--op-token-sigil-mid) 40%,var(--op-token-sigil-dark) 87%);
}
[data-family="tactics"] .op-profile-token-sigil > span:nth-child(3) {
  clip-path:polygon(49% 41%,62% 54%,51% 65%,38% 52%);
  background:linear-gradient(130deg,var(--op-token-sigil-light),var(--op-token-sigil-mid) 72%,var(--op-token-sigil-dark));
}

/* FLUCH: two hooked horns form a hollow crescent; a chained diamond hangs below.
 * A broad empty centre and long hanging point give it its own silhouette.
 */
[data-family="curse"] .op-profile-token-sigil > span:nth-child(1),
[data-family="curse"] .op-profile-token-sigil > span:nth-child(2) {
  clip-path: polygon(7% 3%, 27% 16%, 31% 35%, 43% 46%,
    50% 48%, 50% 64%, 27% 60%, 14% 49%, 9% 30%);
}
[data-family="curse"] .op-profile-token-sigil > span:nth-child(2) {
  transform: scaleX(-1);
}
[data-family="curse"] .op-profile-token-sigil > span:nth-child(3) {
  clip-path: polygon(47% 60%, 53% 60%, 53% 72%, 62% 83%,
    50% 100%, 38% 83%, 47% 72%);
  background: linear-gradient(90deg,
    var(--op-token-sigil-light) 0% 50%, var(--op-token-sigil-dark) 51% 100%);
}

/* COMEBACK: an asymmetrical rising flame between two swept, feathered wings.
 * The wide upswept wings and pointed tail read as an abstract phoenix.
 */
[data-family="comeback"] .op-profile-token-sigil > span:nth-child(1) {
  z-index: 1;
  clip-path: polygon(58% 0%, 56% 23%, 70% 43%, 65% 66%,
    50% 100%, 35% 66%, 29% 48%, 45% 22%, 46% 7%,
    51% 29%, 43% 49%, 50% 68%, 58% 48%, 49% 30%);
  background: linear-gradient(90deg,
    var(--op-token-sigil-light) 0% 48%, var(--op-token-sigil-mid) 49% 67%,
    var(--op-token-sigil-dark) 100%);
}
[data-family="comeback"] .op-profile-token-sigil > span:nth-child(2),
[data-family="comeback"] .op-profile-token-sigil > span:nth-child(3) {
  clip-path: polygon(1% 23%, 22% 35%, 39% 55%, 42% 74%,
    24% 67%, 10% 52%, 23% 57%, 12% 40%, 28% 49%);
}
[data-family="comeback"] .op-profile-token-sigil > span:nth-child(3) {
  transform: scaleX(-1);
}

/* Missing tokens keep their recognisable shape and inherit the parent's grey
 * --op-token-color. No ownership/count/layout rule is changed here.
 */

@media(forced-colors:active){#commander-table #ct-lobby .op-profile-level-track,.op-level-hero-track{background:Canvas;border:1px solid CanvasText}#commander-table #ct-lobby .op-profile-level-track>span,.op-level-hero-track>span{background:Highlight}#commander-table #ct-lobby .op-profile-level-label{background:Highlight;color:HighlightText;border-color:Canvas}.op-level-hero,.op-level-proof{background:Canvas;color:CanvasText;border-color:CanvasText}.op-profile-token{--op-token-color:CanvasText!important;--op-token-surface:Canvas;background:Canvas;box-shadow:none;border:1px solid CanvasText}.op-profile-token::before,.op-profile-token::after{background:none;box-shadow:none;border-color:CanvasText}.op-profile-token-sigil{--op-token-sigil-light:CanvasText;--op-token-sigil-mid:CanvasText;--op-token-sigil-dark:CanvasText;filter:none}.op-profile-token-count{background:Canvas!important;color:CanvasText!important;border-color:Canvas}}
