/* ====================================================
   HINOAKE â€” ninja-theme.css
   9-slice UI skinning using Ninja Adventure asset pack
   (Theme Wood). Loaded AFTER main.css + panels.css so
   it overrides panel / button surfaces.
   ==================================================== */

:root {
  /* Wood theme palette â€” sampled from the asset pack */
  --wood-orange:       #e6792a;
  --wood-orange-dark:  #b9531a;
  --wood-cream:        #f7e7c8;
  --wood-brown:        #4f3a26;
  --wood-brown-dark:   #2f2418;
  --wood-bg-dark:      #5a4a36;
  --wood-text:         #f5e6d3;
  --wood-text-dim:     #c2a98a;
  --wood-border-glow:  rgba(245, 197, 24, 0.55);

  /* Fallback border widths used when border-image is supported */
  --frame-w-panel:  16px;   /* nine_path_panel slice 5 Ã—~3.2 */
  --frame-w-bg:     12px;   /* nine_path_bg    slice 5 Ã—~2.4 */
  --frame-w-button: 8px;    /* button_normal   slice 3-4 Ã—2 */
  --frame-w-cell:   8px;    /* inventory_cell  slice 4 Ã—2   */
}

/* ============================================================
   GLOBAL: pixel-perfect border-image scaling
   ============================================================ */
.nine-frame,
.modal-box,
.side-panel,
#landing-content,
.btn-pixel,
.menu-btn,
.hud-btn,
.tab-btn,
.btn-upgrade,
.btn-claim,
.inv-cell,
.upgrade-row,
.quest-row,
.ach-row,
.char-card,
.notif {
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

/* ============================================================
   OUTER PANEL FRAMES â€” orange wood border + dark interior
   Used on: modals, side-panels, landing card
   ============================================================ */

#landing-content,
.modal-box,
.side-panel {
  background: transparent;
  border: var(--frame-w-panel) solid transparent;
  border-image: url('/sprites/ui/theme/nine_path_panel.png') 5 fill / var(--frame-w-panel) / 0 stretch;
  border-radius: 0;
  box-shadow: 0 8px 28px rgba(0,0,0,0.7);
  color: var(--wood-text);
}

#landing-content {
  padding: 20px 28px 28px;
  min-width: 380px;
  gap: 22px;
}

/* Side panels keep slide-in behavior; just re-skin */
.side-panel {
  border-left-width: var(--frame-w-panel);
  padding: 0;
}
.side-panel.hidden { display: none; }
.side-panel.open   { transform: translateX(0); }

/* Modal box adjustments */
.modal-box {
  padding: 22px 26px;
  gap: 14px;
}
.modal-box.large { min-width: 580px; }

/* Modal headings */
.modal-box h2,
#landing-content #game-title {
  color: var(--wood-cream);
  text-shadow: 2px 2px 0 #000, 0 0 12px var(--wood-border-glow);
}
.modal-box p,
.about-content p { color: var(--wood-text-dim); }
.modal-box strong { color: var(--wood-cream); }

/* ============================================================
   PANEL HEADER / TABS â€” slightly darker inner band
   ============================================================ */

.panel-header {
  background: rgba(47, 36, 24, 0.55);
  border-bottom: 2px solid var(--wood-orange-dark);
  color: var(--wood-cream);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.panel-tabs {
  background: rgba(47, 36, 24, 0.4);
  border-bottom: 2px solid var(--wood-orange-dark);
  gap: 2px;
  padding: 4px 6px 0;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--wood-text-dim);
  font-family: var(--ui-font);
  font-size: 11px;
  font-weight: 600;
  padding: 7px 10px;
  border-bottom: 3px solid transparent;
}
.tab-btn:hover  { color: var(--wood-cream); }
.tab-btn.active {
  color: var(--wood-cream);
  border-bottom-color: var(--wood-orange);
  text-shadow: 1px 1px 0 #000;
}

/* ============================================================
   BUTTONS â€” orange wood button (normal / hover / pressed)
   ============================================================ */

.btn-pixel,
.menu-btn,
.btn-upgrade,
.btn-claim,
#btn-offline-claim,
#btn-start-game,
#btn-settings-close,
#btn-about-close {
  background: transparent;
  border: var(--frame-w-button) solid transparent;
  border-image: url('/sprites/ui/theme/button_normal.png') 3 4 fill / var(--frame-w-button) / 0 stretch;
  border-radius: 0;
  box-shadow: none;
  color: var(--wood-cream);
  font-family: var(--ui-font);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.55);
  padding: 4px 16px;
  transform: none;
  transition: filter 0.12s ease, transform 0.05s ease;
}

.btn-pixel:hover,
.menu-btn:hover:not(:disabled),
.btn-upgrade:not(:disabled):hover,
.btn-claim:not(:disabled):hover,
#btn-offline-claim:hover,
#btn-start-game:not(:disabled):hover,
#btn-settings-close:hover,
#btn-about-close:hover {
  border-image-source: url('/sprites/ui/theme/button_hover.png');
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.btn-pixel:active,
.menu-btn:active:not(:disabled),
.btn-upgrade:not(:disabled):active,
.btn-claim:not(:disabled):active,
#btn-offline-claim:active,
#btn-start-game:not(:disabled):active,
#btn-settings-close:active,
#btn-about-close:active {
  border-image-source: url('/sprites/ui/theme/button_pressed.png');
  transform: translateY(1px);
}

.btn-pixel:disabled,
.menu-btn:disabled,
.btn-upgrade:disabled,
.btn-claim:disabled,
#btn-start-game:disabled {
  border-image-source: url('/sprites/ui/theme/button_disabled.png');
  color: var(--wood-text-dim);
  cursor: not-allowed;
  opacity: 0.85;
  filter: none;
  transform: none;
  text-shadow: none;
}

/* JOUER button â€” bigger and more prominent */
.menu-btn-play {
  font-family: var(--pixel-font);
  font-size: 14px;
  letter-spacing: 4px;
  padding: 10px 20px;
  min-height: 48px;
}

/* Discord button keeps brand color but with wood frame */
.menu-btn-discord {
  border-image-source: url('/sprites/ui/theme/button_normal.png');
  background: linear-gradient(180deg, rgba(88,101,242,0.85), rgba(71,82,196,0.85)) padding-box;
  color: #fff;
}
.menu-btn-discord:hover { background: linear-gradient(180deg, rgba(107,119,245,0.95), rgba(88,101,242,0.95)) padding-box; }

/* Google "soon" â€” disabled look */
.menu-btn-google {
  border-image-source: url('/sprites/ui/theme/button_disabled.png');
  background: transparent;
  color: var(--wood-text-dim);
}

/* Logout small button */
.menu-btn-sm { padding: 2px 12px; font-size: 11px; min-height: 0; }

/* Secondary / about button â€” slightly muted */
.menu-btn-secondary { font-size: 12px; letter-spacing: 1px; }

/* Small / danger variants */
.btn-small  { font-size: 10px; padding: 2px 10px; }
.btn-danger {
  border-image-source: url('/sprites/ui/theme/button_normal.png');
  filter: hue-rotate(-30deg) saturate(1.4);
}
.btn-danger:hover { border-image-source: url('/sprites/ui/theme/button_hover.png'); }

/* In-panel upgrade / claim buttons â€” compact */
.btn-upgrade,
.btn-claim {
  font-family: var(--ui-font);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  min-width: 64px;
}

/* ============================================================
   HUD BUTTONS â€” small square wood buttons
   ============================================================ */

.hud-btn {
  background: transparent;
  border: 6px solid transparent;
  border-image: url('/sprites/ui/theme/button_normal.png') 3 4 fill / 6px / 0 stretch;
  border-radius: 0;
  width: 38px; height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center; justify-content: center;
  color: var(--wood-cream);
  transition: filter 0.12s ease;
}
.hud-btn:hover  { border-image-source: url('/sprites/ui/theme/button_hover.png');  filter: brightness(1.08); }
.hud-btn:active { border-image-source: url('/sprites/ui/theme/button_pressed.png'); }
.hud-btn.active { border-image-source: url('/sprites/ui/theme/button_hover.png'); filter: brightness(1.1) drop-shadow(0 0 6px var(--wood-border-glow)); }

#hud-buttons { gap: 4px; }

/* Panel close (X) â€” uses button frame too */
.panel-close {
  background: transparent;
  border: 5px solid transparent;
  border-image: url('/sprites/ui/theme/button_normal.png') 3 4 fill / 5px / 0 stretch;
  color: var(--wood-cream);
  width: 26px; height: 24px;
  font-size: 12px; line-height: 1;
  padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.panel-close:hover {
  border-image-source: url('/sprites/ui/theme/button_hover.png');
  color: #fff;
}

/* ============================================================
   INNER ROWS â€” upgrades, quests, achievements (use bg frame)
   ============================================================ */

.upgrade-row,
.quest-row,
.ach-row,
.char-card,
.auth-user-row,
.notif {
  background: transparent;
  border: var(--frame-w-bg) solid transparent;
  border-image: url('/sprites/ui/theme/nine_path_bg.png') 5 fill / var(--frame-w-bg) / 0 stretch;
  border-radius: 0;
  color: var(--wood-text);
  padding: 6px 8px;
}

.upgrade-row:hover,
.quest-row:hover,
.ach-row:hover,
.char-card:hover {
  filter: brightness(1.08);
}

.char-card.active {
  border-image-source: url('/sprites/ui/theme/nine_path_focus.png');
  border-image-slice: 3 fill;
  filter: drop-shadow(0 0 10px var(--wood-border-glow));
}
.quest-row.completed { filter: brightness(0.78) saturate(0.7); }
.quest-row.claimable { border-image-source: url('/sprites/ui/theme/nine_path_focus.png'); border-image-slice: 3 fill; }
.ach-row.unlocked    { border-image-source: url('/sprites/ui/theme/nine_path_focus.png'); border-image-slice: 3 fill; }
.ach-row.locked      { opacity: 0.55; }

.upgrade-name, .quest-name, .ach-name { color: var(--wood-cream); font-weight: 600; }
.upgrade-desc, .quest-desc, .ach-desc { color: var(--wood-text-dim); }
.upgrade-level                        { color: #ffd966; }
.quest-reward, .ach-reward            { color: #ffd966; }

/* ============================================================
   INVENTORY CELLS
   ============================================================ */

.inv-cell {
  background: transparent;
  border: var(--frame-w-cell) solid transparent;
  border-image: url('/sprites/ui/theme/inventory_cell.png') 4 fill / var(--frame-w-cell) / 0 stretch;
  border-radius: 0;
}
.inv-cell:hover { filter: brightness(1.15); }
.inv-cell .inv-qty { color: #ffd966; }

#inventory-grid { gap: 4px; padding: 4px; }

/* ============================================================
   HUD: top/bottom bands â€” replace gradients with wood bg
   ============================================================ */

#hud-top {
  background: linear-gradient(to bottom, rgba(47,36,24,0.85), rgba(47,36,24,0.0));
  border-bottom: none;
}
#hud-bottom {
  background: linear-gradient(to top, rgba(47,36,24,0.92), rgba(47,36,24,0.0));
}

#hud-resources span {
  background: transparent;
  border: 7px solid transparent;
  border-image: url('/sprites/ui/theme/nine_path_bg.png') 5 fill / 7px / 0 stretch;
  color: var(--wood-cream);
  padding: 1px 8px;
  font-weight: 700;
}

#hud-zone {
  padding: 4px 10px;
  border: 7px solid transparent;
  border-image: url('/sprites/ui/theme/nine_path_bg.png') 5 fill / 7px / 0 stretch;
  background: transparent;
}
#zone-name { color: var(--wood-cream); font-weight: 600; }
#zone-tier { color: #ffd966; }

