/* Habbodo HUD — collapsed by default so it never covers the room */
:root {
  --hd-panel: rgba(18, 16, 22, 0.92);
  --hd-panel-border: #5a4a2e;
  --hd-gold: #efc14a;
  --hd-cream: #f7ecd2;
  --hd-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  --hd-font: "Trebuchet MS", "Verdana", sans-serif;
}

#habbodo-hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 80;
  font-family: var(--hd-font);
  color: var(--hd-cream);
  opacity: 0;
  transition: opacity 0.35s ease;
}
#habbodo-hud.hd-on { opacity: 1; }

/* Hotel view: Nitro bakes hotel+clouds+cars into one PNG. Overlay puts motion back. */
@keyframes hd-cloud-drift {
  from { background-position: 0 0; }
  to { background-position: 1600px 0; }
}
12% { opacity: 1; }
  88% { opacity: 1; }
  100% { transform: translateX(360px); opacity: 0; }
}
.nitro-hotel-view {
  overflow: hidden;
}
/* Replace red/yellow linear cars with blue/purple road-following animation */
@keyframes hd-car-road {
  0% {
    left: 6.5%;
    bottom: 13.5%;
    opacity: 0;
    z-index: 1;
  }
  6% {
    opacity: 1;
  }
  18% {
    left: 9.5%;
    bottom: 15%;
    z-index: 1;
  }
  32% {
    left: 13%;
    bottom: 16.2%;
    z-index: 2;
  }
  48% {
    left: 16.5%;
    bottom: 17.5%;
    z-index: 2;
  }
  62% {
    left: 20%;
    bottom: 18.8%;
    z-index: 2;
  }
  76% {
    left: 23.5%;
    bottom: 20%;
    z-index: 1;
  }
  90% {
    left: 27%;
    bottom: 21.2%;
    opacity: 1;
    z-index: 1;
  }
  100% {
    left: 30.5%;
    bottom: 22.5%;
    opacity: 0;
    z-index: 1;
  }
}

.nitro-hotel-view .hd-hotel-car {
  position: absolute;
  pointer-events: none;
  width: 46px;
  height: 26px;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  transform: rotate(-6deg) scaleX(-1);
  animation: hd-car-road 20s linear infinite;
  left: 6.5%;
  bottom: 13.5%;
}

.nitro-hotel-view .hd-hotel-car-blue {
  background-image: url("/custom/hotel_car_blue.png");
  animation-duration: 20s;
}

.nitro-hotel-view .hd-hotel-car-purple {
  background-image: url("/custom/hotel_car_purple.png");
  width: 42px;
  height: 24px;
  animation-duration: 26s;
  animation-delay: -11s;
  transform: rotate(-6deg) scaleX(-1) scale(0.92);
}

/* Hide legacy red/yellow car rules if still present */
.nitro-hotel-view .hd-hotel-car-a,
.nitro-hotel-view .hd-hotel-car-b {
  display: none !important;
}

.nitro-hotel-view .hd-hotel-clouds {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 32%;
  z-index: 2;
  pointer-events: none;
  background: url("/custom/hotel_clouds.png") repeat-x 0 0;
  background-size: 1600px 200px;
  animation: hd-cloud-drift 48s linear infinite;
  opacity: 0.85;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
}
#habbodo-hud * { box-sizing: border-box; }
#habbodo-hud .hd-hit { pointer-events: auto; }

