/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  user-select: none;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  color: #e4defa;
  background: transparent;
}

/* ========================================================
   TASKBAR MODE (Mini Strip)
   ======================================================== */
body.mode-taskbar {
  background: transparent !important;
}

body.mode-taskbar #app-wrapper {
  width: 100%;
  height: 100%;
  position: relative;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

body.mode-taskbar #window-titlebar,
body.mode-taskbar #combat-info-strip,
body.mode-taskbar #ui-dashboard {
  display: none !important;
}

body.mode-taskbar #combat-container {
  width: 100%;
  height: 100%;
  position: relative;
}

body.mode-taskbar #game-root {
  width: 100%;
  height: 100%;
}

body.mode-taskbar canvas {
  width: 100%;
  height: 100%;
  display: block;
}

body.mode-taskbar #taskbar-overlay-bar {
  display: flex;
  position: absolute;
  top: 3px;
  left: 4px;
  gap: 4px;
  z-index: 100;
  opacity: 0.35;
  transition: opacity 0.2s ease;
}

body.mode-taskbar:hover #taskbar-overlay-bar {
  opacity: 1;
}

.mini-btn {
  background: rgba(30, 25, 45, 0.85);
  color: #e4defa;
  border: 1px solid rgba(130, 110, 180, 0.5);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 3px;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.mini-btn:hover {
  background: rgba(70, 50, 110, 0.95);
  border-color: #a88be8;
  color: #ffffff;
  transform: translateY(-1px);
}

/* ========================================================
   WINDOWED MODE (Full RPG Windowed View)
   ======================================================== */
body.mode-windowed {
  background: rgba(12, 10, 18, 0.98);
}

body.mode-windowed #app-wrapper {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: #14111f;
  border: 2px solid #4a3d69;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.9), 0 0 15px rgba(110, 75, 180, 0.2);
  overflow: hidden;
}

/* Custom Title Bar */
#window-titlebar {
  height: 38px;
  background: #1b172a;
  border-bottom: 1px solid #332a4a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  -webkit-app-region: drag;
  flex-shrink: 0;
}

.title-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.app-icon {
  font-size: 15px;
}

.app-title {
  color: #f0ebff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.badge {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.stage-badge {
  background: #2b2245;
  border: 1px solid #634d96;
  color: #d1bfff;
}

.gold-badge {
  background: #362915;
  border: 1px solid #a87922;
  color: #fadb6a;
}

.gems-badge {
  background: #142e3c;
  border: 1px solid #00d2d3;
  color: #7efff5;
}

.title-right {
  display: flex;
  align-items: center;
  gap: 6px;
  -webkit-app-region: no-drag;
}

.title-btn {
  background: #27213b;
  color: #d3cbeb;
  border: 1px solid #483d66;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.title-btn:hover {
  background: #3d335c;
  color: #ffffff;
  border-color: #7b62b3;
}

.title-btn.icon-only {
  padding: 2px 7px;
  font-size: 12px;
}

.title-btn.close-btn:hover {
  background: #c53030;
  border-color: #e53e3e;
}

/* Combat Viewport */
body.mode-windowed #combat-container {
  height: 210px;
  background: linear-gradient(180deg, #120e24 0%, #21173b 65%, #161124 100%);
  position: relative;
  border-bottom: 2px solid #352b4d;
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.mode-windowed #game-root {
  width: 100%;
  flex: 1;
  min-height: 0;
  position: relative;
}

#combat-container canvas {
  width: 100%;
  height: 100%;
  display: block;
}

body.mode-windowed #taskbar-overlay-bar {
  display: none !important;
}

#combat-info-strip {
  position: relative;
  height: 28px;
  flex-shrink: 0;
  background: #181329;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 600;
  border-top: 1px solid rgba(168, 139, 232, 0.18);
  pointer-events: auto;
}

.stage-name-text {
  color: #c9bcf0;
}

.boss-alert-text {
  color: #ff4757;
  margin-left: 10px;
  font-weight: 700;
  animation: pulse-red 1s infinite;
}

.boss-alert-text.hidden {
  display: none;
}

@keyframes pulse-red {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.05); }
}

.autocast-label {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  color: #f1ecff;
}

.autocast-label input {
  cursor: pointer;
  accent-color: #9d4edd;
}

/* Dashboard & Tabs */
#ui-dashboard {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #151221;
  overflow: hidden;
}

#dashboard-nav {
  height: 38px;
  background: #1a162b;
  border-bottom: 1px solid #332b4d;
  display: flex;
  padding: 0 10px;
  gap: 6px;
  flex-shrink: 0;
}