#player-portrait {
  background: transparent;
  border: var(--frame-w-cell) solid transparent;
  border-image: url('/sprites/ui/theme/inventory_cell.png') 4 fill / var(--frame-w-cell) / 0 stretch;
  border-radius: 0;
}

/* HP / XP bar wraps */
.bar-wrap {
  background: rgba(15,10,6,0.7);
  border: 1px solid var(--wood-orange-dark);
  border-radius: 0;
}
.hp-bar { background: linear-gradient(90deg, #8b1f1f, #e6452f); }
.xp-bar { background: linear-gradient(90deg, #2a6bb0, #4a9de8); }

#player-dps,
#ips-row { color: var(--wood-cream); }
#dps-count, #ips-count { color: #ffd966; }

/* ============================================================
   BOSS HP BAR â€” same wood treatment
   ============================================================ */

#boss-bar-wrap {
  background: transparent;
  border: 10px solid transparent;
  border-image: url('/sprites/ui/theme/nine_path_panel.png') 5 fill / 10px / 0 stretch;
  padding: 4px 12px 6px;
}
#boss-bar-name { color: #ffb060; text-shadow: 1px 1px 0 #000; font-weight: 700; }
#boss-bar-track {
  background: rgba(15,10,6,0.7);
  border: 1px solid var(--wood-orange-dark);
}

/* ============================================================
   NOTIFICATIONS â€” smaller toast skin
   ============================================================ */

.notif {
  border-width: 10px;
  border-image-slice: 5 fill;
  padding: 8px 12px;
  font-size: 12px;
  border-left: 10px solid transparent; /* keep left accent via border-image */
}
.notif-sub { color: var(--wood-text-dim); }

/* ============================================================
   SETTINGS rows
   ============================================================ */

.settings-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0;
  color: var(--wood-cream);
}
.settings-row label { flex: 1; font-size: 12px; }
.settings-row input[type=range] {
  flex: 2;
  -webkit-appearance: none; appearance: none;
  height: 12px; background: transparent;
}
.settings-row input[type=range]::-webkit-slider-runnable-track {
  height: 8px;
  background: url('/sprites/ui/theme/slider_progress.png');
  background-size: 100% 100%;
  image-rendering: pixelated;
  border: 1px solid var(--wood-orange-dark);
}
.settings-row input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 16px;
  background: url('/sprites/ui/theme/h_slidder_grabber.png') center/contain no-repeat;
  image-rendering: pixelated;
  margin-top: -4px;
  cursor: pointer;
}

hr { border-color: var(--wood-orange-dark) !important; }

/* ============================================================
   LANDING â€” skin auth row + divider with wood theme
   ============================================================ */

#game-sub { color: #ffd966; letter-spacing: 4px; }

.menu-divider {
  color: var(--wood-cream);
  font-size: 11px;
  text-shadow: 1px 1px 0 #000;
}
.menu-divider::before, .menu-divider::after { background: var(--wood-orange-dark); height: 2px; }
.menu-hint  { color: var(--wood-text); text-shadow: 1px 1px 0 #000; opacity: 0.9; }
#auth-username { color: #ffd966; }
.badge-soon {
  background: var(--wood-brown-dark);
  border: 1px solid var(--wood-orange-dark);
  color: var(--wood-cream);
}

#landing-stats {
  color: var(--wood-cream);
  font-weight: 600;
  text-shadow: 1px 1px 0 #000;
}
#landing-stats span { opacity: 0.92; }

/* Make the title pop on the wood interior */
#game-title {
  text-shadow: 0 0 24px rgba(245, 197, 24, 0.7), 3px 3px 0 #2a1a0a, -1px -1px 0 #2a1a0a;
  color: #ffd966 !important;
}

/* ============================================================
   MOBILE TWEAKS
   ============================================================ */

@media (max-width: 600px) {
  :root {
    --frame-w-panel:  12px;
    --frame-w-bg:     10px;
    --frame-w-button: 6px;
  }
  #landing-content { min-width: 0; width: calc(100vw - 24px); padding: 14px; }
  .modal-box, .modal-box.large { min-width: 0; width: calc(100vw - 24px); padding: 16px; }
}

/* sentinel */

/* ============================================
   TUTORIAL OVERLAY
   ============================================ */
#modal-tutorial .tuto-box {
  max-width: 540px;
  width: 92%;
  text-align: center;
  padding: 20px 22px 18px;
}
#modal-tutorial h2 {
  color: #ffd966;
  font-size: 18px;
  text-shadow: 2px 2px 0 #000;
  margin: 0 0 14px;
  letter-spacing: 1px;
}
.tuto-sprites {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.tuto-sprite-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.tuto-sprite {
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border-image: url("/sprites/ui/theme/inventory_cell.png") 4 fill / 4px / 0 stretch;
  padding: 6px;
  background: rgba(0,0,0,0.2);
}
.tuto-sprite-label {
  font-size: 9px;
  color: #d8c89a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.tuto-body {
  text-align: left;
  font-size: 11px;
  line-height: 1.7;
  color: #f5e9c8;
  padding: 8px 6px;
  max-height: 200px;
  overflow-y: auto;
}
.tuto-body p { margin: 4px 0; }
.tuto-body strong { color: #ffd966; }
.tuto-body .tuto-tip {
  background: rgba(245, 197, 24, 0.1);
  border-left: 3px solid #ffd966;
  padding: 6px 8px;
  margin-top: 8px;
  font-style: italic;
  color: #f0e0a0;
}
#tuto-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  gap: 12px;
}
#tuto-dots {
  display: flex;
  gap: 6px;
  flex: 1;
  justify-content: flex-start;
}
.tuto-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #5a4632;
  transition: background 0.2s, transform 0.2s;
}
.tuto-dot.active {
  background: #ffd966;
  transform: scale(1.3);
}

/* ============================================
   UPGRADE PURCHASE FEEDBACK
   ============================================ */
