/* ═══════════════════════════════════════════════════════════════════════════
   HOME SCREEN — skin image-map
   Layer 1: MainScreenRightSide.webp  (right background — starts at nav edge)
   Layer 2: ButtonsLeft.webp          (left nav strip — 93×430, offset from edge)
   Layer 3: UserNameMoneyHeader.webp  (header bar overlay — 907×92)
   Layer 4: *Highlighted.webp         (active nav button on top)
   Layer 5: .hs-hit                   (transparent click targets)
   Canvas:  932.2 × 431.6  (iPhone landscape reference)

   --nav-left : left margin before ButtonsLeft (clears phone edge/notch)
   --nav-end  : right edge of ButtonsLeft = --nav-left + 9.85%
═══════════════════════════════════════════════════════════════════════════ */

:root {
  --nav-left: 2%;        /* shift nav right to clear phone edge */
  --nav-end:  11.85%;    /* 2% + 9.85% */
}

#screen-menu {
  /* Background starts where ButtonsLeft ends, fills to right edge */
  background: url("../assets/Skins/MainScreenRightSide.webp") right top / 88.15% 100% no-repeat !important;
  overflow: hidden;
  filter: brightness(1.2);
}

/* ── Left nav overlays ───────────────────────────────────────────────────── */

/* ButtonsLeft strip  (93×430 source → 9.85% × 99.54% of canvas) */
.hs-nav-base {
  position: absolute;
  left: var(--nav-left); top: 0;
  width: 9.85%;    /* 91.8 / 932.2 */
  height: 99.54%;  /* 429.6 / 431.6 */
  object-fit: fill;
  pointer-events: none;
  z-index: 1;
}

/* One highlighted button image per slot — all hidden until active */
.hs-nav-hl {
  position: absolute;
  left: var(--nav-left);
  width: 9.85%;    /* matches nav base */
  height: 16.59%;  /* 99.54% / 6 slots */
  object-fit: fill;
  pointer-events: none;
  z-index: 2;
  display: none;
  transition: opacity 0.12s ease;
}
.hs-nav-hl.active { display: block; }

/* Slot positions — 6 evenly-spaced slots in ButtonsLeft */
.hs-nav-hl[data-slot="0"] { top: 0%;      } /* SHOP        */
.hs-nav-hl[data-slot="1"] { top: 16.59%;  } /* RECIPES     */
.hs-nav-hl[data-slot="2"] { top: 33.18%;  } /* HOME        */
.hs-nav-hl[data-slot="3"] { top: 49.77%;  } /* LEADERBOARD */
.hs-nav-hl[data-slot="4"] { top: 66.36%;  } /* LEARN       */
.hs-nav-hl[data-slot="5"] { top: 82.95%;  } /* SETTINGS    */

/* ── Header overlay ──────────────────────────────────────────────────────── */
/* UserNameMoneyHeader: source 907×92, canvas pos (261,8)→(632,39)          */

.hs-header-img {
  position: absolute;
  left:   28.0%;   /* 261   / 932.2 */
  top:     1.85%;  /*   8   / 431.6 */
  width:  39.8%;   /* 371   / 932.2 */
  height:  7.18%;  /*  31   / 431.6 */
  object-fit: fill;
  pointer-events: none;
  z-index: 3;
}

/* ── Stat display zones (text overlaid on the header image) ─────────────── */

.hs-stat {
  position: absolute;
  pointer-events: none;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

/* User avatar zone */
#hs-stat-avatar {
  left:   28.70%;  /* 267.5 / 932.2 */
  top:     2.39%;  /*  10.33/ 431.6 */
  width:   2.84%;  /*  26.5 / 932.2 */
  height:  6.10%;  /*  26.34/ 431.6 */
  border-radius: 50%;
  overflow: hidden;
}
#hs-stat-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
}

/* Username */
#hs-stat-name {
  left:   32.07%;  /* 299   / 932.2 */
  top:     2.39%;
  width:   9.44%;  /*  88   / 932.2 */
  height:  6.10%;
  justify-content: flex-start;
  font-size: 9px;
  letter-spacing: 0.5px;
}

/* Lightning count */
#hs-stat-lightning {
  left:   44.41%;  /* 414   / 932.2 */
  top:     3.82%;  /*  16.5 / 431.6 */
  width:   4.5%;
  height:  3.13%;  /*  13.5 / 431.6 */
  font-size: 9px;
}

