/*
 * Desktop (1100px and wider with a mouse, all screens from 1500px): the components of the mobile
 * version (buttons, tiles, cards, lists, reward strip, FAQ, rules, top donators) inside the content
 * and sidebar boxes. The page frame stays as it is: navigation bar, header and the box background
 * images are not touched. Phones and tablets use zz_responsive.css (loaded after this file).
 */
@media (min-width: 1500px), (min-width: 1100px) and (hover: hover), (min-width: 1100px) and (pointer: fine) {
    :root {
        --m-parchment: #f1e4d8;
        --m-parchment-dark: #e6d5c4;
        --m-stone: #5d5b5b;
        --m-gold: #e0c39c;
        --m-gold-dark: #b8976d;
        --m-text: #5f5a57;
        --m-heading: #a2826d;
        --m-gap: 12px;
        --m-header-h: clamp(170px, 46vw, 401px);
        --m-logo-w: min(42vw, 250px);
    }

    /* Ranking */
    .ranking_nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
        margin-bottom: 18px;
    }

    .ranking_nav span {
        display: none;
    }

    .ranking_nav a,
    .ranking_nav.ranking_nav_toplist a {
        display: inline-block;
        padding: 7px 13px;
        font-size: 14px;
        line-height: 1.3;
        border-radius: 999px;
        background: rgba(255, 255, 255, .55);
        box-shadow: inset 0 0 0 1px rgba(127, 100, 49, .3);
    }

    .ranking_nav a:active {
        background: rgba(255, 255, 255, .85);
    }

    /* ---- Buttons in the site's colours: gold for main actions, brown for the rest ---- */
    :root {
        --m-btn-gold: linear-gradient(180deg, #ffe9b0 0%, #f3c86f 55%, #dea849 100%);
        --m-btn-gold-border: #b8862f;
        --m-btn-gold-text: #5a3b12;
        --m-btn-brown: linear-gradient(180deg, #9a7a58 0%, #7b5c40 100%);
        --m-btn-brown-border: #5e452f;
        --m-btn-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 3px 8px rgba(80, 50, 20, .22);
    }

    /* Sidebar: login, logout and vote buttons (image buttons / grey Bootstrap button on desktop) */
    .content_right_inner a.btn-gold,
    .content_right_inner button.btn-gold,
    main .content_right .content_right_inner .box_content a.btn-gold, /* beats display:block in 03_template.css */
    .content_left_inner a.btn-gold,
    .sidebar_vote .box .btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        max-width: 280px;
        height: auto;
        min-height: 46px;
        margin: 10px auto 0;
        padding: 10px 16px;
        border: 1px solid var(--m-btn-gold-border);
        border-radius: 12px;
        background: var(--m-btn-gold);
        box-shadow: var(--m-btn-shadow);
        color: var(--m-btn-gold-text);
        font-family: 'Penumbra Serif', serif;
        font-size: 16px !important;
        font-weight: 700;
        line-height: 1.2;
        letter-spacing: .02em;
        text-transform: uppercase;
        text-decoration: none !important;
        white-space: normal !important;
        -webkit-tap-highlight-color: transparent;
    }

    .sidebar_vote .box .btn {
        max-width: none;
        margin-top: 0;
        font-family: inherit;
        font-size: 14px !important;
        text-transform: none;
        letter-spacing: 0;
    }

    .sidebar_vote .box .btn .fa-star {
        color: #a4611a;
    }

    .content_right_inner a.btn-gold:hover,
    .content_right_inner a.btn-gold:focus,
    .content_right_inner button.btn-gold:hover,
    .content_right_inner button.btn-gold:focus,
    .content_left_inner a.btn-gold:hover,
    .sidebar_vote .box .btn:hover,
    .sidebar_vote .box .btn:focus {
        background: var(--m-btn-gold);
        color: var(--m-btn-gold-text);
        filter: brightness(1.03);
    }

    .content_right_inner a.btn-gold:active,
    .content_right_inner button.btn-gold:active,
    .content_left_inner a.btn-gold:active,
    .sidebar_vote .box .btn:active {
        filter: brightness(.95);
        transform: translateY(1px);
    }

    /* Logout: quieter than login and vote */
    main .content_right .content_right_inner .box_content a.btn-gold[href*="logout"] {
        background: var(--m-btn-brown);
        border-color: var(--m-btn-brown-border);
        color: #fff8ec;
        /* Text 2px lower, same button height */
        padding-top: 12px;
        padding-bottom: 8px;
    }

    main .content_right .content_right_inner .box_content a.btn-gold[href*="logout"]:hover,
    main .content_right .content_right_inner .box_content a.btn-gold[href*="logout"]:focus {
        background: var(--m-btn-brown);
        color: #fff8ec;
    }

    /* Bootstrap buttons in the content */
    .content_left_inner a.btn,
    .content_left_inner button.btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .content_left_inner .btn {
        border-radius: 10px;
        font-weight: 600;
        padding: .55rem 1.1rem;
        box-shadow: var(--m-btn-shadow);
    }

    .content_left_inner .btn-secondary,
    .content_left_inner .btn-info,
    .content_left_inner .btn-dark {
        background: var(--m-btn-brown);
        border-color: var(--m-btn-brown-border);
        color: #fff8ec;
    }

    .content_left_inner .btn-primary,
    .content_left_inner .btn-warning,
    .content_left_inner .btn-success {
        background: var(--m-btn-gold);
        border-color: var(--m-btn-gold-border);
        color: var(--m-btn-gold-text);
    }

    .content_left_inner .btn-danger {
        background: linear-gradient(180deg, #c95a4f 0%, #a8403a 100%);
        border-color: #8a332e;
        color: #fff;
    }

    .content_left_inner .btn:active {
        filter: brightness(.95);
    }

    /* Language / server switches above news, donation and donor lists: pills */
    .content_left_inner .d-flex > a.button {
        margin: 0 4px;
        padding: 0;
        border: 1px solid var(--m-btn-gold-border);
        border-radius: 999px;
        background: rgba(255, 255, 255, .55);
        box-shadow: 0 2px 6px rgba(80, 50, 20, .15);
    }

    .content_left_inner .d-flex > a.button:first-child { margin-left: 0; }
    .content_left_inner .d-flex > a.button:last-child { margin-right: 0; }

    .content_left_inner .d-flex > a.button .button__inner {
        padding: 0;
        border-radius: 999px;
        background: transparent;
        box-shadow: none;
    }

    .content_left_inner .d-flex > a.button .button__inner::before,
    .content_left_inner .d-flex > a.button .button__inner::after,
    .content_left_inner .d-flex > a.button .button__inner__highlight {
        display: none;
    }

    .content_left_inner .d-flex > a.button .button__inner__label {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 42px;
        padding: 4px 12px 0; /* text centred in the pill (base style: line-height 2.4 pushed it down), 2px lower to look centred */
        line-height: 1.2;
        color: #8a6d57;
        font-size: 14px;
        letter-spacing: .03em;
    }

    .content_left_inner .d-flex > a.button.active {
        background: var(--m-btn-gold);
        box-shadow: var(--m-btn-shadow);
    }

    .content_left_inner .d-flex > a.button.active .button__inner__label {
        color: var(--m-btn-gold-text);
    }

}

/* Reward page (accountpanel&page=rewards): bar, milestone cards and tap previews (zz_custom.js) */
@media (min-width: 1500px), (min-width: 1100px) and (hover: hover), (min-width: 1100px) and (pointer: fine) {
    #entropiaReward {
        width: calc(100% - 28px) !important;
        margin: 18px auto 34px !important;
        text-align: left;
        display: block !important; /* the plugin makes it inline-block: extra line gap */
        min-height: 48px; /* height of the finished bar: no jump when the bar script runs */
    }

    /* Keep the bar margins inside its box before and after the plugin runs (same height) */
    .text-center:has(> #entropiaReward) {
        display: flow-root;
    }

    #entropiaReward .bi-titleSpan {
        font-weight: 600;
    }

    #entropiaReward .bi-bar {
        height: 14px !important;
        border-radius: 999px;
        background: #e6d5c4;
    }

    #entropiaReward .bi-barInner {
        border-radius: 999px;
    }

    /* Hover labels are replaced by the preview sheet; one round marker per level */
    #entropiaReward .bi-mlst-label,
    #entropiaReward .bi-mlst-innerLine,
    #entropiaReward .bi-milestone.bottom {
        display: none !important;
    }

    #entropiaReward .bi-milestone {
        width: 28px !important;
        height: 28px !important;
        margin-left: -14px !important;
        margin-top: -14px !important;
        -webkit-tap-highlight-color: transparent;
    }

    #entropiaReward .bi-milestone::after {
        content: "";
        position: absolute;
        left: 50%;
        top: 50%;
        width: 16px;
        height: 16px;
        transform: translate(-50%, -50%);
        border-radius: 50%;
        background: #cbb9a6;
        border: 2px solid #fff8ec;
        box-shadow: 0 1px 3px rgba(80, 50, 20, .35);
    }

    #entropiaReward .bi-milestone.is-claimed::after {
        background: #5cb85c;
    }

    #entropiaReward .bi-milestone.is-open::after {
        background: #f3c86f;
        box-shadow: 0 0 0 3px rgba(243, 200, 111, .45), 0 1px 3px rgba(80, 50, 20, .35);
    }

    .m-rw {
        display: block;
        margin: 0 -12px 18px;
    }

    /* Server-rendered placeholder: same height as the filled strip, so nothing jumps */
    .m-rw:empty {
        min-height: 184px;
    }

    /* "Claim" in the preview jumps here: keep the form clear of the sticky menu */
    .rewardForm {
        scroll-margin-top: 76px;
    }

    .m-rw__hint {
        margin: 0 12px 8px;
        font-size: 13px;
        color: #8a7a6d;
        text-align: center;
    }

    .m-rw__track {
        display: flex;
        gap: 10px;
        padding: 4px 12px 10px;
        overflow-x: auto;
        scroll-snap-type: x proximity;
        scroll-padding-left: 12px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .m-rw__track::-webkit-scrollbar {
        display: none;
    }

    .m-rw__item {
        flex: 0 0 108px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        padding: 8px 6px 10px;
        scroll-snap-align: start;
        background: #fff8ec;
        border: 1px solid rgba(127, 100, 49, .3);
        border-radius: 14px;
        box-shadow: 0 2px 6px rgba(80, 50, 20, .12);
        color: var(--m-text);
        font: inherit;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .m-rw__item:active {
        transform: translateY(1px);
    }

    .m-rw__item.is-open {
        border-color: #b8862f;
        box-shadow: 0 0 0 2px rgba(243, 200, 111, .6), 0 2px 6px rgba(80, 50, 20, .15);
    }

    .m-rw__thumb {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 92px;
        height: 76px;
        overflow: hidden;
        border-radius: 10px;
        background: radial-gradient(circle at 50% 55%, #fffaf0 0%, #f0e2cf 75%);
    }

    .m-rw__thumb--t5,
    .m-rw__thumb--t6 {
        background: radial-gradient(circle at 50% 55%, #fff6d8 0%, #f3dca6 80%);
    }

    .m-rw__thumb svg {
        width: 70px;
        height: 70px;
        filter: drop-shadow(0 2px 2px rgba(80, 50, 20, .25));
    }

    .m-rw__item.is-locked .m-rw__thumb svg {
        filter: saturate(.7) drop-shadow(0 2px 2px rgba(80, 50, 20, .2));
    }

    .m-rw__item.is-claimed .m-rw__thumb svg {
        opacity: .75;
    }

    /* Reward claim: character select and Claim button with the same height and rounding */
    .rewardForm .input-group > .custom-select {
        height: 44px;
        font-size: 14px;
    }

    .rewardForm .input-group > .custom-select:first-child {
        border-top-left-radius: 10px;
        border-bottom-left-radius: 10px;
    }

    .rewardForm .input-group > .input-group-append > .btn {
        height: 44px;
        padding-top: 0;
        padding-bottom: 0;
    }

    .m-rw__pts {
        font-family: 'Penumbra Serif', serif;
        font-size: 16px;
        font-weight: 700;
        line-height: 1;
        color: #a4611a;
    }

    .m-rw__chip {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 3px 8px;
        border-radius: 999px;
        font-size: 11px;
        font-weight: 600;
        line-height: 1.2;
        white-space: nowrap;
    }

    .m-rw__chip.is-claimed { background: #dcefd5; color: #2f6b2f; }
    .m-rw__chip.is-open { background: #fbe7b8; color: #6b4612; }
    .m-rw__chip.is-locked { background: #ece2d7; color: #7d6d60; }

    /* Preview sheet */
    html.m-rw-locked,
    html.m-rw-locked body {
        overflow: hidden;
    }

    .m-rw-sheet {
        position: fixed;
        inset: 0;
        z-index: 2000;
    }

    .m-rw-sheet[hidden] {
        display: none;
    }

    .m-rw-sheet__backdrop {
        position: absolute;
        inset: 0;
        background: rgba(10, 8, 6, .6);
        animation: m-rw-fade .2s ease;
    }

    .m-rw-sheet__panel {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        max-width: 560px;
        max-height: 90vh;
        max-height: 90dvh;
        margin: 0 auto;
        padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px));
        overflow-y: auto;
        overscroll-behavior: contain;
        background: var(--m-parchment);
        border-radius: 18px 18px 0 0;
        box-shadow: 0 -8px 30px rgba(0, 0, 0, .35);
        color: var(--m-text);
        text-align: center;
        animation: m-rw-up .25s ease;
    }

    .m-rw-sheet__close {
        position: absolute;
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        border: 0;
        border-radius: 50%;
        background: rgba(127, 100, 49, .12);
        color: #7d6555;
        font-size: 18px;
    }

    .m-rw-sheet__title {
        margin: 4px 44px 6px;
        font-size: 16px;
    }

    .m-rw-sheet__title b {
        color: #2f8f3a;
    }

    .m-rw-sheet__status {
        margin: 0 0 10px;
        font-size: 13px;
        font-weight: 600;
    }

    .m-rw-sheet__status.is-claimed { color: #2f6b2f; }
    .m-rw-sheet__status.is-locked { color: #a4611a; }

    .m-rw-sheet__opt {
        margin: 0;
    }

    .m-rw-sheet__opt img {
        display: block;
        max-width: 100%;
        max-height: 34vh;
        max-height: 34dvh;
        margin: 0 auto;
        border-radius: 12px;
    }

    .m-rw-sheet__opt figcaption {
        margin-top: 6px;
        font-family: 'Penumbra Serif', serif;
        font-size: 15px;
        font-weight: 600;
        color: #7d6555;
    }

    .m-rw-sheet__or {
        display: flex;
        align-items: center;
        gap: 10px;
        margin: 10px 0;
        font-size: 12px;
        font-weight: 700;
        color: #a2826d;
    }

    .m-rw-sheet__or::before,
    .m-rw-sheet__or::after {
        content: "";
        flex: 1;
        height: 1px;
        background: rgba(127, 100, 49, .3);
    }

    .m-rw-sheet__opts.is-single .m-rw-sheet__opt img {
        max-height: 58vh;
        max-height: 58dvh;
    }

    .m-rw-sheet__go {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-width: 160px;
        min-height: 46px;
        margin-top: 14px;
        padding: 10px 20px;
        border: 1px solid var(--m-btn-gold-border);
        border-radius: 12px;
        background: var(--m-btn-gold);
        box-shadow: var(--m-btn-shadow);
        color: var(--m-btn-gold-text);
        font-family: 'Penumbra Serif', serif;
        font-size: 16px;
        font-weight: 700;
        line-height: 1.2;
        text-transform: uppercase;
    }

    @keyframes m-rw-up {
        from { transform: translateY(100%); }
        to { transform: none; }
    }

    @keyframes m-rw-fade {
        from { opacity: 0; }
        to { opacity: 1; }
    }

    @media (prefers-reduced-motion: reduce) {
        .m-rw-sheet__panel,
        .m-rw-sheet__backdrop {
            animation: none;
        }
    }
}

/* Account management menu (accountpanel): rounded tiles with icons instead of grey blocks */
@media (min-width: 1500px), (min-width: 1100px) and (hover: hover), (min-width: 1100px) and (pointer: fine) {
    .account_info_nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        font-size: 14px;
    }

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

    .account_info_nav a,
    .account_info_nav a[style] {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        min-height: 48px;
        margin: 0;
        padding: 8px 10px;
        border: 1px solid rgba(127, 100, 49, .35);
        border-radius: 12px;
        background: #fff8ec !important;
        box-shadow: 0 2px 6px rgba(80, 50, 20, .12);
        color: #6b4a2e;
        font-weight: 600;
        line-height: 1.2;
        text-align: center;
        -webkit-tap-highlight-color: transparent;
    }

    .account_info_nav a::before {
        flex: none;
        font-family: 'Font Awesome 5 Free';
        font-weight: 900;
        font-size: 15px;
        color: #a4611a;
        content: "\f007"; /* My Account */
    }

    .account_info_nav a[href*="page=transactions"]::before { content: "\f543"; }
    .account_info_nav a[href*="page=purchases"]::before { content: "\f290"; }
    .account_info_nav a[href*="page=logins"]::before { content: "\f1da"; }
    .account_info_nav a[href*="page=promocode"]::before { content: "\f3ff"; }
    .account_info_nav a[href*="page=rewards"]::before { content: "\f06b"; }
    .account_info_nav a[href*="page=loyaltyreward"]::before { content: "\f521"; }

    .account_info_nav a:hover,
    .account_info_nav a:focus {
        background: #fff8ec !important;
        color: #6b4a2e;
    }

    .account_info_nav a:active {
        transform: translateY(1px);
    }

    /* Current page: gold like the main buttons */
    .account_info_nav a.active,
    .account_info_nav a.active:hover,
    .account_info_nav a.active:focus {
        border-color: var(--m-btn-gold-border);
        background: var(--m-btn-gold) !important;
        box-shadow: var(--m-btn-shadow);
        color: var(--m-btn-gold-text);
    }

    .account_info_nav a.active::before {
        color: var(--m-btn-gold-text);
    }

    /* Loyalty Reward keeps its own row and its accent (inline red-brown on desktop) */
    .account_info_nav a[href*="page=loyaltyreward"] {
        grid-column: 1 / -1;
    }

    .account_info_nav a[href*="page=loyaltyreward"]:not(.active) {
        border-color: #7a3f3f;
        background: linear-gradient(180deg, #b0706a 0%, #8f4f4b 100%) !important;
        color: #fff8ec;
    }

    .account_info_nav a[href*="page=loyaltyreward"]:not(.active)::before {
        color: #ffe3a3;
    }
}

/* ---- Content pages: user panel server title, downloads, FAQ, rules, top donators ---- */
@media (min-width: 1500px), (min-width: 1100px) and (hover: hover), (min-width: 1100px) and (pointer: fine) {
    /* Empty spacer paragraphs (&nbsp;) between blocks, marked by zz_custom.js */
    .content_left_inner .m-spacer,
    .site_downloads .content_left_inner > p:has(+ ul),
    .site_downloads .content_left_inner > ul + p,
    .site_downloads .content_left_inner > ul + p + p,
    .site_downloads .content_left_inner > .row + p,
    .site_downloads .content_left_inner > .row + p + p,
    .site_donorOfTheMonth .content_left_inner > p:has(+ hr) {
        display: none;
    }

    /* User panel: server name as a badge instead of a dashed rule */
    #userpanel .box_list > li > h2.dashed {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
        gap: 4px 8px;
        margin: 2px 0 10px;
        padding: 7px 12px;
        overflow: visible;
        border: 1px solid rgba(127, 100, 49, .35);
        border-radius: 999px;
        background: linear-gradient(180deg, #fbf1df 0%, #f0dfc4 100%);
        font-family: 'Penumbra Serif', serif;
        font-size: 15px !important;
        font-weight: 700;
        line-height: 1.2;
        color: #6b4a2e;
        text-transform: uppercase;
        letter-spacing: .03em;
    }

    #userpanel .box_list > li > h2.dashed::before {
        content: "\f233"; /* server */
        position: static;
        display: inline;
        width: auto;
        height: auto;
        margin: 0;
        background: none;
        font-family: 'Font Awesome 5 Free';
        font-weight: 900;
        font-size: 13px;
        color: #a4611a;
    }

    #userpanel .box_list > li > h2.dashed::after {
        display: none;
    }

    #userpanel .box_list > li > h2.dashed .up-cluster-sub {
        font-size: 0; /* hides " (" and ")" around the tag */
    }

    #userpanel .box_list > li > h2.dashed .m-sub {
        padding: 2px 8px;
        border-radius: 999px;
        background: rgba(164, 97, 26, .14);
        font-size: 11px;
        letter-spacing: .02em;
        color: #8a5a22;
    }

    /* ---- Downloads ---- */
    .site_downloads .content_left_inner > ul {
        margin: 0 0 16px;
        padding: 0;
        list-style: none !important;
    }

    .site_downloads .content_left_inner > ul li {
        margin: 0 0 8px;
    }

    .site_downloads .content_left_inner > ul li a {
        position: relative;
        display: block;
        min-height: 52px;
        padding: 15px 34px 15px 56px;
        border: 1px solid rgba(127, 100, 49, .3);
        border-radius: 12px;
        background: #fff8ec;
        box-shadow: 0 2px 6px rgba(80, 50, 20, .1);
        color: #6b4a2e;
        font-size: 14px;
        font-weight: 600;
        line-height: 1.3;
        text-decoration: none !important;
    }

    .site_downloads .content_left_inner > ul li a::before {
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: #f7dcd6;
        color: #b5372c;
        font-family: 'Font Awesome 5 Free';
        font-weight: 900;
        font-size: 14px;
        content: "\f019"; /* download: required runtimes */
    }

    .site_downloads .content_left_inner > ul li a[href*="gameerror"]::before {
        background: #d9e8f7;
        color: #1f6fb5;
        content: "\f059"; /* question: start problems */
    }

    .site_downloads .content_left_inner > ul li a::after {
        position: absolute;
        right: 14px;
        top: 50%;
        transform: translateY(-50%);
        font-family: 'Font Awesome 5 Free';
        font-weight: 900;
        font-size: 12px;
        color: #b8976d;
        content: "\f054"; /* chevron right */
    }

    .site_downloads .download_box,
    .site_downloads .download_box.download_box_right {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        column-gap: 12px;
        width: 100%;
        max-width: none;
        height: auto;
        min-height: 72px;
        margin: 0 0 10px;
        padding: 12px 14px;
        border: 1px solid var(--m-btn-gold-border);
        border-radius: 14px;
        background: var(--m-btn-gold);
        box-shadow: var(--m-btn-shadow);
        color: var(--m-btn-gold-text);
        text-align: left;
    }

    .site_downloads .download_box::before {
        flex: none;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background: rgba(255, 255, 255, .55);
        box-shadow: inset 0 0 0 1px rgba(127, 100, 49, .25);
        font-family: 'Font Awesome 5 Free';
        font-weight: 900;
        font-size: 18px;
        content: "\f019";
    }

    .site_downloads .download_box:active {
        transform: translateY(1px);
        filter: brightness(.97);
    }

    .site_downloads .download_box .db_title {
        flex: 1 1 auto;
        padding: 0;
        font-family: 'Penumbra Serif', serif;
        font-size: 20px;
        line-height: 1.1;
    }

    .site_downloads .download_box .db_server,
    .site_downloads .download_box .db_date {
        padding: 0;
        font-size: 12px;
    }

    .site_downloads .download_box .db_server {
        order: 3;
        flex: 1 1 calc(100% - 56px);
        margin-left: 56px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .03em;
    }

    .site_downloads .download_box .db_date {
        flex: none;
        padding: 3px 8px;
        border-radius: 999px;
        background: rgba(255, 255, 255, .5);
        font-weight: 600;
    }

    /* System requirements: rounded table; cards on phones (below) */
    table.table-download {
        border-collapse: separate;
        border-spacing: 0;
        overflow: hidden;
        border: 1px solid rgba(127, 100, 49, .3);
        border-radius: 12px;
        background: #fff8ec;
        font-size: 13px;
    }

    table.table-download thead th {
        padding: 8px;
        background: #efe0c9;
        color: #6b4a2e;
    }

    table.table-download tbody th,
    table.table-download tbody td {
        padding: 8px;
        border-top: 1px solid rgba(127, 100, 49, .15);
    }

    /* ---- FAQ: accordion, styled from the first paint; zz_custom.js only makes the questions
       clickable (role=button), so the page does not flash the plain list first ---- */
    .site_faq .content_left_inner > ul.list-links,
    .site_faq .content_left_inner > article + p {
        display: none;
    }

    .site_faq .content_left_inner > article {
        margin: 0 0 10px;
        border: 1px solid rgba(127, 100, 49, .3);
        border-radius: 14px;
        background: #fff8ec;
        box-shadow: 0 2px 6px rgba(80, 50, 20, .1);
        overflow: hidden;
        scroll-margin-top: 76px;
    }

    .site_faq .content_left_inner > article > h4 {
        display: flex;
        align-items: center;
        gap: 10px;
        min-height: 54px;
        margin: 0;
        padding: 12px 14px;
        color: #6b4a2e;
        font-family: inherit;
        font-size: 15px;
        font-weight: 700;
        line-height: 1.3;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .site_faq .content_left_inner > article > h4:focus-visible {
        outline: 2px solid #8b6a3e;
        outline-offset: -2px;
    }

    .site_faq .content_left_inner > article > h4::before {
        flex: none;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        border-radius: 50%;
        background: #f3e3c7;
        color: #a4611a;
        font-family: 'Font Awesome 5 Free';
        font-weight: 900;
        font-size: 13px;
        content: "\f128"; /* question */
    }

    .site_faq .content_left_inner > article > h4::after {
        flex: none;
        margin-left: auto;
        font-family: 'Font Awesome 5 Free';
        font-weight: 900;
        font-size: 13px;
        color: #b8976d;
        content: "\f078"; /* chevron down */
        transition: transform .2s ease;
    }

    .site_faq .content_left_inner > article.is-open > h4::after {
        transform: rotate(180deg);
    }

    .site_faq .content_left_inner > article > hr {
        display: none;
    }

    .site_faq .content_left_inner > article > p {
        display: none;
        margin: 0;
        padding: 0 16px 14px 52px;
        font-size: 14px;
        line-height: 1.55;
    }

    .site_faq .content_left_inner > article.is-open > p {
        display: block;
    }

    /* ---- Rules: one card per paragraph, index chips on top ---- */
    .m-rule-index {
        display: flex;
        gap: 6px;
        margin: 0 -12px 14px;
        padding: 2px 12px 6px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .m-rule-index::-webkit-scrollbar {
        display: none;
    }

    .m-rule-index a {
        flex: none;
        padding: 6px 12px;
        border: 1px solid var(--m-btn-gold-border);
        border-radius: 999px;
        background: rgba(255, 255, 255, .6);
        color: #6b4a2e;
        font-size: 13px;
        font-weight: 700;
        white-space: nowrap;
        text-decoration: none !important;
    }

    .site_rules .rule-item {
        margin: 0 0 12px;
        padding: 14px 14px 12px;
        border: 1px solid rgba(127, 100, 49, .3);
        border-left: 4px solid #d8ae5e;
        border-radius: 14px;
        background: #fff8ec;
        box-shadow: 0 2px 6px rgba(80, 50, 20, .1);
        scroll-margin-top: 76px;
    }

    .site_rules .rule-item > h4 {
        display: flex;
        align-items: center;
        gap: 10px;
        margin: 0 0 8px;
        font-family: 'Penumbra Serif', serif;
        font-size: 18px;
        line-height: 1.25;
        color: #6b4a2e;
    }

    .site_rules .rule-item__no {
        flex: none;
        padding: 4px 10px;
        border: 1px solid var(--m-btn-gold-border);
        border-radius: 999px;
        background: var(--m-btn-gold);
        color: var(--m-btn-gold-text);
        font-size: 14px;
        font-weight: 700;
        white-space: nowrap;
    }

    .site_rules .rule-item__sep,
    .site_rules .rule-item__spacer {
        display: none;
    }

    .site_rules .rule-item__text {
        font-size: 14px;
        line-height: 1.6;
    }

    .site_rules .rule-item__text p:last-child {
        margin-bottom: 0;
    }

    /* ---- Top donators ---- */
    .site_donorOfTheMonth .content_left_inner p[style*="1.5em"] {
        font-size: 1em !important;
    }

    .site_donorOfTheMonth .content_left_inner p > a[href$="site=buy"] {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-height: 48px;
        padding: 10px 20px;
        border: 1px solid var(--m-btn-gold-border);
        border-radius: 12px;
        background: var(--m-btn-gold);
        box-shadow: var(--m-btn-shadow);
        color: var(--m-btn-gold-text);
        font-family: 'Penumbra Serif', serif;
        font-size: 17px;
        font-weight: 700;
        line-height: 1.2;
        text-decoration: none !important;
    }

    .site_donorOfTheMonth .content_left_inner p > a[href$="site=buy"]::before {
        font-family: 'Font Awesome 5 Free';
        font-weight: 900;
        content: "\f3a5"; /* gem */
    }

    .site_donorOfTheMonth .content_left_inner p[style*=".9em"] {
        font-size: 14px !important;
        line-height: 1.55;
    }

    /* The page's own <style> sets every table to 694px with black borders */
    .site_donorOfTheMonth .content_left_inner table,
    .site_donorOfTheMonth .content_left_inner table.table {
        width: 100% !important;
        margin: 14px 0 !important;
        border-collapse: separate;
        border-spacing: 0;
        overflow: hidden;
        border: 1px solid rgba(127, 100, 49, .3);
        border-radius: 14px;
        background: #fff8ec;
        font-size: 13px;
    }

    .site_donorOfTheMonth .content_left_inner th,
    .site_donorOfTheMonth .content_left_inner td {
        padding: 8px 10px;
        border: 0;
        border-top: 1px solid rgba(127, 100, 49, .15);
        background: transparent;
    }

    .site_donorOfTheMonth .content_left_inner thead th {
        border-top: 0;
        background: #efe0c9;
        color: #6b4a2e;
        font-weight: 700;
    }

    /* Donator of last month / this month: podium list with medals */
    .site_donorOfTheMonth .content_left_inner table.table-striped thead th {
        padding: 10px 12px;
        background: linear-gradient(180deg, #5b4636 0%, #3f3027 100%);
        color: #fbe7b8;
        font-family: 'Penumbra Serif', serif;
        font-size: 16px;
    }

    .site_donorOfTheMonth .content_left_inner table.table-striped thead.thead-light th {
        background: #efe0c9;
        color: #6b4a2e;
    }

    .site_donorOfTheMonth table.table-striped thead th::before {
        margin-right: 8px;
        font-family: 'Font Awesome 5 Free';
        font-weight: 900;
        content: "\f521"; /* crown */
    }

    .site_donorOfTheMonth table.table-striped thead.thead-light th::before {
        content: "\f201"; /* chart */
    }

    .site_donorOfTheMonth .content_left_inner table.table-striped tbody tr:nth-of-type(odd) {
        background: transparent;
    }

    .site_donorOfTheMonth .content_left_inner table.table-striped tbody td {
        padding: 10px 8px;
        vertical-align: middle;
        font-size: 14px;
    }

    .site_donorOfTheMonth .content_left_inner table.table-striped tbody td:first-child {
        width: 56px;
        font-size: 0 !important; /* "#01" is shown as a medal */
        text-align: center;
    }

    .site_donorOfTheMonth table.table-striped tbody td:first-child::before {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: #efe0c9;
        color: #6b4a2e;
        font-family: 'Font Awesome 5 Free';
        font-weight: 900;
        font-size: 14px;
        content: "\f5a2"; /* medal */
    }

    .site_donorOfTheMonth table.table-striped tbody tr:nth-child(1) td:first-child::before { background: linear-gradient(180deg, #ffe9a8, #e1b03f); color: #6b4612; }
    .site_donorOfTheMonth table.table-striped tbody tr:nth-child(2) td:first-child::before { background: linear-gradient(180deg, #f1f3f6, #b9c0ca); color: #4b5563; }
    .site_donorOfTheMonth table.table-striped tbody tr:nth-child(3) td:first-child::before { background: linear-gradient(180deg, #f3c9a0, #c4834a); color: #5e3512; }

    .site_donorOfTheMonth .content_left_inner table.table-striped tbody td:nth-child(2) {
        font-weight: 700;
        color: #5f4a3a;
    }

    .site_donorOfTheMonth .content_left_inner table.table-striped tbody td:last-child {
        text-align: right;
        white-space: normal;
        font-size: 13px;
        line-height: 1.3;
        color: #a4611a;
        font-weight: 600;
    }

    .site_donorOfTheMonth h4.text-info {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        margin: 8px 0;
        padding: 10px 14px;
        border-radius: 12px;
        background: #e7f1f8;
        color: #1f5f8b !important;
        font-size: 15px;
        line-height: 1.3;
    }

    .site_donorOfTheMonth .content_left_inner img[style*="706px"] {
        width: 100% !important;
        height: auto !important;
        border-radius: 12px;
    }

    .site_donorOfTheMonth .content_left_inner div[style*="margin-left: -6px"] {
        margin-left: 0 !important;
    }
}

/* Desktop adjustments of the components above (the boxes have more room and no sticky menu) */
@media (min-width: 1500px), (min-width: 1100px) and (hover: hover), (min-width: 1100px) and (pointer: fine) {
    /* Hidden by default in zz_responsive.css (loaded later), shown here */
    .content_left_inner .m-rw {
        display: block;
        margin: 0 0 22px;
    }

    .site_rules .content_left_inner .m-rule-index {
        display: flex;
        flex-wrap: wrap;
        margin: 0 0 16px;
        padding: 0;
        overflow: visible;
    }

    .m-rw__track {
        padding-left: 0;
        padding-right: 0;
        scroll-padding-left: 0;
    }

    /* Reward preview: centred dialog instead of a bottom sheet */
    .m-rw-sheet__panel {
        top: 50%;
        bottom: auto;
        max-width: 780px;
        max-height: 86vh;
        padding: 22px 24px 24px;
        border-radius: 18px;
        transform: translateY(-50%);
        animation: m-rw-fade .2s ease;
    }

    .m-rw-sheet__opts:not(.is-single) {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        gap: 12px;
    }

    .m-rw-sheet__opts:not(.is-single) .m-rw-sheet__or {
        flex-direction: column;
        margin: 0;
    }

    .m-rw-sheet__opts:not(.is-single) .m-rw-sheet__or::before,
    .m-rw-sheet__opts:not(.is-single) .m-rw-sheet__or::after {
        width: 1px;
        height: 40px;
        flex: none;
    }

    .m-rw-sheet__opt img,
    .m-rw-sheet__opts.is-single .m-rw-sheet__opt img {
        max-height: 60vh;
    }

    .m-rw__item,
    .m-faq__q,
    .site_faq .content_left_inner > article > h4,
    .account_info_nav a,
    .site_downloads .content_left_inner > ul li a,
    .m-rule-index a {
        transition: background-color .15s ease, box-shadow .15s ease, transform .15s ease;
    }

    .m-rw__item:hover,
    .site_downloads .content_left_inner > ul li a:hover,
    .account_info_nav a:not(.active):hover {
        box-shadow: 0 4px 12px rgba(80, 50, 20, .18);
        transform: translateY(-1px);
    }

    .site_faq .content_left_inner > article > h4:hover {
        background: rgba(243, 227, 199, .45);
    }

    .m-rule-index a:hover {
        background: #fff;
    }

    .site_downloads .download_box:hover,
    .content_left_inner .btn:hover {
        filter: brightness(1.04);
    }

    /* Account management: three tiles per row */
    .account_info_nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Reward page on desktop: all milestone cards visible at once (no sideways scrolling with a mouse),
   two markers per level on the bar (top = first option, bottom = second) with a preview card on hover */
@media (min-width: 1500px), (min-width: 1100px) and (hover: hover), (min-width: 1100px) and (pointer: fine) {
    .m-rw__track {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
        gap: 8px;
        overflow: visible;
        padding-bottom: 4px;
    }

    .m-rw__item {
        flex: none;
        min-width: 0;
        padding: 8px 4px 10px;
    }

    .m-rw__thumb {
        width: 100%;
        max-width: 92px;
    }

    .m-rw__chip {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Room above and below the bar for the two marker rows */
    #entropiaReward {
        margin-top: 26px !important;
        margin-bottom: 44px !important;
    }

    #entropiaReward .bi-milestone.bottom {
        display: block !important;
    }

    #entropiaReward .bi-milestone.top {
        margin-top: -24px !important;
    }

    #entropiaReward .bi-milestone.bottom {
        margin-top: -4px !important;
    }

    #entropiaReward .bi-milestone::after {
        width: 14px;
        height: 14px;
    }

    #entropiaReward .bi-milestone.top::before,
    #entropiaReward .bi-milestone.bottom::before {
        content: "";
        position: absolute;
        left: 50%;
        width: 2px;
        height: 8px;
        margin-left: -1px;
        background: rgba(127, 100, 49, .35);
    }

    #entropiaReward .bi-milestone.top::before { bottom: 0; }
    #entropiaReward .bi-milestone.bottom::before { top: 0; }

    #entropiaReward .bi-milestone:hover::after {
        transform: translate(-50%, -50%) scale(1.25);
        box-shadow: 0 0 0 3px rgba(255, 255, 255, .7), 0 2px 6px rgba(80, 50, 20, .4);
    }

    #entropiaReward .bi-milestone::after {
        transition: transform .15s ease, box-shadow .15s ease;
    }

    #entropiaReward .bi-labelEdge {
        top: 36px !important;
    }

    /* Preview card next to a marker (created by zz_custom.js) */
    .m-rw-tip {
        position: fixed;
        z-index: 1990;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        width: 250px;
        padding: 10px 10px 12px;
        border: 1px solid rgba(127, 100, 49, .35);
        border-radius: 14px;
        background: #fff8ec;
        box-shadow: 0 10px 28px rgba(40, 25, 10, .35);
        color: #5f5a57;
        font-size: 13px;
        text-align: center;
        pointer-events: none;
        animation: m-rw-fade .15s ease;
    }

    .m-rw-tip[hidden] {
        display: none;
    }

    .m-rw-tip__img {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 220px;
    }

    .m-rw-tip__img img {
        max-width: 100%;
        max-height: 100%;
        border-radius: 10px;
    }

    .m-rw-tip__name {
        font-family: 'Penumbra Serif', serif;
        font-size: 15px;
        color: #6b4a2e;
    }

    .m-rw-tip__pts b {
        color: #2f8f3a;
    }

    .m-rw-tip__more {
        font-size: 11px;
        color: #a2826d;
    }
}

/* Back to top on desktop (zz_custom.js scrolls #page-scroll there), same look as on phones;
   html body: beats the global display:none in zz_responsive.css, which is loaded later */
@media (min-width: 1500px), (min-width: 1100px) and (hover: hover), (min-width: 1100px) and (pointer: fine) {
    html body .m-scroll-top {
        position: fixed;
        right: 15px;
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        z-index: 1040;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        padding: 0;
        border: 1px solid rgba(184, 134, 47, .55);
        border-radius: 50%;
        background: rgba(246, 232, 208, .72);
        -webkit-backdrop-filter: blur(4px);
        backdrop-filter: blur(4px);
        box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
        color: #7d6555;
        font-size: 15px;
        opacity: 0;
        transform: translateY(12px);
        pointer-events: none;
        transition: opacity .2s ease, transform .2s ease;
        -webkit-tap-highlight-color: transparent;
    }

    /* With reCAPTCHA on the page its badge takes the bottom right corner (60px high, 14px from
       the bottom): the button sits right above it, centred on the visible part of the badge */
    html:has(.grecaptcha-badge) body .m-scroll-top {
        bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    }

    .m-scroll-top.is-visible {
        opacity: 1;
        transform: none;
        pointer-events: auto;
    }

    .m-scroll-top:active {
        background: rgba(246, 232, 208, .95);
    }

    html body .m-scroll-top:hover {
        background: rgba(246, 232, 208, .95);
        cursor: pointer;
    }
}

/* User panel login: the stone fields (234px images with ~7px transparent edge, pulled 7px left by
   04_site.css) are centred above the Login button, the labels start at the visible field edge */
@media (min-width: 1500px), (min-width: 1100px) and (hover: hover), (min-width: 1100px) and (pointer: fine) {
    #userpanel form input.form-input {
        display: block;
        margin: 2px auto 6px;
    }

    #userpanel form label {
        display: block;
        width: 234px;
        max-width: 100%;
        margin: 0 auto;
        padding-left: 9px;
    }
}
