/* ========================================================
   Pixel Survivor: Abyss - Modern Retro Arcade Styling
   ======================================================== */

:root {
  --bg-dark: #0a0e17;
  --panel-bg: rgba(16, 23, 38, 0.94);
  --panel-border: #2e3c56;
  --accent-cyan: #00f0ff;
  --accent-green: #39ff14;
  --accent-gold: #ffb800;
  --accent-red: #ff3366;
  --accent-purple: #b537f2;
  --text-main: #f0f6fc;
  --text-muted: #8b949e;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", monospace, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-family);
  touch-action: none;
}

#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at center, #111a2e 0%, #06090e 100%);
}

#gameCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  z-index: 1;
}

/* ================= HUD Overlay ================= */
.hud-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

/* Top EXP Progress Bar */
.exp-bar-container {
  width: 100%;
  height: 20px;
  background: rgba(10, 15, 25, 0.85);
  border-bottom: 2px solid #1f2b3e;
  position: relative;
  overflow: hidden;
}

.exp-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #00c6ff, #0072ff);
  box-shadow: 0 0 10px rgba(0, 198, 255, 0.8);
  transition: width 0.15s ease-out;
}

.exp-text {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 12px;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.5px;
  text-shadow: 1px 1px 2px #000;
}

.level-badge {
  background: #ffb800;
  color: #000;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 900;
  font-size: 11px;
}

/* Stats Row */
.hud-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
}

.hud-stat-box {
  background: rgba(16, 23, 38, 0.85);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: bold;
  font-family: monospace;
}

.timer-box {
  color: var(--accent-cyan);
  font-size: 16px;
}

.kills-box {
  color: var(--accent-red);
}

.gold-box {
  color: var(--accent-gold);
}

.super-box {
  color: var(--accent-gold);
  border-color: rgba(255, 215, 0, 0.45);
  background: rgba(255, 215, 0, 0.08);
}

.icon-btn {
  pointer-events: auto;
  background: rgba(16, 23, 38, 0.85);
  border: 1px solid var(--panel-border);
  color: #fff;
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
}

.icon-btn:active {
  transform: scale(0.92);
  background: #25334c;
}

/* Player HP Bar HUD */
.player-hp-container {
  margin-left: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: bold;
}

.hp-bar-label {
  color: #ff3366;
  font-family: monospace;
  font-weight: 900;
}

.hp-bar-outer {
  width: 140px;
  height: 12px;
  background: rgba(20, 10, 15, 0.85);
  border: 1px solid #ff3366;
  border-radius: 4px;
  overflow: hidden;
}

.hp-bar-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #ff3366, #ff6b8b);
  box-shadow: 0 0 8px rgba(255, 51, 102, 0.6);
  transition: width 0.12s ease-out;
}

/* Boss HP HUD */
.boss-hp-container {
  width: 90%;
  max-width: 480px;
  margin: 6px auto 0 auto;
  background: rgba(26, 4, 10, 0.95);
  border: 2px solid #ff1744;
  border-radius: 8px;
  padding: 6px 14px;
  text-align: center;
  box-shadow: 0 0 20px rgba(255, 23, 68, 0.6), inset 0 0 10px rgba(255, 0, 80, 0.3);
  animation: pulse-boss 1.5s infinite alternate;
  pointer-events: auto;
  z-index: 25;
}

@keyframes pulse-boss {
  0% { box-shadow: 0 0 10px rgba(255, 23, 68, 0.4); }
  100% { box-shadow: 0 0 25px rgba(255, 23, 68, 0.85); }
}

.boss-name {
  color: #ff5252;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 1px;
}

.boss-hp-outer {
  width: 100%;
  height: 14px;
  background: #2a0808;
  border-radius: 4px;
  margin-top: 4px;
  overflow: hidden;
}

.boss-hp-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #d50000, #ff1744);
  transition: width 0.1s linear;
}

.boss-hp-num {
  font-size: 11px;
  color: #ffcdd2;
  margin-top: 2px;
  font-family: monospace;
}

