/* Mobile tools discovery button and teaser. */
.tools-tip { display: none; }
@media (max-width: 700px) {
    .mobile-tools-bar { overflow: visible; }

    .mobile-tools-bar .mobile-tools-link.tools-fab { position: relative; z-index: 2; isolation: isolate; overflow: visible; box-shadow: none; background: transparent; }
    .tools-fab .tools-fab__label { color: #6D500B; }

    .tools-fab .tools-fab__coin { position: relative; display: block; flex: 0 0 54px; width: 54px; min-width: 54px; max-width: none; height: 54px; overflow: visible; margin-top: -30px; margin-bottom: 1px; }
    .tools-fab__ring { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, #B8860B, #F3D98B, #D4AF37, #8A6508, #F3D98B, #B8860B); box-shadow: 0 8px 18px rgba(184, 134, 11, .35); }
    .tools-fab .tools-fab__face { position: absolute; inset: 2.5px; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center; color: #6D500B; background: radial-gradient(circle at 40% 30%, #fff, #FFF8E6 60%, #F6E7BE); box-shadow: inset 0 -3px 6px rgba(184, 134, 11, .18); }
    .tools-fab__shine { position: absolute; top: -20%; left: -80%; width: 35%; height: 140%; background: linear-gradient(100deg, transparent, rgba(255, 240, 190, .95), transparent); transform: skewX(-18deg); }
    .tools-fab__halo { position: absolute; inset: -2px; border-radius: 50%; border: 1.5px solid rgba(212, 175, 55, .7); opacity: 0; pointer-events: none; }
    .tools-fab__sq, .tools-fab__gem { transform-box: fill-box; transform-origin: center; }
    .tools-fab__gem { opacity: 0; }
    .tools-fab .tools-fab__badge { position: absolute; z-index: 3; top: -5px; left: -14px; background: linear-gradient(180deg, #FFE29A, #D4AF37); color: #302306; font-size: 10px; overflow: visible; white-space: nowrap; font-weight: 800; line-height: 16px; padding: 0 6px; border-radius: 999px; border: 2px solid #FFFDF8; box-shadow: 0 2px 6px rgba(184, 134, 11, .4); }
    .tools-fab__badge[hidden] { display: none; }

    .tools-fab.is-playing .tools-fab__coin  { animation: tf-lift 2.8s ease-in-out; }
    .tools-fab.is-playing .tools-fab__ring  { animation: tf-spin 2.8s cubic-bezier(.6, 0, .2, 1); }
    .tools-fab.is-playing .tools-fab__shine { animation: tf-shine 2.8s ease-in-out; }
    .tools-fab.is-playing .tools-fab__halo  { animation: tf-halo 2.8s ease-out; }
    .tools-fab.is-playing .tools-fab__sq--1 { animation: tf-s1 2.8s cubic-bezier(.5, 1.6, .4, 1); }
    .tools-fab.is-playing .tools-fab__sq--2 { animation: tf-s2 2.8s cubic-bezier(.5, 1.6, .4, 1); }
    .tools-fab.is-playing .tools-fab__sq--3 { animation: tf-s3 2.8s cubic-bezier(.5, 1.6, .4, 1); }
    .tools-fab.is-playing .tools-fab__sq--4 { animation: tf-s4 2.8s cubic-bezier(.5, 1.6, .4, 1); }
    .tools-fab.is-playing .tools-fab__gem   { animation: tf-gem 2.8s cubic-bezier(.4, 1.8, .5, 1); }

    @keyframes tf-spin  { 0% { transform: rotate(0); } 60%, 100% { transform: rotate(360deg); } }
    @keyframes tf-shine { 0%, 55% { left: -80%; } 80%, 100% { left: 150%; } }
    @keyframes tf-halo  { 0%, 8% { opacity: 0; transform: scale(1); } 14% { opacity: 1; } 55%, 100% { opacity: 0; transform: scale(1.7); } }
    @keyframes tf-lift  { 0%, 100% { transform: translateY(0); } 12% { transform: translateY(-4px); } 24% { transform: translateY(0); } }
    @keyframes tf-s1 { 0%, 12%, 86%, 100% { transform: none; } 28%, 70% { transform: translate(-4px, -4px) rotate(45deg) scale(.8); } }
    @keyframes tf-s2 { 0%, 12%, 86%, 100% { transform: none; } 28%, 70% { transform: translate(4px, -4px) rotate(45deg) scale(.8); } }
    @keyframes tf-s3 { 0%, 12%, 86%, 100% { transform: none; } 28%, 70% { transform: translate(-4px, 4px) rotate(45deg) scale(.8); } }
    @keyframes tf-s4 { 0%, 12%, 86%, 100% { transform: none; } 28%, 70% { transform: translate(4px, 4px) rotate(45deg) scale(.8); } }
    @keyframes tf-gem { 0%, 22% { opacity: 0; transform: scale(0) rotate(-90deg); } 36%, 68% { opacity: 1; transform: scale(1) rotate(0); } 82%, 100% { opacity: 0; transform: scale(0) rotate(90deg); } }

    /* Teaser tooltip */
    .tools-tip { position: fixed; left: 50%; bottom: var(--tools-tip-bottom, 110px); z-index: 112; direction: rtl; display: flex; align-items: center; gap: 8px; padding: 8px 10px; width: max-content; max-width: calc(100vw - 24px); box-sizing: border-box; text-decoration: none; font-family: inherit; background: #FFFDF8; border: 1px solid rgba(184, 134, 11, .35); border-radius: 14px; box-shadow: inset 0 2px 0 rgba(212, 175, 55, .34), 0 10px 24px rgba(28, 28, 46, .16); opacity: 0; visibility: hidden; pointer-events: none; transform: translateX(-50%) translateY(8px); transition: opacity .35s, transform .35s cubic-bezier(.3, 1.5, .5, 1); }
    .tools-tip.is-visible { visibility: visible; opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
    .tools-tip::after { content: ""; position: absolute; bottom: -6px; left: 50%; width: 10px; height: 10px; background: #FFFDF8; border-right: 1px solid rgba(184, 134, 11, .35); border-bottom: 1px solid rgba(184, 134, 11, .35); transform: translateX(-50%) rotate(45deg); }
    .tools-tip__icon { flex: 0 0 30px; width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: #FDF3D6; border: 1px solid rgba(184, 134, 11, .25); }
    .tools-tip__title { display: block; font-size: 13px; font-weight: 800; line-height: 1.3; color: #1C1C2E; }
    .tools-tip__sub { display: block; margin-top: 3px; font-size: 11px; line-height: 1.3; color: #626B78; }
    .tools-tip__close { flex: 0 0 44px; width: 44px; min-height: 44px; margin-inline-start: 2px; padding: 4px 6px; border: 0; background: none; color: #626B78; font-size: 14px; line-height: 1; cursor: pointer; }

    /* Keep the scroll-to-top button out of the way while the tooltip shows */
    body.tools-tip-open .scroll-top-button { visibility: hidden; opacity: 0; pointer-events: none; }

    .mobile-tools-bar.is-tools-open { z-index: 122; }
    .tools-fab__coin span { max-width: none; white-space: normal; text-overflow: clip; }
    .tools-fab__face svg { flex: none; }
    .mobile-tools-bar .tools-fab:focus-visible { outline: 2px solid var(--gold-dark); outline-offset: 2px; }
    .mobile-tools-bar .tools-fab:is(.is-active, [aria-expanded="true"]) .tools-fab__face { box-shadow: inset 0 0 0 2px #A87A0A, inset 0 -3px 6px rgba(184,134,11,.18); }
    .tools-tip[hidden] { display: none; }
    .tools-tip__link { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 44px; color: inherit; text-decoration: none; }
    .tools-tip__link > span:last-child { min-width: 0; }
    .tools-tip__link:focus-visible, .tools-tip__close:focus-visible { outline: 2px solid var(--gold-dark); outline-offset: 2px; border-radius: 8px; }
    html[data-theme="night"] .tools-fab .tools-fab__label { color: var(--gold-light); }
    html[data-theme="night"] .tools-fab__face { background: radial-gradient(circle at 40% 30%,#42371D,#302B20 65%,#252116); color: #F3D98B; }
    html[data-theme="night"] .tools-fab__badge { border-color: #252116; }
    html[data-theme="night"] .mobile-tools-bar .tools-fab:focus-visible { outline-color: var(--gold-light); }
    html[data-theme="night"] .tools-tip { background: #202737; border-color: rgba(212,175,55,.4); box-shadow: 0 10px 24px rgba(0,0,0,.35); }
    html[data-theme="night"] .tools-tip::after { background: #202737; }
    html[data-theme="night"] .tools-tip__title { color: #F7F2E6; }
    html[data-theme="night"] :is(.tools-tip__sub,.tools-tip__close) { color: #BBC3D1; }
    html[data-theme="night"] :is(.tools-tip__link,.tools-tip__close):focus-visible { outline-color: var(--gold-light); }
    @media (prefers-reduced-motion: reduce) {
        .mobile-tools-bar .tools-fab.is-playing * { animation: none; }
        .mobile-tools-bar .tools-fab,
        .mobile-tools-bar .tools-fab * { transition: none; }
        .mobile-tools-bar .tools-fab:active { transform: none; }
        .tools-tip { transition: none; transform: translateX(-50%); }
    }

}
