/* ================================
   TOKENS & GLOBALS
==================================*/
:root {
  --bg: #0b0f14;
  --panel: #121821;
  --muted: #9aa6bf;
  --accent: #ffb703;
  --accent-2: #00d4ff;

  --soft-shadow: 0 10px 30px rgba(0,0,0,.35), 0 2px 10px rgba(0,0,0,.25);

  /* Layout sizing */
  --attrRows: 3;        /* visible rows in Attributes */
  --cardH: 220px;        /* base card height */
  --statsH: min(80dvh, 760px); /* replaces svh */
}

/* Resets / base */
* { box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; } /* lock page scroll; panels handle it */

body {
  margin: 0;
  background: radial-gradient(1200px 1200px at 18% 8%, #172231 0%, var(--bg) 55%) fixed;
  color: #e6eefb;
  font: 16px/1.45 system-ui, Segoe UI, Roboto, Helvetica, Arial;
}

/* ================================
   LAYOUT
==================================*/
.app {
  height: 100svh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: min(360px, 26vw) 1fr;
  gap: 14px;
  padding: 14px;
}



.btnRow{
	  display: flex;
  justify-content: center;
  align-items: center;
}

.stage {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 20px;
  box-shadow: var(--soft-shadow);
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0;
  overflow: visible;
  height: 100%;
}

.stageBody {
  display: grid;
  grid-template-columns: minmax(360px, .8fr) minmax(0, 1.2fr);
  gap: 16px;
  padding: 12px;
  min-height: 0;
  height: 100%;
}

/* Columns */
.spinCol,
.infoCol { min-width: 0; min-height: 0; overflow: visible; }

.spinCol {
  display: grid;
  row-gap: 6px;                       /* smaller gap between rows */
  
}

.infoCol {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
  overflow: auto;
  height: 100%;
}

/* ================================
   DOCK (sidebar) + HAMBURGER
==================================*/
.dock {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  padding: 12px;
  box-shadow: var(--soft-shadow);
  display: grid;
  grid-template-rows: auto auto auto auto auto 1fr;
  gap: 10px;
  min-height: 0;
  overflow: auto;
}

.dock .h { letter-spacing: .2px; display: flex; align-items: center; }
.dock .row { display: flex; flex-wrap: wrap; gap: 8px; }

.dockToggle { display: none !important; } /* legacy toggle hidden on desktop */

.hamburger {
  display: none;
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  z-index: 1100;
  width: 42px; height: 42px;
  background: transparent;
  border: transparent;
}
.hamburger span {
  position: absolute; left: 50%;
  width: 22px; height: 2px; background: #e6eefb;
  transform: translateX(-50%);
  transition: transform .2s ease, opacity .2s ease;
}
.hamburger span:nth-child(1){ top: 13px; }
.hamburger span:nth-child(2){ top: 20px; }
.hamburger span:nth-child(3){ top: 27px; }

/* Scrim */
.dock-scrim {
  position: fixed; inset: 0;
  background: rgba(6,10,16,.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
}
.dock-scrim[hidden] { display: none; }

/* ================================
   BUTTONS
==================================*/
.btn {
  cursor: pointer;
  background: linear-gradient(180deg, #1c2736, #131c29);
  color: #e6eefb;
  border: 1px solid rgba(255,255,255,.10);
  padding: .58rem .85rem;
  border-radius: 12px;

  letter-spacing: .2px;
  box-shadow: 0 6px 18px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.06);
  transition: .15s transform, .15s filter;
  white-space: nowrap;
  min-width: 0;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px) scale(.995); }

.btn.sm { padding: .48rem .65rem; font-size: .92rem; border-radius: 10px; color: #dffff2; }
.btn.sa { padding: .48rem .65rem; font-size: .92rem; border-radius: 10px; background: linear-gradient(180deg, #b3e5fc, #81d4fa); color: #003344; }
.btn.primary { background: linear-gradient(180deg, #2b3a52, #202d40); border-color: rgba(255,255,255,.16); }
.btn.success { background: linear-gradient(180deg, #2a4b3e, #1b322a); border-color: rgba(120,255,204,.35); color: #dffff2; }
.btn.danger  { background: linear-gradient(180deg, #4b2a2a, #2a1b1b); border:1px solid rgba(255,120,120,.35); color: #ffecec; }
button[disabled], .btn[disabled] { opacity: .5; cursor: not-allowed; pointer-events: none; }

/* Link-style button (used by the mobile summary toggle) */
.btn.link { 
  background: none; 
  border: 0; 
  padding: 4px 0; 
  color: var(--accent); 
  font: inherit; 
  text-decoration: underline; 
  cursor: pointer; 
}
.btn.link.sm { font-size: .9rem; }

/* ================================
   FORMS / NAME BOX
==================================*/
.nameBox { display: none; gap: 8px; flex-wrap: wrap; align-items: center; }
.nameBox input {
  flex: 1 1 100%; min-width: 0;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px; padding: .55rem .7rem; color: #fff;
}
#saveNameBtn, #sheetBtn { flex: 1 1 calc(50% - 4px); }

/* ================================
   WHEEL
==================================*/
.wheelWrap {
  position: relative;
  place-self: center;
  width: auto;              /* JS sets width explicitly */
  aspect-ratio: 1 / 1;
  contain: size layout;
  overflow: visible;
  max-width: 560px;         /* a sane desktop cap */
  margin-top: 0;
  align-self: start;
}
canvas#wheel {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block; border-radius: 50%;
  will-change: transform;
  background: radial-gradient(60% 60% at 50% 50%, rgba(255,255,255,.05), rgba(0,0,0,.15));
  transition: filter .25s ease;
}
.pointer {

  position: absolute; top: clamp(4px, 1.2vmin, 10px); left: 50%; transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 16px solid transparent; border-right: 16px solid transparent;
  border-bottom: 28px solid var(--accent);
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.5));
  z-index: 3;
}
.hub { position: absolute; inset: 0; pointer-events: none; }
.hub .dot {
  position: absolute; inset: 0; margin: auto;
  width: clamp(54px, 12%, 78px); aspect-ratio: 1 / 1; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffe9b5, #ffd064 30%, #d08a00 65%);
  border: 4px solid rgba(0,0,0,.35);
  box-shadow: inset 0 0 22px rgba(0,0,0,.45), 0 8px 30px rgba(0,0,0,.35);
}

/* ================================
   INFO / STATS
==================================*/
.sectionTitle {  letter-spacing: .2px; opacity: .9; }
.statsHeader { display: flex; align-items: center; gap: .5rem; }

.progress {
  height: 10px; background: rgba(255,255,255,.06);
  border-radius: 999px; overflow: hidden;
  border: 1px solid rgba(255,255,255,.08); flex: 1;
}
.progress .bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: inset 0 0 10px rgba(255,255,255,.35);
}

.badge {
  font-size: .78rem; color: #c8d5f0;
  background: rgba(255,255,255,.05); padding: .25rem .5rem;
  border-radius: 999px; border: 1px solid rgba(255,255,255,.08);
}

.infoBody {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px; min-height: 0;
  height: 100%;
}

/* Attributes grid scroll host */
#statsGrid {
  flex: 1 1 auto;
  height: var(--statsH);
  max-height: var(--statsH) !important;
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin; scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch; /* Smooth scroll for iOS */
}
#statsGrid::-webkit-scrollbar { width: 8px; }
#statsGrid::-webkit-scrollbar-track { background: rgba(255,255,255,.05); }
#statsGrid::-webkit-scrollbar-thumb { background: rgba(255,255,255,.25); border-radius: 8px; }



/* Default (desktop/tablet): two columns */
#statsGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}


/* RS panel */
.rs {
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 12px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 4px;
  width: 100%;
  overflow: auto;
  min-height: 120px;
  -webkit-overflow-scrolling: touch;
}
.rsList {
  display: grid;
  grid-auto-rows: minmax(32px, auto);
  gap: 6px;
  overflow: auto;
  max-height: calc(var(--statsH) - 84px);
}

.rowStat {
  display: grid; grid-template-columns: 126px 1fr 50px;
  align-items: center; gap: 8px;
}

.rowStat .name {
  display:flex; align-items:center; gap:8px; font-size:.79rem;
  color:#dbe6ff; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.rowStat .valWrap { display:flex; align-items:center; gap:6px; justify-content:flex-end; }
.rowStatDetails {
  grid-column: 1 / -1; display: none; padding: 6px 8px; margin-top: -2px;
  border-left: 2px solid rgba(255,255,255,.1);
}
.rowStat.expanded + .rowStatDetails { display: block; }
.icon {
  width: 18px; height: 18px; display: inline-grid; place-items: center;
   font-size: .98rem;
}
.barWrap { height: 12px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); border-radius: 999px; overflow: hidden; }
.bar { height: 100%; width: 0%; background: #3aaed0; transition: width .35s ease, background-color .25s ease, filter .25s ease; }
.val {  font-size: .94rem; text-align: right; }

.summary {
  background: rgba(255,255,255,.03);
  border: 1px dashed rgba(255,255,255,.12);
  border-radius: 10px;
  padding: 10px;
  display:flex; flex-wrap:wrap; gap:8px; min-height:40px;
}

.tag {
  display:flex; align-items:center; gap:6px;
  padding:.28rem .55rem; border-radius:999px;
  background: rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.08);
   font-size:.86rem;
}

.summary .tag {
   max-height: 25%;
}

/* Inline/roll headings */
.inlineTitle { display:flex; align-items:center; justify-content:center; padding: 6px 2px; flex-direction: row; gap: 6px;}

.rollTitle {
   letter-spacing:.2px;
  background: rgba(255,255,255,.08); border: 1px solid #F39C12;
  padding: .26rem .85rem; border-radius: 999px;
  text-shadow: 0 1px 0 rgba(0,0,0,.35);
}

#rollNow {
	   letter-spacing:.2px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
  padding: .26rem .85rem; border-radius: 999px;
  text-shadow: 0 1px 0 rgba(0,0,0,.35);
  display:flex; align-items:center; justify-content:center;
  max-width: 100%;
    display: inline-flex;

}




/* Impact/Chips */
.impact { font-size:.76rem; color:#a7b5d4; opacity:.9; white-space:normal; overflow-wrap:anywhere; word-break:break-word; flex:1 1 100%; }
.impactChip {  font-size:.82rem; padding:.18rem .44rem; border-radius:10px; background: rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.12); }
.impactChip.neg { opacity:.9; filter:saturate(.95); }
.impactChip { font-size: .78rem; padding: .16rem .38rem; border-radius: 9px; } /* micro variant */

/* ================================
   CARDS & RARITY
==================================*/
.grid {
  --fitScale: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 8px;
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 10px;
  position: relative;
  transform-origin: top center;
  transform: scale(var(--fitScale));
  
  width: 100%;
  max-width: 100%;
  min-width: 0; /* Important for grid containment */
  box-sizing: border-box;
}
.card {
  display:grid; grid-template-rows:auto auto; gap:6px;
  min-height: 240px; padding:8px; border-radius:12px;
  border:1px solid rgba(255,255,255,.10);
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  box-shadow: 0 6px 16px rgba(0,0,0,.22);
  transition: transform .15s ease, box-shadow .15s ease;
  overflow: hidden;
  max-height: none;
}
.card:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(0,0,0,.28); }
.card.popEpic { animation: popIn 480ms cubic-bezier(.2,.8,.2,1) both; }

.card[data-rarity] .chip { border-color: currentColor; }
.card[data-rarity="common"] {
  border-color: rgba(200,210,230,.18);
  background: linear-gradient(180deg, rgba(200,210,230,.06), rgba(200,210,230,.03));
  outline: 1px solid rgba(184,192,204,.25);
}
.card[data-rarity="uncommon"] {
  border-color: rgba(120,255,204,.25);
  background: linear-gradient(180deg, rgba(120,255,204,.12), rgba(120,255,204,.04));
  box-shadow: 0 6px 18px rgba(0,80,60,.25);
  outline: 1px solid rgba(52,211,153,.35);
  box-shadow: 0 0 18px rgba(52,211,153,.10);
}
.card[data-rarity="rare"] {
  border-color: rgba(0,212,255,.35);
  background: linear-gradient(180deg, rgba(0,212,255,.12), rgba(0,212,255,.04));
  box-shadow: 0 6px 18px rgba(0,70,120,.28);
  outline: 1px solid rgba(96,165,250,.45);
  box-shadow: 0 0 20px rgba(96,165,250,.12);
}
.card[data-rarity="epic"] {
  border-color: rgba(150,130,255,.45);
  background: linear-gradient(180deg, rgba(150,130,255,.14), rgba(150,130,255,.05));
  box-shadow: 0 8px 22px rgba(60,40,160,.32);
  outline: 1px solid rgba(192,132,252,.55);
  box-shadow: 0 0 22px rgba(192,132,252,.16);
}
.card[data-rarity="legendary"] {
  border-color: rgba(255,183,3,.55);
  background: linear-gradient(180deg, rgba(255,183,3,.16), rgba(255,183,3,.06));
  box-shadow: 0 10px 26px rgba(180,110,0,.38);
  outline: 1px solid rgba(251,191,36,.65);
  box-shadow: 0 0 24px rgba(251,191,36,.18);
}
.card[data-rarity="mythic"] {
  outline: 1px solid rgba(248,113,113,.75);
  box-shadow: 0 0 28px rgba(248,113,113,.22);
}

/* Rarity labels */
.rarity {
  font-size: .72rem;  padding: .22rem .48rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  letter-spacing: .2px;
}
.rarity.common    { color:#b8c0cc; }
.rarity.uncommon  { color:#34d399; }
.rarity.rare      { color:#60a5fa; }
.rarity.epic      { color:#c084fc; }
.rarity.legendary { color:#fbbf24; }
.rarity.mythic    { color:#f87171; }

/* Legendary FX */
.card[data-rarity="legendary"],
.card[data-rarity="mythic"] { position: relative; z-index: 2; contain: paint; }

.card[data-rarity="legendary"]::before {
  content:""; position:absolute; inset:-2px; border-radius:12px; padding:2px;
  background: conic-gradient(from 0turn, #fff8d6, #ffe089, #ffcb47, #e7a91e, #ffcb47, #ffe089, #fff8d6);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events:none;
}
.card[data-rarity="legendary"]::after {
  content:""; position:absolute; inset:-8px; border-radius:16px;
  box-shadow: 0 0 22px rgba(255,193,7,.35), 0 0 46px rgba(255,193,7,.22);
  opacity:.95; pointer-events:none; animation: glowPulse 2.2s ease-in-out infinite;
}
.card[data-rarity="legendary"] { position: relative; }
.card[data-rarity="legendary"]::after {
  content:""; position:absolute; inset:-4px; border-radius:10px;
  background: linear-gradient(100deg, rgba(255,255,255,0) 15%, rgba(255,255,255,.18) 35%, rgba(255,255,255,0) 55%) no-repeat;
  background-size: 220% 100%; mix-blend-mode: screen; pointer-events:none;
  animation: shimmerSweep 2.8s linear infinite;
}
.rarity.legendary {
  background-image: linear-gradient(90deg, rgba(255,255,255,.9), #fbbf24, rgba(255,255,255,.9));
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmerSweep 2.6s linear infinite;
}

/* Mythic FX */
.card[data-rarity="mythic"]::before {
  content:""; position:absolute; inset:-2px; border-radius:12px; padding:2px;
  background: conic-gradient(from .25turn, #ff4d4d, #ff8a00, #ffd166, #ff8a00, #ff4d4d);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events:none;
}
.card[data-rarity="mythic"]::after {
  content:""; position:absolute; inset:0; border-radius:12px;
  background:
    radial-gradient(60% 60% at 50% 60%, rgba(255,120,80,.25), rgba(255,120,80,0) 70%) no-repeat,
    linear-gradient(120deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.20) 45%, rgba(255,255,255,0) 60%) no-repeat;
  background-size: 100% 100%, 220% 100%;
  background-position: center, 0 0;
  mix-blend-mode: screen; pointer-events:none;
  animation: shimmerSweep 2.2s ease-in-out infinite, heatRipple 1.6s ease-in-out infinite;
}
.card[data-rarity="mythic"] .cardBody { position: relative; }
.card[data-rarity="mythic"] .cardBody::before {
  content:""; position:absolute; left:-6px; right:-6px; bottom:-6px; height:38%;
  border-bottom-left-radius:12px; border-bottom-right-radius:12px; pointer-events:none;
  background:
    radial-gradient(120px 60px at 20% 100%, rgba(255,120,80,.55), transparent 60%),
    radial-gradient(140px 70px at 60% 100%, rgba(255,180,60,.45), transparent 60%),
    radial-gradient(100px 50px at 90% 100%, rgba(255,90,90,.35), transparent 60%);
  filter: blur(.4px); animation: flamePulse 1.8s ease-in-out infinite;
}

/* === Mythic 3D Treatment (tilt, bevel, cast shadow, parallax) === */

/* Give the card real stage presence */
.card[data-rarity="mythic"] {
  position: relative;
  transform-style: preserve-3d;
  transform: perspective(900px) rotateX(4deg) rotateY(-6deg) translateZ(0);
  box-shadow:
    0 18px 28px rgba(0,0,0,.45),
    0 8px 10px rgba(0,0,0,.35);
  transition: transform .25s ease, box-shadow .25s ease;
  will-change: transform;
}

/* Hover tilt and lift */
.card[data-rarity="mythic"]:hover {
  transform: perspective(900px) rotateX(2deg) rotateY(-2deg) translateZ(6px);
  box-shadow:
    0 28px 42px rgba(0,0,0,.55),
    0 12px 16px rgba(0,0,0,.35);
}

/* Pressed state feels “clickable” */
.card[data-rarity="mythic"]:active {
  transform: perspective(900px) rotateX(0deg) rotateY(0deg) translateZ(0) scale(.985);
  box-shadow:
    0 12px 18px rgba(0,0,0,.5),
    0 6px 8px rgba(0,0,0,.35);
}

/* Beveled face with inner highlights and a base vignette */
.card[data-rarity="mythic"] {
  position: relative;
  background-image:
    linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,0) 28%),
    linear-gradient(0deg, rgba(0,0,0,.18), rgba(0,0,0,0) 26%);
  background-blend-mode: overlay, normal;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.42),           /* top bevel line */
    inset 0 -10px 16px rgba(0,0,0,.35),            /* bottom cavity */
    inset 0 0 0 1px rgba(255,255,255,.06);         /* subtle rim */
  transform: translateZ(8px);                      /* parallax layer */
}

/* Use your existing ::before flamePulse, but add a glint “rim” for bevel */
.card[data-rarity="mythic"]::before {
  /* keep your conic border, add a faint opposing light for bevel illusion */
  background:
    conic-gradient(from .25turn, #ff4d4d, #ff8a00, #ffd166, #ff8a00, #ff4d4d),
    linear-gradient(135deg, rgba(255,255,255,.22), rgba(255,255,255,0) 40%),
    linear-gradient(315deg, rgba(0,0,0,.28), rgba(0,0,0,0) 40%);
  background-blend-mode: normal, screen, multiply;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.35)); /* border casts a shadow */
  transform: translateZ(12px);
}

/* Your shimmer ::after gets side shading and sits “above” the face */
.card[data-rarity="mythic"]::after {
  background:
    radial-gradient(60% 60% at 50% 60%, rgba(255,120,80,.25), rgba(255,120,80,0) 70%) no-repeat,
    linear-gradient(120deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.20) 45%, rgba(255,255,255,0) 60%) no-repeat,
    linear-gradient(90deg, rgba(0,0,0,.22), rgba(0,0,0,0) 20%, rgba(0,0,0,0) 80%, rgba(0,0,0,.22)); /* side vignettes */
  background-size: 100% 100%, 220% 100%, 100% 100%;
  background-position: center, 0 0, center;
  transform: translateZ(18px);
}

/* Add corner catchlights for that machined edge look */
.card[data-rarity="mythic"]::after {
  /* if you already used ::after for metallic grain, keep it and add these layers */
  content:"";
  position:absolute;
  inset:2px;
  border-radius:10px;
  pointer-events:none;
  z-index:2;
  background:
    radial-gradient(30px 30px at 10% 12%, rgba(255,255,255,.35), rgba(255,255,255,0) 70%),
    radial-gradient(26px 26px at 90% 88%, rgba(255,255,255,.18), rgba(255,255,255,0) 70%);
  mix-blend-mode: screen;
  transform: translateZ(14px);
}

/* Optional idle bob so it doesn’t sit there like a dead relic */
.card[data-rarity="mythic"].idle {
  animation: mythicBob 4.5s ease-in-out infinite;
}
@keyframes mythicBob {
  0%,100% { transform: perspective(900px) rotateX(4deg) rotateY(-6deg) translateZ(0); }
  50%     { transform: perspective(900px) rotateX(3deg) rotateY(-4deg) translateZ(4px); }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .card[data-rarity="mythic"],
  .card[data-rarity="mythic"]:hover,
  .card[data-rarity="mythic"].idle {
    animation: none;
    transform: perspective(900px) rotateX(3deg) rotateY(-4deg);
  }
}






/* Card internals */
.cardHead { display:flex; align-items:center; gap:6px; min-width:0; }
.chip {
  flex:0 0 auto; width:22px; height:22px; display:grid; place-items:center;
  border-radius:8px; background: rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.12);
  font-size:.78rem;
}
.k { font-size:.78rem; line-height:1.15; letter-spacing:.2px; color:#cdd9ef; overflow-wrap:anywhere; min-width:0; backgro }
.cardBody { display:flex; align-items:flex-start; flex-wrap:wrap; gap:6px; min-width:0; }
.pill {
   font-size:.9rem; line-height:1.2; padding:.24rem .48rem; border-radius:10px;
  background: rgba(255,255,255,.07); border:1px solid rgba(255,255,255,.12);
  max-width:100%; white-space:normal; overflow-wrap:anywhere; hyphens:auto; flex:1 1 100%;
}
.card[data-rarity="legendary"] .pill { border-color: rgba(255,183,3,.45); }
.card[data-rarity="epic"]      .pill { border-color: rgba(150,130,255,.35); }
.card[data-rarity="rare"]      .pill { border-color: rgba(0,212,255,.25); }

/* ================================
   OVERLAYS / MODALS / FINISH
==================================*/
.srOnly {
  position:absolute !important; height:1px; width:1px; margin:-1px;
  overflow:hidden; clip: rect(0 0 0 0); border:0; padding:0;
}

/* Single source of truth for the submit modal */
#finishOverlay.overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;         /* desktop centered */
  justify-content: center;
  z-index: 10001;              /* above toasts/z-fx */
}

/* Scrim with blur (as a pseudo-element so it doesn't create weird stacking) */
#finishOverlay.overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(5,8,12,.66);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

/* Show state */
#finishOverlay.overlay.show { display: flex; }

/* The card itself */
#finishOverlay .overlayCard {
  position: relative;
  z-index: 1;                  /* above the scrim */
  width: min(560px, 92vw);
  max-height: min(92dvh, 680px);
  overflow: auto;
  background: #111722;
  color: #e6eefb;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,.45);
  display: grid;
  gap: 10px;

  /* iOS Safari: force its own layer so it paints above the blurred scrim */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  will-change: transform;
  backface-visibility: hidden;
}

/* Buttons row can wrap on small widths */
#finishOverlay .btnRow {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Mobile: present as a bottom sheet */
@media (max-width: 1850px) {
  #finishOverlay.overlay { align-items: flex-end; }
  #finishOverlay .overlayCard {
    width: 100%;
    max-width: 100%;
    /* include multiple viewport units as fallbacks for older iOS */
    max-height: calc( min(100svh, 100lvh, 100dvh) - 24px );
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    padding-bottom: max(16px, env(safe-area-inset-bottom) + 12px);
  }
}


@media (max-width: 1850px) and (min-width: 960px), (orientation: landscape) and (max-height: 600px) {
	
	.totalLevel .badge {
	
  	width: 100% !important;
	height: 50% !important;
	display: flex !important;
    justify-content: center !important;
	align-items: center !important;
	border: 1px solid rgba(255, 255, 255, .12) !important;
	padding: 25px;
}

#totalBadge {
	
    height: 65px !important;
	font-size: 65px !important;
}

.stageBody {
	
	display: flex !important;
	justify-content: center !important;
	align-items: center !important;
  
}

.spinCol {
	
	
	
}

#statsGrid {
	
width: 100%;
  
  
}
    #statsGrid {
		
		
		height: 14vmax !important;
		
		
	}
	
	
	.rowStat {
		max-height: 25px;
	
	font-size: 11px !important;
	}
	
	    #rsStats .rowStat .name .icon {
			
			font-size: 11px !important;
		}
	
	.grid {
		
		width: 100%;
	}

	
}


