/* ======================================================================
   PROFILE PANEL + HEADER BALANCE  (Kartoosh parity, mobile + desktop)
   ----------------------------------------------------------------------
   Kartoosh opens the profile as a full-screen overlay rather than a page:
   a green "Solde principal" card with Deposit / Withdraw, a gold bonus
   card, the username, then grouped collapsible sections. Desktop splits it
   into a 314px side panel plus a content area; mobile is one sheet.

   The desktop header shows a gold Deposit pill and the balance as plain
   white text, not the username in a dark pill.
   ====================================================================== */

/* ---------- section content inside the panel ---------- */
.kt-profile__view {
    margin-top: 12px;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.kt-profile__view[hidden] {
    display: none;
}

.kt-profile__view-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.kt-profile__view-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    background: transparent;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.kt-profile__view-back:hover {
    background: rgba(255, 255, 255, 0.08);
}

.kt-profile__view-back svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.kt-profile__view-title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kt-profile__view-body {
    position: relative;
    height: 62vh;
    min-height: 320px;
    background: #18232d;
}

.kt-profile__frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #18232d;
    opacity: 1;
    transition: opacity 140ms ease-out;
}

/* The old page paints its own header and modal overlays before our chrome CSS
   lands. Keeping the frame transparent until profile-panel.js has hidden them
   removes the flash of the old page entirely. */
.kt-profile__frame.is-loading {
    opacity: 0;
}

/* Shown while the section is being prepared. */
.kt-profile__loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #18232d;
}

.kt-profile__spin {
    width: 26px;
    height: 26px;
    border: 2px solid rgba(255, 255, 255, 0.16);
    border-top-color: #f8c524;
    border-radius: 50%;
    animation: kt-profile-spin 700ms linear infinite;
}

@keyframes kt-profile-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .kt-profile__frame {
        transition: none;
    }

    .kt-profile__spin {
        animation-duration: 2.4s;
    }
}

/* Shown when the old page has no implementation for the requested section. */
.kt-profile__na {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px;
    text-align: center;
    background: #18232d;
}

.kt-profile__na-title {
    margin: 0;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
}

.kt-profile__na-body {
    margin: 0;
    max-width: 30ch;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    line-height: 1.45;
}

/* When a section is open, the menu and balance cards step aside so the
   content gets the space. The class goes on the .kt-profile root, which is
   what profile-panel.js toggles. */
.kt-profile.is-view .kt-profile__nav,
.kt-profile.is-view .kt-profile__foot {
    display: none;
}

.kt-profile.is-view .kt-profile__view {
    margin-top: 14px;
}

/* ---------- desktop header ---------- */
.tb-deposit-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 10px;
    border-radius: 4px;
    background: #f8c524;
    color: #000205;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s ease;
}

.tb-deposit-btn:hover {
    background: #ffd23f;
}

.tb-deposit-btn svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: 0 0 16px;
}

.tb-balance {
    color: #ffffff;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    padding: 0 4px;
}

.tb-balance:hover {
    color: #f8c524;
}

/* Kartoosh shows the username in the avatar menu, not in the bar. */
.topbar .tb-account {
    display: none;
}

/* ---------- panel shell ---------- */
.kt-profile {
    position: fixed;
    inset: 0;
    z-index: 10500;
}

.kt-profile[hidden] {
    display: none;
}

.kt-profile__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
}

.kt-profile__panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #18232d;
    padding: 56px 12px 28px;
}

.kt-profile__close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
}

.kt-profile__close:hover {
    background: rgba(255, 255, 255, 0.16);
}

/* ---------- balance card (green) ---------- */
.kt-profile__amounts {
    background: linear-gradient(135deg, #17b978 0%, #0f9c63 100%);
    border-radius: 12px;
    padding: 14px;
}

.kt-profile__amount {
    display: flex;
    align-items: center;
    gap: 10px;
}

.kt-profile__amount-texts {
    min-width: 0;
    flex: 1 1 auto;
}

.kt-profile__amount-label {
    display: block;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
}

.kt-profile__amount-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    line-height: 1.25;
}

.kt-profile__eye {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    cursor: pointer;
}

.kt-profile__eye svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.kt-profile__amount-buttons {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.kt-profile__btn {
    flex: 1 1 0;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.92);
    color: #0f7a4e;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    text-transform: uppercase;
}

.kt-profile__btn:hover {
    background: #fff;
}

/* ---------- bonus card (gold) ---------- */
.kt-profile__bonus {
    position: relative;
    margin-top: 12px;
    padding: 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8c524 0%, #e0a90d 100%);
    color: #241a00;
}

.kt-profile__bonus-label {
    display: block;
    font-size: 13px;
    opacity: 0.85;
}

.kt-profile__bonus-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
}

.kt-profile__bonus-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.15);
    font-size: 13px;
}

.kt-profile__bonus-row-value {
    font-weight: 700;
}

/* ---------- username row ---------- */
.kt-profile__id {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 4px;
}

