/* --- VARIABLES & RESET --- */
:root {
    --primary-red: #ff0000;
    --primary-hover: #d60000;
    --cta-yellow: #ffd700;
    --cta-yellow-hover: #ffcc00;
    --bg-dark: #0b0b0b;
    --bg-header: #111;
    --bg-sidebar: #0f0f0f;
    --bg-card: #1e1e1e;
    --text-white: #ffffff;
    --text-gray: #a0a0a0;
    --header-height: 60px;
    --font-main: 'Inter', sans-serif;
    --grid-gap: 15px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-white);
    overflow-x: hidden;
    line-height: 1.5;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }
button { cursor: pointer; border: none; outline: none; }

/* --- HEADER --- */
header {
    height: var(--header-height);
    background-color: var(--bg-header);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #222;
}

header > nav:first-of-type {
    display: flex;
    align-items: center;
    gap: 20px;
}

header > nav:first-of-type button {
    background: none;
    color: var(--text-white);
    font-size: 20px;
}

header > nav:first-of-type img {
    height: 40px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
}

header > nav:last-of-type {
    display: flex;
    align-items: center;
    gap: 10px;
}

header > nav:last-of-type button {
    padding: 8px 20px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
}

header > nav:last-of-type button:first-of-type {
    background: transparent;
    color: var(--text-white);
    border: 1px solid transparent;
}

header > nav:last-of-type button:first-of-type:hover {
    color: var(--text-gray);
}

header > nav:last-of-type button:last-of-type {
    background: linear-gradient(180deg, #ff1a1a 0%, #cc0000 100%);
    color: white;
    box-shadow: 0 4px 10px rgba(255, 0, 0, 0.3);
}

header > nav:last-of-type button:last-of-type:hover {
    filter: brightness(1.1);
}

/* --- LAYOUT --- */
body > div {
    display: flex;
    min-height: calc(100vh - var(--header-height));
    position: relative;
}

/* --- SIDEBAR --- */
aside {
    width: 60px;
    background-color: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    padding-top: 20px;
    border-right: 1px solid #222;
    flex-shrink: 0;
    z-index: 900;
    transition: transform 0.3s ease-in-out;
}

aside > nav ul li {
    padding: 15px 0;
    text-align: center;
    color: #666;
    font-size: 18px;
    cursor: pointer;
    position: relative;
    transition: 0.2s;
    margin-bottom: 5px;
}

aside > nav ul li:hover {
    color: var(--text-white);
}

aside > nav ul li:first-child {
    color: var(--primary-red);
}

aside > nav ul li:first-child::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 20px;
    width: 3px;
    background: var(--primary-red);
}

aside > div {
    margin-top: auto;
    padding-bottom: 20px;
    text-align: center;
}

aside > div i:first-child {
    color: #009246;
    display: block;
    margin-bottom: 15px;
}

aside > div i:last-child {
    color: #0088cc;
    font-size: 20px;
}

/* --- MAIN CONTENT --- */
main {
    flex: 1;
    background-color: var(--bg-dark);
    overflow-x: hidden;
    padding-bottom: 40px;
}

/* --- HERO BANNER --- */
main > section:first-of-type {
    position: relative;
    width: 100%;
    height: 400px;
    background-color: #000;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

main > section:first-of-type::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('qw-banner.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
}

main > section:first-of-type::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.6) 100%);
    z-index: 1;
}

main > section:first-of-type > button:first-of-type {
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.5);
    font-size: 30px;
    z-index: 3;
    padding: 20px;
    cursor: pointer;
    background: none;
}

main > section:first-of-type > button:last-of-type {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.5);
    font-size: 30px;
    z-index: 3;
    padding: 20px;
    cursor: pointer;
    background: none;
}

main > section:first-of-type > button:hover {
    color: white;
}

main > section:first-of-type > div:last-of-type {
    position: relative;
    z-index: 2;
    text-align: left;
    color: white;
    padding: 20px 20px 20px 40px;
    max-width: 600px;
}