.submitwindowbtn {
  display: flex;
  justify-content: center;
  align-items: center;
  color: #dffff2;
}

.lbSummary .sumItem {
	display: flex;
    justify-content: center;
    align-items: center;
  background-image: linear-gradient(45deg, red, orange, yellow, #ff4500);
  -webkit-background-clip: text;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 12px;
    
}

#nameInputOverlay {
  width: 100%; border: 1px solid rgba(255,255,255,.14); border-radius: 10px;
  padding: .55rem .7rem; background: rgba(255,255,255,.06); color: #fff;
}

/* Alt finish overlay id-based */
#finishOverlay.overlay {
  position: fixed; inset: 0; display: none; align-items: center; justify-content: center;
  background: rgba(5,8,12,.66); z-index: 9999;
}
#finishOverlay.overlay.show { display: flex; }
#finishOverlay[hidden] { display: none !important; }
#finishOverlay .overlayCard {
  min-width: 320px; max-width: 560px; background: #111722; color: #e6eefb;
  border-radius: 14px; padding: 18px 20px; box-shadow: 0 8px 40px rgba(0,0,0,.45);
}
#finishOverlay .x {
  position: absolute; right: 12px; top: 10px; background: transparent; border: 0;
  color: #9aa6bf; font-size: 20px; cursor: pointer;
}
#finishOverlay .row { display:flex; align-items:center; gap:10px; margin-top:10px; }
#finishOverlay .nameRow { display:grid; grid-template-columns: 1fr; gap:6px; margin-top:10px; }
#finishOverlay input {
  padding: 8px 10px; border-radius:8px; border:1px solid rgba(255,255,255,.12);
  background:#0b0f14; color:#e6eefb;
}
#finishOverlay button {
  padding: 8px 12px; border-radius: 10px; border: 0; cursor: pointer; background:#2bd1ff; color:#04131b; 
}
#finishOverlay button:disabled { opacity:.55; cursor:not-allowed; }
#overlayResetBtn { margin-top: 4px; }
#overlaySubmitBtn.ok { background:#1f9d57 !important; border-color:#167e45 !important; }

/* Modal (detail) */
.modal {
  position: fixed; inset: 0; display: grid; place-items: center; z-index: 9999;
}
.modal[hidden] { display: none !important; }
.modal::before {
  content:""; position:absolute; inset:0; background: rgba(6,10,16,.6); backdrop-filter: blur(6px);
}
.modalCard {
  position: relative; z-index: 1; width: min(680px, 92vw); max-height: 80vh; overflow: auto;
  background: var(--panel); border: 1px solid rgba(255,255,255,.14); border-radius: 16px; padding: 16px; box-shadow: var(--soft-shadow);
  display: grid; gap: 10px;
}

/* Continuing from where the first document cut off... */

.modalCard h3 { margin: 0; }
#lbDetail .modalCard { position: relative; }
#lbDetailClose { position: absolute; top: 10px; right: 10px; z-index: 2; cursor: pointer; }

/* Disable wheel interactions while modal open */
body.modal-open #wheel,
body.modal-open #wheelWrap,
body.modal-open .pointer { pointer-events: none !important; }

/* ================================
   LEADERBOARD
==================================*/
.lbPanel {
  display:grid; gap:10px; background: rgba(255,255,255,.035);
  border:1px solid rgba(255,255,255,.08); border-radius:14px; padding:12px; min-width:0;
}
.lbHeader { display:flex; align-items:center; justify-content:space-between; gap:10px; text-align:center; flex-direction:column; }
.lbHeader h3 { margin-bottom: 20px; }
.lbControls { display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:center; width:100%; }
.lbSearch, .lbSelect {
  background: rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.12);
  color:#e6eefb; border-radius:10px; padding:.48rem .65rem; font: inherit;
}
#leaderboardPanel { max-width:100%; overflow: hidden; max-height:100%; }
#leaderboardPanel .lbControls>* { min-width:0; max-width:100%; }
#leaderboardPanel .lbSearch { width: min(260px, 100%); }
.lbList {
  list-style:none; margin:0; padding:0; display:grid;
  grid-auto-rows:minmax(52px, auto); gap:6px; max-height:48vh; overflow:auto; width:100%; max-width:100%; overflow-x:hidden;
}
.lbEmpty { opacity:.8; font-size:.92rem; text-align:center; padding:10px; }
.lbItem {
  width:100%;
  display:grid; grid-template-columns:48px minmax(0,1fr) max-content; align-items:center; gap:10px;
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border:1px solid rgba(255,255,255,.10); border-radius:12px; padding:8px 10px;
  box-shadow: 0 6px 16px rgba(0,0,0,.22); cursor:pointer; user-select:none;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.lbItem:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(0,0,0,.28); }
