/*
 * Travian: Legends Clone
 * ---------------------------------------------------------------------------
 * Small additions on top of the official Travian: Legends game pack stylesheet
 * (assets/gpack/css_ltr/imports_compressed.css). Everything that exists in the
 * official stylesheet is styled by it, so this file only covers the few
 * elements the clone adds on its own.
 */

body {
    overflow-y: scroll;
}

/* --- Build menu ------------------------------------------------------- */
.buildOption {
    display: grid;
    grid-template-columns: 90px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(191, 179, 155, .35);
}

.buildOption img.building {
    width: 80px;
    height: 80px;
}

.buildOption .description p {
    margin: 4px 0;
    color: #5c5346;
    font-size: 12px;
    line-height: 1.4;
    max-height: 42px;
    overflow: hidden;
}

.buildOption .boxTitle {
    font-weight: bold;
    font-size: 14px;
}

.buildOption .errors {
    color: #a3311f;
    font-size: 11px;
    margin: 4px 0 0;
    padding-left: 16px;
}

.buildList {
    margin-top: 8px;
}

.buildDetail {
    display: flex;
    gap: 16px;
    padding: 8px;
}

.buildDetail img.building.big {
    width: 160px;
    height: 160px;
    flex: none;
}

.buildDetail .description p {
    margin: 4px 0;
    color: #5c5346;
    font-size: 13px;
}

.buildDetail .costs,
.costs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
}

.buildDetail .errors {
    color: #a3311f;
    font-size: 12px;
}

/* --- Troop panel ------------------------------------------------------ */
.troopGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.troopCard {
    border: 1px solid rgba(191, 179, 155, .45);
    border-radius: 4px;
    padding: 8px;
    background: rgba(255, 252, 244, .35);
    text-align: center;
}

.troopCard img.unit {
    width: 56px;
    height: 56px;
}

.troopCard .name {
    font-weight: bold;
    font-size: 13px;
    margin: 4px 0;
}

.troopCard .stats {
    display: flex;
    justify-content: center;
    gap: 8px;
    font-size: 11px;
    color: #6b6152;
}

.troopCard .costs {
    justify-content: center;
    margin: 4px 0;
}

.troopCard .meta {
    font-size: 10px;
    color: #857a68;
}

.troopCard form {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}

.troopCard .amountInput {
    width: 70px;
    text-align: center;
}

.sendTroopsBox,
.troopOverview {
    margin-top: 18px;
}

.sendTroopsBox form {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.sendTroopsBox label {
    display: flex;
    flex-direction: column;
    font-size: 12px;
    gap: 3px;
}

.textInput {
    border: 1px solid #8d8266;
    border-radius: 2px;
    background: #fffdf7;
    padding: 4px 6px;
    font-size: 13px;
    min-width: 120px;
}

.inlineForm {
    display: inline;
}

/* --- Message list ----------------------------------------------------- */
.messageList {
    list-style: none;
    margin: 0;
    padding: 0;
}

.messageEntry {
    border-bottom: 1px solid rgba(191, 179, 155, .35);
    padding: 8px 0;
}

.messageEntry .subject {
    font-weight: bold;
}

.messageEntry .body {
    white-space: pre-line;
    font-size: 13px;
    margin: 4px 0;
}

.messageEntry .meta {
    font-size: 11px;
    color: #857a68;
}

/* --- Content page helpers --------------------------------------------- */
#content h2 {
    font-size: 16px;
    margin: 16px 0 6px;
}

#content .table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

#content .table th {
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6b6152;
    border-bottom: 1px solid rgba(191, 179, 155, .5);
    padding: 5px 8px;
}

#content .table td {
    border-bottom: 1px solid rgba(191, 179, 155, .25);
    padding: 5px 8px;
}

#content .text-right {
    text-align: right;
}

#content .text-emerald-600 {
    color: #2f7d32;
}

#content .text-red-700 {
    color: #a3311f;
}

#content .error {
    color: #a3311f;
}

#content .taskList {
    list-style: none;
    margin: 0;
    padding: 0;
}

#content .taskList li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(191, 179, 155, .25);
    font-size: 13px;
}

#content .inlineIcon.resource i {
    display: inline-block;
    vertical-align: middle;
    margin-right: 3px;
}

#content .inlineIcon.duration i {
    vertical-align: middle;
    margin-right: 3px;
}

#content .grid {
    display: grid;
}

