.pf-hud-root {
  position: absolute;
  inset: 0;
  pointer-events: none;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  color: #fff;
  z-index: 1000;
}

/* Force mobile styles via class */
.pf-hud-root.pf-hud-mobile {
  transform: scale(0.5) !important;
  transform-origin: top center;
}

.pf-hud-root.pf-hud-mobile .pf-hud-team-bar,
.pf-hud-root.pf-hud-mobile .pf-hud-team-left .pf-hud-team-bar,
.pf-hud-root.pf-hud-mobile .pf-hud-team-right .pf-hud-team-bar {
  width: 200px !important;
  height: 14px !important;
  max-width: 200px !important;
  min-width: 200px !important;
}

.pf-hud-root.pf-hud-mobile .pf-hud-top .pf-hud-hull-bar,
.pf-hud-root.pf-hud-mobile .pf-hud-hull-bar {
  width: 200px !important;
  height: 14px !important;
  max-width: 200px !important;
  min-width: 200px !important;
}

.pf-hud-root.pf-hud-mobile .pf-hud-wheel-left,
.pf-hud-root.pf-hud-mobile .pf-hud-left .pf-hud-wheel-left {
  width: 80px !important;
  height: 80px !important;
  max-width: 80px !important;
  max-height: 80px !important;
  min-width: 80px !important;
  min-height: 80px !important;
}

.pf-hud-root.pf-hud-mobile .pf-hud-joystick-right,
.pf-hud-root.pf-hud-mobile .pf-hud-right .pf-hud-joystick-right {
  width: 80px !important;
  height: 80px !important;
  max-width: 80px !important;
  max-height: 80px !important;
  min-width: 80px !important;
  min-height: 80px !important;
}

.pf-hud-root.pf-hud-mobile .pf-hud-joystick-stick-right {
  width: 20px !important;
  height: 20px !important;
}

@media screen and (max-width: 480px) {
  .pf-hud-root.pf-hud-mobile {
    transform: scale(0.4) !important;
  }
  
  .pf-hud-root.pf-hud-mobile .pf-hud-team-bar,
  .pf-hud-root.pf-hud-mobile .pf-hud-team-left .pf-hud-team-bar,
  .pf-hud-root.pf-hud-mobile .pf-hud-team-right .pf-hud-team-bar {
    width: 160px !important;
    height: 11px !important;
    max-width: 160px !important;
    min-width: 160px !important;
  }
  
  .pf-hud-root.pf-hud-mobile .pf-hud-top .pf-hud-hull-bar,
  .pf-hud-root.pf-hud-mobile .pf-hud-hull-bar {
    width: 160px !important;
    height: 11px !important;
    max-width: 160px !important;
    min-width: 160px !important;
  }
  
  .pf-hud-root.pf-hud-mobile .pf-hud-wheel-left,
  .pf-hud-root.pf-hud-mobile .pf-hud-left .pf-hud-wheel-left {
    width: 64px !important;
    height: 64px !important;
    max-width: 64px !important;
    max-height: 64px !important;
    min-width: 64px !important;
    min-height: 64px !important;
  }
  
  .pf-hud-root.pf-hud-mobile .pf-hud-joystick-right,
  .pf-hud-root.pf-hud-mobile .pf-hud-right .pf-hud-joystick-right {
    width: 64px !important;
    height: 64px !important;
    max-width: 64px !important;
    max-height: 64px !important;
    min-width: 64px !important;
    min-height: 64px !important;
  }
  
  .pf-hud-root.pf-hud-mobile .pf-hud-joystick-stick-right {
    width: 16px !important;
    height: 16px !important;
  }
}

