/* The shell over the tour HUD: which controls show in which mode, the explore HUD (point-of-interest card, the
   places bar, the hover label), the buttons added to the control bar, and the stamp notifications. */

/* ------------------------------------------------------------------ modes */
#xbar,#toOverview,#gamesBtn,#storiesBtn,#xcard,#xhover,.xleader{display:none}
body.mode-explore #xbar{display:flex}
body.mode-explore #toOverview{display:inline-flex}
body.mode-explore #gamesBtn,body.mode-explore #storiesBtn:not([hidden]){display:inline-flex}
body.mode-explore #xcard{display:block}
body.mode-explore #xhover{display:block}
body.mode-explore .xleader{display:inline}
body.mode-explore #track,body.mode-explore #meta,body.mode-explore #hint,body.mode-explore #next,body.mode-explore #tStep,
body.mode-explore #play,body.mode-explore #restart,body.mode-explore #toExplore,body.mode-explore #tourEnd{display:none!important}
body:not(.mode-tour) #toExplore{display:none}
/* embed mode (ui/embed-mode.js, index.html sets html.embed): the stage and the story alone */
html.embed #topbar,html.embed #ctl,html.embed #next,html.embed #hud{display:none!important}

/* ------------------------------------------------------------------ control bar additions */
#ctl .tog{justify-content:flex-end}
#toExplore::after{content:"";width:6px;height:6px;border-top:1.5px solid currentColor;border-right:1.5px solid currentColor;transform:rotate(45deg);margin-inline-start:2px}
[dir="rtl"] #toExplore::after{transform:rotate(-135deg)}
.xb-back{align-items:center;gap:8px;height:40px;padding:0 15px 0 12px;border-radius:20px;border:1.5px solid var(--edge);background:transparent;color:var(--on-blue);cursor:pointer;font-size:14.5px;white-space:nowrap}
.xb-back svg{width:11px;height:11px;flex:none;fill:currentColor}
[dir="rtl"] .xb-back svg{transform:scaleX(-1)}
.xb-back:hover{background:rgba(214,242,252,.14)}
.xb-games svg{width:17px;height:17px;flex:none}

