/*Body*/
body {
    width: 100%;
    height: 100vh;
    background-color: #000000be;
    background-image: url('../img/background.jpg');
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #ffffff;
    overflow: hidden;
    margin: 0;
    position: relative;
}

a {
    text-decoration: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin-top: 8px;
    margin-bottom: 8px;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.75rem;
}

h4 {
    font-size: 1.5rem;
}

h5 {
    font-size: 1.25rem;
}

h6 {
    font-size: 1rem;
}

p {
    margin-top: 0;
    margin-bottom: 0.75rem;
}
/*texte*/
.text {
    display: inline-block;
    align-items: center;
    margin-top: 20px;
    margin-bottom: 20px;
}

.text p {
    font-size: 1.2rem;
    text-align: center;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* toast */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;

    display: grid;
    gap: 10px;
}

.toast {
    min-width: 250px;
    padding: 14px 18px;
    border-radius: 8px;
    color: #fff;
    font-weight: 600;

    opacity: 0;
    transform: translateX(50px);
    transition: 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    background: #27ae60;
}

.toast-error {
    background: #e74c3c;
}

.toast-info {
    background: #3498db;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 11000;
}

.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.6);
}

.modal-box {
    position: relative;
    width: 100%;
    max-width: 740px;
    height: 100%;
    max-height: 760px;
    overflow: auto;

    background: rgba(0, 0, 0, 0.7);
    margin: 4% auto;
    padding: 20px;
    border-radius: 10px;
    color: #ffffff;

    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
}

.tooltip {
    position: absolute;
    display: none;
    pointer-events: none;

    background: #111;
    color: white;

    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    z-index: 9999;
}

/*Building Modal*/

.modal-building {
    display: flex;
    flex-direction: column;
    gap: 18px;

    width: 600px;
    min-height: 600px;

    padding: 20px;

    background: linear-gradient(180deg, #2b2b2b, #1a1a1a);
    border: 2px solid #6f6f6f;
    border-radius: 12px;

    box-shadow: 0 15px 40px rgba(0,0,0,.5);
    color: #eaeaea;
    font-family: sans-serif;
}

.building-title {
    font-size: 28px;
    font-weight: 700;
    text-align: center;

    color: #ffd86a;
    margin: 0;
}

.building-body {
    flex: 1;
    display: flex;
    justify-content: center;
}

.building-stats {
    list-style: none;
    padding: 0;
    margin: 0;

    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;

    width: 100%;
}

.building-stats li {
    background: rgba(255,255,255,0.05);
    padding: 10px 12px;

    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.08);

    display: flex;
    flex-direction: column;
    gap: 4px;
}

.building-stats span {
    font-size: 12px;
    color: #aaa;
}

.building-stats strong {
    font-size: 16px;
    color: #fff;
}

.building-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.building-input {
    width: 120px;
    padding: 8px;

    border-radius: 6px;
    border: 1px solid #555;

    background: #111;
    color: #fff;

    text-align: center;
}

