/*
 * Additions required by the backend integration (login/logout, rankings, profiles, news detail).
 * Uses the original template palette (#131313, #292621, #c4b69b, #d88b00, #fe9900) so the look stays the same.
 */

/* Header: logout is a POST form rendered like the other #commonGnb links */
.gnb-inline-form {
    display: inline;
    margin: 0;
}

.gnb-link-button {
    padding: 0;
    cursor: pointer;
    color: #c4b69b;
    font-family: "Roboto", 'Lucida Sans';
    font-size: 15px;
    font-weight: 500;
    line-height: 33px;
    text-transform: uppercase;
    background: none;
    border: 0;
}

.gnb-link-button:hover,
.gnb-link-button:focus {
    color: #ffa90f;
}

/* Login / register modals */
.register-honeypot {
    position: absolute !important;
    left: -10000px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.register-status.is-error {
    color: #ff6b4a;
}

.register-status.is-success {
    color: #8fd16a;
}

.register-form input.is-invalid {
    outline: 2px solid #ff6b4a;
    outline-offset: 1px;
}

.register-submit[disabled] {
    cursor: wait;
    opacity: .7;
}

.register-switch {
    margin-top: 10px;
    font-size: 14px;
}

.register-switch a {
    color: #f58220;
}

/* Flash message after a non-JavaScript form post */
.site-flash {
    position: fixed;
    top: 12px;
    left: 50%;
    z-index: 10001;
    max-width: 90vw;
    padding: 10px 22px;
    color: #131313;
    font: 500 15px/1.4 "Roboto", Arial, sans-serif;
    background: #fe9900;
    transform: translateX(-50%);
}

.site-flash-error {
    color: #fff;
    background: #b3321b;
}

/* Home page ranking panel: rows link to player profiles without changing their look */
#ranking h2 a,
#ranking ul li a.rank-link {
    display: block;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

#ranking h2 a {
    display: inline;
}

/* Rankings: the original wrapper had a fixed height for an empty table */
#baseSingleBodyWrapper .rankingWrapper .search_result_wrapper {
    height: auto;
}

.ranking-tabs {
    display: flex;
    gap: 2px;
    margin: 12px 0 0 2px;
    list-style: none;
}

.ranking-tabs a {
    display: inline-block;
    padding: 0 24px;
    color: #c4b69b;
    font-size: 15px;
    line-height: 36px;
    text-decoration: none;
    background: #292621;
}

.ranking-tabs a:hover {
    color: #131313;
    background: #c4b69b;
}

.ranking-tabs a.on {
    color: #000;
    font-weight: 500;
    background: #fe9900;
}

.ranking-note {
    margin-top: -20px;
    color: #9e9282;
    font-size: 13px;
}

.ranking_tbl td.ranking-empty {
    padding: 30px 0;
    color: #9e9282;
}

.ranking_tbl .rank-icon {
    width: 24px;
    height: 24px;
    margin-right: 6px;
    vertical-align: middle;
}

.ranking_tbl .clan-emblem {
    width: 22px;
    height: 22px;
    margin-right: 6px;
}

.ranking_tbl .flag-icon {
    width: 22px;
    height: 16px;
}

.ranking_tbl .role-master {
    color: #ff9e00;
}

.ranking_tbl .role-officer {
    color: #d8c38b;
}

/* Profile / clan detail header */
.profile-card {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    align-items: center;
    width: 1070px;
    margin: 40px auto 0 auto;
    padding: 30px 35px;
    color: #c4b69b;
    text-align: left;
    background: #292621;
    box-sizing: border-box;
}

.profile-card .profile-emblem {
    width: 64px;
    height: 64px;
}

.profile-card .profile-rank {
    width: 48px;
    height: 48px;
}

.profile-card h3 {
    margin: 0;
    color: #fff;
    font-size: 30px;
    font-weight: 400;
}

.profile-card .profile-sub {
    margin-top: 6px;
    color: #9e9282;
    font-size: 15px;
}

.profile-card .profile-sub a {
    color: #d88b00;
}

.profile-status {
    display: inline-block;
    margin-left: 10px;
    padding: 0 10px;
    font-size: 13px;
    line-height: 24px;
    vertical-align: middle;
    background: #0a0a0a;
}

.profile-status.on {
    color: #8fd16a;
}

.profile-status.off {
    color: #6e6458;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    width: 1070px;
    margin: 2px auto 0 auto;
    list-style: none;
}