/* Active Perks Tray */
.active-perks-tray {
  margin: 8px 14px 0 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.perk-pill {
  background: rgba(16, 23, 38, 0.8);
  border: 1px solid #334466;
  border-radius: 5px;
  padding: 2px 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}

.perk-pill.super-pill {
  background: rgba(224, 64, 251, 0.25);
  border: 1px solid #e040fb;
  box-shadow: 0 0 8px rgba(224, 64, 251, 0.6);
  animation: pulse-super 1.5s infinite alternate;
}

@keyframes pulse-super {
  0% { box-shadow: 0 0 5px rgba(224, 64, 251, 0.4); }
  100% { box-shadow: 0 0 12px rgba(224, 64, 251, 0.9); }
}

.perk-pill .perk-lvl {
  font-size: 10px;
  background: #ffb800;
  color: #000;
  padding: 0 4px;
  border-radius: 3px;
  font-weight: bold;
}

.perk-pill .perk-super-tag {
  font-size: 9px;
  background: #e040fb;
  color: #fff;
  padding: 0 4px;
  border-radius: 3px;
  font-weight: 900;
}

/* Virtual Joystick */
.joystick-zone {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
}

.joystick-base {
  position: absolute;
  width: 110px;
  height: 110px;
  margin-left: -55px;
  margin-top: -55px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(0, 240, 255, 0.5);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
  pointer-events: none;
  transform: translate3d(0, 0, 0);
}

.joystick-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 48px;
  height: 48px;
  margin-left: -24px;
  margin-top: -24px;
  border-radius: 50%;
  background: radial-gradient(circle, #00f0ff 0%, #0077b6 100%);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.8);
  pointer-events: none;
}

/* Floating Audio Button */
.floating-audio-btn {
  position: absolute;
  bottom: 16px;
  right: 16px;
  z-index: 50;
  background: rgba(16, 23, 38, 0.85);
  border: 1px solid var(--panel-border);
  color: #fff;
  font-size: 18px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  transition: transform 0.15s;
}

.floating-audio-btn:active {
  transform: scale(0.9);
}

/* ================= Screen Overlays ================= */
.screen-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 30;
  background: rgba(6, 9, 15, 0.88);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.pixel-panel {
  background: var(--panel-bg);
  border: 2px solid var(--panel-border);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 15px rgba(0, 240, 255, 0.15);
  color: var(--text-main);
  max-width: 500px;
  width: 100%;
  padding: 22px 18px;
  text-align: center;
  animation: pop-in 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  max-height: 94vh;
  overflow-y: auto;
}

@keyframes pop-in {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Main Menu Details */
.menu-banner-wrapper {
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
  border: 2px solid var(--panel-border);
  box-shadow: 0 4px 18px rgba(0, 240, 255, 0.25);
}

.menu-banner-img {
  width: 100%;
  height: auto;
  max-height: 180px;
  display: block;
  object-fit: cover;
}

.game-title {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #00f0ff 0%, #39ff14 50%, #ffb800 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 4px 0;
  text-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
}

.pixel-subtitle {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--accent-cyan);
  font-weight: bold;
}

.game-tagline {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 14px;
}

/* Hero Selection Tray */
.hero-select-section {
  background: rgba(10, 15, 25, 0.6);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 16px;
}

.section-title {
  font-size: 12px;
  color: var(--accent-cyan);
  font-weight: bold;
  text-align: left;
  margin-bottom: 8px;
}

.hero-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.hero-card {
  background: #111a2d;
  border: 2px solid #233452;
  border-radius: 8px;
  padding: 8px 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.hero-card:active {
  transform: scale(0.95);
}

.hero-card.active {
  background: #1b2844;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
}

.hero-card .hero-icon {
  font-size: 26px;
}

.hero-avatar {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  border: 2px solid rgba(0, 240, 255, 0.4);
  background-size: 200% 200%;
  background-color: #0b111e;
  margin-bottom: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  transition: all 0.2s ease;
}
.hero-avatar.avatar-mage {
  background-image: url('assets/heroes.webp');
  background-position: 0% 0%;
  border-color: #00f0ff;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
}
.hero-avatar.avatar-ninja {
  background-image: url('assets/heroes.webp');
  background-position: 100% 0%;
  border-color: #39ff14;
  box-shadow: 0 0 8px rgba(57, 255, 20, 0.4);
}
.hero-avatar.avatar-thunder {
  background-image: url('assets/heroes.webp');
  background-position: 0% 100%;
  border-color: #ffd166;
  box-shadow: 0 0 8px rgba(255, 209, 102, 0.4);
}
.hero-avatar.avatar-demolition {
  background-image: url('assets/heroes.webp');
  background-position: 100% 100%;
  border-color: #ff5400;
  box-shadow: 0 0 8px rgba(255, 84, 0, 0.4);
}
.hero-avatar.avatar-paladin {
  background-image: url('assets/hero_paladin.webp');
  background-size: cover;
  background-position: center;
  border-color: #ffd700;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
}
.hero-avatar.avatar-summoner {
  background-image: url('assets/hero_summoner.webp');
  background-size: cover;
  background-position: center;
  border-color: #b388ff;
  box-shadow: 0 0 10px rgba(179, 136, 255, 0.6);
}
.hero-avatar.avatar-swordmaster {
  background-image: url('assets/hero_swordmaster.webp');
  background-size: cover;
  background-position: center;
  border-color: #00e5ff;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.75);
}

.hero-card.locked {
  opacity: 0.82;
  border-color: #4b5563;
  position: relative;
}
.hero-card.locked .hero-avatar {
  filter: grayscale(45%);
}
.hero-card.locked::after {
  content: '🔒';
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 11px;
}
.hero-cost-tag {
  font-size: 9px;
  color: #ffd700;
  font-weight: 800;
  margin-top: 2px;
  text-shadow: 0 0 4px rgba(0,0,0,0.8);
}
.hero-unlock-container {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}
.hero-unlock-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: 1px solid #fbbf24;
  color: #fff;
  font-weight: bold;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
  transition: all 0.2s;
  font-size: 13px;
}
.hero-unlock-btn:hover:not(.disabled) {
  transform: translateY(-2px);
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.7);
}
.hero-unlock-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(80%);
}
.hero-unlock-hint {
  font-size: 11px;
  color: #ef4444;
}