.pf-hud-top {
  position: absolute;
  top: 3%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.pf-hud-top-bars {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pf-hud-team-left,
.pf-hud-team-right {
  display: flex;
  align-items: center;
  background: transparent;
  border: none;
  padding: 0;
}

.pf-hud-team-bar {
  width: 400px;
  height: 28px;
  border-radius: 999px;
  background: rgba(128, 128, 128, 0.2);
  backdrop-filter: blur(12px);
  border: 2px solid rgba(255, 255, 255, 0.25);
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.pf-hud-team-fill {
  width: 100%;
  height: 100%;
  transform-origin: left center;
  transform: scaleX(1);
  transition: transform 0.1s linear;
  border-radius: 999px;
}

.pf-hud-team-fill-left {
  background: rgba(255, 255, 255, 0.3);
}

.pf-hud-team-fill-right {
  background: rgba(255, 255, 255, 0.3);
}

.pf-hud-team-icons {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  pointer-events: none;
  z-index: 2;
}

.pf-hud-team-icons-left {
  justify-content: center;
  padding: 0 8px;
  gap: 4px;
}

.pf-hud-team-icons-right {
  justify-content: center;
  padding: 0 8px;
  gap: 4px;
}

.pf-hud-player-icon {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  margin: 0 3px;
}

.pf-hud-settings-btn {
  position: absolute;
  top: 8%;
  right: 3%;
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.9);
  font-size: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  transition: color 0.2s, transform 0.1s;
  z-index: 1001;
  padding: 12px;
  margin-right: 8px;
}

.pf-hud-settings-btn:hover {
  color: rgba(255, 255, 255, 1);
  transform: scale(1.1);
}

.pf-hud-settings-btn:active {
  transform: scale(0.95);
}

/* Settings Menu */
.pf-hud-settings-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: none;
}

.pf-hud-settings-menu.pf-hud-settings-menu-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.pf-hud-settings-menu-content {
  background: rgba(20, 20, 30, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.pf-hud-settings-menu.pf-hud-settings-menu-open .pf-hud-settings-menu-content {
  transform: scale(1);
}

.pf-hud-settings-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.pf-hud-settings-menu-header h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
}

.pf-hud-settings-menu-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 32px;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.pf-hud-settings-menu-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.pf-hud-settings-menu-body {
  padding: 32px;
  overflow-y: auto;
  color: #fff;
  flex: 1;
}

.pf-hud-settings-menu-body p {
  margin: 0;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.7);
}


.pf-hud-top .pf-hud-hull-bar {
  width: 400px;
  height: 28px;
  border-radius: 999px;
  background: rgba(128, 128, 128, 0.2);
  backdrop-filter: blur(12px);
  border: 2px solid rgba(255, 255, 255, 0.25);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.pf-hud-top .pf-hud-hull-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,#10b981,#facc15);
  transform-origin: left center;
  transform: scaleX(1);
  transition: transform 0.1s linear, background 0.3s ease-out;
  border-radius: 999px;
}

.pf-hud-top-timer {
  padding: 0;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: .08em;
  background: transparent;
  border: none;
}

.pf-hud-ship {
  position: absolute;
  left: 50%;
  bottom: 6%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.pf-hud-hull-bar {
  width: 240px;
  height: 18px;
  border-radius: 999px;
  background: rgba(0,0,0,0.75);
  overflow: hidden;
}

.pf-hud-hull-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,#10b981,#facc15);
  transform-origin: left center;
  transform: scaleX(1);
  transition: transform 0.1s linear;
}

.pf-hud-sails-bar {
  width: 180px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.15);
  overflow: hidden;
}

.pf-hud-sails-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #38bdf8 0%, #38bdf8 70%, #ffffff 70%, #ffffff 100%);
  transform-origin: left center;
  transform: scaleX(.7);
  transition: transform 0.1s linear, background 0.2s ease-out;
}

.pf-hud-ship-row {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  justify-content: center;
}

.pf-hud-tags {
  display: flex;
  gap: 6px;
}