main > section:first-of-type > div:last-of-type > span:first-of-type {
    background-color: var(--primary-red);
    color: white;
    padding: 5px 15px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    display: inline-block;
    transform: skew(-15deg);
    margin-bottom: 15px;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.5);
}

main > section:first-of-type > div:last-of-type > h1 {
    font-size: 42px;
    font-weight: 900;
    text-transform: uppercase;
    line-height: 1.1;
    margin-bottom: 20px;
    text-shadow: 0 4px 20px rgba(0,0,0,0.8);
    font-style: italic;
}

main > section:first-of-type > div:last-of-type > h1 span {
    display: block;
    font-size: 1.2em;
    color: white;
}

main > section:first-of-type > div:last-of-type > a {
    background: linear-gradient(180deg, #ffd700 0%, #ffa500 100%);
    color: #000;
    font-weight: 800;
    font-size: 16px;
    padding: 12px 30px;
    border-radius: 4px;
    text-transform: uppercase;
    display: inline-block;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4), inset 0 1px 0 rgba(255,255,255,0.4);
    transform: skew(-10deg);
    transition: 0.3s;
}

main > section:first-of-type > div:last-of-type > a:hover {
    transform: skew(-10deg) scale(1.05);
}

/* --- CATEGORY NAV --- */
main > nav {
    background-color: #1a1a1a;
    padding: 0 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #333;
    overflow-x: auto;
    white-space: nowrap;
    height: 60px;
    scrollbar-width: none;
}

main > nav::-webkit-scrollbar {
    display: none;
}

main > nav > a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    color: #ccc;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    border-right: 1px solid #2a2a2a;
}

main > nav > a:hover {
    color: white;
    background: #222;
}

main > nav > a i {
    font-size: 16px;
}

main > nav > a:nth-child(6) {
    color: white;
    border-bottom: 2px solid var(--primary-red);
    height: 100%;
}

/* --- GAMES SECTION --- */
main > section:nth-of-type(2) {
    padding: 30px 20px;
}

main > section:nth-of-type(2) > header {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 5px,
        rgba(255,255,255,0.03) 5px,
        rgba(255,255,255,0.03) 10px
    );
    padding: 10px 0;
    margin-bottom: 20px;
    height: auto;
    position: static;
    background-color: transparent;
    border: none;
}

main > section:nth-of-type(2) > header > h2 {
    font-size: 20px;
    font-weight: 800;
    text-transform: uppercase;
    font-style: italic;
    margin-left: 20px;
}

main > section:nth-of-type(2) > header > a {
    background: #222;
    color: white;
    border: 1px solid #333;
    padding: 5px 15px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 2px;
    margin-right: 20px;
}

main > section:nth-of-type(2) > div {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
}