.hero-card .hero-name {
  font-size: 11px;
  font-weight: bold;
}

.hero-desc-box {
  margin-top: 10px;
  text-align: left;
  background: rgba(10, 16, 28, 0.85);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  border: 1px solid rgba(0, 240, 255, 0.25);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.5);
}

.hero-desc-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.hero-desc-portrait {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  border: 2px solid #ffd700;
  background-size: cover;
  background-position: center;
  background-color: #06090e;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.35);
  flex-shrink: 0;
}

.hero-desc-portrait.avatar-mage {
  background-image: url('assets/heroes.webp');
  background-size: 200% 200%;
  background-position: 0% 0%;
  border-color: #00f0ff;
}
.hero-desc-portrait.avatar-ninja {
  background-image: url('assets/heroes.webp');
  background-size: 200% 200%;
  background-position: 100% 0%;
  border-color: #39ff14;
}
.hero-desc-portrait.avatar-thunder {
  background-image: url('assets/heroes.webp');
  background-size: 200% 200%;
  background-position: 0% 100%;
  border-color: #ffd166;
}
.hero-desc-portrait.avatar-demolition {
  background-image: url('assets/heroes.webp');
  background-size: 200% 200%;
  background-position: 100% 100%;
  border-color: #ff5400;
}

.hero-desc-main {
  flex: 1;
}

.hero-desc-title {
  font-size: 14px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.5px;
}

.hero-desc-subtitle {
  font-size: 11px;
  color: var(--accent-cyan);
  font-weight: bold;
  margin-top: 2px;
}

.hero-desc-detail {
  color: #cbd5e1;
  font-size: 11.5px;
  line-height: 1.4;
  margin-bottom: 6px;
}

.hero-perks-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.hero-perk-tag {
  background: rgba(0, 240, 255, 0.15);
  color: #79c0ff;
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 10px;
  font-weight: bold;
}

.menu-stats-preview {
  background: rgba(10, 15, 25, 0.6);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 14px;
  display: flex;
  justify-content: space-around;
  border: 1px dashed var(--panel-border);
}

.highlight {
  color: var(--accent-cyan);
  font-weight: bold;
  font-family: monospace;
}

.highlight-gold {
  color: var(--accent-gold);
  font-weight: bold;
  font-family: monospace;
}

.menu-actions, .gameover-actions, .pause-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Buttons */
button {
  font-family: inherit;
  font-size: 16px;
  font-weight: bold;
  padding: 14px 20px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, #00f0ff 0%, #0072ff 100%);
  color: #06090e;
  font-weight: 900;
  box-shadow: 0 4px 15px rgba(0, 240, 255, 0.4);
}

.btn-primary:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(0, 240, 255, 0.6);
}

.btn-secondary {
  background: #1b263b;
  border: 1px solid #415a77;
  color: #e0e1dd;
}

.btn-secondary:active {
  background: #25334c;
  transform: scale(0.97);
}

.btn-subtle {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
  padding: 8px 12px;
  font-size: 13px;
}

.btn-subtle:active {
  color: #fff;
}