.lbItem:active { transform: translateY(0); }
.lbRank {
  width:32px; height:32px; border-radius:10px; display:grid; place-items:center;
  background: rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.12);
}
.lbName {  letter-spacing:.2px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; }
.lbScore {  font-size:1.05rem; }
.meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%
}
.lbPill { visibility: hidden; }
.lbItem.first .lbRank {
  background: radial-gradient(60% 60% at 50% 40%, #ffe9b5, #ffd064 40%, #d08a00);
  border-color: rgba(255,183,3,.6); color:#121821;
}
.lbItem.second .lbRank { color:#121821;background: radial-gradient(60% 60% at 50% 40%, #f2f4f7, #cbd5e1 40%, #94a3b8); }
.lbItem.third  .lbRank { color:#121821;background: radial-gradient(60% 60% at 50% 40%, #ffd6a5, #ffb86b 40%, #cc7a29); }

/* Picks panel */
.picks { display:grid; grid-template-columns:160px 1fr; gap:8px; background: rgba(255,255,255,.035); border:1px solid rgba(255,255,255,.08); border-radius:12px; padding:10px; }
.pRow { display: contents; }
.pKey { color:#cdd9ef; align-self:center; }
.pVal { display:flex; flex-wrap:wrap; gap:6px; }
.pChip {
   font-size:.9rem; line-height:1.2; padding:.22rem .5rem; border-radius:999px;
  background: rgba(255,255,255,.07); border:1px solid rgba(255,255,255,.12);
}

.lbSectionTitle { margin:12px 0 6px; font-size:14px; color:var(--muted); letter-spacing:.3px; }
.lbBreakdown { display:grid; gap:8px; }
.lbBreakItem {
  background: rgba(255,255,255,.04); border:1px solid rgba(255,255,255,.06);
  border-radius:10px; padding:8px;
}
.lbBreakHead { display:flex; justify-content:space-between; gap:8px; font-size:13px; margin-bottom:6px; }
.lbBreakCat {  opacity:.9; }
.lbBreakPick { opacity:.8; }
.lbBreakChips { display:flex; flex-wrap:wrap; gap:6px; }
details { margin-bottom: 5px; }

/* ================================
   TOASTS
==================================*/
#toastHost {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  z-index: 10000; display: grid; gap: 8px; pointer-events: none;
}
.toast {
  pointer-events: auto; min-width: 240px; max-width: 92vw; padding: 10px 14px; border-radius: 10px;
  font: 600 14px/1.2 system-ui, Segoe UI, sans-serif; color: #0b0f14;
  background: #e6f7ea; border: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 8px 30px rgba(0,0,0,.25);
  opacity: 0; transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.err { background: #ffe8e6; color: #4d0b0b; }
.toast.ok  { background: #e8fff3; color: #0b3d27; }

/* ================================
   SPARKLES / EMBERS FX
==================================*/
/* Mythic "embers" */
.emberHost {
  position: fixed; transform: translate(-50%, -50%); pointer-events: none; z-index: 10000;
}
.ember {
  position: absolute; left: 0; top: 0; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, #ffd27a 55%, #ff8a00);
  box-shadow: 0 0 8px rgba(255,180,60,.9);
  animation: emberFly var(--d, 900ms) ease-out var(--delay, 0ms) forwards;
}
@keyframes emberFly {
  0% { transform: translate(0,0) scale(1); opacity: 1; }
  100%{ transform: translate(var(--x,0), var(--y,0)) scale(.7); opacity: 0; }
}

/* Sparkles */
.sparkleHost { position: fixed; inset: 0 0 auto auto; width: 0; height: 0; z-index: 10000; pointer-events: none; }
.sparkleDot {
  position: absolute; left: 0; top: 0; width: 8px; height: 8px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, #e6f3ff 45%, rgba(43,209,255,.9));
}
.sparkleTrail {
  position: absolute; left: 0; top: 0; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, rgba(43,209,255,0), rgba(255,183,3,.95));
  transform-origin: 0 50%; opacity: .9;
}
.sparkleSplash {
  position: fixed; width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle, #fff, #ffb703);
  box-shadow: 0 0 14px rgba(255,183,3,.9);
  pointer-events: none; z-index: 10000;
  animation: sparkleSplash 420ms ease forwards;
}
@keyframes sparkleSplash {
  0% { transform: scale(.6); opacity: 1; }
  100%{ transform: scale(1.7); opacity: 0; }
}
.attrCard.flash { animation: cardFlash 650ms ease; }
@keyframes cardFlash {
  0%{ box-shadow: 0 0 0 0 rgba(255,183,3,0); }
  30%{ box-shadow: 0 0 0 10px rgba(255,183,3,.18); }
  100%{ box-shadow: 0 0 0 0 rgba(255,183,3,0); }
}

/* ================================
   ANIMATIONS (shared)
==================================*/
@keyframes hubThud { 0%{transform:scale(1)} 40%{transform:scale(1.06)} 100%{transform:scale(1)} }
@keyframes glow { 0%{filter:drop-shadow(0 0 0 rgba(255,183,3,0))} 50%{filter:drop-shadow(0 0 16px rgba(255,183,3,.6))} 100%{filter:drop-shadow(0 0 0 rgba(255,183,3,0))} }
@keyframes spin360 { to { transform: rotate(1turn); } }
@keyframes glowPulse { 0%,100%{opacity:.65} 50%{opacity:1} }
@keyframes popIn { 0%{transform:scale(.92); filter:saturate(1.4) brightness(1.2);} 60%{transform:scale(1.02);} 100%{transform:scale(1);} }
@keyframes shimmerSweep { from{background-position:-200% 0;} to{background-position:200% 0;} }
@keyframes heatRipple { 0%{transform:translateZ(0) scale(1); filter:blur(0)} 50%{transform:translateZ(0) scale(1.01); filter:blur(.6px)} 100%{transform:translateZ(0) scale(1); filter:blur(0)} }
@keyframes flamePulse { 0%,100%{opacity:.55} 40%{opacity:.95} 70%{opacity:.75} }

/* Lock body scroll when a modal or drawer is open */
body.modal-open { overflow: hidden; }

/* Make the controls row wrap and/or scroll on narrow screens */
.controlsRow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  height: 50px;
  
}



/* Off-canvas sidebar defaults for mobile */
@media (max-width: 1850px) {
  .app {
    grid-template-columns: 1fr;   /* stack */
    padding: 10px;
    gap: 10px;
    height: 100dvh; /* better viewport unit on mobile */
    min-height: 100dvh;
  }

  /* Show hamburger on mobile */
  .hamburger { display: block; }

  /* Dock becomes an off-canvas drawer */
  .dock {
    position: fixed;
    top: max(10px, env(safe-area-inset-top));
    left: 10px;
    bottom: 10px;
    width: min(80vw, 360px);
    max-width: 85vw;
    transform: translateX(-110%);
    transition: transform .22s ease;
    z-index: 1101;
  }
  .dock.open { transform: translateX(0); }

  /* Main stage fills screen under the hamburger */
  .stageBody {
    grid-template-columns: 1fr;  /* single column */
    padding: 10px;
    gap: 10px;
  }

  .infoBody {
    grid-template-columns: 1fr;  /* stack info grids */
  }

  /* Make small buttons a bit larger for touch */
  .btn.sm, .btn.sa { padding: .6rem .8rem; font-size: 1rem; }

  /* Controls can horizontally scroll if needed */
}

/* Slightly larger touch targets on very small phones */
@media (max-width: 380px) {
  .btn { padding: .65rem .9rem; }
}

/* Optional: subtle drawer open animation for hamburger icon */
.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateX(-50%) rotate(45deg); top: 20px; }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateX(-50%) rotate(-45deg); top: 20px; }



/* Use the dynamic viewport unit so the URL bar doesn't steal space */
.app {
  height: 100dvh;
  min-height: 100dvh;
}

/* Make the left column: [title][wheel area grows/shrinks][controls pinned] */
.spinCol {
  display: grid;
  grid-template-rows: auto 1fr auto; /* title / wheelWrap / controls */
  min-height: 0;                      /* allow the middle row to shrink */
  overflow: auto;                      /* this column scrolls if needed */
  -webkit-overflow-scrolling: touch;
}

/* Keep the controls visible without scrolling */
.controlsRow {
  position: sticky;
  bottom: 0;          /* pin to the bottom of .spinCol’s scroll area */
  z-index: 5;         /* stay above neighbors */
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  overflow: visible;

  /* comfy padding + iOS safe area */
padding: 10px 8px;

  /* subtle backdrop so they’re readable over content when pinned */
  margin-top: 6px;
  border-radius: 12px;
}


/* Speed button selected state */
.btn[aria-pressed="true"],
.btn.is-active {
  filter: brightness(1.18);
  transform: none;               /* cancel the tiny press shift */
  outline: 1px solid rgba(255,255,255,.28);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.22), 0 6px 18px rgba(0,0,0,.3);
}

/* Optional: give each variant a nice “on” look */
.btn.sa[aria-pressed="true"],
.btn.sa.is-active {
  background: linear-gradient(180deg, #c8effe, #9be2fb);
  color: #003344;
  border-color: rgba(0,0,0,.08);
}
.btn.primary[aria-pressed="true"],
.btn.primary.is-active {
  background: linear-gradient(180deg, #344662, #28374f);
}
.btn.success[aria-pressed="true"],
.btn.success.is-active {
  background: linear-gradient(180deg, #2f5a49, #214033);
}



.spinCol { position: relative; z-index: 2; isolation: isolate; -webkit-overflow-scrolling: touch;}
.infoCol { position: relative; z-index: 1; }




/* --- Finish overlay: cross-device sizing & scroll --- */
#finishOverlay.overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;             /* desktop centered */
  justify-content: center;
  background: rgba(5,8,12,.66);    /* fix the alpha (was 66) */
  z-index: 9999;
}
#finishOverlay.overlay.show { display: flex; }

#finishOverlay .overlayCard {
  position: relative;
  width: min(560px, 92vw);
  max-height: min(92dvh, 680px);   /* let the card scroll, not the page */
  overflow: auto;
  background: #111722;
  color: #e6eefb;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,.45);
  display: grid;
  gap: 10px;
}

/* buttons row: allow wrap on narrow screens */
#finishOverlay .btnRow {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

/* mobile: turn dialog into a bottom sheet, with comfy touch space */
@media (max-width: 1850px) {
  #finishOverlay.overlay {
    align-items: flex-end;           /* bottom sheet presentation */
  }
  #finishOverlay .overlayCard {
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - 24px); /* use dynamic viewport unit */
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    padding-bottom: max(16px, env(safe-area-inset-bottom) + 12px);
  }
}

/* name row: let input expand properly (already partially present) */
#finishOverlay .overlayRow { display: flex; gap: 8px; align-items: center; }
#finishOverlay .overlayRow input { flex: 1; }

/* success state for the Submit button (already wired in JS) */
#overlaySubmitBtn.ok { background: #1f9d57 !important; border-color: #167e45 !important; }

/* Patch notes */
.pnList { list-style:none; margin:0; padding:0; display:grid; gap:6px; max-height:32vh; overflow:auto; }
.pnItem details {
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12);
  border-radius:10px; padding:.5rem .7rem;
}
.pnItem summary { cursor:pointer;  }
.pnBullets { margin:.4rem 0 0 1.2rem; }
#patchNotesPanel { width: 100%; }

/* ===== Encyclopedia ===== */
.encyHeader {
  display:flex; align-items:flex-end; justify-content:space-between; gap:12px; margin-bottom:10px;
}
.encyCat { font: 600 .84rem/1 system-ui; opacity:.8 }
.encyRarity { font: 600 .84rem/1 system-ui; opacity:.85; }
.encySearch {
  min-width: 240px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px; padding: .55rem .7rem; color: #fff;
}
.encyBody {
  display:grid; grid-template-columns: minmax(180px, 240px) 1fr; gap:14px; min-height: 0;
  max-height: min(78dvh, 720px);
}
.encyNav {
  border-right: 1px solid rgba(255,255,255,.08);
  overflow:auto; padding-right:8px;
}
.encyNav .navItem {
  display:block; padding:.45rem .55rem; border-radius:10px; cursor:pointer;
  border:1px solid transparent;
}
.encyNav .navItem:hover { background: rgba(255,255,255,.05); }
.encyNav .navItem.active {
  background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.12);
}
.encyContent { overflow:auto; display:grid; gap:10px; }
.encyText { color:#dbe6ff; opacity:.95 }
.encyImpact { display:flex; flex-wrap:wrap; gap:6px; }
.encyImpact .chip {
  display:inline-flex; align-items:center; gap:6px; padding:.28rem .55rem;
  border-radius:999px; border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);  font-size:.86rem;
}
.encyNotes { display:grid; gap:6px; margin:0; padding-left: 1.1rem; }

/* Small screens */
@media (max-width: 780px) {
  .encyBody { grid-template-columns: 1fr; }
  .encyNav { order:2; border-right:0; border-top:1px solid rgba(255,255,255,.08); padding-top:8px; }
}

/* --- Bonus overlay --- */
#bonusOverlay.overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(5,8,12,.66);
  z-index: 10000;
}
#bonusOverlay.overlay.show { display: flex; }

#bonusOverlay .overlayCard {
  position: relative;
  width: min(560px, 92vw);
  max-height: min(92dvh, 680px);
  overflow: auto;
  background: #111722;
  color: #e6eefb;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,.45);
  display: grid;
  gap: 10px;
}

#bonusOverlay .btnRow {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

/* bonus list */
#bonusOverlay .bonusList {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
#bonusOverlay .bonusList li {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  border-radius: 12px;
  padding: .5rem .7rem;
}
#bonusOverlay .bonusList li .meta {
  font-size: .9rem;
  opacity: .85;
}

/* --- Bonus overlay --- */
#bonusOverlay.overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}
#bonusOverlay.overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(5,8,12,.66);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
#bonusOverlay.overlay.show { display: flex; }

#bonusOverlay .overlayCard {
  position: relative;
  z-index: 1;
  width: min(560px, 92vw);
  max-height: min(92dvh, 680px);
  overflow: auto;
  background: #111722;
  color: #e6eefb;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,.45);
  display: grid;
  gap: 10px;
}
#bonusOverlay .btnRow {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
#bonusOverlay .bonusList {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
#bonusOverlay .bonusList li {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  border-radius: 12px;
  padding: .5rem .7rem;
}
#bonusOverlay .bonusList li .meta {
  font-size: .9rem;
  opacity: .85;
}

/* Pill chips for stat deltas inside LB detail & encyclopedia */
#lbDetail .lbBreakChips .impactChip,
#encyModal .encyImpact .impactChip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);

  white-space: nowrap;
  line-height: 1.1;
 
}

#lbDetail .lbBreakChips .impactChip.neg,
#encyModal .encyImpact .impactChip.neg {
  background: rgba(255,0,0,.12);
  border-color: rgba(255,0,0,.25);
}

/* Defensive: if any old code still uses .chip in these sections,
   make it behave like a pill, not the round icon */
#lbDetail .lbBreakChips .chip,
#encyModal .encyImpact .chip {
  position: static;
  display: inline-flex;
  width: auto;
  height: auto;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.overlayResetBtn {
	background-color: gray;
	
}

/* --- Mobile: compact stats + compact attribute cards --- */
@media (max-width: 1850px) {
	
	#totalLevelCount {
	
	font-size: 1.5rem !important;
}
  
  .rsList {
	  
	  max-height: 70px;
	  
	  
  }
  
  #totalBadge {
	  
	  max-height: 60px !important;
  }
  
  .badge {
	  
	  padding: 15px !important;
	  margin-bottom: 5px;
	  
  }
  
  
  
  
  /* === Fix: keep attribute titles visible on mobile === */
  .card.attrCard .cardHead { 
    min-width: 0; 
    align-items: flex-start; 
  }
  .card.attrCard .cardHead .k {
    flex: 1 1 auto;        /* let title actually take space instead of collapsing */
    min-width: 0;
    white-space: normal;    /* allow wrapping */
    overflow-wrap: break-word;
    line-height: 1.2;
  }
  .card.attrCard .cardHead .rarity {
    flex: 0 0 auto;         /* keep rarity compact */
    margin-left: 8px;
    white-space: nowrap;
  }


  /* Layout: keep stats visible at the top, attributes below */
  .infoBody {
    display: grid;
    grid-template-rows: auto 1fr; /* top: stats (compact), bottom: attributes (scrolls) */
    gap: 12px;
  align-items: center; /* Centers content vertically */
  justify-items: center; /* Centers content horizontally */
  }
  
  

  
  
  /* Keep the Stats panel pinned while you scroll attributes */
  #rsPanel {
    position: sticky;
    top: env(safe-area-inset-top, 0);
    z-index: 2;
    background: var(--bg, #0c111a);
    padding-top: 4px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255,255,255,.06);
	
  }

  /* Two rows of five: [icon] [current] */
#rsStats {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px; /* symmetric gap, easier on the eyes */
  grid-auto-flow: row dense;
}





  #rsStats .rowStat {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 10px;
    background: rgba(255,255,255,.06);
  }

  /* hide the long bits; show just icon + current value */
  #rsStats .rowStat .barWrap,
  #rsStats .rowStatDetails,
  #rsStats .rowStat .deltaBadge {
    display: none !important;
  }

  /* show only the stat icon (hide the text label) */
  #rsStats .rowStat .name span:not(.icon) {
    display: none !important;
  }

  #rsStats .rowStat .name .icon {
    font-size: 1.05rem;
    line-height: 1;
  }

  #rsStats .rowStat .valWrap .val {

    font-variant-numeric: tabular-nums;
  }

  /* Attribute grid: smaller cards, tighter grid */
  #statsGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
 row-gap: 6px;
 column-gap: 8px;
  }

  .card.attrCard {
    min-height: auto;
    padding: 10px 12px;
    border-radius: 12px;
  }

  .card.attrCard .cardHead {
    margin-bottom: 6px;
    gap: 8px;
  }

  .card.attrCard .cardHead .chip {
    width: 28px;
    height: 28px;
    font-size: 16px;
    line-height: 28px;
  }

  .card.attrCard .cardHead .k {
    font-size: .95rem;
    line-height: 1.1;
 
  }

  /* Hide the long “picked value” line on mobile; go straight to buffs */


  .card.attrCard .meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  /* Buff chips as [icon] [amount] (hide label text on phones) */
  .impactChip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,.07);
 
    font-size: .9rem;
  }
  .impactChip .lbl { display: none; }
  .impactChip .icon { font-size: 1rem; line-height: 1; }
  
  .summary {
	  display: none;
  }
  .rsSummaryToggle {
	  display: none;
	  
  }
  

  
  .infoCol#rsPanel {
	  height: 450px;
  }

  
}



