/* Equipment: the hero stage and stat tiles, the bag and sort bar, the gear and stat dialogs, and the profile. */
/* Equipment inspection: portrait + stat, skill panel, anchored upgrade controls. */
[data-modal-type="gear"] { border: 3px solid var(--slate-900); border-radius: 16px; }
[data-modal-type="gear"] .modal-title { padding: 24px 38px 15px; font-size: clamp(21px, 4.5vw, 29px); }
[data-modal-type="gear"] .modal-body { padding: 22px 14px 0; text-align: left; }

/* Compact equipment details keep the selected item, its benefit and actions together. */
[data-modal-type="gear"] .modal-body { padding:20px 16px 22px; }

[data-modal-type="gear"] .modal-title{position:relative;padding-top:24px}
.evo-gear-tag {position:absolute;top:3px;left:4px;font-size:11px;color:#fff;text-shadow:1px 1px var(--slate-950),-1px -1px var(--slate-950);z-index:2;}
.equipment {
  padding: 0 13px 24px;
}
.hero-stage {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  padding: 0 13px;
}
.gear-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hero-center {
  position: relative;
  display: flex;
  align-items: center;
  flex-direction: column;
  z-index: 0;
}
.hero-glow {
  width: 190px;
  height: 190px;
  position: absolute;
  top: -20px;
  /* Warm spotlight: a white glow reads blue-gray on the slate background. */
  background: radial-gradient(#ffe7a04d, transparent 66%);
  z-index: -1;
}
.hero-name {
  font-weight: 900;
  font-size: 14px;
  text-shadow: none;
  margin-top: 12px;
  background: var(--slate-800);
  border-radius: 6px;
  padding: 4px 10px;
}
.hero-center > .painted-sprite {
  margin-top: -8px;
  margin-bottom: -8px;
}
.hero-stage {
  min-height: 226px;
}
.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin: 16px 0;
}
.profile-stats span {
  padding: 10px 4px;
  border-radius: 8px;
  background: var(--slate-800);
  color: #d8e9ed;
  font-size: 10px;
}
.profile-stats b {
  display: block;
  color: #fff;
  font-size: 19px;
  margin-bottom: 5px;
}
.equipment-bag {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  padding: 12px;
}
.equipment-bag .item-tile {
  width: 100%;
  height: 84px;
}
.equipment-bag .item-tile small {
  position: absolute;
  top: 1px;
  right: 3px;
  font-size: 10px;
  color: white;
  -webkit-text-stroke: 1.5px var(--slate-950);
  paint-order: stroke fill;
  text-shadow: none;
}
.inventory-sort-region {
  overflow-anchor: none;
}
.equipment-sort-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px 0;
}
.equipment-sort-bar .btn {
  min-width: 132px;
  padding: 8px 16px;
  font-size: 15px;
}
.equipment-showcase { padding: 20px 6px 16px; }
.equipment-showcase .hero-stage { min-height: 250px; }
.equipment-showcase .hero-center { transform: translateY(-20px); }
.equipment-showcase .gear-column { gap: 14px; }
.equipment-showcase .item-tile { border-radius: 13px; }
/* Equipment stat tiles: push-button frame (2px ink, 3px drop) on a soft surface.
   Cream when an upgrade is available, gray when it isn't. */
