body {
    font-family: Arial, sans-serif;
    background-color:#444;
    color:white;
    font-size:18pt;
    padding:24px;
    margin: 0;
}

h1 {
    font-weight:bold;
    text-align: center;
    margin-bottom: 50px;
}

#grid {
    display: grid;
    grid-template-columns: repeat(3, 200px);
    justify-content: center;
    gap: 40px;
    margin-bottom: 50px;
}

.square {
    width: 200px;
    height: 200px;
    cursor: pointer;
    border: 1px solid white;
    position: relative;
}

/* ===== ЦВЕТА (НЕ ТРОГАЮ) ===== */
.square:nth-child(1) { background: #e74c3c; }
.square:nth-child(2) { background: #1f6feb; }
.square:nth-child(3) { background: #808000; }
.square:nth-child(4) { background: #f39c12; }
.square:nth-child(5) { background: #800080; }
.square:nth-child(6) { background: #16a085; }
.square:nth-child(7) { background: #e84393; }
.square:nth-child(8) { background: #999999; }
.square:nth-child(9) { background: #000000; }

/* ===== НОМЕРА (ПК) ===== */
.square::after {
    content: attr(data-id);
    position: absolute;

    left: 3px;
    bottom: 2px;

    font-size: 14px;
    line-height: 1;

    color: #fff;

    pointer-events: none;
}

/* ===== МОБИЛА (фикс overflow + увеличение цифр) ===== */
@media (max-width: 768px) {

    body {
        font-size: 16pt;
        padding: 10px;
    }

    #grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        padding: 0 10px;
    }

    .square {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
    }

    .square::after {
        font-size: 16px !important;
        left: 4px !important;
        bottom: 4px !important;
    }
	
    body {
        font-size: 14pt; /* абзацы меньше */
        padding: 10px;
    }

    h1 {
        font-size: 22px; /* в 2 раза меньше */
        margin-bottom: 30px;
    }
	
}