@media (max-width: 1850px) {
  /* Stats grid lives above attributes and both remain visible */
  #rsPanel { position: sticky; top: 0; z-index: 3; }

  /* Attribute grid: two narrow columns, natural height, small gaps */
  #statsGrid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  /* Compact mobile card */
  .card.attrCard {
    padding: 10px 12px;
    border-radius: 12px;
    margin: 0;             /* avoid huge vertical gaps */
min-height: 100px;
  }


  /* Row 1: [icon] [name] [rarity] */
  .card.attrCard .cardHead {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
  }
  .card.attrCard .cardHead .chip {
    width: 28px; height: 28px; line-height: 28px; font-size: 16px;
  }
  .card.attrCard .cardHead .k {
    font-size: .95rem; line-height: 1.1;
  }
  .card.attrCard .cardHead .rarity {
    margin-left: auto;
    font-size: .8rem;
    opacity: .9;
    white-space: nowrap;
  }

  /* Hide the desktop “picked value” pill on phones */
  

  /* Row 2: compact buff chips */
  .card.attrCard .meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .impactChip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,.07);


  }
  .impactChip .lbl { display: none; }  /* just [icon]+[amount] on phones */
  .impactChip .icon { font-size: 1rem; line-height: 1; }
  
  /* Attribute card layout fix */
.attrCard{
  display: grid;
  grid-template-rows: auto 1fr; /* header, body */
  align-content: start;
  height: var(--cardH);
  min-height: 180px;
  max-height: 200px;            /* ensure no clipping */
}
.attrCard .cardBody{
  align-content: start;        /* keep inner content from stretching weirdly */
}

/* ===== Attributes: single wide column, roomy cards, sane wrapping ===== */
#statsGrid {
  display: grid;
  grid-template-columns: 1fr !important;  /* force 1 column everywhere */
  column-gap: 12px;
  row-gap: 8px;                            /* tighten vertical space */
  max-width: 960px;                        /* nice readable width */
  margin-inline: auto;                     /* center the column */
  height: 130px;
  overflow: scroll;
}

/* Cards should size to content (no fixed height clamp) */
.attrCard {
  height: auto !important;
  min-height: 140px;                       /* enough to show header + a few chips */
}

/* Make sure text is horizontal and wraps at word boundaries, not every character */
.attrCard .cardBody,
.attrCard .pill,
.attrCard .meta,
.impact,
.impactChip,
.pChip {
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;    /* not "anywhere" */
}

/* If you have a rule somewhere using "overflow-wrap:anywhere" on .impact,
   this line neutralizes it without editing that original rule. */
.impact { overflow-wrap: break-word !important; }

/* Optional: slightly smaller pill text for more breathing room */
.attrCard .pill { font-size: 0.95rem; }

/* Optional: impact chips stay on one line each but can wrap to a new line cleanly */
.impactChip { white-space: nowrap; margin: 2px 4px 2px 0; }



  
  
  
}


/* Attribute card chip (desktop) */
.icon {
  line-height: 22px; /* centers single-character emoji perfectly */
    display: inline-flex;
  align-items: center;
  justify-content: center;
}


/* ===== EX rarity: holo-foil + prismatic border ===== */
.card[data-rarity="ex"]{
  position:relative;border-radius:14px;
  --ex-border:conic-gradient(from 0deg at 50% 50%,#9ef,#a9f,#f9a,#ff9,#9f9,#9ef 85%,#9ef);
  background:
    radial-gradient(120% 120% at 50% 35%, hsl(205 100% 72% / .80) 20%, hsl(280 100% 75% / .75) 70%, hsl(260 60% 30% / .60) 80%, hsl(240 30% 10% / .80) 90%) padding-box,
    conic-gradient(from 210deg at 50% 50%, hsl(200 100% 70%), hsl(320 100% 70%), hsl(200 100% 70%)) border-box;
  border:2px solid transparent;
  background-clip:padding-box,border-box;
  box-shadow:0 0 26px rgba(164,69,255,.18),0 0 60px rgba(124,58,237,.12),inset 0 0 18px rgba(66,99,255,.16);
  overflow:hidden;
}
.card[data-rarity="ex"]::before{
  content:"";
  position:absolute;inset:2px;border-radius:inherit;pointer-events:none;
  background:
    radial-gradient(120% 80% at 10% 10%,rgba(255,255,255,.06),transparent 60%),
    radial-gradient(100% 60% at 90% 20%,rgba(255,255,255,.05),transparent 60%),
    repeating-conic-gradient(from 0deg, rgba(255,255,255,.18) 0 8deg, rgba(255,255,255,0) 8deg 16deg),
    repeating-linear-gradient(35deg, rgba(255,255,255,.08) 0 6px, rgba(0,0,0,0) 6px 12px);
  mix-blend-mode:screen;opacity:.85;animation:exHoloPan 16s linear infinite;
}
.card[data-rarity="ex"]::after{
  content:"";position:absolute;inset:0;border-radius:inherit;
  background:linear-gradient(120deg,transparent 30%,rgba(255,255,255,.28) 50%,transparent 70%);
  transform:translateX(-200%) rotate(.001deg);
  animation:exSweep 2200ms cubic-bezier(.2,.8,.2,1) forwards;
}
.rarity.ex{
 
  letter-spacing:.8px;
  background-color:hsl(285, 20.9%, 31.4%,.25);
  z-index:3
}







/* =========================
   UX Polish: non-selectable UI
   Prevent text selection on interactive furniture so it feels like a game UI.
   ========================= */
.noSelect, 
.card, 
.attrCard,
.btn, 
.btnRow .btn,
.chip,
.badge,
.lbItem,
.navItem,
.tab,
.sumItem,
.statsHeader,
.sectionTitle,
.header,
.footer,
.modalHeader,
.modalCard .title,
.tooltip,
.dropdown,
.pill,
.stat,
.tile,
.bar,
.barWrap {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Prevent accidental image/icon dragging */
img, svg {
  -webkit-user-drag: none;
  user-drag: none;
  -khtml-user-drag: none;
}

/* Remove the tap highlight on mobile for UI chrome */
*:where(.card, .attrCard, .btn, .chip, .badge, .lbItem, .navItem, .tab, .sumItem) a {
  -webkit-tap-highlight-color: transparent;
}

/* Hide selection highlight inside interactive UI, as an extra guard */
.card::selection,
.attrCard::selection,
.btn::selection,
.chip::selection,
.badge::selection,
.lbItem::selection,
.navItem::selection,
.tab::selection,
.sumItem::selection,
.statsHeader::selection,
.sectionTitle::selection {
  background: transparent;
  color: inherit;
}
#rollNow { min-width: 6ch; text-align: center; }

/* Common rarity */
.common {
  color: #6D6D6D;   
}

/* Uncommon rarity */
.uncommon {
  color: #1EB800;   
}

/* Rare rarity */
.rare {
  color: #2980B9;     
}

/* Epic rarity */
.epic {
  color: #8E44AD;       
}

/* Legendary rarity */
.legendary {
  color: #F39C12;       
}

/* Mythic rarity */
.mythic {
  color: #E74C3C;    
}

/* EX rarity */



/* If you need to target the button's specific container for centering */
#donate-button-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

#donate-button {
	max-width: 80px;
	max-height: 40px;
	margin-left: 10px;
	
}

.colorfulDonate {
background: linear-gradient(to right, #ff5f00, #ffcc00);
  background-clip: text;
  color: transparent;



  letter-spacing: 0.1rem;
}


.ninjaTitle {
background: linear-gradient(to right, #ff5f00, #ffcc00);
  background-clip: text;
  color: transparent;



  letter-spacing: 0.1rem;
}


#attrTitle, #statsTitle {
background: linear-gradient(to right, #ff5f00, #ffcc00);
  background-clip: text;
  color: transparent;
  letter-spacing: 0.1rem;
}

.rollTitle {
  color: #F39C12;
  letter-spacing: 0.1rem;
}

#lbHeading, #pnHeading, #pnHeading {
	letter-spacing: 0.1rem;
	color: white;
}

.ninjaTitle {
	
	  font-size: 22px;
}

body {
  font-family: 'Russo One', sans-serif;
}

.h .ninjaTitle .versionNum {
	font-size: 13px;
}

/* 1) Reduce excessive space between inlineRollNow and wheel */
.inlineTitle { 
  gap: 8px !important;            /* was 100px */
}
.inlineRollNow { 
  margin: 0;             /* kill any accumulated margin */
  padding: 0;
  height: auto !important;
  line-height: 1.1;
  margin-bottom 0 !important;
}

/* 3) Guardrail: wheel area keeps tight spacing from its header */
#spinCol .wheelWrap { 
  margin-top: 6px;
}


#statsGrid {
  scroll-behavior: smooth;
  scroll-snap-type: y proximity; /* optional but looks good */
}
#statsGrid .attrCard {
  scroll-snap-align: start;      /* optional */
}

/* Let the head be a clean flex row */
.card .cardHead {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;            /* allows z-index to do something */
}

/* Make the title actually own space in the row */


/* Chips shouldn’t bully the title */
.card .cardHead .chip,
.card .cardHead .rarity {
  flex: 0 0 auto;
  z-index: 0;
}



/* === FINAL mobile layout: Row 2 is two columns; chips flow horizontally === */
@media (max-width: 1850px) {
  /* 1) The body is a two-column grid */
  .card.mobile .cardBody {
    display: grid !important;

    align-items: start;
    column-gap: 2px;
  }

  /* 2) Left column: pill is flexible text, no fixed width/height */
  .card.mobile .pill {
    flex: 0 1 auto !important;
    width: auto !important;
    height: auto !important;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap; /* change to normal if you want wrapping */
  }

  /* 3) Right column: chips container is a flex row that wraps */
  .card.mobile .meta {
    display: flex !important;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 2px;
    max-width: 100%;      /* stays inside its grid column */
    width: auto !important; /* undo the rogue width:100% rule */
  }

  /* 4) Each chip is inline-sized; do NOT stretch to full width */
  .card.mobile .meta .impactChip {
    display: inline-flex;
    flex: 0 0 auto; /* key: prevents stretching to the full column width */
    align-items: center;
    gap: 2px;
    white-space: nowrap;
	font-size: 12px;
  }
  
  .icon {
	  font-size: 10px;
	  
  }

  /* 5) Hard kill any rule that collapses the body to "contents" */
  .card.attrCard.mobile .cardBody {
    display: grid !important; /* overrides "display: contents" */
  }
}


:root { --pill-min: 80px; }  /* let pill shrink further on small phones */

@media (max-width: 1850px) {
  /* Row 2: pill flexes, chips claim what they need */
  .card.attrCard.mobile .cardBody {
    display: grid !important;
    grid-template-columns: minmax(var(--pill-min, 80px), 1fr) max-content; /* chips column grows with content */
    column-gap: 8px;
    align-items: center;
  }

  .card.attrCard.mobile .pill {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .card.attrCard.mobile .meta {
    display: flex !important;
    flex-wrap: nowrap;       /* never wrap */
    gap: 6px;
    justify-content: flex-end;
  }

  .card.attrCard.mobile .meta .impactChip {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    font-size: 12px;         /* helps fit 4 chips */
    padding: 2px 6px;        /* tighter padding to buy width */
  }
}

@media (max-width: 1850px) {
  /* Row 1: [icon] [label] [rarity], rarity aligned to card right edge */
  .card.attrCard.mobile .cardHead {
    display: grid;
    grid-template-columns: 28px 1fr max-content;
    align-items: center;
    column-gap: 8px;
    margin-bottom: 6px;
  }

  .card.attrCard.mobile .cardHead .chip { width: 28px; height: 28px; font-size: 16px; }
  .card.attrCard.mobile .cardHead .k    { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .card.attrCard.mobile .cardHead .rarity { justify-self: end; }  /* hard-right, matches chips column edge */
  .val { font-size:14px;}
 
  .raritiesTitle {
	  font-size:1.7dvh;
	  text-align: center;
	  
  }
}
  .rarityLabels{
	  
	  text-align: center;
	  
  }
  
  .rarityPercentages{
	  
	  text-align: center;
	  
  }

/* === Mobile mythic glow fix === */
@media (max-width: 1850px) {
  /* 1) Let mythic cards actually paint outside their box */
  .card.attrCard[data-rarity="mythic"] {
    overflow: visible !important;     /* was hidden via .card */
    contain: initial !important;      /* overrides contain: paint */
  }

  /* 2) Give the glow some room inside the box too */
  .card.attrCard[data-rarity="mythic"] .cardBody {
    position: relative;
    padding-bottom: 16px;             /* space for inner glow */
  }

  /* 3) Keep the pseudo-element inside the card so even if overflow were hidden, it still shows */
  .card.attrCard[data-rarity="mythic"] .cardBody::before {
    /* you currently use: left:-6px; right:-6px; bottom:-6px; height:38%; */
    left: -4px;
    right: -4px;
    bottom: 0;                         /* don’t push it outside the box */
    height: 44%;                       /* a touch taller to compensate */
  }

  /* 4) Do NOT clamp card height on mobile; mythic needs vertical breathing room */
  .card.attrCard { 
    max-height: 150px;       /* you have max-height: 200px in one mobile block */
  }
}




#bmc-wbtn
{
	max-width:50px;
	max-height:50px;

	margin: 8px;
}

/* 1) Define 4 rows: title / current-spin / wheel / controls */
.spinCol {
  display: grid;
  grid-template-rows: auto auto 1fr auto; /* <-- add the second 'auto' for the label */
  row-gap: 6px;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

/* 2) Make the inline header truly centered and full-width */
.inlineTitle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;              /* ensures centering works as expected */
}

/* 3) Kill accidental extra spacing (and fix the missing colon) */
.inlineRollNow {
  margin: 0;
  padding: 0;
  height: auto !important;
  line-height: 1.1;
  margin-bottom: 2%; !important;   /* you had 'margin-bottom 0' */
  margin-top: 10%; !important;  
	display: flex;
  align-items: center;
  justify-content: center;
	font-size: 24px;
}

.rollTitle {
	font-size: 18px;
}

/* Optional: keep the wheel tight to the label */
.wheelWrap { margin-top: 0 !important; align-self: start; }

@media (max-width: 1850px) {
  .card.attrCard[data-rarity="mythic"] { 
    overflow: visible !important; 
    contain: initial !important; 
  }
  .card.attrCard[data-rarity="mythic"] .cardBody {
    position: relative;
    padding-bottom: 16px;       /* room for the glow layer */
  }
  .card.attrCard[data-rarity="mythic"] .cardBody::before {
    left: -4px; right: -4px; bottom: 0; height: 44%;
  }
  
  .inlineRollNow, .rollTitle  {
  margin-bottom: 0 !important;   /* you had 'margin-bottom 0' */
  margin-top: 0 !important;  
  	font-size: 18px !important;
}




}


#stopBtn { display: none; }
#speedBtns button[data-speed="2"],
#speedBtns button[data-speed="3"] { display: none; }

/* === Mobile: keep controls in one line without pushing layout === */
@media (max-width: 1850px) {
  /* Let the wheel column shrink instead of being pushed wider by its children */
  .spinCol { 
  
  min-width: 0; 
  max-height: 100% !important;
  }
  
  
  .controlsRow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;     /* center the items inside the row */
  width: 100%;          /* shrink-wrap to its contents */
  margin-inline: auto;         /* center the whole row block */
  margin-top: 12px;            /* breathing room, optional */
}

/* Make sure children don't stretch if some global .btn styles set flex-grow */
#wheelControls .btn,
#wheelControls .btnGroup {
  flex: 0 0 auto;
}

/* Optional: keep the speed button cluster from splitting on wrap */
#wheelControls .btnGroup {
  display: inline-flex;
  gap: 4px;
}

  /* Belt-and-suspenders center for the wheel */
  #wheelWrap, #wheel { 
    display: block;
    margin-inline: auto;
  }

  /* Make the controls a horizontal scroller that doesn't affect page width */
  .controlsRow {
    flex-wrap: nowrap;             /* one line */
    overflow-x: hidden;              /* scroll if needed */
    overflow-y: hidden;
    max-width: 100%;
	height: 60px;
    gap: 8px;
    justify-content: center;   /* avoid “centered but wider than screen” weirdness */
  }

  /* Critical: children don’t get to force a wider row */
  .controlsRow > * {
    flex: 0 0 auto;
    scroll-snap-align: start;      /* optional: snaps each button into view */
  }
    .statsHeader {
	  display: none !important;
	  visibility: hidden !important;
  }
  
  
  #bmc-wbtn
{
	position: fixed;
	max-width:30px;
	max-height:30px;
	margin: 8px;
	    top: 8px;
    left: 8px;
	z-index: 0 !important;
}

  #bmc-wbtn img
{
	max-width:30px;
	max-height:30px;

}


