/* reset okrajů/paddingu + box-sizing, ať se s tím dál nemusím prát */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* tmavé pozadí přes celou stránku, footer drží dole i na krátkých stránkách */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #121212;
    color: #e0e0e0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* horní lišta s logem a přepínáním Katalog / O hře */
header {
    background-color: #1e1e1e;
    border-bottom: 2px solid #ff6200;
    padding: 15px 0;
}

.bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    color: #fff;
    margin: 0;
}

.logo a {
    color: #fff;
    text-decoration: none;
}

.logo span {
    color: #ff6200;
}

.tab {
    display: inline-block;
    background: transparent;
    border: 1px solid #444;
    color: #ccc;
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 4px;
    margin-left: 10px;
    text-decoration: none;
    transition: all 0.2s;
}

.tab.active, .tab:hover {
    background-color: #ff6200;
    border-color: #ff6200;
    color: #fff;
}

main {
    flex-grow: 1;
    padding: 30px 0;
}

.hidden {
    display: none !important;
}

.layout {
    display: flex;
    gap: 25px;
}

/* levý panel s filtry (hledání, typ, tier, národ) */
.sidebar {
    width: 300px;
    flex-shrink: 0;
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 20px;
    height: fit-content;
}

.top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.top h2 {
    margin: 0;
    color: #ff6200;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.counter {
    font-size: 13px;
    color: #888;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #2a2a2a;
}

.counter span {
    color: #fff;
    font-weight: bold;
}

.close {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
}

.group {
    border: none;
    margin: 0 0 18px;
    padding: 0;
}

.group legend {
    display: block;
    margin-bottom: 8px;
    padding: 0;
    font-size: 13px;
    font-weight: bold;
    color: #aaa;
    text-transform: uppercase;
}

.group input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    background-color: #121212;
    border: 1px solid #444;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
}

.group input[type="text"]:focus {
    border-color: #ff6200;
    outline: none;
}

.pills {
    display: grid;
    gap: 6px;
}

.five {
    grid-template-columns: repeat(5, 1fr);
}

.four {
    grid-template-columns: repeat(4, 1fr);
}

/* tlačítka filtrů (LT/MT/HT, tiery, národy) - .active = zapnutý filtr */
.toggle {
    background: linear-gradient(180deg, #2a2a2a 0%, #1c1c1c 100%);
    border: 1px solid #444;
    color: #aaa;
    padding: 8px 4px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
    user-select: none;
}

.toggle:hover {
    border-color: #888;
    color: #fff;
}

.toggle.active {
    background: linear-gradient(180deg, #ff6200 0%, #a83b00 100%);
    border-color: #ff8c00;
    color: #fff;
    box-shadow: 0 0 8px rgba(255, 98, 0, 0.5);
}

.reset {
    width: 100%;
    padding: 10px;
    background-color: #2a2a2a;
    color: #ccc;
    border: 1px solid #444;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.2s;
}

.reset:hover {
    background-color: #ff6200;
    border-color: #ff6200;
    color: #fff;
}

.burger {
    display: none;
    margin-bottom: 15px;
}

#toggle-filter-btn {
    width: 100%;
    padding: 12px;
    background-color: #ff6200;
    color: #fff;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

/* mřížka karet tanků v katalogu */
.grid {
    flex-grow: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.grid-message {
    grid-column: 1 / -1;
    text-align: center;
}

.grid-message.loading {
    color: #ff6200;
}

.grid-message.error {
    color: #ff4444;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* jedna karta tanku - vlajka národa jde na pozadí přes proměnnou --flag ze scriptu.js */
.card {
    background-color: #1e1e1e;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
    animation: fadeInUp 0.35s ease both;
}

.card:hover {
    transform: translateY(-4px);
    border-color: #ff6200;
}

.thumb {
    position: relative;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    border-radius: 6px;
    overflow: hidden;
}

.thumb::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--flag, none);
    background-size: cover;
    background-position: center;
    opacity: 0.22;
    filter: grayscale(0.35) brightness(0.75);
}

.thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(30, 30, 30, 0) 0%, rgba(30, 30, 30, 0.9) 100%);
}

.card img {
    position: relative;
    z-index: 1;
    max-width: 100%;
    max-height: 100px;
    object-fit: contain;
}

.meta h2 {
    font-size: 16px;
    margin-bottom: 8px;
    color: #fff;
}

.info p {
    font-size: 13px;
    color: #aaa;
    margin: 3px 0;
}

.detail {
    max-width: 980px;
}

