/* ========================================================================
   XBOT — Atelier (main site skin)
   Load order: tokens.css → site.css → glass.css → atelier.css.
   glass.css owns the material (fill, blur, rim, edge glow, reflections);
   this file owns shape, spacing, type and component states.
   Mobile first — phone values are the defaults, desktop in the media
   queries at the bottom.
   ======================================================================== */

/* ===== LAYOUT ===== */
.main-wrap {
    position: relative;
    z-index: 1;
    padding-top: calc(84px + env(safe-area-inset-top, 0px));
    padding-bottom: 28px;
}
.container { padding-left: 14px; padding-right: 14px; }

/* ===== PRELOADER ===== */
.preloader {
    background:
        radial-gradient(90% 60% at 20% 0%, var(--sun-0), rgba(255, 248, 220, 0) 70%),
        linear-gradient(180deg, var(--sun-1), var(--sun-3));
}
.preloader-ring {
    border-radius: 50%;
    background: var(--glass-fill);
    box-shadow: var(--glass-shadow);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}
.preloader-track { stroke: rgba(255, 255, 255, 0.7); }

/* ===== TOP BAR: floating glass capsule ===== */
.topbar,
.topbar.scrolled {
    top: calc(10px + env(safe-area-inset-top, 0px));
    left: 50%;
    right: auto;
    width: calc(100% - 20px);
    max-width: 1140px;
    height: auto;
    transform: translateX(-50%);
    border-radius: 22px;
    background:
        radial-gradient(240px circle at var(--mx, -999px) var(--my, -999px), rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 70%),
        var(--glass-fill);
    border: 0;
}
/* The deeper shadow once the page has scrolled fades in on its own layer: animating box-shadow
   on the blurred bar itself repainted it every frame for the first 300ms of every scroll. */
.topbar::after {
    content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
    box-shadow: var(--glass-shadow-hover); opacity: 0; transition: opacity 0.3s var(--ease-out);
}
.topbar.scrolled::after { opacity: 1; }
.topbar .container.topbar-inner {
    max-width: none;
    height: 58px;
    padding: 0 8px 0 16px;
}
.brand-logo { display: block; height: 26px; width: auto; }
.brand-logo--preloader { height: 22px; }
.brand-logo--foot { height: 18px; }
.topbar-brand { display: flex; align-items: center; line-height: 0; }

.topbar-nav { gap: 4px; }
.topbar-link {
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    color: var(--ink-2);
    font-family: var(--font);
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    transition: background-color 0.2s, color 0.2s, box-shadow 0.3s var(--ease-out);
}
.topbar-link i { font-size: 0.95rem; color: var(--ink-3); transition: color 0.2s; }
.topbar-link:hover { color: var(--ink); background: rgba(255, 255, 255, 0.4); }
.topbar-link:hover i { color: var(--ember); }
.topbar-link.is-active {
    color: var(--ink);
    background: linear-gradient(180deg, #fff, rgba(255, 255, 255, 0.82));
    box-shadow: var(--inlay-shadow-hover);
}
.topbar-link.is-active i { color: var(--ember); }
.topbar-link.is-active::after { display: none; }

/* ===== PHONE TAB BAR: sticky glass capsule at the bottom ===== */
.tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1045;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr); /* fits however many tabs are enabled */
    gap: 0;
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom, 0px));
    border-radius: 20px 20px 0 0;
    background:
        radial-gradient(240px circle at var(--mx, -999px) var(--my, -999px), rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 70%),
        var(--glass-fill);
    box-shadow: var(--glass-shadow), 0 -8px 24px -12px rgba(122, 74, 0, 0.4);
    -webkit-backdrop-filter: blur(22px) saturate(180%) brightness(1.06);
    backdrop-filter: blur(22px) saturate(180%) brightness(1.06);
}
.tabbar-link {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    min-height: 46px;
    padding: 3px 2px;
    border-radius: 14px;
    color: var(--ink-2);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.2s var(--ease-out), color 0.2s;
}
.tabbar-link i {
    font-size: 1.12rem;
    line-height: 1;
    transition: transform 0.3s var(--ease-spring);
}
.tabbar-link span {
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.tabbar-link:hover { color: var(--ink); }
.tabbar-link:active { transform: scale(0.92); }
.tabbar-link.is-active {
    color: var(--ink);
    background: linear-gradient(180deg, #fff, rgba(255, 255, 255, 0.82));
    box-shadow: var(--inlay-shadow-hover);
}
.tabbar-link.is-active i {
    color: var(--ember);
    transform: translateY(-1px) scale(1.06);
}
.tabbar-link:focus-visible { outline: 2px solid var(--ice-ink); outline-offset: 2px; }

/* Phones: the brand-only top bar scrolls away with the page (navigation
   lives in the docked tab bar), and content clears the tab bar. */
@media (max-width: 767px) {
    .topbar,
    .topbar.scrolled { position: absolute; }
    .topbar .container.topbar-inner { justify-content: center; padding: 0 16px; height: 54px; }
    .main-wrap { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
    .site-foot { margin-bottom: calc(70px + env(safe-area-inset-bottom, 0px)); }
}
@media (min-width: 768px) {
    .tabbar { display: none; }
}

/* ===== TYPE ===== */
.page-hero { margin-bottom: 18px; }
.page-hero h1 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(2.2rem, 10vw, 2.6rem);
    letter-spacing: 0.02em;
    line-height: 1;
    text-transform: none;
    color: var(--ink);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}
.page-hero .hero-accent,
.section-divider h2 .hero-accent {
    color: var(--ember);
    -webkit-text-fill-color: currentColor;
    background: none;
}
.page-hero .hero-sub {
    margin-top: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ink-2);
    letter-spacing: 0;
}
.hero-sub strong { color: var(--ink); }
.hero-live {
    height: 24px;
    padding: 0 10px 0 8px;
    border-radius: 999px;
    color: var(--emerald);
    font-weight: 800;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    background: var(--glass-inlay);
    box-shadow: var(--inlay-shadow);
}
.hero-live-dot { background: #16C172; box-shadow: 0 0 0 3px rgba(22, 193, 114, 0.2); }

.section-divider { margin: 26px 0 14px; }
.section-divider h2 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 1.55rem;
    letter-spacing: 0.03em;
    text-transform: none;
    color: var(--ink);
}
.section-divider::after {
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.95), rgba(var(--ice-rgb), 0.5) 40%, rgba(255, 255, 255, 0));
}

