/* What every island of the site shares on the screen (the hub's part; the Neon Jungle and the будители game draw
   their own, in their own look):
   - the top bar, laid out like the Neon Jungle's HUD: home, the player, the stars, the wallet (coins and gems shared by
     all the islands, js/molivche.js), settings. The main island (body.home) has it in both designs; on the screens of
     Човекът и природата it is the new design's bar (.nd-only), the first design keeps its own (.od-only);
   - the settings sheets: the main island's (.main, for every island) and an island's own (.isle). */

html.nd .od-only { display: none !important; }
.mv-coin, .mv-gem { width: 1.2em; height: 1.2em; flex: none; vertical-align: -.22em; }
.pill .mv-coin, .pill .mv-gem { margin-right: 4px; }
.gain { display: inline-flex; align-items: center; gap: 4px; }
.cert-w { display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- the bar ---------- */
.ihud { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 2px 14px; }
.ihud .sp { flex: 1; }
.ihud .brand { margin-right: 4px; }
/* the round buttons and the friend, like the Neon Jungle's, in each island's colours: Човекът и природата's deep blue
   (its painted map's HUD), the main island's pencil yellow */
.ih-btn, .ih-av {
  width: 50px; height: 50px; padding: 0; border-radius: 50%; flex: none; display: grid; place-items: center; line-height: 1;
  color: #fff; border: 3px solid #a9cdf5; --mv-hole: #1d4f8f;
  background: radial-gradient(circle at 35% 30%, #5d9be0, #1d4f8f 62%, #12376b);
  box-shadow: 0 4px 0 #0b2550, 0 0 14px rgba(95, 143, 208, .55), inset 0 2px 0 rgba(255, 255, 255, .35);
}
.ih-btn svg { width: 26px; height: 26px; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .25)); }
.ih-btn:hover:not(:disabled) { background: radial-gradient(circle at 35% 30%, #77b0ef, #2a64ad 62%, #184585); }
.ih-btn:active:not(:disabled), .ih-av:active:not(:disabled) { transform: translateY(2px) scale(.96); box-shadow: 0 2px 0 #0b2550; }
.ih-av { font-size: 29px; border-color: #9fe8ff; background: radial-gradient(circle at 40% 35%, #fff, #d7efff 55%, #8cc2ff); box-shadow: 0 0 16px rgba(110, 200, 255, .75), 0 4px 0 #0b2550; }
.ih-av:hover:not(:disabled) { background: radial-gradient(circle at 40% 35%, #fff, #e6f5ff 55%, #a3d0ff); }
.ihud.main .ih-btn { color: #2b2d42; border-color: #fff3c4; --mv-hole: #ffc93c; background: radial-gradient(circle at 35% 30%, #fff6d0, #ffc93c 58%, #e9a400); box-shadow: 0 4px 0 #a87400, 0 0 14px rgba(255, 201, 60, .5), inset 0 2px 0 rgba(255, 255, 255, .6); }
.ihud.main .ih-btn svg { filter: none; }
.ihud.main .ih-btn:hover:not(:disabled) { background: radial-gradient(circle at 35% 30%, #fffae6, #ffd866 58%, #f2b21a); }
.ihud.main .ih-av { border-color: #ffd866; background: radial-gradient(circle at 40% 35%, #fff, #fff3c4 55%, #ffd866); box-shadow: 0 0 16px rgba(255, 201, 60, .6), 0 4px 0 #a87400; }
.ihud.main .ih-btn:active:not(:disabled), .ihud.main .ih-av:active:not(:disabled) { box-shadow: 0 2px 0 #a87400; }
.iconbtn.ih-home { display: inline-grid; place-items: center; color: var(--ink); --mv-hole: var(--card); }
.iconbtn.ih-home svg { width: 22px; height: 22px; }
.ih-name { font-weight: 900; font-size: 20px; }
.ih-pill {
  height: 46px; border-radius: 23px; display: inline-flex; align-items: center; gap: 8px; padding: 0 16px; flex: none;
  font-weight: 900; font-size: 19px; color: #fff; white-space: nowrap; font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #1d4f8f, #12376b); border: 2px solid #6f9fe0;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .25), 0 3px 10px rgba(0, 0, 0, .22);
}
.ih-pill .mv-coin, .ih-pill .mv-gem { width: 26px; height: 26px; }
.ih-pill .ih-star { font-style: normal; font-size: 22px; line-height: 1; }
.ih-rank { font-size: 22px; padding: 0 14px; gap: 6px; }
.ih-rank span { font-size: 16px; }
.ih-xp {
  flex: 1 1 200px; max-width: 360px; height: 40px; border-radius: 20px; position: relative; display: flex; align-items: center; gap: 10px;
  padding: 0 14px 0 42px; background: rgba(12, 30, 66, .9); border: 2px solid #6f9fe0; color: #fff; font-weight: 900; font-size: 17px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .45), 0 3px 10px rgba(0, 0, 0, .2);
}
.ih-xp > i { position: absolute; left: -8px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 38px; line-height: 1; filter: drop-shadow(0 0 6px rgba(255, 210, 63, .9)); }
.ih-xp .tr { flex: 1; height: 12px; border-radius: 6px; background: rgba(255, 255, 255, .13); overflow: hidden; }
.ih-xp .fl { display: block; height: 100%; min-width: 4px; border-radius: 6px; background: linear-gradient(90deg, #ffe066, #ffb020); box-shadow: 0 0 10px #ffcf40; }
.ih-xp b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ih-xp small { font-size: .78em; opacity: .8; }
html.nd body:not(.home) .ihud { padding-top: 6px; }
@media (max-width: 760px) {
  .ihud { gap: 7px; }
  .ih-rank span { display: none; }
  .ih-xp { order: 9; flex-basis: 100%; max-width: none; height: 34px; }
  .ih-xp > i { font-size: 32px; }
}
@media (max-width: 460px) {
  .ihud .brand > span { display: none; }
  .ih-btn, .ih-av { width: 42px; height: 42px; font-size: 20px; }
  .ih-btn svg { width: 22px; height: 22px; }
  .ih-av { font-size: 25px; }
  .ih-pill { height: 38px; padding: 0 10px; font-size: 16px; gap: 5px; }
  .ih-pill .mv-coin, .ih-pill .mv-gem { width: 22px; height: 22px; }
  .ih-name { display: none; }
  .ihud.main { gap: 6px; }
  /* an island's bar: the buttons above, the stars and the wallet below */
  .ihud:not(.main) .ih-rank, .ihud:not(.main) .sp { display: none; }
  .ihud:not(.main) #hStats { margin-left: auto; }
  .ihud:not(.main) .ih-xp { order: 9; flex: 1 1 0; min-width: 110px; padding-right: 10px; }
  .ihud:not(.main) .ih-pill { order: 10; }
  .ihud:not(.main)::after { content: ""; order: 8; flex-basis: 100%; height: 0; margin-top: -7px; }
}

/* ---------- Човекът и природата's map fills the screen, like the Neon Jungle's: no frame, the bar floats over its
   sky, the tools over its sea; what does not fit scrolls (a finger), or moves with the arrows at the sides or the wheel
   (a mouse: pressing and dragging is for the water) (js: showNatureMap) ---------- */
body.nmap-on { overflow: hidden; }
body.nmap-on .nmap-screen { position: fixed; inset: 0; z-index: 0; background: #2a9fd6; }
body.nmap-on .bay-wrap.nmap { position: absolute; inset: 0; width: auto; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
body.nmap-on .nmap .bay-scroll { position: absolute; inset: 0; overflow: auto; overscroll-behavior: contain; }
.nmap-arrow { position: fixed; z-index: 6; top: 50%; margin-top: -25px; }
.nmap-arrow.left { left: max(14px, env(safe-area-inset-left, 0px)); }
.nmap-arrow.right { right: max(14px, env(safe-area-inset-right, 0px)); }
.nmap-arrow.right svg { transform: scaleX(-1); }
.nmap-arrow[hidden] { display: none; }
@media (hover: none) { .nmap-arrow { display: none; } }                    /* a finger scrolls the map */
body.nmap-on .nmap .bay-stage { min-width: 0; }
body.nmap-on .nmap .bay-swipe:not([hidden]) { display: block; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
body.nmap-on .navs { position: fixed; top: 0; left: 0; right: 0; z-index: 6; pointer-events: none; }
body.nmap-on .ihud { padding: calc(12px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px)); }
body.nmap-on .ihud > :not(.sp) { pointer-events: auto; }
body.nmap-on .map-tools { position: fixed; z-index: 6; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); margin: 0; flex-wrap: nowrap; }
.map-tools .btn-ghost { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.map-tools .btn-ghost i { font-style: normal; }
.map-tools .btn-ghost b { min-width: 24px; padding: 1px 7px; border-radius: 99px; background: var(--berry); color: #fff; font-size: 15px; text-shadow: none; }
/* the Treasure Island's map (js: showTreasureIsland): the same screen, a chest on each sign; the design switch belongs
   to Човекът и природата */
body.nmap-on .tmap .bay-swipe:not([hidden]) { bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
.tmap-stage .bay-plank .ico svg { width: 1.75em; height: 1.75em; filter: drop-shadow(0 .06em 0 rgba(63, 35, 16, .35)); }
.tmap-stage .bay-plank:not(.soon) .ico { box-shadow: inset 0 0 0 .12em #fff3d0, 0 0 .9em rgba(255, 214, 80, .95), 0 .2em .35em rgba(10, 30, 50, .45); animation: treGlow 1.8s ease-in-out infinite; }
@keyframes treGlow { 50% { box-shadow: inset 0 0 0 .12em #fff3d0, 0 0 1.6em rgba(255, 214, 80, .55), 0 .2em .35em rgba(10, 30, 50, .45); } }
.tmap-stage .bay-plank { font-size: clamp(9px, calc(1.3 * var(--u)), 20px); }
.tmap-stage .bay-plank:not(.soon) { font-size: clamp(10px, calc(1.6 * var(--u)), 25px); }
.tmap-stage .bay-plank .tag { top: -1.1em; right: -.9em; }
/* the title board hangs in the middle of the sky, under the bar (on the home map it fills a corner) */
.tmap-stage .bay-title {
  --u: min(.45cqw, 1.45vw); left: 50% !important; top: calc(66px + env(safe-area-inset-top, 0px)) !important; width: auto !important;
  min-height: 0; padding: calc(1 * var(--u)) calc(2.6 * var(--u)) calc(1.1 * var(--u)) calc(7.4 * var(--u));
  transform: translateX(-50%) rotate(-1.5deg); transform-origin: 50% 0;
}
.tmap-stage .bay-title .pencil { width: calc(5 * var(--u)); }
@media (max-width: 460px) {
  /* no stars in this island's bar: the wallet stays in its one row */
  .ihud.tre .ih-pill { order: 0; }
  .ihud.tre::after { content: none; }
  .tmap-stage .bay-title { --u: 1.15vw; top: calc(62px + env(safe-area-inset-top, 0px)) !important; }
}
@media (prefers-reduced-motion: reduce) { .tmap-stage .bay-plank .ico { animation: none; } }
@media (max-width: 640px) {
  body.nmap-on .map-tools { gap: 8px; }
  body.nmap-on .map-tools .btn-ghost { padding: 9px 13px; }
  body.nmap-on .map-tools .btn-ghost span { display: none; }
}

/* ---------- the settings sheet ---------- */
.set-ov { position: fixed; inset: 0; z-index: 85; display: grid; place-items: center; padding: 16px; background: rgba(15, 25, 50, .55); }
.set-sheet {
  position: relative; width: min(660px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain;
  padding: 22px 24px 20px; border-radius: 26px; background: var(--card); color: var(--ink); border: 3px solid var(--line); box-shadow: var(--shadow);
  font-size: 18px; text-align: left;
}
.set-sheet h2 { margin: 0 44px 2px 0; }
.set-sheet h3 { margin: 18px 0 2px; font-size: 20px; }
.set-sub { margin: 0 0 8px; color: var(--ink-soft); font-weight: 700; }
.set-note { color: var(--ink-soft); font-size: 15px; margin: 10px 0 0; }
.set-lbl { margin: 14px 0 6px; font-weight: 800; }
/* a subject's "Знам и мога" island: its topics, and a topic's tests (js/core/app.js, showTopics) */
.topic-list { display: grid; gap: 8px; margin: 10px 0; }
.topic-row { display: grid; grid-template-columns: 44px 1fr; align-items: center; column-gap: 10px; min-height: 56px; padding: 8px 14px;
  text-align: left; font-size: 18px; border-radius: 16px; }
.topic-row .te { grid-row: span 2; font-size: 30px; text-align: center; }
.topic-row b { line-height: 1.2; }
.topic-row small { color: var(--ink-soft); font-weight: 700; font-size: 15px; }
.topic-row[disabled] { opacity: .5; }
.topic-group { margin: 8px 0; }
.topic-group > summary { list-style: none; cursor: pointer; background: var(--card, #fff8e7); box-shadow: 0 3px 0 var(--line); }
.topic-group > summary::-webkit-details-marker { display: none; }
.topic-group[open] > summary { outline: 3px solid #ffc93c; }
.topic-group .topic-list { margin: 8px 0 4px 18px; }
/* the small "Знам и мога" island floating in the sea of a subject's map */
.know-isle { position: absolute; z-index: 3; padding: 0; border: 0; background: none; box-shadow: none; cursor: pointer;
  display: block; animation: know-bob 4s ease-in-out infinite; }
.know-isle img { display: block; width: 100%; height: auto; transition: filter .15s; filter: drop-shadow(0 .4em .5em rgba(0, 40, 80, .35)); }
/* its sign is a sign of the map (.bay-plank, css/bay-map.css and css/world.css), and it lights up as they do */
.know-isle .bay-plank { left: 50%; top: 4%; pointer-events: none; }
.know-isle:hover .bay-plank, .know-isle:focus-visible .bay-plank { transform: translate(-50%, -50%) rotate(var(--r, 0deg)) scale(1.07); filter: brightness(1.1) drop-shadow(0 0 .35em rgba(255, 226, 122, .9)); }
.know-isle:hover img, .know-isle:focus-visible img { filter: brightness(1.08) drop-shadow(0 0 .6em rgba(255, 226, 122, .95)) drop-shadow(0 .4em .5em rgba(0, 40, 80, .35)); }
button.know-isle:hover:not(:disabled), button.know-isle:focus, button.know-isle:active { background: none; box-shadow: none; transform: none; }
.know-isle:active .bay-plank { transform: translate(-50%, -50%) rotate(var(--r, 0deg)) scale(.97); }
.know-isle:focus-visible { outline: none; }
@keyframes know-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -1.2%; } }
@media (prefers-reduced-motion: reduce) { .know-isle { animation: none; } }
.set-x { position: absolute; top: 14px; right: 14px; width: 42px; height: 42px; padding: 0; border-radius: 50%; display: grid; place-items: center; font-size: 18px; font-weight: 900; box-shadow: 0 3px 0 var(--line); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 2px dashed rgba(128, 128, 128, .25); font-weight: 700; }
.set-row > span:first-child { flex: 1; }
.set-row input[type=text] { max-width: 260px; font-size: 19px; padding: 7px 12px; text-align: left; }
.set-row select { font: inherit; font-size: 17px; padding: 6px 10px; border-radius: 12px; border: 3px solid var(--line); background: var(--card); color: var(--ink); }
/* a number typed in (the seconds per question, the questions in a test), its unit after it */
.set-num { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.set-num input { width: 5.5em; font: inherit; font-size: 19px; padding: 6px 10px; border-radius: 12px; border: 3px solid var(--line); background: var(--card); color: var(--ink); text-align: center; }
.set-row .btn-ghost { font-size: 16px; padding: 7px 13px; }
.tgl { width: 66px; height: 36px; padding: 0; border-radius: 18px; position: relative; flex: none; background: #c9d3dd; box-shadow: none; border: 3px solid var(--line); }
.tgl::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 2px solid var(--line); transition: transform .2s; }
.tgl[aria-pressed="true"] { background: var(--grass); }
.tgl:hover:not(:disabled) { background: #b8c4d0; }
.tgl[aria-pressed="true"]:hover:not(:disabled) { background: #5cbf68; }
.tgl[aria-pressed="true"]::after { transform: translateX(28px); }
.tgl:active:not(:disabled) { transform: none; box-shadow: none; }
.seg { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.seg button { font-size: 15px; padding: 6px 11px; border-radius: 12px; box-shadow: 0 3px 0 var(--line); }
.seg button[aria-pressed="true"] { background: var(--pencil); }
.confirm-line { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.confirm-line .sure { color: var(--berry); font-weight: 800; }
.set-lbl small { font-weight: 700; color: var(--ink-soft); font-size: 14px; }
.heroes { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.friend { position: relative; padding: 8px 2px 6px; border-radius: 16px; display: grid; justify-items: center; align-content: start; gap: 2px; line-height: 1.1; min-width: 0; }
.friend .em { font-size: 32px; line-height: 1.1; }
.friend .nm { font-size: 12.5px; font-weight: 800; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend[aria-pressed="true"] { background: var(--pencil); }
.friend.locked .em { filter: grayscale(.85) opacity(.55); }
.friend small { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 900; }
.friend small .mv-gem { width: 15px; height: 15px; }
.friend.shake { animation: shake .35s; }
table.prog { margin-top: 8px; }
.st-weak { margin: 4px 0 0; padding-left: 22px; }
.st-wallet { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 8px 0 4px; font-weight: 700; }
.st-wallet span { display: inline-flex; align-items: center; gap: 6px; }
.st-wallet .mv-coin, .st-wallet .mv-gem { width: 24px; height: 24px; }
.st-isles { display: grid; gap: 10px; margin-top: 8px; }
.st-isle { padding: 12px 14px; border-radius: 18px; border: 3px solid var(--line); background: var(--hover); }
.st-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.st-h b { font-size: 19px; }
.st-h small { color: var(--ink-soft); font-weight: 700; }
.st-e { font-size: 26px; line-height: 1; }
.st-go { margin-left: auto; font-size: 15px; padding: 5px 12px; }
.st-bar { height: 12px; margin: 8px 0 6px; border-radius: 6px; background: rgba(128, 128, 128, .22); overflow: hidden; }
.st-bar i { display: block; height: 100%; min-width: 3px; border-radius: 6px; background: linear-gradient(90deg, var(--grass), #2fbf71); }
.st-l { font-weight: 700; font-size: 16px; }
.st-w { margin-top: 4px; font-size: 15px; color: var(--ink-soft); }
@media (max-width: 520px) {
  .set-ov { padding: 8px; }
  .set-sheet { padding: 18px 14px 16px; font-size: 16px; border-radius: 20px; }
  .set-row { flex-wrap: wrap; }
  .set-row input[type=text] { max-width: none; width: 100%; }
}

/* the new design: the island's sheet is parchment in a wooden frame, like its cards */
html.nd body:not(.home) .set-sheet {
  background: var(--parchment); color: var(--ink); border: 4px solid #6b3d1a;
  box-shadow: inset 0 0 0 3px #f3dca6, inset 0 0 34px rgba(150, 95, 30, .32), 0 7px 0 #4a2a12, 0 18px 40px rgba(5, 30, 60, .38);
}
html.nd body:not(.home) .set-sheet h2, html.nd body:not(.home) .set-sheet h3 { color: #5a2f10; font-family: "Rubik", "Nunito", sans-serif; }
html.nd body:not(.home) .set-row { border-bottom-color: rgba(138, 90, 43, .3); }
html.nd body:not(.home) .tgl { border-color: #6b3d1a; background: #e8d3a6; }
html.nd body:not(.home) .tgl[aria-pressed="true"] { background: #5f9a1e; }
html.nd body:not(.home) .tgl::after { border-color: #6b3d1a; }
html.nd body:not(.home) .set-x { background: var(--wood-dark); color: #fff6dc; border-color: #4a2a12; box-shadow: 0 3px 0 #4a2a12; }
html.nd body:not(.home) .friend, html.nd body:not(.home) .seg button { background: #fffdf6; border-color: #b9895a; box-shadow: 0 3px 0 #b9895a; }
html.nd body:not(.home) .friend[aria-pressed="true"], html.nd body:not(.home) .seg button[aria-pressed="true"] { background: #ffd75e; }
html.nd body:not(.home) .st-isle { background: rgba(255, 255, 255, .55); border-color: #b9895a; }
@media print { .ihud, .set-ov { display: none !important; } }