#content .mt-2 { margin-top: 8px; }
#content .mt-4 { margin-top: 16px; }
#content .gap-2 { gap: 8px; }

/* --- Map -------------------------------------------------------------- */
.mapView {
    position: relative;
    width: 1280px;
    height: 720px;
    margin: 0 auto;
    background: url('/assets/gpack/img_ltr/themes/default/background/bgMap.jpg') center/cover no-repeat, #1c2a1a;
    border: 1px solid #4a4132;
}

.mapTile {
    position: absolute;
    width: 16px;
    height: 16px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: transparent;
    cursor: pointer;
    font-size: 8px;
    color: rgba(255, 255, 255, .45);
    line-height: 14px;
    padding: 0;
}

.mapTile:hover {
    background: rgba(255, 220, 120, .25);
    border-color: #e0b74a;
}

.mapTile.hasVillage {
    background: radial-gradient(circle at center, #c0392b 55%, transparent 60%);
}

.mapTile.hasOasis {
    background: radial-gradient(circle at center, #2e86c1 55%, transparent 60%);
}

.mapTile.hasField {
    background: radial-gradient(circle at center, #7f8c3f 55%, transparent 60%);
}

.mapTile.isOwn {
    background: radial-gradient(circle at center, #e0b74a 55%, transparent 60%);
}

.mapInfo {
    margin-top: 10px;
    font-size: 13px;
    min-height: 22px;
}

/* --- Dialog overlay (build menu, rally point) -------------------------- */
.cloneDialogWrapper {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    background: rgba(20, 14, 8, .45);
    overflow: auto;
    padding: 40px 0;
}

.cloneDialogWrapper .dialogContents {
    max-height: 84vh;
    overflow: auto;
}

.cloneDialogWrapper #dialogContent {
    background-color: #f4efe4;
    margin-top: 67px;
    padding: 14px 12px;
    min-width: 480px;
}

.cloneDialogWrapper h1.titleInHeader {
    background: transparent;
    color: #4a3a22;
    font-size: 22px;
    line-height: 32px;
}

.cloneDialogWrapper .contentNavi.subNavi .tabItem {
    display: inline-block;
    padding: 6px 18px;
    background: #d2bda1;
    font-weight: bold;
    color: #4a3a22;
}

.cloneDialogWrapper .contentNavi.subNavi .tabItem.active {
    background: #a67c3f;
    color: #fff9eb;
}

/* --- Player avatar (top right) ---------------------------------------- */
.cloneAvatar {
    width: 74px;
    height: 74px;
    border-radius: 50%;
    border: 3px solid #6b4a1f;
    background: radial-gradient(circle at 35% 28%, #ffe9a8, #d9a441 45%, #8a5c1c 100%);
    color: #4a2f0c;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 38px;
    font-weight: bold;
    line-height: 1;
    text-shadow: 0 1px 0 rgba(255, 255, 255, .45);
    cursor: pointer;
    box-shadow: inset 0 0 12px rgba(255, 255, 255, .35), 0 2px 6px rgba(0, 0, 0, .45);
}

.cloneAvatar:hover {
    filter: brightness(1.08);
}

/* --- Top right button cluster (profile / options / help / logout) ------- */
.cloneTopRightButtons {
    position: absolute;
    top: 4px;
    right: 10px;
    z-index: 40;
    display: flex;
    gap: 4px;
    align-items: center;
}

.cloneTopRightButtons .layoutButton {
    position: relative;
    width: 30px;
    height: 30px;
}

/* --- Player avatar (official position, right of the currency) --------- */
.cloneAvatarWrapper {
    position: absolute;
    top: 6px;
    right: 318px;
    z-index: 40;
}

.cloneAvatarMenu {
    position: absolute;
    top: 86px;
    right: 0;
    min-width: 170px;
    list-style: none;
    margin: 0;
    padding: 6px;
    border-radius: 6px;
    border: 1px solid #6b4a1f;
    background: #f4efe4;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .45);
}

.cloneAvatarMenu li a {
    display: block;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 13px;
    color: #4a3a22;
}

.cloneAvatarMenu li a:hover {
    background: #d2bda1;
}

.cloneLogoutForm {
    display: inline-flex;
}

.cloneLogoutForm button {
    border: 1px solid #553420;
    border-radius: 50%;
    background: none;
    padding: 0;
    cursor: pointer;
}


/* --- Map --------------------------------------------------------------- */
.cloneMapWrapper {
    position: relative;
    width: 100%;
    height: calc(100vh - 150px);
    min-height: 520px;
    display: flex;
    flex-direction: column;
    border: 1px solid #4a4132;
    background: #14200f;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, .7);
}

.cloneMapToolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 10px;
    background: #2c2419;
    border-bottom: 1px solid #4a4132;
}

.cloneMapCoords {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #e8dcc4;
}

.cloneMapCoords input,
.cloneMapCoords select {
    width: 64px;
    border: 1px solid #6b5a3a;
    background: #14100a;
    color: #f2e6cc;
    padding: 2px 4px;
    border-radius: 2px;
}

.cloneMapZoom {
    display: flex;
    gap: 4px;
}

.cloneMapCanvas {
    position: relative;
    flex: 1;
    overflow: auto;
    background:
        repeating-linear-gradient(45deg, rgba(255, 255, 255, .012) 0 8px, transparent 8px 16px),
        radial-gradient(circle at 30% 20%, #1f3a1c, #101c10 70%);
}

.cloneMapGrid {
    position: relative;
}

.cloneMapTile {
    position: absolute;
    width: 16px;
    height: 16px;
    padding: 0;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
}

.cloneMapTile:hover {
    border-color: rgba(224, 183, 74, .8);
    background: rgba(224, 183, 74, .15);
}

.cloneMapTile.has-field {
    background: radial-gradient(circle, rgba(127, 140, 63, .85) 40%, transparent 45%);
}

.cloneMapTile.has-oasis {
    background: radial-gradient(circle, rgba(46, 134, 193, .9) 40%, transparent 48%);
}

.cloneMapTile.has-village {
    background: radial-gradient(circle, rgba(192, 57, 43, .95) 42%, transparent 52%);
}

.cloneMapTile.is-own {
    background: radial-gradient(circle, rgba(224, 183, 74, .95) 42%, transparent 52%);
}

.cloneMapInfo {
    position: relative;
    z-index: 6;
    padding: 6px 10px;
    background: #2c2419;
    border-top: 1px solid #4a4132;
    color: #f2e6cc;
    font-size: 13px;
    min-height: 32px;
}

/* The map window sits in the middle column of the centre, exactly like the
   original does it (a 600 pixel column between the two sidebars). */
body.mapView #center #contentOuterContainer {
    grid-column-start: 2;
    grid-row-start: 1;
    align-self: start;
    justify-self: center;
    width: 600px;
    max-width: 600px;
    min-width: 0;
    overflow: visible;
}

body.mapView #center {
    grid-template-columns: 1fr 600px 1fr;
}

/* Grid items must be allowed to shrink, otherwise the map canvas stretches
   the whole centre column. */
body.mapView #center .sidebar {
    min-width: 0;
}

.cloneMapCanvas {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

body.mapView #center #contentOuterContainer {
    overflow: visible;
}

.cloneMapMarker {
    position: absolute;
    left: -22px;
    top: -30px;
    width: 44px;
    pointer-events: none;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .6));
}