@keyframes upgFlash {
  0%   { filter: brightness(2.2) drop-shadow(0 0 14px #ffd966); transform: scale(1.04); }
  60%  { filter: brightness(1.4) drop-shadow(0 0 6px #ffd966);  transform: scale(1.01); }
  100% { filter: none; transform: scale(1); }
}
.upgrade-row.just-bought {
  animation: upgFlash 0.7s ease-out;
}

/* ============================================
   SETTINGS â€” finer percentage label
   ============================================ */
.settings-row .vol-pct {
  display: inline-block;
  min-width: 42px;
  text-align: right;
  color: #ffd966;
  font-size: 11px;
  font-family: 'NinjaFont', monospace;
  margin-left: 8px;
}
.settings-row input[type="range"] {
  flex: 1;
}


/* ====================================================================
   V1.0.3 OVERRIDES ï¿½ solid orange panels, white modal text,
   clean sliders, mobile HUD, button click feedback
   ==================================================================== */

/* ---- Solid orange background instead of nine_path_panel border-image ---- */
#landing-content,
.modal-box,
.side-panel,
.modal-box.large {
  background: rgb(243, 140, 76) !important;
  border: 4px solid #6b3a14 !important;
  border-image: none !important;
  outline: 2px solid #2f1a08;
  box-shadow:
    0 0 0 2px #2f1a08,
    inset 0 0 0 2px #b9531a,
    0 8px 28px rgba(0,0,0,0.7);
  border-radius: 0;
  color: #ffffff;
}

#landing-content {
  background: rgb(243, 140, 76) !important;
  padding: 20px 28px 26px;
}

/* Boss HP bar uses same panel skin ï¿½ switch to solid orange too */
#boss-bar-wrap {
  background: rgb(243, 140, 76) !important;
  border: 3px solid #6b3a14 !important;
  border-image: none !important;
  outline: 2px solid #2f1a08;
  box-shadow: 0 0 0 2px #2f1a08, inset 0 0 0 1px #b9531a;
  padding: 6px 12px 8px !important;
}
#boss-bar-name { color: #ffffff !important; }

/* ---- Force WHITE text inside modals (ï¿½ propos, paramï¿½tres, tutorial) ---- */
.modal-box,
.modal-box p,
.modal-box li,
.modal-box label,
.modal-box span:not(.vol-pct):not(.tuto-dot),
.about-content,
.about-content p,
.about-content strong,
.tuto-body,
.tuto-body p,
.tuto-body strong,
.settings-row,
.settings-row label {
  color: #ffffff !important;
}
.modal-box h2,
#modal-tutorial h2,
.modal-box h3 {
  color: #fff8d2 !important;
  text-shadow: 2px 2px 0 #4a1f06, 0 0 12px rgba(0,0,0,0.5) !important;
}
.modal-box strong,
.about-content strong,
.tuto-body strong {
  color: #fff8d2 !important;
  text-shadow: 1px 1px 0 #4a1f06;
}
.about-content a {
  color: #fff8d2 !important;
  text-decoration: underline;
  font-weight: 700;
}
.about-content a:hover { color: #ffe599 !important; }
.modal-box p[style*="color"],
.about-content p[style*="color"] {
  color: #ffffff !important;
}
.tuto-sprite-label { color: #ffe5c2 !important; }
.tuto-body .tuto-tip {
  background: rgba(0, 0, 0, 0.25) !important;
  border-left-color: #fff8d2 !important;
  color: #fff8d2 !important;
}

/* ---- Inner panel surfaces (rows etc.) keep wood look but darker so
        text reads on the bright orange panel ---- */
.upgrade-row,
.quest-row,
.ach-row,
.char-card,
.notif {
  background: rgba(43, 24, 12, 0.55) !important;
  border: 2px solid #4a1f06 !important;
  border-image: none !important;
  border-radius: 4px !important;
  color: #ffffff !important;
}
.upgrade-name,
.quest-name,
.ach-name,
.char-card .char-name { color: #fff8d2 !important; }
.upgrade-desc,
.quest-desc,
.ach-desc,
.char-card .char-desc { color: #f3d8a8 !important; }
.notif-sub { color: #f3d8a8 !important; }

.inv-cell {
  background: rgba(43, 24, 12, 0.6) !important;
  border: 2px solid #4a1f06 !important;
  border-image: none !important;
  border-radius: 3px !important;
}

.panel-header {
  background: rgba(43, 24, 12, 0.7) !important;
  border-bottom: 2px solid #4a1f06 !important;
  color: #fff8d2 !important;
}
.tab-btn { color: #f3d8a8 !important; }
.tab-btn.active,
.tab-btn:hover { color: #ffffff !important; border-bottom-color: #fff8d2 !important; }

/* ---- Tutorial modal sprites: darker bg cells for contrast ---- */
.tuto-sprite {
  background: rgba(43, 24, 12, 0.6) !important;
  border: 2px solid #4a1f06 !important;
  border-image: none !important;
}

/* ====================================================================
   VOLUME SLIDERS ï¿½ clean wooden track, no broken texture
   ==================================================================== */
.settings-row {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  margin-bottom: 14px !important;
  padding: 4px 0 !important;
}
.settings-row label {
  flex: 0 0 auto;
  min-width: 130px;
  font-size: 12px !important;
  color: #ffffff !important;
}
.settings-row input[type="range"] {
  flex: 1;
  height: 18px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
  margin: 0;
  padding: 0;
}
/* WebKit track */
.settings-row input[type="range"]::-webkit-slider-runnable-track {
  height: 10px;
  background: #2f1a08;
  border: 2px solid #4a1f06;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(255, 215, 130, 0.25);
  background-image: linear-gradient(90deg, #ffd966 0%, #ffb84d var(--slider-pct, 50%), #2f1a08 var(--slider-pct, 50%));
  background-repeat: no-repeat;
}
/* Firefox track + progress */
.settings-row input[type="range"]::-moz-range-track {
  height: 10px;
  background: #2f1a08;
  border: 2px solid #4a1f06;
  border-radius: 6px;
}
.settings-row input[type="range"]::-moz-range-progress {
  height: 10px;
  background: linear-gradient(90deg, #ffd966, #ffb84d);
  border-radius: 6px 0 0 6px;
}
/* Thumb */
.settings-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 18px;
  background: #fff8d2;
  border: 2px solid #4a1f06;
  border-radius: 3px;
  margin-top: -6px;
  box-shadow: 0 2px 0 #2f1a08;
  cursor: pointer;
  transition: transform 0.08s ease;
}
.settings-row input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.1); }
.settings-row input[type="range"]:active::-webkit-slider-thumb { transform: scale(0.95); }
.settings-row input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 18px;
  background: #fff8d2;
  border: 2px solid #4a1f06;
  border-radius: 3px;
  box-shadow: 0 2px 0 #2f1a08;
  cursor: pointer;
}
.settings-row .vol-pct {
  flex: 0 0 48px !important;
  min-width: 48px !important;
  text-align: right;
  color: #fff8d2 !important;
  font-size: 12px !important;
  font-weight: 700;
  text-shadow: 1px 1px 0 #4a1f06;
}

/* ====================================================================
   BUTTON CLICK HAPTIC (visual)
   ==================================================================== */
.btn-pixel:active,
.menu-btn:active,
.hud-btn:active,
.tab-btn:active,
.panel-close:active,
.btn-upgrade:active,
.btn-claim:active {
  transform: translateY(2px) scale(0.97) !important;
  filter: brightness(0.92);
  transition: transform 0.04s ease, filter 0.04s ease !important;
}

/* ====================================================================
   MOBILE RESPONSIVE ï¿½ HUD wraps cleanly, canvas fits
   ==================================================================== */
#game-container,
#game-container canvas {
  width: 100% !important;
  height: 100% !important;
  max-width: 100vw;
  max-height: 100vh;
}

/* TABLET / SMALL DESKTOP */
@media (max-width: 900px) {
  #hud-top {
    padding: 6px 8px !important;
    gap: 6px;
    flex-wrap: wrap;
  }
  #hud-zone { font-size: 10px; }
  #hud-resources { gap: 8px !important; flex-shrink: 0; }
  #hud-resources span { font-size: 11px !important; padding: 1px 6px !important; }
  #hud-resources img { height: 14px !important; }
  #hud-buttons { gap: 3px !important; }
  .hud-btn { width: 34px !important; height: 34px !important; }
  .hud-icon { width: 18px !important; height: 18px !important; }
}

/* PHONE */
@media (max-width: 600px) {
  #hud-top {
    padding: 4px 6px !important;
    flex-wrap: wrap;
    gap: 4px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.85), rgba(0,0,0,0.0)) !important;
  }
  /* Full-width zone label on its own row */
  #hud-zone {
    flex: 1 1 100%;
    order: 0;
    text-align: center;
    padding: 2px 6px !important;
    font-size: 9px;
  }
  #zone-name { font-size: 10px !important; }
  #zone-tier { font-size: 8px !important; }

  #hud-resources {
    flex: 1 1 auto;
    order: 1;
    gap: 6px !important;
    flex-wrap: nowrap;
  }
  #hud-resources span {
    font-size: 10px !important;
    padding: 1px 5px !important;
    border-width: 5px !important;
  }
  #hud-resources img { height: 12px !important; }

  #hud-buttons {
    flex: 0 0 auto;
    order: 2;
    gap: 2px !important;
  }
  .hud-btn {
    width: 30px !important;
    height: 30px !important;
    border-width: 5px !important;
    font-size: 13px !important;
  }
  .hud-icon { width: 16px !important; height: 16px !important; }

  /* Bottom HUD: shrink portrait + bars */
  #hud-bottom { padding: 6px 8px !important; }
  #player-portrait { width: 38px !important; height: 38px !important; }
  #player-bar { gap: 6px !important; }
  #player-stats-bar { gap: 3px !important; }
  .bar-wrap { height: 12px !important; }
  .bar-label { font-size: 7px !important; }
  #player-dps { min-width: 36px !important; font-size: 8px; }
  #dps-count { font-size: 10px !important; }
  #ips-row { font-size: 10px !important; gap: 8px; }

  /* Boss bar */
  #boss-bar-wrap {
    min-width: 200px !important;
    width: 80% !important;
    top: 78px !important;
  }

  /* Modals */
  #landing-content,
  .modal-box,
  .modal-box.large {
    width: calc(100vw - 16px) !important;
    min-width: 0 !important;
    max-width: 100vw !important;
    max-height: 92vh;
    overflow-y: auto;
    padding: 14px !important;
  }
  .modal-box h2 { font-size: 13px !important; }
  .modal-box p, .about-content p, .tuto-body { font-size: 10px !important; line-height: 1.5 !important; }
  #char-select-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; }
  .char-card img { height: 44px !important; }
  .char-card { padding: 8px 4px !important; }

  /* Settings rows wrap on phones */
  .settings-row {
    flex-wrap: wrap;
    gap: 6px !important;
  }
  .settings-row label {
    flex: 1 1 100% !important;
    min-width: 0 !important;
  }
  .settings-row input[type="range"] { flex: 1 1 75% !important; }
  .settings-row .vol-pct { flex: 0 0 40px !important; }

  /* Tutorial overlay shrink */
  .tuto-sprites { gap: 10px !important; }
  .tuto-sprite { width: 38px !important; height: 38px !important; padding: 4px !important; }
  .tuto-body { max-height: 140px !important; }

  /* Side panels become full-width drawers */
  .side-panel {
    width: 100vw !important;
    max-width: 100vw !important;
  }

  /* Notifications shrink */
  #notif-container {
    bottom: 110px !important;
    right: 6px !important;
    left: 6px !important;
    max-width: calc(100vw - 12px) !important;
  }
  .notif {
    min-width: 0 !important;
    font-size: 10px !important;
    padding: 6px 10px !important;
  }
}

/* ====================================================================
   V1.0.4 ï¿½ tutorial wood theme, settings contrast, quest polish,
   hover states, portrait fallback
   ==================================================================== */

/* ---- Tutorial wood/orange theme ---- */
.tuto-body,
.tuto-body p,
.tuto-body strong,
.tuto-sprite-label {
  color: #ffffff !important;
}
.tuto-body strong { color: #fff8d2 !important; text-shadow: 1px 1px 0 #4a1f06; }
.tuto-body .tuto-tip {
  background: rgba(43, 24, 12, 0.65) !important;
  border-left: 4px solid #ffd966 !important;
  border-top: 2px solid #4a1f06;
  border-right: 2px solid #4a1f06;
  border-bottom: 2px solid #4a1f06;
  color: #fff8d2 !important;
  font-style: italic;
  border-radius: 0 4px 4px 0;
}
.tuto-sprite {
  background: rgba(43, 24, 12, 0.6) !important;
  border: 3px solid #4a1f06 !important;
  box-shadow: inset 0 0 0 1px #b9531a, 0 2px 0 #2a1408;
  border-radius: 3px;
}
.tuto-dot { background: #4a1f06 !important; box-shadow: inset 0 0 0 1px #b9531a; }
.tuto-dot.active { background: #ffd966 !important; box-shadow: 0 0 6px #ffd966; }

/* ---- Settings ï¿½ darker inner area for contrast ---- */
#modal-settings .modal-box {
  background: rgb(243, 140, 76) !important;
}
#modal-settings .settings-row {
  background: rgba(43, 24, 12, 0.45);
  border: 2px solid #4a1f06;
  padding: 10px 14px !important;
  border-radius: 4px;
  margin-bottom: 10px !important;
}
#modal-settings .settings-row label {
  color: #fff8d2 !important;
  font-size: 12px !important;
  font-weight: 700;
  text-shadow: 1px 1px 0 #2a1408;
}
#modal-settings hr,
#modal-settings .settings-divider {
  border: none;
  border-top: 2px dashed #4a1f06;
  margin: 12px 0;
  opacity: 0.7;
}
#modal-settings h2 {
  background: rgba(43, 24, 12, 0.55);
  padding: 8px 12px;
  border: 2px solid #4a1f06;
  border-radius: 4px;
  margin-bottom: 14px !important;
  color: #fff8d2 !important;
  text-shadow: 2px 2px 0 #2a1408 !important;
}
#modal-settings .danger-row {
  background: rgba(60, 20, 20, 0.45);
  border-color: #7a2020 !important;
}