/* ===== ARENA CARD (section pane) ===== */
.arena-card {
    margin-bottom: 14px;
    border-radius: var(--glass-radius);
    overflow: hidden;
}
.arena-card:hover { border-color: transparent; }
.card-head {
    padding: 14px 14px 6px 14px;
    gap: 10px;
    background: transparent;
    border-bottom: 0;
}
.card-head::before { display: none; }
.card-head h2 {
    gap: 10px;
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    text-transform: none;
    color: var(--ink);
}
.card-head h2 i {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    font-size: 0.95rem;
    background: var(--glass-inlay);
    box-shadow: var(--inlay-shadow);
}
.card-head h2 i:not(.text-cyan):not(.text-emerald) { color: var(--ember) !important; }
.card-body-inner { padding: 8px 12px 12px; }

/* Featured: no pane; the photo tiles are the glass. */
.arena-card--featured {
    overflow: visible;
    background: transparent;
    border: 0;
    box-shadow: none;
}
.arena-card--featured .card-head { padding: 0 2px 12px; }
.arena-card--featured .card-body-inner { padding: 0 !important; }

/* Tags / chips */
.tag,
.card-head .tag,
.pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 30px;
    padding: 0 12px;
    border: 0;
    border-radius: 999px;
    font-family: var(--font);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: none;
    color: var(--ink);
    background: var(--glass-inlay);
    box-shadow: var(--inlay-shadow);
}
.card-head .tag--gold,
.tag.tag--gold { color: var(--ink); background: var(--glass-inlay); border: 0; }
a.tag::after {
    content: "\F138";
    font-family: "bootstrap-icons";
    font-size: 0.78rem;
    line-height: 1;
    transition: transform 0.25s var(--ease-out);
}
a.tag:hover,
.card-head .tag--gold:hover {
    color: var(--ink);
    background: var(--glass-inlay);
    box-shadow: var(--inlay-shadow-hover);
}
a.tag:hover::after { transform: translateX(3px); }
.pill { height: 24px; padding: 0 10px; font-size: 0.66rem; }
.pill--gold { color: var(--reward-light); }
.pill--cyan,
.pill--purple { color: var(--ice-ink); }
.pill--emerald { color: var(--emerald); }
.pill--rose { color: var(--rose); }