.profile-stats li {
    padding: 18px 20px;
    text-align: left;
    background: #0a0a0a;
}

.profile-stats .dt {
    display: block;
    color: #9e9282;
    font-size: 13px;
    text-transform: uppercase;
}

.profile-stats .dd {
    display: block;
    margin-top: 6px;
    color: #c4b69b;
    font-size: 22px;
}

.profile-notice {
    width: 1070px;
    margin: 2px auto 0 auto;
    padding: 18px 20px;
    color: #c4b69b;
    text-align: left;
    white-space: pre-line;
    background: #0a0a0a;
    box-sizing: border-box;
}

.profile-back {
    width: 1070px;
    margin: 25px auto 0 auto;
    text-align: left;
}

.profile-back a {
    color: #d88b00;
    text-decoration: none;
}

/* News detail uses the template's .board_detail styles; only images need sizing */
#bodyContentsWrapper .board_detail .board_image {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 30px 0 0 0;
}

#bodyContentsWrapper .board_detail div.board_details p {
    margin: 0 0 1em 0;
}

#bodyContentsWrapper .board_detail div.board_details a {
    color: #d88b00;
}

#bodyContentsWrapper .board_list .board_list_table td.board_list_table_empty {
    height: 59px;
    line-height: 59px;
    text-align: center;
    color: #9e9282;
}

.pinned-mark {
    margin-right: 6px;
    color: #ff9e00;
}

/* Live username availability hint under the register field */
.register-field-hint {
    display: block;
    min-height: 0;
    margin-top: 5px;
    font-size: 12px;
    line-height: 15px;
    text-align: left;
}

.register-field-hint:empty {
    display: none;
}

.register-field-hint.is-checking {
    color: #9e9282;
}

.register-field-hint.is-available {
    color: #8fd16a;
}

.register-field-hint.is-taken {
    color: #ff6b4a;
}

.register-form input.is-valid {
    outline: 2px solid #8fd16a;
    outline-offset: 1px;
}

/* Security question in the register form / account page */
.register-form select.register-select {
    box-sizing: border-box;
    display: block;
    width: 100%;
    height: 43px;
    padding: 0 8px;
    color: #202020;
    font-size: 15px;
    background: #f5f5f7;
    border: 1px solid #aaa;
}

.register-form select.register-select:focus {
    outline: 2px solid #f58220;
    outline-offset: 1px;
}

.register-form select.register-select.is-invalid {
    outline: 2px solid #ff6b4a;
}

.register-security-note {
    margin: 0 0 10px;
    padding: 9px 11px;
    color: #ffd29a;
    font-size: 12.5px;
    line-height: 17px;
    text-align: left;
    background: rgba(245, 130, 32, .14);
    border-left: 3px solid #f58220;
}

/* Registration success: green check, then the login dialog opens */
.register-success[hidden] {
    display: none;
}

.register-success {
    padding: 30px 10px 20px;
    text-align: center;
}

.register-success-check {
    position: relative;
    display: inline-block;
    width: 96px;
    height: 96px;
    background: #2e9e44;
    border-radius: 50%;
    box-shadow: 0 0 0 6px rgba(46, 158, 68, .25);
    animation: register-pop .35s ease-out both;
}

.register-success-check::after {
    content: "";
    position: absolute;
    top: 22px;
    left: 35px;
    width: 22px;
    height: 42px;
    border: solid #fff;
    border-width: 0 7px 7px 0;
    transform: rotate(45deg);
    animation: register-tick .3s .25s ease-out both;
}

.register-success-title {
    margin: 22px 0 8px;
    color: #8fd16a;
    font-size: 24px;
}

.register-success-text {
    color: #ddd;
    font-size: 15px;
}

.register-success-redirect {
    margin-top: 14px;
    color: #9e9282;
    font-size: 13px;
}