/* ---- Quest UI polish ---- */
#panel-quests .panel-body { padding: 8px !important; }
.quest-row {
  position: relative;
  padding: 12px 14px 12px 50px !important;
  margin-bottom: 8px;
  background: linear-gradient(135deg, rgba(43,24,12,0.7) 0%, rgba(74,31,6,0.55) 100%) !important;
  border: 2px solid #4a1f06 !important;
  border-left-width: 5px !important;
  border-left-color: #ffd966 !important;
  border-radius: 4px;
  box-shadow: 0 2px 0 #2a1408, inset 0 0 0 1px rgba(255,215,130,0.15);
  transition: transform 0.12s ease, filter 0.12s ease;
}
.quest-row::before {
  content: '';
  position: absolute;
  left: 10px; top: 50%;
  width: 28px; height: 28px;
  margin-top: -14px;
  background: url('/sprites/items/Book.png') center/contain no-repeat,
              radial-gradient(circle, rgba(255,215,102,0.25) 0%, transparent 70%);
  image-rendering: pixelated;
  filter: drop-shadow(1px 1px 0 #2a1408);
}
.quest-row:hover {
  transform: translateX(2px);
  filter: brightness(1.12);
  border-left-color: #fff8d2 !important;
}
.quest-row.completed {
  opacity: 0.55;
  filter: grayscale(0.4);
  border-left-color: #6b6b6b !important;
}
.quest-row.completed::before { content: '?'; color: #5acf5a; }
.quest-row.claimable {
  border-left-color: #ffd966 !important;
  box-shadow: 0 0 0 2px #ffd966, 0 2px 0 #2a1408, inset 0 0 12px rgba(255, 215, 102, 0.25);
  animation: questPulse 1.4s ease-in-out infinite;
}
@keyframes questPulse {
  0%, 100% { box-shadow: 0 0 0 2px #ffd966, 0 2px 0 #2a1408, inset 0 0 12px rgba(255, 215, 102, 0.25); }
  50%      { box-shadow: 0 0 0 3px #fff8d2, 0 2px 0 #2a1408, inset 0 0 18px rgba(255, 215, 102, 0.45); }
}
.quest-name {
  font-size: 12px !important;
  font-weight: 700;
  color: #fff8d2 !important;
  text-shadow: 1px 1px 0 #2a1408;
  margin-bottom: 4px;
}
.quest-desc {
  font-size: 10px !important;
  color: #f3d8a8 !important;
  line-height: 1.5;
  margin-bottom: 6px;
}
.quest-progress {
  height: 8px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid #2a1408;
  border-radius: 4px;
  overflow: hidden;
  margin: 4px 0 6px;
}
.quest-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffd966, #ffb84d);
  transition: width 0.3s ease;
}
.quest-reward {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 8px;
  border: 1px solid #ffd966;
  border-radius: 3px;
  color: #ffd966 !important;
  font-size: 10px !important;
  font-weight: 700;
}
.quest-tabs, .panel-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #4a1f06;
  background: rgba(43, 24, 12, 0.55);
  padding: 0 4px;
}
.tab-btn {
  background: transparent !important;
  border: none !important;
  border-bottom: 3px solid transparent !important;
  padding: 8px 14px !important;
  color: #f3d8a8 !important;
  font-size: 11px !important;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.tab-btn:hover {
  color: #fff8d2 !important;
  background: rgba(255, 215, 102, 0.08) !important;
}
.tab-btn.active {
  color: #ffd966 !important;
  border-bottom-color: #ffd966 !important;
  background: rgba(255, 215, 102, 0.12) !important;
}

/* ---- Button hover polish (consistent across all CTA buttons) ---- */
.btn-pixel,
.menu-btn,
.menu-btn-play,
.menu-btn-discord,
.btn-upgrade,
.btn-claim,
.panel-close {
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease !important;
}
.btn-pixel:hover,
.menu-btn:hover,
.btn-upgrade:hover,
.btn-claim:hover {
  filter: brightness(1.12) saturate(1.1) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 0 #2a1408, 0 6px 14px rgba(0, 0, 0, 0.5) !important;
}
.menu-btn-play:hover {
  filter: brightness(1.15) !important;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 5px 0 #2a1408, 0 8px 18px rgba(255, 168, 60, 0.5) !important;
}
.menu-btn-discord:hover {
  filter: brightness(1.18) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 0 #1e2030, 0 6px 14px rgba(88, 101, 242, 0.5) !important;
}
.menu-btn-discord:disabled,
.menu-btn-discord[disabled] {
  filter: grayscale(0.6) brightness(0.7);
  cursor: not-allowed;
  transform: none !important;
}
.menu-btn-discord:disabled:hover { transform: none !important; box-shadow: none !important; }
.hud-btn:hover {
  filter: brightness(1.18) saturate(1.1) !important;
  transform: translateY(-1px);
}
.panel-close:hover {
  filter: brightness(1.15);
  transform: scale(1.05);
}

/* ---- Player portrait fallback (in case background-image fails) ---- */
#player-portrait {
  background-color: #4a1f06;
  background-size: contain !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  image-rendering: pixelated;
}
#player-portrait::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 215, 130, 0.25);
}

/* ---- Reset save danger button ---- */
#btn-reset-save {
  background: linear-gradient(180deg, #c83a3a, #8a1f1f) !important;
  border: 2px solid #4a0808 !important;
  color: #fff !important;
  padding: 8px 16px;
  font-weight: 700;
  text-shadow: 1px 1px 0 #2a0404;
  cursor: pointer;
  transition: filter 0.12s ease, transform 0.12s ease;
}
#btn-reset-save:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

/* ============================================================
   v1.0.5 â€” HUD scaling, responsive sizing, social systems
   ============================================================ */

/* HUD top bar grows with --hud-scale CSS variable (default 1) */
#hud-top {
  padding: calc(8px * var(--hud-scale, 1)) calc(12px * var(--hud-scale, 1)) !important;
  gap: calc(10px * var(--hud-scale, 1));
}
#zone-name { font-size: calc(13px * var(--hud-scale, 1)) !important; }
#zone-tier { font-size: calc(11px * var(--hud-scale, 1)) !important; }
#hud-resources { gap: calc(10px * var(--hud-scale, 1)) !important; }
#hud-resources span {
  font-size: calc(15px * var(--hud-scale, 1)) !important;
  padding: calc(5px * var(--hud-scale, 1)) calc(11px * var(--hud-scale, 1)) !important;
}
#hud-resources img {
  height: calc(18px * var(--hud-scale, 1)) !important;
  width: auto !important;
}
.hud-btn {
  width: calc(44px * var(--hud-scale, 1)) !important;
  height: calc(44px * var(--hud-scale, 1)) !important;
  font-size: calc(20px * var(--hud-scale, 1)) !important;
}
.hud-icon {
  width: calc(24px * var(--hud-scale, 1)) !important;
  height: calc(24px * var(--hud-scale, 1)) !important;
}
#hud-buttons { gap: calc(8px * var(--hud-scale, 1)) !important; }

/* Bottom HUD (player portrait + bars) also scales */
#hud-bottom { padding: calc(10px * var(--hud-scale, 1)) calc(12px * var(--hud-scale, 1)) !important; }
#player-portrait {
  width: calc(56px * var(--hud-scale, 1)) !important;
  height: calc(56px * var(--hud-scale, 1)) !important;
}

/* Mobile auto-scales HUD up so buttons remain tappable */
@media (max-width: 900px) {
  :root { --hud-scale: 1.15; }
}
@media (max-width: 600px) {
  :root { --hud-scale: 1.35; }
  #hud-resources span { font-size: calc(13px * var(--hud-scale, 1)) !important; padding: calc(4px * var(--hud-scale,1)) calc(8px * var(--hud-scale,1)) !important; }
  #hud-top { flex-wrap: wrap; gap: calc(6px * var(--hud-scale, 1)); }
}

/* ---- HUD scale control row in settings ---- */
#modal-settings .settings-row .slider-value {
  min-width: 48px;
  text-align: right;
  color: #fff8d2 !important;
  font-weight: 700;
}

/* ---- Landing menu Settings button (matches secondary style) ---- */
.menu-btn-settings {
  /* uses same look as menu-btn-secondary defined elsewhere */
}
.menu-btn-settings:hover {
  filter: brightness(1.1);
}

/* ============================================================
   SOCIAL PANEL (Profile / Friends / Clans / Chat / Leaderboard)
   ============================================================ */