/* --- Hero inventory layout -------------------------------------------- */
.heroV2Layout {
    display: grid;
    grid-template-columns: 62px 1fr;
    gap: 8px;
    align-items: start;
    margin-bottom: 10px;
}

.heroV2Equipment {
    display: grid;
    gap: 4px;
}

.heroV2Equipment .heroItem {
    width: 62px;
    height: 62px;
    border: 1px solid #6b5a3a;
    border-radius: 4px;
    background: rgba(0, 0, 0, .12);
}

.heroV2Body {
    display: flex;
    justify-content: center;
    background: linear-gradient(180deg, rgba(210, 189, 161, .55), rgba(210, 189, 161, .15));
    border-radius: 4px;
    min-height: 260px;
    align-items: flex-end;
}

.heroV2Body img {
    height: 260px;
    width: auto;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .45));
}

.troopCard .sendAmount {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-top: 6px;
    font-size: 11px;
    color: #6b6152;
}

.troopCard .sendAmount input {
    width: 70px;
    border: 1px solid #8d8266;
    border-radius: 2px;
    background: #fffdf7;
    padding: 2px 4px;
    text-align: center;
    font-size: 12px;
}

/* --- Map blocks & markers ---------------------------------------------- */
/* --- Official map window ------------------------------------------------ */
#content.map {
    padding: 0;
}