/* ===== RANK MEDALS ===== */
.cover-card-rank,
.user-card-rank,
.lb-rank {
    border: 0;
    color: var(--ink);
    font-family: var(--font);
    font-weight: 800;
    background: linear-gradient(180deg, #fff, rgba(255, 255, 255, 0.78));
    box-shadow:
        inset 0 1px 0 #fff,
        inset 0 -0.5px 0 rgba(var(--ice-rgb), 0.6),
        0 4px 10px -4px rgba(122, 74, 0, 0.5);
}
.rank-1.cover-card-rank, .rank-1.user-card-rank, .lb-rank.rank-1 {
    color: #4A3000;
    background: linear-gradient(145deg, #FFF6C2 0%, #FFD23F 45%, #E49B00 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.6), 0 0 14px rgba(255, 196, 0, 0.7), 0 4px 10px -4px rgba(122, 74, 0, 0.6);
}
.rank-2.cover-card-rank, .rank-2.user-card-rank, .lb-rank.rank-2 {
    color: #2E3642;
    background: linear-gradient(145deg, #FFFFFF 0%, #E2E7EF 50%, #A8B3C3 100%);
    box-shadow: inset 0 1px 0 #fff, 0 0 0 1px rgba(255, 255, 255, 0.7), 0 0 12px rgba(var(--ice-rgb), 0.6), 0 4px 10px -4px rgba(60, 70, 90, 0.5);
}
.rank-3.cover-card-rank, .rank-3.user-card-rank, .lb-rank.rank-3 {
    color: #4A2408;
    background: linear-gradient(145deg, #FFE6CC 0%, #EBA46E 50%, #B4632B 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.5), 0 0 12px rgba(235, 140, 70, 0.55), 0 4px 10px -4px rgba(122, 60, 0, 0.6);
}

/* ===== COVER CARD (photo leaderboard tile) ===== */
.cover-card-grid { gap: 10px; }
.cover-card {
    border-radius: 20px;
    background: linear-gradient(160deg, #FFF6D2, #FFD978);
}
.cover-card:hover { transform: translateY(-4px); }
.cover-card-img { z-index: 0; }
.cover-card-fallback {
    font-family: 'Varela Round', var(--font);
    font-weight: 400;
    font-size: clamp(2rem, 12vw, 3rem);
    color: rgba(28, 22, 6, 0.4);
    background:
        radial-gradient(circle at 50% 36%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0) 55%),
        linear-gradient(160deg, #FFF3C4, #FFC94A);
}
.cover-card-rank {
    top: 8px;
    left: 8px;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 0.78rem;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}
/* Frosted caption. Not a backdrop-filter: the photo behind never changes,
   so the caption carries its own pre-blurred copy of it (--cover is set by
   site.js from the <img>). The blur is painted once and cached with the
   card, so entrances and hovers cost nothing extra, and a fading card never
   makes the glass "snap" back at the end. */
.cover-card-overlay {
    left: 6px;
    right: 6px;
    bottom: 6px;
    z-index: 2;
    gap: 1px;
    padding: 8px 10px 9px;
    overflow: hidden;
    isolation: isolate;
    border-radius: 15px;
    border: 0;
    background: rgba(255, 255, 255, 0.55);
    box-shadow: var(--inlay-shadow);
}
.cover-card-overlay::before,
.profile-cover-overlay::before {
    content: "";
    position: absolute;
    z-index: -2;
    background: var(--cover, none) center top / cover no-repeat;
    transform: scale(1.08);
    transform-origin: 50% 0;
    pointer-events: none;
}
.cover-card-overlay::before {
    left: -6px;
    right: -6px;
    bottom: -6px;
    aspect-ratio: 3 / 4;
    filter: blur(10px) saturate(1.6) brightness(1.25);
}
.cover-card-overlay::after,
.profile-cover-overlay::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(120% 90% at 0% 0%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 55%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0.4));
}
.cover-card-name {
    font-family: 'Varela Round', var(--font);
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--ink);
}
.cover-card-sub { font-size: 0.58rem; font-weight: 800; color: var(--ice-ink); }
.cover-card-value {
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--reward-light);
}
.cover-card-stats { border-top: 1px solid rgba(28, 22, 6, 0.1); }
.cover-card-stat {
    font-family: var(--font);
    font-size: 0.55rem;
    font-weight: 700;
    color: var(--ink-3);
    border-right-color: rgba(28, 22, 6, 0.1);
}
.cover-card-stat b { color: var(--ink); font-weight: 800; }
/* Clear glass over any photo: a soft white halo keeps caption text legible
   when the photo behind is dark, and is invisible over light ones. */
.cover-card-name,
.cover-card-value,
.cover-card-sub,
.cover-card-stat,
.profile-cover .profile-name {
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6), 0 0 10px rgba(255, 255, 255, 0.75);
}
.cover-card-value { color: #A84300; }

/* ===== USER CARD (quiz / room tiles) ===== */
.user-card-grid { gap: 10px; }
.user-card {
    padding: 6px;
    border-radius: 20px;
}
.user-card:hover { transform: translateY(-3px); color: var(--ink); }
.user-card-avatar {
    border-radius: 15px;
    font-family: 'Varela Round', var(--font);
    font-size: 2.2rem;
    font-weight: 400;
    color: rgba(28, 22, 6, 0.4);
    background:
        radial-gradient(circle at 50% 36%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 60%),
        linear-gradient(160deg, #FFF3C4, #FFCF5A);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}
.user-card-avatar img { border-radius: 15px; }
.user-card-rank {
    top: 12px;
    left: 12px;
    min-width: 26px;
    height: 26px;
    padding: 0 7px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    font-size: 0.72rem;
}
.user-card-rank.rank-1 { font-size: 0.76rem; padding: 0 8px; }
.user-card-info { padding: 8px 6px 4px; }
.user-card-name {
    font-family: 'Varela Round', var(--font);
    font-weight: 400;
    font-size: 0.88rem;
    color: var(--ink);
}
.user-card-sub { font-size: 0.66rem; font-weight: 700; color: var(--ink-3); }
.user-card-val {
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--reward-light);
}

/* ===== LEADERBOARD ROWS ===== */
.lb-row {
    margin: 0 0 8px;
    padding: 10px 12px;
    gap: 12px;
    border-radius: 16px;
    color: var(--ink);
    text-decoration: none;
}
.lb-row:last-child { margin-bottom: 0; }
.lb-row:hover {
    transform: none;
    background:
        radial-gradient(200px circle at var(--mx, -999px) var(--my, -999px), rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0) 70%),
        var(--glass-inlay);
    box-shadow: var(--inlay-shadow-hover);
}
.lb-row--highlight {
    background:
        radial-gradient(140% 90% at 0% 0%, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0) 52%),
        linear-gradient(180deg, rgba(255, 222, 170, 0.75), rgba(255, 176, 92, 0.42));
}
.lb-row--highlight::before {
    top: 12px;
    bottom: 12px;
    left: 4px;
    width: 3px;
    border-radius: 3px;
    background: var(--ember);
}
.lb-rank { width: 30px; height: 30px; font-size: 0.76rem; -webkit-backdrop-filter: none; backdrop-filter: none; }
.lb-avatar,
.avatar-initials {
    width: 40px;
    height: 40px;
    border: 2px solid #fff;
    color: var(--ink-2);
    background: linear-gradient(160deg, #FFF6D6, #FFD978);
    box-shadow: 0 0 10px rgba(var(--ice-rgb), 0.35);
}
.lb-row:hover .lb-avatar { border-color: #fff; }
.lb-name,
.lb-name a,
.profile-link {
    font-family: 'Varela Round', var(--font);
    font-weight: 400;
    font-size: 0.94rem;
    color: var(--ink);
}
.lb-name a:hover,
.profile-link:hover { color: var(--reward-light); }
.lb-subtitle { font-size: 0.7rem; font-weight: 600; color: var(--ink-3); }
.lb-value {
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--reward-light);
}
.lb-stat-label { font-family: var(--font); font-weight: 800; color: var(--ink-3); }
.lb-stat-value { font-family: var(--font); font-weight: 800; color: var(--ink); }

/* ===== TABS ===== */
.tab-bar,
.tab-bar:hover {
    display: flex;
    width: fit-content;
    max-width: 100%;
    gap: 4px;
    padding: 5px;
    margin-bottom: 14px;
    border-radius: 999px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
}
.filter-tab {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 16px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0;
    color: var(--ink-2);
    background: transparent;
    scroll-snap-align: center;
    transition: background-color 0.2s, color 0.2s, box-shadow 0.3s var(--ease-out);
}
.filter-tab:hover { color: var(--ink); background: rgba(255, 255, 255, 0.42); }
.filter-tab.active,
.filter-tab.active:hover {
    color: var(--ink);
    background: linear-gradient(180deg, #fff, rgba(255, 255, 255, 0.82));
    box-shadow: var(--inlay-shadow-hover);
}
.filter-tab.active::after { display: none; }
.filter-tab:focus-visible,
.topbar-link:focus-visible,
.cover-card:focus-visible,
.user-card:focus-visible,
.lb-row:focus-visible,
.tag:focus-visible {
    outline: 2px solid var(--ice-ink);
    outline-offset: 2px;
}

/* ===== FORMS ===== */
.x-input,
.x-select {
    min-height: 46px;
    padding: 0 16px;
    border-radius: 16px;
    font-family: var(--font);
    font-size: 16px; /* no iOS zoom on focus */
    font-weight: 600;
    color: var(--ink);
    outline: none;
}
.x-input::placeholder { color: var(--ink-3); font-weight: 600; }
.x-select {
    max-width: 100%;
    text-overflow: ellipsis;
    padding-right: 40px;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231C1606' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 16px center,
        var(--glass-fill);
}
.x-select option { background: #FFF8E0; color: var(--ink); }
.x-input:focus,
.x-select:focus {
    background:
        radial-gradient(240px circle at var(--mx, -999px) var(--my, -999px), rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 70%),
        var(--glass-fill);
    box-shadow: var(--glass-shadow-hover), 0 0 0 4px rgba(var(--ice-rgb), 0.28);
}
.x-select:focus {
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231C1606' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 16px center,
        var(--glass-fill);
}

/* ===== BUTTONS ===== */
/* Primary: dark ink capsule (the reference's "Get started"). */
.btn-neon-orange,
a.btn-neon-orange,
button.btn-neon-orange,
.btn-game:not(.btn-game--outline),
.error-btn--primary,
.btn-primary,
.btn-primary:focus,
.tweet-search-form .filter-tab,
.tweet-search-form .filter-tab.active,
#user-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 22px;
    border: 0 !important;
    border-radius: 999px !important;
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    text-transform: none;
    color: #FFF7DE !important;
    background: linear-gradient(180deg, #3A3018 0%, #17120A 100%) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        inset 0 -0.5px 0 rgba(var(--ice-rgb), 0.45),
        0 0 16px rgba(var(--ice-rgb), 0.4),
        0 12px 22px -12px rgba(0, 0, 0, 0.6) !important;
    opacity: 1 !important;
    transition: transform 0.2s var(--ease-out), box-shadow 0.3s var(--ease-out);
}
.btn-neon-orange:hover,
.btn-game:not(.btn-game--outline):hover,
.error-btn--primary:hover,
.btn-primary:hover,
.tweet-search-form .filter-tab:hover,
#user-search-btn:hover {
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.32),
        inset 0 -0.5px 0 rgba(var(--ice-rgb), 0.6),
        0 0 26px rgba(var(--ice-rgb), 0.6),
        0 14px 26px -12px rgba(0, 0, 0, 0.6) !important;
}
.btn-neon-orange:active,
.btn-game:active,
.error-btn:active,
.tweet-search-form .filter-tab:active { transform: scale(0.97); }

/* Secondary: clear glass capsule. */
.btn-game--outline,
.btn-secondary,
.btn-secondary:focus,
.error-btn:not(.error-btn--primary) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 20px;
    border: 0 !important;
    border-radius: 999px !important;
    font-weight: 800;
    color: var(--ink) !important;
    background: var(--glass-inlay) !important;
    box-shadow: var(--inlay-shadow) !important;
}
.btn-game--outline:hover,
.btn-secondary:hover,
.error-btn:not(.error-btn--primary):hover {
    color: var(--ink) !important;
    background: var(--glass-inlay) !important;
    box-shadow: var(--inlay-shadow-hover) !important;
}

