/* ==========================================================================
   travian-base.css — TaTatrGam Design System
   CSS Variables · Reset · Typography · Buttons · Tables · Tabs · Utilities
   ========================================================================== */

/* --- CSS Variables --- */
:root {
    /* Backgrounds */
    --bg-page:       #FFFFFF;
    --bg-content:    #FFFFFF;
    --bg-header:     #E8E9EB;
    --bg-nav:        #4A7B3F;
    --bg-sidebar:    #FFFFFF;
    --bg-resource:   transparent;
    --bg-footer:     #FFFFFF;
    --bg-table-even: #F9F9FB;
    --bg-table-odd:  #FCFCFC;
    --bg-table-head: #E5E7EA;

    /* Text */
    --text-primary:   #222222;
    --text-secondary: #555555;
    --text-link:      #2A7A38;
    --text-link-hover:#3E9D50;
    --text-heading:   #111111;
    --text-gold:      #D4A843;
    --text-light:     #FFFFFF;

    /* Borders */
    --border-light:  #E0E0E0;
    --border-medium: #CCCCCC;
    --border-dark:   #999999;
    --border-green:  #2E8B57;

    /* Resources */
    --res-wood:      #8B6914;
    --res-clay:      #CC6600;
    --res-iron:      #888888;
    --res-crop:      #CCAA00;
    --res-negative:  #CC0000;

    /* Dimensions */
    --sidebar-width:   155px;
    --village-panel:   160px;
    --content-max:     980px;
    --header-height:   100px;
    --nav-height:      42px;
    --resource-height: 36px;

    /* Plus */
    --plus-green: #71D000;
    --plus-orange: #FF6F0F;
}

/* --- Minimal Reset --- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-page);
    color: var(--text-primary);
    font-family: Tahoma, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    direction: rtl;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

/* Mobile touch: prevent 300ms double-tap zoom delay */
a, button, [role="button"], input, select, textarea {
    touch-action: manipulation;
}

img {
    border: 0;
    vertical-align: middle;
}

a {
    color: var(--text-link);
    text-decoration: none;
    cursor: pointer;
}

a:hover {
    color: var(--text-link-hover);
    text-decoration: underline;
}

area {
    cursor: pointer;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-heading);
    margin: 0.5em 0;
}

p {
    margin: 0.5em 0;
}

table {
    border-collapse: collapse;
    margin: 0;
}

td, th {
    padding: 2px 4px;
    text-align: right;
}

ul, ol {
    margin: 0.5em 0;
    padding-inline-start: 1.5em;
}

/* --- Typography --- */
.text-gold {
    color: var(--text-gold);
}

.text-negative {
    color: var(--res-negative);
}

.text-secondary {
    color: var(--text-secondary);
}

/* --- Buttons --- */
.btn-travian {
    display: inline-block;
    padding: 4px 12px;
    background-color: #2F9F2F; /* Match resources */
    border: 1px solid #1B5E20;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    line-height: 1.6;
}

.btn-travian:hover {
    background-color: #388E3C;
    color: #fff;
    text-decoration: none;
}

.btn-travian:active {
    background-color: #1B5E20;
}

.btn-primary {
    background-color: #2B78E4;
    border: 1px solid #1A5E9E;
}

.btn-primary:hover {
    background-color: #4A90E2;
}

.btn-danger {
    background-color: #C62828;
    border: 1px solid #8E0000;
}

.btn-danger:hover {
    background-color: #EF5350;
}

.btn-small {
    padding: 2px 8px;
    font-size: 10px;
}

/* --- Tables (Travian style) --- */
.trav-table {
    width: 100%;
    border: 1px solid var(--border-light);
}

.trav-table th {
    background-color: var(--bg-table-head);
    color: var(--text-heading);
    font-weight: bold;
    padding: 4px 6px;
    border-bottom: 1px solid var(--border-medium);
}

.trav-table td {
    padding: 3px 6px;
    border-bottom: 1px solid var(--border-light);
}

.trav-table tr:nth-child(even) td {
    background-color: var(--bg-table-even);
}

