/* Waffle Crusher HUD: Power Stone Arcade Edition */
:root{--wc-gold:#dcae4e;--wc-red:#d9272e;--wc-black:#08090d}

#hud.wc-hud, .wc-hud {
  display: none; /* Default hidden on main menu */
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: clamp(8px, 1.5vw, 20px);
  align-items: start;
  width: 100vw;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 50;
  pointer-events: none;
  font-family: 'Impact', 'Segoe UI Black', sans-serif;
  color: #fff;
  padding: 10px 0;
}

#hud.wc-hud.is-active, .wc-hud.is-active {
  display: grid; /* Displayed during active match */
}

.wc-hud__side {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0px;
  width: 100%;
}

.wc-hud__side--right {
  align-items: stretch;
}

/* Internal layout wrapper for each player side */
.wc-hud__side > div:first-child {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.wc-hud__side--right > div:first-child {
  flex-direction: row-reverse;
  width: 100%;
}

.wc-hud__side--right > div:first-child > div:nth-child(2) {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.wc-hud__side--left > div:first-child > div:nth-child(2) {
  display: flex;
  flex-direction: column;
}

/* Portraits flush against outer screen edges */
.wc-hud__portrait {
  width: clamp(46px, 5.5vw, 70px);
  aspect-ratio: 1;
  object-fit: cover;
  border: 2px solid var(--wc-gold);
  clip-path: polygon(12% 0, 88% 0, 100% 12%, 100% 88%, 88% 100%, 12% 100%, 0 88%, 0 12%);
  box-shadow: 0 0 10px rgba(220, 174, 78, 0.4);
  flex-shrink: 0;
}

/* Sleek, thin name banners */
.wc-hud__name {
  width: 100%;
  padding: 2px 10px;
  background: linear-gradient(#29252a, #09090d);
  border: 1px solid var(--wc-gold);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: clamp(9px, 1.1vw, 12px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wc-hud__side--right .wc-hud__name {
  text-align: right;
}

/* Standardized, equal-length health meters hugging the name banner */
.wc-hud__meter {
  position: relative;
  width: 100%;
  height: clamp(11px, 1.5vw, 16px);
  overflow: hidden;
  background: #09090d;
  border: 2px solid #c69a42;
  box-shadow: 0 2px #030407, inset 0 0 0 2px #3d2b13;
  transform: skewX(-7deg);
  margin-top: -1px;
}

.wc-hud__side--right .wc-hud__meter {
  transform: skewX(7deg);
}

.wc-hud__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--value, 100%);
  transition: width .22s ease;
  border-radius: 2px;
}

.wc-hud__side--right .wc-hud__fill {
  inset: 0 0 0 auto;
}

.wc-hud__fill--health {
  background: linear-gradient(#ffb1a1 0%, #e63b36 28%, #a90e19 72%, #56090e 100%);
}

.wc-hud__fill--power {
  background: linear-gradient(#fff1a9 0%, #efc04b 30%, #b87918 75%, #66360a 100%);
}

.wc-hud__meter-label {
  display: none;
}

.wc-hud__center {
  display: grid;
  justify-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.wc-hud__timer {
  padding: 4px 10px;
  background: #08090d;
  border: 2px solid var(--wc-gold);
  color: #fff3c6;
  font-size: clamp(16px, 2.2vw, 24px);
  font-weight: 1000;
}

.wc-hud__normal-only {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding-left: 2px;
}

.wc-hud__side--right .wc-hud__normal-only {
  flex-direction: row-reverse;
  padding-right: 2px;
  padding-left: 0;
}

.wc-hud__waffles {
  display: flex;
  gap: 4px;
}

.wc-hud__waffle {
  width: clamp(16px, 2vw, 22px);
  aspect-ratio: 1;
  background-image: url('/assets/ui/mainmenu/icon-waffle.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.3;
  filter: grayscale(1) drop-shadow(0 1px 2px rgba(0,0,0,0.8));
  transition: all 0.2s ease;
}

.wc-hud__waffle.is-collected {
  opacity: 1;
  filter: drop-shadow(0 0 6px rgba(255,197,46,0.8));
}

/* Independent Third Transformation Bar - Perfectly matched to health bar width and skew */
.wc-hud__transform-bar-container {
  display: none;
  width: 100%;
  margin-top: 5px;
}

.wc-hud__transform-bar-container.is-active,
.wc-hud__transform-bar-container[data-active="true"] {
  display: block;
}

.wc-hud__transform-bar-glow {
  position: relative;
  width: 100%;
  height: clamp(11px, 1.5vw, 16px);
  overflow: hidden;
  background: #09090d;
  border: 2px solid #ffc52e;
  box-shadow: 0 0 15px rgba(255, 197, 46, 0.75), inset 0 0 8px rgba(255, 197, 46, 0.5);
  transform: skewX(-7deg);
}

.wc-hud__side--right .wc-hud__transform-bar-glow {
  transform: skewX(7deg);
}

@media(max-width: 620px) {
  .wc-hud { gap: 4px; }
  .wc-hud__name { font-size: 8px; padding: 2px 6px; }
  .wc-hud__center { min-width: 40px; }
}