main > section:nth-of-type(2) > div > article {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 3/4;
    transition: transform 0.3s;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

main > section:nth-of-type(2) > div > article:hover {
    transform: translateY(-5px);
    z-index: 10;
}

main > section:nth-of-type(2) > div > article > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Badge (DROPS & WINS, NUOVO, ESCLUSIVO) - первый span в article */
main > section:nth-of-type(2) > div > article > span:first-of-type {
    position: absolute;
    top: 0;
    left: 10px;
    background: var(--primary-red);
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    z-index: 2;
}

/* Если первый элемент это img, то нет badge - переопределяем для статей без badge */
main > section:nth-of-type(2) > div > article > img:first-child + span {
    top: auto;
    left: -5px;
    bottom: -5px;
    background: transparent;
    font-size: 60px;
    font-weight: 900;
    font-style: italic;
    padding: 0;
    box-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}

main > section:nth-of-type(2) > div > article:nth-child(2) > span:first-of-type {
    background: red;
}

main > section:nth-of-type(2) > div > article:last-child > span:first-of-type {
    background: #8e44ad;
}

/* Rank number (1, 2, 3...) - span который идет сразу после img */
main > section:nth-of-type(2) > div > article > img + span {
    position: absolute;
    bottom: -5px;
    left: -5px;
    font-size: 60px;
    font-weight: 900;
    color: white;
    font-style: italic;
    line-height: 1;
    text-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
    z-index: 5;
    font-family: 'Inter', sans-serif;
}

/* Pot info (1640,34 €) - span который идет после номера ранга (после img + span) */
main > section:nth-of-type(2) > div > article > img + span + span {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: #ffd700;
    color: black;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 2px;
    z-index: 4;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

/* --- SEO CONTENT --- */
main > section:last-of-type {
    margin: 40px 20px;
    padding: 30px;
    background-color: #151515;
    border-radius: 8px;
    color: #ccc;
    font-size: 14px;
    border-left: 3px solid var(--primary-red);
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

main > section:last-of-type > article > ul,
main > section:last-of-type > article > ol {
    list-style: none;
    margin: 20px 0;
    padding: 0;
}

main > section:last-of-type > article > ul > li,
main > section:last-of-type > article > ol > li {
    position: relative;
    padding-left: 30px;
    margin-bottom: 12px;
    font-size: 15px;
    color: #ddd;
}

main > section:last-of-type > article > ul > li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary-red);
    font-weight: bold;
    font-size: 16px;
}

main > section:last-of-type > article > ol > li {
    counter-increment: list-counter;
}

main > section:last-of-type > article > ol {
    counter-reset: list-counter;
}

main > section:last-of-type > article > ol > li::before {
    content: counter(list-counter) '.';
    position: absolute;
    left: 0;
    color: var(--primary-red);
    font-weight: bold;
    font-size: 16px;
}

main > section:last-of-type > article > div {
    overflow-x: auto;
    margin: 30px 0;
}

main > section:last-of-type > article > table,
main > section:last-of-type > article > div > table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    font-size: 14px;
    margin: 30px 0;
}

main > section:last-of-type > article > table th,
main > section:last-of-type > article > table td,
main > section:last-of-type > article > div > table th,
main > section:last-of-type > article > div > table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #333;
}

