/* Travian SS — classic Saudi-style game chrome */

/* Light mountain panorama used by the reference theme. */
div#dynamic_header,
body.mod1 div#dynamic_header,
body.mod2 div#dynamic_header {
    min-height: 64px;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    position: relative;
    background-color: #eef8fc !important;
    background-image: url("../gpack/travian/images/artwork.jpg?v=19") !important;
    background-position: center 43% !important;
    background-repeat: no-repeat !important;
    background-size: cover !important;
    border-bottom: 1px solid #b9c3c7;
}

/* Desktop banner height only. Narrower viewports are sized by
   travian-responsive.css (72px ≤979, 64px ≤768), so no height is
   declared here below 980px and no !important is needed. */
@media (min-width: 980px) {
    div#dynamic_header,
    body.mod1 div#dynamic_header,
    body.mod2 div#dynamic_header {
        height: 100px;
    }
}

div#dynamic_header::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.18) 0%,
        rgba(255, 255, 255, 0) 58%,
        rgba(255, 255, 255, 0.3) 100%
    );
    pointer-events: none;
    z-index: 0;
}

div#dynamic_header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: #d9dedf;
    border-top: 1px solid rgba(255, 255, 255, 0.9);
    z-index: 1;
}

div#dynamic_header .tss-brand {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-align: center;
}

div#dynamic_header .tss-brand .brand-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

div#dynamic_header .tss-brand .ornament {
    display: inline-block;
    width: 34px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #a88913, transparent);
}

div#dynamic_header .tss-brand .name {
    font-family: Tahoma, Arial, sans-serif;
    font-size: 23px;
    font-weight: 700;
    letter-spacing: 0;
    color: #f1cc18;
    text-shadow:
        1px 1px 0 #715f08,
        -1px -1px 0 rgba(255, 255, 255, 0.8);
}

div#dynamic_header .tss-brand .ss {
    color: #d5a900;
    text-shadow: 1px 1px 0 #715f08;
}

div#dynamic_header .tss-brand .tagline {
    font-family: Tahoma, Arial, sans-serif;
    font-size: 10px;
    letter-spacing: 0;
    color: var(--color-tss-stone-label, #5b6169);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
    opacity: 1;
}

/* The reference theme keeps the right navigation compact and text-only. */
div#side_navi a#logo {
    display: none !important;
}
div#side_navi a#logo img {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: none !important;
}
div#side_navi a#logo::after {
    content: "";
    display: none;
}
div#side_navi a#logo::before {
    content: "";
    display: none;
}

/* Portal / homepage — kill TravianZ ribbon logo */
body.indexpage #navigation,
body.indexPage #navigation,
body.contentpage #navigation,
body.contentPage #navigation,
body.presto #navigation {
    background-image: none !important;
    background-color: rgba(255, 255, 255, 0.92) !important;
    border-radius: 8px;
}
#navigation a.home {
    background: none !important;
    text-indent: 0 !important;
    overflow: visible !important;
    width: auto !important;
    min-width: 160px;
    height: auto !important;
    min-height: 48px;
    /* A MARGIN, not an inset. The element is position: relative, so an inset
       moves it without moving anything else - it slid 20px into the menu
       sitting beside it and painted the last letters of the site name behind
       it (measured: title 863..1023, menu 237..883, overlap 20px). A logical
       margin reserves the same 20px instead of stealing it. */
    inset-inline-start: auto !important;
    inset-inline-end: auto !important;
    margin-inline-start: 20px;
    top: 18px !important;
    display: inline-flex !important;
    align-items: center;
    font-family: "Cairo", "Tajawal", Tahoma, sans-serif;
    font-size: 1.45rem;
    font-weight: 700;
    color: #8b1a1a !important;
    text-decoration: none !important;
    text-shadow: 0 1px 0 #fff;
}
#navigation a.home img {
    display: none !important;
}
#navigation a.home::before {
    content: "Travian ";
    color: var(--color-tss-stone-ink, #3c4147);
}
#navigation a.home::after {
    content: "SS";
    color: #c62828;
}
html[dir="rtl"] #navigation a.home::before {
    content: "ترافيان ";
}
html[dir="rtl"] #navigation a.home::after {
    content: "SS";
}