donate-button-container {
	
	position: fixed; 
	    top: 20px;
    left: 20px;
	z-index: 0 !important;
}
	
  
}


/* Mobile: make the controls truly centered */
@media (max-width: 1850px) {
  .controlsRow {
   
    justify-content: center;
    /* symmetric, safe-area aware padding so it doesn't 'lean' left */

  }
  
   
  

  /* Prevent any child margin from shifting the visual center */
  .controlsRow > * {
    margin: 0 !important;
  }

  /* If you still need horizontal scrolling, let it scroll (not clip) */
  .controlsRow {
    overflow-x: auto;   /* was hidden */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
	 max-width: 960px;
  }
  
  
  
  .controlsRow::-webkit-scrollbar { display: none; }
  
  
  .statsHeader {
	  display: none !important;
	  visibility: hidden !important;
  }
    #bmc-wbtn
{
	position: fixed;
	max-width:40px;
	max-height:40px;
	margin: 8px;
	    top: 8px;
    left: 8px;
	z-index: 2 !important;
}

  #bmc-wbtn img
{
	max-width:30px;
	max-height:30px;

}

}

  .rowStat .valWrap .deltaBadge {
	  
	  font-size: 12px;
	  border: 1px solid rgba(255,255,255,.08);
	  border-radius: 5px;
	  padding: 2px;
	  
  }



/* This targets all scrollable elements */
* {
  scrollbar-width: none !important;         /* Firefox */
  -ms-overflow-style: none !important;      /* IE and Edge */
}

*::-webkit-scrollbar {
  display: none !important;                 /* Chrome, Safari, and Opera */
}

/* === Leaderboard Detail: Mobile sheet layout === */
@media (max-width: 1850px) {
  #lbDetail .modalCard {
    width: 100vw;
    max-width: 100vw;
    height: 80dvh;                 /* feel like a bottom sheet */
    max-height: 80dvh;
    border-radius: 16px 16px 0 0;  /* sheet top corners */
    padding: 12px;
    display: grid;
    grid-template-rows: auto auto auto 1fr; /* header rows + scroller */
    gap: 8px;
  }

  /* Sticky header area: Close button + title + total */
  #lbDetail .modalCard h3 {
    font-size: 1.05rem;
    line-height: 1.2;
    margin: 0;
  }
  #lbDetail .total { font-size: .95rem; opacity: .9; }

  /* Keep the X easy to hit and pinned */
  #lbDetailClose {
    position: sticky;
    top: 0;
    align-self: start;
    margin-left: auto;
    z-index: 3;
    background: transparent;
    border: 0;
    font-size: 1.25rem;
    padding: 6px;
  }

  /* Make inner content a single scroll area */
  #lbDetailScroll {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    display: grid;
    grid-auto-rows: min-content;
    gap: 10px;
    padding-bottom: 10px; /* breathing room above iOS nav bar */
  }

  /* Stats grid: 2 columns on phones, smaller gaps */
  #lbDetail .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  /* Picks: label/value pairs stack into chips that wrap */
  #lbDetail .picks {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  #lbDetail .pRow.pKey { font-size: .9rem; opacity: .9; }
  #lbDetail .pRow.pVal { display: flex; flex-wrap: wrap; gap: 6px; }
  #lbDetail .pChip { font-size: .86rem; }

  /* Breakdown chips wrap nicely and don’t overflow */
  #lbDetail .lbBreakdown { display: grid; gap: 8px; }
  #lbDetail .lbBreakItem { 
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px; padding: 8px;
    background: rgba(255,255,255,.035);
  }
  #lbDetail .lbBreakHead { 
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  }
  #lbDetail .lbBreakChips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
  #lbDetail .impactChip { font-size: .82rem; padding: .2rem .45rem; }
}




/* Prevent scroll chaining while overlays are open */
#finishOverlay.overlay,
#bonusOverlay.overlay {
  overscroll-behavior: contain;
}

/* Reduce touch delays on controls */
button, .btn { touch-action: manipulation; }


* {
	
	
}

/* Global nuclear option */
html, body, * {
  text-transform: uppercase;
}

.nocaps { text-transform: none; }

selector {
  text-transform: uppercase;
}

* {
  font-family: 'Russo One', sans-serif !important;
}

.body  {
  background-image: url('akatsuki.png');
  background-repeat: repeat;    /* Prevent tiling */
}

/* ================================
   NARUTO BUTTON SKIN
   No markup changes. Targets your existing classes and IDs.
==================================*/

/* Palette */
:root {
  --n-orange: #ff5f00;   /* jumpsuit orange */
  --n-orange-hi: #ff7a1a;
  --n-orange-lo: #bf3f00;

  --n-gold: #ffcc00;     /* hokage trim */
  --n-blue: #00c8ff;     /* rasengan */
  --n-blue-hi: #33d6ff;
  --n-leaf: #1ea94d;     /* konoha green */
  --n-red: #e11d48;      /* akatsuki red */

  --n-ink-dark: #0b0f14;
  --n-ink: #0f1420;
  --n-on-warm: #1a1200;
  --n-on-dark: #e6eefb;
}

/* Base polish stays intact but nicer focus */
.btn { position: relative; outline: none; }
.btn:focus-visible {
  outline: 2px solid var(--n-gold);
  outline-offset: 2px;
  box-shadow:
    0 0 0 4px rgba(255,204,0,.18),
    0 6px 18px rgba(0,0,0,.3),
    inset 0 1px 0 rgba(255,255,255,.06);
}
.btn[disabled], button[disabled] { filter: grayscale(.2) saturate(.7) opacity(.7); }

/* Map your existing variants to Naruto colors */

/* success → leaf green */
.btn.success {
  color: #eafff3;
  border: 1px solid color-mix(in oklab, var(--n-leaf) 75%, black 10%);
  background: linear-gradient(180deg, color-mix(in oklab, var(--n-leaf) 85%, white 8%), var(--n-leaf));
  box-shadow: 0 10px 22px rgba(20,120,60,.32), inset 0 1px 0 rgba(255,255,255,.14);
}
.btn.success:hover { filter: brightness(1.06); }
.btn.success:active { transform: translateY(1px) scale(.995); }

/* danger → akatsuki red */
.btn.danger {
  color: #ffecef;
  border: 1px solid color-mix(in oklab, var(--n-red) 70%, black 10%);
  background: linear-gradient(180deg, color-mix(in oklab, var(--n-red) 85%, white 6%), var(--n-red));
  box-shadow: 0 10px 24px rgba(160,0,40,.35), inset 0 1px 0 rgba(255,255,255,.10);
}
.btn.danger:hover { filter: brightness(1.05); }
.btn.danger:active { transform: translateY(1px) scale(.995); }

/* primary → rasengan blue */
.btn.primary {
  color: var(--n-on-dark);
  border: 1px solid color-mix(in oklab, var(--n-blue) 80%, white 0%);
  background: linear-gradient(180deg, var(--n-blue-hi), var(--n-blue));
  box-shadow: 0 10px 24px rgba(0,160,230,.28), inset 0 1px 0 rgba(255,255,255,.16);
}
.btn.primary:hover { filter: brightness(1.06); }
.btn.primary:active { transform: translateY(1px) scale(.995); }

/* .sa small alt → hokage gold */
.btn.sa {
  color: var(--n-on-warm);
  border: 1px solid color-mix(in oklab, var(--n-gold) 60%, black 8%);
  background: linear-gradient(180deg, #ffe066, var(--n-gold));
  box-shadow: 0 10px 22px rgba(180,140,0,.3), inset 0 1px 0 rgba(255,255,255,.18);
}

/* Base .btn for neutral actions keeps your dark chrome,
   but we’ll add orange outlines for certain controls via IDs below */

/* ================================
   Per-button targeting by ID
   These match your exact HTML without changing classes.
==================================*/

/* Start is your big CTA. Make it Naruto orange even though it’s .success */
#randomAllBtn.btn.success {
  color: var(--n-on-warm);
  border: 1px solid color-mix(in oklab, var(--n-orange) 70%, black 6%);
  background: linear-gradient(180deg, var(--n-orange-hi), var(--n-orange));
  box-shadow: 0 10px 24px rgba(191,63,0,.35), inset 0 1px 0 rgba(255,255,255,.16);
}

/* Stop is already .danger, inherits akatsuki red */

/* Speed buttons are .btn.sm with no variant. Give them orange outline style */
#speedBtns .btn.sm {
  color: color-mix(in oklab, var(--n-orange) 86%, white 8%);
  background: linear-gradient(180deg, #1c2736, #131c29);
  border: 1px solid color-mix(in oklab, var(--n-orange) 60%, white 0%);
}
#speedBtns .btn.sm[aria-pressed="true"] {
  filter: brightness(1.14);
  outline: 1px solid rgba(255,255,255,.28);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.22), 0 6px 18px rgba(0,0,0,.3);
}

/* Prev and Next feel navigational. Use Hokage gold so they read distinct from Reset */
#prevBtn.btn,
#nextBtn.btn {
  color: var(--n-on-warm);
  border: 1px solid color-mix(in oklab, var(--n-gold) 60%, black 8%);
  background: linear-gradient(180deg, #ffe066, var(--n-gold));
  box-shadow: 0 10px 22px rgba(180,140,0,.3), inset 0 1px 0 rgba(255,255,255,.18);
}

/* Reset is already .btn with no variant in your HTML.
   Make it destructive without changing its class */
#resetBtn.btn {
  color: #ffecef;
  border: 1px solid color-mix(in oklab, var(--n-red) 70%, black 10%);
  background: linear-gradient(180deg, color-mix(in oklab, var(--n-red) 85%, white 6%), var(--n-red));
  box-shadow: 0 10px 24px rgba(160,0,40,.35), inset 0 1px 0 rgba(255,255,255,.10);
}

/* Mute as ghost orange so it doesn’t scream */
#muteBtn.btn {
  color: var(--n-orange);
  background: transparent;
  border: 1px dashed color-mix(in oklab, var(--n-orange) 60%, white 0%);
}
#muteBtn.btn:hover { background: rgba(255,95,0,.10); border-style: solid; }

/* Overlay open button is .sa. Gold is fine. If you prefer rasengan, uncomment below */
/*
#overlayOpenBtn.btn.sa {
  color: var(--n-on-dark);
  border: 1px solid color-mix(in oklab, var(--n-blue) 80%, white 0%);
  background: linear-gradient(180deg, var(--n-blue-hi), var(--n-blue));
}
*/

/* Name box sheet button is .btn sm. Give it rasengan to read as positive action */
#sheetBtn.btn.sm {
  color: var(--n-on-dark);
  border: 1px solid color-mix(in oklab, var(--n-blue) 80%, white 0%);
  background: linear-gradient(180deg, var(--n-blue-hi), var(--n-blue));
}

/* Finish overlay buttons */
#overlaySheetBtn.btn.sm { /* download sheet */
  color: var(--n-on-dark);
  border: 1px solid color-mix(in oklab, var(--n-blue) 80%, white 0%);
  background: linear-gradient(180deg, var(--n-blue-hi), var(--n-blue));
}
#overlaySubmitBtn.btn.sm.primary { /* submit to leaderboard */
  color: var(--n-on-warm);
  border: 1px solid color-mix(in oklab, var(--n-orange) 70%, black 6%);
  background: linear-gradient(180deg, var(--n-orange-hi), var(--n-orange));
}
#overlayResetBtn.btn.danger { /* already danger mapped to akatsuki */ }

/* Bonus overlay */
#startBonusBtn.btn.sm.primary {
  color: var(--n-on-dark);
  border: 1px solid color-mix(in oklab, var(--n-blue) 80%, white 0%);
  background: linear-gradient(180deg, var(--n-blue-hi), var(--n-blue));
}

/* Dock toggle in case it shows on mobile */
#dockToggleBtn.btn {
  color: color-mix(in oklab, var(--n-orange) 86%, white 8%);
  background: linear-gradient(180deg, #1c2736, #131c29);
  border: 1px solid color-mix(in oklab, var(--n-orange) 60%, white 0%);
}

/* Pressed and hover affordances for any of the patched buttons */
#prevBtn.btn:hover,
#nextBtn.btn:hover,
#resetBtn.btn:hover,
#sheetBtn.btn.sm:hover,
#overlaySheetBtn.btn.sm:hover,
#overlaySubmitBtn.btn.sm.primary:hover,
#startBonusBtn.btn.sm.primary:hover,
#dockToggleBtn.btn:hover { filter: brightness(1.06); }
#prevBtn.btn:active,
#nextBtn.btn:active,
#resetBtn.btn:active,
#sheetBtn.btn.sm:active,
#overlaySheetBtn.btn.sm:active,
#overlaySubmitBtn.btn.sm.primary:active,
#startBonusBtn.btn.sm.primary:active,
#dockToggleBtn.btn:active { transform: translateY(1px) scale(.995); }

/* Respect high contrast users */
@media (prefers-contrast: more) {
  #randomAllBtn.btn.success { background: var(--n-orange) !important; }
  #prevBtn.btn,
  #nextBtn.btn { background: var(--n-gold) !important; }
  #resetBtn.btn { background: var(--n-red) !important; }
  #sheetBtn.btn.sm,
  #overlaySheetBtn.btn.sm,
  #startBonusBtn.btn.sm.primary { background: var(--n-blue) !important; }
}








/* ================================
   NARUTO DOCK + PANELS SKIN
   No markup changes. Works with your HTML as-is.
==================================*/

/* Palette reuse */
:root {
  --n-orange: #ff5f00;
  --n-orange-hi: #ff7a1a;
  --n-orange-lo: #bf3f00;

  --n-gold: #ffcc00;
  --n-blue: #00c8ff;
  --n-blue-hi: #33d6ff;

  --n-leaf: #1ea94d;
  --n-red: #e11d48;

  --chrome-bg: rgba(255,255,255,.04);
  --chrome-brd: rgba(255,255,255,.10);
  --chrome-brd-2: rgba(255,255,255,.14);
}

/* ================================
   Dock shell
==================================*/
.dock {
  background:
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02)) padding-box,
    radial-gradient(120% 100% at 0% 0%, rgba(255,95,0,.14), rgba(0,0,0,0) 55%) border-box;
  border: 1px solid var(--chrome-brd);
  box-shadow:
    0 10px 30px rgba(0,0,0,.35),
    0 2px 10px rgba(0,0,0,.25),
    inset 0 0 0 1px rgba(255,255,255,.04);
  border-radius: 16px;
}