#panel-social .panel-body { padding: 8px !important; }
.social-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #4a1f06;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.social-tab {
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 6px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: #f5d098;
  font-family: var(--pixel-font, monospace);
  font-size: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.social-tab:hover { color: #fff8d2; background: rgba(255, 215, 102, 0.08); }
.social-tab.active {
  color: #ffd966;
  border-bottom-color: #ffd966;
  background: rgba(255, 215, 102, 0.06);
  text-shadow: 0 0 6px rgba(255, 215, 102, 0.5);
}

.social-section { display: none; }
.social-section.active { display: block; }

/* Profile section */
.profile-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(43,24,12,0.7), rgba(74,31,6,0.55));
  border: 2px solid #4a1f06;
  border-left: 5px solid #ffd966;
  border-radius: 4px;
  margin-bottom: 10px;
}
.profile-avatar {
  width: 64px; height: 64px;
  background: #2a1408;
  border: 2px solid #ffd966;
  border-radius: 4px;
  image-rendering: pixelated;
  flex-shrink: 0;
}
.profile-meta { flex: 1; min-width: 0; }
.profile-name {
  font-size: 14px;
  color: #ffd966;
  margin-bottom: 4px;
  font-weight: 700;
  text-shadow: 1px 1px 0 #2a1408;
}
.profile-title {
  font-size: 10px;
  color: #f5d098;
  margin-bottom: 6px;
  font-style: italic;
}
.profile-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  font-size: 10px;
  color: #fff8d2;
}
.profile-stats span strong { color: #ffd966; }
.profile-edit {
  display: flex; gap: 6px; margin-bottom: 8px;
}
.profile-edit input {
  flex: 1;
  background: rgba(43,24,12,0.6);
  border: 2px solid #4a1f06;
  color: #fff8d2;
  padding: 6px 10px;
  border-radius: 4px;
  font-family: var(--pixel-font, monospace);
  font-size: 11px;
}
.profile-edit input:focus { outline: none; border-color: #ffd966; }
.profile-edit button {
  background: linear-gradient(180deg, #ffd966, #c9922a);
  border: 2px solid #2a1408;
  color: #2a1408;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--pixel-font, monospace);
  font-size: 10px;
  font-weight: 700;
}
.profile-edit button:hover { filter: brightness(1.1); }

/* Empty state for social tabs without backend */
.social-empty {
  padding: 20px 14px;
  text-align: center;
  background: rgba(43,24,12,0.45);
  border: 2px dashed #4a1f06;
  border-radius: 4px;
  color: #f5d098;
  font-size: 11px;
  line-height: 1.6;
}
.social-empty .icon {
  font-size: 28px;
  display: block;
  margin-bottom: 8px;
  filter: drop-shadow(1px 1px 0 #2a1408);
}

/* ============================================================
   v1.0.6 â€” Unified hover, quest UI polish, inventory contrast
   ============================================================ */

/* ---- UNIFIED BUTTON HOVERS ----
   Single rule: every interactive button "lifts" by 2px on hover, no color or
   filter changes. We override every previous :hover that mutated background,
   filter, color or border-image-source so the visual stays stable. */
.btn-pixel:hover:not(:disabled),
.menu-btn:hover:not(:disabled),
.menu-btn-secondary:hover,
.menu-btn-settings:hover,
.menu-btn-discord:hover,
.menu-btn-logout:hover,
.menu-btn-play:hover,
.btn-primary:hover,
.btn-secondary:hover,
.btn-danger:hover,
.btn-upgrade:not(:disabled):hover,
.btn-claim:not(:disabled):hover,
.btn-quest-claim:not(:disabled):hover,
.hud-btn:hover,
.panel-close:hover,
#btn-offline-claim:hover,
#btn-start-game:not(:disabled):hover,
#btn-settings-close:hover,
#btn-about-close:hover,
#btn-reset-save:hover,
.profile-edit button:hover,
.chat-input-row button:hover {
  /* Stay on the SAME normal frame â€” only nudge upward */
  border-image-source: url('/sprites/ui/theme/button_normal.png') !important;
  background-image: none !important;
  filter: none !important;
  color: inherit;
  transform: translateY(-2px);
  transition: transform 0.08s ease;
}

/* Buttons that intentionally use a tinted background keep that base color on
   hover (just don't shift it brighter or to a different hue). */
.menu-btn-discord:hover {
  background: linear-gradient(180deg, rgba(88,101,242,0.85), rgba(71,82,196,0.85)) padding-box !important;
}
.menu-btn-play:hover,
.btn-primary:hover {
  /* keep the gold tone instead of swapping to brighter gold variable */
  background: var(--color-gold2) !important;
  box-shadow: 0 4px 0 rgba(0,0,0,0.35) !important;
}

/* Active still uses the pressed sprite + a downward nudge. */
.btn-pixel:active:not(:disabled),
.menu-btn:active:not(:disabled),
.btn-upgrade:not(:disabled):active,
.btn-claim:not(:disabled):active,
.btn-quest-claim:not(:disabled):active,
.hud-btn:active,
.panel-close:active,
#btn-offline-claim:active,
#btn-start-game:not(:disabled):active,
#btn-settings-close:active,
#btn-about-close:active,
#btn-reset-save:active {
  border-image-source: url('/sprites/ui/theme/button_pressed.png') !important;
  transform: translateY(1px) !important;
  filter: none !important;
}

/* Row hovers (upgrade / quest / ach / inventory cell) are part of static lists,
   not buttons. Drop the brightness flicker; keep them visually inert. */
.upgrade-row:hover,
.quest-row:hover,
.ach-row:hover,
.char-card:hover,
.inv-cell:hover {
  filter: none !important;
}

/* Tab buttons (panel tabs + social tabs + chat channels) â€” only color shift on
   the active state, hover is inert to avoid the buggy palette flicker. */
.tab-btn:hover, .social-tab:hover, .chat-channel:hover {
  color: inherit;
  filter: none;
}

/* ---- HUD BADGE (quest claim notification) ---- */
.hud-btn { position: relative; }
.hud-badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 18px; height: 18px;
  padding: 0 4px;
  background: linear-gradient(180deg, #ff5757, #b62a2a);
  border: 2px solid #2a0a08;
  border-radius: 9px;
  color: #fff;
  font-family: var(--pixel-font, monospace);
  font-size: 10px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
  box-shadow: 0 1px 0 rgba(0,0,0,0.6);
  pointer-events: none;
  animation: badge-pulse 1.6s ease-in-out infinite;
}
.hud-badge.hidden { display: none; }
@keyframes badge-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.18); box-shadow: 0 0 8px rgba(255, 90, 90, 0.7); }
}