/* Outgame register CTA in side menu */
div#side_navi a.tss-nav-register {
    color: #c45a00 !important;
    font-weight: bold;
}

/* ========== Side menu on the RIGHT — Arabic / RTL only ========== */
html[dir="rtl"] div#side_navi {
    text-align: right;
}

html[dir="rtl"] div#side_navi p a,
html[dir="rtl"] div#side_navi .tss-nav-group a {
    padding-left: 0 !important;
    padding-right: 12px !important;
}

html[dir="rtl"] div#side_navi table {
    padding-left: 0 !important;
    padding-right: 12px !important;
}

html[dir="rtl"] div#side_info {
    text-align: right;
}

html[dir="rtl"] div#side_info h5,
html[dir="rtl"] div#side_info div.news {
    margin-left: 0 !important;
    margin-right: 10px;
}

/* Desktop float overrides live in travian-ss-layout.css (CSS Grid). */
@media (max-width: 979px) {
    html[dir="rtl"] div#side_navi,
    html[dir="rtl"] div#content,
    html[dir="rtl"] div#side_info {
        float: none !important;
    }
}

/* Floating support widget */
.tss-support-widget {
    position: fixed;
    z-index: 9999;
    bottom: 18px;
    inset-inline-end: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #1e5fad;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
    font: bold 13px/1.2 "Tajawal", Tahoma, Arial, sans-serif;
}
.tss-support-widget:hover {
    background: #174a88;
    color: #fff !important;
}
.tss-support-widget .tss-support-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    color: #1e5fad;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

/* The widget is position:fixed, so on a short screen it lands on top of
   whatever control happens to sit at the bottom of the page — measured
   covering the login submit button at 375px wide. Shrink it and reserve
   matching space at the end of the document so it can never cover a control. */
@media (max-width: 768px) {
    .tss-support-widget {
        bottom: 10px;
        padding: 8px 12px;
        font: bold 12px/1.2 "Tajawal", Tahoma, Arial, sans-serif;
    }

    .tss-support-widget .tss-support-icon {
        width: 18px;
        height: 18px;
        font-size: 12px;
    }

    .wrapper {
        padding-bottom: 68px;
    }
}

/* Homepage USP box */
.tss-usp-box {
    margin: 12px 0 8px;
    padding: 12px 14px;
    background: linear-gradient(180deg, var(--color-tss-stone-50, #f8f8f7), var(--color-tss-stone-100, #ececeb));
    border: 1px solid var(--color-tss-stone-line, #3c414733);
    border-radius: 4px;
}
.tss-usp-box h3 {
    margin: 0 0 8px;
    font: bold 15px/1.3 "Cairo", "Tajawal", Tahoma, sans-serif;
    color: var(--color-tss-stone-ink, #3c4147);
}
.tss-usp-box ul {
    margin: 0;
    padding: 0 18px;
}
.tss-usp-box li {
    margin: 4px 0;
    font: 12px/1.45 "Tajawal", Tahoma, Arial, sans-serif;
    color: var(--color-tss-stone-ink, #3c4147);
}

/* Registration gold badge */
.tss-reg-bonus {
    margin: 0 0 10px;
    padding: 8px 10px;
    background: var(--color-tss-stone-50, #f8f8f7);
    border: 1px solid var(--color-tss-gold-pill-mid, #f59e0b);
    border-radius: 3px;
    color: var(--color-tss-stone-ink, #3c4147);
    font: bold 12px/1.4 "Tajawal", Tahoma, Arial, sans-serif;
    text-align: center;
}

.tss-captcha-code {
    display: inline-block;
    vertical-align: middle;
    margin: 0 8px 0 0;
    padding: 4px 12px 4px 10px;
    letter-spacing: 0.4em;
    font: 700 18px/1.2 "Courier New", Courier, monospace;
    color: var(--color-tss-stone-ink, #3c4147);
    background: var(--color-tss-stone-100, #ececeb);
    border: 1px solid var(--color-tss-stone-line, #3c414733);
    border-radius: 4px;
    user-select: none;
}

html[dir="rtl"] .tss-captcha-code {
    margin: 0 0 0 8px;
}

#regwiz .tss-captcha-code {
    display: block;
    width: fit-content;
    margin: 0 0 8px;
}

html[dir="rtl"] #regwiz .tss-captcha-code {
    margin: 0 0 8px;
}
