/* ═══════════════════════════════════════════════════════════════════════════
   SOL VOL - HERO COMPONENTS
   Modern Dark Hero UI with Green Accents
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────────────
   HERO PORTRAIT
   ───────────────────────────────────────────────────────────────────────── */

.hero-portrait {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}

/* Portrait Frame */
.hero-portrait__frame {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  background: var(--dark-700);
  border: 3px solid var(--sol-green);
  box-shadow:
    0 0 15px var(--sol-green-glow),
    inset 0 0 20px rgba(0, 0, 0, 0.5);
  transition: all var(--duration-normal);
}

.hero-portrait:hover .hero-portrait__frame {
  box-shadow:
    0 0 25px var(--sol-green-glow),
    inset 0 0 20px rgba(0, 0, 0, 0.5);
  transform: scale(1.05);
}

/* Opponent portrait has different accent */
.hero-portrait--opponent .hero-portrait__frame {
  border-color: var(--sol-red);
  box-shadow:
    0 0 15px var(--sol-red-glow),
    inset 0 0 20px rgba(0, 0, 0, 0.5);
}

/* Portrait Image */
.hero-portrait__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Placeholder */
.hero-portrait__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--sol-green);
  background: linear-gradient(135deg, var(--dark-600) 0%, var(--dark-800) 100%);
}

/* Reaction Overlay */
.hero-portrait__reaction {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--duration-fast);
}

.hero-portrait__reaction.damage {
  background: radial-gradient(circle, rgba(255, 59, 92, 0.6) 0%, transparent 70%);
  animation: hero-damage 0.3s ease-out;
}

.hero-portrait__reaction.heal {
  background: radial-gradient(circle, rgba(20, 241, 149, 0.6) 0%, transparent 70%);
  animation: hero-heal 0.5s ease-out;
}

@keyframes hero-damage {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
  100% { opacity: 0; transform: scale(1); }
}

@keyframes hero-heal {
  0% { opacity: 0; }
  50% { opacity: 1; }
  100% { opacity: 0; }
}

/* ─────────────────────────────────────────────────────────────────────────
   HERO HEALTH SHIELD
   ───────────────────────────────────────────────────────────────────────── */

.hero-portrait__health {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 36px;
  height: 28px;
  padding: 0 8px;
  background: linear-gradient(135deg, var(--sol-green-dark) 0%, var(--sol-green) 100%);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px var(--sol-green-glow);
}

.hero-portrait__health-value {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Low health warning */
.hero-portrait__health.low {
  background: linear-gradient(135deg, #cc2244 0%, var(--sol-red) 100%);
  animation: health-low-pulse 1s ease-in-out infinite;
}

@keyframes health-low-pulse {
  0%, 100% { box-shadow: 0 2px 8px var(--sol-red-glow); }
  50% { box-shadow: 0 2px 15px var(--sol-red-glow); }
}

/* ─────────────────────────────────────────────────────────────────────────
   HERO POWER BUTTON
   ───────────────────────────────────────────────────────────────────────── */

.hero-portrait__power {
  position: absolute;
  bottom: -5px;
  right: -10px;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--dark-600) 0%, var(--dark-800) 100%);
  border: 2px solid var(--sol-purple);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-normal);
  box-shadow: 0 0 10px var(--sol-purple-glow);
}

.hero-portrait__power:hover {
  transform: scale(1.1);
  box-shadow: 0 0 20px var(--sol-purple-glow);
}

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

.hero-portrait__power:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.hero-portrait__power-icon {
  font-size: 16px;
  color: var(--sol-purple);
}

.hero-portrait__power-cost {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  background: var(--sol-cyan);
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  color: var(--dark-900);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─────────────────────────────────────────────────────────────────────────
   TPS CRYSTAL DISPLAY
   ───────────────────────────────────────────────────────────────────────── */

.tps-display {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tps-crystal {
  width: 16px;
  height: 20px;
  position: relative;
}

.tps-crystal::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--dark-600);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all var(--duration-fast);
}

.tps-crystal.filled::before {
  background: linear-gradient(135deg, var(--sol-cyan) 0%, #0099cc 100%);
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}

.tps-crystal.empty::before {
  background: var(--dark-700);
  opacity: 0.5;
}

/* Animated crystal gain */
.tps-crystal.gaining {
  animation: crystal-gain 0.5s ease-out;
}

@keyframes crystal-gain {
  0% { transform: scale(0.5); opacity: 0; }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

/* Animated crystal spend */
.tps-crystal.spending {
  animation: crystal-spend 0.3s ease-out;
}

@keyframes crystal-spend {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.5) translateY(-10px); opacity: 0; }
}

