/* Основной контент */
.main-content {
    margin-left: 300px;
    padding: 20px;
    flex-grow: 1;
    background-color: #f4f4f4;
    transition: margin-left 0.3s ease;
    margin-top: 120px;
}

/* Плитки компьютеров */
.tile {
    min-height: 200px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    transition: transform 0.2s, box-shadow 0.2s;
}

.tile-body {
    height: calc(100% - 30px);
}

.tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.tile h2 {
    margin-top: 0;
}

.tile button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.tile button:hover {
    background-color: #0056b3;
}

/* Плитки игр */
.game-tile {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0;
    aspect-ratio: 1/1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
}

.game-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.game-image {
    height: 75%;
    width: 100%;
    background-color: #eee;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
    transition: background-position 3s linear;
    will-change: background-position; /* Оптимизация анимации */
}

.alt-text {
    display: none;
    font-family: Arial, sans-serif;
    font-weight: bold;
    line-height: 60px;
    font-size: 2rem;
    letter-spacing: 1px;
    height: 60px;
    color: #f8f8f8;
    text-shadow:
            -1px -1px 1px rgba(0,0,0,0.2),
            1px 1px 1px rgba(255,255,255,0.6);
    padding: 10px 15px;
    border-radius: 5px;
    text-align: center;
}

.game-image:not([style*="background-image"]) .alt-text,
.game-image[style*="background-image: none"] .alt-text {
    display: block;
}

.game-tile:hover .game-image {
    /* Это нужно для сброса анимации при быстром наведении/снятии */
    animation: forceRepaint 0.001s;
    background-position: center bottom;
}

.game-title {
    height: 25%;
    padding: 10px;
    text-align: center;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.no-content-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    font-size: 1.2rem;
    color: #666;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Индикатор загрузки */
#loading {
    text-align: center;
    margin: 20px;
    display: none;
}

/* Кнопка прокрутки вверх */
.scroll-to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 40px;
    height: 40px;
    background-color: #2c3e50;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

/* Добавить перед медиазапросами */
.help-content {
    display: none;
    max-width: 800px;
}

.help-tile {
    display: block;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.help-tile details > summary {
    list-style: none;
}

.help-tile details > summary::-webkit-details-marker {
    display: none;
}

.help-tile details > summary h2 {
    display: inline-block;
    border-bottom: 1px dashed currentColor;
    cursor: pointer;
    outline: none;
}

.help-tile details[open] > summary h2 {
    border-bottom: none;
    margin-bottom: 8px;
}