/* Header in dock */
.dock .h {
  color: #ffe9c2;
  text-shadow: 0 1px 0 rgba(0,0,0,.25);
}

/* Generic panel inside dock */
.lbPanel,
#patchNotesPanel.panel {
  background:
    linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.02)) padding-box,
    linear-gradient(180deg, rgba(255,95,0,.15), rgba(255,95,0,0)) border-box;
  border: 1px solid var(--chrome-brd);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.28), 0 0 0 1px rgba(255,255,255,.02) inset;
}

/* Section titles inside these panels */
.lbPanel h3,
#patchNotesPanel h3 {
  background-image: linear-gradient(90deg, #ffcc00, #ff5f00, #00c8ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: .1rem;
}

/* ================================
   Leaderboard controls
==================================*/
.lbHeader { gap: 10px; }
.lbControls .lbSearch,
.lbControls .lbSelect {
  background: rgba(255,255,255,.06);
  border: 1px solid var(--chrome-brd-2);
  border-radius: 10px;
  color: #e6eefb;
  transition: border-color .15s ease, box-shadow .15s ease;
  outline: none;
}
.lbControls .lbSearch:focus-visible,
.lbControls .lbSelect:focus-visible {
  border-color: color-mix(in oklab, var(--n-gold) 70%, white 0%);
  box-shadow: 0 0 0 3px rgba(255,204,0,.18);
}

/* ================================
   Leaderboard list items
==================================*/
.lbList { gap: 8px; }
.lbItem {
  background:
    linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.02));
  border: 1px solid var(--chrome-brd);
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0,0,0,.22);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.lbItem:hover {
  transform: translateY(-1px);
  border-color: color-mix(in oklab, var(--n-orange) 40%, white 0%);
  box-shadow: 0 10px 22px rgba(0,0,0,.32), 0 0 0 2px rgba(255,95,0,.10) inset;
}
.lbItem:active { transform: translateY(0); }


.lbItem.second .lbRank {
  background: radial-gradient(60% 60% at 50% 40%, #e6eef7, #cbd5e1 40%, #94a3b8);
  border-color: rgba(203,213,225,.7);
}
.lbItem.third .lbRank {
  background: radial-gradient(60% 60% at 50% 40%, #ffd6a5, #ffb86b 40%, #cc7a29);
  border-color: rgba(255,184,107,.6);
}

/* Name + score */
.lbName { color: #e9f1ff; }
.lbScore {
  color: color-mix(in oklab, var(--n-blue) 80%, white 10%);
  text-shadow: 0 1px 0 rgba(0,0,0,.25);
}

/* Empty state */
#lbEmpty {
  opacity: .9;
  color: #c8d5f0;
  border: 1px dashed rgba(255,255,255,.12);
  border-radius: 10px;
  padding: .6rem .8rem;
}

/* ================================
   Leaderboard detail modal (#lbDetail)
==================================*/
#lbDetail .modalCard {
  background:
    linear-gradient(180deg, rgba(17,23,34,.98), rgba(17,23,34,.96)) padding-box,
    linear-gradient(180deg, rgba(0,200,255,.18), rgba(255,95,0,.18)) border-box;
  border: 1px solid transparent;
  box-shadow: 0 12px 40px rgba(0,0,0,.55);
}
#lbDetail h3 { 
  background-image: linear-gradient(90deg, #ffcc00, #ff5f00);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
#lbDetail .total {
  color: color-mix(in oklab, var(--n-blue) 86%, white 8%);
}

/* Stat grid inside details */
#lbDetail .grid .card {
  border: 1px solid rgba(255,255,255,.12);
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
}
#lbDetail .picks {
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 12px;
}
#lbDetail .pChip {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
}

/* Breakdown section chips */
#lbDetail .lbBreakItem {
  border: 1px solid rgba(255,255,255,.10);
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border-radius: 10px;
}
#lbDetail .lbBreakChips .impactChip {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
}
#lbDetail .lbBreakChips .impactChip.neg {
  background: rgba(225,29,72,.12);
  border-color: rgba(225,29,72,.28);
}

/* Close button hover */
#lbDetailClose:hover { filter: brightness(1.18); }

/* ================================
   Patch notes + Roadmap accordions
   You duplicated id="patchNotesPanel". Styling is generic.
==================================*/
.pnList { gap: 8px; }
.pnItem details {
  border: 1px solid var(--chrome-brd);
  background:
    linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.02));
  border-radius: 12px;
  padding: .5rem .7rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.pnItem details[open] {
  border-color: color-mix(in oklab, var(--n-orange) 40%, white 0%);
  box-shadow: 0 0 0 2px rgba(255,95,0,.10) inset;
}
.pnItem summary {
  list-style: none;
  cursor: pointer;
  color: #ffe7b8;
  text-shadow: 0 1px 0 rgba(0,0,0,.25);
}
.pnItem summary::-webkit-details-marker { display: none; }

.pnItem summary p,
.pnItem summary h3 {
  display: inline;
  margin: 0;
  background-image: linear-gradient(90deg, #ffcc00, #ff5f00);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.pnBullets {
  margin: .4rem 0 0 1.2rem;
  color: #dbe6ff;
}
.pnBullets li {
  margin: .18rem 0;
  /* cute rasengan bullets */
  position: relative;
  padding-left: .4rem;
}
.pnBullets li::before {
  content: "";
  position: absolute;
  left: -0.9rem; top: .45rem;
  width: .45rem; height: .45rem; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, var(--n-blue));
  box-shadow: 0 0 6px rgba(0,200,255,.7);
}

/* Roadmap list inherits same visuals since you reused classes */

/* ================================
   Badges and small UI bits in dock
==================================*/
.totalLevel .badge {
  background: rgba(255,255,255,.06);
  border: 5px solid rgba(255,255,255,.12);
  color: #ffe9c2;
  	width: 100%;
	height: 100%;
	    display: flex;
    justify-content: center;
	align-items: center;
}

#totalBadge {
	    display: flex;
    justify-content: center;
    height: 100px;
    align-items: center;
	font-size: 500px;
    width: 100%;
}

.sectionTitle {
  color: #ffd98a;
}

/* Progress bar accent already tracks --accent; make it Naruto if desired */
.theme-naruto .progress .bar {
  background: linear-gradient(90deg, var(--n-orange), var(--n-blue));
  box-shadow: inset 0 0 10px rgba(255,255,255,.35);
}

/* ================================
   Hover accents for links or “learn more” style .btn.link
==================================*/
.btn.link {
  color: var(--n-orange);
}
.btn.link:hover {
  color: color-mix(in oklab, var(--n-orange) 90%, white 10%);
  text-decoration-thickness: 2px;
}

/* ================================
   Mobile polish for dock panels
==================================*/
@media (max-width: 1850px) {
  .dock {
    background:
      linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02)) padding-box,
      radial-gradient(120% 100% at 0% 0%, rgba(255,95,0,.18), rgba(0,0,0,0) 65%) border-box;
    border: 1px solid var(--chrome-brd);
  }
  .lbItem:hover { transform: none; }
  
  
  #rsPanel {
	  
	  height: 180px;
	  max-width: 960px;
  }
  
}

/* ================================
   High contrast users
==================================*/
@media (prefers-contrast: more) {
  .lbItem,
  .pnItem details { background: #121821 !important; }
  .lbRank { background: #ffcc00 !important; }
  .pnItem details[open] { border-color: #ff5f00 !important; }
}





/* ================================
   NARUTO STAGE + CONTENT SKIN
   No markup changes. Targets your existing selectors.
==================================*/

/* palette reuse */
:root{
  --n-orange:#ff5f00; --n-orange-hi:#ff7a1a; --n-orange-lo:#bf3f00;
  --n-gold:#ffcc00; --n-blue:#00c8ff; --n-blue-hi:#33d6ff; --n-blue-lo:#008fb3;
  --n-leaf:#1ea94d; --n-red:#e11d48;
}

/* Stage chrome */
.stage{
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02)) padding-box,
    radial-gradient(120% 100% at 0% 0%, rgba(255,95,0,.10), rgba(0,0,0,0) 65%) border-box;
  border:1px solid rgba(255,255,255,.08);
  box-shadow: var(--soft-shadow), 0 0 0 1px rgba(255,255,255,.02) inset;
  border-radius:20px;
}

/* Stage grid gutters */
.stageBody{ gap:16px; }

/* Titles above wheel */
.inlineTitle .rollTitle{
  background-image: linear-gradient(90deg, var(--n-gold), var(--n-orange));
  -webkit-background-clip:text; background-clip:text; color:transparent;
}
.inlineRollNow #rollNow{
  color: color-mix(in oklab, var(--n-blue) 86%, white 10%);
  text-shadow: 0 1px 0 rgba(0,0,0,.35);
}

/* Wheel area */
.wheelWrap{ filter: drop-shadow(0 10px 22px rgba(0,0,0,.35)); }
canvas#wheel{
  background:
    radial-gradient(60% 60% at 50% 50%, rgba(255,255,255,.05), rgba(0,0,0,.12)),
    conic-gradient(from .25turn, rgba(255,95,0,.10), rgba(0,200,255,.10), rgba(255,95,0,.10));
  border:1px solid rgba(255,255,255,.06);
}

@keyframes naruGlow{ 0%,100%{filter:drop-shadow(0 6px 14px rgba(191,63,0,.45))} 50%{filter:drop-shadow(0 8px 20px rgba(191,63,0,.75))} }

.hub .dot{
  background: radial-gradient(circle at 35% 35%, #fff4c7, #ffd064 35%, #d08a00 70%);
  border:4px solid rgba(0,0,0,.38);
  box-shadow: inset 0 0 24px rgba(0,0,0,.45), 0 10px 34px rgba(0,0,0,.45);
}



/* Stats header in the right column */
.statsHeader .badge{
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
  color:#ffe7b8;
}
.statsHeader .progress .bar{
  background: linear-gradient(90deg, var(--n-orange), var(--n-blue));
}
#status.badge{
  color: color-mix(in oklab, var(--n-blue) 86%, white 10%);
}

/* Grid panels and attribute cards */
#statsGrid{
  background:
    linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.02));
  border:1px solid rgba(255,255,255,.08);
  border-radius:14px;
}
.card.attrCard{
  border:1px solid rgba(255,255,255,.10);
  background:
    linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.02));
  box-shadow: 0 6px 16px rgba(0,0,0,.22);
}
.card.attrCard:hover{
  box-shadow: 0 10px 24px rgba(0,0,0,.30);
  border-color: color-mix(in oklab, var(--n-orange) 35%, white 0%);
}

/* Attribute header bits */
.card .cardHead .chip{
  border-color: rgba(255,255,255,.14);
  background:
    radial-gradient(100% 100% at 30% 30%, rgba(255,255,255,.10), rgba(255,255,255,0)),
    linear-gradient(180deg, rgba(255,95,0,.18), rgba(255,95,0,0));
}
.card .cardHead .k{ color:#e9f1ff; }
.card .rarity{
  border-color: rgba(255,255,255,.14);
  max-height: 27px;

}

/* Pills and chips inside cards */
.pill{
  background: rgba(255,255,255,.07);
  border:1px solid rgba(255,255,255,.12);
}
.impactChip{
  background: rgba(255,255,255,.07);
  border:1px solid rgba(255,255,255,.12);
}
.impactChip.neg{
  background: rgba(225,29,72,.12);
  border-color: rgba(225,29,72,.28);
}

/* RS panel on the right */
.rs{
  background:
    linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.02)) padding-box,
    linear-gradient(180deg, rgba(0,200,255,.10), rgba(255,95,0,.10)) border-box;
  border:1px solid rgba(255,255,255,.08);
  border-radius:14px;
}
.rowStat{
  background: transparent;
}
.barWrap{ border:1px solid rgba(255,255,255,.10); }
.bar{
  background: linear-gradient(90deg, var(--n-orange), var(--n-blue));
}

/* Section titles inside the stage */
.sectionTitle{
  color:#ffd98a;
    display: flex;
  align-items: flex-start; /* Aligns content to the top */
  justify-content: center;
}

/* Rarity legend at bottom-right */
.rarityLabels span,
.rarityPercentages span{
  text-shadow: 0 1px 0 rgba(0,0,0,.35);
}
.rarityLabels .ex,
.rarityPercentages .ex{
background-image: 
    radial-gradient(120% 160% at 80% 0%, rgba(255, 255, 255, 0.20), rgba(255, 255, 255, 0) 60%),
    linear-gradient(135deg, #FF007F 0%, #FF69B4 40%, #FFC0FF 70%, #B2D8F7 100%);
-webkit-background-clip: text; 
background-clip: text; 
color: transparent;
text-shadow: 
    0 0 10px rgba(255, 0, 127, 0.8), /* Pink glow */
    0 0 20px rgba(255, 0, 127, 0.6), 
    0 0 30px rgba(255, 0, 127, 0.4),
    0 0 40px rgba(255, 0, 127, 0.2); /* Stronger glow effect for depth */


}

/* Finish overlay card polish to match theme, if opened from stage */
#finishOverlay .overlayCard{
  background:
    linear-gradient(180deg, rgba(17,23,34,.98), rgba(17,23,34,.96)) padding-box,
    linear-gradient(180deg, rgba(255,95,0,.16), rgba(0,200,255,.16)) border-box;
  border:1px solid transparent;
  box-shadow: 0 12px 40px rgba(0,0,0,.55);
}
#finishOverlay .hint{ color:#c8d5f0; }

/* Mobile guardrails */
@media (max-width: 1850px){
  .controlsRow{
    background:
      linear-gradient(to top, rgba(11,15,20,.96), rgba(11,15,20,.85) 60%, rgba(11,15,20,0)),
      linear-gradient(90deg, rgba(255,95,0,.12), rgba(0,200,255,.12));
  }
  .card.attrCard:hover{ box-shadow: 0 6px 16px rgba(0,0,0,.22); }
}

/* High contrast users */
@media (prefers-contrast: more){
  canvas#wheel{ background: radial-gradient(60% 60% at 50% 50%, rgba(255,255,255,.06), rgba(0,0,0,.12)); }
  .pointer{ border-bottom-color: var(--n-orange) !important; }
  .bar, .progress .bar{ background: var(--n-orange) !important; }
}





/* === Chakra Halo behind logo (no HTML changes) === */
.dock .h {
  position: relative;               /* anchor for the aura layers */
  isolation: isolate;               /* keep blend effects tidy */
}

/* Soft blue radial aura */
.dock .h::before {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  translate: -50% -50%;
  width: min(230px, 60vw);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(closest-side,
      rgba(0, 210, 255, .55),
      rgba(0, 160, 255, .28) 45%,
      rgba(0, 120, 255, .14) 65%,
      transparent 72%);
  filter: blur(10px) saturate(120%);
  animation: chakraPulse 3.6s ease-in-out infinite;
  mix-blend-mode: screen;           /* plays nicely over dark bg */
}

/* Subtle rotating energy ring */
.dock .h::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  translate: -50% -50%;
  width: min(270px, 70vw);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  background:
    conic-gradient(
      from 0turn,
      rgba(0, 200, 255, .0) 0 20%,
      rgba(0, 200, 255, .22) 25%,
      rgba(120, 240, 255, .0) 35%,
      rgba(0, 150, 255, .18) 55%,
      rgba(0, 200, 255, .0) 75%,
      rgba(100, 220, 255, .16) 90%,
      rgba(0, 200, 255, .0) 100%);
  filter: blur(12px);
  opacity: .55;
  animation: chakraSpin 14s linear infinite;
  mix-blend-mode: screen;
}

/* Keep the logo above the aura and give it some glow */
.dock .h img {
  position: relative;
  z-index: 1;
  filter:
    drop-shadow(0 10px 28px rgba(0, 170, 255, .28))
    drop-shadow(0 0 22px rgba(0, 210, 255, .26));
}

