/* Universal Box-Sizing Reset for Tailwind & DaisyUI component consistency */
*, ::before, ::after {
  box-sizing: border-box;
}

input, select, textarea, button, .input, .select {
  box-sizing: border-box;
}

/* Responsive utility support for compiled Tailwind */
@media (min-width: 640px) {
  .sm\:w-64 { width: 16rem !important; }
  .sm\:w-72 { width: 18rem !important; }
  .sm\:w-80 { width: 20rem !important; }
}

/* Phones were at 14px, so every rem size (text-xs = 10.5px) was smaller than on desktop; 15px keeps layouts close
   while lifting text-xs to ~11px. Inputs are pinned to 16px separately (mobile fixes block at the end). */
html {
  font-size: 15px;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.no-min-width {
min-width:auto !important;
}

html {
  position: relative;
  min-height: 100%;
  /* Always reserve scrollbar space so it never shifts the layout left/right */
  overflow-y: scroll;
  /* Prevent any overflow from causing horizontal wiggle */
  overflow-x: clip;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Clamp body so nothing overflows horizontally */
  overflow-x: clip;
  max-width: 100vw;
}

h1, h2, h3, h4, h5, h6, .btn, .navbar, .badge {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.chat-chat {
min-height:500px;

}

.chat-other-header-name {
    margin-left: 2em;
}

.Card-Header {
    margin-bottom: -15px;
}

input {
/*background : transparent !important;*/
}



.paper {
    position: relative;
    width: 100%;
    min-width: 400px;
    height: 480px;
    margin: 0 auto;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
    overflow: hidden;
}

/*
    Add side of page effect 
    
    .paper:before {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        width: 60px;
        background: radial-gradient(#575450 6px, transparent 7px) repeat-y;
        background-size: 30px 30px;
        border-right: 3px solid #D44147;
        box-sizing: border-box;

    }*/

.paper-content {
    position: absolute;
    top: 30px;
    right: 0;
    bottom: 30px;
    left: 60px;
    background: linear-gradient(transparent, transparent 28px, #91D1D3 28px);
    background-size: 30px 30px;
}

    .paper-content textarea {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        line-height: 30px;
        padding: 0 10px;
        border: 0;
        outline: 0;
        background: transparent;
        font-family: 'Handlee', cursive;
        font-weight: bold;
        font-size: 18px;
        box-sizing: border-box;
        z-index: 1;
    }

/* ==========================================================================
   Auto-Hiding Scrollbars Across Entire Site (Hidden When Not Focused/Hovered)
   ========================================================================== */
* {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    transition: scrollbar-color 0.3s ease;
}

*:hover,
*:focus,
*:focus-within {
    scrollbar-color: rgba(150, 150, 150, 0.45) transparent;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: transparent;
    border-radius: 9999px;
    transition: background-color 0.3s ease;
}

*:hover::-webkit-scrollbar-thumb,
*:focus::-webkit-scrollbar-thumb,
*:focus-within::-webkit-scrollbar-thumb,
body:hover::-webkit-scrollbar-thumb,
html:hover::-webkit-scrollbar-thumb {
    background-color: rgba(140, 140, 140, 0.4);
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(100, 100, 100, 0.7) !important;
}

.send-button-comment:hover {
    background-image: none !important;
background-color:skyblue !important;
}




.star-rating {
    border: solid 1px #ccc;
    display: flex;
    flex-direction: row-reverse;
    font-size: 1.5em;
    justify-content: space-around;
    padding: 0 .2em;
    text-align: center;
    width: 5em;
}

.star-rating-check {
    display: flex;
    flex-direction: row-reverse;
    font-size: 1.5em;
    justify-content: space-around;
    padding: 0 .2em;
    text-align: center;
    width: 5em;
}

    .star-rating input {
        display: none;
    }

.star-rating-check input {
    display: none;
}

.star-rating-check label {
    color: #ccc;
    cursor: pointer;
}

    .star-rating label {
        color: #ccc;
        cursor: pointer;
    }

    .star-rating :checked ~ label {
        color: #f90;
    }

    .star-rating-checked {
        color: #f90;
    }

    .star-rating label:hover,
    .star-rating label:hover ~ label {
        color: #fc0;
    }

.text-button {
    background: none;
    background-color: transparent !important;
    border: none;
}

.main-add-button {
    width: -webkit-fill-available;
    margin-bottom:1em !important;
}

.accordion-body ul {
    list-style: none;
    padding-left: 0em !important;
}

.accordion-body ul li{
    list-style: none;
    padding-left: 0em !important;
}

.accordion-item {
border:none !important;
}

.side-nav-bar {
    margin-top: -1em !important;
    background-color: inherit !important;
}

.side-nav-bar div{
    background-color: inherit !important;
}

.underline-input {
border-right:none;
border-left:none;
border-top:none;
}

/* Post & card base styles */
article.card {
    max-width: 100%;
}

/* Reset browser default figure margins (UA stylesheet adds 40px inline margins
   which shift post/card images right and cause them to overflow the card) */
figure {
    margin: 0;
}

#Side-Nav-Bar > * {
    position: relative;
    z-index: 1;

    background: inherit !important;
}

.DisplayOff > * {
    display:none !important;
}
.DisplayOn > * {
    display: block !important;
}

.upload-button {
border:none;
color:inherit;
display:none

}


@media (max-width: 991.98px) {
    .side-advert-display > * {
        display: none !important;
        width: 100%;
    }

    .mobile > * {
        display: block !important;
    }

    .web-display > * {
        display: none !important;
    }
}

@media (max-width: 1199.98px) {
    #right-side-advert > * {
        display: none !important;
    }
}

.container-div {
    position: relative;
    height: 200px;
}

#toggleDiv {
    display: none;
    position: absolute;
    top: 20px;
    left: 20px;
    width: 150px;
    padding: 20px;
    z-index: 10;
}

/* Responsive Side Navigation Overlay for Mobile */
@media (max-width: 991.98px) {
    .side-nav-bar {
        position: fixed !important;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 1050 !important;
        background-color: rgba(0, 0, 0, 0.5) !important;
        width: 100vw !important;
        height: 100vh !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    #Side-Nav-Bar {
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px !important;
        height: 100vh !important;
        overflow-y: auto !important;
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.25);
    }
}

/* Profile avatar border cosmetics live further down, under "Solid Profile Borders". */

/* ==========================================================================
   Wardrobe hub (Views/Wardrobe): Avatar · Style · Items
   Borders are written out in full here: Tailwind's preflight is off, so the
   `border` utility alone draws nothing.
   ========================================================================== */
.ws-hub { --ws-line: oklch(var(--b3)); --ws-top: 56px; }
/* The ws- rules below set display; Tailwind's .hidden must still win when a panel or chip row is switched off */
.ws-hub .hidden { display: none !important; }
body.nav-hidden .ws-hub { --ws-top: 0px; }

/* Section switcher + style chips stay reachable while scrolling long grids */
.ws-sticky {
    position: sticky;
    top: var(--ws-top);
    z-index: 30;
    margin: 0 -0.75rem;
    padding: 0.5rem 0.75rem;
    background: oklch(var(--b2) / 0.92);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: top 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
@media (min-width: 640px) { .ws-sticky { margin: 0; border-radius: 1rem; } }

.ws-seg {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 0.25rem;
    padding: 0.25rem;
    border-radius: 0.9rem;
    background: oklch(var(--b3) / 0.7);
}
.ws-seg button {
    min-height: 44px;
    border: 0;
    border-radius: 0.7rem;
    background: transparent;
    color: oklch(var(--bc) / 0.7);
    font-weight: 700;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.ws-seg button[aria-selected="true"] {
    background: oklch(var(--b1));
    color: oklch(var(--bc));
    box-shadow: 0 1px 3px rgb(0 0 0 / 0.15);
}
.ws-seg button[aria-selected="true"] i { color: oklch(var(--p)); }

/* Style categories: one row of chips that scrolls sideways on phones */
.ws-chips {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    margin-top: 0.5rem;
    padding-bottom: 0.125rem;
}
.ws-chips::-webkit-scrollbar { display: none; }
.ws-chips button {
    flex: 0 0 auto;
    scroll-snap-align: start;
    min-height: 40px;
    padding: 0 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--ws-line);
    background: oklch(var(--b1));
    color: oklch(var(--bc) / 0.8);
    font-size: 0.8125rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}
.ws-chips button[aria-selected="true"] {
    background: oklch(var(--p));
    border-color: oklch(var(--p));
    color: oklch(var(--pc));
}
.ws-chips .ws-count { font-size: 0.6875rem; opacity: 0.7; font-weight: 700; }

.ws-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin: 0.25rem 0 0.75rem; }
.ws-panel-head p { font-size: 0.75rem; color: oklch(var(--bc) / 0.65); margin: 0; }