.nav-tab {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: #a49bbd;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.nav-tab:hover {
  color: #e5def7;
  background: rgba(255, 255, 255, 0.03);
}

.nav-tab.active {
  color: #ffd166;
  border-bottom-color: #ffd166;
  background: rgba(255, 209, 102, 0.06);
}

#dashboard-content {
  flex: 1;
  padding: 12px 14px;
  overflow-y: auto;
}

/* Custom Scrollbar */
#dashboard-content::-webkit-scrollbar {
  width: 6px;
}
#dashboard-content::-webkit-scrollbar-track {
  background: #110e1a;
}
#dashboard-content::-webkit-scrollbar-thumb {
  background: #392f54;
  border-radius: 3px;
}
#dashboard-content::-webkit-scrollbar-thumb:hover {
  background: #56477d;
}

.tab-pane {
  display: none;
  height: 100%;
}

.tab-pane.active {
  display: block;
}

.section-intro {
  margin-bottom: 12px;
}

.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.party-quick-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.best-party-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #eab308 50%, #d97706 100%);
  border: 1px solid #fde047;
  color: #1c1302;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.45);
  transition: transform 0.12s ease, filter 0.12s ease;
}

.best-party-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.12);
}

.best-party-btn:active {
  transform: translateY(0);
}

.section-intro h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #f3efff;
}

.section-intro .subtext {
  font-size: 11px;
  color: #9389ad;
}

/* ========================================================
   HEROES TAB
   ======================================================== */
.heroes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.hero-card {
  background: #1e1930;
  border: 1px solid #3d3159;
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
  transition: border-color 0.15s ease;
}

.hero-card:hover {
  border-color: #6d559e;
}

