.top-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: #b9c3c8;
  background: var(--panel);
  cursor: pointer;
}

.icon-button:hover { color: var(--gold); border-color: #5e5331; }
.icon-button:active { transform: scale(.95); }

.avatar {
  background: #081016 url("assets/yaya-animations.webp") -8px -3px / 300px 300px no-repeat !important;
  image-rendering: pixelated;
}

.skill-badge {
  max-width: 108px;
  overflow: hidden;
  color: var(--gold);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .04em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-badges {
  position: absolute;
  right: 13px;
  bottom: 46px;
  z-index: 4;
  display: flex;
  gap: 6px;
  pointer-events: none;
}

.status-badge {
  padding: 5px 8px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 99px;
  color: #d9e4e8;
  background: rgba(8,13,18,.78);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.status-badge.boss { color: #ffe28b; border-color: rgba(244,200,94,.34); }
.status-badge.buff { color: #a8f2c3; border-color: rgba(113,212,152,.34); }
.status-badge.danger { color: #ffaaa2; border-color: rgba(239,92,82,.55); background: rgba(67,20,20,.85); }

.ultimate-button {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 6;
  isolation: isolate;
  display: grid;
  width: 74px;
  height: 50px;
  overflow: hidden;
  place-content: center;
  border: 2px solid #685b31;
  border-radius: 4px;
  color: #c5cbd0;
  background: rgba(8,13,18,.9);
  box-shadow: 0 4px 0 rgba(0,0,0,.34), inset 0 0 0 1px rgba(255,255,255,.05);
  cursor: pointer;
  image-rendering: pixelated;
}
.ultimate-button > i { position: absolute; right: 0; bottom: 0; left: 0; z-index: -1; height: 0%; background: linear-gradient(#7d5a13,#dcae38); transition: height .18s linear; }
.ultimate-button span { color: #9aa6ad; font: 900 7px ui-monospace,monospace; letter-spacing: .12em; }
.ultimate-button b { margin-top: 2px; font: 1000 9px ui-monospace,monospace; }
.ultimate-button.ready { color: #fff3bd; border-color: #f4c85e; box-shadow: 0 0 18px rgba(244,200,94,.38), 0 4px 0 rgba(0,0,0,.34); animation: ultimate-ready .8s steps(2) infinite; }
.ultimate-button:disabled { cursor: default; }
@keyframes ultimate-ready { 50% { filter: brightness(1.28); transform: translateY(-1px); } }
body.reduced-motion .ultimate-button.ready { animation: none; }
body.taskbar-mode .ultimate-button { top: 7px; right: 7px; width: 62px; height: 42px; }

.pixel-icon {
  display: inline-block;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.35));
}

.pixel-icon.tiny { width: 17px; height: 17px; }
.pixel-icon.large { width: 34px; height: 34px; }
.pixel-icon.modal-pixel-icon { width: 58px; height: 58px; }
.skill-pixel-icon { width: 28px; height: 28px; margin: auto; }
.icon-attack { background-image: url("assets/icons/attack.webp"); }
.icon-health { background-image: url("assets/icons/health.webp"); }
.icon-speed { background-image: url("assets/icons/speed.webp"); }
.icon-burst { background-image: url("assets/icons/burst.webp"); }
.icon-guard { background-image: url("assets/icons/guard.webp"); }
.icon-dash { background-image: url("assets/icons/dash.webp"); }
.icon-weapon { background-image: url("assets/icons/weapon.webp"); }
.icon-armor { background-image: url("assets/icons/armor.webp"); }
.icon-charm { background-image: url("assets/icons/charm.webp"); }
.icon-quest { background-image: url("assets/icons/quest.webp"); }
.icon-loot { background-image: url("assets/icons/loot.webp"); }
.icon-portal { background-image: url("assets/icons/portal.webp"); }

.text-icon {
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 8px;
  font-weight: 1000;
  letter-spacing: -.04em;
}

.nav button { flex: 1; min-width: 0 !important; }
.nav button > .pixel-icon { width: 21px; height: 21px; margin: auto; }

.stage-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.portal-button {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 9px;
  border: 1px solid #4b6680;
  border-radius: 10px;
  color: #b9d9ff;
  background: rgba(25,43,59,.86);
  font-size: 8px;
  font-weight: 950;
  letter-spacing: .05em;
  text-transform: uppercase;
  cursor: pointer;
}

.portal-button span { color: #77b9ff; font-size: 14px; line-height: .8; }
.portal-button:hover { border-color: #78baff; background: #203b52; }

.loot-quick {
  position: absolute;
  right: 13px;
  bottom: 12px;
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid #94783a;
  border-radius: 11px;
  color: #2b1d02;
  background: #f4c85e;
  box-shadow: 0 8px 22px rgba(0,0,0,.35), 0 0 16px rgba(244,200,94,.15);
  font-size: 8px;
  font-weight: 950;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .18s, transform .18s;
  pointer-events: none;
}

.loot-quick.show { opacity: 1; transform: translateY(0); pointer-events: auto; }

.panel-layer,
.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 18px 12px max(12px, env(safe-area-inset-bottom));
  background: rgba(2,6,9,.7);
  backdrop-filter: blur(8px);
}

.panel-layer.open,
.modal-layer.open { display: flex; }

.panel-sheet {
  display: flex;
  flex-direction: column;
  width: min(100%, 536px);
  max-height: min(78dvh, 690px);
  overflow: hidden;
  border: 1px solid #33434e;
  border-radius: 25px;
  background: #111a21;
  box-shadow: 0 28px 90px rgba(0,0,0,.62);
  animation: panel-in .23s ease-out;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 18px 13px;
  border-bottom: 1px solid var(--line);
}

.panel-head div { min-width: 0; }
.panel-head small { display: block; margin-bottom: 3px; color: var(--gold); font-size: 9px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.panel-head h2 { margin: 0; font-size: 21px; letter-spacing: -.03em; }

.panel-close {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: #172129;
  font-size: 20px;
  cursor: pointer;
}

.panel-body {
  min-height: 0;
  padding: 15px;
  overflow: auto;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 5px 2px 10px;
  color: #dfe8eb;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.section-title span { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: 0; text-transform: none; }
.section-title.section-spaced { margin-top: 18px; }

.card-grid { display: grid; gap: 9px; }
.card-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.game-card {
  position: relative;
  overflow: hidden;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #172129;
}

.game-card.selected { border-color: #8d7438; background: #282719; box-shadow: inset 0 0 0 1px rgba(244,200,94,.12); }
.game-card.equipped { border-color: #3d7658; background: #17261f; }
.game-card.complete { border-color: #4c755e; }
.game-card.claimed { opacity: .6; }
.bag-slot { width: 100%; text-align: left; cursor: pointer; }
.bag-slot:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.game-card h3 { margin: 0 0 4px; font-size: 13px; }
.game-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }

.stat-value { display: block; margin-top: 9px; color: var(--gold); font-size: 20px; font-weight: 950; letter-spacing: -.04em; }
.stat-level { color: #91a0a8; font-size: 9px; font-weight: 800; }

.action-button {
  width: 100%;
  margin-top: 11px;
  padding: 9px 10px;
  border: 1px solid #514828;
  border-radius: 11px;
  color: #241a04;
  background: var(--gold);
  font-size: 10px;
  font-weight: 950;
  cursor: pointer;
}

.action-button.secondary { color: #dce6e9; border-color: #394954; background: #202d36; }
.action-button.danger { color: #ffd8d4; border-color: #6d3d3b; background: #3a2020; }
.action-button:disabled { opacity: .4; cursor: not-allowed; }

.skill-icon,
.item-icon {
  display: grid;
  width: 38px;
  height: 38px;
  margin-bottom: 9px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  background: rgba(255,255,255,.035);
  font-size: 20px;
}

.item-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #172129;
}

.item-row.equipped { border-color: #417657; background: #17261f; }
.item-row .item-icon { margin: 0; }
.item-copy { min-width: 0; }
.item-copy strong { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.item-copy small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.rarity-common { color: #c3cbd0; }
.rarity-rare { color: #81b4ff; }
.rarity-epic { color: #c694ff; }
.rarity-legendary { color: #ffd66f; }
.rarity-immortal { color: #ff9d6f; text-shadow: 0 0 8px #ff713f; }
.rarity-arcana { color: #ef71ff; text-shadow: 0 0 8px #c82ce4; }
.rarity-celestial { color: #73e8ff; text-shadow: 0 0 8px #3bc7e4; }
.rarity-divine { color: #fff3a4; text-shadow: 0 0 9px #ffe46c; }
.rarity-cosmic { color: #fff; text-shadow: 0 0 6px #72f0ff, 0 0 12px #c26cff; }
[class*="rarity-border-"] { border-color: #59646b !important; }
.rarity-border-rare { border-color: #5f93da !important; }
.rarity-border-epic { border-color: #9d62dc !important; }
.rarity-border-legendary { border-color: #ad8b36 !important; }
.rarity-border-immortal { border-color: #d46e42 !important; }
.rarity-border-arcana { border-color: #bd50cf !important; }
.rarity-border-celestial { border-color: #43bace !important; }
.rarity-border-divine { border-color: #e6cb5e !important; }
.rarity-border-cosmic { border-color: #bb8cff !important; box-shadow: inset 0 0 12px rgba(104,224,255,.12), 0 0 10px rgba(194,108,255,.16); }

.small-button {
  padding: 7px 9px;
  border: 1px solid #3b4b55;
  border-radius: 10px;
  color: #dce6e9;
  background: #202c34;
  font-size: 9px;
  font-weight: 900;
  cursor: pointer;
}

.small-button.active { color: #201703; border-color: #74612e; background: var(--gold); }

.quest-progress {
  height: 6px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 99px;
  background: #29353d;
}

.quest-progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #5fb985, #8ce6a8); }

.quest-meta { display: flex; justify-content: space-between; margin-top: 6px; color: var(--muted); font-size: 9px; }
.reward { color: var(--gold); font-weight: 900; }

.portal-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid #3b6380;
  border-radius: 18px;
  background: radial-gradient(circle at 15% 50%, rgba(70,145,210,.18), transparent 34%), #17232d;
}

.portal-summary small,
.portal-summary span { display: block; color: var(--muted); font-size: 9px; }
.portal-summary strong { display: block; margin: 3px 0; color: #bcdcff; font-size: 19px; }

.portal-orb {
  position: relative;
  display: grid;
  flex: 0 0 58px;
  height: 58px;
  place-items: center;
  border: 2px solid #68aee8;
  border-radius: 50%;
  box-shadow: inset 0 0 18px rgba(76,162,229,.28), 0 0 20px rgba(76,162,229,.15);
}

.portal-orb::before,
.portal-orb::after,
.portal-orb i { position: absolute; border: 1px solid rgba(143,204,255,.55); border-radius: 50%; content: ""; }
.portal-orb::before { inset: 8px 15px; }
.portal-orb::after { inset: 15px 8px; }
.portal-orb i { inset: 19px; background: #7dc2f5; box-shadow: 0 0 14px #67b5f1; }

.portal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

.portal-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #172129;
}

.portal-card.current { border-color: #4d82a8; background: #192b38; }
.portal-card.boss-route { border-color: #65552e; }
.portal-stage-icon { color: #73b8eb; font-size: 18px; }
.portal-card.boss-route .portal-stage-icon { color: var(--gold); }
.portal-copy { min-width: 0; }
.portal-copy small { display: block; color: var(--muted); font-size: 8px; }
.portal-copy strong { display: block; margin-top: 3px; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.portal-card .small-button { padding: 7px; }

.difficulty-select { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 14px; }
.difficulty-chip { padding: 8px 5px; border: 1px solid #34434c; border-top: 3px solid var(--difficulty-color); border-radius: 4px; color: #dce5e8; background: #151e25; cursor: pointer; }
.difficulty-chip b, .difficulty-chip small { display: block; }
.difficulty-chip b { color: var(--difficulty-color); font: 900 9px ui-monospace, monospace; text-transform: uppercase; }
.difficulty-chip small { margin-top: 4px; color: #788790; font-size: 7px; }
.difficulty-chip.active { background: #232a28; box-shadow: inset 0 0 0 1px var(--difficulty-color); }
.difficulty-chip:disabled { opacity: .35; cursor: not-allowed; }

.portal-map {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 4px 0 4px 28px;
}

.portal-map::before {
  position: absolute;
  top: 13px;
  bottom: 13px;
  left: 14px;
  width: 3px;
  border-radius: 4px;
  background: linear-gradient(#6ebfff, #6d77dc 48%, #f4c85e);
  box-shadow: 0 0 12px rgba(104,174,232,.32);
  content: "";
}

.portal-map-node {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 9px;
  border: 1px solid #33444f;
  border-radius: 16px;
  background: #172129;
}

.portal-map-node:nth-child(even) { margin-left: 22px; }
.portal-map-node.active-sector { border-color: #547ca0; background: #172936; }
.portal-map-node.current { box-shadow: inset 0 0 0 1px rgba(112,184,238,.24), 0 0 20px rgba(63,137,193,.1); }
.portal-map-node.defeated { border-color: #5e5736; }
.portal-path-dot {
  position: absolute;
  left: -27px;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 2px solid #5486ac;
  border-radius: 50%;
  background: #111a21;
}
.portal-map-node.defeated .portal-path-dot { border-color: var(--gold); }
.portal-boss-thumb {
  width: 56px;
  height: 56px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 5px 5px rgba(0,0,0,.45));
}
.portal-map-node .portal-copy span { display: block; margin-top: 2px; color: #a7b3b9; font-size: 8px; }

.bestiary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.bestiary-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 9px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #33434e;
  border-radius: 16px;
  background: #172129;
}
.bestiary-card.boss { border-color: #66552e; background: #211f18; }
.bestiary-card.locked { border-style: dashed; }
.bestiary-portrait { display: grid; width: 74px; height: 74px; place-items: center; border-radius: 12px; overflow: hidden; background: #0b1217; }
.bestiary-portrait img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.bestiary-card.locked .bestiary-portrait img { filter: brightness(0) opacity(.48); }
.bestiary-copy { min-width: 0; }
.bestiary-copy small { color: var(--gold); font-size: 7px; font-weight: 900; text-transform: uppercase; }
.bestiary-copy h3 { margin: 4px 0 8px; overflow: hidden; font-size: 11px; text-overflow: ellipsis; }
.bestiary-copy dl { display: grid; gap: 5px; margin: 0; }
.bestiary-copy dl div { min-width: 0; }
.bestiary-copy dt { color: #718089; font-size: 7px; font-weight: 900; text-transform: uppercase; }
.bestiary-copy dd { margin: 1px 0 0; color: #d1d9dd; font-size: 8px; overflow-wrap: anywhere; }

.party-strip { display: flex; flex: 0 0 auto; gap: 5px; }
.party-member { width: 42px; text-align: center; }
.party-member small, .party-member b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.party-hp { display: block; width: 38px; height: 3px; margin-top: 1px; overflow: hidden; background: #27333b; }
.party-hp i { display: block; height: 100%; background: #66d18e; }
.party-member small { margin-top: 2px; color: #82919a; font-size: 6px; text-transform: uppercase; }
.party-member b { color: #cdd7dc; font-size: 6px; }
.companion-portrait {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 38px;
  overflow: hidden;
  border: 1px solid #52616b;
  border-radius: 4px;
  background-color: #081015;
  background-image: url("assets/companions.webp");
  background-repeat: no-repeat;
  background-size: 300% 100%;
  image-rendering: pixelated;
}
.companion-portrait.large { width: 66px; height: 66px; }
.companion-knight { background-position: 0 50%; }
.companion-mage { background-position: 50% 50%; }
.companion-healer { background-position: 100% 50%; }
.companion-portrait > i { position: absolute; inset: 0; background: linear-gradient(to top, rgba(3,7,10,.78) calc(var(--party-cd) * 100%), transparent 0); }
.formation-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.formation-slot { display: grid; justify-items: center; padding: 9px; border: 1px solid #34434d; border-radius: 4px; background: #151f27; }
.formation-slot small { margin-top: 4px; color: var(--gold); font-size: 7px; text-transform: uppercase; }
.formation-slot b { margin-top: 2px; font-size: 9px; }
.avatar-mini { width: 38px; height: 38px; border: 1px solid #8f7437; border-radius: 4px; background: #081016 url("assets/yaya-animations.webp") -1px 0 / 150px 150px no-repeat; image-rendering: pixelated; }
.companion-grid { display: grid; gap: 7px; }
.companion-card { display: grid; grid-template-columns: 66px minmax(0,1fr) auto auto; gap: 9px; align-items: center; padding: 9px; border: 1px solid #34434d; border-radius: 4px; background: #151f27; }
.companion-card.selected { border-color: #8b743a; background: #242417; }
.companion-card h3 { margin: 2px 0 3px; font-size: 12px; }
.companion-card p, .companion-card small { margin: 0; color: #82919a; font-size: 8px; }

.combat-metrics { position: absolute; bottom: 9px; left: 9px; z-index: 6; display: flex; gap: 4px; pointer-events: none; }
.combat-metrics span { min-width: 47px; padding: 4px 6px; border: 1px solid rgba(255,255,255,.1); border-radius: 3px; background: rgba(6,11,15,.78); backdrop-filter: blur(5px); }
.combat-metrics small, .combat-metrics b { display: block; }
.combat-metrics small { color: #718089; font: 800 6px ui-monospace, monospace; }
.combat-metrics b { margin-top: 1px; color: #e8f0f2; font: 900 8px ui-monospace, monospace; }
.combat-metrics span:last-child { min-width: 96px; }
.element-dot { display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 1px; background: #aaa; box-shadow: 0 0 5px currentColor; }
.element-nature { color:#6ed58f; background:#6ed58f; }
.element-frost { color:#74cfff; background:#74cfff; }
.element-arcane { color:#c58cff; background:#c58cff; }
.element-shadow { color:#f07070; background:#f07070; }
.element-storm { color:#ffe278; background:#ffe278; }
.boss-break { position: absolute; top: 37px; right: 14px; left: 14px; z-index: 5; display: none; grid-template-columns: auto 1fr; gap: 6px; align-items: center; }
.boss-break.show { display: grid; }
.boss-break span { color: #8fe7ff; font: 900 7px ui-monospace, monospace; letter-spacing: .08em; }
.boss-break i { height: 4px; overflow: hidden; border-radius: 0; background: rgba(4,9,13,.72); }
.boss-break b { display: block; height: 100%; background: linear-gradient(90deg,#49a6cf,#9cecff); transition: width .12s; }
.chest-queue-button { display: flex; align-items: center; gap: 3px; padding: 5px 7px; border: 1px solid #554a2d; border-radius: 4px; color: #d9c781; background: #211f17; font: 900 7px ui-monospace, monospace; cursor: pointer; }
.chest-queue-button.ready { border-color: #e3bd4e; box-shadow: 0 0 10px rgba(244,200,94,.28); animation: chest-ready .9s steps(2) infinite; }

.bag-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; padding: 8px; border: 1px solid #33434d; border-radius: 4px; background: #111920; font-size: 8px; }
.bag-toolbar > span { flex: 1; color: #9eabb2; }
.bag-toolbar label { display: flex; align-items: center; gap: 4px; color: #c9d3d7; }
.loot-inspector { margin-bottom: 14px; padding: 12px; border: 2px solid #59646b; border-radius: 4px; background: linear-gradient(135deg,#1b2630,#111920); }
.loot-inspector-head { display: grid; grid-template-columns: auto 1fr auto; gap: 9px; align-items: center; }
.loot-inspector-head h3 { margin: 3px 0 0; font-size: 14px; }
.loot-inspector-head small { color: #8d9aa2; font-size: 7px; }
.comparison { font: 900 14px ui-monospace, monospace; }
.comparison.positive { color: #6ed797; }
.comparison.negative { color: #ef746c; }
.comparison-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 10px; }
.comparison-grid div, .affix-line { padding: 8px; border: 1px solid #2e3d46; background: #10171d; }
.comparison-grid small, .comparison-grid b { display: block; }
.comparison-grid small, .affix-line span { color: #798891; font-size: 7px; text-transform: uppercase; }
.comparison-grid b, .affix-line b { margin-top: 3px; color: #dce5e8; font-size: 9px; }
.affix-line { display: flex; justify-content: space-between; margin-top: 7px; }
.loot-actions { display: grid; grid-template-columns: repeat(4,1fr); gap: 6px; margin-top: 9px; }
.item-row.inspectable { cursor: pointer; }
.item-row.selected { border-color: #9c8040; }
.item-score { color: var(--gold); font: 900 11px ui-monospace, monospace; }

.chest-grid { display: grid; gap: 7px; }
.chest-card { display: grid; grid-template-columns: auto 1fr auto; gap: 9px; align-items: center; padding: 10px; border: 1px solid #4c4530; border-radius: 4px; background: #1c1e18; }
.chest-card h3 { margin: 3px 0 0; font-size: 11px; }
.chest-card small { color: #9f946e; font-size: 8px; text-transform: uppercase; }
.chest-card.ready { border-color: #d1aa45; background: #292515; }
.rune-status { color: var(--gold); font: 900 8px ui-monospace, monospace; }

.cube-balance { display: flex; justify-content: space-between; margin-bottom: 10px; color: #9caab1; font-size: 9px; text-transform: uppercase; }
.cube-balance b { color: #9ce6ff; }
.cube-machine { display: grid; justify-items: center; padding: 18px; border: 2px solid #385268; border-radius: 4px; background: radial-gradient(circle,#16334a,#0b141c 65%); }
.cube-core { position: relative; display: grid; width: 86px; height: 86px; place-items: center; border: 3px solid #74c9f0; color: #bcecff; background: #10283a; clip-path: polygon(25% 0,75% 0,100% 25%,100% 75%,75% 100%,25% 100%,0 75%,0 25%); }
.cube-core i { position: absolute; inset: 18px; border: 2px solid #ffe177; transform: rotate(45deg); }
.cube-core b { z-index: 1; font: 900 9px ui-monospace,monospace; }
.cube-machine.charged .cube-core { animation: cube-spin 1.4s steps(8) infinite; box-shadow: 0 0 22px rgba(95,203,255,.36); }
.cube-slots { display: grid; grid-template-columns: repeat(3,74px); gap: 10px; margin-top: 16px; }
.cube-slot { display: grid; height: 68px; place-items: center; border: 1px dashed #4c6575; background: #0c1720; color: #657681; font-size: 22px; }
.cube-slot small { display: block; color: #8da0ab; font-size: 7px; text-transform: uppercase; }
.cube-actions { display: grid; grid-template-columns: repeat(2,1fr); gap: 7px; }
.cube-inventory { display: grid; grid-template-columns: repeat(2,1fr); gap: 6px; }
.cube-item { display: flex; gap: 7px; align-items: center; padding: 8px; border: 1px solid #35454f; color: #dbe4e7; background: #141e25; text-align: left; cursor: pointer; }
.cube-item.selected { background: #26301d; box-shadow: inset 0 0 0 1px var(--gold); }
.cube-item span { min-width: 0; overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.cube-item small { display: block; margin-top: 2px; color: #83929a; font-size: 7px; }

.rune-header { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; padding: 12px; border: 1px solid #514671; background: #1b1930; }
.rune-header > div { display: flex; align-items: center; gap: 8px; }
.rune-header small, .rune-header b { display: block; }
.rune-header small { color: #9a91b4; font-size: 7px; text-transform: uppercase; }
.rune-header b { color: #d9c0ff; font-size: 20px; }
.rune-header p { margin: 0; color: #9a99ab; font-size: 9px; }
.rune-tree { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; }
.rune-branch { position: relative; display: grid; gap: 11px; padding: 10px; border: 1px solid #394550; background: #10181f; }
.rune-branch h3 { margin: 0; color: #aab7bd; font: 900 9px ui-monospace,monospace; text-transform: uppercase; }
.rune-line { position: absolute; top: 54px; bottom: 35px; left: 28px; width: 2px; background: #3b4f5e; }
.rune-node { position: relative; z-index: 1; display: grid; grid-template-columns: 34px 1fr auto; gap: 3px 7px; align-items: center; padding: 8px; border: 1px solid #35444e; color: #cdd7db; background: #172129; text-align: left; }
.rune-node > span { grid-row: 1/4; display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid #435560; background: #0b1318; }
.rune-node b { font-size: 9px; }
.rune-node small { grid-column: 2/4; color: #85939b; font-size: 7px; }
.rune-node em { color: var(--gold); font: normal 900 7px ui-monospace,monospace; }
.rune-node.unlocked { border-color: #9276c8; background: #28213a; }
.rune-node.available:not(:disabled) { cursor: pointer; box-shadow: 0 0 12px rgba(156,116,220,.1); }
.rune-node:disabled { opacity: .48; }
.rune-node.unlocked:disabled { opacity: 1; }

.view-mode-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; margin-bottom: 8px; }
.view-mode-card { padding: 9px; border: 1px solid #35454f; color: #b9c5ca; background: #151f26; cursor: pointer; }
.view-mode-card i { display: block; height: 28px; margin-bottom: 6px; border: 2px solid #61727c; background: #0b1217; }
.view-mode-card:nth-child(2) i { margin: 5px 8px 6px; height: 23px; }
.view-mode-card:nth-child(3) i { margin-top: 17px; height: 11px; }
.view-mode-card b,.view-mode-card small { display:block; text-transform:capitalize; }
.view-mode-card b { font:900 9px ui-monospace,monospace; }
.view-mode-card small { margin-top:3px; color:#78878f; font-size:7px; }
.view-mode-card.active { border-color: var(--gold); color: var(--gold); background:#252417; }

.taskbar-expand { position: fixed; right: 8px; bottom: 8px; z-index: 80; display: none; padding: 8px; border: 1px solid #8a7136; color: #261c04; background: var(--gold); font: 900 8px ui-monospace,monospace; cursor: pointer; }

.skill::after { position: absolute; inset: 3px; z-index: 2; border: 3px solid transparent; border-top-color: rgba(255,224,130,.92); border-radius: 15px; transform: rotate(calc(var(--cooldown-ratio, 0) * 360deg)); content: ""; pointer-events: none; }

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 2px;
  border-bottom: 1px solid var(--line);
}

.settings-row strong { display: block; font-size: 12px; }
.settings-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }

.volume-row {
  display: block;
  padding: 13px 2px;
  border-bottom: 1px solid var(--line);
}

.volume-row span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 12px;
}

.volume-row output { color: var(--gold); font-size: 10px; font-weight: 900; }

.volume-row input {
  width: 100%;
  height: 5px;
  accent-color: var(--gold);
  cursor: pointer;
}

.audio-check {
  display: grid;
  gap: 12px;
  margin-bottom: 7px;
  padding: 13px;
  border: 1px solid #655532;
  border-radius: 15px;
  background: #242315;
}

.audio-check.ready { border-color: #3d7658; background: #17261f; }
.audio-check strong { font-size: 11px; }
.audio-check small { display: block; margin: 4px 0 0 16px; color: var(--muted); font-size: 9px; }

.audio-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: #d9a640;
  box-shadow: 0 0 10px rgba(244,200,94,.45);
}

.audio-check.ready .audio-dot { background: #63d28d; box-shadow: 0 0 10px rgba(99,210,141,.5); }
.audio-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.audio-actions .small-button { padding: 9px; }

.toggle {
  position: relative;
  flex: 0 0 45px;
  height: 25px;
  border: 0;
  border-radius: 99px;
  background: #34414a;
  cursor: pointer;
}

.toggle::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #dce4e7;
  content: "";
  transition: transform .18s;
}

.toggle.on { background: #4aa171; }
.toggle.on::after { transform: translateX(20px); }

.sound-prompt {
  position: fixed;
  right: 50%;
  bottom: calc(76px + env(safe-area-inset-bottom));
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 13px;
  border: 1px solid #66582f;
  border-radius: 99px;
  color: #251b05;
  background: var(--gold);
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .04em;
  cursor: pointer;
  transform: translateX(50%);
  transition: opacity .2s, transform .2s;
}

.sound-prompt.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate(50%, 8px);
}

.empty-state {
  padding: 32px 18px;
  border: 1px dashed #374650;
  border-radius: 17px;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}

.modal-layer { z-index: 70; align-items: center; }

.modal-card {
  width: min(100%, 420px);
  padding: 22px;
  border: 1px solid #3b4a54;
  border-radius: 25px;
  background: #121b22;
  box-shadow: 0 30px 100px rgba(0,0,0,.68);
  text-align: center;
  animation: modal-in .2s ease-out;
}

.modal-art {
  display: grid;
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  place-items: center;
  border: 1px solid #66582f;
  border-radius: 22px;
  background: #272617;
  font-size: 34px;
}

.modal-card h2 { margin: 0; font-size: 23px; letter-spacing: -.04em; }
.modal-card p { margin: 9px 0 0; color: #9cabb3; font-size: 12px; line-height: 1.6; }
.modal-card .action-button { margin-top: 18px; padding: 12px; }
.modal-card .text-button { margin-top: 10px; border: 0; color: var(--muted); background: none; font-size: 10px; cursor: pointer; }

.tutorial-dots { display: flex; justify-content: center; gap: 6px; margin-top: 15px; }
.tutorial-dots i { width: 6px; height: 6px; border-radius: 50%; background: #3b4850; }
.tutorial-dots i.active { background: var(--gold); }

.offline-total { margin: 17px 0 0; color: var(--gold); font-size: 31px; font-weight: 1000; letter-spacing: -.05em; }

.stage-clear-kicker { display: block; margin-bottom: 4px; color: var(--gold); font-size: 9px; font-weight: 950; letter-spacing: .14em; text-transform: uppercase; }
.stage-clear-art { border-color: #877039; background: radial-gradient(circle, #393018, #17150e); }
.stage-clear-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 17px; }
.stage-clear-grid div { padding: 10px 5px; border: 1px solid #303f48; border-radius: 12px; background: #172129; }
.stage-clear-grid small { display: block; color: var(--muted); font-size: 7px; font-weight: 800; text-transform: uppercase; }
.stage-clear-grid strong { display: block; margin-top: 4px; color: #fff0bd; font-size: 12px; }
.stage-clear-loot { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 13px; padding: 11px; border: 1px dashed #3d4c55; border-radius: 13px; }
.stage-clear-loot > small { flex-basis: 100%; color: var(--muted); font-size: 8px; text-transform: uppercase; }
.stage-loot { display: inline-flex; align-items: center; gap: 5px; font-size: 9px; font-weight: 900; }
.stage-loot.empty { color: var(--muted); font-weight: 600; }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.modal-actions .action-button { display: flex; align-items: center; justify-content: center; gap: 5px; }

body.reduced-motion .panel-sheet,
body.reduced-motion .modal-card { animation: none; }

body.reduced-motion .sound-prompt { transition: none; }

body:not(.reduced-motion) .loot-inspector[class*="rarity-border-cosmic"] { animation: cosmic-pulse 1.4s steps(3) infinite; }

/* Pixel-window treatment: stepped corners and hard inner frame replace soft app-card chrome. */
.stage, .hero-card, .progress, .panel-sheet, .modal-card, .game-card, .item-row, .portal-summary, .empty-state {
  border-radius: 4px !important;
  clip-path: polygon(7px 0,calc(100% - 7px) 0,100% 7px,100% calc(100% - 7px),calc(100% - 7px) 100%,7px 100%,0 calc(100% - 7px),0 7px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.025);
}

.stage-label, .stage-name, .enemy-name, .enemy-level, .battle-log, .skill-badge, .nav button, .panel-head small, .section-title {
  font-family: ui-monospace, "Cascadia Mono", monospace;
}

body.compact-mode .app { width: min(100%, 430px); padding-top: 10px; }
body.compact-mode .topbar { margin-bottom: 8px; }
body.compact-mode .arena-wrap { height: 218px; }
body.compact-mode .progress { display: none; }
body.compact-mode .hero-card { margin-top: 8px; padding: 8px; }
body.compact-mode .party-member b { display: none; }

body.taskbar-mode { min-height: 100%; overflow: hidden; background: transparent; }
body.taskbar-mode .app {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: minmax(460px,1fr) 410px;
  gap: 6px;
  width: 100%;
  max-width: none;
  min-height: 0;
  height: 154px;
  padding: 6px 76px 6px 6px;
  overflow: visible;
  border-top: 2px solid #596976;
  background: rgba(6,11,15,.92);
  box-shadow: 0 -18px 50px rgba(0,0,0,.48), inset 0 1px rgba(255,255,255,.05);
  backdrop-filter: blur(13px);
}
body.taskbar-mode .topbar, body.taskbar-mode .progress, body.taskbar-mode .nav, body.taskbar-mode .sound-prompt { display: none !important; }
body.taskbar-mode .stage { display: grid; grid-template-columns: 142px minmax(0,1fr); grid-template-rows: 1fr; height: 142px; }
body.taskbar-mode .stage-head { display: grid; align-content: center; gap: 9px; padding: 9px; border-right: 1px solid #2c3942; }
body.taskbar-mode .stage-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
body.taskbar-mode .pips { grid-column: 1/-1; }
body.taskbar-mode .portal-button { display: none; }
body.taskbar-mode .arena-wrap { height: 100%; }
body.taskbar-mode .battle-log { display: none; }
body.taskbar-mode .hero-card { align-self: stretch; height: 142px; margin: 0; padding: 9px; }
body.taskbar-mode .hero-card .avatar { flex-basis: 44px; height: 44px; }
body.taskbar-mode .party-member { width: 38px; }
body.taskbar-mode .companion-portrait { width: 34px; height: 34px; }
body.taskbar-mode .party-member b { display: none; }
body.taskbar-mode .hero-title strong { font-size: 12px; }
body.taskbar-mode .hero-info small { font-size: 8px; }
body.taskbar-mode .skill { flex-basis: 54px; height: 54px; border-radius: 4px; }
body.taskbar-mode .status-badges { right: 12px; bottom: 43px; }
body.taskbar-mode .loot-quick { bottom: 8px; }
body.taskbar-mode .taskbar-expand { display: block; }
body.taskbar-mode .panel-layer, body.taskbar-mode .modal-layer { align-items: center; }
body.taskbar-mode .panel-sheet { max-height: 88dvh; }

body[data-difficulty="hard"] { --line: #54432f; }
body[data-difficulty="nightmare"] { --line: #493d64; }
body[data-difficulty="hell"] { --line: #603334; }
body[data-difficulty="hard"] .stage { box-shadow: inset 0 0 0 1px rgba(241,179,95,.12); }
body[data-difficulty="nightmare"] .stage { box-shadow: inset 0 0 0 1px rgba(177,132,255,.16); }
body[data-difficulty="hell"] .stage { box-shadow: inset 0 0 0 1px rgba(255,103,94,.2); }

button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.nav { justify-content: flex-start !important; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav button { flex: 0 0 60px; }
.loadout-block { margin-top: 14px; padding: 12px; border: 1px solid #33434d; background: #101920; }
.loadout-block .section-title { margin-bottom: 9px; }
.loadout-block .section-title em { color: #91a0a8; font-size: 8px; font-style: normal; }
.loadout-slots { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.loadout-slot { min-width: 0; padding: 10px; border: 1px solid #36454f; background: #151f26; }
.loadout-slot > b, .loadout-slot > small { display: block; margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loadout-slot > b { color: #fff2c8; font-size: 10px; }
.loadout-slot > small { color: #8998a0; font-size: 8px; }
.loadout-picks { display: grid; gap: 4px; margin-top: 8px; }
.loadout-picks button { padding: 5px; overflow: hidden; border: 1px solid #34434d; color: #aebbc2; background: #0d1419; font-size: 7px; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.loadout-picks button.active { border-color: #d5b551; color: #ffe394; }
.companion-build { margin-top: 14px; padding: 14px; border: 1px solid #30404a; background: #111a21; }
.companion-build.selected { border-color: #746333; }
.companion-build > header { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; }
.companion-build h3, .companion-build p { margin: 3px 0; }
.companion-build p { color: #8c9aa2; font-size: 9px; }
.companion-skill-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 7px; margin-top: 10px; }
.skill-choice { padding: 9px; border: 1px solid #33434e; color: #d7e1e5; background: #101820; text-align: left; cursor: pointer; }
.skill-choice.active { border-color: #d9ba58; background: #272416; }
.skill-choice b, .skill-choice small { display: block; }
.skill-choice b { font-size: 9px; }.skill-choice small { margin-top: 4px; color: #8d9ba3; font-size: 7px; }
.passive-select { display: flex; align-items: center; gap: 8px; margin-top: 9px; color: #9aa9b0; font-size: 8px; }
.passive-select select { flex: 1; padding: 7px; border: 1px solid #3b4a53; color: #eef4f5; background: #0d151a; font-size: 9px; }

.achievement-grid, .pet-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.achievement-card { display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: center; padding: 13px; border: 1px solid #34434d; background: #121c23; }
.achievement-card.locked { opacity: .55; }.achievement-card.unlocked { border-color: #d1ad48; }
.achievement-card h3, .achievement-card p { margin: 3px 0; }.achievement-card p { color: #8e9ca4; font-size: 8px; }.achievement-card b { color: #efd06d; font-size: 8px; }
.pet-card { padding: 14px; border: 1px solid #34434e; background: #111b22; text-align: center; }
.pet-card.active { border-color: #d7b84f; box-shadow: inset 0 0 28px rgba(244,200,94,.08); }.pet-card.locked { filter: grayscale(1); opacity: .5; }
.pet-card h3, .pet-card p { margin: 5px 0; }.pet-card p { color: #91a0a8; font-size: 9px; line-height: 1.5; }
.pet-sprite { width: 138px; height: 108px; margin: auto; background-image: url("assets/pets.webp"); background-repeat: no-repeat; background-size: 300% 100%; image-rendering: pixelated; }
.pet-sprout { background-position: 0 0; }.pet-chick { background-position: 50% 0; }.pet-moth { background-position: 100% 0; }
.pet-sprite.level-5, .pet-sprite.level-6, .pet-sprite.level-7, .pet-sprite.level-8, .pet-sprite.level-9 { filter: drop-shadow(0 0 6px #77dfff); }
.pet-sprite.level-10 { filter: drop-shadow(0 0 8px #ffe477) saturate(1.25); transform: scale(1.08); }
.pet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.collection-bonuses { display: grid; gap: 5px; margin-bottom: 15px; padding: 12px; border: 1px solid #34434d; background: #111a20; }
.collection-bonuses span { color: #68767d; font-size: 8px; }.collection-bonuses span.active { color: #80dfa2; }
.cube-preview { margin: 12px 0; padding: 13px; border: 1px solid #d0ad48; background: #282316; }.cube-preview h3, .cube-preview p { margin: 5px 0; }.cube-preview p { color: #c5b982; font-size: 9px; }
.offline-timeline { display: grid; gap: 7px; margin-top: 14px; text-align: left; }.offline-timeline div { display: grid; grid-template-columns: 64px 1fr; gap: 8px; padding: 7px; border-left: 2px solid #d6b74f; background: #151f25; }.offline-timeline b { color: #e7c75e; font-size: 8px; }.offline-timeline span { color: #a9b6bc; font-size: 9px; }

.wallet-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  padding: 18px;
  place-items: center;
  overflow: auto;
  background:
    radial-gradient(circle at 50% 28%, rgba(244,200,94,.18), transparent 34rem),
    linear-gradient(rgba(4,9,13,.92), rgba(3,7,10,.98));
  backdrop-filter: blur(12px);
  transition: opacity .55s steps(5), visibility .55s;
}
.wallet-gate[hidden] { display: none !important; }
.wallet-gate.passed { opacity: 0; visibility: hidden; pointer-events: none; }
.wallet-gate-card {
  width: min(100%, 520px);
  overflow: hidden;
  border: 2px solid #5a4a23;
  background: #0e171d;
  box-shadow: 0 0 0 5px #070b0e, 0 28px 100px rgba(0,0,0,.78), 0 0 55px rgba(244,200,94,.12);
  clip-path: polygon(12px 0,calc(100% - 12px) 0,100% 12px,100% calc(100% - 12px),calc(100% - 12px) 100%,12px 100%,0 calc(100% - 12px),0 12px);
}
.wallet-banner {
  position: relative;
  display: grid;
  grid-template-columns: 152px 1fr;
  min-height: 192px;
  align-items: center;
  overflow: hidden;
  border-bottom: 2px solid #5d4c25;
  background:
    linear-gradient(90deg, rgba(7,14,18,.05), rgba(7,14,18,.72)),
    linear-gradient(135deg, #182f2a, #10202b 58%, #1d1822);
}
.wallet-banner::before, .wallet-banner::after {
  position: absolute;
  content: "";
  pointer-events: none;
}
.wallet-banner::before { inset: 0; background: repeating-linear-gradient(0deg, transparent 0 7px, rgba(255,255,255,.018) 8px); }
.wallet-banner::after { right: 22px; bottom: 18px; width: 86px; height: 86px; border: 2px solid rgba(244,200,94,.15); transform: rotate(45deg); }
.wallet-banner-yaya {
  position: relative;
  z-index: 1;
  width: 136px;
  height: 136px;
  margin-left: 10px;
  align-self: center;
  border: 2px solid #c99524;
  background: #071018 url("assets/icons/yaya-taskbar-hero.webp") center / cover no-repeat;
  image-rendering: pixelated;
  filter: drop-shadow(0 9px 0 rgba(0,0,0,.34)) drop-shadow(0 0 18px rgba(244,200,94,.28));
  clip-path: polygon(8px 0,calc(100% - 8px) 0,100% 8px,100% calc(100% - 8px),calc(100% - 8px) 100%,8px 100%,0 calc(100% - 8px),0 8px);
}
.wallet-banner > div:last-child { position: relative; z-index: 2; padding: 20px 22px 20px 4px; }
.wallet-banner small, .wallet-step, .wallet-balance small, .wallet-security {
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.wallet-banner small { color: #79d49d; font-size: 9px; }
.wallet-banner h2 { margin: 8px 0 0; color: #fff3c9; font: 1000 clamp(28px,8vw,44px)/.88 ui-monospace,"Cascadia Mono",monospace; letter-spacing: -.08em; text-shadow: 3px 3px #532e18, 0 0 20px rgba(244,200,94,.2); }
.wallet-gate-copy { display: grid; justify-items: center; padding: 24px; text-align: center; }
.wallet-step { color: var(--gold); font-size: 9px; }
.wallet-gate-copy > p { max-width: 390px; min-height: 38px; margin: 9px 0 14px; color: #a8b5bc; font-size: 12px; line-height: 1.55; }
.wallet-balance { width: 100%; padding: 12px; border: 1px solid #35454f; background: #121d24; }
.wallet-balance small, .wallet-balance b { display: block; }
.wallet-balance small { color: #7f8e96; font-size: 7px; }
.wallet-balance b { margin-top: 5px; color: #fff0b4; font-size: 17px; }
.wallet-balance.verified { border-color: #488760; background: #12251c; box-shadow: inset 0 0 22px rgba(113,212,152,.07); }
.wallet-loader { display: flex; gap: 5px; height: 20px; margin: 14px 0 4px; align-items: center; }
.wallet-loader[hidden] { visibility: hidden; }
.wallet-loader i { width: 14px; height: 5px; background: #394851; animation: wallet-load 1s steps(1) infinite; }
.wallet-loader i:nth-child(2) { animation-delay: .12s; }.wallet-loader i:nth-child(3) { animation-delay: .24s; }.wallet-loader i:nth-child(4) { animation-delay: .36s; }.wallet-loader i:nth-child(5) { animation-delay: .48s; }
.ton-connect-button { display: flex; min-height: 44px; margin-top: 8px; justify-content: center; }
.wallet-refresh { width: min(100%, 300px); margin-top: 10px; }
.wallet-security { margin-top: 13px; color: #68767d; font-size: 6px; line-height: 1.6; }
.wallet-status-button { width: auto !important; min-width: 42px; padding: 0 8px; font-size: 6px !important; }
.wallet-locked-companion { border-color: #514527; background: linear-gradient(135deg,#171b1b,#19170f); }
.wallet-locked-companion .companion-portrait { filter: grayscale(.82) brightness(.62); }
.recruit-note { display: flex; gap: 8px; margin-top: 11px; padding: 10px; align-items: center; border: 1px dashed #5c4c25; background: #211c10; }
.recruit-note b { flex: 0 0 auto; color: var(--gold); font-size: 10px; }.recruit-note span { color: #a69b79; font-size: 8px; line-height: 1.45; }
body.wallet-locked .app { filter: saturate(.55) brightness(.58); pointer-events: none; user-select: none; }
body.wallet-locked .sound-prompt, body.wallet-locked .taskbar-expand { display: none !important; }

.leaderboard-hero {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  gap: 14px;
  padding: 16px;
  align-items: center;
  border: 1px solid #36566c;
  background: linear-gradient(135deg,#152937,#111d25);
}
.leaderboard-hero h3 { margin: 3px 0; color: #fff1bf; font-size: 18px; }
.leaderboard-hero small, .leaderboard-hero p { color: #8fa4b1; }
.leaderboard-hero p { margin: 0; font-size: 9px; line-height: 1.5; }
.leaderboard-list { display: grid; gap: 7px; }
.leaderboard-row {
  display: grid;
  grid-template-columns: 48px minmax(0,1fr) auto;
  gap: 12px;
  min-height: 64px;
  padding: 11px 13px;
  align-items: center;
  border: 1px solid #2d414d;
  background: #121d24;
}
.leaderboard-row.current {
  border-color: #c99d3d;
  box-shadow: inset 3px 0 #f4c85e, 0 0 18px rgba(244,200,94,.08);
}
.leaderboard-rank { color: var(--gold); font: 900 14px ui-monospace,"Cascadia Mono",monospace; }
.leaderboard-player, .leaderboard-score { display: grid; gap: 4px; min-width: 0; }
.leaderboard-player strong { overflow: hidden; color: #eef5f6; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard-player small, .leaderboard-score small { color: #80919a; font-size: 8px; }
.leaderboard-score { text-align: right; }
.leaderboard-score strong { color: #78d39d; font-size: 11px; }
.cloud-loading {
  display: flex;
  min-height: 120px;
  gap: 12px;
  align-items: center;
  justify-content: center;
  color: #91a1a9;
  font-size: 10px;
}
.cloud-loading i { width: 12px; height: 12px; border: 3px solid #334752; border-top-color: var(--gold); animation: cube-spin .8s steps(8) infinite; }
.cloud-note { padding: 10px; border: 1px dashed #4e452c; color: #b3a274; font-size: 9px; text-align: center; }

@keyframes panel-in { from { opacity: 0; transform: translateY(25px); } }
@keyframes modal-in { from { opacity: 0; transform: scale(.96); } }
@keyframes cube-spin { 50% { transform: rotate(45deg) scale(1.05); } }
@keyframes chest-ready { 50% { filter: brightness(1.25); } }
@keyframes cosmic-pulse { 50% { filter: brightness(1.18) saturate(1.3); } }
@keyframes wallet-load { 0%,20% { background: var(--gold); box-shadow: 0 0 8px rgba(244,200,94,.45); } 21%,100% { background: #394851; box-shadow: none; } }

@media (max-width: 430px) {
  .wallet { min-width: 76px; padding-right: 10px; padding-left: 10px; }
  .top-actions { gap: 5px; }
  .icon-button { width: 34px; height: 34px; border-radius: 11px; }
  .card-grid.three { grid-template-columns: 1fr; }
  .panel-layer { padding-right: 8px; padding-left: 8px; }
  .stage-controls { gap: 6px; }
  .portal-button { padding: 5px 7px; font-size: 7px; }
  .portal-grid { grid-template-columns: 1fr; }
  .bestiary-grid { grid-template-columns: 1fr; }
  .portal-map-node:nth-child(even) { margin-left: 10px; }
  .stage-clear-grid { grid-template-columns: repeat(2, 1fr); }
  .difficulty-select { grid-template-columns: repeat(2,1fr); }
  .companion-card { grid-template-columns: 54px minmax(0,1fr); }
  .companion-card .small-button { grid-row: 2; }
  .companion-portrait.large { width: 54px; height: 54px; }
  .cube-inventory, .rune-tree { grid-template-columns: 1fr; }
  .loot-actions { grid-template-columns: repeat(2,1fr); }
  .loadout-slots, .achievement-grid, .pet-grid { grid-template-columns: 1fr; }
  .companion-build > header { grid-template-columns: 54px 1fr; }
  .companion-build > header .small-button { grid-column: 1/-1; }
  .leaderboard-hero { grid-template-columns: auto 1fr; }
  .leaderboard-hero .small-button { grid-column: 1/-1; }
  .leaderboard-row { grid-template-columns: 38px minmax(0,1fr); }
  .leaderboard-score { grid-column: 2; text-align: left; }
  .wallet-gate { padding: 10px; }
  .wallet-banner { grid-template-columns: 118px 1fr; min-height: 168px; }
  .wallet-banner-yaya { width: 108px; height: 108px; margin-left: 6px; background-position: center; background-size: cover; }
  .wallet-gate-copy { padding: 18px; }
}

@media (max-width: 820px) {
  body.taskbar-mode .app { grid-template-columns: minmax(350px,1fr) 310px; }
  body.taskbar-mode .stage { grid-template-columns: 108px minmax(0,1fr); }
  body.taskbar-mode .stage-controls { grid-template-columns: 1fr; }
  body.taskbar-mode .chest-queue-button { display: none; }
  body.taskbar-mode .party-member small { display: none; }
  body.taskbar-mode .hero-card { gap: 6px; }
  body.taskbar-mode .status-badges { right: 10px; }
}