/* ---- QUEST PANEL â€” mobile-game-style cards ---- */
.quest-row {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px 12px;
}
.quest-row .quest-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.quest-row .quest-name {
  font-size: 12px;
  color: #fff8d2;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.quest-row .quest-desc {
  font-size: 10px;
  color: #d8c89a;
  line-height: 1.5;
}
.quest-row .quest-objs { display: flex; flex-direction: column; gap: 4px; }
.quest-row .quest-obj {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 8px;
  align-items: center;
}
.quest-row .quest-obj-label { font-size: 10px; color: #d8c89a; }
.quest-row .quest-obj-count { font-size: 10px; color: #ffd966; font-weight: 700; }
.quest-row .quest-bar {
  grid-column: 1 / -1;
  height: 8px;
  background: rgba(0,0,0,0.55);
  border: 1px solid #4a1f06;
  border-radius: 3px;
  overflow: hidden;
}
.quest-row .quest-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #2a8a3a, #6cf066);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25);
  transition: width 0.4s ease;
}
.quest-row .quest-rewards { display: flex; gap: 4px; flex-wrap: wrap; }
.reward-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px 2px 4px;
  background: rgba(0,0,0,0.45);
  border: 1px solid #4a1f06;
  border-radius: 10px;
  color: #ffd966;
  font-size: 10px;
  font-weight: 700;
}
.reward-chip img {
  width: 14px; height: 14px;
  image-rendering: pixelated;
}
.reward-chip.reward-xp  { color: #aee8ff; border-color: #1f4a6a; }
.reward-chip.reward-gem { color: #d4ffd1; border-color: #1f4a2a; }

/* "PRÃŠT !" ribbon corner badge on a claim-ready quest */
.quest-row.claimable {
  border-image-source: url('/sprites/ui/theme/nine_path_focus.png') !important;
  border-image-slice: 3 fill;
  filter: drop-shadow(0 0 6px rgba(255, 217, 102, 0.45));
}
.quest-row .quest-ribbon {
  position: absolute;
  top: -8px; right: 10px;
  padding: 2px 10px;
  background: linear-gradient(180deg, #ffd966, #c9922a);
  border: 2px solid #2a1408;
  color: #2a1408;
  font-family: var(--pixel-font, monospace);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  border-radius: 2px;
  box-shadow: 0 2px 0 rgba(0,0,0,0.5);
  animation: ribbon-bob 1.8s ease-in-out infinite;
}
@keyframes ribbon-bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%      { transform: translateY(-2px) rotate(-2deg); }
}

/* Claimed quests: dim, muted, sent to bottom by JS sort */
.quest-row.claimed {
  filter: grayscale(0.65) brightness(0.7);
  opacity: 0.72;
}
.quest-row.claimed .quest-name { color: #c8b89a; }
.quest-status-done {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  align-self: flex-start;
  background: rgba(0,0,0,0.4);
  border: 1px solid #3a5a3a;
  color: #9ad59a;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
}
.quest-status-done span { color: #6cf066; font-size: 12px; }

/* The new sprite-framed RÃ©clamer button */
.btn-quest-claim {
  position: relative;
  align-self: flex-end;
  margin-top: 4px;
  padding: 4px 18px;
  font-family: var(--pixel-font, monospace);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #2a1408;
  background: linear-gradient(180deg, #ffe78a 0%, #ffd966 45%, #c9922a 100%);
  border: 3px solid transparent;
  border-image: url('/sprites/ui/theme/button_normal.png') 3 4 fill / 6px / 0 stretch;
  border-radius: 0;
  cursor: pointer;
  text-shadow: 1px 1px 0 rgba(255,255,255,0.35);
  overflow: hidden;
  transition: transform 0.08s ease;
}
.btn-quest-claim .claim-glow {
  position: absolute;
  top: 0; left: -60%;
  width: 50%; height: 100%;
  background: linear-gradient(110deg, transparent, rgba(255,255,255,0.55), transparent);
  animation: claim-shine 2.2s ease-in-out infinite;
}
@keyframes claim-shine {
  0%   { left: -60%; }
  60%  { left: 110%; }
  100% { left: 110%; }
}
.btn-quest-claim:hover {
  transform: translateY(-2px);
  border-image-source: url('/sprites/ui/theme/button_normal.png') !important;
  filter: none !important;
}
.btn-quest-claim:active {
  transform: translateY(1px);
  border-image-source: url('/sprites/ui/theme/button_pressed.png') !important;
}

/* ---- INVENTORY contrast + sprite cells ---- */
.inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 6px;
  padding: 6px;
}
.inv-cell {
  position: relative;
  width: 100%;
  height: 86px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  padding: 6px 4px 4px;
  background: rgba(15,8,4,0.55);
  cursor: help;
}
.inv-icon-img {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(1px 1px 0 #000);
}
.inv-cell .inv-name {
  font-size: 9px;
  line-height: 1.15;
  color: #fff8d2;
  text-align: center;
  text-shadow: 1px 1px 0 #000;
  max-height: 22px;
  overflow: hidden;
}
.inv-cell .inv-qty {
  position: absolute;
  bottom: 2px;
  right: 4px;
  padding: 1px 5px;
  background: rgba(0,0,0,0.7);
  border: 1px solid #ffd966;
  color: #ffd966;
  font-size: 10px;
  font-weight: 800;
  border-radius: 8px;
  line-height: 1;
}
/* Rarity glow accents on inventory cells */
.inv-cell.rarity-common    { /* default */ }
.inv-cell.rarity-rare      { box-shadow: inset 0 0 0 2px rgba(74, 144, 226, 0.45); }
.inv-cell.rarity-epic      { box-shadow: inset 0 0 0 2px rgba(186, 85, 211, 0.55); }
.inv-cell.rarity-legendary { box-shadow: inset 0 0 0 2px rgba(255, 200, 60, 0.65), 0 0 10px rgba(255, 200, 60, 0.3); }

.inv-empty {
  padding: 18px 14px;
  text-align: center;
  background: rgba(15,8,4,0.55);
  border: 2px dashed #4a1f06;
  border-radius: 4px;
  color: #f5d098;
  font-size: 11px;
  line-height: 1.6;
}

/* ---- Stats summary chips at the top of the upgrades panel ---- */
.stats-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 6px;
  margin-bottom: 8px;
  background: rgba(15,8,4,0.55);
  border: 2px solid #4a1f06;
  border-radius: 4px;
}
.stat-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 2px;
  background: rgba(0,0,0,0.35);
  border: 1px solid #2a1408;
  border-radius: 3px;
  min-width: 0;
}
.stat-pill-k {
  font-size: 9px;
  color: #d8c89a;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.stat-pill-v {
  font-size: 11px;
  color: #ffd966;
  font-weight: 800;
  text-shadow: 1px 1px 0 #000;
}
@media (max-width: 600px) {
  .stats-summary { grid-template-columns: repeat(2, 1fr); }
}

/* sentinel v1.0.6 */

/* ============================================================
   v1.0.7 â€” Public profiles, friends, referral, rich notifs
   ============================================================ */

/* ---- Notif card with action buttons ---- */
.notif.notif-card {
  background: rgba(15,8,4,0.92);
  border: 3px solid transparent;
  border-image: url('/sprites/ui/theme/nine_path_focus.png') 3 fill / 6px / 0 stretch;
  padding: 10px 12px;
  max-width: 300px;
  pointer-events: auto;
}
.notif.notif-card.sticky { border-image-source: url('/sprites/ui/theme/nine_path_focus.png'); }
.notif-row {
  display: flex; align-items: flex-start; gap: 8px;
}
.notif-icon {
  width: 28px; height: 28px;
  image-rendering: pixelated;
  filter: drop-shadow(1px 1px 0 #000);
  flex-shrink: 0;
}
.notif-text { flex: 1 1 auto; min-width: 0; }
.notif-title {
  color: #ffd966;
  font-weight: 800;
  font-size: 11px;
  text-shadow: 1px 1px 0 #2a1408;
  margin-bottom: 2px;
}
.notif-sub {
  color: #fff8d2;
  font-size: 10px;
  line-height: 1.45;
  word-break: break-word;
}
.notif-close {
  background: none; border: none;
  color: #d8c89a; font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  flex-shrink: 0;
}
.notif-close:hover { color: #ffd966; }
.notif-actions {
  display: flex; gap: 6px; margin-top: 8px;
  flex-wrap: wrap;
}
.btn-pixel.btn-tiny {
  padding: 2px 8px;
  font-size: 9px;
  letter-spacing: 0.5px;
}

/* ---- Public profile modal ---- */
#modal-public-profile .modal-box.public-profile-box {
  width: min(440px, 92vw);
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
}
.pp-card {
  display: flex; gap: 14px;
  align-items: center;
  padding: 10px 6px 14px;
}
.pp-avatar {
  width: 84px; height: 84px;
  border: 3px solid transparent;
  border-image: url('/sprites/ui/theme/inventory_cell.png') 3 fill / 4px / 0 stretch;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  flex-shrink: 0;
}
.pp-info { flex: 1 1 auto; min-width: 0; }
.pp-name {
  color: #fff8d2;
  font-size: 14px;
  font-weight: 800;
  text-shadow: 2px 2px 0 #2a1408;
  margin-bottom: 4px;
}
.pp-title {
  color: #ffd966;
  font-size: 11px;
  margin-bottom: 6px;
}
.pp-presence {
  display: inline-flex; align-items: center; gap: 6px;
  color: #aee8ff;
  font-size: 10px;
}
.pp-presence.offline { color: #8a8aaa; }
.pp-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #6cf066;
  box-shadow: 0 0 6px rgba(108,240,102,0.75);
  animation: pp-blink 1.6s ease-in-out infinite;
}
.pp-dot.off {
  background: #6a6a8a;
  box-shadow: none;
  animation: none;
}
.pp-since {
  color: #d8c89a;
  font-size: 9px;
  margin-left: 4px;
}
@keyframes pp-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.45; }
}

.pp-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 10px 8px;
  margin: 4px 0 12px;
  background: rgba(15,8,4,0.55);
  border: 2px solid #4a1f06;
  border-radius: 4px;
}
.pp-stat {
  display: flex; flex-direction: column; align-items: center;
  background: rgba(0,0,0,0.35);
  border: 1px solid #2a1408;
  border-radius: 3px;
  padding: 6px 2px;
}
.pp-stat img {
  width: 22px; height: 22px;
  image-rendering: pixelated;
  filter: drop-shadow(1px 1px 0 #000);
  margin-bottom: 4px;
}
.pp-stat-k { font-size: 9px; color: #d8c89a; }
.pp-stat-v {
  font-size: 12px; color: #ffd966; font-weight: 800;
  text-shadow: 1px 1px 0 #000;
}
.pp-link { margin: 8px 4px; }
.pp-link input {
  width: 100%;
  padding: 6px 8px;
  background: rgba(0,0,0,0.55);
  color: #aee8ff;
  border: 2px solid #4a1f06;
  border-radius: 3px;
  font-family: var(--pixel-font, monospace);
  font-size: 10px;
  cursor: text;
}
.pp-actions {
  display: flex; gap: 8px;
  flex-wrap: wrap;
  padding: 4px 4px 4px;
  margin-top: 6px;
}
.public-profile-loading {
  text-align: center;
  padding: 40px 20px;
  color: #d8c89a;
  font-size: 11px;
}
@media (max-width: 600px) {
  .pp-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Friends list (real backend) ---- */
.friends-section { margin-bottom: 14px; }
.friends-section-title {
  font-size: 10px;
  color: #ffd966;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 4px 0 6px 4px;
  text-shadow: 1px 1px 0 #2a1408;
}
.friend-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  margin-bottom: 4px;
  background: rgba(15,8,4,0.55);
  border: 2px solid #4a1f06;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.08s ease;
}
.friend-row:hover { transform: translateX(2px); }
.friend-row .avatar {
  width: 36px; height: 36px;
  border: 2px solid #4a1f06;
  background-size: cover;
  background-position: center;
  image-rendering: pixelated;
  flex-shrink: 0;
}
.friend-info { flex: 1 1 auto; min-width: 0; }
.friend-info .name {
  color: #fff8d2;
  font-size: 11px;
  font-weight: 700;
  display: block;
  text-shadow: 1px 1px 0 #2a1408;
}
.friend-meta {
  display: flex; gap: 8px;
  margin-top: 2px;
  font-size: 9px;
  color: #d8c89a;
}
.friend-meta .level { color: #ffd966; font-weight: 700; }
.friend-presence { color: #aee8ff; }
.friend-actions {
  display: flex; gap: 4px;
  flex-shrink: 0;
}
.friend-dot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.friend-dot.online {
  background: #6cf066;
  box-shadow: 0 0 5px rgba(108,240,102,0.7);
}
.friend-dot.off { background: #6a6a8a; }

/* ---- Profile share row in social panel ---- */
.profile-share {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin: 8px 0 4px;
}

/* sentinel v1.0.7 */

/* ============================================================
   v1.0.7+ â€” Social rework: readable Inter font, sprite icons,
   clans + chat + leaderboard real backend
   ============================================================ */

/* All social panel body text uses the readable UI font.
   Pixel font is reserved for tab labels and stat numbers. */
#panel-social,
#panel-social .profile-name,
#panel-social .profile-title,
#panel-social .profile-stats,
#panel-social .profile-edit input,
#panel-social .profile-edit button,
#panel-social .friend-row,
#panel-social .clan-desc,
#panel-social .chat-message,
#panel-social .chat-input-row input,
#panel-social .lb-header,
#panel-social .social-empty,
#panel-social .sx-empty-line {
  font-family: var(--ui-font, 'Inter', system-ui, sans-serif) !important;
  letter-spacing: 0;
}
#panel-social .profile-name,
#panel-social .friends-section-title,
#panel-social .lb-header,
#panel-social .sx-empty-title,
#panel-social .cm-author {
  font-weight: 800;
  letter-spacing: 0.2px;
}
#panel-social .profile-stats {
  font-size: 11px;
}
#panel-social .profile-stats span strong {
  color: #ffd966;
  font-weight: 700;
}
#panel-social .friend-row .name { font-size: 12px; font-weight: 700; }
#panel-social .friend-meta { font-size: 10px; }
#panel-social .profile-edit input {
  font-size: 12px;
  padding: 7px 10px;
}
#panel-social .profile-edit button { font-size: 11px; }
#panel-social .chat-message { font-size: 11px; line-height: 1.45; }
#panel-social .chat-input-row input { font-size: 12px; padding: 7px 10px; }

/* Inline sprite icons (no emojis) */
.sx-ico {
  display: inline-block;
  width: 14px; height: 14px;
  vertical-align: -3px;
  image-rendering: pixelated;
  margin-right: 4px;
  filter: drop-shadow(1px 1px 0 rgba(0,0,0,0.6));
}
.sx-ico-lg { width: 20px; height: 20px; vertical-align: -5px; }
.sx-em { color: #ffd966; font-weight: 700; }

/* Square pixel-art action buttons (yes/no/view/join) */
.sx-btn {
  width: 28px; height: 28px;
  border: 2px solid #2a1408;
  background: #4a1f06;
  cursor: pointer;
  padding: 0;
  image-rendering: pixelated;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px 16px;
  border-radius: 3px;
  transition: transform 0.08s ease;
}
.sx-btn:hover { transform: translateY(-2px); }
.sx-btn-yes  { background-color: #2e6f2e; background-image: url('/sprites/items/Honey.png'); background-size: 18px 18px; }
.sx-btn-no   { background-color: #6f2828; background-image: url('/sprites/items/Letter.png'); background-size: 18px 18px; }
.sx-btn-view { background-color: #4a1f06; background-image: url('/sprites/items/Book.png'); background-size: 18px 18px; }
.sx-btn-join { background-color: #2e6f2e; background-image: url('/sprites/items/GoldKey.png'); background-size: 18px 18px; }

/* Empty-state with sprite icon */
.social-empty .sx-empty-ico {
  display: block;
  margin: 0 auto 8px;
  width: 36px; height: 36px;
  image-rendering: pixelated;
  filter: drop-shadow(2px 2px 0 #000);
}
.social-empty .sx-empty-title {
  color: #ffd966;
  font-size: 12px;
  margin-bottom: 4px;
}
.social-empty .sx-empty-line {
  color: #f5d098;
  font-size: 11px;
  line-height: 1.5;
}

/* Hide the legacy emoji icon span */
.social-empty .icon { display: none; }

/* Profile avatar tweaks for sprite use */
.profile-avatar { background-size: cover; background-position: center; background-repeat: no-repeat; }
.profile-avatar-clan {
  display: flex; align-items: center; justify-content: center;
  background: #2a1408;
}
.profile-avatar-clan img {
  width: 40px; height: 40px;
  image-rendering: pixelated;
  filter: drop-shadow(2px 2px 0 #000);
}

/* Clans */
.clan-desc {
  padding: 8px 12px;
  margin-bottom: 10px;
  background: rgba(43,24,12,0.45);
  border-left: 3px solid #ffd966;
  color: #fff8d2;
  font-size: 11px;
  line-height: 1.5;
  font-style: italic;
}
.clan-create {
  padding: 10px;
  margin-bottom: 12px;
  background: rgba(43,24,12,0.45);
  border: 2px solid #4a1f06;
  border-radius: 4px;
}
.clan-form {
  display: flex; gap: 6px; margin-bottom: 6px;
}
.clan-form input {
  flex: 1;
  background: rgba(15,8,4,0.55);
  border: 2px solid #4a1f06;
  color: #fff8d2;
  padding: 6px 10px;
  border-radius: 3px;
  font-family: var(--ui-font, sans-serif);
  font-size: 11px;
}
.clan-form input:focus { outline: none; border-color: #ffd966; }
.clan-create > input {
  background: rgba(15,8,4,0.55);
  border: 2px solid #4a1f06;
  color: #fff8d2;
  padding: 6px 10px;
  border-radius: 3px;
  font-family: var(--ui-font, sans-serif);
  font-size: 11px;
}
.clan-create > input:focus { outline: none; border-color: #ffd966; }

.avatar.avatar-clan {
  display: flex; align-items: center; justify-content: center;
  background: #2a1408;
}
.avatar.avatar-clan img {
  width: 22px; height: 22px;
  image-rendering: pixelated;
}
.clan-role {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 9px;
  font-weight: 800;
  border-radius: 2px;
  vertical-align: 1px;
  letter-spacing: 0.5px;
}
.clan-role.owner   { background: #ffd966; color: #2a1408; }
.clan-role.officer { background: #aee8ff; color: #1a3a5a; }

/* Chat â€” bubble layout with avatars */
#panel-social .chat-channels {
  display: flex; gap: 4px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
#panel-social .chat-channel-btn {
  background: rgba(43,24,12,0.55);
  border: 2px solid #4a1f06;
  color: #f5d098;
  padding: 6px 10px;
  border-radius: 3px;
  cursor: pointer;
  font-family: var(--ui-font, sans-serif);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex; align-items: center;
  transition: all 0.1s ease;
}
#panel-social .chat-channel-btn:hover { transform: translateY(-1px); }
#panel-social .chat-channel-btn.active {
  background: #ffd966; color: #2a1408;
  border-color: #2a1408;
}
#panel-social .chat-channel-btn .sx-ico { filter: none; }
#panel-social .chat-messages {
  height: 260px;
  overflow-y: auto;
  background: rgba(15,8,4,0.55);
  border: 2px solid #4a1f06;
  border-radius: 4px;
  padding: 8px;
  margin-bottom: 8px;
  display: flex; flex-direction: column;
  gap: 6px;
}
.sx-chat-empty {
  color: #8a8aaa;
  font-size: 11px;
  text-align: center;
  padding: 30px 10px;
  font-family: var(--ui-font, sans-serif);
}
.chat-message {
  display: flex; gap: 8px;
  padding: 6px 8px;
  background: rgba(43,24,12,0.45);
  border-left: 3px solid #4a1f06;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.1s ease;
}
.chat-message:hover { background: rgba(43,24,12,0.65); border-left-color: #ffd966; }
.cm-avatar {
  width: 28px; height: 28px;
  background-size: cover;
  background-position: center;
  border: 1px solid #4a1f06;
  image-rendering: pixelated;
  flex-shrink: 0;
}
.cm-body { flex: 1; min-width: 0; }
.cm-head {
  display: flex; gap: 8px; align-items: baseline;
  margin-bottom: 2px;
}
.cm-author { color: #ffd966; font-size: 11px; }
.cm-time { color: #8a8aaa; font-size: 9px; margin-left: auto; }
.cm-text { color: #fff8d2; font-size: 11px; word-wrap: break-word; }

#panel-social .chat-input-row {
  display: flex; gap: 6px;
}
#panel-social .chat-input-row input {
  flex: 1;
  background: rgba(15,8,4,0.55);
  border: 2px solid #4a1f06;
  color: #fff8d2;
  padding: 7px 10px;
  border-radius: 3px;
}
#panel-social .chat-input-row input:focus { outline: none; border-color: #ffd966; }

/* Leaderboard */
.lb-header {
  text-align: center;
  color: #ffd966;
  font-size: 12px;
  margin-bottom: 10px;
  text-shadow: 1px 1px 0 #2a1408;
}
.lb-rank {
  display: flex; align-items: center; justify-content: center;
  width: 28px; flex-shrink: 0;
}
.lb-rank .sx-ico-lg { margin: 0; }
.lb-num {
  color: #f5d098;
  font-weight: 800;
  font-size: 12px;
  font-family: var(--pixel-font, monospace);
}
.lb-score {
  color: #ffd966;
  font-weight: 800;
  font-size: 11px;
  flex-shrink: 0;
  margin-left: 6px;
  font-family: var(--ui-font, sans-serif);
}
.leader-row.rank-1 { border-left-color: #ffd966 !important; }
.leader-row.rank-2 { border-left-color: #d8d8d8 !important; }
.leader-row.rank-3 { border-left-color: #cd7f32 !important; }
.leader-row.rank-me {
  background: linear-gradient(135deg, rgba(255,217,102,0.15), rgba(255,217,102,0.05)) !important;
  border-left-color: #ffd966 !important;
}
.lb-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, #4a1f06, transparent);
  margin: 8px 0;
}

/* sentinel v1.0.7+ */



.social-empty .label-coming {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 10px;
  background: rgba(232, 64, 64, 0.2);
  border: 1px solid #e84040;
  color: #ff9090;
  font-size: 9px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Friends list */
.friend-row, .clan-row, .leader-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin-bottom: 6px;
  background: rgba(43,24,12,0.55);
  border: 2px solid #4a1f06;
  border-left: 4px solid #ffd966;
  border-radius: 4px;
  font-size: 11px;
  color: #fff8d2;
}
.friend-row .avatar, .leader-row .avatar {
  width: 28px; height: 28px;
  background: #2a1408;
  border: 1px solid #ffd966;
  border-radius: 3px;
  flex-shrink: 0;
  image-rendering: pixelated;
}
.friend-row .name, .leader-row .name { flex: 1; color: #fff8d2; }
.friend-row .level, .leader-row .level { color: #ffd966; font-weight: 700; }
.leader-row .rank {
  width: 30px;
  text-align: center;
  color: #ffd966;
  font-weight: 700;
}
.leader-row.rank-1 { border-left-color: #ffd966; }
.leader-row.rank-2 { border-left-color: #d8d8d8; }
.leader-row.rank-3 { border-left-color: #cd7f32; }

/* Chat box */
.chat-box {
  display: flex;
  flex-direction: column;
  height: 360px;
}
.chat-channels {
  display: flex; gap: 4px; margin-bottom: 6px; flex-wrap: wrap;
}
.chat-channel-btn {
  background: rgba(43,24,12,0.55);
  border: 2px solid #4a1f06;
  color: #f5d098;
  font-family: var(--pixel-font, monospace);
  font-size: 9px;
  padding: 4px 8px;
  border-radius: 3px;
  cursor: pointer;
}
.chat-channel-btn.active { background: #4a1f06; color: #ffd966; border-color: #ffd966; }
.chat-messages {
  flex: 1;
  overflow-y: auto;
  background: rgba(20,10,5,0.55);
  border: 2px solid #4a1f06;
  border-radius: 4px;
  padding: 8px;
  margin-bottom: 6px;
  font-size: 11px;
  color: #fff8d2;
  line-height: 1.5;
}
.chat-message { margin-bottom: 4px; }
.chat-message .author { color: #ffd966; font-weight: 700; }
.chat-message .time { color: #8a8aaa; font-size: 9px; margin-right: 4px; }
.chat-input-row { display: flex; gap: 6px; }
.chat-input-row input {
  flex: 1;
  background: rgba(43,24,12,0.6);
  border: 2px solid #4a1f06;
  color: #fff8d2;
  padding: 6px 10px;
  border-radius: 4px;
  font-family: var(--pixel-font, monospace);
  font-size: 11px;
}
.chat-input-row input:focus { outline: none; border-color: #ffd966; }
.chat-input-row button {
  background: linear-gradient(180deg, #ffd966, #c9922a);
  border: 2px solid #2a1408;
  color: #2a1408;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
  font-size: 10px;
}
.chat-input-row button:hover { filter: brightness(1.1); }

/* ====================================================================
   V1.0.8 POLISH — notifs top-center, boss UI, player HUD, death modal,
   inventory grid, devlog, slider initial value
   ==================================================================== */

/* === NOTIFICATIONS — top-center stack, sprite-friendly cards === */
#notif-container {
  position: absolute !important;
  top: 16px !important;
  bottom: auto !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  z-index: 30;
  pointer-events: none;
  width: min(420px, 92vw);
  max-height: 60vh;
  overflow: hidden;
}
.notif {
  pointer-events: auto;
  background: rgba(43, 24, 12, 0.95) !important;
  border: 2px solid #6b3a14 !important;
  border-left: 5px solid #ffd966 !important;
  border-radius: 4px !important;
  padding: 10px 14px !important;
  font-family: 'Inter', system-ui, sans-serif !important;
  font-size: 13px !important;
  color: #fff8d2 !important;
  box-shadow: 0 4px 14px rgba(0,0,0,0.5);
  animation: notifDrop 0.28s ease;
  max-width: 100%;
  line-height: 1.4;
}
@keyframes notifDrop {
  from { opacity: 0; transform: translateY(-12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.notif.boss        { border-left-color: #e84040 !important; }
.notif.gold        { border-left-color: #ffd966 !important; }
.notif.gem         { border-left-color: #c062ff !important; }
.notif.quest       { border-left-color: #6fb1ff !important; }
.notif.achievement { border-left-color: #ffb84d !important; }
.notif.danger,
.notif.error       { border-left-color: #e84040 !important; }
.notif.success     { border-left-color: #3ecf5a !important; }
.notif-card .notif-row {
  display: flex; align-items: center; gap: 10px;
}
.notif-card .notif-icon {
  width: 28px; height: 28px;
  image-rendering: pixelated;
  flex-shrink: 0;
}
.notif-card .notif-text { flex: 1; min-width: 0; }
.notif-card .notif-title {
  font-weight: 700;
  color: #fff8d2;
  margin-bottom: 2px;
}
.notif-card .notif-sub {
  font-size: 11px;
  color: #f3d8a8;
}
.notif-card .notif-close {
  background: transparent; border: 0; color: #f3d8a8;
  font-size: 18px; cursor: pointer; line-height: 1;
  padding: 0 4px;
}
.notif-card .notif-close:hover { color: #fff8d2; }
.notif-card .notif-actions {
  display: flex; gap: 6px; margin-top: 8px; justify-content: flex-end;
}

/* === BOSS ANNOUNCE — full banner with sprite === */
#boss-announce {
  top: 0 !important; left: 0 !important;
  transform: none !important;
  width: 100%;
  display: flex; justify-content: center;
  pointer-events: none;
  z-index: 25;
  padding-top: 60px;
}
#boss-announce-inner {
  display: flex !important; align-items: center; gap: 18px !important;
  background: linear-gradient(135deg, rgba(74,12,12,0.96), rgba(184,40,40,0.92)) !important;
  border: 3px solid #ff5050 !important;
  border-image: none !important;
  outline: 2px solid #2f1a08;
  padding: 14px 24px !important;
  min-width: 380px; max-width: 90vw;
  box-shadow: 0 0 40px rgba(232,64,64,0.55), inset 0 0 0 1px rgba(255,200,200,0.25);
  animation: bossDrop 0.5s ease, bossShake 0.4s ease 0.5s;
}
@keyframes bossDrop {
  from { opacity: 0; transform: translateY(-40px); }
  to   { opacity: 1; transform: translateY(0); }
}
#boss-announce-sprite-wrap {
  width: 84px; height: 84px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.4);
  border: 2px solid #2f1a08;
  flex-shrink: 0;
}
#boss-announce-sprite {
  height: 72px; width: auto;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 6px rgba(255,80,80,0.6));
}
#boss-announce-text { color: #fff; }
#boss-announce-title {
  font-family: 'NinjaFont', 'Press Start 2P', monospace;
  font-size: 14px; letter-spacing: 3px;
  color: #ffe5c2;
  text-shadow: 2px 2px 0 #4a0606;
  margin: 0;
}
#boss-announce-name {
  font-family: 'NinjaFont', 'Press Start 2P', monospace;
  font-size: 18px; color: #ffd966;
  text-shadow: 2px 2px 0 #4a0606;
  margin: 4px 0 0;
}
#boss-announce-sub {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px; color: #ffe5c2;
  margin: 4px 0 0;
  opacity: 0.85;
}

/* === BOSS HP BAR — thicker, sprite-decorated head === */
#boss-bar-wrap {
  top: 12px !important;
  width: min(520px, 90vw) !important;
  max-width: 520px !important;
  min-width: 320px !important;
  padding: 8px 12px 10px !important;
  background: rgba(43, 24, 12, 0.92) !important;
  border: 3px solid #6b3a14 !important;
  border-image: none !important;
  outline: 2px solid #2f1a08;
  box-shadow: 0 4px 18px rgba(0,0,0,0.6);
}
#boss-bar-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 6px;
}
#boss-bar-face {
  width: 28px; height: 28px;
  image-rendering: pixelated;
  background: rgba(0,0,0,0.4);
  border: 1px solid #2f1a08;
  flex-shrink: 0;
}
#boss-bar-meta {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
}
#boss-bar-name {
  font-family: 'NinjaFont', monospace;
  font-size: 12px; color: #ffe5c2 !important;
  text-shadow: 1px 1px 0 #2f1a08;
  letter-spacing: 1px;
  text-align: left !important;
  margin: 0 !important;
}
#boss-bar-tier {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 10px; color: #ffd966;
  font-weight: 600;
}
#boss-bar-hp-text {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px; font-weight: 700; color: #fff8d2;
}
#boss-bar-track {
  height: 22px !important;
  background: #1a0a0a !important;
  border: 2px solid #2f1a08 !important;
  border-radius: 3px !important;
  overflow: hidden;
  position: relative;
}
#boss-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff5050, #e84040 60%, #b80f0f) !important;
  box-shadow: inset 0 0 6px rgba(255,200,200,0.35);
  transition: width 0.25s ease;
}
#boss-bar-track::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, transparent 50%);
  pointer-events: none;
}

/* === PLAYER HUD bottom bar polish === */
#player-bar {
  background: rgba(43, 24, 12, 0.78) !important;
  border: 2px solid #6b3a14 !important;
  border-radius: 4px !important;
  padding: 6px 10px !important;
  gap: 10px;
}
#player-portrait {
  width: 44px !important; height: 44px !important;
  background-color: #1a0a0a;
  border: 2px solid #6b3a14;
  flex-shrink: 0;
  image-rendering: pixelated;
}
#player-stats-bar { gap: 4px !important; }
.bar-wrap {
  display: flex !important;
  align-items: center;
  gap: 6px;
  position: relative;
  height: 14px;
  background: rgba(0,0,0,0.55);
  border: 1px solid #2f1a08;
  border-radius: 2px;
  padding: 0;
}
.bar-wrap .bar-icon {
  position: absolute;
  left: 2px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  image-rendering: pixelated;
  z-index: 2;
  filter: drop-shadow(1px 1px 0 #000);
}
.bar-wrap .bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  height: 100%;
  border-radius: 2px;
  transition: width 0.25s ease;
}
.bar-wrap .hp-bar { background: #3ecf5a; }
.bar-wrap .xp-bar { background: linear-gradient(90deg, #6fb1ff, #c062ff); }
.bar-wrap .bar-label {
  position: relative;
  z-index: 3;
  margin-left: 22px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: #fff8d2;
  text-shadow: 1px 1px 0 #000;
  white-space: nowrap;
}
#player-dps {
  display: flex !important;
  align-items: center;
  gap: 4px;
  background: rgba(0,0,0,0.45);
  border: 1px solid #2f1a08;
  border-radius: 3px;
  padding: 4px 8px;
  flex-shrink: 0;
  flex-direction: row !important;
}
#player-dps .dps-icon {
  width: 16px; height: 16px;
  image-rendering: pixelated;
}
#dps-count {
  font-family: 'Inter', system-ui, sans-serif !important;
  font-size: 11px; font-weight: 700;
  color: #ff8a8a !important;
}

/* === DEATH MODAL === */
.death-box {
  text-align: center;
  border: 3px solid #4a1f06 !important;
}
.death-box h2 {
  color: #ff8a8a !important;
  text-shadow: 2px 2px 0 #4a0606 !important;
  letter-spacing: 4px;
}
.death-skull {
  font-size: 64px;
  line-height: 1;
  color: #ff8a8a;
  text-shadow: 0 0 20px rgba(255,80,80,0.5);
  margin-bottom: 4px;
  animation: skullPulse 1.4s ease-in-out infinite;
}
@keyframes skullPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
.death-box .death-tip {
  font-size: 11px !important;
  color: #ffe5c2 !important;
  font-style: italic;
  margin-top: 4px;
}

/* === ABOUT MODAL — devlog === */
.about-modal-box {
  max-width: 560px !important;
  max-height: 80vh;
}
.about-modal-box .about-content {
  max-height: 56vh;
  overflow-y: auto;
  text-align: left;
  padding-right: 8px;
}
.devlog-title {
  margin-top: 16px !important;
  font-size: 12px !important;
  color: #fff8d2 !important;
  text-shadow: 1px 1px 0 #4a1f06;
  letter-spacing: 2px;
  border-top: 1px solid #4a1f06;
  padding-top: 10px;
}
.devlog-entry {
  background: rgba(43, 24, 12, 0.55);
  border: 2px solid #4a1f06;
  border-radius: 3px;
  padding: 8px 12px;
  margin-bottom: 8px;
}
.devlog-entry-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}
.devlog-version {
  font-family: 'NinjaFont', monospace;
  font-size: 12px;
  color: #ffd966;
  letter-spacing: 1px;
}
.devlog-date {
  font-size: 10px;
  color: #f3d8a8;
}
.devlog-entry-title {
  font-size: 11px;
  color: #fff8d2 !important;
  font-weight: 700;
  margin-bottom: 4px;
}
.devlog-entry ul {
  margin: 4px 0 0 16px;
  padding: 0;
  font-size: 10px;
  line-height: 1.5;
  color: #fff;
}
.devlog-entry ul li { margin-bottom: 2px; }

/* === INVENTORY GRID — 4 cols, sprite-first === */
#inventory-grid {
  display: block !important;
}
#inventory-grid .inv-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 8px !important;
  margin: 4px 0;
}
#inventory-grid .inv-cell {
  aspect-ratio: 1;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px;
  cursor: pointer;
  position: relative;
  transition: transform 0.08s ease, border-color 0.08s ease;
}
#inventory-grid .inv-cell:hover {
  transform: translateY(-2px);
  border-color: #ffd966 !important;
}
#inventory-grid .inv-cell .inv-icon-img {
  width: 40px !important;
  height: 40px !important;
  object-fit: contain;
  image-rendering: pixelated;
}
#inventory-grid .inv-cell .inv-name {
  font-size: 9px;
  color: #fff8d2;
  text-align: center;
  line-height: 1.1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#inventory-grid .inv-cell .inv-qty {
  position: absolute;
  bottom: 2px; right: 4px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 10px;
  font-weight: 800;
  color: #ffd966;
  background: rgba(0,0,0,0.7);
  padding: 1px 5px;
  border-radius: 8px;
  text-shadow: none;
}
#inventory-grid .inv-cell.rarity-common    { border-color: #6b6b6b !important; }
#inventory-grid .inv-cell.rarity-rare      { border-color: #6fb1ff !important; }
#inventory-grid .inv-cell.rarity-epic      { border-color: #c062ff !important; }
#inventory-grid .inv-cell.rarity-legendary { border-color: #ffd966 !important; box-shadow: 0 0 10px rgba(255,217,102,0.4); }

#inventory-grid .inv-empty-hero {
  text-align: center;
  padding: 30px 16px;
}
#inventory-grid .inv-empty-hero img {
  width: 80px; height: 80px;
  image-rendering: pixelated;
  opacity: 0.6;
  margin-bottom: 12px;
}
#inventory-grid .inv-empty-hero p {
  color: #fff8d2;
  font-size: 12px;
  line-height: 1.5;
}
#inventory-grid .inv-empty-hero .inv-empty-hint {
  color: #f3d8a8;
  font-size: 10px;
  margin-top: 6px;
}

/* Item detail modal */
#modal-item {
  position: fixed; inset: 0; z-index: 220;
  display: none; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.7);
}
#modal-item.visible { display: flex; }
#modal-item .item-modal-box {
  background: rgb(243, 140, 76);
  border: 4px solid #6b3a14;
  outline: 2px solid #2f1a08;
  box-shadow: 0 0 0 2px #2f1a08, inset 0 0 0 2px #b9531a, 0 8px 28px rgba(0,0,0,0.7);
  padding: 24px;
  width: min(420px, 92vw);
  text-align: center;
}
#modal-item .item-icon {
  width: 80px; height: 80px;
  image-rendering: pixelated;
  margin: 0 auto 8px;
  display: block;
  background: rgba(0,0,0,0.3);
  border: 2px solid #2f1a08;
  padding: 8px;
}
#modal-item .item-name {
  font-family: 'NinjaFont', monospace;
  color: #fff8d2; font-size: 14px;
  letter-spacing: 2px; margin: 8px 0;
}
#modal-item .item-rarity {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 2px;
  margin-bottom: 8px;
}
#modal-item .item-rarity.common    { color: #cccccc; }
#modal-item .item-rarity.rare      { color: #6fb1ff; }
#modal-item .item-rarity.epic      { color: #c062ff; }
#modal-item .item-rarity.legendary { color: #ffd966; }
#modal-item .item-desc {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px; color: #fff;
  margin-bottom: 8px; line-height: 1.5;
}
#modal-item .item-source {
  font-size: 11px; color: #ffe5c2;
  background: rgba(43, 24, 12, 0.6);
  border: 1px solid #4a1f06;
  padding: 6px 10px;
  margin-bottom: 10px;
}
#modal-item .item-qty {
  color: #ffd966; font-weight: 700; margin-bottom: 12px;
}
#modal-item .item-actions {
  display: flex; gap: 8px; justify-content: center;
  flex-wrap: wrap;
}

/* === SLIDER initial render fix (cover all 3 sliders, including #hud-scale) === */
#vol-bgm, #vol-sfx, #hud-scale {
  --slider-pct: 50%;
}

/* sentinel v1.0.8 */