/* Animations */
@keyframes chakraPulse {
  0%, 100% { transform: scale(1);   opacity: .95; }
  50%      { transform: scale(1.05); opacity: 1;   }
}

@keyframes chakraSpin {
  to { transform: rotate(1turn); }
}

/* Optional: tighten the header so the aura centers nicely */
.dock .h {
  justify-content: center;
  align-items: center;
  padding: 8px 0;
}




/* Character submit summary: fix spacing and make it pop */
.lbSummary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.lbSummary .sumItem {
  display: flex;
  align-items: center;
  justify-content: center;
  /* the missing space */
  gap: 0.5rem;

  /* make it stand out more */
  background: linear-gradient(135deg, rgba(120, 190, 255, 0.12), rgba(140, 120, 255, 0.10));
  border: 1px solid rgba(180, 205, 255, 0.28);
  border-radius: 12px;
  padding: 0.65rem 0.9rem;
  box-shadow:
    0 8px 22px rgba(40, 80, 160, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.lbSummary .sumItem span {
  font-weight: 600;
  letter-spacing: 0.2px;
  opacity: 0.9;
}

.lbSummary .sumItem p {
  margin: 0;               /* kill default margins */
  font-size: 1.05rem;
  line-height: 2;
  font-variant-numeric: tabular-nums;
  padding: 0.5rem;
  border-radius: 8px;
	  background-image: linear-gradient(45deg, red, orange, yellow, #ff4500);
  -webkit-background-clip: text;
  color: transparent; /* Make the text color transparent so the gradient shows */
}

/* motion-safety for the dramatic types */
@media (prefers-reduced-motion: reduce) {
  .lbSummary .sumItem { box-shadow: 0 4px 12px rgba(40, 80, 160, 0.16); }
}

/* Character submit summary: fix spacing and make it pop */
.lbSummary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.lbSummary .sumItem {
  display: flex;
  align-items: center;
  justify-content: center;
  /* the missing space */
  gap: 0.5rem;

  /* make it stand out more */
  background: linear-gradient(135deg, rgba(120, 190, 255, 0.12), rgba(140, 120, 255, 0.10));
  border: 1px solid rgba(180, 205, 255, 0.28);
  border-radius: 12px;
  padding: 0.65rem 0.9rem;
  box-shadow:
    0 8px 22px rgba(40, 80, 160, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.lbSummary .sumItem span {
  font-weight: 600;
  letter-spacing: 0.2px;
  opacity: 0.9;
}

.lbSummary .sumItem p {
  margin: 0;               /* kill default margins */
  font-size: 1.05rem;
  line-height: 2;
  font-variant-numeric: tabular-nums;
  padding: 0.1rem;
  border-radius: 8px;
}

/* motion-safety for the dramatic types */
@media (prefers-reduced-motion: reduce) {
  .lbSummary .sumItem { box-shadow: 0 4px 12px rgba(40, 80, 160, 0.16); }
}

.globalRank {
	
	width: 50px;
	
}

.encyText {
	
	color: #e6eefb;
}



/* Keep both tiles wide enough to avoid wrapping under normal widths */
.lbSummary {
  display: grid;
  gap: 12px;
}

/* One-line, no-wrap stat rows */
.lbSummary .sumItem {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;     /* don't stack */
  min-width: 0;          /* allow proper flex overflow calc */
  position: relative;    /* neutralize any inherited weirdness */
}

.lbSummary .sumItem span,
.lbSummary .sumItem p {
  white-space: nowrap;   /* keep label and number on one line */
}

/* Make the numbers behave like inline pills, not block elements */
.lbSummary .sumItem p {
  display: inline-block;
  margin: 0;
  line-height: 2;
}

/* Safety: if the viewport gets comically narrow, shrink numbers slightly */
@media (max-width: 380px) {
  .lbSummary .sumItem p {
    font-size: 0.95rem;
  }
}

/* === Full-column parchment scroll skin =============================== */
.scroll-pane {
  position: relative;
  isolation: isolate;              /* keep effects self-contained */
  overflow: visible;               /* show curled edges/rods */
  border-radius: 0;                /* scrolls are flat sheets */

  /* Parchment face (warm paper + subtle grain) */
  background:
    /* faint stains/grain */
    radial-gradient(120% 80% at 12% 10%, rgba(255,255,255,.06), transparent 60%),
    radial-gradient(100% 70% at 88% 16%, rgba(255,255,255,.045), transparent 60%),
    repeating-linear-gradient(0deg, rgba(0,0,0,.03) 0 2px, rgba(0,0,0,0) 2px 6px),
    linear-gradient(180deg, rgba(255,238,200,.12), rgba(210,175,110,.10));
  box-shadow:
    0 12px 32px rgba(0,0,0,.35),          /* lift off dark stage */
    inset 0 0 0 1px rgba(0,0,0,.25),      /* outer ink line */
    inset 0 0 0 2px rgba(255,255,255,.05) /* subtle highlight rim */;
  border: 1px solid rgba(0,0,0,.35);
}

/* Top and bottom curls (rolled ends) */
.scroll-pane::before,
.scroll-pane::after {
  content: "";
  position: absolute;
  left: -10px;
  right: -10px;
  height: 18px;
  z-index: -1;                      /* behind the paper */
  background:
    radial-gradient(120% 200% at 50% 0%, rgba(0,0,0,.38), transparent 62%) top/100% 100% no-repeat,
    linear-gradient(90deg, rgba(255,255,255,.08),
                           rgba(0,0,0,.25) 20%,
                           rgba(0,0,0,.25) 80%,
                           rgba(255,255,255,.08));
  filter: blur(.25px);
}
.scroll-pane::before { top: -16px;   border-top-left-radius: 12px;  border-top-right-radius: 12px; }
.scroll-pane::after  { bottom: -16px; transform: scaleY(-1); border-bottom-left-radius: 12px; border-bottom-right-radius: 12px; }

/* Side rods (optional, pure CSS; remove if you don’t want them) */
.scroll-pane::marker { display:none; } /* defensive */
.scroll-pane .rod {
  pointer-events: none;
  position: absolute;
  top: -22px;
  bottom: -22px;
  width: 16px;
  z-index: -1;
  border-radius: 12px;
  background:
    radial-gradient(circle at 40% 20%, #ffe9b5, #ffd064 35%, #8a5a1e 70%),
    linear-gradient(180deg, rgba(255,255,255,.2), rgba(0,0,0,.25));
  border: 1px solid rgba(0,0,0,.4);
  box-shadow: inset 0 0 14px rgba(0,0,0,.35), 0 10px 22px rgba(0,0,0,.35);
}
.scroll-pane .rod.left  { left: -26px; }
.scroll-pane .rod.right { right: -26px; }

/* Gently ragged side edges using a mask (keeps content crisp) */
.scroll-pane {
  -webkit-mask-image:
    radial-gradient(12px 16px at 0 8px, transparent 60%, black 62%) left top,
    radial-gradient(12px 16px at 100% 8px, transparent 60%, black 62%) right top,
    linear-gradient(black, black);
  -webkit-mask-size: 12px 24px, 12px 24px, 100% calc(100% - 0px);
  -webkit-mask-position: left top, right top, 0 0;
  -webkit-mask-repeat: no-repeat, no-repeat, no-repeat;
  mask-composite: add;
}

/* Let your sticky controls sit “on” the paper (not in a dark chip) */
.scroll-pane .controlsRow {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* Add a faint inner divider where controls stick to the bottom */
.scroll-pane .controlsRow::before {
  content: "";
  position: absolute;
  left: 8px; right: 8px; top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,0,0,.28), transparent);
}

/* Keep the wheel’s drop shadow from overpowering the paper */
.scroll-pane .wheelWrap { filter: drop-shadow(0 8px 18px rgba(0,0,0,.32)); }

/* Mobile: slimmer curls, hide rods for space */
@media (max-width: 1850px) {
  .scroll-pane::before,
  .scroll-pane::after { left: -6px; right: -6px; height: 12px; }
  .scroll-pane .rod { display: none; }
}

/* Let the parchment “touch” the container edges */
.scroll-pane {
  /* pull the paper out through the parent padding */
  margin-top:  -12px;
  margin-bottom: -12px;

  /* give the space back inside so content doesn’t move */
  padding-top:  12px;
  padding-bottom: 12px;

  /* ensure it stretches the whole column area */
  height: calc(100% + 24px);
  align-self: stretch;
}

/* Match mobile padding (your stageBody drops to ~10px) */
@media (max-width: 1850px) {
  .scroll-pane {
    margin-top:  -10px;
    margin-bottom: -10px;
    padding-top:  10px;
    padding-bottom: 10px;
    height: calc(100% + 20px);
  }
}

/* Keep the bottom curl aligned after the shift */
.scroll-pane::after { bottom: -16px; }
/* (keep your existing ::before/::after from the scroll skin) */

/* Let the parchment “touch” the container edges */
.scroll-pane {
  /* pull the paper out through the parent padding */
  margin-top:  -12px;
  margin-bottom: -12px;

  /* give the space back inside so content doesn’t move */
  padding-top:  12px;
  padding-bottom: 12px;

  /* ensure it stretches the whole column area */
  height: calc(100% + 24px);
  align-self: stretch;
}

/* Match mobile padding (your stageBody drops to ~10px) */
@media (max-width: 1850px) {
  .scroll-pane {
    margin-top:  -10px;
    margin-bottom: -10px;
    padding-top:  10px;
    padding-bottom: 10px;
    height: calc(100% + 20px);
  }
}

/* Keep the bottom curl aligned after the shift */
.scroll-pane::after { bottom: -16px; }
/* (keep your existing ::before/::after from the scroll skin) */

.scroll-pane {
  margin-left:  -12px; padding-left:  12px;
  margin-right: -12px; padding-right: 12px;
}
@media (max-width: 1850px) {
  .scroll-pane {
    margin-left:  -10px; padding-left:  10px;
    margin-right: -10px; padding-right: 10px;
  }
}

/* Mobile fit improvements for finish overlay */

@media (max-width: 1850px) {
  #finishOverlay .overlayCard {
    width: 100%;
    max-width: 100%;
    max-height: calc(min(100svh, 100lvh, 100dvh) - 12px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding-left: 14px;
    padding-right: 14px;
  }
  #finishOverlay .row { flex-wrap: wrap; }
  #finishOverlay .btnRow { flex-wrap: wrap; justify-content: center; }
  #finishOverlay input, #finishOverlay button { max-width: 100%; }
  #finishOverlay .hint { overflow-wrap: anywhere; }
  
  .overlayRank p {
  /* Your styles here */
}
}


/* === Total Level badge animation === */
#totalLevelCount.badge { font-variant-numeric: tabular-nums; }
@keyframes levelPulse {
  0%   { transform: scale(1); box-shadow: 0 0 0 rgba(255,255,255,0); }
  40%  { transform: scale(var(--pulseScale,1.14)); box-shadow: 0 0 var(--pulseBlur,14px) rgba(255,255,255,.35); }
  100% { transform: scale(1); box-shadow: 0 0 0 rgba(255,255,255,0); }
}
#totalLevelCount.pulsing { animation: levelPulse 420ms cubic-bezier(.17,.67,.23,1); }
#totalLevelCount.down { color: #ffb4aa; border-color: rgba(255,80,80,.28); }
#totalLevelCount { font-variant-numeric: tabular-nums; }




/* EX look without sheen, with rotating text colors */
:root {
  --ex-pink: #ff69c9;
  --ex-pink-soft: #ffd2ff;
  --ex-ice: #d6ecff;
  --ex-blue: #66b3ff;
}

/* Base EX card shell (static background, no card-level animation) */
.card.ex,
.card[data-rarity="ex"] {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.28);
  background:
    radial-gradient(120% 160% at 80% 0%, rgba(255,255,255,.20), rgba(255,255,255,0) 60%),
    linear-gradient(135deg, var(--ex-pink) 0%, #ffc0ff 30%, #d0e3ff 60%, var(--ex-blue) 100%);
  box-shadow:
    0 10px 30px rgba(0,0,0,.35),
    inset 0 1px 0 rgba(255,255,255,.35);
  color: #fff; /* fallback for any text not gradient-clipped */
}

/* Subtle crosshatch foil texture (kept) */
.card.ex::before,
.card[data-rarity="ex"]::before {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.06) 0 2px, transparent 2px 6px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.05) 0 2px, transparent 2px 6px);
  mix-blend-mode: screen;
  pointer-events: none;
  transform: translateZ(0);
}

/* Removed sheen: no ::after highlight */

/* Text legibility tweaks for non-animated parts (optional) */
.card.ex .title,
.card[data-rarity="ex"] .title {
  letter-spacing: .3px;
  text-shadow: 0 2px 8px rgba(0,0,0,.45);
}
.card.ex .stat,
.card[data-rarity="ex"] .stat {
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
}

/* Rotating gradient text */
@keyframes exTextSweep {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Apply the rotating text to common elements inside EX cards */
.card.ex .title,
.card.ex .stat,
.card.ex .label,
.card.ex .value,
.card.ex .desc,
.card[data-rarity="ex"] .title,
.card[data-rarity="ex"] .stat,
.card[data-rarity="ex"] .label,
.card[data-rarity="ex"] .value,
.card[data-rarity="ex"] .desc,
.card.ex #totalLevelBadge,
.card[data-rarity="ex"] #totalLevelBadge {
  background: linear-gradient(
    90deg,
    var(--ex-pink) 0%,
    var(--ex-pink-soft) 25%,
    var(--ex-ice) 55%,
    var(--ex-blue) 85%,
    var(--ex-pink) 100%
  );
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: exTextSweep 7s linear infinite;
  /* keep it readable on busy backgrounds */
  filter: drop-shadow(0 1px 0 rgba(0,0,0,.45)) drop-shadow(0 0 6px rgba(0,0,0,.3));
}

/* Optional: make all text inside EX cards rotate without adding classes everywhere */
.card.ex,
.card[data-rarity="ex"] {
  --ex-text-anim: exTextSweep 7s linear infinite;
}
.card.ex *:not(svg):not(path),
.card[data-rarity="ex"] *:not(svg):not(path) {
  animation: var(--ex-text-anim);
  /* Only color-cycle elements that have gradient text applied.
     If an element still has normal color, this does nothing visible. */
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .card.ex .title,
  .card.ex .stat,
  .card.ex .label,
  .card.ex .value,
  .card.ex .desc,
  .card[data-rarity="ex"] .title,
  .card[data-rarity="ex"] .stat,
  .card[data-rarity="ex"] .label,
  .card[data-rarity="ex"] .value,
  .card[data-rarity="ex"] .desc,
  .card.ex #totalLevelBadge,
  .card[data-rarity="ex"] #totalLevelBadge,
  .card.ex *:not(svg):not(path),
  .card[data-rarity="ex"] *:not(svg):not(path) {
    animation: none;
    background-position: 50% 50%;
  }
}

/* ===== Fix: force gradient text to actually show ===== */

/* Shared palette + gradient token */
:root {
  --ex-pink: #ff69c9;
  --ex-pink-soft: #ffd2ff;
  --ex-ice: #d6ecff;
  --ex-blue: #66b3ff;
  --ex-grad: linear-gradient(
    90deg,
    var(--ex-pink) 0%,
    var(--ex-pink-soft) 25%,
    var(--ex-ice) 55%,
    var(--ex-blue) 85%,
    var(--ex-pink) 100%
  );
}

/* Apply gradient text to the usual suspects */
.card.ex :is(.title,.stat,.label,.value,.desc,#totalLevelBadge),
.card[data-rarity="ex"] :is(.title,.stat,.label,.value,.desc,#totalLevelBadge) {
  background-image: var(--ex-grad) !important;
  background-size: 300% 100% !important;
  background-position: 0% 50% !important;

  /* The magic combo that actually reveals the gradient as text fill */
  -webkit-background-clip: text !important;
  background-clip: text !important;
  color: transparent !important;
  -webkit-text-fill-color: transparent !important; /* Safari & some Chromium builds */

  animation: exTextSweep 7s linear infinite;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,.45)) drop-shadow(0 0 6px rgba(0,0,0,.3));
}

/* Optional: an opt-in attribute you can slap on any element that should color-cycle */
.card.ex [data-ex-chroma],
.card[data-rarity="ex"] [data-ex-chroma] {
  background-image: var(--ex-grad) !important;
  background-size: 300% 100% !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  animation: exTextSweep 7s linear infinite;
}

/* Animation keyframes (unchanged) */
@keyframes exTextSweep {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* If something renders as plain white because it's inline in a weird browser,
   making it inline-block helps the background paint correctly. */
.card.ex :is(.title,.stat,.label,.value,.desc,#totalLevelBadge),
.card[data-rarity="ex"] :is(.title,.stat,.label,.value,.desc,#totalLevelBadge),
.card.ex [data-ex-chroma],
.card[data-rarity="ex"] [data-ex-chroma] {
  display: inline-block;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .card.ex :is(.title,.stat,.label,.value,.desc,#totalLevelBadge),
  .card[data-rarity="ex"] :is(.title,.stat,.label,.value,.desc,#totalLevelBadge),
  .card.ex [data-ex-chroma],
  .card[data-rarity="ex"] [data-ex-chroma] {
    animation: none;
    background-position: 50% 50%;
  }
}

/* ===== GLASS BLUR PER RARITY =====
   Works with either .card.common or [data-rarity="common"].
   Requires the card background to be at least partially transparent.
*/

/* Base “glass” shell */
.card {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  isolation: isolate;          /* keeps effects inside */
  background: rgba(10,12,18,.35); /* translucent so backdrop-filter shows */
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 8px 28px rgba(0,0,0,.35);
}

/* The blur/tint layer */
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;                  /* sits behind content but inside card */
  background: var(--rarity-tint, rgba(255,255,255,.08));
  backdrop-filter: blur(var(--rarity-blur, 10px)) saturate(1.1);
  -webkit-backdrop-filter: blur(var(--rarity-blur, 10px)) saturate(1.1); /* Safari */
  /* soft inner glow so the glass reads even with busy BGs */
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), inset 0 10px 40px rgba(255,255,255,.06);
}

/* Fallback when backdrop-filter isn’t available */
@supports not (backdrop-filter: blur(10px)) {
  .card::after {
    background:
      linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02)) ,
      var(--rarity-fallback, rgba(255,255,255,.05));
    filter: none;
  }
}

/* ===== RARITY TOKENS ===== */
:root {
  /* tweak these if your palette shifts */
  --blur-s: 6px;
  --blur-m: 10px;
  --blur-l: 14px;
  --blur-xl: 18px;
}

/* Common */
.card.common,
.card[data-rarity="common"] {
  --rarity-tint: rgba(180, 200, 220, .12);
  --rarity-fallback: rgba(180, 200, 220, .08);
  --rarity-blur: var(--blur-s);
  border-color: rgba(200,220,240,.10);
}

/* Uncommon */
.card.uncommon,
.card[data-rarity="uncommon"] {
  --rarity-tint: rgba(120, 230, 170, .12);
  --rarity-fallback: rgba(120, 230, 170, .08);
  --rarity-blur: var(--blur-m);
  border-color: rgba(120,230,170,.18);
}

/* Rare (blue) */
.card.rare,
.card[data-rarity="rare"] {
  --rarity-tint: rgba(80, 160, 255, .12);
  --rarity-fallback: rgba(80, 160, 255, .08);
  --rarity-blur: var(--blur-m);
  border-color: rgba(80,160,255,.20);
}

/* Epic (purple) */
.card.epic,
.card[data-rarity="epic"] {
  --rarity-tint: rgba(170, 110, 255, .13);
  --rarity-fallback: rgba(170, 110, 255, .09);
  --rarity-blur: var(--blur-l);
  border-color: rgba(170,110,255,.22);
}

/* Legendary (gold) */
.card.legendary,
.card[data-rarity="legendary"] {
  --rarity-tint: rgba(255, 210, 110, .14);
  --rarity-fallback: rgba(255, 210, 110, .10);
  --rarity-blur: var(--blur-l);
  border-color: rgba(255,210,110,.26);
border-radius: 18px;
  box-shadow: 0 10px 36px rgba(255,210,110,.12), 0 8px 24px rgba(0,0,0,.35);
}

/* Mythic (pink) */
.card.mythic,
.card[data-rarity="mythic"] {
  --rarity-tint: rgba(255, 120, 200, .16);
  --rarity-fallback: rgba(255, 120, 200, .12);
  --rarity-blur: var(--blur-xl);
  border-color: rgba(255,120,200,.28);
  box-shadow: 0 10px 36px rgba(255,120,200,.12), 0 8px 24px rgba(0,0,0,.35);
}

/* EX (your pink ↔ blue aesthetic) */
.card.ex,
.card[data-rarity="ex"] {
  --rarity-tint: rgba(255, 120, 200, .12);            /* pink glass */
  --rarity-fallback: rgba(255, 120, 200, .10);
  --rarity-blur: var(--blur-xl);
  border-color: rgba(255,255,255,.28);
}

/* Optional: vignette to add depth without extra filters */
.card > .vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 140% at 50% 10%, rgba(0,0,0,0) 0%, rgba(0,0,0,.22) 95%);
  mix-blend-mode: multiply;
}