@keyframes register-pop {
    from { transform: scale(.3); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes register-tick {
    from { opacity: 0; transform: rotate(45deg) scale(.4); }
    to { opacity: 1; transform: rotate(45deg) scale(1); }
}

/* My account page */
.account-panel {
    width: min(420px, calc(100% - 40px));
    margin: 40px auto 0 auto;
    color: #c4b69b;
    text-align: left;
}

.account-panel h3 {
    margin: 0 0 8px;
    color: #fff;
    font-size: 22px;
    font-weight: 400;
}

.account-help {
    margin: 0 0 12px;
    color: #9e9282;
    font-size: 13px;
    line-height: 18px;
}

.account-question {
    margin: 4px 0 8px;
    padding: 10px 11px;
    font-size: 14px;
    background: #292621;
}

.account-question span {
    display: block;
    color: #9e9282;
    font-size: 12px;
}

.account-question strong {
    color: #ffd29a;
    font-weight: 500;
}

/* Support tickets (player side) */
.support-panel {
    width: min(760px, calc(100% - 40px));
    margin: 40px auto 0 auto;
    color: #c4b69b;
    text-align: left;
}

.support-panel h3 {
    margin: 0 0 12px;
    color: #fff;
    font-size: 22px;
    font-weight: 400;
}

.support-form textarea {
    box-sizing: border-box;
    display: block;
    width: 100%;
    min-height: 170px;
    padding: 10px 12px;
    color: #202020;
    font: 15px/1.45 "Roboto", Arial, sans-serif;
    background: #f5f5f7;
    border: 1px solid #aaa;
    resize: vertical;
}

.support-form textarea:focus {
    outline: 2px solid #f58220;
    outline-offset: 1px;
}

.support-form input[type="file"] {
    display: block;
    width: 100%;
    margin-top: 6px;
    color: #c4b69b;
    font-size: 13px;
}

.support-file-label {
    color: #c4b69b;
    font-size: 14px;
}

.support-file-label small {
    color: #9e9282;
}

.support-login {
    padding: 40px 30px;
    text-align: center;
    background: #292621;
}

.support-button {
    display: inline-block;
    width: auto;
    min-height: 0;
    padding: 10px 40px;
    color: #1b1b1b;
    text-decoration: none;
}

.support-list-title {
    margin-top: 40px !important;
}

.support-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 2px;
    line-height: 40px;
    color: #c4b69b;
}

.support-table th {
    font-weight: 400;
    background: #292621;
}

.support-table td {
    padding: 0 10px;
    background: #0a0a0a;
}

.support-table td.cell_left {
    text-align: center;
    background: #292621;
}

.support-table a {
    color: #d88b00;
    text-decoration: none;
}

.support-status {
    display: inline-block;
    padding: 0 10px;
    font-size: 12px;
    line-height: 22px;
    white-space: nowrap;
    background: #0a0a0a;
    border: 1px solid #34302a;
}

.support-status-open {
    color: #ffd29a;
}

.support-status-answered {
    color: #131313;
    background: #8fd16a;
    border-color: #8fd16a;
}

.support-status-closed {
    color: #6e6458;
}

.support-back {
    width: auto;
    margin: 0 0 15px 0;
}

.support-ticket-head {
    margin-bottom: 14px;
}

.support-ticket-head h3 {
    display: inline;
    margin-right: 10px;
}

.support-thread {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.support-message {
    padding: 14px 16px;
    background: #0a0a0a;
    border-left: 3px solid #6e6458;
}

.support-message.from-admin {
    background: #1d1a15;
    border-left-color: #fe9900;
}

.support-message-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    color: #9e9282;
    font-size: 12px;
}

.support-message-meta strong {
    color: #fff;
    font-weight: 500;
}

.support-message.from-admin .support-message-meta strong {
    color: #ff9e00;
}

.support-message-body {
    color: #d8cdb4;
    font-size: 14px;
    line-height: 1.55;
    word-wrap: break-word;
}

.support-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.support-attachments img {
    display: block;
    max-width: 180px;
    max-height: 120px;
    border: 1px solid #34302a;
}

.support-close-form {
    margin-top: 12px;
    text-align: center;
}

.support-close-form .gnb-link-button {
    font-size: 13px;
    text-transform: none;
    text-decoration: underline;
}

/* Footer: coloured Discord and YouTube logos, both exactly 46x46 */
footer #sn ul li a.dc {
    background: url('../img/icon_discord.svg') 0 0 / 46px 46px no-repeat;
}

footer #sn ul li a.yt {
    background: url('../img/icon_youtube.svg') 0 0 / 46px 46px no-repeat;
}

footer #sn ul li a.dc:hover,
footer #sn ul li a.yt:hover {
    opacity: .8;
}

/* Ranking search: the template's "Oyuncu adı girin" label sits behind the transparent input.
   Hide it while the field is focused or has text so it never overlaps what the player types. */