#content.map .titleInHeader {
    position: static;
    inset: auto;
    height: auto;
    margin: 0 0 6px;
    padding: 8px 12px;
    font-size: 22px;
    color: #f2e6cc;
    background: linear-gradient(#4a4132, #2c2419);
    border: 1px solid #636363;
    border-bottom: 0;
}

body.mapView .map2 {
    position: relative;
    height: auto;
    min-height: 417px;
    padding: 30px 0 18px 26px;
    border: 1px solid #636363;
    background: #23201a;
}

.cloneMapToolbar {
    display: flex;
    gap: 6px;
    align-items: center;
    padding: 4px 6px;
    margin-bottom: 4px;
    background: #2c2419;
    border: 1px solid #4a4132;
    font-size: 12px;
    color: #f2e6cc;
}

.cloneMapToolbar .mapToolbarButton {
    width: 20px;
    height: 20px;
    padding: 0;
    font-size: 13px;
    line-height: 1;
    color: #f2e6cc;
    cursor: pointer;
    background: #3a3125;
    border: 1px solid #6b5f49;
    border-radius: 2px;
}

.cloneMapToolbar .mapToolbarButton:hover {
    color: #e0b74a;
    border-color: #e0b74a;
}

.cloneMapToolbar .mapToolbarButton:disabled {
    opacity: .45;
    cursor: default;
}

.cloneMapToolbar .iconCropfinder {
    background: radial-gradient(circle at 50% 40%, #f0d060, #8a6a12);
    border-color: #e0b74a;
}

.cloneMapToolbar .iconRequireGold {
    background: radial-gradient(circle at 50% 40%, #6b6b6b, #2c2c2c);
}

.cloneMapToolbar select {
    padding: 2px 4px;
    font-size: 12px;
    color: #f2e6cc;
    background: #3a3125;
    border: 1px solid #6b5f49;
    border-radius: 2px;
}

.cloneMapFrame {
    position: relative;
    /* the map canvas plus the coordinate axis underneath it */
    height: 419px;
}

#mapContainer {
    position: relative;
    width: 543px;
    height: 401px;
    overflow: auto;
    background: #1b1a16;
}

.cloneMapAxis {
    position: absolute;
    overflow: hidden;
    font-size: 10px;
    color: #b7a98c;
    background: #26231c;
    user-select: none;
}

.cloneMapAxisY {
    top: 0;
    left: 0;
    width: 25px;
    height: 401px;
    border-right: 1px solid #4a4132;
}

.cloneMapAxisX {
    top: 401px;
    left: 25px;
    width: 543px;
    height: 18px;
    border-top: 1px solid #4a4132;
}

.cloneMapAxisInner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.cloneMapAxisY .cloneMapAxisInner {
    width: 25px;
    height: 24060px;
}

.cloneMapAxisX .cloneMapAxisInner {
    width: 24060px;
    height: 18px;
}

.cloneMapTick {
    position: absolute;
    color: #b7a98c;
}

.cloneMapAxisY .cloneMapTick {
    right: 3px;
    transform: translateY(-50%);
}

.cloneMapAxisX .cloneMapTick {
    top: 2px;
    transform: translateX(-50%);
}

.cloneMapWorld {
    position: relative;
}

.cloneMapBlock {
    position: absolute;
    width: 600px;
    height: 600px;
    pointer-events: none;
}

.cloneMapBlock img.image,
.cloneMapBlock img.imageMark {
    position: absolute;
    top: 0;
    left: 0;
    width: 600px;
    height: 600px;
}

.cloneMapCropResults {
    padding: 6px 10px;
    background: #2c2419;
    border-top: 1px solid #4a4132;
    color: #f2e6cc;
    font-size: 13px;
    max-height: 180px;
    overflow: auto;
}

.cloneMapCropResults .boxTitle {
    font-weight: bold;
    color: #e0b74a;
    margin-bottom: 4px;
}

/* --- Grey area (the central Natar zone) -------------------------------- */
.cloneMapGreyArea {
    position: absolute;
    border-radius: 50%;
    background: rgba(30, 28, 24, .35);
    box-shadow: inset 0 0 60px rgba(0, 0, 0, .55);
    pointer-events: none;
    z-index: 1;
}

/* --- Settlement map picker ---------------------------------------------- */
.cloneMapPick {
    position: absolute;
    border: 2px solid #e0b74a;
    box-shadow: 0 0 10px rgba(224, 183, 74, .8);
    pointer-events: none;
    z-index: 5;
}

/* --- Found new village button ------------------------------------------ */
.sidebarBox .settleLink {
    padding: 6px 8px 10px;
}

.sidebarBox .settleLink a {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 6px;
    font-size: 12px;
    color: #f2e6cc;
    text-decoration: none;
    border: 1px solid #4a4132;
    border-radius: 4px;
    background: rgba(0, 0, 0, .25);
}

.sidebarBox .settleLink a:hover {
    border-color: #e0b74a;
    color: #e0b74a;
}

.sidebarBox .settleLink svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

body.mapView #content.map {
    width: 600px;
}