/* Coin / money count */
#hs-stat-coins {
  left:   51.87%;  /* 483.5 / 932.2 */
  top:     3.82%;
  width:   4.77%;  /*  44.5 / 932.2 */
  height:  3.13%;
  font-size: 9px;
}

/* Gold count */
#hs-stat-gold {
  left:   59.75%;  /* 557   / 932.2 */
  top:     3.82%;
  width:   4.08%;  /*  38   / 932.2 */
  height:  3.13%;
  font-size: 9px;
}

/* ── Center content panel ────────────────────────────────────────────────── */
/* Transparent when HOME (skin shows through). Dark + content for all others. */

#hs-center {
  position: absolute;
  left: var(--nav-end);  /* starts at right edge of ButtonsLeft */
  top: 0;
  width: calc(100% - var(--nav-end) - 10.7%);  /* fills to right panel */
  height: 88.2%;
  display: none;
  overflow: hidden;
  z-index: 3;
  transition: top 0.15s ease, width 0.15s ease, height 0.15s ease;
}

#hs-center.visible {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(8, 4, 2, 0.97);
}

/* ── Shop mode: push below HUD, expand right, cover bottom bar ────────── */
#hs-center.shop-mode {
  top: 11%;
  width: calc(100% - var(--nav-end)); /* covers right panel */
  height: 89%;
  background: transparent;
}

.hs-panel {
  display: none;
  width: 100%; height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  color: rgba(255,255,255,0.75);
  font-family: var(--font-ui, 'Inter', sans-serif);
}
.hs-panel.active { display: flex; }

/* ── Shop panel — image-map inside the center area ─────────────────────── */
/* The blank PNG fills hs-center; slot % coords are relative to this panel  */

.hs-panel[data-panel="shop"] {
  background: url("../assets/Shop/StoreScreenBlank.webp") center / cover no-repeat;
  position: relative;  /* makes it the containing block for .shop-slot etc. */
  padding: 0;
  overflow: hidden;
}

/* hs-center dark overlay isn't needed when shop is open — panel covers it */
#hs-center.visible:has(.hs-panel[data-panel="shop"].active) {
  background: transparent;
}

.hs-panel-title {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 5px;
  color: var(--c-gold, #D4AF37);
  text-shadow:
    0 0 18px rgba(212,175,55,0.60),
    0 0 40px rgba(212,175,55,0.22);
  margin-bottom: 8px;
}

.hs-panel-sub {
  font-size: 13px;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.35);
}

/* ── Hit zones ───────────────────────────────────────────────────────────── */

.hs-hit {
  position: absolute;
  background: transparent;
  border: none;
  padding: 0; margin: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  border-radius: 8px;
  z-index: 4;
  /* Press-down feel */
  transition: transform 0.07s ease;
  transform-origin: center center;
}

.hs-hit:active { transform: scale(0.91); }

/* Debug: show hit zones as red outlines */
#screen-menu.hs-debug .hs-hit {
  outline: 2px solid rgba(255, 60, 60, 0.75);
  background: rgba(255, 0, 0, 0.10);
}

/* ═══════════════════════════════════════════════════════════════════════════
   ROTATE-TO-LANDSCAPE OVERLAY
   Covers everything in portrait mode on phones.
   Hidden on desktop (where innerWidth > 1024 even in portrait).
═══════════════════════════════════════════════════════════════════════════ */

#screen-rotate {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #080402;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  font-family: var(--font-ui, 'Inter', sans-serif);
  text-align: center;
  padding: 32px;
}

/* Show only on real portrait-mode phones (max-width filters out desktop portrait windows) */
@media (orientation: portrait) and (max-width: 1024px) {
  #screen-rotate { display: flex; }
}

.rotate-icon {
  font-size: 72px;
  animation: rotate-hint 2s ease-in-out infinite;
  display: block;
  line-height: 1;
}

@keyframes rotate-hint {
  0%   { transform: rotate(0deg);   opacity: 1;    }
  40%  { transform: rotate(-90deg); opacity: 1;    }
  55%  { transform: rotate(-90deg); opacity: 0.6;  }
  70%  { transform: rotate(-90deg); opacity: 1;    }
  100% { transform: rotate(-90deg); opacity: 1;    }
}

.rotate-headline {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--c-gold, #D4AF37);
  text-shadow: 0 0 20px rgba(212,175,55,0.50);
  margin: 0;
}

.rotate-sub {
  font-size: 13px;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.40);
  margin: 0;
}