#baseSingleBodyWrapper .rankingWrapper .search_pname_form ul li.li_pn:focus-within span,
#baseSingleBodyWrapper .rankingWrapper .search_pname_form ul li.li_pn.is-filled span {
    visibility: hidden;
}

footer #sn ul li a.is-disabled {
    cursor: default;
}

/* "Similar names": separate section under an empty ranking search (readable on the dark template) */
#baseSingleBodyWrapper .rankingWrapper .similar-results {
    margin: 22px 0 0 0;
    padding: 18px 20px 20px;
    text-align: left;
    background: #1b1915;
    border-top: 2px solid #fe9900;
}

#baseSingleBodyWrapper .rankingWrapper .similar-results h4 {
    margin: 0 0 12px;
    color: #fe9900;
    font-size: 18px;
    font-weight: 500;
    text-transform: uppercase;
}

#baseSingleBodyWrapper .rankingWrapper .similar-results h4 small {
    margin-left: 10px;
    color: #c4b69b;
    font-size: 14px;
    font-weight: 400;
    text-transform: none;
}

#baseSingleBodyWrapper .rankingWrapper .similar-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 2px;
    color: #e6dcc6;
    font-size: 15px;
    line-height: 40px;
}

#baseSingleBodyWrapper .rankingWrapper .similar-table th {
    padding: 0 14px;
    color: #9e9282;
    font-size: 13px;
    font-weight: 400;
    text-align: left;
    background: #292621;
}

#baseSingleBodyWrapper .rankingWrapper .similar-table td {
    padding: 0 14px;
    background: #0a0a0a;
}

#baseSingleBodyWrapper .rankingWrapper .similar-table tr:hover td {
    background: #141310;
}

#baseSingleBodyWrapper .rankingWrapper .similar-table td.similar-name a {
    color: #ffb84d;
    font-weight: 600;
    text-decoration: none;
}

#baseSingleBodyWrapper .rankingWrapper .similar-table td.similar-name a:hover {
    color: #ffffff;
    text-decoration: underline;
}

#baseSingleBodyWrapper .rankingWrapper .similar-table .rank-icon {
    width: 24px;
    height: 24px;
    margin-right: 8px;
    vertical-align: middle;
}

#baseSingleBodyWrapper .rankingWrapper .similar-table a.similar-button {
    display: inline-block;
    padding: 0 16px;
    color: #131313;
    font-size: 13px;
    font-weight: 600;
    line-height: 30px;
    text-decoration: none;
    background: #fe9900;
}

#baseSingleBodyWrapper .rankingWrapper .similar-table a.similar-button:hover {
    color: #131313;
    background: #ffb84d;
}

/* GM badge next to the nickname on the player profile */
.profile-card h3 .gm-badge {
    width: 24px;
    height: 24px;
    margin: 0 4px 0 6px;
    vertical-align: -2px;
}



/* Ranking categories: one compact panel. Row 1 = group tabs (equal width), row 2 = the group's categories. */
.ranking-categories {
    margin: 12px 0 12px 2px;
    background: #1b1915;
    border: 1px solid #2c2923;
}

.ranking-group-tabs {
    display: flex;
    border-bottom: 2px solid #fe9900;
}

.ranking-group-tabs a {
    flex: 1 1 0;
    color: #c4b69b;
    font-size: 14px;
    line-height: 38px;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    background: #292621;
    border-right: 1px solid #1b1915;
}

.ranking-group-tabs a:last-child {
    border-right: 0;
}

.ranking-group-tabs a:hover {
    color: #fff;
    background: #34302a;
}

.ranking-group-tabs a.on {
    color: #131313;
    font-weight: 600;
    background: #fe9900;
}

.ranking-category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
    margin: 0;
    padding: 12px;
    list-style: none;
}

.ranking-category-list[hidden] {
    display: none;
}

.ranking-category-list a {
    display: inline-block;
    min-width: 64px;
    padding: 0 13px;
    color: #c4b69b;
    font-size: 14px;
    line-height: 32px;
    text-align: center;
    text-decoration: none;
    background: #0f0e0c;
    border: 1px solid #34302a;
}

.ranking-category-list a:hover {
    color: #fff;
    border-color: #fe9900;
}

.ranking-category-list a.on {
    color: #131313;
    font-weight: 600;
    background: #fe9900;
    border-color: #fe9900;
}

