/* ── Shared Master Prize sticky header — used by draw page, home & admin ──
   Single source of truth for the brand + user badge so every page matches. */

.mp-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 12px;              /* matches the draw page .top-bar exactly */
  min-height: 48px;              /* stable bar height so nothing jumps on nav */
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}
.mp-topbar-actions { display: flex; align-items: center; gap: 6px; }

/* Header nav (My Lucky Draws / Admin) + mobile hamburger — Master Apps style */
.mp-burger { display: none; place-items: center; width: 34px; height: 34px; flex-shrink: 0;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); cursor: pointer; padding: 0; }
.mp-burger svg { width: 19px; height: 19px; }
.mp-nav { display: flex; align-items: center; gap: 2px; margin-left: 8px; margin-right: auto; }
.mp-nav a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px;
  color: var(--text-light, var(--muted, #8892A4)); font-weight: 600; font-size: .9rem; text-decoration: none; white-space: nowrap; }
.mp-nav a:hover, .mp-nav a.active { color: var(--text); background: var(--bg); }
.mp-nav a svg { width: 16px; height: 16px; }
@media (max-width: 768px) {
  .mp-burger { display: grid; }
  .mp-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch;
    gap: 0; margin: 0; background: var(--card); border-bottom: 1px solid var(--border); padding: 6px 10px;
    box-shadow: 0 14px 26px rgba(0,0,0,.32); z-index: 120; }
  .mp-nav.open { display: flex; }
  .mp-nav a { padding: 11px 12px; }
}

/* Brand (logo + wordmark) — clicks through to My Lucky Draws */
.mp-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  font-size: 16px;
  white-space: nowrap;
  flex-shrink: 0;
}
.mp-brand:hover { opacity: .85; }
.mp-brand .app-logo { height: 30px; width: auto; object-fit: contain; display: block; }

/* User badge (avatar + name → dropdown) — reserve height so the async
   fill (from /api/me) never shifts the row on navigation. */
.mp-idbadge { position: relative; display: flex; align-items: center; justify-content: flex-end; margin-left: 2px; min-height: 36px; }
.mp-id-signin { display:inline-flex; align-items:center; gap:6px; padding:6px 12px; border:1px solid var(--border);
  border-radius:8px; color:var(--text-light,var(--muted,#8892A4)); font-size:13px; font-weight:600; text-decoration:none; cursor:pointer; }
.mp-id-signin:hover { color:var(--text); background:var(--bg); }
.mp-id-signin svg { width:15px; height:15px; }
.mp-id-summary { display:flex; align-items:center; gap:8px; background:none; border:1px solid var(--border);
  border-radius:22px; padding:3px 11px 3px 3px; cursor:pointer; color:var(--text); font:inherit; line-height:1; }
.mp-id-summary:hover { background:var(--bg); }
.mp-id-summary img, .mp-av-fb { width:30px; height:30px; border-radius:50%; object-fit:cover;
  display:grid; place-items:center; background:var(--accent); color:#fff; font-weight:700; font-size:13px; flex-shrink:0; }
.mp-id-name { font-size:13px; font-weight:600; max-width:150px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mp-id-summary svg { color: var(--text-light,var(--muted,#8892A4)); flex-shrink:0; }
.mp-id-panel { display:none; position:absolute; right:0; top:48px; width:232px; background:var(--card);
  border:1px solid var(--border); border-radius:12px; box-shadow:0 14px 34px rgba(0,0,0,.42); padding:8px; z-index:300; }
.mp-id-panel.open { display:block; }
.mp-id-head { padding:8px 10px; border-bottom:1px solid var(--border); margin-bottom:6px; display:flex; flex-direction:column; gap:2px; }
.mp-id-head strong { font-size:.9rem; }
.mp-id-head small { color:var(--text-light,var(--muted,#8892A4)); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mp-id-panel a { display:flex; align-items:center; gap:10px; padding:9px 10px; border-radius:8px; font-size:14px; color:var(--text); text-decoration:none; }
.mp-id-panel a svg { width:16px; height:16px; }
.mp-id-panel a:hover { background:var(--bg); }
.mp-id-out { color: var(--danger,#e5658a); }
/* Mobile: 3-section bar — hamburger (left) · brand icon+name (centre) · avatar (right) */
@media (max-width:768px){
  .mp-id-name{ display:none; }
  /* Platform pages (mydraws/admin/login) have a sparse right side → centre the
     brand for the 3-section look. */
  .mp-topbar .mp-brand{ position:absolute; left:50%; transform:translateX(-50%); }
  /* The draw-page toolbar is busy on the right (fullscreen/theme/sound/settings
     + avatar); an absolute-centred OR full-width wordmark overlaps those icons.
     Keep the brand in normal flow next to the burger and show the logo only —
     the draw title sits right below, so the wordmark is redundant here. */
  .top-bar .mp-brand{ position:static; transform:none; }
  .mp-brand span{ display:inline; }
  .top-bar .mp-brand span{ display:none; }
  .mp-idbadge{ margin-left:auto; }   /* keep the badge hard-right even when the nav is hidden/empty */
}
