/* Gems (13.1): the bag, the Gem Chest, a pal's gem, the event's lucky lantern. Uses the 13.0 panel
   tokens (glow.css) so it follows light and dark mode. */
.gem-icon{image-rendering:pixelated;image-rendering:crisp-edges;flex:none;display:block}
.gem-dialog{width:min(420px,calc(100vw - 24px))}
.gem-dialog .panel-header{padding-bottom:4px}
.gem-found{display:flex;align-items:center;gap:14px;margin:8px 18px 4px;padding:14px;border-radius:16px;
  background:var(--c-soft,rgba(121,200,255,.1));border:1px solid var(--c-soft-edge,rgba(121,200,255,.2))}
.gem-found[hidden]{display:none}
.gem-found-icon{width:66px;height:66px;animation:gem-pop .5s var(--spring,cubic-bezier(.2,1.55,.45,1)) both}
.gem-found .micro{margin:0 0 2px}
.gem-found-name{display:block;font-size:18px;color:var(--c-text,var(--white))}
.gem-about{margin:4px 0 0;font-size:12.5px;line-height:1.4;color:var(--c-text2,var(--muted))}
@keyframes gem-pop{from{transform:scale(.4) rotate(-12deg);opacity:0}to{transform:none;opacity:1}}
@media (prefers-reduced-motion:reduce){.gem-found-icon{animation:none}}
.gem-bag{display:flex;flex-direction:column;gap:10px;padding:8px 18px 4px}
.gem-row-name{margin:0 0 6px;font-size:12px;font-weight:600;color:var(--c-text2,var(--muted))}
.gem-cells{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
.gem-cell{display:flex;flex-direction:column;align-items:center;gap:2px;padding:9px 4px 6px;border-radius:12px;min-width:0;
  background:var(--c-tile,rgba(255,255,255,.06));border:1px solid var(--c-tile-edge,rgba(255,255,255,.1));text-align:center}
.gem-cell b{font-size:12.5px;color:var(--c-text,var(--white))}
.gem-cell span{font-size:11px;color:var(--c-text2,var(--muted))}
.gem-icon.is-flawless{animation:gem-twinkle 2.6s ease-in-out infinite}
@keyframes gem-twinkle{0%,100%{filter:drop-shadow(0 0 0 rgba(255,214,110,0))}50%{filter:drop-shadow(0 0 4px rgba(255,214,110,.75)) brightness(1.12)}}
@media (prefers-reduced-motion:reduce){.gem-icon.is-flawless{animation:none}}
.gem-cell.is-empty .gem-icon{opacity:.28;filter:grayscale(.7);animation:none}
.gem-cell.is-new{box-shadow:0 0 0 2px var(--c-accent-text,#8fd2ff) inset}
.gem-combine{font-size:11px;min-height:26px;padding:2px 6px}
.gem-combine:disabled{opacity:.4}
.gem-howto{margin:6px 18px 16px}
.gem-howto dl{grid-template-columns:1fr;gap:2px}
.gem-howto dd{margin:0 0 8px}
.gem-tier .chest-tier-icon{image-rendering:pixelated}
/* a pal's gem, on its page */
.detail-gem{margin:10px 0 4px;padding:12px;border-radius:14px;background:var(--c-tile,rgba(255,255,255,.06));border:1px solid var(--c-tile-edge,rgba(255,255,255,.1));text-align:left}
.detail-gem .micro{margin:0 0 6px}
.gem-now{display:flex;align-items:center;gap:10px}
.gem-now b{display:block;font-size:14px;color:var(--c-text,var(--white))}
.gem-effect,.gem-none{display:block;margin:2px 0 0;font-size:12.5px;line-height:1.4;color:var(--c-text2,var(--muted))}
.gem-actions{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;margin-top:10px}
.gem-actions .secondary-button{min-height:36px;padding:6px 14px}
.gem-pick{display:flex;flex-direction:column;gap:6px;margin-top:10px}
.gem-option{display:flex;align-items:center;gap:10px;width:100%;padding:8px 10px;border-radius:12px;text-align:left;cursor:pointer;
  background:var(--c-chip,rgba(255,255,255,.06));border:1px solid var(--c-chip-edge,rgba(255,255,255,.12));color:inherit;font:inherit}
.gem-option:hover,.gem-option:focus-visible{border-color:var(--c-accent-text,#8fd2ff)}
.gem-option:focus-visible{outline:2px solid var(--c-accent-text,#8fd2ff);outline-offset:2px}
.gem-option-text b{display:block;font-size:13px;color:var(--c-text,var(--white))}
.gem-option-text span{display:block;font-size:12px;line-height:1.35;color:var(--c-text2,var(--muted))}
.gem-option.is-attuned .gem-option-text b::after{content:' · same class';font-weight:500;color:var(--c-accent-text,#8fd2ff)}
/* the little gem mark next to a level on lineup cards */
.gem-mark{display:inline-block;vertical-align:-3px;margin-left:3px}

/* the ✕ on a panel stays tappable over a long title pill (this dialog, and a few older ones) */
html dialog .panel-header .close-dialog{position:relative;z-index:2}

/* 13.2: mega bosses on the ladder map, every hundredth stage */
.ladder-node.is-mega{width:78px;height:78px;border-width:3px;border-color:#ff6fd8;box-shadow:0 0 0 3px rgba(255,111,216,.25),0 0 22px rgba(255,111,216,.55)}
.ladder-node.is-mega canvas{width:52px;height:52px}
.ladder-mega{position:absolute;left:50%;top:-13px;transform:translateX(-50%);font-size:9px;letter-spacing:.14em;font-weight:700;color:#fff;background:linear-gradient(90deg,#ff6fd8,#8f6bff);border-radius:6px;padding:1px 6px;white-space:nowrap}

/* 13.2: leaderboards */
.ranks-dialog{width:min(440px,calc(100vw - 24px))}
.ranks-tabs{display:flex;flex-wrap:wrap;gap:4px;padding:4px;margin:4px 16px 8px;border-radius:14px;background:var(--c-chip,rgba(255,255,255,.06));scrollbar-width:none}
.ranks-tabs::-webkit-scrollbar{display:none}
.ranks-tab{flex:1 1 auto;min-height:36px;padding:4px 7px;border:0;border-radius:10px;background:transparent;color:var(--c-text2,var(--muted));font:inherit;font-size:12.5px;cursor:pointer;white-space:nowrap}
.ranks-tab.is-on{background:var(--c-chip-on,#fff);color:var(--c-chip-on-ink,#14244a);font-weight:600}
.ranks-tab:focus-visible{outline:2px solid var(--c-accent-text,#8fd2ff);outline-offset:2px}
.ranks-body{padding:0 16px 16px}
.ranks-heading{margin:4px 0 8px;font-size:13px;color:var(--c-text2,var(--muted))}
.ranks-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:5px}
.ranks-row{display:grid;grid-template-columns:26px 40px 1fr auto;align-items:center;gap:8px;padding:6px 10px;border-radius:12px;
  background:var(--c-tile,rgba(255,255,255,.06));border:1px solid var(--c-tile-edge,rgba(255,255,255,.1))}
.ranks-rank{font-weight:700;text-align:center;font-variant-numeric:tabular-nums;color:var(--c-text2,var(--muted))}
.ranks-pal{width:40px;height:40px;image-rendering:pixelated}
.ranks-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--c-text,var(--white))}
.ranks-value{font-size:12.5px;font-variant-numeric:tabular-nums;color:var(--c-text,var(--white));white-space:nowrap}
.ranks-row.is-top-1 .ranks-rank{color:#f5b829}
.ranks-row.is-top-2 .ranks-rank{color:#b9c6d6}
.ranks-row.is-top-3 .ranks-rank{color:#d9895a}
.ranks-row.is-top-1{border-color:rgba(245,184,41,.55)}
.ranks-row.is-me{box-shadow:0 0 0 2px var(--c-accent-text,#8fd2ff) inset}
.ranks-foot{margin:10px 0 2px;font-size:13px;font-weight:600;color:var(--c-text,var(--white))}
.ranks-note{margin:2px 0 0;font-size:11.5px;color:var(--c-text3,var(--muted))}
.friends-ranks{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 12px;margin:12px 0}
.friends-ranks .friends-heading{margin:0}
.friends-ranks .friends-help{margin:2px 0 0}

html dialog .ranks-tab{letter-spacing:0;padding:4px 8px;font-size:12px}