/* The column the table is sorted by */
#baseSingleBodyWrapper .rankingWrapper .search_result_wrapper .ranking_tbl th.stat-highlight {
    color: #131313;
    font-weight: 500;
    background: #fe9900;
}

#baseSingleBodyWrapper .rankingWrapper .search_result_wrapper .ranking_tbl td.stat-highlight {
    color: #ffb84d;
    font-weight: 600;
}


/* Clan mark: background square with the emblem drawn on top (Assets/img/clanmark) */
.clan-mark {
    position: relative;
    display: inline-block;
    flex: 0 0 auto;
    overflow: hidden;
    vertical-align: middle;
    background: #000;
}

.clan-mark img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    image-rendering: auto;
}

.ranking_tbl .clan-mark.clan-emblem {
    margin-right: 6px;
}

#ranking ul li .dt .cn .clan-mark.cib {
    margin: 10px 5px 0 10px;
    vertical-align: -7px;
}

.profile-card .clan-mark.profile-emblem {
    border: 1px solid #34302a;
}

/* Main page ranking panel: game rank icons are square (Assets/img/rank, 32x32) */
#ranking ul li .lv img {
    width: 24px;
    height: 24px;
    margin: 18px 12px 18px 12px;
}

/* Rank guide: game rank icons */
.rank_guid_tbl th img.rank-guide-icon {
    width: 32px;
    height: 32px;
    margin: 0 2px;
    vertical-align: middle;
}

/* Small rank icon inside text (profile "Rank:" line, account overview) */
img.rank-inline {
    width: 20px;
    height: 20px;
    vertical-align: -5px;
}

/* Download menu has a single entry (no "Game client" sub item): do not expand on hover */
nav.inside_body ul.outerCategory .innerCategory.menu6:hover {
    height: 55px;
}

/* Download page: "İndir" + "Yedek İndirme" side by side (same look as the old single #cae_download_link button) */
#baseSingleBodyWrapper .downloadWrapper .cae-download-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px 28px;
}

/* gameclient.min.css gives #cae_download_link "margin: 0 auto", which in a flex row pushes the buttons apart */
#baseSingleBodyWrapper .downloadWrapper .cae-download-buttons > #cae_download_link,
#baseSingleBodyWrapper .downloadWrapper .cae-download-buttons > .cae-download-btn {
    box-sizing: border-box;
    min-width: min(380px, 100%);
    margin: 0;
    text-align: center;
}

#baseSingleBodyWrapper .downloadWrapper .cae-download-btn {
    display: inline-block;
    line-height: 82px;
    height: 82px;
    overflow-y: hidden;
    padding: 0 0 0 50px;
    color: #000;
    font-size: 30px;
    font-weight: 600;
    text-transform: uppercase;
    text-decoration: none;
    background: url('../img/btn_download_off_left.png') left top no-repeat;
    margin: 0;
}

#baseSingleBodyWrapper .downloadWrapper .cae-download-btn::after {
    content: '';
    display: block;
    width: 50px;
    height: 82px;
    background: url('../img/btn_download_off_right.png') left top no-repeat;
    float: right;
}

#baseSingleBodyWrapper .downloadWrapper .cae-download-btn:hover {
    background: url('../img/btn_download_on_left.png') left top no-repeat;
}

#baseSingleBodyWrapper .downloadWrapper .cae-download-btn:hover::after {
    background: url('../img/btn_download_on_right.png') left top no-repeat;
}

@media (max-width: 600px) {
    #baseSingleBodyWrapper .downloadWrapper .cae-download-btn {
        padding-left: 30px;
        font-size: 20px;
    }
}

/* Download page: client link not configured yet (Admin -> Ayarlar) */
.cae-download-btn.is-disabled,
#cae_download_link.is-disabled {
    cursor: not-allowed;
    opacity: .55;
    filter: grayscale(.6);
}

/* Download page: installation video (Admin -> Ayarlar), in place of the old support buttons. 16:9, full width up to 880px. */
#baseSingleBodyWrapper .downloadWrapper .install-video {
    max-width: 880px;
    margin: 30px auto 0;
    text-align: center;
}

#baseSingleBodyWrapper .downloadWrapper .install-video h4 {
    margin: 0 0 14px;
}

#baseSingleBodyWrapper .downloadWrapper .install-video-frame {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: #000;
    border: 1px solid #d88b00;
}