.menu-footer {
  margin-top: 14px;
  font-size: 11px;
  color: #6e7681;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ================= Level Up Selection ================= */
.levelup-badge {
  display: inline-block;
  background: linear-gradient(90deg, #ffb800, #ff8800);
  color: #000;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1px;
  padding: 3px 12px;
  border-radius: 12px;
  margin-bottom: 6px;
}

.levelup-header h2 {
  font-size: 22px;
  margin-bottom: 4px;
}

.levelup-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.upgrade-cards-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.upgrade-card {
  background: #121a2c;
  border: 2px solid #283a5e;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  overflow: hidden;
}

.upgrade-card:active, .upgrade-card:hover {
  background: #1c2944;
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 240, 255, 0.25);
}

.upgrade-card.new-weapon::after {
  content: "NEW";
  position: absolute;
  top: 4px;
  right: 6px;
  background: var(--accent-cyan);
  color: #000;
  font-size: 9px;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 3px;
}

/* Super Weapon Evolution Card */
.upgrade-card.super-card {
  background: linear-gradient(135deg, rgba(224, 64, 251, 0.2) 0%, rgba(30, 10, 45, 0.9) 100%);
  border: 2px solid #e040fb;
  box-shadow: 0 0 18px rgba(224, 64, 251, 0.5);
  animation: pulse-super-card 1.5s infinite alternate;
}

@keyframes pulse-super-card {
  0% { border-color: #e040fb; box-shadow: 0 0 10px rgba(224, 64, 251, 0.4); }
  100% { border-color: #ffd600; box-shadow: 0 0 22px rgba(255, 214, 0, 0.8); }
}

.upgrade-card.super-card::after {
  content: "⚡ 超武觉醒";
  position: absolute;
  top: 4px;
  right: 6px;
  background: linear-gradient(90deg, #e040fb, #ffd600);
  color: #000;
  font-size: 10px;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 4px;
}

.card-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-info {
  flex: 1;
}

.card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.card-name {
  font-size: 15px;
  font-weight: bold;
  color: #fff;
}

.card-lvl {
  font-size: 11px;
  color: var(--accent-gold);
  font-weight: bold;
}

.card-desc {
  font-size: 12px;
  color: #8b949e;
  line-height: 1.35;
}

.card-synergy {
  margin-top: 6px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.3px;
  display: inline-block;
  text-align: left;
}

.card-synergy.needed {
  background: rgba(30, 41, 59, 0.85);
  color: #94a3b8;
  border: 1px dashed rgba(148, 163, 184, 0.45);
}

.card-synergy.ready {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.22), rgba(245, 158, 11, 0.15));
  color: #fde047;
  border: 1px solid #facc15;
  box-shadow: 0 0 8px rgba(250, 204, 21, 0.3);
}

.card-action-row {
  margin-top: 6px;
  display: flex;
  justify-content: flex-end;
}

.card-btn-banish {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #ef4444;
  color: #fca5a5;
  font-size: 11px;
  font-weight: bold;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.card-btn-banish:hover {
  background: #ef4444;
  color: #fff;
  transform: scale(1.05);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

/* ================= Shop Modal ================= */
.shop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.shop-header h2 {
  font-size: 18px;
}

.shop-gold-display {
  font-size: 14px;
}

.shop-desc {
  font-size: 12px;
  color: var(--text-muted);
  text-align: left;
  margin-bottom: 10px;
}

.shop-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.shop-tab {
  flex: 1;
  padding: 8px 10px;
  background: #111a2d;
  border: 1px solid #233452;
  border-radius: 6px;
  font-size: 12px;
  font-weight: bold;
  color: #8b949e;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.shop-tab:hover {
  background: #182742;
  color: #fff;
}

.shop-tab.active {
  background: #1f365d;
  border-color: var(--accent-cyan);
  color: #fff;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.25);
}

.shop-section-title {
  font-size: 13px;
  font-weight: bold;
  color: #ffd700;
  margin: 10px 0 6px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.talent-item.skill-unlock-item {
  border-color: #a855f7;
  background: #171026;
}

.talent-item.tier3-item {
  border-color: #ff3d00;
  background: #241014;
}

.talents-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 52vh;
  overflow-y: auto;
  margin-bottom: 16px;
  padding-right: 4px;
}

.talent-item {
  background: #111a2d;
  border: 1px solid #233452;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  gap: 8px;
}

.talent-item-info {
  flex: 1;
}

.talent-title-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: bold;
  color: #fff;
}

.talent-cur-val {
  font-size: 11px;
  color: var(--accent-cyan);
}

.talent-desc {
  font-size: 11px;
  color: #8b949e;
  margin-top: 2px;
}

.talent-dots {
  display: flex;
  gap: 3px;
  margin-top: 5px;
}

.talent-dot {
  width: 14px;
  height: 5px;
  background: #1f2d45;
  border-radius: 2px;
}

.talent-dot.active {
  background: var(--accent-gold);
}

.btn-buy-talent {
  padding: 8px 12px;
  font-size: 12px;
  background: #ffb800;
  color: #000;
  font-weight: bold;
  border-radius: 6px;
  white-space: nowrap;
}

.btn-buy-talent.maxed {
  background: #2a3547;
  color: #6e7681;
  cursor: not-allowed;
}

.btn-buy-talent.cant-afford {
  background: #393e46;
  color: #888;
  cursor: not-allowed;
}

/* ================= Game Over Screen ================= */
.gameover-title {
  font-size: 26px;
  font-weight: 900;
  color: var(--accent-red);
  letter-spacing: 1px;
}

.gameover-quote {
  font-size: 13px;
  color: var(--text-muted);
  margin: 6px 0 18px 0;
}

.gameover-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.stat-cell {
  background: rgba(10, 15, 25, 0.7);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-cell .label {
  font-size: 11px;
  color: var(--text-muted);
}

.stat-cell .val {
  font-size: 18px;
  font-weight: bold;
  font-family: monospace;
}

.new-record-alert {
  background: rgba(255, 184, 0, 0.15);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  border-radius: 6px;
  padding: 8px;
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 16px;
  animation: bounce 1s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* ================= Guide Modal & Super Recipes ================= */
.guide-content {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
  max-height: 58vh;
  overflow-y: auto;
}

.guide-section-header {
  font-size: 13px;
  font-weight: bold;
  color: var(--accent-gold);
  margin-top: 6px;
}

.synergy-recipe {
  background: rgba(16, 23, 38, 0.7);
  border: 1px solid #3d255a;
  border-left: 3px solid #e040fb;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
}

.recipe-line {
  color: #e0e1dd;
  margin-bottom: 3px;
}

.recipe-result {
  color: #79c0ff;
  font-size: 11px;
}

.guide-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: rgba(10, 15, 25, 0.5);
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #1c273a;
}

.guide-item .icon {
  font-size: 20px;
  flex-shrink: 0;
}

.guide-item strong {
  font-size: 13px;
  color: var(--accent-cyan);
}

.guide-item p {
  font-size: 11px;
  color: #8b949e;
  margin-top: 2px;
  line-height: 1.4;
}

/* ================= Pause Modal ================= */
.pause-stats {
  display: flex;
  justify-content: space-around;
  margin: 12px 0;
  font-size: 14px;
  color: var(--accent-cyan);
}

.pause-build {
  text-align: left;
  margin-bottom: 16px;
}

.pause-build h3 {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.pause-perks-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 35vh;
  overflow-y: auto;
}

/* Responsive tweaks */
@media (max-width: 480px) {
  .pixel-panel {
    padding: 18px 14px;
  }
  .game-title {
    font-size: 26px;
  }
  .hero-list {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* PC Only and Controls Enhancement */
.pc-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 600px) {
  .pc-only {
    display: none !important;
  }
}

#hud-toggle-mouse {
  padding: 4px 8px;
  font-size: 11px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid #38bdf8;
  color: #e0f2fe;
}

#hud-toggle-mouse:hover {
  background: rgba(56, 189, 248, 0.25);
}

.btn-reroll {
  width: 100%;
  margin-top: 10px;
  background: linear-gradient(135deg, #4a148c, #7b1fa2);
  color: #ffd54f;
  border: 2px solid #ba68c8;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(123, 31, 162, 0.4);
}

.btn-reroll:hover {
  background: linear-gradient(135deg, #6a1b9a, #8e24aa);
  border-color: #ffd54f;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(123, 31, 162, 0.6);
}

.btn-reroll:active {
  transform: scale(0.96);
}

.btn-reroll.disabled,
.btn-reroll:disabled {
  background: rgba(30, 41, 59, 0.75);
  color: #94a3b8;
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

/* ================= Global Floating Toast ================= */
.game-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-24px);
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid #ffd700;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.65), 0 0 16px rgba(255, 215, 0, 0.35);
  color: #fff;
  padding: 12px 24px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  pointer-events: none;
  opacity: 0;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 99999;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.game-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