/* ===== STAT TILES ===== */
.stat-trio {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 18px;
}
.stat-card {
    padding: 16px 8px 14px;
    border-radius: var(--glass-radius-sm);
}
.stat-card:hover {
    transform: translateY(-2px);
    background:
        radial-gradient(240px circle at var(--mx, -999px) var(--my, -999px), rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 70%),
        var(--glass-fill);
    box-shadow: var(--glass-shadow-hover);
}
.stat-number {
    font-family: var(--font);
    font-size: clamp(1.25rem, 6vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.stat-number,
.stat-number--gold,
.stat-number--cyan,
.stat-number--emerald {
    background: none;
    -webkit-text-fill-color: currentColor;
    color: var(--ink);
}
.stat-card--gold .stat-number { color: var(--reward-light); }
.stat-card--cyan .stat-number { color: var(--ice-ink); }
.stat-card--emerald .stat-number { color: var(--emerald); }
.stat-label {
    margin-top: 6px;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--ink-3);
}

/* Lucky draw countdown + stat cards */
.ld-alltime-row { gap: 10px; }
.ld-countdown-card {
    padding: 20px 14px;
    border-radius: var(--glass-radius);
}
.ld-countdown-label { color: var(--ink-3); font-weight: 800; }
.ld-cd-unit span {
    min-width: 48px;
    font-family: var(--font);
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--ink);
    text-shadow: 0 0 18px rgba(var(--ice-rgb), 0.55);
    font-variant-numeric: tabular-nums;
}
.ld-cd-unit small { color: var(--ink-3); font-weight: 800; }
.ld-cd-sep { color: var(--ember); }
.ld-draw-stats { border-top: 1px solid rgba(28, 22, 6, 0.1); }
.ld-draw-stat { color: var(--ink-2); }
.ld-draw-stat i { color: var(--ember); }
.ld-stat-card {
    padding: 14px;
    border-radius: var(--glass-radius-sm);
}
.ld-stat-card:hover { transform: translateY(-2px); box-shadow: var(--glass-shadow-hover); }
.ld-stat-icon {
    border-radius: 13px;
    color: var(--ember);
    background: var(--glass-inlay);
    box-shadow: var(--inlay-shadow);
}
.ld-stat-val { font-family: var(--font); font-weight: 800; color: var(--ink); }
.ld-stat-lbl { color: var(--ink-3); font-weight: 800; }

