.defense-line-card { cursor: default; }
.defense-line-card:focus-visible { outline: 2px solid #f4f0df; outline-offset: 4px; }
.defense-placement-ghost { position:fixed!important; z-index:10000; display:block; width:1em; height:1em; pointer-events:none; transform:translate(-50%,-50%)!important; line-height:1!important; }
.defense-piece-stack .defense-placement-pawn { display:block; width:100%; height:100%; font-size:1em!important; text-align:center; line-height:1!important; }
.defense-placement-count { position:absolute; right:-.05em; bottom:-.08em; display:grid; place-items:center; min-width:1.25em; height:1.25em; padding:0 .15em; border:1px solid #b89450; border-radius:50%; background:#17231f; color:#e7b84f; font:800 calc(.3em * var(--defense-count-scale,1))/1 system-ui,sans-serif; text-shadow:none; }
.powerup-card-rail .defense-placement-count { position:absolute; right:-.05em; bottom:-.08em; display:grid; place-items:center; min-width:1.25em; height:1.25em; padding:0 .15em; border:1px solid #527d95; border-radius:50%; background:#284759; color:#f4f0df; font:800 calc(.3em * var(--defense-count-scale,1))/1 system-ui,sans-serif; text-shadow:none; }
.defense-placement-ghost[hidden] { display:none!important; }
body.defense-placement-active #board, body.defense-placement-active #board * { cursor:none!important; }
.powerup-card-group { display:grid; grid-template-rows:auto minmax(22px,1fr) auto; align-content:center; gap:1px; box-sizing:border-box; padding:2px 3px; border:0; border-radius:7px; background:#284759; color:#f4f0df; box-shadow:none; font:11px/1.05 system-ui,sans-serif; text-align:center; }
.powerup-group-title { display:block; min-width:0; margin:0; color:#f4f0df; font-size:11px; line-height:1.05; overflow-wrap:anywhere; }
.powerup-group-title>span { white-space:nowrap; }
.powerup-group-content { display:flex; min-width:0; align-items:center; justify-content:center; gap:3px; min-height:22px; }
.powerup-group-content small { min-width:0; font-size:11px; line-height:1.05; overflow-wrap:anywhere; }
.powerup-group-content .mystery-reel-glyph { display:block; flex:0 0 22px; width:22px; height:22px; font-size:22px!important; line-height:22px; color:#f4f0df; }
.powerup-group-content .mystery-reward-piece { transform-origin:center; animation:king-check-spin-retro 1.25s steps(8,end) infinite; cursor:grab; }
.powerup-group-content svg { flex:0 0 22px; width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:2; }
.powerup-group-content button, .powerup-group-navigation button { box-sizing:border-box; min-width:20px; min-height:20px; margin:0; padding:1px 3px; border:1px solid #527d95; border-radius:3px; color:#f4f0df; background:#284759; font:inherit; line-height:14px; cursor:pointer; }
.powerup-group-navigation { display:flex; min-width:0; align-items:center; justify-content:space-between; gap:2px; }
.powerup-group-navigation span { min-width:0; overflow-wrap:anywhere; }
.powerup-group-navigation button { flex:0 0 20px; }
.powerup-card-group button:focus-visible { outline:2px solid #f4f0df; outline-offset:1px; }
.powerup-group-content .powerup-two-x { font-size:20px; }

.defense-piece-stack{position:relative;display:block;width:1em;height:1em;line-height:1;color:#fffdf0}
.defense-activate{display:grid;place-items:center;width:100%;height:100%;margin:0;padding:0;border:0;border-radius:50%;background:transparent;color:inherit;font:inherit;cursor:pointer}
.defense-activate .defense-piece-stack{font-size:calc(var(--powerup-card-width,106px) * .38)}
.defense-activate:disabled{opacity:1;cursor:default}.defense-activate:focus-visible{outline:2px solid #f4f0df;outline-offset:3px}
.defense-activate,.mystery-box.ready{touch-action:none;user-select:none;-webkit-user-select:none}

/* Shared rows keep every title, medallion, subtitle and description aligned.
   Only the personal-project button palette is used inside cards:
   #284759, #527d95 and #f4f0df. The dragged-pawn badge remains historical. */
.powerup-card-rail .defense-piece-stack,
.powerup-card-rail .piece { color:#f4f0df;text-shadow:none; }
/* Shared dimensions remain unchanged. */
.powerup-card-rail {
  --powerup-blue:#284759;
  --powerup-blue-light:#527d95;
  --powerup-rim:#f4f0df;
  --powerup-ink:#f4f0df;
  --powerup-card-fill:#284759;
  --powerup-title:#f4f0df;
  --powerup-copy:#f4f0df;
}
.powerup-card-rail .mystery-card {
  display:grid;
  grid-template-columns:minmax(0,1fr);
  grid-template-rows:calc(var(--powerup-card-width) * .24) calc(var(--powerup-card-width) * .6842) calc(var(--powerup-card-width) * .46) minmax(0,1fr) calc(var(--powerup-card-width) * .14);
  justify-items:center;
  align-items:start;
  align-content:stretch;
  gap:calc(var(--powerup-card-width) * .04);
  padding:calc(var(--powerup-card-width) * .08) calc(var(--powerup-card-width) * .0658);
  border:0;
  border-radius:calc(var(--powerup-card-width) * .08);
  background:var(--powerup-card-fill);
  color:var(--powerup-ink);
  box-shadow:none;
  font-family:system-ui,sans-serif;
  text-shadow:none;
}
.powerup-card-rail .mystery-label {
  grid-row:1;
  width:100%;
  margin:0;
  color:var(--powerup-title);
  font-size:calc(var(--powerup-card-width) * .1053);
  line-height:1.12;
  letter-spacing:.04em;
}
.powerup-card-rail .mystery-reel {
  grid-row:2;
  margin:0;
  --powerup-ink:#f4f0df;
  color:#f4f0df;
  background:#527d95;
  /* Blue medallion, ivory rim and ivory-tinted inner glow. */
  border-color:var(--powerup-rim);
  box-shadow:inset 0 0 calc(var(--powerup-card-width) * .1316) #f4f0df33;
}
.powerup-card-rail .mystery-card > strong {
  grid-row:3;
  width:100%;
  margin:0;
  color:var(--powerup-ink);
  font-size:calc(var(--powerup-card-width) * .123);
  line-height:1.12;
  font-weight:750;
  overflow-wrap:normal;
}
.powerup-card-rail .mystery-card > p {
  grid-row:4;
  width:100%;
  min-width:0;
  margin:0;
  color:var(--powerup-copy);
  font-size:calc(var(--powerup-card-width) * .108);
  line-height:1.22;
  overflow-wrap:normal;
}
.powerup-card-rail .mystery-card > .powerup-remaining {
  grid-row:5;
  margin:0;
  color:var(--powerup-title);
  font-size:calc(var(--powerup-card-width) * .1053);
  line-height:1.1;
}
.powerup-card-rail .powerup-icon .powerup-symbol {
  display:block;
  width:calc(var(--powerup-card-width) * .46);
  height:calc(var(--powerup-card-width) * .46);
  color:var(--powerup-ink);
  fill:none;
  stroke:none;
  overflow:visible;
}