.back {
    display: inline-block;
    background: none;
    border: none;
    color: #ff6200;
    font-size: 15px;
    text-decoration: none;
    cursor: pointer;
    margin-bottom: 15px;
}

/* detail tanku (tank.html) - hlavní box se stránkou */
.panel {
    background-color: #1e1e1e;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 25px;
}

.intro {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    border-bottom: 1px solid #333;
    padding-bottom: 20px;
}

.intro img {
    max-width: 120px;
    max-height: 100px;
}

.intro h1 {
    font-size: 24px;
    color: #fff;
}

.intro p {
    color: #aaa;
    font-size: 14px;
}

.blocks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.block {
    background-color: #121212;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    overflow: hidden;
}

.block .head {
    background-color: #ff6200;
    color: #fff;
    font-weight: bold;
    font-size: 14px;
    padding: 10px 14px;
}

/* jeden řádek statu (název + hodnota), .better/.worse barví hodnotu podle vlivu vybavení */
.row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 14px;
    font-size: 13px;
    border-top: 1px solid #222;
}

.row .l {
    color: #aaa;
}

.row .v {
    color: #fff;
    font-weight: bold;
}

.row .v.better {
    color: #6fcf6f;
}

.row .v.worse {
    color: #ff6666;
}

.equipment {
    margin-bottom: 20px;
}

.equipment h2 {
    margin-bottom: 12px;
}

.slots {
    display: flex;
    gap: 10px;
}

/* tři sloty na vybavení, .filled = obsazený slot */
.slot {
    font-family: inherit;
    width: 56px;
    height: 56px;
    border: 2px dashed #444;
    border-radius: 6px;
    background-color: #121212;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    font-size: 10px;
    line-height: 1.2;
    text-align: center;
    color: #ccc;
    overflow: hidden;
}

.slot:hover {
    border-color: #ff6200;
}

.slot.filled {
    border-style: solid;
    border-color: #ff6200;
    background-color: #241505;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* modální okno pro výběr vybavení (otvírá se kliknutím na slot) */
.picker {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.15s ease both;
}

.picker-box {
    background-color: #1e1e1e;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 20px;
    width: 380px;
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: popIn 0.2s ease both;
}

.picker-box h2 {
    margin-bottom: 12px;
    color: #ff6200;
    flex-shrink: 0;
}

#picker-list {
    overflow-y: auto;
}

.pick-item {
    display: block;
    width: 100%;
    text-align: left;
    background-color: #121212;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 8px;
    color: #fff;
    cursor: pointer;
}

.pick-item:hover {
    border-color: #ff6200;
}

.pick-item.active {
    border-color: #ff6200;
    background-color: #241505;
}

.pick-item strong {
    display: block;
    font-size: 14px;
}

.pick-item small {
    color: #aaa;
    font-size: 12px;
}

.pick-remove {
    text-align: center;
    color: #ff4444;
}

/* stránka O hře */
.about-hero {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.about-hero h1 {
    font-size: 32px;
    color: #fff;
}

.about-article {
    background-color: #1e1e1e;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 25px;
    max-width: 760px;
}

.about-article section {
    margin-bottom: 22px;
}

.about-article section:last-child {
    margin-bottom: 0;
}

.about-article h2 {
    color: #ff6200;
    font-size: 18px;
    margin-bottom: 8px;
}

.about-article p {
    color: #ccc;
    font-size: 14px;
    line-height: 1.6;
}

.about-article a {
    color: #ff8c3f;
}

/* patička dole na každé stránce */
footer {
    background-color: #1e1e1e;
    border-top: 1px solid #333;
    padding: 20px 0;
    text-align: center;
    color: #777;
    font-size: 13px;
}

/* mobil: sidebar s filtry se schová a vysouvá přes burger tlačítko */
@media (max-width: 768px) {
    .layout {
        flex-direction: column;
    }

    .burger {
        display: block;
    }

    .close {
        display: block;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 300px;
        height: 100vh;
        z-index: 1000;
        box-shadow: 5px 0 15px rgba(0,0,0,0.8);
        transition: left 0.3s ease;
        overflow-y: auto;
    }

    .sidebar.open {
        left: 0;
    }

    .bar {
        flex-wrap: wrap;
        gap: 10px;
    }

    nav {
        width: 100%;
    }

    .tab {
        margin-left: 0;
        margin-right: 10px;
    }
}

@media (max-width: 480px) {
    .intro,
    .about-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .picker-box {
        width: 100%;
    }
}