.player-header{
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin: 15px 0;
}

.player-stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  max-width: 280px;
  min-width: 220px;
}

.player-stats p{
  margin: 4px 0;
  font-size: 14px;
}

.player-stat-card {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(0,0,0,0.18));
  border: 1px solid rgba(255,255,255,0.07);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.03),
    0 6px 14px rgba(0,0,0,0.16);
}

.player-stat-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
}

.player-stat-card-gold::before {
  background: linear-gradient(180deg, #f5c76a, #b8862f);
  box-shadow: 0 0 10px rgba(245,199,106,0.22);
}

.player-stat-card-stones::before {
  background: linear-gradient(180deg, #66c7ff, #2f7fd8);
  box-shadow: 0 0 10px rgba(102,199,255,0.22);
}

.player-stat-card-power::before {
  background: linear-gradient(180deg, #c18cff, #7b4dcb);
  box-shadow: 0 0 10px rgba(193,140,255,0.18);
}

.player-stat-card-exp::before {
  background: linear-gradient(180deg, #ff7ad9, #c85bbf);
  box-shadow: 0 0 10px rgba(255,122,217,0.18);
}

.player-stat-icon {
  font-size: 20px;
  width: 28px;
  min-width: 28px;
  text-align: center;
}

.player-stat-content {
  min-width: 0;
}

.player-stat-label {
  font-size: 12px;
  color: #b8b8b8;
  margin-bottom: 2px;
  line-height: 1.2;
}

.player-stat-value {
  font-size: 17px;
  font-weight: 800;
  color: #f2f2f2;
  line-height: 1.2;
}

.player-stat-card-gold .player-stat-value {
  color: #f3d28c;
}

.player-stat-card-stones .player-stat-value {
  color: #9edcff;
}

.player-stat-card-power .player-stat-value {
  color: #d6b2ff;
}

.player-stat-card-exp .player-stat-value {
  color: #ffb3ea;
}

.player-avatar-base{
  width: 192px;
  height: 192px;
  border-radius: 10px;
  background: #111;
  border: 2px solid #333;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-avatar-base img{
  max-width: 90%;
  max-height: 90%;
  image-rendering: pixelated;
}

#game-ui.locked .player-hud{
  display: none;
}

.hp-bar{
  position: relative;
  width: 100%;
  height: 18px;
  background: #333;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
  border: 1px solid rgba(255,255,255,.08);
}

.hp-fill{
  height: 100%;
  transition: width 0.4s ease;
}

.hp-text{
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #ffffff;
  text-shadow:
    0 1px 2px rgba(0,0,0,0.95),
    0 0 6px rgba(0,0,0,0.75);
  pointer-events: none;
  z-index: 2;
}

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

.monster-hp{
  background: linear-gradient(90deg, #c0392b, #e74c3c);
}

.exp-bar{
  position: relative;
  width: 100%;
  height: 14px;
  background: #333;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.08);
}

.exp-fill{
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(90deg, #f1c40f, #f39c12);
  transition: width 0.4s ease;
}

.exp-text{
  position: relative;
  z-index: 2;
  font-size: 11px;
  color: #fff;
  font-weight: bold;
  pointer-events: none;
}

.fatigue-bar{
  position: relative;
  width: 100%;
  height: 14px;
  background: #333;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
  border: 1px solid rgba(255,255,255,.08);
}

.fatigue-fill{
  height: 100%;
  transition: width .4s ease;
}

.fatigue-low{
  background: linear-gradient(90deg, #27ae60, #2ecc71);
}

.fatigue-mid{
  background: linear-gradient(90deg, #f1c40f, #f39c12);
}

.fatigue-high{
  background: linear-gradient(90deg, #c0392b, #e74c3c);
}

.fatigue-text{
  position: absolute;
  width: 100%;
  text-align: center;
  font-size: 11px;
  font-weight: bold;
  color: #fff;
  top: 0;
  line-height: 14px;
  text-shadow: 0 0 4px rgba(0,0,0,0.8);
  pointer-events: none;
}

.fatigue-status{
  margin: 8px 0 4px;
  font-weight: 700;
  font-size: 14px;
}

.hint{
  font-size: 12px;
  color: #aaa;
  margin: 4px 0 8px;
  line-height: 1.4;
}

.fatigue-warning{
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #e74c3c;
}

.box-fatigue{
  background: linear-gradient(180deg, #1c1c1c, #151515);
}

.box-fatigue.exhausted{
  border: 1px solid #c0392b;
  box-shadow: 0 0 10px rgba(192,57,43,.4);
}

.tooltip{
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin: 6px 0;
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(0,0,0,.18));
  border: 1px solid rgba(255,215,128,0.10);
  border-radius: 12px;
}

.stat-left{
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
}

.bonus{
  color: var(--gold);
  margin-left: 4px;
  font-size: 13px;
}

.stat-add-form{
  margin-left: auto;
  display: inline-flex;
  flex: 0 0 auto;
}

.tooltip-box{
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translate(12px, -50%);
  min-width: 220px;
  padding: 10px 12px;
  background: #000;
  color: #eee;
  border-radius: 10px;
  border: 1px solid rgba(255,215,128,0.12);
  font-size: 13px;
  line-height: 1.4;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .15s ease;
  z-index: 2000;
}

.tooltip:hover .tooltip-box{
  opacity: 1;
  visibility: visible;
}

.skill-card{
  margin-top: 8px;
}

.skill-desc{
  font-size: 12px;
  color: #aaa;
  margin-top: 4px;
}

.pots-meta{
  font-size: 12px;
  color: #aaa;
  margin: 6px 0;
}

.pots-actions{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pots-empty{
  font-size: 12px;
  color: #888;
}

.player-avatar-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background:
    linear-gradient(180deg,
      rgba(255,255,255,0.04),
      rgba(0,0,0,0.32)
    ),
    linear-gradient(180deg,
      rgba(20,20,20,0.96),
      rgba(10,10,10,0.98)
    );
  box-shadow:
    0 14px 32px rgba(0,0,0,0.38),
    inset 0 1px 0 rgba(255,255,255,0.04);
}

.player-avatar-main-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.player-avatar-main {
  width: 210px;
  height: 210px;
  border-radius: 16px;
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(255,255,255,0.05), transparent 35%),
    linear-gradient(180deg, rgba(18,18,18,0.98), rgba(8,8,8,0.98));
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.03),
    0 10px 24px rgba(0,0,0,0.28);
}

.player-avatar-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.player-avatar-info {
  min-width: 0;
}

.player-avatar-name {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 4px;
  color: #f7f2ea;
}

.player-avatar-sub {
  font-size: 13px;
  font-weight: 700;
  color: #cdbb9b;
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

.player-avatar-hp-block {
  max-width: 210px;
}

.player-avatar-hp-label {
  font-size: 12px;
  color: #b8b8b8;
  margin-bottom: 4px;
}

.player-avatar-hp-bar {
  margin-top: 0;
}

.player-avatar-hp-bar .hp-text {
  font-size: 14px;
  font-weight: 900;
}

.player-avatar-eq {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 0 0 auto;
}

.player-avatar-eq-slot {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.player-avatar-eq-slot.filled img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  padding: 4px;
}

.player-avatar-eq-slot.empty {
  color: #8d8d8d;
}

.player-avatar-slot-icon {
  font-size: 20px;
  opacity: 0.8;
}

.player-avatar-upgrade {
  position: absolute;
  right: 4px;
  bottom: 4px;
  padding: 2px 5px;
  border-radius: 999px;
  background: rgba(0,0,0,0.72);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  border: 1px solid rgba(255,255,255,0.08);
}

.player-avatar-card-blue {
  border-color: rgba(58,160,255,0.32);
  background:
    linear-gradient(180deg,
      rgba(58,160,255,0.10),
      rgba(0,0,0,0.38)
    ),
    linear-gradient(180deg,
      rgba(20,20,20,0.96),
      rgba(10,10,10,0.98)
    );
  box-shadow:
    0 14px 32px rgba(0,0,0,0.38),
    0 0 18px rgba(58,160,255,0.15),
    inset 0 1px 0 rgba(255,255,255,0.04);
}

.player-avatar-card-purple {
  border-color: rgba(181,108,255,0.34);
  background:
    linear-gradient(180deg,
      rgba(181,108,255,0.12),
      rgba(0,0,0,0.42)
    ),
    linear-gradient(180deg,
      rgba(20,20,20,0.96),
      rgba(10,10,10,0.98)
    );
  box-shadow:
    0 14px 32px rgba(0,0,0,0.38),
    0 0 22px rgba(181,108,255,0.18),
    inset 0 1px 0 rgba(255,255,255,0.04);
}

.player-avatar-card-gold {
  border-color: rgba(255,210,125,0.38);
  background:
    linear-gradient(180deg,
      rgba(255,210,125,0.14),
      rgba(0,0,0,0.46)
    ),
    linear-gradient(180deg,
      rgba(20,20,20,0.96),
      rgba(10,10,10,0.98)
    );
  box-shadow:
    0 14px 32px rgba(0,0,0,0.38),
    0 0 24px rgba(255,210,125,0.20),
    inset 0 1px 0 rgba(255,255,255,0.04);
}

@media (max-width: 768px){
  .tooltip-box{
    left: 0;
    top: 100%;
    transform: translate(0, 10px);
    width: 100%;
    min-width: unset;
  }

  .tooltip:focus-within .tooltip-box{
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}

@media (max-width: 760px) {
  .player-header {
    flex-direction: column;
    align-items: stretch;
  }

  .player-stats {
    max-width: unset;
    min-width: 0;
  }

  .player-avatar-card {
    justify-content: space-between;
  }

  .player-avatar-main {
    width: 170px;
    height: 170px;
  }

  .player-avatar-hp-block {
    max-width: 170px;
  }
}

.player-stat-label {
  font-size: 13px;
  color: #b8b8b8;
  margin-bottom: 2px;
  line-height: 1.2;
  font-weight: 700;
}

.player-stat-card-gold .player-stat-label {
  color: #f3d28c;
}

.player-stat-card-stones .player-stat-label {
  color: #9edcff;
}

.player-stat-card-power .player-stat-label {
  color: #d6b2ff;
}

.player-stat-card-exp .player-stat-label {
  color: #ffb3ea;
}