/* ===== Legendary upgrade kit ===== */
:root {
  --leg-gold-1: #fee9a0;
  --leg-gold-2: #ffd36b;
  --leg-gold-3: #ffba45;
  --leg-amber:   #ffecb3;
  --leg-shadow:  rgba(0,0,0,.35);
}

/* Base legendary shell */
.card.legendary,
.card[data-rarity="legendary"] {
  position: relative;
  isolation: isolate;
  border-radius: 18px;
  overflow: hidden;
  /* translucent to let backdrop-filter glass from your rarity system show through */
  background:
    radial-gradient(140% 180% at 50% 0%, rgba(255,255,255,.18), rgba(255,255,255,0) 55%),
    linear-gradient(180deg, rgba(255,240,210,.10), rgba(255,210,120,.08));
  border: 1px solid rgba(255,240,190,.35);
  box-shadow:
    0 10px 36px rgba(255,210,110,.12),
    0 8px 24px var(--leg-shadow),
    inset 0 1px 0 rgba(255,255,255,.25);
}

/* Animated gilded border using a conic-gradient ring */
/* Static gilded border using border-image */
.card.legendary,
.card[data-rarity="legendary"] {
  border: 2px solid transparent;
  border-radius: 18px;
  background-clip: padding-box; /* keeps the interior from inheriting the border gradient */
}


/* Soft foil noise without images, keeps GPU happy */
.card.legendary::after,
.card[data-rarity="legendary"]::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  mix-blend-mode: overlay;
  opacity: .25;
  background:
    repeating-conic-gradient(
      from 0deg,
      rgba(255,255,255,.22) 0 6deg,
      rgba(0,0,0,.00) 6deg 12deg
    ),
    repeating-linear-gradient(
      135deg,
      rgba(255,255,255,.05) 0 2px,
      rgba(0,0,0,0) 2px 6px
    );
  filter: blur(.2px);
}

/* Title emboss and jeweled dot */
.card.legendary .title,
.card[data-rarity="legendary"] .title {
  letter-spacing: .4px;
  color: var(--leg-amber);
  text-shadow:
    0 1px 0 rgba(0,0,0,.45),
    0 0 14px rgba(255,220,140,.45);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.card.legendary .title::after,
.card[data-rarity="legendary"] .title::after {
  content: "";
  width: .65em;
  height: .65em;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, #fff 0 35%, rgba(255,255,255,0) 36%),
    radial-gradient(circle at 70% 70%, #ffae2b, #804a00 70%);
  box-shadow: 0 0 10px rgba(255,210,110,.6);
}

/* Corner filigree that appears on hover */
.card.legendary .filigree,
.card[data-rarity="legendary"] .filigree {
  position: absolute;
  inset: 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s ease;
  background:
    radial-gradient(40% 40% at 0% 0%, rgba(255,220,140,.18), rgba(255,220,140,0) 60%),
    radial-gradient(40% 40% at 100% 0%, rgba(255,220,140,.18), rgba(255,220,140,0) 60%),
    radial-gradient(40% 40% at 0% 100%, rgba(255,220,140,.18), rgba(255,220,140,0) 60%),
    radial-gradient(40% 40% at 100% 100%, rgba(255,220,140,.18), rgba(255,220,140,0) 60%);
  border-radius: inherit;
}
.card.legendary:hover .filigree,
.card[data-rarity="legendary"]:hover .filigree {
  opacity: 1;
}

/* Subtle lift and glint on hover */
.card.legendary:hover,
.card[data-rarity="legendary"]:hover {
  transform: translateY(-2px);
  box-shadow:
    0 14px 44px rgba(255,210,110,.16),
    0 10px 30px var(--leg-shadow),
    inset 0 1px 0 rgba(255,255,255,.35);
}

/* Optional: big number gets a gold gradient text treatment */
.card.legendary #totalLevelBadge,
.card[data-rarity="legendary"] #totalLevelBadge {
  background: linear-gradient(90deg, #fff6cc, #ffd36b, #ffb341, #ffd36b, #fff6cc);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: legText 8s linear infinite;
  text-shadow: 0 1px 0 rgba(0,0,0,.45);
}
@keyframes legText {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .card.legendary::before,
  .card[data-rarity="legendary"]::before { animation: none; }
  .card.legendary:hover,
  .card[data-rarity="legendary"]:hover { transform: none; }
  .card.legendary #totalLevelBadge,
  .card[data-rarity="legendary"] #totalLevelBadge { animation: none; }
}

:root {
  --epic-1: #e1a4ff;
  --epic-2: #c070ff;
  --epic-3: #7c3cff;
}

/* Outer glowing animated border */
.card.epic::before,
.card[data-rarity="epic"]::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: conic-gradient(from var(--epic-rot, 0deg),
    var(--epic-1),
    var(--epic-2),
    var(--epic-3),
    var(--epic-2),
    var(--epic-1)
  );

  /* Proper mask for ring cutout */
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;

  pointer-events: none;
  animation: epicBorderSpin 14s linear infinite;
}

@keyframes epicBorderSpin {
  to { --epic-rot: 360deg; }
}

.card.epic,
.card[data-rarity="epic"] {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background:
    radial-gradient(circle at 30% 30%, rgba(140, 0, 255, .25), transparent 60%),
    radial-gradient(circle at 70% 80%, rgba(255, 0, 255, .18), transparent 60%),
    rgba(40, 0, 60, .6);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(200, 150, 255, .35);
  box-shadow:
    0 8px 24px rgba(140, 80, 255, .25),
    inset 0 1px 0 rgba(255, 255, 255, .1);
  isolation: isolate;
}
@keyframes epicNebula {
  0%   { background-position: 0% 0%; }
  50%  { background-position: 100% 100%; }
  100% { background-position: 0% 0%; }
}

.card.epic,
.card[data-rarity="epic"] {
  background-size: 200% 200%;
  animation: epicNebula 20s ease-in-out infinite;
}


@keyframes epicTextSweep {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.card.epic .title,
.card.epic .stat,
.card[data-rarity="epic"] .title,
.card[data-rarity="epic"] .stat {
  background: linear-gradient(90deg, #e4b3ff, #ff70f5, #b070ff, #e4b3ff);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: epicTextSweep 8s linear infinite;
  text-shadow: 0 2px 8px rgba(100, 0, 140, 0.6);
}


#totalLevelCount {
	
	font-size: 2rem;
}

.lbMeta {
	
	display: none !important;
	visibility: hidden !important;
}



.socialIcons {
	width: 100%;
		  display: flex !important;
  justify-content: center !important;
  align-items: center!important;
      background-image: linear-gradient(90deg, #ffcc00, #ff5f00, #00c8ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
	
	
}




/* Saved name display inside Finish overlay */
.overlayName{margin:0 0 6px 0;font-size:0.95rem;opacity:0.95; 	width: 100%;
		  display: flex !important;
  justify-content: center !important;
  align-items: center!important;
  font-size: 28px;
      background-image: linear-gradient(45deg, red, orange, yellow, #ff4500);
    -webkit-background-clip: text;
    color: transparent;
  
  }

#finishTitle{
	
width: 100%;
display: flex !important;
justify-content: center !important;
align-items: center!important;
  
 }
 
 /* Ninja Spinner Loading Overlay */
.nsl[hidden] { display: none !important; }
.nsl { position: fixed; inset: 0; z-index: 100000; display: grid; place-items: center; }
.nsl-scrim { position: absolute; inset: 0; background: color-mix(in oklab, #0b0f14 85%, transparent); backdrop-filter: blur(2px); }

.nsl-card {
  position: relative; z-index: 1; width: min(420px, 86vw);
  padding: 20px 20px 16px; border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  box-shadow:
    0 12px 28px rgba(0,0,0,.45),
    inset 0 1px 0 rgba(255,255,255,.08),
    inset 0 0 0 1px rgba(255,255,255,.06);
  color: #e6edf3;
}

.nsl-title { margin: 10px 0 12px; font: 700 18px/1.2 "Russo One", system-ui, sans-serif; letter-spacing: .3px; 


width: 100%;
display: flex !important;
justify-content: center !important;
align-items: center!important;

}

.nsl-bar { height: 10px; border-radius: 999px; background: rgba(255,255,255,.12); overflow: hidden; }
.nsl-bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, #39d353, #1f6feb); transition: width .18s ease; }

.nsl-spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.22);
  border-top-color: #ffb703; margin: 0 auto 8px;
  animation: nsl-spin .8s linear infinite;
}
@keyframes nsl-spin { to { transform: rotate(360deg); } }
.nsl.nsl-reduced .nsl-spinner { animation: none; }


  #legal-modal.hidden { display: none; }
  #legal-modal.open { display: block; }
  #legal-modal { position: fixed; inset: 0; z-index: 9999; }
  .ns-legal__backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); }
  .ns-legal__dialog {
    position: fixed; left: 50%; top: 50%;
    transform: translate(-50%, -50%) translateY(8px);
    opacity: 0; transition: transform 160ms ease-out, opacity 160ms ease-out;
    width: min(900px, 92vw); max-height: 90vh; overflow: auto;
    background: #101215; color: #eaecef; border-radius: 12px; padding: 16px;
    will-change: transform, opacity; contain: content;
  }
  #legal-modal.open .ns-legal__dialog { transform: translate(-50%, -50%) translateY(0); opacity: 1; }
  .ns-legal__tabs { display: flex; gap: 8px; margin: 8px 0 12px; flex-wrap: wrap; }
  .ns-legal__tab { padding: 6px 10px; border-radius: 8px; border: 1px solid #2a2f3a; background: #151922; color: inherit; cursor: pointer; }
  .ns-legal__tab[aria-selected="true"] { background: #1f2633; border-color: #3a4252; }
  .ns-legal__content { border: 1px solid #2a2f3a; border-radius: 10px; padding: 12px; max-height: 60vh; overflow: auto; content-visibility: auto; contain-intrinsic-size: 800px 1200px; }
  .ns-legal__header { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
  .ns-legal__title { margin: 0; }
  .ns-legal__subtitle { margin: 0; opacity: .7; font-size: .9rem; }
  .ns-legal__close, .ns-legal__close-secondary { background: #2a2f3a; color: #fff; border: none; padding: 6px 10px; border-radius: 8px; cursor: pointer; }
  .ns-legal__footer { display: flex; justify-content: flex-end; margin-top: 12px; }
  @media (prefers-reduced-motion: reduce) { .ns-legal__dialog { transition: none; } }