/* ===== TWEETS ===== */
.tweets-page { max-width: 640px; }
.tweet-search-bar { margin-bottom: 14px; }
.tweet-search-form { gap: 8px; }
.tweet-search-form .x-input { max-width: none; flex: 1 1 auto; min-width: 0; }
.tweet-search-form .filter-tab { flex: 0 0 auto; margin: 0; padding: 0 24px; }
.tweet-clear-filter {
    min-height: 40px;
    padding: 0 16px;
    margin-bottom: 12px;
    border-radius: 999px;
    color: var(--ink);
    font-weight: 800;
}
.tweet-clear-filter:hover { color: var(--ink); box-shadow: var(--glass-shadow-hover); background: var(--glass-fill); }
.tweet-clear-filter i { color: var(--rose); }

/* Feed cards come in dozens, so they skip the live backdrop blur (its
   per-frame cost grows with every card on screen) and use a milky frosted
   fill; rim, glare and edge glow stay. content-visibility lets the browser
   skip cards that are off screen, so a long feed and each new page of
   tweets stay cheap. */
.tweet-card {
    padding: 12px 12px 10px;
    margin-bottom: 10px;
    border-radius: 20px;
    background:
        radial-gradient(240px circle at var(--mx, -999px) var(--my, -999px), rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 70%),
        radial-gradient(130% 80% at 0% 0%, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 46%),
        linear-gradient(112deg, rgba(255, 255, 255, 0) 28%, rgba(255, 255, 255, 0.3) 36%, rgba(255, 255, 255, 0.05) 44%, rgba(255, 255, 255, 0) 52%),
        linear-gradient(180deg, rgba(255, 253, 244, 0.58) 0%, rgba(255, 250, 232, 0.42) 100%);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    content-visibility: auto;
    contain-intrinsic-size: auto 260px;
}
.tweet-card:hover { transform: none; }
.tweet-retweet {
    padding-bottom: 10px;
    margin-bottom: 10px;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--ink-3);
    border-bottom: 1px solid rgba(28, 22, 6, 0.08);
}
.tweet-retweet i { color: var(--emerald); }
.tweet-header { gap: 9px; margin-bottom: 8px; }
.tweet-avatar,
.reply-avatar,
.rt-orig-avatar,
.like-avatar {
    border: 2px solid #fff;
    color: var(--ink-2);
    background: linear-gradient(160deg, #FFF6D6, #FFD978);
    box-shadow: 0 0 12px rgba(var(--ice-rgb), 0.4);
}
.tweet-avatar { width: 38px; height: 38px; font-size: 0.9rem; }
.tweet-username { gap: 6px; font-size: 0.92rem; }
.tweet-link {
    font-family: 'Varela Round', var(--font);
    font-weight: 400;
    color: var(--ink);
}
.tweet-link:hover { color: var(--reward-light); }
.tweet-room-link {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--ice-ink);
    background: rgba(var(--ice-rgb), 0.16);
    box-shadow: inset 0 0 0 0.5px rgba(var(--ice-rgb), 0.35);
}
.tweet-room-link:hover { color: var(--ice-ink); background: rgba(var(--ice-rgb), 0.26); }
.tweet-time { font-family: var(--font); font-size: 0.7rem; font-weight: 700; color: var(--ink-3); }
.tweet-content {
    font-size: 0.92rem;
    line-height: 1.45;
    font-weight: 500;
    color: var(--ink-2);
}
.tweet-mention { color: var(--ice-ink); font-weight: 800; }
.tweet-mention:hover { color: var(--ice-ink); }

/* Compact thumbnails: capped height, natural aspect, centred. Tap opens
   the full-size image in the lightbox. */
.tweet-media {
    position: relative;
    margin: 8px 0 0;
    border: 0;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.42);
    box-shadow: var(--inlay-shadow);
}
.tweet-media img {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 220px;
    margin: 0 auto;
    object-fit: contain;
    background: transparent;
    cursor: zoom-in;
}
.tweet-zoom {
    position: absolute;
    top: 8px;
    right: 8px;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 0.75rem;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: var(--inlay-shadow);
    pointer-events: none;
}
.tweet-caption {
    padding: 8px 10px 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ink);
    border-top: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.5));
}
.tweet-media--audio { padding: 10px; }

.rt-original {
    margin-top: 8px;
    padding: 8px 10px;
    border: 0;
    border-radius: 16px;
}
.rt-original-user { color: var(--ink); }
.rt-original-text { color: var(--ink-2); font-size: 0.86rem; }

.tweet-footer {
    gap: 6px;
    margin-top: 8px;
    padding-top: 0;
    border-top: 0;
}
.tweet-action {
    height: 30px;
    padding: 0 11px;
    gap: 6px;
    border-radius: 999px;
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--ink-2);
    background: rgba(255, 255, 255, 0.4);
    box-shadow: inset 0 1px 0 #fff, inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}
.tweet-action .bi-heart-fill { color: var(--rose); }
.tweet-action .bi-chat-fill { color: var(--ice-ink); }
button.tweet-action { border: 0; display: inline-flex; align-items: center; }
.tweet-action--btn { margin: 0; cursor: pointer; transition: box-shadow 0.3s var(--ease-out), transform 0.2s; }
.tweet-action--btn:hover { color: var(--ink); background: rgba(255, 255, 255, 0.55); box-shadow: var(--inlay-shadow-hover); }
.tweet-action--btn:active { transform: scale(0.95); }
.tweet-action:hover { color: var(--ink); }
.tweet-opened { padding-top: 6px; font-size: 0.72rem; font-weight: 700; color: var(--ink-3); }

