/* Display currency (public/assets/js/money.js): rubles by default (.currency-rub on <html>), coins when chosen */

.currency-rub .myicon-coins:before {
    content: "";
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    background: url("/assets/images/currencies/rub-circle.svg") center / contain no-repeat;
}

/* Lost amounts grey the coin glyph through color, which a background image ignores; mute the ruble icon the same way */
.currency-rub .coins_lost .myicon-coins:before {
    filter: grayscale(1) brightness(.67);
}

/* Coin-specific information (e.g. the "1 RUB ≈ 10 coins" rate) is meaningless when amounts are shown in rubles */
.currency-rub .currency-coin-only {
    display: none !important;
}

/* Rank/bonus tables colour every span in a cell to paint the coin icon; amounts rendered as spans keep the cell colour */
.ranks-table td div span[data-coins] {
    color: inherit;
}

/* The "coins" option in the switcher always shows the coin glyph */
.currency-rub .currency-switch__coin:before {
    content: "\e973";
    width: auto;
    height: auto;
    vertical-align: baseline;
    background: none;
}

.currency-switch__toggle {
    padding: 0;
    border: 0;
    background: none;
    font-size: inherit;
    line-height: inherit;
    cursor: pointer;
    transition: opacity .15s ease;
}

.currency-switch__toggle:hover {
    opacity: .75;
}

.currency-switch__menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 1000;
    min-width: 160px;
    padding: 6px;
    border: 1px solid #2b2b2b;
    border-radius: 8px;
    background: #181818;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
}

.currency-switch__menu.open {
    display: block;
}

.currency-switch__option {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 6px;
    background: none;
    color: #cdcdcd;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.currency-switch__option:hover {
    background: #242424;
    color: #fff;
}

.currency-switch__option img,
.currency-switch__option .currency-switch__coin {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    font-size: 16px;
    color: #ffc200;
}

.currency-coin .currency-switch__option[data-currency="coin"],
.currency-rub .currency-switch__option[data-currency="rub"] {
    background: #202020;
    color: #ffc200;
}

/* Social link bonus badges on the profile show a bare number; mark it as rubles in ruble mode */
.currency-rub .login__social-bonus [data-coins]:after {
    content: " ₽";
}