.trav-table tr:nth-child(odd) td {
    background-color: var(--bg-table-odd);
}

.trav-table tr:hover td {
    background-color: #F0F0F0;
}

.trav-table tr.hl td {
    background-color: #E5F3E6;
}

/* Old table compat — row_table_data alternating rows */
table.row_table_data tr:nth-child(even) td {
    background-color: var(--bg-table-even);
}

table.row_table_data tr:nth-child(odd) td {
    background-color: var(--bg-table-odd);
}

/* --- Tabs (#textmenu) --- */
#textmenu {
    margin: 14px 0;
    font-size: 13px;
    font-weight: normal;
}

    #textmenu a {
        color: var(--text-link);
        text-decoration: none;
        padding: 2px 6px;
        margin: 0 2px;
        font-size: 15px;
        font-weight: normal;
    }

#textmenu a:hover {
    color: var(--text-link-hover);
}

#textmenu a.selected {
    border-bottom: 2px solid var(--text-link);
    font-weight: bold;
}

#textmenu span {
    color: #C0C0C0;
    font-weight: bold;
}

/* --- Resource Icons (sprite from res2.gif) --- */
img.r1, img.r2, img.r3, img.r4, img.r5 {
    background-image: url("../img/gpack/img/a/res2.gif");
    background-repeat: no-repeat;
    height: 12px;
    width: 18px;
    display: inline-block;
    vertical-align: middle;
}

img.r1 { background-position: 0 0; }
img.r2 { background-position: -21px 0; }
img.r3 { background-position: -42px 0; }
img.r4 { background-position: -63px 0; }
img.r5 { background-position: -84px 0; }

/* Large resource icons (resNew2.png) */
img.r100, img.r200, img.r300, img.r400, img.r500,
img.r600, img.r700, img.r800, img.r900,
img.r1000, img.r1100 {
    height: 21px;
    width: 25px;
    background-image: url("../img/gpack/img/a/resNew2.png");
    background-repeat: no-repeat;
    display: inline-block;
    vertical-align: middle;
}

img.r100  { background-position: 0 0; }
img.r200  { background-position: 0 -21px; }
img.r300  { background-position: 0 -42px; }
img.r400  { background-position: 0 -63px; }
img.r500  { background-position: 0 -84px; }
img.r600  { background-position: 0 -105px; }
img.r700  { background-position: 0 -126px; }
img.r800  { background-position: 0 -147px; }
img.r900  { background-position: 0 -168px; }
img.r1000 { background-position: 0 -189px; }
img.r1100 { background-position: 0 -210px; }

/* --- Forms --- */
input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
select,
textarea {
    font-family: Tahoma, Arial, sans-serif;
    font-size: 14px;
    padding: 3px 6px;
    border: 1px solid var(--border-medium);
    background-color: #fff;
    color: var(--text-primary);
    direction: rtl;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--text-link);
    box-shadow: 0 0 3px rgba(85, 119, 34, 0.3);
}

/* --- Plus styling --- */
span.plus_g {
    color: var(--plus-green);
    font-weight: bold;
}

span.plus_o {
    color: var(--plus-orange);
    font-weight: bold;
}

/* --- Status classes --- */
.none {
    color: #C0C0C0;
}

.error {
    color: #FF8000;
}

/* --- Utility Classes --- */
.hide {
    display: none;
}

.hl {
    background-color: #FFF3C4;
}

.text-center {
    text-align: center;
}

.text-start {
    text-align: start;
}

/* --- Scrollbar (thin, themed) --- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-page);
}

::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-dark);
}

/* Gold instant-finish button */
.gold-finish-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    margin-left: 6px;
    background: linear-gradient(to bottom, #f7e49e, #c8963e);
    border: 1px solid #a07828;
    border-radius: 3px;
    color: #4a2e00;
    font-size: 11px;
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
    line-height: 1;
    vertical-align: middle;
}

.gold-finish-btn:hover {
    background: linear-gradient(to bottom, #ffe8a0, #daa520);
    border-color: #8a6820;
}

.gold-finish-btn img.gold {
    width: 16px;
    height: 16px;
    vertical-align: middle;
}