.tweet-replies {
    margin-top: 8px;
    padding: 0 10px;
    border-top: 0;
    border-radius: 16px;
}
.reply-row { padding: 7px 0; }
.reply-row + .reply-row { border-top: 1px solid rgba(28, 22, 6, 0.08); }
.reply-avatar { width: 26px; height: 26px; }
.reply-time { font-family: var(--font); font-weight: 700; color: var(--ink-3); }
.reply-text { font-size: 0.82rem; line-height: 1.4; color: var(--ink-2); }
.reply-more { font-weight: 700; color: var(--ink-3); }

/* ----- Tweet search (mobile first) ----- */
.tweet-finder {
    margin-bottom: 12px;
    padding: 8px;
    border-radius: var(--glass-radius);
}
.finder-modes {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.28);
    box-shadow: inset 0 1px 2px rgba(122, 74, 0, 0.12), inset 0 0 0 0.5px rgba(255, 255, 255, 0.6);
}
.finder-mode {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 40px;
    padding: 0 6px;
    border: 0;
    border-radius: 12px;
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--ink-2);
    background: transparent;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.2s, color 0.2s;
}
.finder-mode i { font-size: 0.95rem; color: var(--ink-3); }
.finder-mode[aria-pressed="true"] {
    color: var(--ink);
    background: linear-gradient(180deg, #fff, rgba(255, 255, 255, 0.84));
    box-shadow: var(--inlay-shadow-hover);
}
.finder-mode[aria-pressed="true"] i { color: var(--ember); }
.finder-mode:focus-visible { outline: 2px solid var(--ice-ink); outline-offset: 1px; }

.finder-field {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 4px 4px 4px 14px;
    border-radius: 999px;
    background: var(--glass-inlay);
    box-shadow: var(--inlay-shadow);
    transition: box-shadow 0.2s;
}
.finder-field:focus-within { box-shadow: var(--inlay-shadow-hover), 0 0 0 3px rgba(var(--ice-rgb), 0.3); }
.finder-icon { flex: 0 0 auto; font-size: 1rem; color: var(--ink-3); }
.finder-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 42px;
    padding: 0 2px;
    border: 0;
    outline: none;
    background: transparent;
    font-family: var(--font);
    font-size: 16px; /* no iOS zoom */
    font-weight: 700;
    color: var(--ink);
}
.finder-input::placeholder { color: var(--ink-3); font-weight: 600; }
.finder-input::-webkit-search-cancel-button { display: none; }
.finder-clear {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    font-size: 0.8rem;
    color: var(--ink-2);
    background: rgba(28, 22, 6, 0.08);
}
.finder-clear:hover { color: var(--ink); background: rgba(28, 22, 6, 0.14); }
.finder-go {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    font-family: var(--font);
    font-size: 0.88rem;
    font-weight: 800;
    color: #FFF7DE;
    background: linear-gradient(180deg, #3A3018 0%, #17120A 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 0 14px rgba(var(--ice-rgb), 0.35), 0 8px 16px -10px rgba(0, 0, 0, 0.6);
    transition: transform 0.2s var(--ease-out);
}
.finder-go:active { transform: scale(0.96); }
.finder-hint {
    margin: 8px 6px 2px;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--ink-3);
}

.tweet-types { margin-bottom: 10px; }
.tweet-types .filter-tab i { font-size: 0.85rem; }

/* Active filters as removable chips + live count */
.tweet-active {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    min-height: 24px;
    margin-bottom: 12px;
}
.tweet-chips { display: contents; }
.tweet-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    min-height: 32px;
    padding: 0 8px 0 12px;
    border: 0;
    border-radius: 999px;
    font-family: var(--font);
    font-size: 0.78rem;
    color: var(--ink);
    background: var(--glass-inlay);
    box-shadow: var(--inlay-shadow);
    transition: transform 0.2s var(--ease-out);
}
.tweet-chip:active { transform: scale(0.96); }
.tweet-chip-label { font-weight: 700; color: var(--ink-3); }
.tweet-chip-value {
    overflow: hidden;
    max-width: 14rem;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-weight: 800;
}
.tweet-chip i {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 0.9rem;
    color: var(--ink-2);
    background: rgba(28, 22, 6, 0.08);
}
.tweet-chip--clear {
    padding: 0 14px;
    font-weight: 800;
    color: var(--rose);
}
.tweet-count {
    margin-left: auto;
    font-size: 0.76rem;
    font-weight: 800;
    color: var(--ink-3);
    font-variant-numeric: tabular-nums;
}
.tweet-empty .tweet-chip { margin-top: 12px; }

/* Retweets: who retweeted on top, the original author on the card */
.tweet-rt {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: -2px 0 8px;
    padding: 0 0 8px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--ink-2);
    border-bottom: 1px solid rgba(28, 22, 6, 0.08);
}
.tweet-rt-icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.8rem;
    color: #fff;
    background: linear-gradient(145deg, #34D88E, #0E9F5B);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 4px 10px -4px rgba(14, 159, 91, 0.7);
}
.tweet-rt-text { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.tweet-rt-text .tweet-link { font-size: 0.82rem; }
.tweet-rt-time { flex: 0 0 auto; font-size: 0.7rem; font-weight: 700; color: var(--ink-3); }
.tweet-card--rt { box-shadow: var(--glass-shadow), inset 3px 0 0 rgba(22, 193, 114, 0.55); }

@media (min-width: 576px) {
    .finder-modes { display: inline-grid; width: auto; grid-template-columns: repeat(4, auto); }
    .finder-mode { padding: 0 16px; }
}

/* Tweets switched off (Features:TweetsEnabled = false) */
.tweets-paused {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 34px 22px 28px;
    border-radius: var(--glass-radius);
    text-align: center;
    background:
        radial-gradient(130% 80% at 0% 0%, rgba(255, 255, 255, 0.62) 0%, rgba(255, 255, 255, 0) 46%),
        linear-gradient(180deg, rgba(255, 253, 244, 0.5), rgba(255, 251, 236, 0.3));
    box-shadow: var(--glass-shadow);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
}
.tweets-paused-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin-bottom: 4px;
    border-radius: 22px;
    font-size: 1.8rem;
    color: var(--ember);
    background: var(--glass-inlay);
    box-shadow: var(--inlay-shadow), 0 0 22px rgba(255, 176, 32, 0.45);
}
.tweets-paused h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.7rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: var(--ink);
}
.tweets-paused p {
    max-width: 22rem;
    margin: 0 0 8px;
    font-weight: 600;
    color: var(--ink-2);
}