/* Tile grids: 3 across on a phone, more as the screen grows */
.ws-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 0.625rem; }
.ws-grid--wide { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

.ws-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.5rem;
    border-radius: 1rem;
    border: 2px solid var(--ws-line);
    background: oklch(var(--b1));
    cursor: pointer;
    min-height: 44px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.ws-tile:active { transform: scale(0.97); }
.ws-tile > input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.ws-tile:has(input:checked) {
    border-color: oklch(var(--p));
    box-shadow: 0 0 0 3px oklch(var(--p) / 0.22);
    background: oklch(var(--p) / 0.06);
}
.ws-tile:has(input:focus-visible) { outline: 2px solid oklch(var(--p)); outline-offset: 2px; }
.ws-check {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    z-index: 20;
    width: 1.375rem;
    height: 1.375rem;
    border-radius: 999px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    background: oklch(var(--p));
    color: oklch(var(--pc));
    box-shadow: 0 1px 3px rgb(0 0 0 / 0.3);
}
.ws-tile:has(input:checked) .ws-check { display: flex; }
.ws-name {
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ws-tile--row { flex-direction: row; align-items: center; text-align: left; gap: 0.75rem; padding: 0.625rem 0.75rem; }
.ws-tile--row .ws-name { text-align: left; }
.ws-anim {
    position: absolute;
    top: 0.35rem;
    left: 0.35rem;
    z-index: 20;
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    background: oklch(var(--wa));
    color: oklch(var(--wac));
}

/* Tile visuals */
.ws-theme-swatch {
    height: 3.5rem;
    border-radius: 0.7rem;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr auto;
    background: oklch(var(--b1));
    color: oklch(var(--bc));
    box-shadow: inset 0 0 0 1px oklch(var(--bc) / 0.12);
}
.ws-theme-swatch > span:nth-child(1) { background: oklch(var(--p)); }
.ws-theme-swatch > span:nth-child(2) { background: oklch(var(--s)); }
.ws-theme-swatch > span:nth-child(3) { background: oklch(var(--a)); }
.ws-theme-swatch > b { grid-column: 1 / -1; font-size: 0.7rem; padding: 0.15rem 0.4rem; }

.ws-ring { width: 3.75rem; height: 3.75rem; border-radius: 999px; margin: 0.25rem auto 0; flex-shrink: 0; }
.ws-ring > img { width: 100%; height: 100%; border-radius: 999px; object-fit: cover; display: block; background: oklch(var(--b2)); }
.ws-ring--plain { box-shadow: 0 0 0 3px oklch(var(--b1)), 0 0 0 4px var(--ws-line); }

.ws-swatch { height: 3.5rem; border-radius: 0.7rem; box-shadow: inset 0 0 0 1px oklch(var(--bc) / 0.12); }
.ws-banner { height: 3.5rem; border-radius: 0.7rem; overflow: hidden; background: oklch(var(--b2)); display: flex; align-items: center; justify-content: center; color: oklch(var(--bc) / 0.4); }
/* Banner art sits on the right with a dark fade on the left, like post headers show it */
.ws-banner > img { width: 100%; height: 100%; object-fit: cover; object-position: right center; display: block; }
.ws-font-sample { font-size: 1.5rem; line-height: 1.15; text-align: center; padding: 0.35rem 0.25rem; border-radius: 0.6rem; background: oklch(var(--b2) / 0.6); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.ws-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    padding: 0.75rem 0.875rem;
    border-radius: 1rem;
    border: 1px solid var(--ws-line);
    background: oklch(var(--b1));
}

/* Save status pill: shows each background save without a page reload */
.ws-status {
    position: fixed;
    left: 50%;
    bottom: calc(5rem + env(safe-area-inset-bottom));
    transform: translate(-50%, 1rem);
    z-index: 9998;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    background: oklch(var(--n));
    color: oklch(var(--nc));
    box-shadow: 0 6px 20px rgb(0 0 0 / 0.25);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.ws-status.is-on { opacity: 1; transform: translate(-50%, 0); }
.ws-status.is-error { background: oklch(var(--er)); color: oklch(var(--erc)); }
@media (min-width: 1024px) { .ws-status { bottom: 1.5rem; } }

/* Avatar: Save/Undo ride along the bottom of the screen while you browse tiles */
.ws-savebar {
    position: sticky;
    bottom: calc(4.75rem + env(safe-area-inset-bottom));
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
    padding: 0.5rem;
    border-radius: 1rem;
    background: oklch(var(--b1) / 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 6px 24px rgb(0 0 0 / 0.18);
    border: 1px solid var(--ws-line);
}
@media (min-width: 1024px) { .ws-savebar { bottom: 1rem; } }
/* Only there when there's something to save (avatar-wardrobe.js disables Save when the look is unchanged) */
.ws-savebar:has(#wardrobe-save:disabled) { display: none; }

/* Items: packs and boosters */
.ws-item {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 1rem;
    border: 2px solid var(--ws-line);
    background: oklch(var(--b1));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.4rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.1s ease;
}
.ws-item:active { transform: scale(0.96); }
.ws-item .ws-qty {
    position: absolute;
    bottom: 0.3rem;
    right: 0.3rem;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.05rem 0.35rem;
    border-radius: 0.4rem;
    background: oklch(var(--n));
    color: oklch(var(--nc));
}
.ws-item.rarity-common { border-color: #22c55e; }
.ws-item.rarity-uncommon { border-color: #38bdf8; }
.ws-item.rarity-rare { border-color: #3b82f6; }
.ws-item.rarity-epic { border-color: #a855f7; }
.ws-item.rarity-legendary { border-color: #f59e0b; box-shadow: inset 0 0 10px rgba(245, 158, 11, 0.2); }
.ws-item.rarity-bronze { border-color: #cd7f32; box-shadow: inset 0 0 8px rgba(205, 127, 50, 0.35); }
.ws-item.rarity-silver { border-color: #94a3b8; box-shadow: inset 0 0 8px rgba(148, 163, 184, 0.35); }
.ws-item.rarity-gold { border-color: #eab308; box-shadow: inset 0 0 10px rgba(234, 179, 8, 0.45); }
.ws-item.rarity-platinum { border-color: #a855f7; box-shadow: inset 0 0 12px rgba(168, 85, 247, 0.5); }

.ws-card {
    border-radius: 1.25rem;
    border: 1px solid var(--ws-line);
    background: oklch(var(--b1));
    padding: 0.875rem;
}
.ws-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.ws-quick a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 48px;
    padding: 0.5rem 0.75rem;
    border-radius: 0.9rem;
    border: 1px solid var(--ws-line);
    background: oklch(var(--b1));
    color: oklch(var(--bc));
    font-weight: 600;
    font-size: 0.8125rem;
    text-decoration: none;
}
.ws-quick a:hover { border-color: oklch(var(--p) / 0.5); text-decoration: none; }

/* ==========================================================================
   Post Card Custom & Animated Borders
   ========================================================================== */
.post-border-default {
    border: 1px solid oklch(var(--b3, 0.86 0 0));
}

.post-border-glow {
    border: 2px solid var(--post-border-color, #00ffd5) !important;
    box-shadow: 0 0 16px -2px var(--post-border-color, #00ffd5), inset 0 0 8px -4px var(--post-border-color, #00ffd5) !important;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.post-border-glow:hover {
    box-shadow: 0 0 24px 0px var(--post-border-color, #00ffd5), inset 0 0 12px -2px var(--post-border-color, #00ffd5) !important;
}

/* Animated post borders. The border and a base glow are painted once; only the ::after glow layer
   animates, and only its opacity, so the compositor runs it without repainting the post on every frame
   (animating box-shadow / background-position on dozens of feed cards made scrolling stutter). */
.post-border-pulse,
.post-border-rainbow,
.post-border-flame,
.post-border-cyber {
    position: relative;
}

.post-border-pulse::after,
.post-border-rainbow::after,
.post-border-flame::after,
.post-border-cyber::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    z-index: 1;
    will-change: opacity;
    animation: postGlowPulse 2.4s ease-in-out infinite alternate;
}

@keyframes postGlowPulse {
    from { opacity: 0; }
    to { opacity: 1; }
}

.post-border-pulse {
    border: 2px solid var(--post-border-color, #00ffd5) !important;
    box-shadow: 0 0 10px -2px var(--post-border-color, #00ffd5), 0 0 2px var(--post-border-color, #00ffd5) !important;
}

.post-border-pulse::after {
    box-shadow: inset 0 0 18px 2px var(--post-border-color, #00ffd5);
}

.post-border-rainbow {
    border: 3px solid transparent !important;
    background-image: linear-gradient(var(--fallback-b1, oklch(var(--b1)/1)), var(--fallback-b1, oklch(var(--b1)/1))),
                      linear-gradient(135deg, #ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8, #ff0000) !important;
    background-origin: border-box !important;
    background-clip: padding-box, border-box !important;
    box-shadow: 0 0 14px rgba(0, 255, 213, 0.45) !important;
}

.post-border-rainbow::after {
    box-shadow: inset 0 0 18px rgba(255, 0, 200, 0.55);
    animation-duration: 2.5s;
}

.post-border-flame {
    border: 3px solid transparent !important;
    background-image: linear-gradient(var(--fallback-b1, oklch(var(--b1)/1)), var(--fallback-b1, oklch(var(--b1)/1))),
                      linear-gradient(135deg, #ef4444, #f97316, #eab308, #ff2200) !important;
    background-origin: border-box !important;
    background-clip: padding-box, border-box !important;
    box-shadow: 0 0 18px rgba(249, 115, 22, 0.7) !important;
}

.post-border-flame::after {
    box-shadow: inset 0 0 20px rgba(249, 115, 22, 0.75), inset 0 0 6px rgba(234, 179, 8, 0.7);
    animation-duration: 2s;
}

.post-border-cyber {
    border: 2px solid var(--post-border-color, #06b6d4) !important;
    box-shadow: 0 0 15px var(--post-border-color, #06b6d4), inset 0 0 10px rgba(6, 182, 212, 0.15) !important;
}

.post-border-cyber::after {
    box-shadow: inset 0 0 22px var(--post-border-color, #06b6d4), inset 0 0 40px rgba(122, 0, 255, 0.3);
    animation-duration: 3s;
}

/* ==========================================================================
   Side Adverts Layout
   ========================================================================== */
.side-advert-display {
    max-width: 100%;
    overflow: hidden;
}

/* ==========================================================================
   Quests & Daily Limit Floating Widget
   ========================================================================== */
.quest-floating-widget {
    position: fixed;
    top: 72px;
    right: 16px;
    width: 300px;
    max-width: calc(100vw - 24px);
    z-index: 30;
    pointer-events: none; /* Allows clicks to pass through to underlying content outside card */
    transition: transform 0.25s ease, box-shadow 0.25s ease, width 0.25s ease, top 0.25s ease, opacity 0.25s ease;
}

.quest-floating-widget > .card {
    pointer-events: auto; /* Re-enable clicks inside the card */
}

.quest-floating-widget #qw-body {
    max-height: min(520px, calc(100vh - 130px));
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.quest-floating-widget #qw-body > * {
    flex-shrink: 0 !important;
}

#qw-free-pack-section {
    flex-shrink: 0 !important;
    min-height: fit-content !important;
}

.quest-floating-widget #qw-body::-webkit-scrollbar {
    width: 5px;
}

.quest-floating-widget #qw-body::-webkit-scrollbar-track {
    background: transparent;
}

.quest-floating-widget #qw-body::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.35);
    border-radius: 9999px;
}

.quest-floating-widget #qw-body::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.65);
}

/* Transform/opacity only, so the pack floats on the compositor instead of repainting every frame */
@keyframes qwFloatPack {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-8px) rotate(-1.5deg); }
}

@keyframes qwPulseRing {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
    50% { transform: translate(-50%, -50%) scale(1.08); opacity: 1; }
}

.qw-floating-pack {
    animation: qwFloatPack 2.4s ease-in-out infinite;
    will-change: transform;
}

.qw-modal-glow-ring {
    transform: translate(-50%, -50%);
    animation: qwPulseRing 2.4s ease-in-out infinite;
}

.qw-modal-glow {
    background:
        radial-gradient(18rem 14rem at 50% -10%, rgba(245, 158, 11, 0.28), transparent 70%),
        radial-gradient(16rem 12rem at 50% 110%, oklch(var(--p) / 0.22), transparent 70%);
}

@media (prefers-reduced-motion: reduce) {
    .qw-floating-pack, .qw-modal-glow-ring { animation: none; }
}

/* Free Pack modal: centred in the visible viewport on every screen. Preflight is off, so the UA <dialog>
   margin/padding/max-size defaults still apply, and 100vh in a mobile WebView is taller than what is
   visible (bars + bottom nav), which pushed the box below centre. Size the dialog to the dynamic
   viewport explicitly and centre with grid. */
dialog#qw-free-pack-modal {
    position: fixed;
    inset: 0;
    width: 100vw;
    width: 100dvw;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
    border: 0;
    box-sizing: border-box;
    display: grid;
    place-items: center;
    background: rgba(5, 4, 10, 0.72);
}

dialog#qw-free-pack-modal:not([open]) {
    display: none;
}

#qw-free-pack-modal .modal-box {
    margin: 0 !important;
    justify-self: center;
    align-self: center;
    width: 100%;
    max-width: min(440px, calc(100vw - 24px));
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
}

dialog#qw-free-pack-modal:modal {
    overscroll-behavior: contain;
}

dialog#qw-free-pack-modal::backdrop {
    background: transparent;
    overflow: hidden;
    overscroll-behavior: contain;
}

/* Offset quest widget cleanly below the sticky check-in banner so it never blocks venue controls */
body.has-active-checkin .quest-floating-widget,
body:has(#active-checkin-banner) .quest-floating-widget,
body:has(#download-apk-banner) .quest-floating-widget {
    top: 116px;
}

.quest-floating-widget.qw-collapsed {
    width: auto;
}

.quest-floating-widget.qw-collapsed .card {
    border-radius: 9999px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.quest-floating-widget.qw-collapsed #qw-header {
    border-bottom: none !important;
    padding: 6px 14px;
    border-radius: 9999px;
}

@media (max-width: 768px) {
    .quest-floating-widget {
        top: 68px;
        right: 10px;
        width: 260px;
        max-width: calc(100vw - 20px);
    }

    body.has-active-checkin .quest-floating-widget,
    body:has(#active-checkin-banner) .quest-floating-widget,
    body:has(#download-apk-banner) .quest-floating-widget {
        top: 112px;
    }

    .quest-floating-widget.qw-collapsed {
        left: auto !important;
        right: 10px !important;
        width: auto !important;
        /* Was 48vw: with the Free Pack badge the pill needs ~200px, so the badge wrapped under the bar and the chevron was clipped */
        max-width: calc(100vw - 20px) !important;
    }

    .quest-floating-widget.qw-collapsed #qw-header {
        padding: 5px 10px !important;
        gap: 6px;
        flex-wrap: nowrap;
        white-space: nowrap;
    }

    /* Collapsed on phones the Free Pack badge is a gift-icon chip (title + bounce still flag it) */
    .quest-floating-widget.qw-collapsed .qw-free-pack-label { display: none; }
    .quest-floating-widget.qw-collapsed #qw-header-free-pack-badge { padding: 0 6px; height: 18px; }

    /* The whole pill toggles, so its chevron doesn't need the 32px touch minimum */
    .quest-floating-widget.qw-collapsed #qw-toggle-btn { min-height: 24px; min-width: 24px; width: 24px; height: 24px; }

    .quest-floating-widget.qw-collapsed #qw-header .w-20 {
        width: 2.75rem !important; /* Compact progress bar on mobile (44px) so it never encroaches into page headers or controls */
    }

    .quest-floating-widget:not(.qw-collapsed) {
        left: 10px;
        right: 10px;
        margin-left: auto;
        margin-right: auto;
        width: calc(100vw - 20px);
        max-width: 340px;
        z-index: 45;
    }

    .quest-floating-widget #qw-body {
        max-height: calc(100dvh - 120px);
        overflow-y: auto;
    }
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
#wsm-toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

#wsm-toast-container .toast-item {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#wsm-toast-container .toast-success {
    background-color: #059669 !important;
    color: #ffffff !important;
    border: 1px solid #10b981;
}

#wsm-toast-container .toast-error {
    background-color: #dc2626 !important;
    color: #ffffff !important;
    border: 1px solid #ef4444;
}

/* Poke toasts: who poked, the streak, and a Poke back button */
#wsm-toast-container .toast-poke {
    max-width: min(22rem, calc(100vw - 2rem));
    background: oklch(var(--n));
    color: oklch(var(--nc));
    border: 1px solid oklch(var(--nc) / 0.12);
    opacity: 0;
    transform: translateY(16px) scale(0.98);
}
#wsm-toast-container .toast-poke.is-on { opacity: 1; transform: none; }
#wsm-toast-container .toast-poke--party { background: linear-gradient(120deg, #f97316, #db2777); color: #fff; animation: poke-party 0.6s ease 2; }
.toast-poke__icon { font-size: 1.4rem; line-height: 1; }
.toast-poke__text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.toast-poke__text small { font-weight: 500; opacity: 0.85; font-size: 0.75rem; margin-top: 0.1rem; }
.toast-poke__action {
    flex-shrink: 0;
    min-height: 36px;
    padding: 0 0.8rem;
    border: 0;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.8125rem;
    background: oklch(var(--wa, var(--p)));
    color: oklch(var(--wac, var(--pc)));
    cursor: pointer;
}
@keyframes poke-party { 50% { transform: scale(1.04); } }
@media (max-width: 639px) {
    #wsm-toast-container { left: 1rem; right: 1rem; bottom: calc(5rem + env(safe-area-inset-bottom)); align-items: center; }
}

/* Profile Poke button: streak chip, your 3 sounds and the streak status */
.poke-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
    background: #ef4444;
    color: #fff;
}
.poke-chip.hidden { display: none; }
.poke-widget[data-poke-state="your-move"] > label,
.poke-widget[data-poke-state="at-risk"] > label { animation: poke-wiggle 1.6s ease-in-out infinite; }
.poke-widget.is-cooling > label { opacity: 0.75; }
@keyframes poke-wiggle {
    0%, 70%, 100% { transform: none; }
    76% { transform: rotate(-6deg); }
    82% { transform: rotate(6deg); }
    88% { transform: rotate(-4deg); }
}
@media (prefers-reduced-motion: reduce) {
    .poke-widget > label, #wsm-toast-container .toast-poke--party { animation: none !important; }
}
.poke-menu {
    width: min(16rem, calc(100vw - 1rem));
    margin-top: 0.4rem;
    padding: 0.75rem;
    border-radius: 1rem;
    background: oklch(var(--b1));
    color: oklch(var(--bc));
    box-shadow: 0 0 0 1px oklch(var(--bc) / 0.1), 0 12px 30px rgb(0 0 0 / 0.25);
}
.poke-menu__status { margin: 0 0 0.6rem; font-size: 0.8125rem; font-weight: 600; line-height: 1.35; }
.poke-menu__sounds { display: grid; gap: 0.4rem; }
.poke-menu__sound {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 44px;
    padding: 0 0.75rem;
    border: 1px solid oklch(var(--bc) / 0.12);
    border-radius: 0.75rem;
    background: oklch(var(--b2));
    color: inherit;
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    text-align: left;
}
.poke-menu__sound i { width: 1.25rem; text-align: center; color: oklch(var(--wa, var(--p))); }
.poke-menu__sound:hover:not(:disabled) { border-color: oklch(var(--p)); background: oklch(var(--p) / 0.08); }
.poke-menu__sound:disabled { opacity: 0.5; cursor: not-allowed; }
.poke-menu__shop { display: block; margin-top: 0.6rem; font-size: 0.75rem; font-weight: 700; color: oklch(var(--p)); text-decoration: none; }
.poke-menu__shop:hover { text-decoration: underline; }
.poke-menu__best { margin: 0.4rem 0 0; font-size: 0.6875rem; color: oklch(var(--bc) / 0.6); }

/* Wardrobe → Sounds */
.ps-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.ps-slot {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    min-height: 5rem;
    padding: 0.6rem 0.35rem;
    border-radius: 1rem;
    border: 2px solid var(--ws-line, oklch(var(--bc) / 0.12));
    background: oklch(var(--b2));
    color: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.ps-slot > i { font-size: 1.35rem; color: oklch(var(--p)); }
.ps-slot[aria-checked="true"] { border-color: oklch(var(--p)); box-shadow: 0 0 0 3px oklch(var(--p) / 0.22); background: oklch(var(--p) / 0.06); }
.ps-slot:focus-visible { outline: 2px solid oklch(var(--p)); outline-offset: 2px; }
.ps-slot__num { position: absolute; top: 0.3rem; left: 0.45rem; font-size: 0.625rem; font-weight: 800; color: oklch(var(--bc) / 0.5); }
.ps-slot__name { font-size: 0.75rem; font-weight: 700; text-align: center; line-height: 1.2; }
.ps-balance { flex-shrink: 0; font-size: 0.8125rem; padding: 0.3rem 0.7rem; border-radius: 999px; background: oklch(var(--b3) / 0.7); }
.ps-balance i { color: #f59e0b; }
.ps-grid { display: grid; gap: 0.5rem; }
@media (min-width: 640px) { .ps-grid { grid-template-columns: 1fr 1fr; } }
.ps-card {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas: "play meta" "play action";
    column-gap: 0.75rem;
    row-gap: 0.4rem;
    align-items: center;
    padding: 0.65rem 0.75rem;
    border-radius: 1rem;
    border: 2px solid var(--ws-line, oklch(var(--bc) / 0.12));
    background: oklch(var(--b1));
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ps-card.is-equipped { border-color: oklch(var(--p) / 0.6); }
.ps-card.is-new { box-shadow: 0 0 0 4px oklch(var(--su) / 0.4); }
.ps-play {
    grid-area: play;
    position: relative;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 999px;
    border: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #fff;
    background: var(--ps-tone, #64748b);
    cursor: pointer;
}
.ps-play__hint {
    position: absolute;
    right: -0.15rem;
    bottom: -0.15rem;
    width: 1.3rem;
    height: 1.3rem;
    border-radius: 999px;
    font-size: 0.55rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: oklch(var(--b1));
    color: oklch(var(--bc));
    box-shadow: 0 1px 3px rgb(0 0 0 / 0.3);
}
.ps-card.is-playing .ps-play { animation: ps-pulse 0.6s ease; }
@keyframes ps-pulse { 0% { box-shadow: 0 0 0 0 var(--ps-tone); } 100% { box-shadow: 0 0 0 14px transparent; } }
.ps-meta { grid-area: meta; min-width: 0; }
.ps-meta__top { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; font-size: 0.875rem; }
.ps-meta p { margin: 0.1rem 0 0; font-size: 0.75rem; color: oklch(var(--bc) / 0.65); }
.ps-rarity { font-size: 0.625rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; padding: 0.05rem 0.4rem; border-radius: 999px; color: #fff; background: var(--ps-tone, #64748b); }
.ps-action { grid-area: action; display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.ps-action .btn { min-height: 2rem; height: 2rem; }
.ps-on { font-size: 0.75rem; font-weight: 700; color: oklch(var(--p)); }
.ps-need { font-size: 0.6875rem; color: oklch(var(--bc) / 0.55); }
.ps-card[data-ps-rarity="free"] { --ps-tone: #64748b; }
.ps-card[data-ps-rarity="common"] { --ps-tone: #0ea5e9; }
.ps-card[data-ps-rarity="rare"] { --ps-tone: #8b5cf6; }
.ps-card[data-ps-rarity="epic"] { --ps-tone: #db2777; }
.ps-card[data-ps-rarity="legendary"] { --ps-tone: #f59e0b; }
@media (prefers-reduced-motion: reduce) { .ps-card.is-playing .ps-play { animation: none; } }

/* ==========================================================================
   Auth Flow – Cannabis Floating Leaves
   ========================================================================== */
.leaf-float {
    position: absolute;
    font-size: 1.5rem;
    opacity: 0.18;
    animation: leaf-drift var(--dur, 7s) ease-in-out infinite;
    animation-delay: var(--delay, 0s);
    pointer-events: none;
    user-select: none;
}

@keyframes leaf-drift {
    0%   { transform: translateY(0px)   rotate(0deg)   scale(1);    opacity: 0.18; }
    33%  { transform: translateY(-18px) rotate(12deg)  scale(1.05); opacity: 0.26; }
    66%  { transform: translateY(8px)   rotate(-8deg)  scale(0.97); opacity: 0.20; }
    100% { transform: translateY(0px)   rotate(0deg)   scale(1);    opacity: 0.18; }
}

/* ==========================================================================
   Auth Flow – Fake Avatar Loader Overlay
   ========================================================================== */
#avatar-loader-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    backdrop-filter: blur(8px) saturate(1.5);
    background: rgba(0,0,0,0.55);
}

#avatar-loader-overlay.active { display: flex; }

.fake-avatar-ring {
    width: 100px; height: 100px; border-radius: 50%;
    background: linear-gradient(135deg, #ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8, #ff0000);
    background-size: 300% 300%;
    animation: loader-ring-shift 2s linear infinite;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 32px rgba(0,255,213,0.5);
}

@keyframes loader-ring-shift {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

.fake-avatar-inner {
    width: 88px; height: 88px; border-radius: 50%;
    background: #1a1a2e;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem;
    animation: avatar-morph 3s ease-in-out infinite;
}

@keyframes avatar-morph {
    0%, 100% { filter: hue-rotate(0deg) brightness(1); }
    50%       { filter: hue-rotate(180deg) brightness(1.2); }
}

.loader-caption {
    color: #fff; font-size: 0.95rem; font-weight: 600;
    letter-spacing: 0.03em; text-align: center;
    animation: caption-fade 0.5s ease-in-out;
}

@keyframes caption-fade {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Auth Flow – Multi-Step Wizard
   ========================================================================== */
.step-panel { display: none; }
.step-panel.active { display: block !important; animation: step-in 0.4s cubic-bezier(0.34,1.56,0.64,1) both; }

@keyframes step-in {
    from { opacity: 0; transform: translateX(30px) scale(0.97); }
    to   { opacity: 1; transform: translateX(0)    scale(1); }
}

.step-indicator { transition: all 0.3s ease; }
.step-indicator.done    { background: oklch(var(--p)) !important; color: oklch(var(--pc)) !important; border-color: oklch(var(--p)) !important; }
.step-indicator.current { box-shadow: 0 0 0 4px oklch(var(--p) / 0.25); }

/* ==========================================================================
   Auth Flow – Skill Tree
   ========================================================================== */
.skill-node { transition: transform 0.25s ease, filter 0.25s ease; }
.skill-node.unlocked { animation: node-pulse 2.5s ease-in-out infinite; filter: drop-shadow(0 0 8px oklch(var(--p) / 0.7)); }

@keyframes node-pulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.08); }
}

/* ==========================================================================
   Auth Flow – Drag & Drop Inventory
   ========================================================================== */
.drag-item { cursor: grab; transition: transform 0.2s ease, box-shadow 0.2s ease; user-select: none; }
.drag-item:active { cursor: grabbing; transform: scale(1.12) rotate(6deg); box-shadow: 0 8px 20px rgba(0,0,0,0.3); }

.drop-zone { transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease; border: 2px dashed oklch(var(--bc) / 0.3); border-radius: 1rem; }
.drop-zone.drag-over { border-color: oklch(var(--p)); background: oklch(var(--p) / 0.08); transform: scale(1.03); }
.drop-zone.filled { border-style: solid; border-color: oklch(var(--p)); background: oklch(var(--p) / 0.12); animation: drop-bounce 0.4s cubic-bezier(0.34,1.56,0.64,1); }

@keyframes drop-bounce {
    from { transform: scale(0.85); }
    to   { transform: scale(1); }
}

/* ==========================================================================
   Login – Feature Slideshow
   ========================================================================== */
[data-theme="emerald"] .bg-emerald-login {
    background-color: #66cc99 !important;
    background-image: linear-gradient(145deg, #78c2ad 0%, #56cc9d 60%, #40b584 100%) !important;
    color: #ffffff !important;
}

[data-theme="coffee"] .bg-emerald-login {
    background-color: #231812 !important;
    background-image: linear-gradient(145deg, #382317 0%, #231812 60%, #150d08 100%) !important;
    color: #fde68a !important;
}

.auth-slide { display: none; animation: slide-fade 0.5s ease both; }
.auth-slide.active { display: flex; }

@keyframes slide-fade {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.slide-dot { width: 8px; height: 8px; border-radius: 50%; background: oklch(var(--pc) / 0.4); transition: background 0.3s ease, transform 0.3s ease; cursor: pointer; }
.slide-dot.active { background: oklch(var(--pc)); transform: scale(1.35); }

/* ==========================================================================
   Avatar borders
   One contract for every border: an element carrying a border class wraps the avatar <img>.
   - Padding is the ring thickness (--avatar-ring, picked per avatar size just below).
   - Static rings paint the wrapper background. Animated rings paint ::before, hollowed out by a mask,
     so no animation ever filters, scales or recolours the photo.
   - Animations only move transform/opacity, accents are inline SVG (no emoji), and sizes are multiples
     of the ring or percentages, so one definition works from a chat avatar to a profile photo.
   - Class names are stored on accounts, so keep them. Catalog flags live in Constants/Borders.cs and
     DefaultCustomisationTests checks them against this file.
   ========================================================================== */
:is(.w-5, .w-6, .w-7, .w-8, .w-9) { --avatar-ring: 2px; }
:is(.w-10, .w-11, .w-12) { --avatar-ring: 2.5px; }
:is(.w-14, .w-16, .w-20, .w-24) { --avatar-ring: 3.5px; }
:is(.w-28, .w-32, .w-36, .w-40) { --avatar-ring: 4.5px; }
.ws-ring { --avatar-ring: 4px; }

/* Shared by every border */
:is(.border-default, .profile-border-green, .profile-border-red, .profile-border-blue, .profile-border-purple,
    .border-solid-gold, .border-solid-cyan, .border-solid-orange, .border-solid-pink, .border-solid-white, .border-solid-black,
    .border-grad-sunset, .border-grad-cosmic, .border-grad-ocean, .border-grad-emerald, .border-grad-gold,
    .border-grad-berry, .border-grad-aurora, .border-grad-monolith,
    .border-gold-glow, .border-neon-cyan, .border-glow-crimson, .border-glow-acid, .border-glow-plasma,
    .border-glow-solar, .border-glow-frost,
    .profile-border-animated-1, .border-flame, .border-anim-pulse, .border-anim-vortex, .border-anim-matrix,
    .border-anim-sparkle, .border-diamond-shimmer, .border-goat-aura, .border-dragon-orbit, .border-peekaboo-pet) {
    --_pad: calc(var(--avatar-ring, 3px) * var(--ring-k, 1));
    padding: var(--_pad) !important;
    border: 0 !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    justify-content: center !important;
    align-items: center !important;
    background: var(--ring-bg, #94a3b8) !important;
    box-shadow: 0 0 calc(var(--_pad) * 3.5) calc(var(--_pad) * 0.4) var(--ring-glow, transparent) !important;
}

/* Keep the photo round and above every ring layer */
:is(.border-default, .profile-border-green, .profile-border-red, .profile-border-blue, .profile-border-purple,
    .border-solid-gold, .border-solid-cyan, .border-solid-orange, .border-solid-pink, .border-solid-white, .border-solid-black,
    .border-grad-sunset, .border-grad-cosmic, .border-grad-ocean, .border-grad-emerald, .border-grad-gold,
    .border-grad-berry, .border-grad-aurora, .border-grad-monolith,
    .border-gold-glow, .border-neon-cyan, .border-glow-crimson, .border-glow-acid, .border-glow-plasma,
    .border-glow-solar, .border-glow-frost,
    .profile-border-animated-1, .border-flame, .border-anim-pulse, .border-anim-vortex, .border-anim-matrix,
    .border-anim-sparkle, .border-diamond-shimmer, .border-goat-aura, .border-dragon-orbit, .border-peekaboo-pet) img {
    border-radius: 50% !important;
    object-fit: cover !important;
    position: relative !important;
    z-index: 1 !important;
}

/* ── 1. Solid ────────────────────────────────────────────────────────── */
.border-default { --ring-bg: #94a3b8; --ring-k: 0.75; }
.profile-border-green { --ring-bg: #10b981; }
.profile-border-red { --ring-bg: #ef4444; }
.profile-border-blue { --ring-bg: #3b82f6; }
.profile-border-purple { --ring-bg: #8b5cf6; }
.border-solid-gold { --ring-bg: #f59e0b; }
.border-solid-cyan { --ring-bg: #06b6d4; }
.border-solid-orange { --ring-bg: #f97316; }
.border-solid-pink { --ring-bg: #ec4899; }
.border-solid-white { --ring-bg: #ffffff; --ring-glow: rgba(0, 0, 0, 0.28); }
.border-solid-black { --ring-bg: #18181b; }

/* ── 2. Gradient: conic, so the colour travels around the ring ───────── */
.border-grad-sunset { --ring-bg: conic-gradient(from 200deg, #f43f5e, #fb923c, #fbbf24, #fb923c, #f43f5e); }
.border-grad-cosmic { --ring-bg: conic-gradient(from 30deg, #8b5cf6, #ec4899, #3b82f6, #8b5cf6); }
.border-grad-ocean { --ring-bg: conic-gradient(from 160deg, #22d3ee, #3b82f6, #1d4ed8, #3b82f6, #22d3ee); }
.border-grad-emerald { --ring-bg: conic-gradient(from 90deg, #10b981, #06b6d4, #84cc16, #10b981); }
.border-grad-gold { --ring-bg: conic-gradient(from 45deg, #fde68a, #d97706, #92400e, #f59e0b, #fde68a); }
.border-grad-berry { --ring-bg: conic-gradient(from 300deg, #ec4899, #a855f7, #6366f1, #ec4899); }
.border-grad-aurora { --ring-bg: conic-gradient(from 120deg, #00f5d4, #7b2cbf, #ff007f, #00f5d4); }
.border-grad-monolith { --ring-bg: conic-gradient(from 20deg, #94a3b8, #1e293b, #0f172a, #475569, #94a3b8); }

/* ── 3. Glow: a still ring with a soft, size-aware halo ──────────────── */
.border-gold-glow { --ring-bg: conic-gradient(#ffd700, #ffb700, #fff275, #d4af37, #ffd700); --ring-glow: rgba(255, 200, 0, 0.75); }
.border-neon-cyan { --ring-bg: #00f0ff; --ring-glow: rgba(0, 240, 255, 0.8); }
.border-glow-crimson { --ring-bg: #ef4444; --ring-glow: rgba(239, 68, 68, 0.8); }
.border-glow-acid { --ring-bg: #22c55e; --ring-glow: rgba(132, 204, 22, 0.8); }
.border-glow-plasma { --ring-bg: #a855f7; --ring-glow: rgba(192, 132, 252, 0.8); }
.border-glow-solar { --ring-bg: #f59e0b; --ring-glow: rgba(251, 146, 60, 0.8); }
.border-glow-frost { --ring-bg: #bae6fd; --ring-glow: rgba(56, 189, 248, 0.8); }

/* ── 4. Animated: the ring is ::before (masked), the photo is never touched ── */
:is(.profile-border-animated-1, .border-flame, .border-anim-pulse, .border-anim-vortex, .border-anim-matrix,
    .border-anim-sparkle, .border-diamond-shimmer, .border-goat-aura, .border-dragon-orbit) {
    background: transparent !important;
    isolation: isolate;
    --ring-mask: radial-gradient(circle farthest-side, transparent calc(100% - var(--_pad) - 0.5px), #000 calc(100% - var(--_pad)));
}
:where(.profile-border-animated-1, .border-flame, .border-anim-pulse, .border-anim-vortex, .border-anim-matrix,
       .border-anim-sparkle, .border-diamond-shimmer, .border-goat-aura, .border-dragon-orbit, .border-peekaboo-pet) {
    position: relative;
}
:is(.profile-border-animated-1, .border-flame, .border-anim-pulse, .border-anim-vortex, .border-anim-matrix,
    .border-anim-sparkle, .border-diamond-shimmer, .border-goat-aura, .border-dragon-orbit)::before,
:is(.profile-border-animated-1, .border-flame, .border-anim-pulse, .border-anim-vortex, .border-anim-matrix,
    .border-anim-sparkle, .border-diamond-shimmer, .border-goat-aura, .border-dragon-orbit)::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    pointer-events: none;
}
:is(.profile-border-animated-1, .border-flame, .border-anim-pulse, .border-anim-vortex, .border-anim-matrix,
    .border-anim-sparkle, .border-diamond-shimmer, .border-goat-aura, .border-dragon-orbit)::before {
    z-index: -1;
    background: var(--ring-bg);
    -webkit-mask: var(--ring-mask);
    mask: var(--ring-mask);
}
:is(.profile-border-animated-1, .border-flame, .border-anim-pulse, .border-anim-vortex, .border-anim-matrix,
    .border-anim-sparkle, .border-diamond-shimmer, .border-goat-aura, .border-dragon-orbit)::after {
    z-index: -2;
}

@keyframes avatar-ring-spin { to { transform: rotate(1turn); } }
@keyframes avatar-ring-orbit { to { rotate: 1turn; } }
@keyframes avatar-ring-breathe {
    0%, 100% { transform: scale(1); opacity: 0.55; }
    50% { transform: scale(1.1); opacity: 1; }
}
@keyframes avatar-ring-flicker {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    18% { transform: scale(1.06); opacity: 1; }
    33% { transform: scale(1.01); opacity: 0.6; }
    52% { transform: scale(1.08); opacity: 0.95; }
    70% { transform: scale(1.02); opacity: 0.65; }
    86% { transform: scale(1.05); opacity: 1; }
}
/* Two beats, then a rest: lub-dub */
@keyframes avatar-ring-heartbeat {
    0% { transform: scale(1); opacity: 0.8; }
    24% { transform: scale(1.4); opacity: 0; }
    24.01%, 30% { transform: scale(1); opacity: 0; }
    31% { transform: scale(1); opacity: 0.7; }
    58%, 100% { transform: scale(1.45); opacity: 0; }
}
@keyframes avatar-ring-twinkle {
    0%, 100% { scale: 0.85; opacity: 0.55; }
    50% { scale: 1.08; opacity: 1; }
}

/* Chroma Spin: a full spectrum travelling around the ring, with a soft rotating halo */
.profile-border-animated-1 { --ring-bg: conic-gradient(#ff3b3b, #ff9f1a, #ffe14d, #3ddc84, #19d3ff, #4f6bff, #b44dff, #ff4fd8, #ff3b3b); }
.profile-border-animated-1::before { animation: avatar-ring-spin 4s linear infinite; }
.profile-border-animated-1::after {
    background: var(--ring-bg);
    filter: blur(calc(var(--_pad) * 1.5));
    opacity: 0.45;
    animation: avatar-ring-spin 4s linear infinite;
}

/* Ember Flicker: a slowly turning fire ring under an uneven, flickering glow */
.border-flame { --ring-bg: conic-gradient(from 30deg, #ff3d00, #ff9100, #ffd54a, #ff6d00, #e53900, #ff9100, #ff3d00); }
.border-flame::before { animation: avatar-ring-spin 7s linear infinite; }
.border-flame::after {
    box-shadow: 0 0 calc(var(--_pad) * 4) calc(var(--_pad) * 0.6) rgba(255, 98, 0, 0.85);
    animation: avatar-ring-flicker 1.4s ease-in-out infinite;
}

/* Heartbeat: a steady rose ring that sends out a double shock wave */
.border-anim-pulse { --ring-bg: linear-gradient(135deg, #f472b6, #ec4899, #db2777); --ring-glow: rgba(236, 72, 153, 0.45); }
.border-anim-pulse::after {
    z-index: -1;
    box-sizing: border-box;
    border: var(--_pad) solid rgba(244, 114, 182, 0.9);
    opacity: 0;
    animation: avatar-ring-heartbeat 1.8s cubic-bezier(0.2, 0.6, 0.3, 1) infinite;
}

/* Void Vortex: a comet of colour chasing its own tail around a faint ring */
.border-anim-vortex {
    --ring-bg: conic-gradient(from 0deg, transparent 0%, #6366f1 20%, #a855f7 45%, #ec4899 70%, #38bdf8 100%),
               linear-gradient(rgba(129, 140, 248, 0.28), rgba(129, 140, 248, 0.28));
    --ring-glow: rgba(124, 92, 246, 0.35);
}
.border-anim-vortex::before { animation: avatar-ring-spin 2.8s linear infinite; }
.border-anim-vortex::after {
    background: conic-gradient(from 0deg, transparent 0%, #6366f1 25%, #a855f7 55%, #38bdf8 100%);
    filter: blur(calc(var(--_pad) * 1.6));
    opacity: 0.5;
    animation: avatar-ring-spin 2.8s linear infinite;
}

/* Data Ring: a segmented green ring that ticks round like a scanning readout */
.border-anim-matrix {
    --ring-bg: repeating-conic-gradient(from 0deg, #00ff41 0deg 6deg, #00381a 6deg 12deg);
    --ring-glow: rgba(0, 255, 65, 0.3);
}
.border-anim-matrix::before { animation: avatar-ring-spin 9s steps(30) infinite; }
.border-anim-matrix::after {
    box-shadow: 0 0 calc(var(--_pad) * 3) rgba(0, 255, 65, 0.6);
    animation: avatar-ring-breathe 2.4s ease-in-out infinite;
}

/* Stardust: a gold ring with three four-point stars orbiting and twinkling */
.border-anim-sparkle {
    --ring-bg: conic-gradient(from 20deg, #fde68a, #facc15, #fff3b0, #eab308, #fde68a);
    --ring-glow: rgba(250, 204, 21, 0.5);
}
.border-anim-sparkle::after {
    z-index: 2;
    inset: -14%;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M32 2C34 22 42 30 62 32 42 34 34 42 32 62 30 42 22 34 2 32 22 30 30 22 32 2Z' fill='%23fff3a3' stroke='%23d97706' stroke-width='2.4' stroke-linejoin='round'/%3E%3C/svg%3E") 50% 1.25% / 20% 20% no-repeat,
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M32 2C34 22 42 30 62 32 42 34 34 42 32 62 30 42 22 34 2 32 22 30 30 22 32 2Z' fill='%23fff3a3' stroke='%23d97706' stroke-width='2.4' stroke-linejoin='round'/%3E%3C/svg%3E") 92.25% 74.4% / 16% 16% no-repeat,
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M32 2C34 22 42 30 62 32 42 34 34 42 32 62 30 42 22 34 2 32 22 30 30 22 32 2Z' fill='%23fff3a3' stroke='%23d97706' stroke-width='2.4' stroke-linejoin='round'/%3E%3C/svg%3E") 7.75% 74.4% / 18% 18% no-repeat;
    filter: drop-shadow(0 0 calc(var(--_pad) * 0.8) rgba(245, 158, 11, 0.75));
    animation: avatar-ring-orbit 9s linear infinite, avatar-ring-twinkle 2.2s ease-in-out infinite;
}

/* Diamond Glint: an icy ring with a bright glint sliding round it like light on a cut gem */
.border-diamond-shimmer {
    --ring-bg: conic-gradient(from 0deg, #b9f2ff, #5eead4, #38bdf8, #e0fbfc, #38bdf8, #5eead4, #b9f2ff);
    --ring-glow: rgba(0, 245, 212, 0.55);
}
.border-diamond-shimmer::after {
    z-index: -1;
    background: conic-gradient(from 0deg, transparent 0deg 292deg, rgba(255, 255, 255, 0.95) 340deg, transparent 360deg);
    -webkit-mask: var(--ring-mask);
    mask: var(--ring-mask);
    animation: avatar-ring-spin 3s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

/* GOAT Aura: a fast spectrum ring inside a slowly breathing golden aura */
.border-goat-aura { --ring-bg: conic-gradient(#ffbe0b, #fb5607, #ff006e, #8338ec, #3a86ff, #ffbe0b); }
.border-goat-aura::before { animation: avatar-ring-spin 5s linear infinite; }
.border-goat-aura::after {
    box-shadow: 0 0 calc(var(--_pad) * 5) calc(var(--_pad) * 0.8) rgba(255, 190, 11, 0.85);
    animation: avatar-ring-breathe 2.6s ease-in-out infinite;
}

/* Dragon's Orbit: a dragon flies round the ring trailing a comet of fire */
.border-dragon-orbit {
    --ring-bg: conic-gradient(from 0deg, transparent 0deg 200deg, rgba(255, 69, 0, 0.35) 270deg, #ffb300 345deg, #fff3b0 360deg),
               linear-gradient(135deg, #ea580c, #b91c1c);
    --ring-glow: rgba(255, 98, 0, 0.4);
}
.border-dragon-orbit::before { animation: avatar-ring-spin 3.6s linear infinite; }
.border-dragon-orbit::after {
    z-index: 2;
    inset: -16%;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg stroke='%237c1d0e' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M8 50C16 54 24 50 30 44C36 38 42 40 48 34L50 28L58 26L63 30L57 33C55 37 52 40 48 42C42 48 34 52 26 54C18 56 12 54 8 50Z' fill='%23e8431a'/%3E%3Cpath d='M50 28L46 20L53 26Z' fill='%23ffd54a'/%3E%3Cpath d='M30 46C26 32 30 16 44 8C43 16 46 20 52 22C47 24 48 28 52 31C44 31 40 36 38 44Z' fill='%23ffb300'/%3E%3C/g%3E%3Ccircle cx='56' cy='29' r='1.5' fill='%23fff'/%3E%3Ccircle cx='56.4' cy='29' r='.7' fill='%23111'/%3E%3C/svg%3E") 50% 0 / 32% auto no-repeat;
    filter: drop-shadow(0 0 calc(var(--_pad) * 1.2) rgba(255, 98, 0, 0.9));
    animation: avatar-ring-spin 3.6s linear infinite;
}

/* Peek-a-Boo Pal: a still pastel ring with a pet that pops up behind the photo, waves and ducks away */
.border-peekaboo-pet {
    --ring-bg: conic-gradient(#f472b6, #c084fc, #38bdf8, #f472b6);
    --ring-glow: rgba(192, 132, 252, 0.45);
    isolation: isolate;
}
.border-peekaboo-pet::before,
.border-peekaboo-pet::after {
    content: "";
    position: absolute;
    pointer-events: none;
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    opacity: 0;
    transform-origin: bottom center;
}
.border-peekaboo-pet::after {
    z-index: -1;
    top: -22%;
    right: -8%;
    width: 46%;
    height: 46%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cellipse cx='32' cy='38' rx='22' ry='18' fill='%23ffffff' stroke='%23334155' stroke-width='2'/%3E%3Cpolygon points='16,26 22,10 28,24' fill='%23ffffff' stroke='%23334155' stroke-width='2'/%3E%3Cpolygon points='18,24 22,14 26,23' fill='%23f472b6'/%3E%3Cpolygon points='48,26 42,10 36,24' fill='%23ffffff' stroke='%23334155' stroke-width='2'/%3E%3Cpolygon points='46,24 42,14 38,23' fill='%23f472b6'/%3E%3Ccircle cx='24' cy='36' r='3.5' fill='%231e293b'/%3E%3Ccircle cx='23' cy='34.5' r='1.2' fill='%23ffffff'/%3E%3Ccircle cx='40' cy='36' r='3.5' fill='%231e293b'/%3E%3Ccircle cx='39' cy='34.5' r='1.2' fill='%23ffffff'/%3E%3Cellipse cx='32' cy='41' rx='2.5' ry='1.8' fill='%23f472b6'/%3E%3Cpath d='M30 43 Q32 46 34 43' stroke='%23334155' stroke-width='1.5' fill='none'/%3E%3Cellipse cx='18' cy='41' rx='3' ry='1.8' fill='%23fda4af' opacity='0.7'/%3E%3Cellipse cx='46' cy='41' rx='3' ry='1.8' fill='%23fda4af' opacity='0.7'/%3E%3C/svg%3E");
    animation: avatar-ring-peek 8s ease-in-out infinite;
}
.border-peekaboo-pet::before {
    z-index: 2;
    top: -32%;
    right: 36%;
    width: 18%;
    height: 18%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M32 56C10 40 6 26 14 17C20 11 28 14 32 21C36 14 44 11 50 17C58 26 54 40 32 56Z' fill='%23f472b6'/%3E%3C/svg%3E");
    animation: avatar-ring-heart 8s ease-in-out infinite;
}
@keyframes avatar-ring-peek {
    0%, 55%, 100% { transform: translateY(70%) scale(0.7); opacity: 0; }
    62% { transform: translateY(15%) scale(0.95); opacity: 1; }
    67% { transform: translateY(0) rotate(-8deg); opacity: 1; }
    72% { transform: translateY(0) rotate(10deg); opacity: 1; }
    77% { transform: translateY(0) rotate(-8deg); opacity: 1; }
    82% { transform: translateY(0) rotate(0); opacity: 1; }
    90% { transform: translateY(70%) scale(0.7); opacity: 0; }
}
@keyframes avatar-ring-heart {
    0%, 66%, 86%, 100% { transform: translateY(40%) scale(0.3); opacity: 0; }
    72%, 78% { transform: translateY(-20%) scale(1); opacity: 1; }
    83% { transform: translateY(-60%) scale(0.8); opacity: 0; }
}

/* Reduced motion: still rings, with the stars and dragon left in place and the wave effects hidden */
@media (prefers-reduced-motion: reduce) {
    :is(.profile-border-animated-1, .border-flame, .border-anim-pulse, .border-anim-vortex, .border-anim-matrix,
        .border-anim-sparkle, .border-diamond-shimmer, .border-goat-aura, .border-dragon-orbit, .border-peekaboo-pet)::before,
    :is(.profile-border-animated-1, .border-flame, .border-anim-pulse, .border-anim-vortex, .border-anim-matrix,
        .border-anim-sparkle, .border-diamond-shimmer, .border-goat-aura, .border-dragon-orbit, .border-peekaboo-pet)::after {
        animation: none !important;
    }
    .border-anim-pulse::after,
    .border-diamond-shimmer::after { opacity: 0; }
}

/* ==========================================================================
   Graphic & Animated Profile Backgrounds
   ========================================================================== */

/* ── Fun Graphic Design Backgrounds ──────────────────────────────────── */
.bg-arcade-retro {
    background-color: #0d0221 !important;
    background-image: 
        linear-gradient(to top, rgba(255, 0, 128, 0.4) 0%, transparent 65%),
        linear-gradient(rgba(0, 240, 255, 0.25) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.25) 1px, transparent 1px) !important;
    background-size: 100% 100%, 28px 28px, 28px 28px !important;
}

.bg-botanical-paradise {
    background-color: #064e3b !important;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(16, 185, 129, 0.4) 0%, transparent 55%),
        radial-gradient(circle at 80% 70%, rgba(5, 150, 105, 0.5) 0%, transparent 55%),
        linear-gradient(135deg, #064e3b, #022c22, #047857) !important;
}

.bg-memphis-pop {
    background-color: #1e1b4b !important;
    background-image: 
        radial-gradient(#ec4899 15%, transparent 16%),
        radial-gradient(#38bdf8 15%, transparent 16%),
        linear-gradient(45deg, rgba(251, 191, 36, 0.15) 25%, transparent 25%) !important;
    background-size: 28px 28px, 36px 36px, 48px 48px !important;
    background-position: 0 0, 14px 14px, 0 0 !important;
}

.bg-cosmic-doodle {
    background-color: #09090b !important;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #ffffff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 40px 70px, #a855f7, rgba(0,0,0,0)),
        radial-gradient(1.5px 1.5px at 90px 40px, #38bdf8, rgba(0,0,0,0)),
        radial-gradient(circle at 50% 50%, rgba(124, 58, 237, 0.25) 0%, transparent 70%),
        linear-gradient(135deg, #0f172a, #030712) !important;
    background-size: 120px 120px, 160px 160px, 140px 140px, 100% 100%, 100% 100% !important;
}

.bg-cyber-hex {
    background-color: #0b0f19 !important;
    background-image: 
        radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.25) 0%, transparent 60%),
        linear-gradient(to right, rgba(6, 182, 212, 0.15) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(6, 182, 212, 0.15) 1px, transparent 1px) !important;
    background-size: 100% 100%, 24px 24px, 24px 24px !important;
}

/* ── Animated Backgrounds ────────────────────────────────────────────── */
.bg-anim-aurora {
    background: linear-gradient(125deg, #022c22, #064e3b, #0e7490, #4338ca, #6b21a8, #064e3b) !important;
    background-size: 400% 400% !important;
    animation: aurora-flow 12s ease infinite !important;
}
@keyframes aurora-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.bg-anim-matrix {
    background-color: #020b05 !important;
    background-image: 
        linear-gradient(0deg, rgba(0, 255, 65, 0.14) 1px, transparent 1px),
        radial-gradient(circle at 50% 50%, rgba(34, 197, 94, 0.25) 0%, transparent 70%) !important;
    background-size: 100% 4px, 100% 100% !important;
    animation: matrix-scanline 8s linear infinite !important;
}
@keyframes matrix-scanline {
    0% { background-position: 0 0, 0 0; }
    100% { background-position: 0 400px, 0 0; }
}

.bg-anim-starlight {
    background: radial-gradient(circle at 20% 40%, rgba(236, 72, 153, 0.35) 0%, transparent 50%),
                radial-gradient(circle at 80% 60%, rgba(59, 130, 246, 0.35) 0%, transparent 50%),
                linear-gradient(135deg, #09090b, #1e1b4b, #0f172a) !important;
    background-size: 200% 200% !important;
    animation: starlight-shift 10s ease-in-out infinite alternate !important;
}
@keyframes starlight-shift {
    0% { background-position: 0% 0%; filter: brightness(1); }
    100% { background-position: 100% 100%; filter: brightness(1.25); }
}

.bg-anim-sunset-waves {
    background: linear-gradient(135deg, #f43f5e, #fb923c, #e11d48, #d97706, #4c0519) !important;
    background-size: 300% 300% !important;
    animation: sunset-waves 9s ease infinite !important;
}
@keyframes sunset-waves {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.bg-anim-neon-pulse {
    background: linear-gradient(225deg, #ff007f, #7928ca, #0070f3, #7928ca) !important;
    background-size: 300% 300% !important;
    animation: neon-pulse 8s ease infinite !important;
}
@keyframes neon-pulse {
    0% { background-position: 0% 50%; filter: saturate(1.1); }
    50% { background-position: 100% 50%; filter: saturate(1.6); }
    100% { background-position: 0% 50%; filter: saturate(1.1); }
}


/* ==========================================================================
   Header & Top Navbar Theme Resilience
   Ensure the top navbar always respects the active DaisyUI theme color
   and is immune to rogue legacy bootstrap-theme background color overrides
   ========================================================================== */
header.bg-primary,
header.bg-primary .navbar,
.navbar.bg-primary {
    background-color: oklch(var(--p)) !important;
    color: oklch(var(--pc)) !important;
    border-color: oklch(var(--p) / 0.8) !important;
    background-image: none !important;
}

/* Ensure brand logo, badges, and links in top navbar never show underlines */
#app-header a,
#app-header a:hover,
#app-header a:focus,
#app-header a:active,
#app-header a *,
#app-header .badge {
    text-decoration: none !important;
}

/* Default / fallback green navbar matching Mint / Emerald */
[data-theme="emerald"] header.bg-primary,
[data-theme="emerald"] .navbar.bg-primary {
    background-color: #56cc9d !important;
    background-image: linear-gradient(135deg, #78c2ad 0%, #56cc9d 100%) !important;
    color: #ffffff !important;
}

/* Dark Espresso / Coffee Theme: Deep roasted espresso with golden crema amber highlights */
[data-theme="coffee"] header.bg-primary,
[data-theme="coffee"] .navbar.bg-primary {
    background-color: #1b120c !important;
    background-image: linear-gradient(135deg, #2a1a10 0%, #180f09 100%) !important;
    border-bottom: 1px solid rgba(245, 158, 11, 0.3) !important;
    color: #f59e0b !important;
}

[data-theme="coffee"] .gsap-hero,
[data-theme="coffee"] #section-hero {
    background-color: #180f09 !important;
    background-image: linear-gradient(160deg, #180f09 0%, #24160d 50%, #301d11 100%) !important;
    color: #fef3c7 !important;
}

/* Fix DaisyUI --pc in coffee theme to always be luminous cream/white */
[data-theme="coffee"] {
    --pc: 98% 0.01 80 !important;
    --fallback-pc: #ffffff !important;
}

/* Hero Section on Dark Coffee Background: Guaranteed High Contrast */
[data-theme="coffee"] .gsap-hero .hero-title,
[data-theme="coffee"] #section-hero .hero-title,
[data-theme="coffee"] .hero-title {
    color: #ffffff !important;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7) !important;
}

[data-theme="coffee"] .gsap-hero .hero-subtitle,
[data-theme="coffee"] #section-hero .hero-subtitle,
[data-theme="coffee"] .hero-subtitle {
    color: rgba(254, 243, 199, 0.9) !important;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6) !important;
}

[data-theme="coffee"] .gsap-hero .btn-outline,
[data-theme="coffee"] #section-hero .btn-outline {
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(8px) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="coffee"] .gsap-hero .btn-outline:hover,
[data-theme="coffee"] #section-hero .btn-outline:hover {
    color: #ffffff !important;
    border-color: #f59e0b !important;
    background-color: rgba(245, 158, 11, 0.25) !important;
    box-shadow: 0 0 18px rgba(245, 158, 11, 0.4) !important;
}

[data-theme="coffee"] .gsap-scroll-indicator,
[data-theme="coffee"] .gsap-scroll-indicator * {
    color: rgba(254, 243, 199, 0.8) !important;
}

[data-theme="coffee"] .text-primary-content {
    color: #ffffff !important;
}
[data-theme="coffee"] .text-primary-content\/70 {
    color: rgba(254, 243, 199, 0.85) !important;
}
[data-theme="coffee"] .text-primary-content\/50 {
    color: rgba(254, 243, 199, 0.70) !important;
}
[data-theme="coffee"] .border-primary-content\/30 {
    border-color: rgba(254, 243, 199, 0.45) !important;
}

/* Feature Sections and Feature Cards contrast on Coffee theme */
[data-theme="coffee"] .gsap-feature-section h2 {
    color: #ffffff !important;
}
[data-theme="coffee"] .gsap-feature-section p,
[data-theme="coffee"] .gsap-feature-section .text-base-content\/70,
[data-theme="coffee"] .gsap-feature-section .text-base-content\/60,
[data-theme="coffee"] .gsap-feature-section .text-base-content\/55 {
    color: rgba(254, 243, 199, 0.85) !important;
}
[data-theme="coffee"] .gsap-feature-card {
    background: rgba(32, 22, 31, 0.85) !important;
    border-color: rgba(245, 158, 11, 0.25) !important;
}
[data-theme="coffee"] .gsap-feature-card h3 {
    color: #ffffff !important;
}
[data-theme="coffee"] .gsap-feature-card p,
[data-theme="coffee"] .gsap-feature-card .text-xs {
    color: rgba(254, 243, 199, 0.8) !important;
}

[data-theme="coffee"] #alpha-banner div.bg-primary {
    background-color: #2b1810 !important;
    background-image: linear-gradient(135deg, #2b1810 0%, #3d2314 100%) !important;
    border: 1px solid rgba(245, 158, 11, 0.25) !important;
    color: #fef3c7 !important;
}

[data-theme="coffee"] .btn-accent {
    background-color: #d97706 !important;
    border-color: #b45309 !important;
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="coffee"] .btn-accent:hover {
    background-color: #b45309 !important;
    border-color: #92400e !important;
    color: #ffffff !important;
}

/* Primary buttons in coffee theme (Log In, Submit, CTA, Skip): rich roasted amber with luminous white text */
[data-theme="coffee"] .btn-primary,
[data-theme="coffee"] #login-submit,
[data-theme="coffee"] .gsap-skip-btn,
[data-theme="coffee"] a.btn-primary {
    background-color: #d97706 !important;
    background-image: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #b45309 100%) !important;
    border-color: #b45309 !important;
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6) !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35) !important;
}

[data-theme="coffee"] .btn-primary:hover,
[data-theme="coffee"] #login-submit:hover,
[data-theme="coffee"] .gsap-skip-btn:hover,
[data-theme="coffee"] a.btn-primary:hover {
    background-color: #b45309 !important;
    background-image: linear-gradient(135deg, #d97706 0%, #b45309 50%, #92400e 100%) !important;
    border-color: #78350f !important;
    color: #ffffff !important;
    box-shadow: 0 6px 20px rgba(180, 83, 9, 0.5) !important;
}

[data-theme="coffee"] header.bg-primary a,
[data-theme="coffee"] header.bg-primary button {
    color: #fde68a !important;
}

[data-theme="coffee"] header.bg-primary a.btn-primary,
[data-theme="coffee"] .navbar a.btn-primary {
    color: #ffffff !important;
    background-color: #d97706 !important;
    background-image: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    border-color: #b45309 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="coffee"] header.bg-primary a.btn-primary:hover,
[data-theme="coffee"] .navbar a.btn-primary:hover {
    background-color: #b45309 !important;
    color: #ffffff !important;
}

/* Coffee Theme: Login Card, Form Inputs, & Autofill High-Contrast Protection */
[data-theme="coffee"] #section-login .card,
[data-theme="coffee"] .auth-page-body .card {
    background-color: #1f140e !important;
    border-color: rgba(245, 158, 11, 0.25) !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 8px 10px -6px rgba(0, 0, 0, 0.6) !important;
}

[data-theme="coffee"] input.input,
[data-theme="coffee"] .input-primary,
[data-theme="coffee"] .auth-page-body input[type="text"],
[data-theme="coffee"] .auth-page-body input[type="email"],
[data-theme="coffee"] .auth-page-body input[type="password"] {
    background-color: #150d08 !important;
    border-color: rgba(245, 158, 11, 0.35) !important;
    color: #fef3c7 !important;
    font-weight: 500 !important;
}

[data-theme="coffee"] input.input:focus,
[data-theme="coffee"] .input-primary:focus,
[data-theme="coffee"] .auth-page-body input[type="text"]:focus,
[data-theme="coffee"] .auth-page-body input[type="email"]:focus,
[data-theme="coffee"] .auth-page-body input[type="password"]:focus {
    background-color: #1c110b !important;
    border-color: #f59e0b !important;
    outline: 2px solid rgba(245, 158, 11, 0.45) !important;
    color: #ffffff !important;
}

[data-theme="coffee"] input.input::placeholder,
[data-theme="coffee"] .auth-page-body input::placeholder {
    color: rgba(254, 243, 199, 0.5) !important;
}

/* Chrome / Safari / Edge Autofill Fix: prevents white/yellow box with black text on dark brown */
[data-theme="coffee"] input:-webkit-autofill,
[data-theme="coffee"] input:-webkit-autofill:hover,
[data-theme="coffee"] input:-webkit-autofill:focus {
    -webkit-text-fill-color: #fef3c7 !important;
    -webkit-box-shadow: 0 0 0px 1000px #150d08 inset !important;
    transition: background-color 5000s ease-in-out 0s;
    caret-color: #fef3c7 !important;
}

[data-theme="coffee"] #section-login .label-text {
    color: #fef3c7 !important;
    font-weight: 600 !important;
}

[data-theme="coffee"] #section-login .text-base-content\/60 {
    color: rgba(254, 243, 199, 0.75) !important;
}

[data-theme="coffee"] #section-login .divider {
    color: rgba(254, 243, 199, 0.5) !important;
}

[data-theme="coffee"] #section-login .link-primary,
[data-theme="coffee"] #section-login #forgot-password {
    color: #f59e0b !important;
}

[data-theme="coffee"] #section-login .link-primary:hover,
[data-theme="coffee"] #section-login #forgot-password:hover {
    color: #fbbf24 !important;
}

[data-theme="coffee"] .text-accent {
    color: #f59e0b !important;
}

[data-theme="coffee"] .badge-accent {
    background-color: #d97706 !important;
    color: #ffffff !important;
    border-color: #b45309 !important;
}

/* ==========================================================================
   Desktop Collapsible Sidebar & Intersecting Navigation (Cloudflare Style)
   ========================================================================== */
@media (min-width: 1024px) {
    .drawer.lg\:drawer-open {
        display: grid !important;
        grid-template-columns: 20rem 1fr !important;
    }
    .drawer.lg\:drawer-open .drawer-side {
        position: fixed !important;
        top: 56px !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 20rem !important;
        height: calc(100vh - 56px) !important;
        height: calc(100dvh - 56px) !important;
        max-height: calc(100vh - 56px) !important;
        max-height: calc(100dvh - 56px) !important;
        z-index: 40 !important;
        display: block !important;
        pointer-events: auto !important;
        visibility: visible !important;
        transform: none !important;
        overflow: visible !important;
    }
    .drawer.lg\:drawer-open .drawer-side > aside {
        width: 20rem !important;
        max-width: 20rem !important;
        min-height: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        box-sizing: border-box !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        overscroll-behavior: contain !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        transform: translateX(0) !important;
    }
    .drawer.lg\:drawer-open .drawer-content {
        grid-column-start: 2 !important;
        min-width: 0 !important;
        width: 100% !important;
    }
    .drawer.sidebar-collapsed {
        grid-template-columns: 0px 1fr !important;
        grid-auto-columns: 0px auto !important;
    }
    .drawer.sidebar-collapsed .drawer-side {
        width: 0 !important;
        max-width: 0 !important;
        overflow: hidden !important;
        border-right: none !important;
        visibility: hidden !important;
        transform: translateX(-100%) !important;
        pointer-events: none !important;
    }
    .drawer.sidebar-collapsed .drawer-side > aside {
        transform: translateX(-100%) !important;
        width: 0 !important;
        min-width: 0 !important;
        padding: 0 !important;
        border-right: none !important;
        visibility: hidden !important;
    }
    .drawer.sidebar-collapsed .drawer-content {
        grid-column-start: 2 !important;
        margin-left: 0 !important;
        width: 100% !important;
    }
}

@media (max-width: 1023px) {
    .drawer {
        display: block !important;
        width: 100% !important;
    }
    .drawer-content {
        grid-column-start: 1 !important;
        width: 100% !important;
        transition: none !important;
    }
    .drawer-side {
        top: 56px !important;
        height: calc(100vh - 56px) !important;
        height: calc(100dvh - 56px) !important;
        z-index: 50 !important;
        overscroll-behavior: contain !important;
    }
    .drawer-side > aside {
        padding-top: 1.25rem !important;
        overscroll-behavior: contain !important;
    }
}

.drawer-side > aside {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), width 0.25s cubic-bezier(0.4, 0, 0.2, 1), padding 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* ==========================================================================
   Auto-Hiding Top Navigation (Mobile App & Social Media Headroom Pattern)
   Top navbar smoothly disappears on scroll down, and reappears on scroll up.
   ========================================================================== */
/* ==========================================================================
   Auto-Hiding Navigation Chrome (Mobile App & Social Media Headroom Pattern)
   Top navbar, bottom navigation, and quests widget hide and reappear in perfect sync
   ========================================================================== */
#app-header,
header.bg-primary {
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s ease;
    will-change: transform;
}

#app-bottom-nav,
.btm-nav {
    will-change: transform, opacity;
    backface-visibility: hidden;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#quest-floating-widget,
.quest-floating-widget {
    will-change: transform, opacity;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.28s ease,
                width 0.25s ease,
                top 0.25s ease !important;
}

/* 1. Top Navbar hides upwards */
body.nav-hidden #app-header,
body.nav-hidden header.bg-primary,
#app-header.chrome-hidden,
header.bg-primary.chrome-hidden {
    transform: translateY(-100%) !important;
    box-shadow: none !important;
    pointer-events: none !important;
}

/* 2. Bottom Nav slides downwards off screen */
body.nav-hidden #app-bottom-nav,
body.nav-hidden .btm-nav,
#app-bottom-nav.chrome-hidden,
.btm-nav.chrome-hidden {
    transform: translateY(100%) !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* 3. Quest widget translates upwards & fades out in sync with top navbar */
body.nav-hidden #quest-floating-widget,
body.nav-hidden .quest-floating-widget,
#quest-floating-widget.chrome-hidden,
.quest-floating-widget.chrome-hidden {
    transform: translateY(-80px) scale(0.95) !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Smoothly adjust elements below the header */
#active-checkin-banner,
#download-apk-banner {
    position: sticky;
    top: 56px;
    z-index: 35;
    box-sizing: border-box;
    border-bottom-left-radius: 1rem;
    border-bottom-right-radius: 1rem;
    overflow: hidden;
    transition: top 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
body.nav-hidden #active-checkin-banner,
body.nav-hidden #download-apk-banner {
    top: 0 !important;
}

#active-checkin-banner > div,
#download-apk-banner > div {
    box-sizing: border-box;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.auth-page-body #active-checkin-banner > div,
.auth-page-body #download-apk-banner > div {
    max-width: 100% !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
}

@media (min-width: 640px) {
    .auth-page-body #active-checkin-banner > div,
    .auth-page-body #download-apk-banner > div {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

@media (min-width: 1024px) {
    .auth-page-body #active-checkin-banner > div,
    .auth-page-body #download-apk-banner > div {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }
}

.side-advert-display {
    transition: top 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
body.nav-hidden .side-advert-display {
    top: 19px !important;
}

/* Reduced-motion override — disable transitions for accessibility */
@media (prefers-reduced-motion: reduce) {
    #app-header,
    #app-bottom-nav,
    .btm-nav,
    #quest-floating-widget,
    .quest-floating-widget {
        transition: none !important;
    }
}

@media (min-width: 1024px) {
    .drawer.lg\:drawer-open .drawer-side {
        transition: top 0.28s cubic-bezier(0.16, 1, 0.3, 1), height 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    }
    body.nav-hidden .drawer.lg\:drawer-open .drawer-side {
        top: 0 !important;
        height: 100vh !important;
        height: 100dvh !important;
    }
}

/* Accessibility: Respect users with reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    #app-header,
    #active-checkin-banner,
    .side-advert-display,
    .quest-floating-widget,
    .drawer.lg\:drawer-open .drawer-side {
        transition: none !important;
    }
}

/* ==========================================================================
   Auto-Hiding Scrollbars Across the Entire Site
   Scrollbars disappear completely when not hovered or in focus
   ========================================================================== */
* {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    transition: scrollbar-color 0.3s ease;
}

*:hover,
*:focus,
*:focus-within {
    scrollbar-color: color-mix(in oklch, currentColor 30%, transparent) transparent;
}

/* WebKit Scrollbars (Chrome, Edge, Safari, Opera) */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
    background-color: transparent;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: transparent;
    border-radius: 9999px;
    transition: background-color 0.3s ease;
}

*:hover::-webkit-scrollbar-thumb,
*:focus::-webkit-scrollbar-thumb,
*:focus-within::-webkit-scrollbar-thumb,
body:hover::-webkit-scrollbar-thumb {
    background-color: color-mix(in oklch, currentColor 25%, transparent);
}

::-webkit-scrollbar-thumb:hover {
    background-color: color-mix(in oklch, currentColor 50%, transparent);
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* ==========================================================================
   External Social Login Buttons (Google, Facebook, Apple, Microsoft)
   Strict sizing and layout to prevent inline collapse or overlapping
   ========================================================================== */
.external-login-container {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    width: 100% !important;
    margin: 4px 0 !important;
}

.external-login-btn {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    width: 100% !important;
    min-height: 44px !important;
    height: 44px !important;
    padding: 0 16px !important;
    border-radius: 8px !important;
    border: 1px solid rgba(0, 0, 0, 0.15) !important;
    background-color: #ffffff !important;
    color: #1f2937 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease !important;
    box-sizing: border-box !important;
    position: relative !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    margin: 0 !important;
}

[data-theme="dark"] .external-login-btn,
[data-theme="night"] .external-login-btn,
[data-theme="synthwave"] .external-login-btn,
[data-theme="coffee"] .external-login-btn,
[data-theme="forest"] .external-login-btn,
[data-theme="black"] .external-login-btn,
[data-theme="luxury"] .external-login-btn,
[data-theme="dracula"] .external-login-btn,
[data-theme="business"] .external-login-btn,
[data-theme="dim"] .external-login-btn,
[data-theme="sunset"] .external-login-btn {
    background-color: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: #fef3c7 !important;
}

.external-login-btn:hover {
    background-color: rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(0, 0, 0, 0.25) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

[data-theme="dark"] .external-login-btn:hover,
[data-theme="night"] .external-login-btn:hover,
[data-theme="synthwave"] .external-login-btn:hover,
[data-theme="coffee"] .external-login-btn:hover,
[data-theme="forest"] .external-login-btn:hover,
[data-theme="black"] .external-login-btn:hover,
[data-theme="luxury"] .external-login-btn:hover,
[data-theme="dracula"] .external-login-btn:hover,
[data-theme="business"] .external-login-btn:hover,
[data-theme="dim"] .external-login-btn:hover,
[data-theme="sunset"] .external-login-btn:hover {
    background-color: rgba(255, 255, 255, 0.16) !important;
    border-color: rgba(245, 158, 11, 0.45) !important;
    color: #ffffff !important;
}

/* ==========================================================================
   Universal Dynamic Text Contrast Engine (WCAG 2.1 AA/AAA Compliant)
   Ensures text is always easily readable despite any background colour/tone
   ========================================================================== */
@supports (color: contrast-color(#000)) {
    .btn-primary:not([disabled]),
    #login-submit:not([disabled]),
    .gsap-skip-btn:not([disabled]) {
        color: contrast-color(var(--fallback-p, oklch(var(--p)/1))) !important;
    }
}

@supports not (color: contrast-color(#000)) {
    @supports (color: oklch(from #000 l c h)) {
        .btn-primary:not([disabled]),
        #login-submit:not([disabled]),
        .gsap-skip-btn:not([disabled]) {
            --btn-bg-eval: var(--fallback-p, oklch(var(--p)/1));
            --contrast-flip: max(0, sign(0.60 - oklch(from var(--btn-bg-eval) l 0 0)));
            color: oklch(from var(--btn-bg-eval) calc(12% + var(--contrast-flip) * 88%) 0 0) !important;
        }
    }
}

/* Fallback for all dark-toned themes to prevent black-on-dark contrast failure */
:is([data-theme="coffee"], [data-theme="night"], [data-theme="dark"], [data-theme="synthwave"], [data-theme="forest"], [data-theme="black"], [data-theme="luxury"], [data-theme="dracula"], [data-theme="business"], [data-theme="dim"], [data-theme="sunset"]) .btn-primary:not([disabled]),
:is([data-theme="coffee"], [data-theme="night"], [data-theme="dark"], [data-theme="synthwave"], [data-theme="forest"], [data-theme="black"], [data-theme="luxury"], [data-theme="dracula"], [data-theme="business"], [data-theme="dim"], [data-theme="sunset"]) #login-submit:not([disabled]),
:is([data-theme="coffee"], [data-theme="night"], [data-theme="dark"], [data-theme="synthwave"], [data-theme="forest"], [data-theme="black"], [data-theme="luxury"], [data-theme="dracula"], [data-theme="business"], [data-theme="dim"], [data-theme="sunset"]) .gsap-skip-btn:not([disabled]) {
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.external-login-btn svg,
.external-login-btn img,
.external-login-btn i {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    flex-shrink: 0 !important;
    display: inline-block !important;
    vertical-align: middle !important;
}

/* Sidebar navigation anchor styling - strictly prevent underlines across all states */
#sidebar-nav-container a,
#sidebar-nav-container a:hover,
#sidebar-nav-container a:focus,
#sidebar-nav-container a:active,
#sidebar-nav-container a:visited,
#sidebar-nav-container .menu a,
#sidebar-nav-container .menu a:hover,
#sidebar-nav-container .menu a:focus,
#sidebar-nav-container .menu a:active,
#sidebar-nav-container summary,
#sidebar-nav-container summary:hover {
    text-decoration: none !important;
}

/* Banner anchor styling - strictly prevent underlines */
#download-apk-banner a,
#download-apk-banner a:hover,
#download-apk-banner a:focus,
#download-apk-banner a:active,
#download-apk-banner a:visited,
#active-checkin-banner a,
#active-checkin-banner a:hover,
#active-checkin-banner a:focus,
#active-checkin-banner a:active,
#active-checkin-banner a:visited {
    text-decoration: none !important;
}

/* Mobile Bottom Navigation (btm-nav) style resets to prevent Bootstrap anchor interference */
.btm-nav a {
    text-decoration: none !important;
}

.btm-nav a:hover,
.btm-nav a:focus {
    text-decoration: none !important;
}

/* ==========================================================================
   Mobile Fixed Navigation Guarantee
   Ensure top header and bottom nav stay firmly fixed on all viewports
   ========================================================================== */
header.bg-primary {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 9999 !important;
}

.btm-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 9999 !important;
    will-change: transform, opacity;
    backface-visibility: hidden;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                opacity  0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Grid layout only on mobile/tablet — never override lg:hidden on desktop */
@media (max-width: 1023px) {
    .btm-nav {
        display: grid !important;
        grid-template-columns: repeat(5, 1fr) !important;
    }
}

/* ==========================================================================
   Auth Flow – Mobile Bottom Navigation and Safe Padding Overrides
   Hides bottom navigation on auth pages and provides breathing room for submit buttons
   ========================================================================== */
.auth-page-body .btm-nav {
    display: none !important;
}

.auth-page-body .drawer-content {
    padding-bottom: 0 !important;
}

.pb-btm-nav {
    padding-bottom: 5rem !important;
}

/* Ensure DaisyUI <dialog class="modal"> hides correctly when closed */
dialog.modal:not([open]) {
    display: none !important;
}

/* Post-Bootstrap utility compatibility */
.d-none {
    display: none !important;
}


.text-rainbow {
    background: linear-gradient(to right, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rainbowTextMove 5s ease infinite;
    font-weight: bold;
}

@keyframes rainbowTextMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ==========================================================================
   Auth Flow – GSAP Scrollable Login Page: Full-Width Section Breakout
   The layout wraps RenderBody() in max-w-7xl with px padding & side adverts.
   These rules let .gsap-section elements escape to true viewport width.
   ========================================================================== */

/* Hide side adverts entirely on auth pages */
.auth-page-body .side-advert-display {
    display: none !important;
}

/* Remove the max-width cap and padding from the content container on auth pages */
.auth-page-body .drawer-content > .w-full.max-w-7xl {
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Zero out main padding */
.auth-page-body main.flex-1 {
    padding-bottom: 0 !important;
}

/* GSAP sections fill the full drawer-content area width.
   The .w-full.max-w-7xl parent is already overridden to max-width:100% above,
   so width:100% on sections is all that's needed. */
.auth-page-body .gsap-section {
    width: 100%;
}

/* Remove footer on auth pages — it appears below the login form unnecessarily */
.auth-page-body footer.footer {
    display: none !important;
}

/* Ensure the dot nav and skip button clear the sidebar */
@media (min-width: 1024px) {
    .gsap-dot-nav {
        right: 1rem;
    }
    .gsap-skip-btn {
        right: 1rem;
    }
}

/* Alpha banner top adjustment: banner is fixed below the navbar (56px) */
.auth-page-body #alpha-banner {
    left: 0;
    right: 0;
}

/* Hide empty ASP.NET Core validation summaries */
.validation-summary-valid {
    display: none !important;
}

/* ==========================================================================
   Vendor Flip Cards & Hidden Scrollbar Utilities
   ========================================================================== */

/* Cross-browser hidden scrollbar */
.hide-scrollbar, .no-scrollbar {
    -ms-overflow-style: none !important; /* IE and Edge */
    scrollbar-width: none !important; /* Firefox */
}
.hide-scrollbar::-webkit-scrollbar, .no-scrollbar::-webkit-scrollbar {
    display: none !important; /* Chrome, Safari, Opera */
    width: 0 !important;
    height: 0 !important;
}

/* 3D Perspective Card Container - Fixed uniform height across all cards */
.vendor-flip-card {
    perspective: 1200px;
    -webkit-perspective: 1200px;
    user-select: none;
    position: relative;
    width: 100%;
    height: 480px !important;
    min-height: 480px !important;
    max-height: 480px !important;
    display: block;
    box-sizing: border-box;
}

.vendor-flip-card-inner {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    max-height: 100% !important;
    transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
    transform-style: preserve-3d !important;
    -webkit-transform-style: preserve-3d !important;
}

.vendor-flip-card.is-flipped .vendor-flip-card-inner {
    transform: rotateY(180deg) !important;
    -webkit-transform: rotateY(180deg) !important;
}

/* Both faces must be strictly positioned absolute filling the card box, backface hidden */
.vendor-card-front,
.vendor-card-back {
    position: absolute !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    max-height: 100% !important;
    -webkit-backface-visibility: hidden !important;
    backface-visibility: hidden !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    margin: 0 !important;
}

.vendor-card-front {
    z-index: 2;
    transform: rotateY(0deg) !important;
    -webkit-transform: rotateY(0deg) !important;
}

.vendor-card-back {
    z-index: 1;
    transform: rotateY(180deg) !important;
    -webkit-transform: rotateY(180deg) !important;
}

.vendor-flip-card.is-flipped .vendor-card-back {
    z-index: 3;
}

/* Ensure the scrollable body in the back face flexes and scrolls without resizing the card */
.vendor-card-back .card-body {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
}

/* ==========================================================================
   Post & Journal Dropdown Menu Stacking & Visibility Fixes (Feed & Profile)
   ========================================================================== */
.post-options-dropdown,
.journal-options-dropdown,
details.dropdown.post-options-dropdown,
details.dropdown.journal-options-dropdown {
    position: relative !important;
}

/* Ensure open dropdowns and their parent cards stay in front of everything */
details.dropdown[open] {
    z-index: 100 !important;
    position: relative !important;
}

details.dropdown[open] > .dropdown-content {
    z-index: 100 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Elevate parent post cards and search-result wrappers above sibling cards/elements when open */
article.card:has(details.dropdown[open]),
.search-result:has(details.dropdown[open]),
.feed-content:has(details.dropdown[open]),
.has-open-dropdown {
    z-index: 90 !important;
    position: relative !important;
    overflow: visible !important;
}

/* Prevent container overflow clipping for post and journal cards */
article.card[data-post-guid],
article.card[data-journal-guid] {
    overflow: visible !important;
}

/* Make sure Profile tab panels & feed list never clip dropdowns */
#profilePanels,
#Posts,
#Journals,
#feed-content {
    overflow: visible !important;
}

/* Ensure profile tabs card doesn't clip children */
.card:has(#profilePanels) {
    overflow: visible !important;
}

/* ==========================================================================
   Mobile Instagram-Style Edge-to-Edge Feed Layout
   ========================================================================== */
@media (max-width: 639px) {
    /* Full-width breakout for feed content on mobile */
    .feed-page-body .drawer-content {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .feed-page-body .w-full.max-w-7xl {
        padding-left: 0 !important;
        padding-right: 0 !important;
        padding-top: 0.25rem !important;
    }

    .feed-page-body main.flex-1 {
        padding-left: 0 !important;
        padding-right: 0 !important;
        padding-bottom: 0 !important;
    }

    /* Edge-to-edge post cards */
    .feed-page-body article.card[data-post-guid] {
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        box-shadow: none !important;
    }

    /* Full width media */
    .feed-page-body article.card[data-post-guid] figure {
        width: 100vw !important;
        max-width: 100vw !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        border-radius: 0 !important;
    }

    .feed-page-body article.card[data-post-guid] figure img,
    .feed-page-body article.card[data-post-guid] figure video {
        width: 100vw !important;
        max-width: 100vw !important;
        border-radius: 0 !important;
    }
}

/* ==========================================================================
   Feed scroll performance + end-of-feed spacing
   ========================================================================== */

/* Below lg the bottom nav is fixed, and drawer-content, main, the content wrapper and the footer each
   added their own bottom padding (~16rem of blank page past the last post). Keep exactly one spacer:
   the bottom nav height plus the safe-area inset. The footer links live in the sidebar on mobile. */
@media (max-width: 1023px) {
    .feed-page-body .drawer-content {
        padding-bottom: calc(4rem + env(safe-area-inset-bottom, 0px)) !important;
    }

    .feed-page-body .drawer-content > .w-full.max-w-7xl {
        padding-bottom: 0 !important;
    }

    .feed-page-body .drawer-content > footer.footer {
        display: none !important;
    }
}

/* Off-screen posts skip layout and paint entirely; the browser remembers each post's real height once
   it has been rendered, so the scrollbar doesn't jump */
.feed-page-body #feed-content > .search-result,
.feed-page-body #feed-content > article.card[data-post-guid] {
    content-visibility: auto;
    contain-intrinsic-size: auto 560px;
}

/* Hover shadows do nothing on touch screens but still cost a repaint per card */
@media (hover: none) {
    .feed-page-body article.card[data-post-guid] {
        transition: none !important;
    }
    .feed-page-body article.card[data-post-guid]:hover {
        box-shadow: none !important;
    }
}

/* Backdrop blurs on video controls re-render whenever the video or the page under them moves */
.feed-video-preview .backdrop-blur-md {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

/* Animated post borders are paused while their post is off-screen (feed-perf.js adds .is-offscreen) */
article.card[data-post-guid].is-offscreen::after,
article.card[data-post-guid].is-offscreen .avatar *,
article.card[data-post-guid].is-offscreen .avatar *::before,
article.card[data-post-guid].is-offscreen .avatar *::after {
    animation-play-state: paused !important;
}

@media (prefers-reduced-motion: reduce) {
    .post-border-pulse::after, .post-border-rainbow::after, .post-border-flame::after, .post-border-cyber::after {
        animation: none !important;
        opacity: 0.6;
    }
}

/* Data Saver keeps the static border and glow, without the pulse */
html[data-saver="on"] .post-border-pulse::after, html[data-saver="on"] .post-border-rainbow::after,
html[data-saver="on"] .post-border-flame::after, html[data-saver="on"] .post-border-cyber::after {
    animation: none !important;
    opacity: 0.6;
}

/* Feed photos: no blur-to-sharp filter on the feed (a filter per image repaints mid-scroll) */
.feed-page-body #feed-content .rv-img-pending,
.feed-page-body #feed-content .rv-img-sharpen {
    filter: none !important;
    transform: none !important;
    transition: none !important;
}

/* Feed entrance: a short fade with no movement, so cards never appear to slide while scrolling */
.feed-page-body #feed-content[data-reveal] > .rv-in {
    animation-name: rv-fade !important;
    animation-duration: 220ms !important;
    animation-delay: 0ms !important;
}

/* Parked results (feed-perf.js) are empty boxes holding their old height; nothing to animate in */
.feed-page-body #feed-content > .search-result.feed-parked {
    contain-intrinsic-size: none;
}

/* Safe area padding utilities for notched devices */
.safe-area-pt {
    padding-top: max(0.75rem, env(safe-area-inset-top, 0.75rem)) !important;
}
.safe-area-pb {
    padding-bottom: max(1rem, env(safe-area-inset-bottom, 1rem)) !important;
}

/* ==========================================================================
   Instagram Reels Fullscreen Video Viewer
   ========================================================================== */
#reels-modal-viewer {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-width: 100vw !important;
    max-height: 100dvh !important;
    background-color: #000000 !important;
    z-index: 999999 !important;
    display: none;
    flex-direction: column !important;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
}

#reels-modal-viewer.active {
    display: flex !important;
}

body.reels-open {
    overflow: hidden !important;
    touch-action: none !important;
}

#reels-scroller {
    position: relative !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    max-height: 100dvh !important;
    display: block !important;
    overflow-y: scroll !important;
    overflow-x: hidden !important;
    scroll-snap-type: y mandatory !important;
    overscroll-behavior-y: contain !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
}

.reel-item {
    position: relative !important;
    scroll-snap-align: start !important;
    scroll-snap-stop: always !important;
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    max-height: 100dvh !important;
    width: 100vw !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: #000000 !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
    touch-action: pan-y !important;
}

.feed-video-touch-shield {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    cursor: pointer;
    background: transparent;
    -webkit-tap-highlight-color: transparent;
}

.feed-video-fullscreen-btn {
    position: absolute !important;
    bottom: 0.75rem !important;
    right: 0.75rem !important;
    z-index: 25 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    touch-action: manipulation !important;
}

.pointer-events-auto {
    pointer-events: auto !important;
}

@keyframes reelHeartPop {
    0% { transform: scale(0) rotate(-15deg); opacity: 0; }
    50% { transform: scale(1.3) rotate(0deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.animate-heart-pop {
    animation: reelHeartPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.feed-video-preview:hover .video-play-overlay div {
    transform: scale(1.1);
    background-color: oklch(var(--p) / 0.85);
}

/* Instagram Reels Action Buttons: Completely remove any button background/border */
.reel-action-btn,
button.reel-action-btn,
.reel-btn-like,
button.reel-btn-like,
.reel-btn-comment,
button.reel-btn-comment,
.reel-btn-share,
button.reel-btn-share {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    border-width: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 0 !important;
    margin: 0 !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

/* Slide-Up Comments Drawer */
#reels-comments-drawer {
    width: 100% !important;
    width: 100vw !important;
    max-width: 100vw !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 10002 !important;
}

#reels-comments-backdrop {
    z-index: 10001 !important;
}





/* Image Fallback and Broken Image Safety */
img:not([src]), img[src=''], img[src='#'] { visibility: hidden; }
.avatar img { background-color: transparent; -webkit-user-select: none; user-select: none; }

/* =====================================================================
   Performance & UX plan, Phase 1
   ===================================================================== */

/* Page-to-page cross-fade in browsers that support cross-document View Transitions
   (Chromium-based browsers and Safari 18.2+). Other browsers navigate exactly as before.
   Skipped entirely for people who ask their device to reduce motion. */
@media (prefers-reduced-motion: no-preference) {
    @view-transition {
        navigation: auto;
    }

    ::view-transition-old(root),
    ::view-transition-new(root) {
        animation-duration: 200ms;
        animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
    }
}

/* Respect the device "reduce motion" setting across the whole app.
   Animations finish instantly instead of playing; loading spinners keep turning so progress stays visible.
   0.01ms (not 0) keeps animationend/transitionend events firing for scripts that wait on them. */
@media (prefers-reduced-motion: reduce) {
    *:not(.fa-spin):not(.fa-spinner):not(.loading):not(.animate-spin),
    *:not(.fa-spin):not(.fa-spinner):not(.loading):not(.animate-spin)::before,
    *:not(.fa-spin):not(.fa-spinner):not(.loading):not(.animate-spin)::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Avatars: idle float in the wardrobe, a one-time pop-in for map markers, confetti once on a new podium.
   The global reduce-motion rule above already stops all three. */
.avatar-idle > svg { animation: avatar-float 4.4s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes avatar-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.avatar-pop { animation: avatar-pop 200ms ease-out 1 both; }
@keyframes avatar-pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.podium-confetti-piece { position: absolute; top: 0; width: 6px; height: 10px; border-radius: 2px; animation: podium-confetti 1.8s ease-in forwards; }
@keyframes podium-confetti { from { transform: translateY(-10px) rotate(0deg); opacity: 1; } to { transform: translateY(220px) rotate(540deg); opacity: 0; } }

/* Pick-one pills for check-in seats, bill splits and payment methods.
   Preflight is off, so borders are drawn here rather than with Tailwind's border utilities. */
.choice-pill { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; cursor: pointer; user-select: none;
    border: 1.5px solid color-mix(in oklab, currentColor 18%, transparent); border-radius: .85rem; padding: .55rem .8rem;
    background: var(--fallback-b1, oklch(var(--b1))); transition: border-color .15s, background-color .15s, box-shadow .15s; }
.choice-pill:hover { border-color: var(--fallback-p, oklch(var(--p) / .6)); }
.choice-pill input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.choice-pill:has(input:checked), .choice-pill.is-selected { border-color: var(--fallback-p, oklch(var(--p))); background: var(--fallback-p, oklch(var(--p) / .1)); box-shadow: 0 0 0 1px var(--fallback-p, oklch(var(--p))) inset; }
.choice-pill:has(input:focus-visible) { outline: 2px solid var(--fallback-p, oklch(var(--p))); outline-offset: 2px; }
.choice-pill:has(input:disabled) { opacity: .45; cursor: not-allowed; }
.co-bubble-text { overflow-wrap: anywhere; white-space: pre-wrap; }

/* Badge medals (Views/Shared/_BadgeMedal.cshtml). Earning the same badge again climbs the BadgeTiers
   ladder and the medal changes with data-badge-tier: 0 Common (flat, never animated), 1 Uncommon ring,
   2 Rare ring + glow, 3 Epic gradient + glow, 4 Legendary gold with a shine sweep, 5 Mythic with a
   turning iridescent ring and a sparkle. Layers: the medal's background is the ring, __face is the
   surface inset by --medal-ring, ::before the Mythic ring, ::after the shine. Motion is transform and
   opacity only. Preflight is off, so nothing here relies on Tailwind's border utilities. */
.badge-medal {
    --medal-tone: color-mix(in oklab, var(--fallback-bc, oklch(var(--bc))) 22%, transparent);
    --medal-ring: 1px;
    --medal-glow: transparent;
    --medal-surface: var(--fallback-b2, oklch(var(--b2)));
    position: relative; isolation: isolate; overflow: hidden;
    display: inline-flex; align-items: center; gap: .3em; white-space: nowrap; vertical-align: middle;
    border-radius: .45rem; padding: .2em .5em; font-size: 11px; line-height: 1.25;
    color: var(--fallback-bc, oklch(var(--bc)));
    background: var(--medal-tone);
    box-shadow: 0 0 10px var(--medal-glow);
    transition: transform .15s ease;
}
.badge-medal:hover { transform: translateY(-1px); }
.badge-medal--xs { font-size: 10px; padding: .15em .4em; border-radius: .35rem; }
.badge-medal--lg { font-size: 12.5px; padding: .45em .75em; border-radius: .6rem; --medal-ring: 1.5px; }
.badge-medal__face { position: absolute; inset: var(--medal-ring); z-index: -1; border-radius: inherit; background: var(--medal-surface); }
.badge-medal__icon { color: var(--medal-icon, inherit); font-size: 1em; }
.badge-medal__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; max-width: 12rem; }
.badge-medal--xs .badge-medal__name { font-weight: 500; }
.badge-medal__count {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 800; font-size: .85em;
    padding: 0 .3em; border-radius: .3rem;
    background: color-mix(in oklab, var(--medal-icon, var(--fallback-bc, oklch(var(--bc)))) 18%, transparent);
    color: var(--medal-icon, inherit);
}

.badge-medal[data-badge-tier="1"] { --medal-tone: #34d399; --medal-icon: #10b981; }
.badge-medal[data-badge-tier="2"] { --medal-tone: #38bdf8; --medal-icon: #0ea5e9; --medal-glow: rgb(56 189 248 / .35); --medal-ring: 1.5px; }
.badge-medal[data-badge-tier="3"] { --medal-tone: linear-gradient(135deg, #c084fc, #818cf8); --medal-icon: #a855f7; --medal-glow: rgb(192 132 252 / .45); --medal-ring: 1.5px; }
.badge-medal[data-badge-tier="4"] { --medal-tone: linear-gradient(135deg, #fde68a, #f59e0b 45%, #fbbf24 70%, #b45309); --medal-icon: #f59e0b; --medal-glow: rgb(251 191 36 / .5); --medal-ring: 2px; }
.badge-medal[data-badge-tier="5"] { --medal-tone: transparent; --medal-icon: #f43f5e; --medal-glow: rgb(251 113 133 / .55); --medal-ring: 2px; }
/* Razor writes data-* attributes even when their value is null (data-badge-special=""), so match "true" */
.badge-medal[data-badge-special="true"] { --medal-tone: linear-gradient(135deg, #f0abfc, #e879f9 50%, #c026d3); --medal-icon: #d946ef; --medal-glow: rgb(232 121 249 / .45); --medal-ring: 1.5px; }
.badge-medal[data-badge-tier="1"],
.badge-medal[data-badge-tier="2"] { --medal-surface: color-mix(in oklab, var(--medal-tone) 12%, var(--fallback-b1, oklch(var(--b1)))); }
.badge-medal[data-badge-tier="3"],
.badge-medal[data-badge-tier="4"],
.badge-medal[data-badge-tier="5"],
.badge-medal[data-badge-special="true"] { --medal-surface: color-mix(in oklab, var(--medal-icon) 13%, var(--fallback-b1, oklch(var(--b1)))); }

/* Legendary and Mythic: a soft light sweep across the face every few seconds. */
.badge-medal[data-badge-tier="4"]::after,
.badge-medal[data-badge-tier="5"]::after {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: linear-gradient(105deg, transparent 35%, rgb(255 255 255 / .38) 50%, transparent 65%);
    transform: translateX(-120%);
    animation: badge-medal-shine 3.6s ease-in-out infinite;
}
/* Mythic: a turning iridescent ring. A big square behind the face spins; the medal clips it to a ring. */
.badge-medal[data-badge-tier="5"]::before {
    content: ""; position: absolute; z-index: -1; left: 50%; top: 50%; width: 160%; aspect-ratio: 1; pointer-events: none;
    background: conic-gradient(#fb7185, #f472b6, #c084fc, #60a5fa, #34d399, #fbbf24, #fb7185);
    transform: translate(-50%, -50%) rotate(0deg);
    animation: badge-medal-spin 5s linear infinite;
}
.badge-medal__spark {
    position: absolute; top: 1px; right: 2px; width: 7px; height: 7px; pointer-events: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 0l1.2 3.8L10 5 6.2 6.2 5 10 3.8 6.2 0 5l3.8-1.2z' fill='%23fff'/%3E%3C/svg%3E") center / contain no-repeat;
    filter: drop-shadow(0 0 2px #fb7185);
    animation: badge-medal-twinkle 2.4s ease-in-out infinite;
}
@keyframes badge-medal-shine { 0%, 55% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }
@keyframes badge-medal-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes badge-medal-twinkle { 0%, 100% { opacity: .25; transform: scale(.7); } 50% { opacity: 1; transform: scale(1.1); } }

/* Profile showcase card: medal, rank pips, progress to the next rank. */
.badge-medal-card { display: inline-flex; flex-direction: column; align-items: flex-start; gap: .3rem; min-width: 8.5rem; padding: .5rem; border-radius: .75rem;
    background: var(--fallback-b2, oklch(var(--b2) / .55)); box-shadow: inset 0 0 0 1px var(--fallback-bc, oklch(var(--bc) / .08)); text-align: left; }
.badge-medal-meta { display: flex; align-items: center; gap: .4rem; width: 100%; }
.badge-medal__pips { display: inline-flex; gap: 2px; }
.badge-medal__pips > span { width: 9px; height: 4px; border-radius: 2px; background: var(--fallback-bc, oklch(var(--bc) / .15)); }
.badge-medal__pips > span.is-on { background: var(--card-tone, #f59e0b); }
.badge-medal__tier { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--card-tone, var(--fallback-bc, oklch(var(--bc) / .6))); }
.badge-medal-progress { display: block; width: 100%; height: 4px; border-radius: 2px; overflow: hidden; background: var(--fallback-bc, oklch(var(--bc) / .1)); }
.badge-medal-progress > span { display: block; height: 100%; border-radius: inherit; background: var(--card-tone, var(--fallback-bc, oklch(var(--bc) / .35))); }
.badge-medal-next { font-size: 10px; color: var(--fallback-bc, oklch(var(--bc) / .55)); }
.badge-medal-card:has([data-badge-tier="1"]) { --card-tone: #10b981; }
.badge-medal-card:has([data-badge-tier="2"]) { --card-tone: #0ea5e9; }
.badge-medal-card:has([data-badge-tier="3"]) { --card-tone: #a855f7; }
.badge-medal-card:has([data-badge-tier="4"]) { --card-tone: #f59e0b; }
.badge-medal-card:has([data-badge-tier="5"]) { --card-tone: #f43f5e; }
.badge-medal-card:has([data-badge-special="true"]) { --card-tone: #d946ef; }

@media (prefers-reduced-motion: reduce) {
    .badge-medal, .badge-medal::before, .badge-medal::after, .badge-medal__spark { animation: none !important; transition: none !important; }
    .badge-medal[data-badge-tier="4"]::after, .badge-medal[data-badge-tier="5"]::after { opacity: 0; }
    .badge-medal__spark { opacity: .8; }
}


/* ==========================================================================
   Small-screen fixes (mobile audit 2026-10-29, see docs/mobile-ui-audit.md)
   Plain CSS on purpose: tailwind.min.css is only rebuilt on Publish.
   ========================================================================== */

/* Undefined Tailwind size that a few views use */
.text-2xs { font-size: 10px; line-height: 0.875rem; }

/* Preflight is off, so <a class="tab"> kept the link underline */
a.tab, .tabs a.tab, .tabs .tab { text-decoration: none !important; }

/* Long URLs and unbroken words in user content wrap instead of widening cards and chat bubbles.
   break-word (not anywhere) for page text: it only splits a word that cannot fit, and does not let
   flex items shrink below word width (anywhere broke "Seasonal" into "Season al" in tight headers). */
.chat-bubble,
.journal-lines {
    overflow-wrap: anywhere;
}
#main-render-content p,
#main-render-content li,
#main-render-content h1,
#main-render-content h2,
#main-render-content h3 {
    overflow-wrap: break-word;
}

/* Tab bars scroll sideways instead of overflowing or squashing labels */
.tabs {
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs > .tab { flex-shrink: 0; }

/* Hover-only overlays (photo edit, item preview, slideshow arrows): on touch, show them as a small corner chip */
@media (hover: none) {
    .touch-reveal { opacity: 1 !important; }
    .touch-reveal.inset-0 {
        inset: auto 6px 6px auto !important;
        width: auto;
        height: auto;
        padding: 4px 8px;
        border-radius: 9999px;
        background-color: rgba(0, 0, 0, 0.55);
        font-size: 12px;
        gap: 4px;
    }
    .touch-reveal.inset-0 i { font-size: 13px !important; }
}

/* Any input under 16px makes iOS Safari zoom the page on focus */
@media (max-width: 767px), (pointer: coarse) {
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="hidden"]),
    select,
    textarea {
        font-size: 16px !important;
    }
    .input-xs, .select-xs { height: 2.25rem; min-height: 2.25rem; }
    .input-sm, .select-sm { height: 2.5rem; min-height: 2.5rem; }
}

/* Touch targets: extra-small buttons grow to a tappable 32px */
@media (pointer: coarse) {
    .btn-xs { min-height: 32px; height: auto; }
    .btn-xs.btn-circle, .btn-xs.btn-square { min-width: 32px; width: 32px; height: 32px; }
}

@media (max-width: 1023px) {
    /* The collapsed Quests pill floats at the top right of the page; reserve its row so it no longer
       covers page headers and their buttons ("Shop", "Mark all as read", leaderboard tabs) */
    body:has(#quest-floating-widget) #main-render-content { padding-top: 2.25rem; }

    /* Sidebar drawer rows and section headers to a comfortable tap height */
    .drawer-side .menu li > a,
    .drawer-side .menu li > summary { min-height: 44px; display: flex; align-items: center; }

    /* Header icon buttons were 28px */
    #app-header .btn-sm.btn-circle { width: 36px; height: 36px; min-height: 36px; }
}

@media (max-width: 639px) {
    /* Floor for hard-coded tiny text (8-10px) used across cards, badges and meta lines */
    .text-\[7px\], .text-\[8px\], .text-\[9px\] { font-size: 10px !important; }
    .text-\[10px\] { font-size: 11px !important; }
}

@media (max-width: 399px) {
    /* Up to ~400px the Beta badge and the boost pill pushed the brand name down to "WSMCon…" */
    #app-header .badge-accent,
    #app-header #global-buff-indicator { display: none !important; }
}

@media (max-width: 374px) {
    #app-header .btn-sm.btn-circle { width: 32px; height: 32px; min-height: 32px; }
    /* 320px still lacked ~14px for the full brand name */
    #app-header nav > div:first-child > a { font-size: 0.95rem; }
}