main > section:last-of-type > article > table th,
main > section:last-of-type > article > div > table th {
    background-color: #222;
    color: var(--primary-red);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

main > section:last-of-type > article > table tr:last-child td,
main > section:last-of-type > article > div > table tr:last-child td {
    border-bottom: none;
}

main > section:last-of-type > article > table tr:hover td,
main > section:last-of-type > article > div > table tr:hover td {
    background-color: #252525;
}

main > section:last-of-type > article > details {
    background-color: #222;
    margin-bottom: 10px;
    border-radius: 4px;
    overflow: hidden;
}

main > section:last-of-type > article > details > summary {
    padding: 15px;
    cursor: pointer;
    font-weight: bold;
    color: white;
    list-style: none;
}

/* --- FOOTER --- */
footer {
    background: #080808;
    border-top: 1px solid #222;
    margin-top: 60px;
}

footer > div {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px 20px;
}

footer > div > div:first-of-type {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

footer > div > div:first-of-type > section {
    display: flex;
    flex-direction: column;
}

footer > div > div:first-of-type > section:first-of-type > h3 {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary-red);
    margin-bottom: 15px;
    text-transform: uppercase;
    font-style: italic;
}

footer > div > div:first-of-type > section > h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

footer > div > div:first-of-type > section:first-of-type > p {
    font-size: 13px;
    color: #999;
    line-height: 1.6;
    margin-bottom: 20px;
}

footer > div > div:first-of-type > section > ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

footer > div > div:first-of-type > section > ul > li {
    margin-bottom: 10px;
}

footer > div > div:first-of-type > section > ul > li > a {
    color: #999;
    font-size: 13px;
    transition: color 0.3s;
    display: inline-block;
}

footer > div > div:first-of-type > section > ul > li > a:hover {
    color: var(--primary-red);
    padding-left: 5px;
}

footer > div > div:first-of-type > section:first-of-type > nav {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

footer > div > div:first-of-type > section:first-of-type > nav > a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 50%;
    color: #999;
    font-size: 18px;
    transition: all 0.3s;
}

footer > div > div:first-of-type > section:first-of-type > nav > a:hover {
    background: var(--primary-red);
    color: white;
    border-color: var(--primary-red);
    transform: translateY(-3px);
}

footer > div > div:first-of-type > section:last-of-type > div {
    margin-top: 15px;
}

footer > div > div:first-of-type > section:last-of-type > div > p {
    color: #999;
    font-size: 12px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

footer > div > div:first-of-type > section:last-of-type > div > p > i {
    color: var(--primary-red);
    font-size: 14px;
}

footer > div > section {
    padding: 30px 0;
    border-top: 1px solid #222;
    border-bottom: 1px solid #222;
    margin-bottom: 20px;
}

footer > div > section > h4 {
    text-align: center;
    margin-bottom: 20px;
}

footer > div > section > div {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

footer > div > section > div > i {
    font-size: 32px;
    color: #666;
    transition: all 0.3s;
    cursor: pointer;
}

footer > div > section > div > i:hover {
    color: var(--primary-red);
    transform: scale(1.1);
}

footer > div > div:last-of-type {
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

footer > div > div:last-of-type > p {
    color: #666;
    font-size: 12px;
    margin: 0;
}

footer > div > div:last-of-type > div {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

footer > div > div:last-of-type > div > span {
    color: #999;
    font-size: 11px;
    padding: 5px 12px;
    background: #1a1a1a;
    border-radius: 3px;
    border: 1px solid #333;
}

/* --- RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 768px) {
    header > nav:first-of-type {
        gap: 10px;
    }

    header > nav:first-of-type img {
        height: 32px;
        max-width: 150px;
    }

    header > nav:last-of-type button {
        padding: 6px 12px;
        font-size: 11px;
    }

    aside {
        position: fixed;
        top: var(--header-height);
        left: 0;
        bottom: 0;
        width: 250px;
        background-color: #111;
        transform: translateX(-100%);
        z-index: 1000;
        border-right: 1px solid #333;
        box-shadow: 4px 0 15px rgba(0,0,0,0.5);
    }

    aside.active {
        transform: translateX(0);
    }

    main > section:first-of-type {
        height: 350px;
    }

    main > section:first-of-type > div:last-of-type {
        padding: 20px;
    }

    main > section:first-of-type > div:last-of-type > h1 {
        font-size: 28px;
    }

    main > section:first-of-type > div:last-of-type > span:first-of-type {
        font-size: 10px;
        padding: 4px 10px;
    }

    main > section:nth-of-type(2) > div {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    main > section:nth-of-type(2) > div > article {
        aspect-ratio: 1/1.2;
    }

    main > section:nth-of-type(2) > div > article > img + span {
        font-size: 40px;
    }

    main > section:nth-of-type(2) {
        padding: 20px 10px;
    }

    main > section:last-of-type {
        margin: 20px 10px;
        padding: 20px;
    }

    footer > div > div:first-of-type {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }

    footer > div > div:last-of-type {
        flex-direction: column;
        text-align: center;
    }

    footer > div > div:last-of-type > div {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    main > section:first-of-type > div:last-of-type > h1 {
        font-size: 24px;
    }

    main > section:first-of-type {
        height: 300px;
    }

    header > nav:last-of-type button {
        padding: 6px 8px;
    }

    footer > div > div:first-of-type {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    footer > div {
        padding: 40px 15px 15px;
    }

    footer > div > section > div {
        gap: 15px;
    }

    footer > div > section > div > i {
        font-size: 24px;
    }
}