/* --- Crop finder panel --------------------------------------------------- */
.cloneMapCropFinder {
    position: relative;
    z-index: 6;
    padding: 6px 10px;
    background: #2c2419;
    border-top: 1px solid #4a4132;
    color: #f2e6cc;
    font-size: 13px;
}

.cloneMapCropFinder .boxTitle {
    font-weight: bold;
    color: #e0b74a;
    margin-bottom: 4px;
}

.cloneMapCropFilters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
    font-size: 12px;
}

.cloneMapCropFilters select {
    margin-left: 4px;
    padding: 1px 4px;
    color: #f2e6cc;
    background: #3a3125;
    border: 1px solid #6b5f49;
    border-radius: 2px;
}

.cloneMapCropEmpty {
    font-size: 12px;
    color: #b7a98c;
}

/* --- Official map grid --------------------------------------------------- */
.cloneMapGrid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/assets/gpack/img/map/grid/grid-1.gif');
    background-repeat: repeat;
    pointer-events: none;
    z-index: 3;
    opacity: .5;
}

/* --- Celebration (Town Hall) -------------------------------------------- */
.buildDetail .celebration {
    margin-top: 12px;
    padding: 8px 10px;
    border: 1px solid #4a4132;
    border-radius: 3px;
    background: rgba(0, 0, 0, .2);
}

.buildDetail .celebration .boxTitle {
    margin-bottom: 4px;
    font-weight: bold;
    color: #e0b74a;
}

/* --- Marketplace tabs and NPC merchant ----------------------------------- */
.marketTabs {
    display: flex;
    gap: 2px;
    margin-bottom: 10px;
    border-bottom: 1px solid #4a4132;
}

.marketTab {
    padding: 5px 12px;
    font-size: 13px;
    color: #b7a98c;
    text-decoration: none;
    border: 1px solid transparent;
    border-bottom: 0;
}

.marketTab:hover,
.marketTab.active {
    color: #e0b74a;
    background: #2c2419;
    border-color: #4a4132;
}

.marketNpc {
    padding: 8px 10px;
    margin-bottom: 10px;
    border: 1px solid #4a4132;
    border-radius: 3px;
    background: rgba(0, 0, 0, .2);
}

.marketNpc .boxTitle {
    margin-bottom: 4px;
    font-weight: bold;
    color: #e0b74a;
}

/* --- Alliance bonuses ---------------------------------------------------- */
.allianceBonuses {
    margin-top: 12px;
    padding: 8px 10px;
    border: 1px solid #4a4132;
    border-radius: 3px;
    background: rgba(0, 0, 0, .2);
}

/* --- Demolition of buildings (main building level 10) -------------------- */
.buildDetail .demolition {
    margin-top: 12px;
    padding: 8px 10px;
    border: 1px solid #4a4132;
    border-radius: 3px;
    background: rgba(0, 0, 0, .2);
}

.buildDetail .demolition .boxTitle {
    margin-bottom: 4px;
    font-weight: bold;
    color: #e0b74a;
}

/* --- Hero inventory ------------------------------------------------------ */
.heroV2Attributes .heroInventory {
    margin-top: 12px;
    padding: 8px 10px;
    border: 1px solid #4a4132;
    border-radius: 3px;
    background: rgba(0, 0, 0, .2);
}

.heroV2Attributes .heroInventory .boxTitle {
    margin-bottom: 4px;
    font-weight: bold;
    color: #e0b74a;
}

/* --- Notification centre ------------------------------------------------- */
#navigation a.notifications {
    position: relative;
    display: block;
    width: 32px;
    height: 32px;
    margin: 0 2px;
    background: radial-gradient(circle at 50% 35%, #d8c08a, #6b5f49);
    border-radius: 50%;
    cursor: pointer;
}

#navigation a.notifications:hover {
    background: radial-gradient(circle at 50% 35%, #f0d89a, #8a7a5a);
}

.taskList li.read {
    opacity: .55;
}
