/* =======================
   FONTS
======================= */
@font-face {
    font-family: 'Alexandria';
    src: url('/fonts/Alexandria-VariableFont_wght_1.woff') format('woff2');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Cinzel';
    src: url('fonts/Cinzel.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

h2 {
    font-family: 'Cinzel', serif;
    font-weight: bold;
}
/* =======================
   GLOBALE STYLES
======================= */
body {
    font-family: 'Alexandria', Helvetica, Arial, sans-serif;
    display: grid;
    text-align: center;
    align-items: center;
    justify-content: center;
    background-color: #000;
    width: 99%;
    overflow: auto;
}

body::-webkit-scrollbar {
    display: none;
}

a:link, a:visited {
    color: inherit;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

a:hover, a:active {
    font-size: 90%;
    text-decoration: underline;
}

/* =======================
   GENERELLE ELEMENTE
======================= */
.sbilder {
    width: 30px;
    height: 30px;
}

.sbilder:hover {
    transform: scale(1.5);
    z-index: 50;
}

.rot { color: #503333; }

.strich { border: 1px solid white; border-collapse: collapse; }

.line-above-row { border-top: 1px solid black; }

/* =======================
   LAYOUT-CONTAINER
======================= */
.actionlist {
    background-color: #545656;
    width: 900px;
    border-radius: 7px;
    justify-content: center;
    display: block;
    overflow: auto;
    border-width: 1px;
    border-color: #000;
    border-style: solid;
}
.img-button {
    display: inline-block;
    width: 105px;
    height: 30px;
    background-image: url('../image/button/button.png');
    background-size: cover;
    position: relative;
    text-decoration: none;
}
.img-button:hover {
    width: 105px;
    height: 30px;
    background-image: url('../image/button/button2.png');
}
.img-button span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    
    color: black;
    font-size: 10px;
    font-family: 'Cinzel', serif;
    pointer-events: none;
    text-shadow: 0 0 1px black;
}
.img-button:hover span {
    text-shadow: 0 0 1px #D0AD68;
}
.img-button .msg {
    position: absolute;
    top: 0px;
    left: 0px;
    z-index: 10;
    width: 105px;
    height: 30px;
}
.img-button .letter {
    position: absolute;
    top: 0px;
    right: 0px;
    z-index: 10;
    width: 105px;
    height: 30px;
}
.top {
    text-align: center;
    top: 200px;
    background-color: #1D1D1D;
    width: 900px;
    border-radius: 8px;
    border-width: 1px;
    border-style: solid;
}

.main, .mainGame {
    background-color: #585756;
    width: 900px;
    border-radius: 8px;
    overflow: auto;
    border-color: #000;
    border-style: solid;
    border-width: 1px;
}

.mainGame {
    align-items: center;
    justify-content: center;
}

.main2 {
    width: 100%;
    font-size: 90%;
    text-align: center;
    vertical-align: top;
    border-radius: 8px;
}

.main3 {
    font-size: 75%;
    text-align: center;
    vertical-align: top;
    background-color: #545454;
    border-radius: 12px;
    border: 0px;
    border-style: solid;
    margin-bottom: 2px;
}

.main4 {
    font-size: 74%;
    text-align: center;
    vertical-align: center;
    background-color: #545454;
    border-radius: 10px;
    border: 1px solid black;
}

.info {
    font-size: 50%;
    text-align: center;
    vertical-align: center;
    background-color: #545454;
    border-radius: 10px;
    border: 1px solid black;
}

/* =======================
   BOXEN / STYLES (DEF, ATK, WALK, GEWINNER, VERLIERER)
======================= */
.def, .atk, .walk, .gewinner, .verlierer {
    font-size: 75%;
    text-align: center;
    vertical-align: center;
    background-color: #545454;
    border-radius: 12px;
    border: 1px solid;
    box-shadow: 0 0 4px;
}

.def { width: 425px; height: 65px; border-color: red; box-shadow: 0 0 4px red; }
.atk { width: 425px; height: 65px; border-color: yellow; box-shadow: 0 0 4px yellow; }
.walk { width: 425px; height: 65px; border-color: green; box-shadow: 0 0 4px green; }
.gewinner { border-color: green; box-shadow: 0 0 4px green; margin-bottom: 2px; }
.verlierer { border-color: red; box-shadow: 0 0 4px red; margin-bottom: 2px; }

/* =======================
   BUTTONS
======================= */

td.footer {
    padding: 0;
    margin: 0;
    height: 20px;
    line-height: 20px;
    text-align: center;
    background-color: #1D1D1D;
    width: 100%;
    border-radius: 8px;
    border: 1px solid #000;
}

/* =======================
   KAMPF / CITY
======================= */
.kampfbericht {
    display: flex;
    flex-direction: column;
    width: 300px;
    height: 200px;
    overflow: hidden;
}

.city {
    display: flex;
    flex-direction: column;
    width: 600px;
    height: 380px;
    overflow: hidden;
}

.row {
    display: flex;
    justify-content: center;
    position: relative;
    overflow: visible;
}

/* =======================
   TILES & BODEN
======================= */
.tile, .tile2 {
    position: relative;
    pointer-events: none;
    background-size: cover;
}

.tile { width: 100px; height: 100px; }
.tile2 { width: 75px; height: 75px; }

.tile .hitbox {
    pointer-events: auto;
    position: absolute;
    width: 49%;
    height: 49%;
    bottom: 15%;
    left: 25%;
    z-index: 10;
}

div.grass { background-image: url('../image/city/gras.png'); background-size: cover; }
.pavement { background-image: url('../image/city/pflaster.png'); }
.water1 { background-image: url('../image/city/wasser1.png'); }
.water2 { background-image: url('../image/city/wasser2.png'); }

/* =======================
   BUILDINGS
======================= */
.tile .hitbox:hover + img.building,
.tile img.building:hover {
    pointer-events: none;
    transform: scale(1.25);
    z-index: 50;
}

.tile img.building {
    pointer-events: none;
    transition: transform 0.3s ease;
    transform-origin: center;
    position: relative;
    z-index: 3;
}

.building {
    width: 100px;
    height: 100px;
    position: relative;
    z-index: 3;
    transform-origin: center center;
    transition: transform 0.2s;
}

.building.behind { z-index: 1; }

.wall { width: 600px; height: 400px; position: absolute; z-index: 2; }
.profilStatus { position: absolute; z-index: 2; }

.buildings-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
    text-align: center;
}

.building-box {
    width: 100px;
    margin: 5px;
    display: inline-block;
    text-align: center;
    position: relative;
    vertical-align: top;
}

.building-name {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    font-weight: bold;
    font-size: 12px;
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    padding: 2px 5px;
    border-radius: 4px;
    z-index: 2;
}

.building-image { width: 95%; height: 95%; position: relative; }

.building-count {
    position: absolute;
    bottom: 7px;
    left: 0px;
    font-size: 16px;
    background-color: rgba(0,0,0,0.5);
    color: #fff;
    padding: 1px 3px;
    border-radius: 3px;
    z-index: 10;
}
.construction-gif {
    position: absolute;
    bottom: 2px;
    left: 2px;
    width: 20px; /* anpassen */
    height: 20px;
}
/* =======================
   ICONS
======================= */
.info-icon {
    position: absolute;
    right: 10px;
    top: 25;
    transform: translateY(-50%);
    z-index: 99;
    padding: 2px;
}

.bauen-icon {
    position: absolute;
    right: 0px;
    bottom: 5px;
    z-index: 99;
    padding: 2px;
}

.info-icon img {
    width: 10px;
    height: 10px;
    transition: transform 0.2s ease;
}

.info-icon img:hover {
    transform: scale(1.25);
}

/* =======================
   UNITS
======================= */
.unit-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    justify-content: center;
    align-items: center;
    padding: 2px;
}

.unit-box {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 3px;
    border-radius: 8px;
}

.unit {
    pointer-events: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.unit:hover {
    transform: scale(1.25);
    z-index: 50;
}

.unit-level {
    position: absolute;
    bottom: 2px;
    left: 4px;
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 12px;
    padding: 2px 4px;
    border-radius: 3px;
}

.unit-count {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(0,0,0,0.5);
    color: white;
    padding: 2px 2px;
    font-size: 10px;
    border-radius: 3px;
}
.unit-typ {
    position: absolute;
    width: 15px;
    height: 15px;
    top: 12px;
    right: 2px;
    border-radius: 3px;
}

.unit-name {
    position: absolute;
    font-family: 'Cinzel', serif;
    top: 1px;
    font-size: 9px;
    font-weight: bold;
    text-align: center;
}

/* =======================
   AVATARE
======================= */
.avatar-container {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    justify-content: center;
    max-width: 500px;
    margin: auto;
}

.avatar {
    width: 75px;
    height: 75px;
    border: 1px solid transparent;
    border-radius: 10px;
    transition: border 0.2s;
}

.avatar-label { display: block; cursor: pointer; }

input[type="radio"]:checked + .avatar {
    border: 2px solid green;
}

/* =======================
   TOOLTIP
======================= */
.tooltip-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
    cursor: pointer;
}

.tooltip-box {
    visibility: hidden;
    opacity: 0;
    vertical-align: middle;
    max-width: 90vw;
    background-color: #222;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 6px 8px;
    position: absolute;
    z-index: 999;
    top: 50%;
    right: 100%;
    transform: translateY(-50%);
    font-size: 11px;
    white-space: pre;
    transition: opacity 0.2s ease;
    box-sizing: border-box;
    word-wrap: normal;
    box-shadow: 0 0 6px rgba(0,0,0,0.5);
}

.tooltip-box::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -3px;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 6px solid #222;
}

.tooltip-container:hover .tooltip-box,
.tooltip-container:focus-within .tooltip-box {
    visibility: visible;
    opacity: 1;
}
.countdown {
    font-family: 'Cinzel', serif;
    font-size: 10px;
    color: #D0AD68; /* gold */
    text-shadow: 1px 1px 2px black;
    letter-spacing: 1px;
}
a.countdown:visited {
    color: #D0AD68;
}