.kt-profile__avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.kt-profile__avatar svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.kt-profile__id-name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 14px;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kt-profile__copy {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
}

.kt-profile__copy svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.kt-profile__copy.is-copied {
    color: #4ade80;
}

/* ---------- grouped navigation ---------- */
.kt-profile__group {
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    margin-bottom: 8px;
    overflow: hidden;
}

.kt-profile__group-head {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.kt-profile__group-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.kt-profile__group-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.kt-profile__group-title {
    flex: 1 1 auto;
    text-transform: uppercase;
}

.kt-profile__group-chev {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.18s ease;
}

.kt-profile__group.is-open .kt-profile__group-chev {
    transform: rotate(180deg);
}

.kt-profile__group-body {
    padding: 0 14px 10px 46px;
}

.kt-profile__group-body[hidden] {
    display: none;
}

.kt-profile__link {
    display: block;
    padding: 7px 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    text-decoration: none;
}

.kt-profile__link:hover {
    color: #fff;
}

/* ---------- promo + logout ---------- */
.kt-profile__foot {
    margin-top: 14px;
}

.kt-profile__promo {
    display: flex;
    gap: 10px;
}

.kt-profile__promo-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 42px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 14px;
}

.kt-profile__promo-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.kt-profile__promo-apply {
    flex: 0 0 96px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
}

.kt-profile__promo-apply:hover {
    background: rgba(255, 255, 255, 0.12);
}

.kt-profile__logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
    margin-top: 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
}

.kt-profile__logout:hover {
    background: rgba(255, 255, 255, 0.12);
}

.kt-profile__logout svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

body.kt-profile-open {
    overflow: hidden;
}

/* ---------- desktop: side panel + content column ---------- */
@media (min-width: 901px) {
    .kt-profile__panel {
        top: 50%;
        left: 50%;
        right: auto;
        bottom: auto;
        transform: translate(-50%, -50%);
        width: 320px;
        max-height: calc(100vh - 100px);
        border-radius: 14px;
        padding: 18px 14px 22px;
    }

    .kt-profile__close {
        top: 10px;
        right: 10px;
    }

    /* The desktop bar carries the gold Deposit pill; the plain balance text
       sits beside it. Neither is repeated inside the panel. */
    .tb-account {
        display: none;
    }
}

@media (max-width: 900px) {
    /* Mobile shows the balance as plain text, like Kartoosh. No deposit pill:
       the panel has the Deposit button. */
    .tb-deposit-btn {
        display: none;
    }

    .tb-balance {
        display: inline-flex;
        align-items: center;
        height: 28px;
        padding: 0 8px;
        border-radius: 4px;
        background: rgba(255, 255, 255, 0.08);
        font-size: 13px;
    }

    /* The mobile chip used to carry .btn .s-small .sign-in, which painted it as a
       gold button. Kartoosh shows the balance as plain white text. The chip
       picked up its gold from a rule in joker-mobile.css, which loads after
       this file, so the override needs !important to win. */
    .hdr-user-bc .hdr-user-chip,
    .hdr-user-bc a.hdr-user-chip {
        display: inline-flex !important;
        align-items: center;
        height: auto !important;
        min-height: 0;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0;
        background: transparent !important;
        background-image: none !important;
        box-shadow: none !important;
        color: #ffffff !important;
        font-size: 14px;
        font-weight: 500;
        line-height: 1.2;
        text-decoration: none;
        text-transform: none;
        letter-spacing: 0;
        white-space: nowrap;
        cursor: pointer;
    }

    .hdr-user-bc .hdr-user-chip:hover,
    .hdr-user-bc a.hdr-user-chip:hover {
        background: transparent !important;
        color: #f8c524 !important;
    }

    .hdr-user-bc .hdr-user-chip span {
        background: transparent !important;
        color: inherit !important;
    }

    /* Kartoosh keeps a profile icon immediately right of the mobile balance.
       Plain white glyph on nothing, matching the balance's weight, with a tap
       target large enough for a thumb. joker-mobile.css loads later, so the
       properties it could repaint are forced. */
    .hdr-user-bc .hdr-profile-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        width: 26px !important;
        min-width: 26px;
        height: 26px !important;
        min-height: 0;
        margin-left: 6px;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 50%;
        background: transparent !important;
        background-image: none !important;
        box-shadow: none !important;
        color: #ffffff !important;
        line-height: 0;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .hdr-user-bc .hdr-profile-btn svg {
        width: 19px;
        height: 19px;
        display: block;
        fill: currentColor;
        pointer-events: none;
    }

    .hdr-user-bc .hdr-profile-btn:hover,
    .hdr-user-bc .hdr-profile-btn:focus-visible {
        background: rgba(255, 255, 255, 0.1) !important;
        color: #ffffff !important;
        outline: none;
    }

    .hdr-user-bc .hdr-profile-btn:active {
        background: rgba(255, 255, 255, 0.16) !important;
    }
}