#baseSingleBodyWrapper .downloadWrapper .install-video-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Ranking search: per-IP budget exceeded (the list is shown unfiltered) */
#baseSingleBodyWrapper .rankingWrapper .search-throttled {
    margin: 0 0 12px;
    padding: 10px 14px;
    color: #f0c674;
    font-size: 13px;
    background: rgba(216, 139, 0, .12);
    border-left: 3px solid #d88b00;
}

/* Header: "Buy GC" link between login/logout and support, highlighted like the site's accent colour */
#commonGnb li.gnb-gc a {
    color: #ffa90f;
}

#commonGnb li.gnb-gc a:hover,
#commonGnb li.gnb-gc a:focus {
    color: #ffd29a;
}

/* Home page Discord panel (Main.php #discordPanel, data: /api/discord-widget.php via site.js).
   Wide screens: in the empty area right of the 1200 px content, top aligned with "Weapon of the week".
   Below 1800 px there is not enough room next to the content: the panel moves under the latest news. */

.discord-panel {
    --dp-gold: #fe9900;
    --dp-gold-dark: #d88b00;
    --dp-text: #c4b69b;
    --dp-muted: #9e9282;
    --dp-line: #34302a;
    clear: both;
    box-sizing: border-box;
    margin: 30px 0 0;
    font-family: "Roboto", 'Lucida Sans';
    color: var(--dp-text);
    background: rgba(8, 8, 8, .82);
    border: 1px solid var(--dp-line);
    border-top: 0;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .55);
}

.discord-panel *,
.discord-panel *::before,
.discord-panel *::after {
    box-sizing: border-box;
}

.discord-panel-head {
    display: flex;
    align-items: center;
    height: 34px;
    border-bottom: 1px solid var(--dp-gold-dark);
    background: #0d0d0d;
}

.discord-panel-head h2 {
    display: flex;
    align-items: center;
    height: 34px;
    margin: 0;
    padding: 0 34px 0 8px;
    color: #000;
    font-size: 11pt;
    font-weight: 600;
    line-height: 34px;
    text-transform: uppercase;
    white-space: nowrap;
    background: linear-gradient(180deg, #ffad1f 0%, var(--dp-gold) 55%, var(--dp-gold-dark) 100%);
    clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 100%, 0 100%);
}

.discord-panel-logo {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-right: 9px;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, .55);
    border-radius: 50%;
    background: #5865f2;   /* Discord's own brand colour for the logo badge */
}

.discord-panel-logo svg {
    display: block;
    width: 16px;
    height: 16px;
    fill: #fff;
}

.discord-panel-summary {
    padding: 16px 14px 14px;
    border-bottom: 1px solid var(--dp-line);
    background: linear-gradient(180deg, rgba(254, 153, 0, .07), rgba(254, 153, 0, 0));
}

.discord-panel-online {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 0 0 14px;
    font-size: 10pt;
    letter-spacing: .02em;
}

.discord-panel-online strong {
    color: #ffb84d;
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.discord-panel-pulse {
    position: relative;
    top: -2px;
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #3ba55d;
    box-shadow: 0 0 0 0 rgba(59, 165, 93, .6);
    animation: discord-panel-pulse 2s infinite;
}

.discord-panel.is-error .discord-panel-pulse,
.discord-panel.is-loading .discord-panel-pulse {
    background: #6e6458;
    animation: none;
}

@keyframes discord-panel-pulse {
    0% { box-shadow: 0 0 0 0 rgba(59, 165, 93, .6); }
    70% { box-shadow: 0 0 0 8px rgba(59, 165, 93, 0); }
    100% { box-shadow: 0 0 0 0 rgba(59, 165, 93, 0); }
}

.discord-panel-join {
    display: block;
    padding: 11px 12px;
    color: #000;
    font-size: 11pt;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    text-decoration: none;
    letter-spacing: .04em;
    background: linear-gradient(180deg, #ffb84d 0%, var(--dp-gold) 50%, var(--dp-gold-dark) 100%);
    border: 1px solid #ffd29a;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .6), 0 4px 14px rgba(254, 153, 0, .25);
    cursor: pointer;
    transition: filter .15s ease, box-shadow .15s ease;
}

.discord-panel-join:hover,
.discord-panel-join:focus-visible {
    color: #000;
    filter: brightness(1.12);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .6), 0 4px 20px rgba(254, 153, 0, .45);
}

.discord-panel-join:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.discord-panel-join.is-disabled {
    color: #3a352d;
    background: #6e6458;
    border-color: #6e6458;
    box-shadow: none;
    cursor: default;
    filter: none;
}

.discord-panel-body {
    position: relative;
}

.discord-panel-status {
    margin: 0;
    padding: 18px 14px;
    color: var(--dp-muted);
    font-size: 9.5pt;
    line-height: 1.5;
}

.discord-panel-status[hidden] {
    display: none;
}

.discord-panel.is-error .discord-panel-status {
    color: #ff9e7f;
    border-left: 3px solid #ff6b4a;
    background: rgba(255, 107, 74, .07);
}

.discord-panel-members,
.discord-panel-skeleton {
    margin: 0;
    padding: 6px 0;
    list-style: none;
}

.discord-panel-members {
    max-height: 550px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--dp-gold-dark) #141414;
}