/* ===== PROFILE ===== */
.profile-cover {
    --cover-ratio: 4 / 5;
    display: block;
    width: 100%;
    aspect-ratio: var(--cover-ratio);
    margin-bottom: 12px;
    overflow: hidden;
    border-radius: 28px;
    background: linear-gradient(160deg, #FFF3C4, #FFC94A);
}
.profile-cover-img,
.profile-cover-fallback {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.profile-cover-img { z-index: 1; object-fit: cover; object-position: center top; }
.profile-cover-fallback {
    z-index: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Varela Round', var(--font);
    font-size: 5rem;
    color: rgba(28, 22, 6, 0.35);
    background:
        radial-gradient(circle at 50% 36%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 55%),
        linear-gradient(160deg, #FFF3C4, #FFC94A);
}
.profile-cover-overlay {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 2;
    padding: 14px 16px;
    overflow: hidden;
    isolation: isolate;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.5);
    box-shadow: var(--inlay-shadow), 0 0 18px rgba(var(--ice-rgb), 0.35);
}
.profile-cover-overlay::before {
    left: -10px;
    right: -10px;
    bottom: -10px;
    aspect-ratio: var(--cover-ratio);
    filter: blur(16px) saturate(1.5) brightness(1.25);
}
.profile-cover .profile-name,
.profile-name {
    margin: 0;
    font-family: 'Varela Round', var(--font);
    font-weight: 400;
    font-size: 1.7rem;
    line-height: 1.12;
    letter-spacing: 0;
    color: var(--ink);
    overflow-wrap: anywhere;
}
.profile-meta { gap: 6px; margin-top: 8px; }
.profile-badge {
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--ink-2);
    background: rgba(255, 255, 255, 0.6);
    box-shadow: inset 0 1px 0 #fff, 0 0 8px rgba(var(--ice-rgb), 0.3);
}
.profile-badge i { color: var(--ember); }
.profile-badge .bi-patch-check-fill { color: var(--ice-ink); }

.profile-stats-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}
.pstat {
    padding: 14px 6px 12px;
    border-radius: 18px;
}
.pstat:hover { transform: translateY(-2px); box-shadow: var(--glass-shadow-hover); }
.pstat-val {
    font-family: var(--font);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}
.pstat:first-child .pstat-val { color: var(--reward-light); }
.pstat-label { font-size: 0.58rem; font-weight: 800; letter-spacing: 0.06em; color: var(--ink-3); }

.profile-grid { grid-template-columns: 1fr; gap: 0; }
.profile-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.pd-item,
.pd-item:hover {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
    margin: 0;
    padding: 10px 12px;
    border: 0;
    border-radius: 14px;
}
.pd-item:last-child { border-bottom: 0; }
.pd-label { font-size: 0.64rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.pd-val {
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 800;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}
.profile-sub-head {
    margin: 16px 0 8px;
    padding-top: 0;
    border-top: 0;
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--ink-2);
}
a.profile-room { text-decoration: none; color: inherit; }
.profile-room .lb-avatar { color: var(--ember) !important; }
.profile-room-go { margin-left: 2px; font-size: 0.78rem; color: var(--ink-3); }

.profile-links { gap: 8px; }
.profile-link-item,
.profile-link-item:hover {
    min-height: 54px;
    padding: 0 14px 0 8px;
    gap: 12px;
    border: 0;
    border-radius: 16px;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--ink);
    transform: none;
}
.profile-link-item i:first-child {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    font-size: 1rem;
    color: var(--ember);
    background: linear-gradient(180deg, #fff, rgba(255, 255, 255, 0.7));
    box-shadow: inset 0 1px 0 #fff, 0 4px 10px -6px rgba(122, 74, 0, 0.5);
}
.profile-link-item i:last-child { color: var(--ink-3); transition: transform 0.25s var(--ease-out); }
.profile-link-item:hover i:last-child { transform: translateX(3px); }

/* ===== XMONEY HISTORY ===== */
.xm-header {
    gap: 14px;
    padding: 14px;
    margin-bottom: 14px;
    border-radius: var(--glass-radius);
}
.xm-avatar {
    border: 3px solid #fff;
    box-shadow: 0 0 16px rgba(var(--ice-rgb), 0.5);
}
.xm-avatar-fb { color: var(--ink-2); background: linear-gradient(160deg, #FFF6D6, #FFD978); }
.xm-username { font-family: 'Varela Round', var(--font); font-weight: 400; color: var(--ink); }
.xm-balance { color: var(--ink-2); font-weight: 600; }
.xm-balance strong { font-family: var(--font); font-weight: 800; color: var(--reward-light); }
.xm-row {
    margin: 0 0 8px;
    padding: 10px 12px;
    border: 0;
    border-radius: 16px;
}
.xm-row:last-child { margin-bottom: 0; }
.xm-icon { border-radius: 12px; }
.xm-room { color: var(--ink); }
.xm-row-bot { color: var(--ink-3); font-weight: 600; }
.xm-time { font-family: var(--font); font-weight: 700; }
.xm-amt { font-family: var(--font); font-weight: 800; }

/* ===== MODALS / LIGHTBOX ===== */
.modal-backdrop {
    --bs-backdrop-bg: rgba(110, 70, 0, 0.3);
    --bs-backdrop-opacity: 1;
}
.modal-content,
.likes-modal-content {
    border-radius: 26px;
    overflow: hidden;
    color: var(--ink);
}
.likes-modal-header,
.modal-header,
.modal-footer {
    padding: 14px 16px 10px;
    background: transparent;
    border: 0;
}
.likes-modal-header .btn-close {
    filter: none;
    opacity: 0.7;
    border-radius: 50%;
}
.likes-modal-title { font-family: var(--font); font-weight: 800; color: var(--ink); }
.likes-modal-body { padding: 0 10px 12px; }
.like-row {
    margin: 0 0 6px;
    padding: 8px 10px;
    border: 0;
    border-radius: 14px;
}
.like-row:last-child { border-bottom: 0; }
.like-row:hover { color: var(--ink); }
.like-name { font-family: 'Varela Round', var(--font); font-weight: 400; color: var(--ink); }
.like-room { color: var(--ice-ink); font-weight: 700; }
.like-time { font-family: var(--font); font-weight: 700; color: var(--ink-3); }

.img-lightbox { background: rgba(28, 22, 6, 0.88); }
/* Full size: the picture fills the screen (keeping its proportions),
   even when the original is small. */
.img-lightbox { padding: calc(64px + env(safe-area-inset-top, 0px)) 12px calc(24px + env(safe-area-inset-bottom, 0px)); }
.img-lightbox img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: none;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.5));
}
.img-lightbox-close {
    top: calc(16px + env(safe-area-inset-top, 0px));
    right: 16px;
    border: 0;
    color: var(--ink);
    background: var(--glass-inlay);
    box-shadow: var(--inlay-shadow);
}
.img-lightbox-close:hover { color: var(--ink); background: var(--glass-inlay); box-shadow: var(--inlay-shadow-hover); }