.hero-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hero-identity {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-avatar {
  width: 38px;
  height: 38px;
  background: #2b2247;
  border: 1px solid #5a4785;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.hero-names h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
}

.hero-class-tag {
  font-size: 10px;
  text-transform: uppercase;
  color: #bfa8ff;
  letter-spacing: 0.5px;
}

.hero-level-badge {
  background: #2f254f;
  border: 1px solid #7155aa;
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #ffdf7a;
}

/* Bars */
.bar-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bar-row {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #a99ec7;
}

.progress-bar-bg {
  width: 100%;
  height: 7px;
  background: #110e1c;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #2f2742;
}

.progress-bar-fill {
  height: 100%;
  transition: width 0.2s ease;
}

.progress-bar-fill.hp-fill {
  background: linear-gradient(90deg, #2ecc71, #27ae60);
}

.progress-bar-fill.xp-fill {
  background: linear-gradient(90deg, #3498db, #2980b9);
}

/* Stats Matrix */
.hero-stats-matrix {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px 10px;
  background: #171324;
  border-radius: 4px;
  padding: 8px;
  font-size: 11px;
  border: 1px solid #2c2342;
}

.stat-item {
  display: flex;
  justify-content: space-between;
}

.stat-item .stat-label {
  color: #9287b0;
}

.stat-item .stat-val {
  font-weight: 700;
  color: #e5def5;
}

.hero-level-up-btn {
  background: linear-gradient(180deg, #e67e22, #d35400);
  color: #ffffff;
  border: 1px solid #f39c12;
  border-radius: 4px;
  padding: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.hero-level-up-btn:hover:not(:disabled) {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.hero-level-up-btn:disabled {
  background: #2c263d;
  border-color: #3f3657;
  color: #6f658c;
  cursor: not-allowed;
}

/* ========================================================
   EQUIPMENT & BAG TAB
   ======================================================== */
.equipment-bag-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 14px;
  height: 100%;
}

.hero-loadout-panel,
.inventory-bag-panel {
  background: #191528;
  border: 1px solid #362c4f;
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 6px;
}

.panel-header h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #f1ecff;
}

.hero-selector-pills {
  display: flex;
  gap: 4px;
}

.hero-pill {
  background: #251e3a;
  border: 1px solid #443763;
  color: #b7a9de;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.hero-pill.active {
  background: #5a4191;
  border-color: #8f6ee0;
  color: #ffffff;
}

/* Equipment Slots */
.equipment-slots-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.eq-slot-row {
  background: #151121;
  border: 1px solid #34284d;
  border-radius: 5px;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.slot-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  background: #221a36;
  border: 1px solid #453669;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.slot-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.slot-title {
  font-size: 10px;
  text-transform: uppercase;
  color: #8b7fa8;
  font-weight: 700;
}

.slot-item-name {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot-item-stats {
  font-size: 10px;
  color: #a89bc9;
}

.slot-unequip-btn {
  background: #2a203b;
  border: 1px solid #4a3869;
  color: #cbbbe8;
  padding: 3px 7px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}

.slot-unequip-btn:hover {
  background: #8b263e;
  border-color: #d1345b;
  color: #ffffff;
}

.loadout-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: auto;
}

.action-btn {
  padding: 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  border: none;
}

.primary-btn {
  background: linear-gradient(180deg, #6c5ce7, #5344c7);
  color: #ffffff;
  border: 1px solid #8e7bf8;
}

.primary-btn:hover {
  filter: brightness(1.15);
}

.secondary-btn {
  background: #2b2340;
  color: #d6ccf2;
  border: 1px solid #473966;
}

.secondary-btn:hover {
  background: #392f54;
}

/* Inventory Bag */
.bag-actions {
  display: flex;
  gap: 6px;
}

.small-btn {
  background: #271f3b;
  border: 1px solid #48396b;
  color: #c9bede;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}

.small-btn:hover {
  background: #3a2e57;
  color: #ffffff;
}

.warning-btn:hover {
  background: #8f5319;
  border-color: #d47e28;
}

.bag-slots-container {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 6px;
  align-content: start;
  max-height: 200px;
  overflow-y: auto;
  padding: 6px;
  background: #120f1c;
  border-radius: 5px;
  border: 1px solid #2b223d;
  margin-bottom: 10px;
}

.bag-item-slot {
  width: 44px;
  height: 44px;
  background: #1c172b;
  border: 1px solid #362952;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  position: relative;
  transition: transform 0.1s ease, border-color 0.1s ease;
}

.bag-item-slot:hover {
  transform: scale(1.08);
  border-color: #ffffff !important;
  z-index: 2;
}

.bag-item-slot.selected {
  outline: 2px solid #ffd166;
  outline-offset: 1px;
}

/* Item Inspector Card */
.item-inspector-card {
  background: #13101e;
  border: 1px solid #3a2e54;
  border-radius: 5px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 90px;
}

.item-inspector-card.empty {
  align-items: center;
  justify-content: center;
  color: #7b7096;
  font-size: 11px;
}

.inspector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.inspector-name {
  font-size: 13px;
  font-weight: 700;
}

.inspector-slot-tag {
  font-size: 10px;
  text-transform: uppercase;
  color: #9c8fb8;
}

.inspector-stats {
  font-size: 11px;
  color: #c7badf;
  line-height: 1.4;
}

.inspector-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.equip-now-btn {
  flex: 1;
  background: #27ae60;
  border: 1px solid #2ecc71;
  color: #ffffff;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.equip-now-btn:hover {
  filter: brightness(1.15);
}

.sell-item-btn {
  background: #b25816;
  border: 1px solid #e67e22;
  color: #ffffff;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.sell-item-btn:hover {
  filter: brightness(1.15);
}

/* ========================================================
   SKILLS TAB
   ======================================================== */
.skills-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skills-hero-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 12px;
}

.skill-card {
  background: #1b162b;
  border: 1px solid #3c2f57;
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.skill-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.skill-icon-frame {
  width: 42px;
  height: 42px;
  background: #271f3d;
  border: 1px solid #5d468a;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.skill-cooldown-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #ffcc00;
}

.skill-title-block {
  flex: 1;
}

.skill-title-block h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}

.skill-type-tag {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.skill-type-tag.active-type {
  color: #70a1ff;
}

.skill-type-tag.passive-type {
  color: #2ed573;
}

.skill-level-pill {
  background: #2a2245;
  border: 1px solid #6c549e;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #ffd271;
}

.skill-desc {
  font-size: 11px;
  color: #b7abd1;
  line-height: 1.4;
  min-height: 32px;
}

.skill-actions-row {
  display: flex;
  gap: 6px;
  margin-top: auto;
}

.skill-upgrade-btn {
  flex: 1;
  background: #3c2f57;
  border: 1px solid #674d99;
  color: #f1ecff;
  border-radius: 4px;
  padding: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.skill-upgrade-btn:hover:not(:disabled) {
  background: #5d448c;
  border-color: #8c68cc;
}

.skill-upgrade-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.skill-cast-btn {
  background: linear-gradient(180deg, #3742fa, #2f3542);
  border: 1px solid #5352ed;
  color: #ffffff;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.skill-cast-btn:hover:not(:disabled) {
  filter: brightness(1.2);
}

.skill-cast-btn:disabled {
  background: #211d2e;
  border-color: #38304f;
  color: #685e82;
  cursor: not-allowed;
}

/* ========================================================
   RECRUIT TAB
   ======================================================== */
.recruit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.recruit-card {
  background: #1b162a;
  border: 1px solid #3c3057;
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.recruit-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.recruit-avatar {
  width: 44px;
  height: 44px;
  background: #271f3d;
  border: 1px solid #5d468a;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.recruit-names h4 {
  margin: 0;
  font-size: 14px;
  color: #ffffff;
}

.recruit-desc {
  font-size: 11px;
  color: #b0a3c9;
  line-height: 1.4;
}

.recruit-btn {
  margin-top: auto;
  background: linear-gradient(180deg, #10ac84, #1dd1a1);
  border: 1px solid #10ac84;
  color: #0b382c;
  font-weight: 800;
  padding: 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

.recruit-btn:hover:not(:disabled) {
  filter: brightness(1.15);
}

.recruit-btn:disabled {
  background: #252033;
  border-color: #3b3252;
  color: #6b6187;
  cursor: not-allowed;
}

/* ========================================================
   RARITY STYLES & GLOWS
   ======================================================== */
.rarity-common { color: #9ca3af !important; border-color: #9ca3af !important; }
.rarity-uncommon { color: #22c55e !important; border-color: #22c55e !important; }
.rarity-rare { color: #3b82f6 !important; border-color: #3b82f6 !important; }
.rarity-legendary { color: #f59e0b !important; border-color: #f59e0b !important; }
.rarity-immortal { color: #ef4444 !important; border-color: #ef4444 !important; }
.rarity-arcana { color: #a855f7 !important; border-color: #a855f7 !important; }
.rarity-beyond { color: #ec4899 !important; border-color: #ec4899 !important; }
.rarity-celestial { color: #06b6d4 !important; border-color: #06b6d4 !important; }
.rarity-divine { color: #eab308 !important; border-color: #eab308 !important; }
.rarity-cosmic { color: #f43f5e !important; border-color: #f43f5e !important; text-shadow: 0 0 6px #f43f5e; }

/* ========================================================
   IDLE GACHA SUMMON & HERO COLLECTION SYSTEM
   ======================================================== */
.hero-rarity-pill {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.hero-rarity-R {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid #3b82f6;
  color: #60a5fa;
}

.hero-rarity-SR {
  background: rgba(168, 85, 247, 0.22);
  border: 1px solid #a855f7;
  color: #c084fc;
}

.hero-rarity-SSR {
  background: rgba(245, 158, 11, 0.25);
  border: 1px solid #f59e0b;
  color: #fcd34d;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.35);
}

.hero-rarity-UR {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.3), rgba(168, 85, 247, 0.3));
  border: 1px solid #f43f5e;
  color: #fda4af;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.5);
}

.hero-stars-tag {
  color: #ffd166;
  font-size: 11px;
  font-weight: 800;
  text-shadow: 0 0 4px rgba(255, 209, 102, 0.4);
}

.hero-card-actions {
  display: flex;
  gap: 6px;
  margin-top: auto;
}

.hero-card-actions .hero-level-up-btn {
  flex: 1;
}

.hero-deploy-btn {
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid #10ac84;
  background: linear-gradient(180deg, #1dd1a1, #10ac84);
  color: #092c23;
  transition: all 0.15s ease;
}

.hero-deploy-btn.bench-mode {
  background: #2b2240;
  border-color: #5b4882;
  color: #d7cbf2;
}

.hero-deploy-btn:hover:not(:disabled) {
  filter: brightness(1.15);
}

.hero-deploy-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Gacha Banner */
.gacha-banner-box {
  background: linear-gradient(135deg, #1e1538 0%, #2d1b4e 55%, #1a1230 100%);
  border: 1px solid #6c4ea8;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

.gacha-banner-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.gacha-banner-title h3 {
  margin: 0 0 4px 0;
  font-size: 16px;
  color: #fff3c4;
  text-shadow: 0 0 8px rgba(255, 209, 102, 0.4);
}

.gacha-rates-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 10px;
}

.gacha-pity-box {
  text-align: right;
  font-size: 11px;
  color: #d6cbef;
}

.gacha-pity-bar-bg {
  width: 170px;
  height: 7px;
  background: #120d21;
  border: 1px solid #483670;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
}

.gacha-pity-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #f43f5e);
  transition: width 0.25s ease;
}

.gacha-buttons-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.gacha-pull-btn {
  padding: 9px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border: 1px solid transparent;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.gacha-pull-btn .btn-sub {
  font-size: 10px;
  font-weight: 600;
  opacity: 0.9;
}

.gacha-pull-btn.gems-single {
  background: linear-gradient(180deg, #0abde3, #0984e3);
  border-color: #48dbfb;
  color: #ffffff;
}

.gacha-pull-btn.gems-multi {
  background: linear-gradient(180deg, #9b59b6, #6c5ce7);
  border-color: #d980fa;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(155, 89, 182, 0.45);
}

.gacha-pull-btn.gold-single {
  background: linear-gradient(180deg, #d68910, #b9770e);
  border-color: #f5b041;
  color: #ffffff;
}

.gacha-pull-btn.gold-multi {
  background: linear-gradient(180deg, #e67e22, #d35400);
  border-color: #f39c12;
  color: #ffffff;
}

.gacha-pull-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.12);
}

.gacha-pull-btn:disabled {
  background: #262038;
  border-color: #3d3359;
  color: #6f648a;
  box-shadow: none;
  cursor: not-allowed;
}

/* Gacha Pull Results Showcase */
.gacha-results-panel {
  background: #171226;
  border: 1px solid #493870;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 14px;
}

.gacha-results-header {
  font-size: 13px;
  font-weight: 700;
  color: #ffeaa7;
  margin-bottom: 8px;
}

.gacha-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(125px, 1fr));
  gap: 8px;
}

@keyframes gachaPopIn {
  0% { opacity: 0; transform: scale(0.75) translateY(8px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.gacha-result-card {
  background: #211a36;
  border: 1px solid #45376b;
  border-radius: 6px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  animation: gachaPopIn 0.25s ease forwards;
}

.gacha-result-card.rar-SR { border-color: #a855f7; }
.gacha-result-card.rar-SSR { border-color: #f59e0b; box-shadow: 0 0 10px rgba(245, 158, 11, 0.3); }
.gacha-result-card.rar-UR { border-color: #f43f5e; box-shadow: 0 0 14px rgba(244, 63, 94, 0.5); }

.gacha-status-tag {
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 3px;
}

.gacha-status-tag.is-new {
  background: #10ac84;
  color: #ffffff;
}

.gacha-status-tag.is-dupe {
  background: #f39c12;
  color: #1a1205;
}

/* 26-Hero Codex Grid */
.codex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}

.codex-card {
  background: #1b162b;
  border: 1px solid #352b4f;
  border-radius: 6px;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.codex-card.locked {
  opacity: 0.45;
  filter: grayscale(0.85);
}

.codex-card.unlocked {
  border-color: #5c488a;
}

.codex-avatar {
  width: 38px;
  height: 38px;
  background: #261e3d;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.codex-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.codex-name {
  font-size: 11px;
  font-weight: 700;
  color: #f1ecff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.codex-meta {
  font-size: 9px;
  color: #a699c4;
}

.mini-deploy-btn {
  margin-top: 3px;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 800;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid #10ac84;
  background: linear-gradient(180deg, #1dd1a1, #10ac84);
  color: #072920;
  transition: filter 0.12s ease;
}

.mini-deploy-btn.in-party {
  background: #2b2245;
  border-color: #6c549e;
  color: #ffd166;
}

.mini-deploy-btn:hover {
  filter: brightness(1.15);
}

/* ========================================================
   WEB & MOBILE RESPONSIVE MODE (Cloudflare Pages / PWA)
   ======================================================== */
body.mode-web #window-titlebar .title-right {
  display: none !important;
}

body.mode-web #app-wrapper {
  border-radius: 0;
  border: none;
  height: 100dvh;
}

@media (max-width: 768px) {
  #window-titlebar {
    height: auto;
    min-height: 36px;
    padding: 4px 8px;
  }

  .title-left {
    flex-wrap: wrap;
    gap: 5px;
    font-size: 11px;
  }

  body.mode-windowed #combat-container {
    height: 155px;
  }

  #dashboard-nav {
    overflow-x: auto;
    white-space: nowrap;
    padding: 0 6px;
    gap: 2px;
    -webkit-overflow-scrolling: touch;
  }

  .nav-tab {
    padding: 0 10px;
    font-size: 11px;
    flex-shrink: 0;
  }

  #dashboard-content {
    padding: 10px;
    -webkit-overflow-scrolling: touch;
  }

  .equipment-bag-layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .heroes-grid {
    grid-template-columns: 1fr;
  }

  .gacha-buttons-row {
    grid-template-columns: 1fr 1fr;
  }

  .gacha-results-grid {
    grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  }

  .codex-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}