.discord-panel-members[hidden],
.discord-panel-skeleton[hidden] {
    display: none;
}

.discord-panel-members:focus-visible {
    outline: 1px solid var(--dp-gold-dark);
    outline-offset: -1px;
}

.discord-panel-members::-webkit-scrollbar {
    width: 6px;
}

.discord-panel-members::-webkit-scrollbar-track {
    background: #141414;
}

.discord-panel-members::-webkit-scrollbar-thumb {
    background: var(--dp-gold-dark);
}

.discord-member {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 6px 14px;
    list-style: none;
}

.discord-member:hover {
    background: rgba(254, 153, 0, .08);
}

.discord-member-avatar {
    position: relative;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
}

.discord-member-avatar img,
.discord-member-initial {
    display: block;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #292621;
}

.discord-member-avatar img {
    object-fit: cover;
}

.discord-member-initial {
    color: #ffd29a;
    font-size: 13px;
    font-weight: 700;
    line-height: 32px;
    text-align: center;
    text-transform: uppercase;
}

.discord-member-status {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 12px;
    height: 12px;
    border: 2px solid #0b0b0b;
    border-radius: 50%;
    background: #3ba55d;
}

.discord-member-status.is-idle {
    background: #faa81a;
}

.discord-member-status.is-dnd {
    background: #ed4245;
}

.discord-member-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.discord-member-name,
.discord-member-activity {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.discord-member-name {
    color: #e6dccb;
    font-size: 10pt;
    font-weight: 500;
}

.discord-member-activity {
    color: var(--dp-muted);
    font-size: 8.5pt;
}

.discord-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.discord-panel-skeleton li {
    position: relative;
    height: 32px;
    margin: 6px 14px 12px 56px;
    background: linear-gradient(90deg, #1b1915 0%, #2a2620 50%, #1b1915 100%) 0 0 / 200% 100%;
    animation: discord-panel-shimmer 1.4s linear infinite;
}

.discord-panel-skeleton li::before {
    content: "";
    position: absolute;
    top: 0;
    left: -42px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #1b1915;
}

.discord-panel-skeleton li:nth-child(2n) {
    margin-right: 54px;
}

@keyframes discord-panel-shimmer {
    from { background-position: 100% 0; }
    to { background-position: -100% 0; }
}

.discord-panel-foot {
    min-height: 30px;
    margin: 0;
    padding: 8px 14px;
    color: #6e6458;
    font-size: 8pt;
    border-top: 1px solid var(--dp-line);
}

.discord-panel-foot:empty {
    display: none;
}

/* Under the news (default): header row + list in columns. */
@media (max-width: 1799.98px) {
    .discord-panel-summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 20px;
    }

    .discord-panel-online {
        margin: 0;
    }

    .discord-panel-join {
        flex: 0 0 260px;
    }

    .discord-panel-members {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        max-height: 264px;
    }

    .discord-panel-skeleton {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

/* The template's 100 px gap above the footer shows as an empty black band under the panel (home page only). */
body:has(.discord-panel) footer {
    margin-top: 30px;
}

/* Enough room right of the content: side panel in the empty area (99 px header + 55 px menu + 33 px gap).
   Positioned against <body> (position: relative in default.min.css), NOT #contentsWrapper/#firstWrapper:
   their overflow: auto/hidden would clip a panel that sits outside the 1200 px column. */
@media (min-width: 1800px) {
    .discord-panel {
        position: absolute;
        top: 187px;
        left: calc(50% + 624px);
        width: min(320px, calc(50% - 640px));
        margin: 0;
    }

    /* Keeps the footer below the side panel even when the page content is short (e.g. database offline). */
    #contentsWrapper:has(> .discord-panel) {
        min-height: 970px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .discord-panel-pulse,
    .discord-panel-skeleton li {
        animation: none;
    }

    .discord-panel-join {
        transition: none;
    }
}

/* Clan match history (clan-matches.php) */
#baseSingleBodyWrapper .rankingWrapper .match_tbl td {
    vertical-align: middle;
}

#baseSingleBodyWrapper .rankingWrapper .match_tbl td:first-child {
    white-space: nowrap;
}

#baseSingleBodyWrapper .rankingWrapper .match_tbl .match-side {
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#baseSingleBodyWrapper .rankingWrapper .match_tbl .match-emblem {
    margin-right: 6px;
    vertical-align: middle;
}

