* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: Arial, Helvetica, sans-serif;
}

body {
    background:
        radial-gradient(circle at top, #202020 0%, #101010 45%, #080808 100%);
    color: #ffffff;
}

.page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px 16px;
}

.container {
    width: 100%;
    max-width: 520px;
}

.header {
    text-align: center;
    margin-bottom: 28px;
}

.header h1 {
    margin: 0 0 8px;
    font-size: 36px;
    font-weight: 800;
}

.header p {
    margin: 0;
    color: #999;
    font-size: 15px;
}

.buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.category-button {
    position: relative;
    width: 100%;
    min-height: 62px;

    border: 1px solid #2e2e2e;
    border-radius: 16px;

    background: #181818;
    color: #fff;

    font-size: 17px;
    font-weight: 600;

    cursor: pointer;

    transition:
        transform 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease;
}

.category-button:hover {
    transform: translateY(-2px);
    background: #202020;
    border-color: #444;
}

.category-button:active {
    transform: scale(0.98);
}

.count {
    position: absolute;

    right: 14px;
    top: 50%;
    transform: translateY(-50%);

    width: 27px;
    height: 27px;

    border-radius: 50%;

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

    background: #fff;
    color: #111;

    font-size: 12px;
    font-weight: 700;
}

.ad-button {
    border-color: #5a4a1c;
    background: #211c0d;
}

.ad-button:hover {
    background: #2b250f;
    border-color: #806b27;
}

.loading,
.error {
    text-align: center;
    padding: 30px;
    color: #888;
}

/* Modal */

.modal {
    position: fixed;
    inset: 0;

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

    padding: 16px;

    opacity: 0;
    visibility: hidden;

    transition:
        opacity 0.25s ease,
        visibility 0.25s ease;

    z-index: 1000;
}

.modal.open {
    opacity: 1;
    visibility: visible;
}

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

.modal-window {
    position: relative;

    width: 100%;
    max-width: 620px;
    max-height: 85vh;

    overflow-y: auto;

    padding: 28px;

    border: 1px solid #333;
    border-radius: 20px;

    background: #151515;

    transform: translateY(20px) scale(0.97);

    transition: transform 0.25s ease;

    z-index: 1;
}

.modal.open .modal-window {
    transform: translateY(0) scale(1);
}

.close-button {
    position: absolute;

    top: 12px;
    right: 14px;

    width: 36px;
    height: 36px;

    border: 0;
    border-radius: 50%;

    background: #252525;
    color: #aaa;

    font-size: 25px;
    line-height: 1;

    cursor: pointer;
}

.close-button:hover {
    background: #333;
    color: #fff;
}

.modal-header {
    padding-right: 45px;
    margin-bottom: 22px;
}

.modal-header h2 {
    margin: 0 0 6px;
    font-size: 24px;
}

.modal-header p {
    margin: 0;
    color: #777;
    font-size: 14px;
}

.contract {
    padding: 18px 0;
    border-bottom: 1px solid #292929;
}

.contract:first-child {
    padding-top: 0;
}

.contract:last-child {
    border-bottom: 0;
}

.contract-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #fff;
}

.contract-line {
    margin: 6px 0;
    color: #aaa;
    font-size: 14px;
    line-height: 1.45;
}

.contract-line strong {
    color: #ddd;
}

.ad-content {
    color: #ddd;
    line-height: 1.6;
    white-space: pre-wrap;
}

.ad-info {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #292929;
    color: #888;
    font-size: 13px;
}

/* Mobile */

@media (max-width: 600px) {
    .page {
        padding: 20px 12px;
    }

    .header h1 {
        font-size: 30px;
    }

    .category-button {
        min-height: 58px;
        font-size: 16px;
    }

    .modal {
        padding: 10px;
    }

    .modal-window {
        max-height: 90vh;
        padding: 22px 18px;
        border-radius: 18px;
    }

    .modal-header h2 {
        font-size: 21px;
    }

    .contract-title {
        font-size: 16px;
    }
}