.pf-hud-tag {
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.pf-hud-tag-bad {
  background: rgba(220,38,38,.9);
}

.pf-hud-tag-good {
  background: rgba(34,197,94,.9);
}

.pf-hud-left {
  position: absolute;
  left: 5%;
  bottom: 8%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.pf-hud-wheel-left {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(128, 128, 128, 0.2);
  backdrop-filter: blur(12px);
  border: 2px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
}

.pf-hud-wheel-img-left {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.15s ease-out;
  transform-origin: center center;
  opacity: 0.8;
  filter: brightness(1.2);
}

.pf-hud-joystick-right {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(128, 128, 128, 0.2);
  backdrop-filter: blur(12px);
  border: 2px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
}

.pf-hud-joystick-stick-right {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  position: absolute;
  transition: transform 0.1s ease-out;
  transform-origin: center center;
}

.pf-hud-wheel-right {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: transparent;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
}

.pf-hud-wheel-img-right {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.15s ease-out;
  transform-origin: center center;
  opacity: 0.8;
  filter: brightness(1.2);
}

.pf-hud-right {
  position: absolute;
  right: 5%;
  bottom: 8%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.pf-hud-ship-icon {
  --wind-angle: 0deg;
  width: 80px;
  height: 80px;
  border-radius: 16px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  position: relative;
  transition: transform 0.1s ease-out;
}

.pf-hud-wind-ring {
  position: absolute;
  width: 75px;
  height: 75px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

.pf-hud-wind-arrow-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(var(--wind-angle));
  transition: transform 0.2s ease-out;
  z-index: 1;
  pointer-events: none;
}

.pf-hud-wind-arrow {
  width: 12px;
  height: 12px;
  background: #3b82f6;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  transform: translateY(-35px);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
  border-radius: 2px 2px 0 0;
}

.pf-hud-ship-shape {
  position: relative;
  width: 22px;
  height: 37px;
  background: rgba(200, 200, 200, 0.8);
  clip-path: polygon(50% 0, 100% 26%, 100% 100%, 0 100%, 0 26%);
  box-shadow: 0 0 0 1px rgba(21, 24, 39, 0.5);
  border-radius: 3px;
  z-index: 2;
  pointer-events: none;
}


@keyframes pf-hud-aim-pulse {
  0%, 100% {
    opacity: 0.7;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
  }
}

.pf-hud-toast {
  position: absolute;
  left: 50%;
  top: 18%;
  transform: translateX(-50%);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.7);
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.pf-hud-toast.pf-hud-toast-visible {
  opacity: .9;
}

@media screen and (max-width: 768px) {
  .pf-hud-root {
    transform: scale(0.5) !important;
    transform-origin: top center;
  }
  
  .pf-hud-team-bar,
  .pf-hud-team-left .pf-hud-team-bar,
  .pf-hud-team-right .pf-hud-team-bar,
  div.pf-hud-team-bar {
    width: 200px !important;
    height: 14px !important;
    max-width: 200px !important;
    min-width: 200px !important;
  }
  
  .pf-hud-top .pf-hud-hull-bar,
  .pf-hud-hull-bar,
  div.pf-hud-hull-bar {
    width: 200px !important;
    height: 14px !important;
    max-width: 200px !important;
    min-width: 200px !important;
  }
  
  .pf-hud-wheel-left,
  .pf-hud-left .pf-hud-wheel-left,
  div.pf-hud-wheel-left {
    width: 80px !important;
    height: 80px !important;
    max-width: 80px !important;
    max-height: 80px !important;
    min-width: 80px !important;
    min-height: 80px !important;
  }
  
  .pf-hud-joystick-right,
  .pf-hud-right .pf-hud-joystick-right,
  div.pf-hud-joystick-right {
    width: 80px !important;
    height: 80px !important;
    max-width: 80px !important;
    max-height: 80px !important;
    min-width: 80px !important;
    min-height: 80px !important;
  }
  
  .pf-hud-joystick-stick-right {
    width: 20px !important;
    height: 20px !important;
  }
}

/* Small mobile devices */
@media screen and (max-width: 480px) {
  .pf-hud-root {
    transform: scale(0.4) !important;
    transform-origin: top center;
  }
  
  .pf-hud-team-bar,
  .pf-hud-team-left .pf-hud-team-bar,
  .pf-hud-team-right .pf-hud-team-bar,
  div.pf-hud-team-bar {
    width: 160px !important;
    height: 11px !important;
    max-width: 160px !important;
    min-width: 160px !important;
  }
  
  .pf-hud-top .pf-hud-hull-bar,
  .pf-hud-hull-bar,
  div.pf-hud-hull-bar {
    width: 160px !important;
    height: 11px !important;
    max-width: 160px !important;
    min-width: 160px !important;
  }
  
  .pf-hud-wheel-left,
  .pf-hud-left .pf-hud-wheel-left,
  div.pf-hud-wheel-left {
    width: 64px !important;
    height: 64px !important;
    max-width: 64px !important;
    max-height: 64px !important;
    min-width: 64px !important;
    min-height: 64px !important;
  }
  
  .pf-hud-joystick-right,
  .pf-hud-right .pf-hud-joystick-right,
  div.pf-hud-joystick-right {
    width: 64px !important;
    height: 64px !important;
    max-width: 64px !important;
    max-height: 64px !important;
    min-width: 64px !important;
    min-height: 64px !important;
  }
  
  .pf-hud-joystick-stick-right {
    width: 16px !important;
    height: 16px !important;
  }
}