.hd-online {
  position: absolute;
  top: 8px;
  left: 10px;
  background: var(--hd-panel);
  border: 2px solid var(--hd-panel-border);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: var(--hd-shadow);
  text-transform: uppercase;
}
.hd-online b { color: #7dff9a; }

.hd-toggle {
  position: absolute;
  top: 8px;
  right: 10px;
  background: var(--hd-panel);
  border: 2px solid var(--hd-panel-border);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 800;
  color: var(--hd-gold);
  cursor: pointer;
  box-shadow: var(--hd-shadow);
  text-transform: uppercase;
}
.hd-vip-float {
  position: absolute;
  top: 8px;
  right: 78px;
  background: linear-gradient(#f3d36a, #d59a2a);
  border: 2px solid #8a5a12;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 800;
  color: #2a1c08;
  cursor: pointer;
  box-shadow: var(--hd-shadow);
  text-transform: uppercase;
}

.hd-tv,
.hd-right,
.hd-level,
.hd-modal { display: none; }

#habbodo-hud.hd-open .hd-tv,
#habbodo-hud.hd-open .hd-right,
#habbodo-hud.hd-open .hd-level { display: block; }

#habbodo-hud.hd-open .hd-right {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hd-tv {
  position: absolute;
  top: 44px;
  left: 10px;
  width: 210px;
  background: var(--hd-panel);
  border: 2px solid var(--hd-panel-border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--hd-shadow);
}
.hd-tv-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  cursor: pointer;
  background: linear-gradient(#2a2430, #16131a);
}
.hd-live {
  background: #e23b3b;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 4px;
}
.hd-tv-title { font-size: 11px; font-weight: 700; flex: 1; }
.hd-tv-body { display: none; height: 118px; background: #000; }
.hd-tv.open .hd-tv-body { display: block; }
.hd-tv-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  color: #ddd;
  font-size: 11px;
}

.hd-right {
  position: absolute;
  top: 44px;
  right: 10px;
  width: 210px;
}

.hd-card {
  background: var(--hd-panel);
  border: 2px solid var(--hd-panel-border);
  border-radius: 10px;
  padding: 8px 10px;
  box-shadow: var(--hd-shadow);
}
.hd-card h4 {
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--hd-gold);
  text-transform: uppercase;
}
.hd-card p { margin: 0 0 6px; font-size: 11px; line-height: 1.3; color: #e8dcc4; }
.hd-btn {
  display: inline-block;
  background: linear-gradient(#f3d36a, #d59a2a);
  color: #2a1c08;
  border: 2px solid #8a5a12;
  border-radius: 8px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  text-transform: uppercase;
}

.hd-progress {
  height: 8px;
  background: #2a2430;
  border: 1px solid #5a4a2e;
  border-radius: 6px;
  overflow: hidden;
  margin: 3px 0 4px;
}
.hd-progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(#7dff9a, #2e9b55);
  width: 0;
}

.hd-level {
  position: absolute;
  left: 8px;
  bottom: 98px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--hd-panel);
  border: 2px solid var(--hd-panel-border);
  border-radius: 10px;
  padding: 4px 8px 4px 4px;
  min-width: 168px;
  box-shadow: var(--hd-shadow);
}
.hd-avatar {
  width: 40px;
  height: 44px;
  border-radius: 8px;
  background: #2b3340 center bottom / 56px no-repeat;
  border: 1px solid #5a4a2e;
}
.hd-level .meta { flex: 1; min-width: 0; }
.hd-level .name { font-size: 11px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-level .lvl { font-size: 10px; color: var(--hd-gold); }

.hd-modal {
  position: absolute;
  right: 12px;
  bottom: 100px;
  width: 260px;
  max-height: 280px;
  overflow: auto;
}
.hd-modal.open { display: block; }
.hd-user {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #3a3124;
  font-size: 12px;
}
.hd-user img { width: 40px; height: 44px; object-fit: contain; }
.hd-vip-pill {
  display: inline-block;
  background: linear-gradient(#f7e7a1, #c9a227);
  color: #3a2a08;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 6px;
}
.hd-vip-plans { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.hd-vip-plan { width: 100%; text-align: left; }
.hd-quest {
  font-size: 10px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 1px 0;
  color: #d9cbb0;
}
.hd-quest.done { color: #7dff9a; text-decoration: line-through; }

#hd-games-root {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
}
#hd-games-btn {
  pointer-events: auto;
  position: absolute;
  top: 8px;
  left: 188px;
  background: linear-gradient(#f3d36a, #d59a2a);
  border: 2px solid #8a5a12;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 800;
  color: #2a1c08;
  cursor: pointer;
  text-transform: uppercase;
  box-shadow: var(--hd-shadow);
}
#hd-games-modal {
  display: none;
  pointer-events: auto;
  position: absolute;
  left: 50%;
  top: 54px;
  transform: translateX(-50%);
  width: min(520px, 94vw);
  max-height: 78vh;
  overflow: auto;
  background: var(--hd-panel);
  border: 2px solid var(--hd-panel-border);
  border-radius: 12px;
  padding: 10px 12px 12px;
  box-shadow: var(--hd-shadow);
}
#hd-games-modal.open { display: block; }
.hd-g-head { display: flex; justify-content: space-between; align-items: center; color: var(--hd-gold); }
.hd-g-head button, #hd-g-back {
  background: transparent;
  border: 0;
  color: var(--hd-cream);
  cursor: pointer;
  font-weight: 800;
}
.hd-g-sub, .hd-g-hint, .hd-g-empty { font-size: 11px; color: #d9cbb0; margin: 6px 0; }
.hd-g-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.hd-g-start {
  background: #2a2430;
  border: 1px solid #5a4a2e;
  color: var(--hd-cream);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  font-weight: 800;
  text-align: left;
}
.hd-g-start span { display: block; font-size: 10px; color: var(--hd-gold); font-weight: 600; }
.hd-g-row { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; padding: 4px 0; border-bottom: 1px solid #3a3124; }
.hd-g-join, #hd-ships-auto { cursor: pointer; }
.hd-g-bar { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 8px; }
.hd-ttt { display: grid; grid-template-columns: repeat(3, 64px); gap: 4px; justify-content: center; }
.hd-cell {
  width: 64px; height: 64px; font-size: 28px; font-weight: 800;
  background: #1e1a22; color: var(--hd-gold); border: 1px solid #5a4a2e; border-radius: 8px; cursor: pointer;
}
.hd-chess { display: grid; grid-template-columns: repeat(8, 32px); width: 256px; margin: 0 auto; }
.hd-sq { width: 32px; height: 32px; border: 0; font-size: 20px; cursor: pointer; line-height: 32px; padding: 0; }
.hd-sq.light { background: #e8d5a3; }
.hd-sq.dark { background: #7a5a32; color: #fff; }
.hd-sq.on { outline: 2px solid #efc14a; }
.hd-ships { display: flex; gap: 16px; justify-content: center; }
.hd-sea { display: grid; grid-template-columns: repeat(8, 18px); gap: 2px; }
.hd-sea i, .hd-shot {
  width: 18px; height: 18px; display: block; background: #1b3a52; border: 0; padding: 0; cursor: pointer;
}
.hd-sea .ship { background: #4a6; }
.hd-sea .miss, .hd-shot.miss { background: #889; }
.hd-sea .hit, .hd-shot.hit { background: #c0392b; }
#hd-snow { width: 100%; max-width: 480px; background: #cfe8f7; border-radius: 8px; display: block; margin: 0 auto; cursor: crosshair; }
#hd-games-modal.hd-snow-full {
  top: 4px;
  width: min(920px, 98vw);
  max-height: 98vh;
  padding: 0;
  overflow: hidden;
  background: #4a5a68;
  border-color: #2a3540;
  border-radius: 6px;
}
#hd-games-modal.hd-snow-full .hd-g-head,
#hd-games-modal.hd-snow-full .hd-g-sub { display: none; }
.hd-ss {
  position: relative;
  width: 100%;
  height: min(640px, 92vh);
  background: #6a8aa0;
  overflow: hidden;
  font-family: Tahoma, Verdana, sans-serif;
}
#hd-ss-cv { display: block; width: 100%; height: 100%; cursor: pointer; }
.hd-ss-timer {
  position: absolute;
  top: 10px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(40, 52, 64, 0.82);
  border: 2px solid #cfd8e0;
  border-radius: 14px;
  padding: 3px 10px 3px 8px;
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.5px;
}
.hd-ss-timer i {
  width: 22px; height: 22px; border-radius: 50%;
  background: #3a7ec8; color: #fff; font-style: normal;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 900;
}
.hd-ss-scores {
  position: absolute;
  top: 10px;
  right: 12px;
  display: flex;
  gap: 8px;
}
.hd-ss-scores span {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 900; font-size: 14px;
  border: 2px solid rgba(255,255,255,0.7);
  text-shadow: 0 1px 2px #000;
}
.hd-ss-scores .g { background: #3cb44a; }
.hd-ss-scores .r { background: #d23a2a; }
.hd-ss-scores .b { background: #2a6ed0; }
.hd-ss-bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: linear-gradient(#8a9aaa, #5c6c7a);
  border-top: 2px solid #c5d0d8;
  box-shadow: inset 0 1px 0 #b8c4ce;
}
.hd-ss-face {
  width: 46px; height: 46px;
  background: #3a4450 center 4px / 64px no-repeat #2a3340;
  border: 2px solid #d8e0e8;
  border-radius: 4px;
}
.hd-ss-hp {
  width: 12px; height: 46px;
  background: #1a2218;
  border: 1px solid #0d140c;
  border-radius: 2px;
  display: flex;
  flex-direction: column-reverse;
  overflow: hidden;
}
.hd-ss-hp i { display: block; width: 100%; background: linear-gradient(#8dff6a, #2e9b2a); }
.hd-ss-ammo { display: flex; gap: 4px; }
.hd-ss-ammo i {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid #d8e4ee;
  background: rgba(30,40,50,0.45);
  box-shadow: inset 0 0 4px #000;
}
.hd-ss-ammo i.on { background: radial-gradient(circle at 35% 35%, #fff, #cfe8f8 55%, #8aa); }
.hd-ss-mitt {
  width: 40px; height: 40px; border-radius: 8px;
  border: 2px solid #1e4a7a;
  background: linear-gradient(#6eb4f0, #2a6cb0);
  color: #fff; font-size: 20px; cursor: pointer;
}
.hd-ss-mitt.on { outline: 2px solid #fff; background: linear-gradient(#9ad0ff, #3a88d0); }
.hd-ss-chat {
  flex: 1;
  height: 28px;
  background: #fff;
  border: 1px solid #4a5a68;
  border-radius: 3px;
  color: #333;
  font-size: 12px;
  padding: 0 8px;
  pointer-events: none;
}
.hd-ss-exit {
  background: #3a4450; color: #fff; border: 1px solid #111; border-radius: 4px;
  height: 28px; padding: 0 10px; cursor: pointer; font-weight: 800; font-size: 11px;
}
.hd-ss-hint {
  position: absolute; left: 12px; bottom: 64px;
  color: #1a2830; font-size: 11px; font-weight: 700;
  text-shadow: 0 1px 0 #e8f4ff;
  pointer-events: none;
}
.hd-wbar { flex: 1; height: 10px; background: #2a2430; border-radius: 6px; overflow: hidden; }
.hd-wbar i { display: block; height: 100%; background: linear-gradient(#7dff9a, #2e9b55); }
.hd-wob-row { display: flex; gap: 8px; align-items: center; font-size: 11px; margin: 6px 0; }
.hd-beam { height: 8px; background: #c9a227; border-radius: 4px; margin: 10px 0; }
.hd-poker-row { display: flex; gap: 6px; justify-content: center; margin: 8px 0; flex-wrap: wrap; }
.hd-cardp {
  width: 52px; height: 72px; border-radius: 6px; background: #f4eee2; color: #1a140c;
  border: 2px solid #5a4a2e; font-weight: 800; font-size: 16px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.hd-cardp.red { color: #b42318; }
.hd-cardp.held { outline: 2px solid #efc14a; background: #fff6d8; }
.hd-cardp small { font-size: 8px; color: #7a5a20; }