.building-button {
    padding: 8px 16px;

    border: none;
    border-radius: 6px;

    background: linear-gradient(180deg, #d5a928, #8d6910);
    color: #fff;

    font-weight: bold;
    cursor: pointer;

    transition: 0.2s;
}

.building-button:hover {
    filter: brightness(1.1);
}

.confirm-modal {
    position: fixed;

    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(0,0,0,0.7);

    z-index: 99999;
}

.confirm-box {
    width: 320px;

    background: #1c1c1c;

    border: 2px solid #27ae60;

    border-radius: 10px;

    padding: 24px;

    color: white;

    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.confirm-text {
    margin: 0 0 20px;

    text-align: center;

    font-size: 16px;
}

.confirm-actions {
    display: flex;

    justify-content: space-between;

    gap: 12px;
}

.confirm-yes,
.confirm-no {
    flex: 1;

    border: none;

    border-radius: 6px;

    padding: 10px;

    cursor: pointer;

    font-weight: bold;

    transition: 0.2s;
}

.confirm-yes {
    background: #e74c3c;
    color: white;
}

.confirm-yes:hover {
    background: #ff5a4f;
}

.confirm-no {
    background: #2c3e50;
    color: white;
}

.confirm-no:hover {
    background: #3b536b;
}


/* Building popup - reference strategy-game window */
.modal-box:has(.modal-building) {
    width: min(430px, calc(100vw - 32px));
    max-width: 430px;
    height: auto;
    max-height: calc(100vh - 120px);
    margin: auto;
    padding: 0;
    overflow: visible;
    background: transparent;
    border-radius: 0;
    display: block;
}

.modal:has(.modal-building) .modal-close {
    display: none;
}

.modal-building {
    width: 100%;
    min-height: 0;
    box-sizing: border-box;
    gap: 0;
    padding: 0;
    overflow: hidden;

    background:
        linear-gradient(180deg, #181a1a 0%, #080909 100%);
    border: 2px solid #756b57;
    border-radius: 0;

    box-shadow:
        0 0 0 1px #171512,
        0 0 0 4px rgba(0,0,0,.55),
        0 18px 45px rgba(0,0,0,.75);

    color: #e9e5dc;
    font-family: Arial, Helvetica, sans-serif;
}

.building-window-titlebar {
    min-height: 38px;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 30px 1fr 38px;
    align-items: center;

    border-bottom: 2px solid #685e4c;
    background:
        linear-gradient(180deg, #35342f 0%, #151615 100%);
    box-shadow: inset 0 0 0 1px #090a09;
}

.building-window-ornament {
    color: #d2b46d;
    font-size: 10px;
    text-align: center;
}

.building-window-close-hint {
    justify-self: center;
    min-width: 27px;
    padding: 3px 4px;
    border: 1px solid #514b3e;
    background: #121312;
    color: #888275;
    font-size: 8px;
    text-align: center;
}

.building-title {
    margin: 0;
    color: #eee9dd;
    font-size: 14px;
    line-height: 18px;
    font-weight: 700;
    text-align: center;
    text-shadow: 1px 1px #000;
}

.building-window-body {
    padding: 12px 14px 14px;
}

.building-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 9px;
    border-bottom: 1px solid #3d3a34;
}

.building-emblem {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex: 0 0 42px;

    border: 2px solid #9a824b;
    background: radial-gradient(circle, #383329 0%, #0b0c0b 72%);
    color: #e0c37b;
    font-size: 20px;
    box-shadow: inset 0 0 6px #000;
}

.building-summary-text {
    display: grid;
    gap: 2px;
}

.building-summary-text strong {
    color: #f2eee5;
    font-size: 14px;
}

.building-summary-text span {
    color: #9d978b;
    font-size: 10px;
}

.building-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 18px;
    width: 100%;
    box-sizing: border-box;
    list-style: none;
    padding: 9px 0 4px;
    margin: 0;
}

.building-stats li {
    min-height: 30px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;

    padding: 5px 0;
    border-radius: 0;
    border: 0;
    border-bottom: 1px solid #292a28;

    background: transparent;
}

.building-stats span {
    color: #aaa397;
    font-size: 10px;
}

.building-stats strong {
    color: #eee9df;
    font-size: 11px;
    text-align: right;
    white-space: nowrap;
}

.building-description {
    margin: 7px 0 10px;
    color: #d8d0bd;
    font-size: 10px;
    line-height: 1.4;
}

.building-actions {
    display: grid;
    gap: 5px;
    padding-top: 9px;
    border-top: 1px solid #4a463c;
}

.building-actions label {
    color: #aaa398;
    font-size: 10px;
}

.building-action-row {
    display: grid;
    grid-template-columns: 82px 1fr;
    gap: 5px;
}

.building-input {
    width: 100%;
    min-height: 31px;
    box-sizing: border-box;

    padding: 5px 7px;
    border: 1px solid #716650;
    border-radius: 0;

    background: #0b0c0b;
    color: #f0eadc;

    font-size: 12px;
    font-weight: 700;
    text-align: center;
    outline: none;
}

.building-input:focus {
    border-color: #b89a59;
    box-shadow: inset 0 0 0 1px #4e422b;
}

.building-button {
    min-height: 31px;
    box-sizing: border-box;

    padding: 5px 12px;
    border: 1px solid #786b50;
    border-radius: 0;

    background: linear-gradient(180deg, #4a493f 0%, #191a18 100%);
    color: #eee9dd;

    font-size: 11px;
    font-weight: 700;
    text-shadow: 1px 1px #000;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px #0a0b0a;
}

.building-button:hover {
    border-color: #c0a35f;
    background: linear-gradient(180deg, #5a5647 0%, #211f19 100%);
}

.building-button:active {
    transform: translateY(1px);
}

@media (max-width: 520px) {
    .modal-box:has(.modal-building) {
        width: calc(100vw - 20px);
    }

    .building-window-titlebar {
        min-height: 35px;
    }

    .building-window-body {
        padding: 10px;
    }
}

/* Compteurs des six bâtiments productifs : top bar exclusivement. */
.building-topbar-counts{
    grid-column:1 / -1;
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    gap:8px;
    padding:5px 9px 7px;
    border-top:1px solid #4f493d;
}
.building-topbar-count{
    display:flex;
    flex-wrap:wrap;
    align-items:baseline;
    justify-content:center;
    gap:5px;
    min-width:0;
    font:10px/1.3 Arial,Helvetica,sans-serif;
    color:#bfb9aa;
    text-align:center;
}
.building-topbar-count strong{
    font-size:11px;
    font-weight:700;
    color:#e9d196;
    overflow-wrap:anywhere;
}
.building-topbar-count strong sup{
    font-size:8px;
}
@media(max-width:520px){
    .building-topbar-counts{gap:5px;padding:5px 4px;}
    .building-topbar-count{font-size:9px;gap:3px;}
}