.player-stat { display:flex;flex-direction:column;align-items:center;justify-content:center;width:88px;min-height:105px;border:2px solid var(--ink);border-radius:16px;background:var(--cream);color:var(--ink);box-shadow:0 var(--button-depth) var(--button-drop);padding:5px; }
.player-stat:active:not(:disabled) {transform:translateY(2px);box-shadow:0 1px var(--button-drop)}
.player-stat.upgrade-unavailable { background:var(--gray); }
.player-stat b {font-size:12px}.player-stat span {font-size:17px;color:var(--ink)}
.fixed-gear-actions{display:grid;gap:12px;margin-top:18px}
/* Size the stage from the shell, not the viewport: a narrow desktop shell still needs both stat columns inside it. */
.equipment-showcase .hero-stage{gap:6px}
.equipment-showcase .gear-column{flex:0 1 88px;min-width:66px}
.equipment-showcase .player-stat{width:100%}
.equipment-showcase .hero-center{flex:0 1 150px;min-width:0}
.equipment-showcase .hero-center>.painted-sprite{width:100%;max-width:150px;height:auto;aspect-ratio:1;position:relative;top:-8px;filter:drop-shadow(2px 2px 0 #fffdf0) drop-shadow(-2px -2px 0 #fffdf0)}

.fixed-gear-portrait{display:flex;align-items:center;justify-content:center;width:132px;height:132px;margin:0 auto 12px;border:3px solid var(--slate-800);border-radius:20px;overflow:hidden;}
.fixed-gear-portrait .painted-sprite{position:static;flex:none}

.fixed-gear-portrait[class*="grade-"]{background:var(--rarity)}
.equipment-detail-row { display:grid;grid-template-columns:100px minmax(0,1fr);align-items:center;gap:16px; }
.equipment-detail-row .fixed-gear-portrait { width:100px;height:100px;margin:0;border-radius:18px; }
.equipment-detail-bonus { display:flex;align-items:center;gap:10px;min-width:0; }
.equipment-detail-bonus > .painted-sprite { flex-shrink:0; }
.equipment-detail-bonus b { display:block;font-size:18px;line-height:1.2;color:#fff; }
.equipment-detail-bonus strong { display:block;margin-top:6px;font-size:20px;line-height:1.2;color:#baff65; }
.gear-bonus-change { display:block;width:fit-content;margin:16px auto 0;padding:6px 18px;border-radius:14px;background:var(--slate-500);font-size:20px;line-height:1.2;color:#50ed16;-webkit-text-stroke:2px var(--ink);paint-order:stroke fill; }
.gear-bonus-change.down { color:var(--red-top); }
[data-modal-type="gear"] .fixed-gear-actions { margin-top:22px; }
[data-modal-type="gear"] .fixed-gear-actions .btn { width:100%;min-width:0; }
@media(max-width:360px){.equipment-detail-row{grid-template-columns:86px minmax(0,1fr);gap:10px}.equipment-detail-row .fixed-gear-portrait{width:86px;height:86px}.equipment-detail-bonus{gap:6px}.equipment-detail-bonus b{font-size:16px}.equipment-detail-bonus strong{font-size:17px}.equipment-detail-bonus > .painted-sprite{width:34px;height:34px}
}

/* Use the actual affected card artwork as a compact equipment badge. */
.equipment-card-badge {
  position:absolute;top:3px;left:3px;width:29px;height:29px;
  display:flex;align-items:center;justify-content:center;
  background:#fff0ba;border:2px solid var(--slate-800);border-radius:9px;
  box-shadow:0 2px 0 #26354b55;pointer-events:none;
}
.equipment-card-badge > .painted-sprite {width:23px;height:23px;flex-shrink:0}

/* Leave the affected-card badge clear and group duplicate counts at the foot. */
.equipment-tile-meta {position:absolute;bottom:3px;left:0;right:0;display:flex;justify-content:center;align-items:center;gap:3px}
.equipment-bag .equipment-tile-meta small {position:absolute;top:auto;right:3px;bottom:0;left:auto;transform:none;z-index:2;min-width:32px;font-size:18px;line-height:23px;letter-spacing:1px;padding:1px 5px;border:2px solid #eaf5ff;border-radius:14px;background:var(--slate-900);color:white;-webkit-text-stroke:0;text-shadow:none;box-shadow:0 2px 0 var(--slate-950)}
/* The duplicate-count pill hangs below the tile, so lift the tag clear of it. */
.equipment-bag .equipment-tile-meta:has(small) em {margin-bottom:19px}
@media(max-width:360px){.equipment-bag .equipment-card-badge{width:25px;height:25px}.equipment-bag .equipment-card-badge>.painted-sprite{width:20px;height:20px}.equipment-tile-meta{gap:2px}.equipment-bag .equipment-tile-meta small{padding-inline:3px}
}

/* Leave room for duplicate counts hanging below each equipment tile. */
.equipment-bag {row-gap:20px;padding-bottom:22px}
/* Each sort group starts on a fresh row under its own label for quick scanning. */
.equipment-group-label {margin:0;padding:10px 12px 0;color:white;font-size:13px;letter-spacing:1px;text-transform:uppercase;-webkit-text-stroke:3px #1d3a52;paint-order:stroke fill;text-shadow:0 2px 0 #1d3a52}

.equipment-replace > b {display:block;text-align:center;margin-bottom:12px;font-size:16px;color:var(--slate-900)}
.equipment-replace-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.equipment-replace-grid .item-tile {width:100%;height:auto;aspect-ratio:1;min-height:92px;padding:5px;cursor:pointer}
.equipment-replace-grid .item-tile:focus-visible {outline:3px solid white;outline-offset:3px}
@media(max-width:360px){.equipment-replace-grid{gap:7px}.equipment-replace-grid .item-tile{min-height:84px}.equipment-replace-grid .equipment-card-badge{width:25px;height:25px}.equipment-replace-grid .equipment-card-badge > .painted-sprite{width:20px;height:20px}
}

.equipment-equipped-check {position:absolute;right:3px;top:3px;width:23px;height:23px;border:2px solid #25452a;border-radius:50%;background:#8ee244;box-shadow:inset 0 2px #d8ff9a,0 1px #25452a;display:grid;place-items:center;z-index:3}
.equipment-equipped-check {color:#163b22}
.equipment-equipped-check svg {width:16px;height:16px}
.equipment-tile-meta:has(.equipment-equipped-check) {top:0;bottom:3px;pointer-events:none}
@media(max-width:360px){.equipment-equipped-check{width:21px;height:21px;right:2px;top:2px}.equipment-equipped-check svg{width:14px;height:14px}
}

.equipped-bonus-summary {
  position:absolute;top:calc(100% + 8px);left:50%;transform:translateX(-50%);
  width:138px;display:grid;gap:3px;
}
.equipped-bonus-row {
  display:flex;align-items:center;gap:5px;min-height:27px;padding:1px 5px;
  border-radius:8px;background:#254859;color:#c5ff80;
}
.equipped-bonus-row > svg {flex-shrink:0;width:26px;height:26px}
.equipped-bonus-row b {font-size:11px;line-height:1.25;padding-block:3px}
.equipped-bonus-row b > span {display:block;white-space:nowrap}
@media(max-width:360px){
 .equipped-bonus-summary{width:113px}
 .equipped-bonus-row{gap:3px;padding:1px 3px}
 .equipped-bonus-row b{font-size:10px}
 .equipped-bonus-row > svg{width:23px;height:23px}
}
.screen.equipment {background-color:var(--slate-700)}
.screen.equipment {background-image:var(--pattern-equipment)}
@media(prefers-reduced-motion:no-preference) {
.equipment-showcase .hero-center > .painted-sprite {
    animation:equipment-dane-idle 2.6s ease-in-out infinite;
  }
}

/* Unit top-left, equipped top-right, bonus bottom-left, count bottom-right. */
.equipment-stat-badge {position:absolute;bottom:3px;left:3px;width:29px;height:29px;display:grid;place-items:center;background:#fff0ba;border:2px solid var(--slate-800);border-radius:9px;box-shadow:0 2px 0 #26354b55;pointer-events:none}
.equipment-stat-badge > svg {width:23px;height:23px}
@media(max-width:360px){.equipment-stat-badge{width:25px;height:25px}.equipment-stat-badge > svg{width:20px;height:20px}
}

/* Dane profile: portrait, level with XP, lifetime stats, upgrade. */
.profile-modal .modal-body{display:flex;flex-direction:column;align-items:center;gap:14px;padding:18px 16px 20px}
.profile-hero{display:grid;place-items:center;width:150px;height:150px;border-radius:50%;background:radial-gradient(circle,#fff3b0 0,#ffe48a55 45%,#0000 70%)}
.profile-level{width:100%;display:flex;flex-direction:column;align-items:center;gap:7px}
.profile-level b{font-size:24px;color:#fff3cf;-webkit-text-stroke:4px var(--slate-900);paint-order:stroke fill}
.profile-xp{position:relative;width:100%;height:26px;border:3px solid var(--slate-900);border-radius:13px;background:var(--slate);overflow:hidden}
.profile-xp i{position:absolute;inset:0 auto 0 0;background:var(--green-top);box-shadow:inset 0 -4px var(--green)}
.profile-xp span{position:relative;display:block;line-height:20px;font-size:13px;color:#fff;-webkit-text-stroke:3px var(--slate-900);paint-order:stroke fill}
.profile-stats{width:100%;display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.profile-stats div{display:flex;flex-direction:column;align-items:center;gap:3px;padding:9px 4px 8px;border-radius:12px;background:var(--slate-500);border-top:3px solid var(--slate);box-shadow:0 3px #4d647766}
.profile-stats b{font-size:18px;line-height:1;color:#fff;-webkit-text-stroke:3px var(--slate-900);paint-order:stroke fill}
.profile-stats small{font-size:10px;color:#e2ebf1;text-transform:uppercase;letter-spacing:.3px}
.profile-modal .modal-body>.btn{margin:2px 0 0;min-width:200px}

/* Compact, shared presentation for every permanent stat upgrade. */
.stat-upgrade-modal .modal-body{display:flex;flex-direction:column;align-items:center;gap:18px;padding:22px 20px 26px}
.stat-upgrade-modal .reward-art{margin:0}
.stat-upgrade-modal .stat-upgrade-level{margin:0;color:#fff;font-size:20px;line-height:1.1}
.stat-upgrade-values{display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap;background:var(--slate-500);border-radius:14px;padding:10px 22px;color:white;font-size:36px;line-height:1.15;-webkit-text-stroke:3px var(--ink);paint-order:stroke fill}
.stat-upgrade-values strong{color:#50ed16;font-weight:400}
.stat-upgrade-modal .stat-upgrade-buy{min-width:116px;width:auto;margin:2px 0 0;padding:7px 14px;border-radius:13px;gap:6px}
/* +1, ×N, MAX: up to three equal buttons, centered; label over its total cost. */
.stat-upgrade-buys{display:flex;justify-content:center;gap:8px;align-self:stretch}
.stat-upgrade-buys .stat-upgrade-buy{flex:0 1 calc((100% - 16px) / 3);min-width:0;margin:2px 0 0;padding:6px 4px;flex-direction:column;gap:2px}
.stat-upgrade-buys .stat-upgrade-buy b{font-size:20px;line-height:1;font-weight:400}
.stat-upgrade-buys .stat-upgrade-buy small{display:flex;align-items:center;gap:3px;font-size:14px;line-height:1;white-space:nowrap}
@media(max-width:360px){.stat-upgrade-values{font-size:30px;padding:10px 16px}
}
.gear-dialog-name{display:block}
.gear-rarity-badge{position:absolute;top:-14px;left:50%;transform:translateX(-50%);min-width:150px;padding:3px 24px;background:var(--ink);clip-path:polygon(12px 0,calc(100% - 12px) 0,100% 50%,calc(100% - 12px) 100%,12px 100%,0 50%);font-size:16px;line-height:1.2;letter-spacing:1px;text-transform:uppercase;color:var(--slate-900);-webkit-text-stroke:0;text-shadow:none;isolation:isolate}
.gear-rarity-badge:before{content:"";position:absolute;inset:2px;background:var(--rarity);clip-path:polygon(11px 0,calc(100% - 11px) 0,100% 50%,calc(100% - 11px) 100%,11px 100%,0 50%);z-index:-1}
.gear-rarity-badge.rarity-5,.gear-rarity-badge.rarity-6{color:white}

/* Equipment guide art: a gear piece with its ×3 merge count, and three pieces for the three slots. */
.equipment-guide-merge-art b {position:absolute;bottom:0;right:0;font-size:25px;color:white;-webkit-text-stroke:3px var(--slate-900);paint-order:stroke fill}
.equipment-guide-slots-art {flex-wrap:wrap;gap:2px;max-width:88px;margin:0 auto}