.tps-display__text {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  color: var(--sol-cyan);
  margin-left: 4px;
}

/* Simple TPS display (numeric) */
.tps-simple {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: var(--radius-md);
}

.tps-simple__label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
}

.tps-simple__value {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--sol-cyan);
}

/* ─────────────────────────────────────────────────────────────────────────
   PROFIT METER
   ───────────────────────────────────────────────────────────────────────── */

.profit-meter {
  width: 100%;
  max-width: 300px;
}

.profit-meter__label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xs);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.profit-meter__label span:nth-child(2) {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--sol-green);
}

.profit-meter__bar {
  height: 12px;
  background: var(--dark-700);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.profit-meter__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sol-green-dark) 0%, var(--sol-green) 100%);
  border-radius: var(--radius-full);
  transition: width 0.5s var(--ease-out);
  position: relative;
}

/* Shine effect on fill */
.profit-meter__fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, transparent 100%);
  border-radius: var(--radius-full) var(--radius-full) 0 0;
}

/* Glow when near win */
.profit-meter__bar.near-win {
  box-shadow: 0 0 15px var(--sol-green-glow);
}

.profit-meter__bar.near-win .profit-meter__fill {
  animation: profit-pulse 1s ease-in-out infinite;
}

@keyframes profit-pulse {
  0%, 100% { box-shadow: inset 0 0 10px rgba(20, 241, 149, 0.3); }
  50% { box-shadow: inset 0 0 20px rgba(20, 241, 149, 0.5); }
}

/* Markers on the bar */
.profit-meter__markers {
  display: flex;
  justify-content: space-between;
  padding: 0 2px;
  margin-top: 2px;
}

.profit-meter__marker {
  width: 1px;
  height: 4px;
  background: var(--dark-400);
}

.profit-meter__marker:nth-child(5n) {
  height: 6px;
  background: var(--dark-300);
}

/* ─────────────────────────────────────────────────────────────────────────
   PLAYER STATUS BAR
   ───────────────────────────────────────────────────────────────────────── */

.player-status {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: rgba(17, 17, 17, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
}

.player-status__stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.player-status__stat-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.player-status__stat-value {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--sol-green);
}

/* ─────────────────────────────────────────────────────────────────────────
   CHARGES DISPLAY
   ───────────────────────────────────────────────────────────────────────── */

.charges-display {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.charge-pip {
  width: 10px;
  height: 10px;
  background: var(--dark-600);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transition: all var(--duration-fast);
}

.charge-pip.filled {
  background: var(--sol-gold);
  box-shadow: 0 0 6px var(--sol-gold-glow);
}

/* ─────────────────────────────────────────────────────────────────────────
   DECK/HAND COUNTERS
   ───────────────────────────────────────────────────────────────────────── */

.counter-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  background: var(--dark-700);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.counter-badge__value {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-primary);
}

.counter-badge--warning {
  border-color: rgba(255, 152, 0, 0.3);
  background: rgba(255, 152, 0, 0.1);
}

.counter-badge--warning .counter-badge__value {
  color: var(--sol-orange);
}

.counter-badge--danger {
  border-color: rgba(255, 59, 92, 0.3);
  background: rgba(255, 59, 92, 0.1);
}

.counter-badge--danger .counter-badge__value {
  color: var(--sol-red);
}

/* ─────────────────────────────────────────────────────────────────────────
   EMOTE BUBBLE
   ───────────────────────────────────────────────────────────────────────── */

.emote-bubble {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  padding: var(--space-sm) var(--space-md);
  background: var(--dark-700);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  color: var(--text-primary);
  white-space: nowrap;
  opacity: 0;
  animation: emote-appear 3s ease-out forwards;
  z-index: 50;
}

.emote-bubble::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid var(--dark-700);
}

@keyframes emote-appear {
  0% { opacity: 0; transform: translateX(-50%) translateY(10px); }
  10% { opacity: 1; transform: translateX(-50%) translateY(0); }
  80% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

/* ─────────────────────────────────────────────────────────────────────────
   TURN INDICATOR ON PORTRAIT
   ───────────────────────────────────────────────────────────────────────── */

.hero-portrait.active-turn::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--sol-green);
  animation: turn-ring 1.5s ease-in-out infinite;
}

@keyframes turn-ring {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.5;
  }
}