/* ===== FOOTER ===== */
.site-foot {
    position: relative;
    z-index: 1;
    margin: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px));
    padding: 14px 0;
    border-radius: 22px;
}
.foot-copy { color: var(--ink-3); font-weight: 700; }

/* ===== EMPTY / LOADING / ERRORS ===== */
.loading-indicator { font-family: var(--font); font-weight: 700; color: var(--ink-3); }
.spinner-ring { border-color: rgba(255, 255, 255, 0.7); border-top-color: var(--ember); }
.empty-state { color: var(--ink-3); }
.empty-state i { opacity: 0.5; }
.empty-state p { font-weight: 700; }

.error-card {
    padding: 32px 20px;
    border-radius: 28px;
}
.error-code {
    background: linear-gradient(135deg, var(--ember) 10%, #FFB020 45%, var(--ice-ink) 90%);
    -webkit-background-clip: text;
    background-clip: text;
}
.error-title { color: var(--ink); }
.error-text { color: var(--ink-2); }

/* Utilities on the light field */
.text-cyan { color: var(--ice-ink) !important; }
.text-muted-x { color: var(--ink-3) !important; }

/* Entrances are Web Animations (XRise in scene.js). CSS only holds the
   hidden state until an element is revealed — no transition here, or the
   two would run at once. */
.animate-in { transform: none; transition: none; }
.animate-in.is-visible { opacity: 1; }
.await-reveal { opacity: 0; }

/* Cards never keyframe-animate on their own; XRise owns the entrance. */
.lb-row,
.tweet-card,
.user-card,
.cover-card,
.user-card-grid > *:nth-child(n) { animation: none; }

/* ===== WIDER SCREENS ===== */
@media (min-width: 576px) {
    .cover-card-grid { gap: 12px; }
    .profile-cover { --cover-ratio: 3 / 2; }
}

@media (min-width: 768px) {
    .main-wrap { padding-top: 104px; padding-bottom: 40px; }
    .container { padding-left: 16px; padding-right: 16px; }
    .topbar,
    .topbar.scrolled { top: 16px; width: calc(100% - 32px); border-radius: 24px; }
    .topbar .container.topbar-inner { height: 64px; padding: 0 10px 0 20px; }
    .brand-logo { height: 28px; }
    .page-hero { margin-bottom: 24px; }
    .page-hero h1 { font-size: 3rem; }
    .section-divider h2 { font-size: 1.8rem; }
    .arena-card { margin-bottom: 16px; }
    .card-head { padding: 18px 18px 8px; }
    .card-body-inner { padding: 8px 16px 16px; }
    .stat-trio { gap: 14px; margin-bottom: 26px; }
    .stat-card { padding: 22px 12px 18px; }
    .profile-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
    .profile-stats-row { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; }
    .site-foot { margin: 8px auto 16px; max-width: 1140px; width: calc(100% - 32px); }
    .user-card-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
    .cover-card-overlay { left: 8px; right: 8px; bottom: 8px; padding: 10px 12px; }
    .tweet-media img { max-height: 300px; }
    .cover-card-overlay::before { left: -8px; right: -8px; bottom: -8px; }
}

@media (min-width: 992px) {
    .cover-card-grid { gap: 14px; }
    /* Profile: portrait on the left, numbers on the right. */
    .profile-page {
        display: grid;
        grid-template-columns: 340px minmax(0, 1fr);
        column-gap: 20px;
        align-items: start;
    }
    .profile-page > .profile-cover {
        grid-row: 1 / span 2;
        position: sticky;
        top: 104px;
        --cover-ratio: 3 / 4;
        margin-bottom: 0;
    }
    .profile-page > .profile-stats-row,
    .profile-page > .profile-grid { grid-column: 2; }
    .profile-page .profile-grid { grid-template-columns: 1fr 1fr; }
    .profile-detail-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .profile-grid .profile-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1200px) {
    .profile-grid .profile-detail-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
