/* Smooth: one top bar for the map, Home and battle (js/smooth-topbar.js).
   A solid dark-navy panel, 760 x 36 game units, centred over the game area and joined to the top of the window, with
   rounded bottom corners. The menu icons share the left part evenly; each currency, Message and Settings sit in their own
   cell between thin dividers. --u (px per game unit) is set by the script, so the bar scales with the game only. */
#mg-topbar{--u:1px;position:fixed;z-index:43;left:0;width:calc(var(--u)*760);top:0;height:calc(var(--u)*36);box-sizing:border-box;overflow:hidden;
  background:linear-gradient(180deg,#1d3150 0%,#14243d 55%,#0f1c31 100%);
  border:calc(var(--u)*1.2) solid #3b5a82;border-top:0;border-radius:0 0 calc(var(--u)*8) calc(var(--u)*8);
  box-shadow:0 calc(var(--u)*2) calc(var(--u)*6) rgba(0,0,0,.45),inset 0 calc(var(--u)*-1) 0 rgba(255,255,255,.05);
  font-family:"MG VAG Bold","MG VAG","Trebuchet MS",Arial,sans-serif;color:#fff;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent}
#mg-topbar[hidden],#mg-topbar [hidden]{display:none!important}
#mg-topbar.tb-wait{pointer-events:none} /* between two screens: still shown, not clickable */
/* Cat Taxi (#travel-layer, z 46) and the Flash panels (#panel-layer, z 45: daily reward, mastery...) dim the whole game
   area behind their window, the bar included: keep the bar above the dim, not clickable while the window is open */
html:has(#travel-layer:not([hidden])) #mg-topbar,html:has(#panel-layer:not([hidden])) #mg-topbar{z-index:47;pointer-events:none}
/* the scene-change loader (#transition, z 2147483647) and the wipe snapshot (#panel-swap) cover the whole game area,
   the strip under the bar included, so only the badges poked out: keep the bar above them while they are up */
html:has(#transition:not([hidden])) #mg-topbar,html:has(#panel-swap) #mg-topbar{z-index:2147483647}
#mg-topbar .tb-inner{display:flex;align-items:stretch;width:100%;height:100%}
#mg-topbar .tb-ic{display:block;width:100%;height:100%;object-fit:contain;pointer-events:none;filter:drop-shadow(0 calc(var(--u)*.8) calc(var(--u)*.8) rgba(0,0,0,.5))}

/* the menu icons: spread evenly over the left part */
#mg-topbar .tb-nav{flex:9 1 0;min-width:0;display:flex;align-items:center;justify-content:space-around;padding:0 calc(var(--u)*4)}
/* each currency, Message and Settings: its own cell (just as wide as its content) with a thin divider on the left;
   the menu icons take the rest of the width */
#mg-topbar .tb-cell{flex:none;display:flex;align-items:center;justify-content:center;gap:calc(var(--u)*5);padding:0 calc(var(--u)*10);position:relative}
#mg-topbar .tb-cell::before{content:"";position:absolute;left:0;top:calc(var(--u)*7);bottom:calc(var(--u)*7);width:calc(var(--u)*1);background:rgba(120,165,215,.35)}
#mg-topbar .tb-cell.tb-endcell{padding:0 calc(var(--u)*8)}

/* icon buttons */
#mg-topbar .tb-btn{position:relative;flex:none;width:calc(var(--u)*32);height:calc(var(--u)*32);min-width:0;min-height:0;margin:0;padding:0;border:0;border-radius:calc(var(--u)*7);background:transparent;color:inherit;font:inherit;cursor:pointer;transition:background .15s,transform .15s,opacity .15s}
#mg-topbar .tb-btn:hover{background:rgba(120,190,255,.14)}
#mg-topbar .tb-btn:active{transform:scale(.92)}
#mg-topbar .tb-btn:focus-visible{outline:2px solid #7fc8ff;outline-offset:1px}
#mg-topbar .tb-btn:disabled{opacity:.45;filter:grayscale(1);cursor:default;transform:none;background:transparent}
#mg-topbar .tb-endcell .tb-btn{width:calc(var(--u)*26);height:calc(var(--u)*26)}
#mg-topbar .tb-gear .tb-ic{width:80%;height:80%;margin:10%;transition:transform .35s ease}
#mg-topbar .tb-gear:hover .tb-ic{transform:rotate(60deg)}
#mg-topbar .tb-badge{position:absolute;top:calc(var(--u)*-2);right:calc(var(--u)*-4);min-width:calc(var(--u)*13);height:calc(var(--u)*13);padding:0 calc(var(--u)*3);box-sizing:border-box;border-radius:calc(var(--u)*7);background:linear-gradient(#ff4d4d,#d41a26);border:calc(var(--u)*1) solid #fff;color:#fff;font-size:calc(var(--u)*8);line-height:calc(var(--u)*11);text-align:center;box-shadow:0 1px 2px rgba(0,0,0,.5);pointer-events:none}

/* currencies: icon and number */
#mg-topbar .tb-cur{cursor:default}
#mg-topbar .tb-cur .tb-ic{flex:none;width:calc(var(--u)*21);height:calc(var(--u)*21)}
#mg-topbar .tb-num{font-size:calc(var(--u)*15);line-height:1;letter-spacing:.02em;font-variant-numeric:tabular-nums;white-space:nowrap;text-shadow:0 calc(var(--u)*1) calc(var(--u)*1.5) rgba(0,0,0,.8)}

/* the inbox.js button is replaced by the bar's own Message button */
html.mg-topbar-inbox #inbox-button{opacity:0!important;pointer-events:none!important}

@media (prefers-reduced-motion:reduce){#mg-topbar .tb-btn,#mg-topbar .tb-gear .tb-ic{transition:none}}