#xbar{align-items:center;gap:10px;min-width:0;justify-content:center}
.xb-map{display:inline-flex;align-items:center;gap:8px;height:40px;padding:0 16px 0 13px;border-radius:20px;border:1.5px solid var(--edge);background:transparent;color:var(--on-blue);cursor:pointer;font-size:14.5px;flex:none}
.xb-map svg{width:17px;height:17px}
.xb-map kbd{font:inherit;font-size:11px;font-weight:500;line-height:1;padding:2px 4px;border:1px solid currentColor;border-radius:3px;opacity:.7}
.xb-map:hover{background:rgba(214,242,252,.14)}
body.map-open .xb-map{background:var(--pale);border-color:var(--pale);color:var(--ink);font-weight:600}
.xb-nav{display:flex;align-items:center;gap:10px;min-width:0}
.xb-nav .ib svg{width:14px;height:14px;fill:none}
.xb-nav .ib:disabled{opacity:.4;cursor:default;background:transparent}
.xb-pos{display:flex;flex-direction:column;align-items:center;min-width:0;max-width:34ch;text-align:center;line-height:1.15}
.xb-pos b{font-weight:600;font-size:15px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.xb-pos small{font-size:12.5px;color:var(--on-blue-dim);white-space:nowrap;font-variant-numeric:tabular-nums}
@media (pointer:coarse){.xb-back,.xb-map{height:44px;border-radius:22px}}

/* ------------------------------------------------------------------ the point-of-interest card */
.xcard{position:absolute;top:calc(var(--hdro,0px) + 20px);inset-inline-start:20px;width:min(380px,38%);max-height:calc(100% - var(--hdro,0px) - 20px - var(--ctlo,0px) - 16px);overflow:auto;
  pointer-events:auto;padding:18px 20px 20px;background:var(--card);color:var(--text);border-radius:var(--r-card);box-shadow:var(--shadow);overflow-wrap:break-word;
  transition:opacity .35s ease,transform .35s ease;scrollbar-width:thin;scrollbar-color:var(--line) transparent}
.xcard.is-away{opacity:0;transform:translateX(-10px);pointer-events:none}
[dir="rtl"] .xcard.is-away{transform:translateX(10px)}
.xc-trail ol{list-style:none;margin:0 0 8px;padding:0;display:flex;flex-wrap:wrap;gap:2px 0;font-size:13px;color:var(--dim)}
.xc-trail li{display:flex;align-items:center}
.xc-trail li+li::before{content:"";width:5px;height:5px;border-top:1px solid currentColor;border-right:1px solid currentColor;transform:rotate(45deg);margin:0 8px 0 6px;opacity:.7}
[dir="rtl"] .xc-trail li+li::before{transform:rotate(-135deg);margin:0 6px 0 8px}
.xc-trail button{border:0;background:none;padding:2px 0;color:var(--dim);cursor:pointer;font:inherit;text-decoration:underline;text-decoration-color:var(--line);text-underline-offset:3px}
.xc-trail button:hover{color:var(--blue);text-decoration-color:currentColor}
.xc-trail span{color:var(--text)}
.xc-eyebrow{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 10px;margin:0 0 4px;font-size:12px;font-weight:600;letter-spacing:.14em;text-transform:uppercase;color:var(--blue)}
.xc-seen{display:inline-flex;align-items:center;gap:5px;font-weight:500;letter-spacing:.06em;color:var(--good)}
.xc-seen::before{content:"";width:8px;height:4px;border-left:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(-45deg) translateY(-2px)}
.xcard h2{margin:0;font-family:var(--font-display);font-style:italic;font-weight:600;font-synthesis:none;font-size:32px;line-height:1.1;color:var(--ink);padding-inline-end:6px}
.xcard.is-welcome h2{font-size:32px}
.xc-body{margin:10px 0 0;font-size:15.5px;line-height:1.5;color:var(--text-long)}
.xcard .stats{margin-top:12px}
/* world places: the link to CERN, the sites, the Tier 1s */
.xc-link{display:flex;gap:8px;align-items:baseline;margin:10px 0 0;font-size:13.5px;line-height:1.35;color:var(--ink)}
.xc-link i{flex:none;width:14px;height:0;border-top:2px solid var(--blue);transform:translateY(-3px)}
.xc-sites{margin-top:10px}
.xc-sites h3{margin:0 0 4px;font-size:12px;font-weight:600;letter-spacing:.14em;text-transform:uppercase;color:var(--dim)}
.xc-sites ul{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:2px 12px;font-size:13.5px;line-height:1.3}
.xc-sites li{display:flex;flex-wrap:wrap;align-items:baseline;gap:0 5px;min-width:0}
.xc-sites li i{flex:none;width:7px;height:7px;border-radius:50%;border:1.5px solid var(--blue);transform:translateY(-1px)}
.xc-sites li.k-tier0 i,.xc-sites li.k-tier1 i,.xc-sites li.k-online i{background:var(--blue)}
.xc-sites li.k-hpc i{border-color:var(--dim);background:var(--dim)}
.xc-sites b{font-weight:600}
.xc-sites span{color:var(--dim)}
.xc-sites em{flex-basis:100%;padding-inline-start:12px;font-style:normal;font-size:12px;color:var(--dim)}
.xc-t1{margin:8px 0 0;font-size:13.5px;color:var(--dim)}
.xc-t1 button{border:0;background:none;padding:0;font:inherit;color:var(--blue);cursor:pointer;text-decoration:underline;text-underline-offset:3px}
/* actions: Play in blue, stories pale, "Up to" outlined */
.xc-acts{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}
.xc-btn{display:inline-flex;align-items:center;gap:8px;min-height:40px;padding:6px 16px 6px 13px;border-radius:22px;border:1.5px solid var(--blue);background:transparent;color:var(--ink);
  cursor:pointer;font-size:15px;font-weight:500;text-align:start;line-height:1.2}
.xc-btn svg{width:12px;height:12px;flex:none}
.xc-btn.solid{background:var(--blue);border-color:var(--blue);color:var(--on-blue);font-weight:600}
.xc-btn.solid svg{width:10px;height:10px}
[dir="rtl"] .xc-btn.solid svg{transform:scaleX(-1)}
.xc-btn.xc-story{background:var(--pale);border-color:var(--pale);color:var(--ink);font-weight:500}
.xc-btn.xc-story svg{width:14px;height:14px}
[dir="rtl"] .xc-btn.xc-story svg{transform:none}
.xc-btn.solid:hover{background:var(--ink);border-color:var(--ink)}
.xc-btn.xc-story:hover{background:#c3e9f8;border-color:#c3e9f8}
.xc-btn:not(.solid):hover{background:var(--pale)}
.xc-sect{margin:16px 0 8px;padding-top:12px;border-top:1px solid var(--rule);font-size:12px;font-weight:600;letter-spacing:.14em;text-transform:uppercase;color:var(--dim)}
.xc-tiles{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}
.xc-tile{display:flex;align-items:center;gap:12px;width:100%;min-height:52px;padding:8px 12px 8px 10px;border:0;border-radius:12px;
  background:var(--pale);color:var(--text);cursor:pointer;font:inherit;text-align:start;transition:background .15s;--tc:var(--blue)}
.xc-tile:hover{background:#c3e9f8}
.xc-tico{flex:none;display:grid;place-items:center;width:32px;height:32px;color:var(--tc)}
.xc-tico svg{width:22px;height:22px}
.xc-tile.is-passport .xc-tico{color:var(--ink)}
.xc-tile.is-passport .xc-tico svg{width:30px;height:30px;transform:rotate(-8deg)}
.xc-tt{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px;line-height:1.2}
.xc-tt b{font-weight:600;font-size:15px;color:var(--ink)}
.xc-tt small{font-size:12.5px;color:var(--dim);font-variant-numeric:tabular-nums}
.xc-tile.is-next .xc-tt small{display:flex;flex-wrap:wrap;align-items:center;gap:2px 8px}
.xc-tile.is-next .lvl{font-size:11.5px;padding:0 7px 0 5px;gap:4px}   /* the suggestion's audience level, beside its kind */
.xc-tile.is-next .lvl-ico{width:11px;height:10px}
.xc-tile.is-next{background:var(--card);box-shadow:inset 0 0 0 1.5px var(--blue)}
.xc-tile.is-next:hover{background:var(--pale)}
.xc-meter{display:block;height:4px;margin-top:5px;border-radius:2px;background:rgba(33,84,172,.15);overflow:hidden}
.xc-meter i{display:block;height:100%;min-width:3px;border-radius:2px;background:var(--red)}
.xc-tgo{flex:none;display:grid;place-items:center;color:var(--blue);transition:transform .15s}
.xc-tgo svg{width:12px;height:12px}
[dir="rtl"] .xc-tgo svg{transform:scaleX(-1)}
.xc-tile:hover .xc-tgo{transform:translateX(2px)}
[dir="rtl"] .xc-tile:hover .xc-tgo{transform:translateX(-2px)}
.xc-keys{margin:12px 0 0;font-size:13px;color:var(--dim)}
.xc-keys kbd{font:inherit;font-size:12px;border:1px solid var(--line);border-radius:3px;padding:0 5px;color:var(--text)}
.xc-tog{display:none}
.xcard button:focus-visible{outline:2px solid var(--focus);outline-offset:2px}
@media (pointer:coarse){.xc-btn{min-height:44px}}

/* the name of the place under the pointer */
#xhover{position:absolute;left:0;top:0;pointer-events:none;padding:6px 12px 7px;background:var(--card);color:var(--text);border-radius:10px;
  opacity:0;transition:opacity .15s;white-space:nowrap;box-shadow:var(--shadow-s)}
#xhover.is-on{opacity:1}
#xhover b{display:block;font-weight:600;font-size:14.5px;color:var(--ink)}
#xhover span{display:block;font-size:12px;color:var(--dim)}

/* ------------------------------------------------------------------ stamp notifications: white pills under the header */
#toasts{position:fixed;z-index:70;top:calc(var(--hdr) + 14px + var(--safe-top));left:50%;transform:translateX(-50%);display:flex;flex-direction:column;align-items:center;gap:8px;pointer-events:none;width:max-content;max-width:calc(100vw - 24px)}
/* over a game they sit just under its title bar */
body.game-open #toasts{top:calc(72px + var(--safe-top))}
.toast{pointer-events:auto;display:flex;align-items:center;gap:4px;padding:0 6px 0 0;border-radius:30px;
  background:var(--white);color:var(--text);box-shadow:0 8px 24px rgba(5,20,50,.35);
  animation:toast-in .5s cubic-bezier(.2,.8,.2,1.2) both;transition:opacity .35s,transform .35s}
.toast.is-out{opacity:0;transform:translateY(-8px)}
@keyframes toast-in{from{opacity:0;transform:translateY(-14px) scale(.96)}}
.toast-main{display:flex;align-items:center;gap:12px;min-width:0;padding:7px 8px 7px 7px;border:0;border-radius:30px;background:none;color:inherit;font:inherit;text-align:start;cursor:pointer}
.toast-main[tabindex="-1"]{cursor:default}
/* the × in a ring that empties over the toast's life; hovering or focusing the toast holds it */
.toast-x{flex:none;width:36px;height:36px;padding:0;border:0;border-radius:50%;background:none;color:var(--dim);cursor:pointer;display:grid;place-items:center}
.toast-x svg{width:32px;height:32px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}
.toast-ring{stroke:var(--blue);stroke-width:2;stroke-dasharray:100;transform:rotate(-90deg);transform-origin:center;animation:toast-life 6.5s linear forwards}
.toast:is(:hover,:focus-within) .toast-ring{animation-play-state:paused}
@keyframes toast-life{to{stroke-dashoffset:100}}
.toast-x:hover{color:var(--ink);background:var(--pale)}
.toast-ico{flex:none;width:36px;height:36px;border-radius:50%;border:2px solid var(--red);display:grid;place-items:center;color:var(--red);transform:rotate(-8deg)}
.toast-ico svg{width:20px;height:20px}
.toast-t{display:flex;flex-direction:column;line-height:1.2}
.toast-t small{font-size:11px;font-weight:600;letter-spacing:.14em;text-transform:uppercase;color:var(--red-text)}
.toast-t b{font-weight:500;font-size:15px}
/* a plain toast ("Updated to the latest version"): one line, a blue disc with a tick */
.toast.is-plain .toast-main{padding:10px 8px 10px 10px}
.toast.is-plain .toast-ico{width:32px;height:32px;border:0;background:var(--blue);color:var(--on-blue);transform:none}
.toast.is-plain .toast-ico svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.toast.is-plain .toast-t b{font-size:16px;font-weight:400}
.toast:hover{box-shadow:0 0 0 2px var(--pale),0 8px 24px rgba(5,20,50,.35)}
.toast button:focus-visible{outline:2px solid var(--focus);outline-offset:2px}

/* ------------------------------------------------------------------ phones: one row in the bar, the rest in its menu */
#ctlMore,#restartM{display:none}
@media (max-width:640px){
  #ctl,body.mode-explore #ctl{grid-template-columns:auto minmax(0,1fr) auto}
  #ctlMore{display:grid}
  #restart{display:none}
  body.mode-tour #restartM{display:inline-flex}
  #ctl .tog{position:absolute;bottom:calc(100% + 8px);inset-inline-end:10px;grid-column:auto;display:none;flex-direction:column;align-items:stretch;gap:8px;
    min-width:min(230px,calc(100vw - 20px));padding:10px;border-radius:18px;background:var(--blue);box-shadow:var(--shadow)}
  #ctl.menu-open .tog{display:flex}
  #ctl.menu-open #ctlMore{background:var(--pale);color:var(--ink);border-color:var(--pale)}
  #ctl .tog>*{justify-content:flex-start}
  #ctl .tog .xb-games{width:auto;padding:0 14px}
  #ctl .tog .xb-games span{position:static;width:auto;height:auto;overflow:visible;clip-path:none}
  #ctl .tog .shell-pass{padding-inline:12px}
  #ctl .tog .shell-pass::after{content:attr(title);order:-1;font-size:14.5px}
  #ctl .tog .shell-pass svg{order:-2}
  .xb-back{padding:0;width:44px;height:44px;border-radius:50%;justify-content:center}
  .xb-back span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  .xb-map{height:44px;border-radius:22px;padding:0 14px}
  .xb-map span{display:none}
  .xb-games{padding:0;width:44px;justify-content:center}
  .xb-games span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  .xc-sect{margin-top:12px;padding-top:10px}
  .xc-tile{padding-block:6px}
  .xb-map kbd{display:none}
  #xbar{gap:8px;justify-content:space-between}
  .xb-pos{max-width:none;flex:1}
  .xb-nav{flex:1;gap:6px}
  .xcard{top:auto;bottom:calc(var(--ctlo,0px) + 10px);inset-inline:10px;width:auto;max-height:min(56%,calc(100% - var(--ctlo,0px) - var(--hdro,0px) - 70px));border-radius:var(--r-dialog);padding:12px 14px 14px 18px;box-shadow:0 12px 32px rgba(5,20,50,.4)}
  .xcard h2{font-size:27px;padding-inline-end:50px}
  .xcard.is-welcome h2{font-size:27px}
  .xc-tog{display:grid;place-items:center;position:absolute;top:10px;inset-inline-end:10px;width:44px;height:44px;border-radius:50%;border:1.5px solid var(--blue);background:var(--card);color:var(--ink);cursor:pointer}
  .xc-tog svg{width:14px;height:14px;transition:transform .2s}
  .xcard:not(.is-collapsed) .xc-tog svg{transform:rotate(180deg)}
  .xcard.is-collapsed{padding-block:12px 14px}
  .xcard.is-collapsed .xc-more,.xcard.is-collapsed .xc-trail{display:none}
  .xcard:not(.is-collapsed) .xc-trail{padding-inline-end:50px}
  .xcard.is-away{transform:translateY(10px)}
  .xc-body{font-size:15px;line-height:1.45}
  .xc-btn{min-height:44px}
  .xc-keys{display:none}
  .toast-t b{font-size:15px}
}

/* ------------------------------------------------------------------ the globe's look (ui/globe-toggle.js) */
.globe-tog{position:absolute;top:calc(var(--hdro,0px) + 14px);inset-inline-end:14px;display:flex;gap:2px;padding:3px;pointer-events:auto;
  border-radius:22px;background:var(--pale);box-shadow:var(--shadow-s)}
.globe-tog button{min-height:34px;padding:0 14px;border:0;border-radius:17px;background:transparent;color:var(--ink);font:inherit;font-size:14px;cursor:pointer}
.globe-tog button:hover{background:rgba(255,255,255,.6)}
.globe-tog button[aria-pressed="true"]{background:var(--blue);color:var(--on-blue);font-weight:600}
.globe-tog button:focus-visible{outline:2px solid var(--focus);outline-offset:2px}
@media (pointer:coarse){.globe-tog button{min-height:44px;border-radius:22px}.globe-tog{border-radius:25px}}
.globe-credit{position:absolute;inset-inline-end:14px;bottom:calc(var(--ctlo,0px) + 8px);margin:0;max-width:min(460px,60%);text-align:end;
  font-size:11px;line-height:1.35;color:var(--on-blue-dim);pointer-events:auto;text-shadow:0 1px 2px rgba(5,20,50,.9)}
.globe-credit a{color:inherit;text-decoration-color:rgba(201,230,246,.45);text-underline-offset:2px}
.globe-credit a:hover{color:var(--white)}
.globe-tog[hidden],.globe-credit[hidden]{display:none}
@media (max-width:640px){
  .globe-credit{bottom:auto;top:calc(var(--hdro,0px) + 64px);max-width:66%;font-size:10px}
}

/* ------------------------------------------------------------------ audience levels (ui/levels.js): a story's or game's
   badge. The name is always written out and a three-step mark beside it fills one, two or three steps, so the level
   never rests on colour; the fill deepens with the level. */
.lvl{display:inline-flex;align-items:center;gap:6px;max-width:100%;box-sizing:border-box;padding:2px 10px 2px 8px;border:1px solid currentColor;border-radius:999px;
  font-family:var(--font);font-style:normal;font-size:13.5px;font-weight:600;line-height:1.35;letter-spacing:.01em;color:var(--ink);white-space:nowrap}
.lvl-name{overflow:hidden;text-overflow:ellipsis;unicode-bidi:plaintext}
.lvl-ico{width:14px;height:12px;flex:none;fill:currentColor}
.lvl-ico .off{fill:none;stroke:currentColor;stroke-width:1;opacity:.6}
[dir="rtl"] .lvl-ico{transform:scaleX(-1)} /* the steps climb in the reading direction */
.lvl[data-level="deeper"]{background:var(--pale)}
.lvl[data-level="insider"]{background:var(--ink);border-color:var(--ink);color:var(--on-blue)}
.lvl-hint{font-size:14px;line-height:1.35;color:var(--dim);unicode-bidi:plaintext}

/* ------------------------------------------------------------------ "Why?": a game's or a story's link to a concept of
   the Toolbox (games/_shared.js whyLink, the story card's why: ui/prelude.js), which opens it over them */
.why-link{display:inline-flex;align-items:center;gap:6px;min-height:32px;padding:2px 12px 2px 8px;border-radius:16px;border:1.5px solid var(--blue);
  background:var(--card);color:var(--ink);cursor:pointer;font:inherit;font-size:14.5px;font-weight:500;line-height:1.2;text-align:start;vertical-align:middle}
.why-link:hover{background:var(--pale)}
.why-link::before{content:"?";flex:none;display:inline-grid;place-items:center;width:18px;height:18px;border-radius:50%;background:var(--blue);color:var(--on-blue);font-size:12.5px;font-weight:700}
.why-link b{font-weight:600}
@media (pointer:coarse){ .why-link{min-height:40px;border-radius:20px} }