#baseSingleBodyWrapper .rankingWrapper .match_tbl .match-side.is-winner a {
    color: #ffc24a;
    font-weight: 700;
}

#baseSingleBodyWrapper .rankingWrapper .match_tbl .match-clan-gone {
    color: #7d7466;
    font-style: italic;
}

#baseSingleBodyWrapper .rankingWrapper .match_tbl .match-score {
    color: #c4b69b;
    font-size: 18px;
    white-space: nowrap;
}

#baseSingleBodyWrapper .rankingWrapper .match_tbl .match-score .is-winner {
    color: #ffc24a;
    font-weight: 700;
}

#baseSingleBodyWrapper .rankingWrapper .match_tbl .match-score-sep {
    margin: 0 4px;
    color: #7d7466;
}

#baseSingleBodyWrapper .rankingWrapper .match_tbl .match-draw {
    display: block;
    color: #9e9282;
    font-size: 11px;
}

#baseSingleBodyWrapper .rankingWrapper .match-outcome {
    display: inline-block;
    width: 18px;
    margin-right: 6px;
    color: #111;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

#baseSingleBodyWrapper .rankingWrapper .match-outcome.is-win { background: #7fd47f; }
#baseSingleBodyWrapper .rankingWrapper .match-outcome.is-loss { background: #ff6b4a; }
#baseSingleBodyWrapper .rankingWrapper .match-outcome.is-draw { background: #9e9282; }

#baseSingleBodyWrapper .rankingWrapper .match-filter,
#baseSingleBodyWrapper .rankingWrapper .profile-matches-link {
    margin: 0 0 12px;
    font-size: 14px;
}

#baseSingleBodyWrapper .rankingWrapper .match-filter a,
#baseSingleBodyWrapper .rankingWrapper .profile-matches-link a {
    color: #ffa90f;
}

#baseSingleBodyWrapper .rankingWrapper .profile-matches-link {
    margin: 14px 0 0;
    text-align: right;
}

@media (max-width: 760px) {
    #baseSingleBodyWrapper .rankingWrapper .match_tbl th:nth-child(5),
    #baseSingleBodyWrapper .rankingWrapper .match_tbl td:nth-child(5),
    #baseSingleBodyWrapper .rankingWrapper .match_tbl th:nth-child(6),
    #baseSingleBodyWrapper .rankingWrapper .match_tbl td:nth-child(6),
    #baseSingleBodyWrapper .rankingWrapper .match_tbl th:nth-child(7),
    #baseSingleBodyWrapper .rankingWrapper .match_tbl td:nth-child(7),
    #baseSingleBodyWrapper .rankingWrapper .match_tbl th:nth-child(8),
    #baseSingleBodyWrapper .rankingWrapper .match_tbl td:nth-child(8) {
        display: none;
    }
}

@media (max-width: 600px) {
    #baseSingleBodyWrapper .rankingWrapper .match_tbl col {
        width: auto;
    }

    #baseSingleBodyWrapper .rankingWrapper .match_tbl .match-time {
        display: block;
        color: #9e9282;
    }

    #baseSingleBodyWrapper .rankingWrapper .match_tbl td,
    #baseSingleBodyWrapper .rankingWrapper .match_tbl th {
        padding-left: 4px;
        padding-right: 4px;
    }

    #baseSingleBodyWrapper .rankingWrapper .match_tbl .match-emblem {
        display: none;
    }

    #baseSingleBodyWrapper .rankingWrapper .match_tbl .match-side {
        white-space: normal;
        word-break: break-word;
    }
}
