* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #667eea, #764ba2);
    min-height: 100vh;
    color: white;
}

.container {
    width: 90%;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 20px;
    text-align: center;
}

/* =========================
   HERO
   ========================= */

.hero {
    text-align: center;
    margin-top: 25px;
    margin-bottom: 45px;
}

.hero-badge {
    display: inline-block;

    padding: 8px 18px;
    margin-bottom: 18px;

    border-radius: 30px;

    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.35);

    color: white;

    font-size: 14px;
    font-weight: bold;

    backdrop-filter: blur(6px);
}

.hero h1 {
    margin-top: 0;
    margin-bottom: 15px;
}

.hero .subtitle {
    margin-bottom: 0;
}

h1 {
    color: white;
    font-size: 55px;
    margin-bottom: 15px;
}

.subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 20px;
    margin-bottom: 40px;
}


/* =========================
   КАТЕГОРИИ
   ========================= */

.categories {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 25px;
}

.category-card {
    position: relative;
    cursor: pointer;
}

.category-card input {
    position: absolute;
    opacity: 0;
}

.category-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    min-height: 180px;
    padding: 20px;

    background: white;
    border: 3px solid transparent;
    border-radius: 20px;

    box-sizing: border-box;

    transition: transform 0.2s,
    box-shadow 0.2s,
    border-color 0.2s,
    background 0.2s;
}

.category-content:hover {
    transform: translateY(-5px);

    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

.category-card input:checked + .category-content {
    border-color: #667eea;
    background: #f3f4ff;

    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.25),
    0 0 0 2px rgba(102, 126, 234, 0.08);
}

.category-icon {
    display: block;
    font-size: 38px;
    margin-bottom: 12px;
}

.category-title {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #302c3b;
}

.category-description {
    display: block;
    margin-top: 7px;
    font-size: 13px;
    line-height: 1.4;
    color: #85808f;
}
/* =========================
   СПЕЦИАЛЬНЫЕ КАРТОЧКИ
   ========================= */

/* Для двоих */

.couple-card:hover .category-content {
    background: #fff4f7;
    border-color: darkred;
}

/* Удиви меня */

.surprise-card {
    text-decoration: none;
    color: inherit;
    display: block;
}


.surprise-card:hover .category-content {
    border-color: #a99bea;
    color: #6656c7;
}


/* =========================
   ВРЕМЯ
   ========================= */

.time-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;

    margin-top: 25px;
}

.time-card {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 65px;

    background: white;

    border: 3px solid transparent;
    border-radius: 15px;

    cursor: pointer;

    font-size: 16px;
    font-weight: bold;
    color: #333;

    transition: transform 0.2s,
    box-shadow 0.2s,
    border-color 0.2s,
    background 0.2s;
}

.time-card:hover {
    transform: translateY(-3px);

    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.time-card input {
    position: absolute;
    opacity: 0;
}

.time-card:has(input:checked) {
    border-color: #667eea;

    background: #f3f4ff;

    color: #667eea;

    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.15);
}


/* =========================
   КНОПКИ
   ========================= */

.button {
    display: block;

    margin-top: 40px;
    margin-left: auto;
    margin-right: auto;
    padding: 15px 30px;

    border-radius: 30px;

    background: white;
    color: #667eea;

    border: 2px solid white;

    text-decoration: none;

    font-size: 17px;
    font-weight: bold;

    cursor: pointer;

    transition: background 0.2s,
    transform 0.2s,
    box-shadow 0.2s;
}

.button:hover {
    background: #f4f4f4;

    transform: translateY(-3px);

    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}


/* =========================
   ФОРМЫ
   ========================= */

form {
    text-align: center;
}

label {
    font-weight: 700;
    color: #444;
}

input,
textarea,
select {
    width: 100%;

    padding: 12px;

    border: 1px solid #ddd;
    border-radius: 10px;

    font-size: 16px;
    font-family: Arial, sans-serif;
}

textarea {
    resize: vertical;
}

form button {
    border: none;
    cursor: pointer;
}

form .button {
    display: inline-block;
    width: auto;
}


/* =========================
   КАРТОЧКА ЗАНЯТИЯ
   ========================= */

.activity-card {
    background: white;

    border-radius: 25px;

    padding: 40px;

    max-width: 650px;

    margin: 40px auto;

    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.activity-card h2 {
    font-size: 32px;

    margin-top: 0;

    color: #333;
}

.activity-description {
    font-size: 19px;

    line-height: 1.6;

    color: #555;
}

.duration {
    display: inline-block;

    background: #f0ecff;

    color: #6046c7;

    padding: 10px 18px;

    border-radius: 30px;

    margin-top: 15px;

    font-weight: bold;
}

.back-button {
    display: inline-block;

    margin-top: 20px;

    color: white;

    text-decoration: none;

    font-size: 17px;
}

.button-container {
    display: flex;
    justify-content: center;
}

.auth-form {
    max-width: 400px;
    margin: 30px auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-form input {
    padding: 12px 15px;
    border-radius: 10px;
    border: 1px solid #ddd;
    font-size: 16px;
    box-sizing: border-box;
}

.auth-form label {
    color: white;
    font-weight: bold;
    margin-top: 8px;
}

.auth-form .button {
    margin-top: 20px;
}

.auth-link {
    text-align: center;
    position: relative;
    margin-top: 20px;
    top: 20px;
    color: white;
}

.auth-link a {
    font-weight: bold;
    color: aliceblue;
    text-decoration: underline;
}

.auth-error,
.auth-success {
    text-align: center;
    margin: 15px 0;
}

/* Верхнее меню */

.top-menu {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
    padding-bottom: 20px;
}

.top-menu-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.top-link {
    display: inline-block;
    padding: 12px 14px;
    border-radius: 20px;
    color: white;
    text-decoration: none;
    font-weight: bold;
    transition: 0.2s;
    margin-top: 20px;
    margin: 2px;
}

.top-link:hover {
    background: rgba(255, 255, 255, 0.2);
}

.register-link {
    border: 1px solid rgba(255, 255, 255, 0.7);
    margin: 18px;
}

.username {
    color: white;
    font-weight: bold;
    margin-right: 5px;
}

.logout-form {
    display: inline;
    margin: 0;
}

.logout-button {
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
}


/* Лайк и избранное */

.activity-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: nowrap;
}

.activity-actions form {
    display: inline-flex;
    align-items: center;
    margin: 0;
    width: auto;
    flex: 0 0 auto;
}

.icon-button {
    border: none;
    background: transparent;
    padding: 5px;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.2s;
}

.icon-button:hover {
    transform: scale(1.2);
}

.icon-button.active {
    transform: scale(1.05);
}


/* Сообщение гостю */

.auth-message {
    display: none;
    text-align: center;
    margin: 15px auto;
    padding: 12px 18px;
    max-width: 500px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.9);
    color: #555;
    font-size: 14px;
}

.auth-message a {
    color: #667eea;
    font-weight: bold;
    text-decoration: none;
}

.auth-message.show {
    display: block;
}

.favorite-card {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 25px;
    margin: 20px 0;
}

/* =========================
   СТРАНИЦА ЗАНЯТИЯ
   ========================= */

.activity-card {
    color: black;
    background: white;
    border-radius: 25px;
    padding: 35px;
    margin-top: 30px;

    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);

    text-align: left;
}

.activity-card h2 {
    text-align: center;

    font-size: 30px;

    color: #333;

    margin-top: 10px;
    margin-bottom: 20px;
}

.activity-description {
    font-size: 18px;
    line-height: 1.6;

    color: #555;

    text-align: center;

    margin-bottom: 25px;
}


/* КАРТИНКА */

.activity-image {
    width: 100%;

    margin-bottom: 25px;

    overflow: hidden;

    border-radius: 20px;
}

.activity-image img {
    display: block;

    width: 100%;
    max-height: 400px;

    object-fit: cover;
}


/* ОСНОВНАЯ ИНФОРМАЦИЯ */

.activity-info {
    display: flex;

    justify-content: center;

    gap: 30px;

    margin: 25px 0;

    padding: 15px;

    background: #f5f6ff;

    border-radius: 15px;

    color: #555;

    font-size: 16px;
}


/* СЕКЦИИ */

.activity-section {
    margin-top: 25px;

    padding: 20px;

    background: #f8f8fb;

    border-radius: 15px;
}

.activity-section h3 {
    margin-top: 0;
    margin-bottom: 12px;

    color: #333;

    font-size: 20px;
}

.activity-text {
    margin: 0;

    color: #555;

    font-size: 16px;

    line-height: 1.7;

    white-space: pre-line;
}


/* ИНТЕРЕСНЫЙ ФАКТ */

.fact-section {
    background: #fff8e7;

    border-left: 5px solid #f0b429;
}


/* МАТЕРИАЛЫ */

.activity-materials {
    margin-top: 25px;

    padding: 20px;

    background: #f3f4ff;

    border-radius: 15px;

    text-align: center;
}

.activity-materials h3 {
    margin-top: 0;
    margin-bottom: 18px;

    color: #333;
}


/* КНОПКИ МАТЕРИАЛОВ */

.material-button {
    display: inline-block;

    margin: 5px;

    padding: 12px 20px;

    border-radius: 25px;

    background: white;

    color: #667eea;

    border: 2px solid #667eea;

    text-decoration: none;

    font-weight: bold;

    transition: transform 0.2s,
    background 0.2s,
    color 0.2s;
}

.material-button:hover {
    transform: translateY(-2px);

    background: #667eea;

    color: white;
}


/* НАВИГАЦИЯ */

.activity-navigation {
    display: flex;

    justify-content: center;

    gap: 20px;

    flex-wrap: wrap;

    margin-top: 20px;
}

.activity-navigation .button {
    margin-top: 10px;
}

.favorite-meta {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 15px 0;
}

.favorite-meta-item {
    display: inline-block;
    background: rgba(255, 255, 255, 0.9);
    color: black;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.hero-link {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.hero-link:hover {
    text-decoration: none;
}

/* Персональная рекомендация */
.personal-recommendation {
    margin: 0 0 28px;
    padding: 22px 24px;

    border-radius: 18px;
    text-align: center;

    background: linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.22),
            rgba(255, 255, 255, 0.10)
    );

    border: 1px solid rgba(255, 255, 255, 0.35);

    box-shadow:
            0 8px 24px rgba(40, 25, 90, 0.12),
            0 0 18px rgba(255, 255, 255, 0.08);

    animation: recommendationAppear 0.8s ease-out both;
}

/* Крупная надпись «Для тебя» */
.personal-recommendation-title {
    margin-bottom: 10px;

    color: indigo;
    font-size: clamp(26px, 3vw, 34px);
    font-weight: 800;
    line-height: 1.2;

    text-shadow: 0 3px 14px rgba(40, 25, 90, 0.2);
}

/* Пояснение под заголовком */
.personal-recommendation-text {
    color: darkblue;
    font-size: 16px;
    line-height: 1.6;
}

/* Плавное появление снизу */
@keyframes recommendationAppear {
    from {
        opacity: 0;
        transform: translateY(22px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* Личный раздел */

.hero-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.personal-section {
    text-align: center;
    margin-top: 30px;
}

.personal-section h2 {
    margin-bottom: 25px;
}

.favorites-section-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    margin-top: 32px;
    margin-bottom: 38px;

    padding: 16px 36px;
    border-radius: 16px;

    background: rgba(255, 255, 255, 0.95);
    color: #667eea;

    font-size: 18px;
    font-weight: 700;

    text-decoration: none;

    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);

    transition:
            transform 0.2s ease,
            box-shadow 0.2s ease;
}

.favorites-section-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

/* Челлендж дня */

.daily-challenge {
    margin: 0 auto 0;
    max-width: 650px;
    padding: 28px;
    border-radius: 24px;

    background: linear-gradient(
            135deg,
            rgba(255, 193, 7, 0.95),
            rgba(255, 111, 0, 0.95)
    );

    color: white;

    box-shadow:
            0 15px 35px rgba(0, 0, 0, 0.2);

    text-align: center;
}

.daily-challenge-title {
    font-size: 25px;
    font-weight: 800;
    margin-bottom: 18px;
}

.daily-challenge-content h3 {
    font-size: 22px;
    margin: 0 0 12px;
}

.daily-challenge-content p {
    margin: 0 auto;
    max-width: 520px;
    line-height: 1.6;
    font-size: 16px;
}

.daily-challenge-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
}

.daily-challenge-actions form {
    margin: 0;
}

.challenge-start-button,
.challenge-decline-button,
.challenge-complete-button {
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.challenge-start-button {
    background: white;
    color: #f57c00;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.challenge-decline-button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.challenge-complete-button {
    background: white;
    color: #e65100;
    padding: 14px 30px;
    font-size: 16px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.challenge-start-button:hover,
.challenge-decline-button:hover,
.challenge-complete-button:hover {
    transform: translateY(-2px);
}

.daily-challenge-status {
    margin-top: 22px;
    font-size: 17px;
    font-weight: 700;
}

.challenge-streak {
    margin-top: -15px;
    margin-bottom: 22px;

    font-size: 18px;
    font-weight: 700;

    color: white;
}

/* Имя пользователя */

.profile-name-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.profile-name {
    margin: 0;
}

.edit-name-button {
    border: none;
    background: transparent;
    padding: 4px;
    font-size: 18px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.edit-name-button:hover {
    transform: scale(1.15);
}

.name-edit-form {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.name-edit-form.show {
    display: flex;
}

.name-edit-form input {
    width: auto;
    min-width: 120px;
    max-width: 280px;
    padding: 7px 12px;
    border-radius: 10px;
    border: 1px solid #ddd;
    font-size: 16px;
    text-align: center;
}

.save-name-button {
    padding: 7px 14px;
    border: none;
    border-radius: 10px;
    background: white;
    color: #667eea;
    font-weight: bold;
    cursor: pointer;
}
/* =========================
   ИМЯ В ЛИЧНОМ РАЗДЕЛЕ
   ========================= */

.profile-name-form {
    margin: 35px 0 0;
    text-align: center;
}

.profile-name-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 7px;
    min-height: 42px;
}

.profile-name {
    font-size: 28px;
    font-weight: 700;
    color: white;
}

.profile-name.hide {
    display: none;
}

.profile-name-input {
    display: none;

    width: 10ch;
    max-width: 30ch;

    padding: 5px 9px;

    border: none;
    border-radius: 10px;

    background: white;
    color: #333;

    font-size: 24px;
    font-weight: 700;
    text-align: center;

    outline: none;
}

.profile-name-input.show {
    display: inline-block;
}

.edit-name-button {
    border: none;
    background: transparent;

    padding: 3px;

    font-size: 18px;
    line-height: 1;

    color: white;

    cursor: pointer;

    transition: transform 0.2s ease;
}

.edit-name-button:hover {
    transform: scale(1.15);
}

.challenge-streak {
    margin-top: 12px;
    text-align: center;

    font-size: 18px;
    font-weight: 700;
    color: white;
}

.username-link {
    text-decoration: none;
    color: white;
    cursor: pointer;
}

.username-link:hover {
    text-decoration: underline;
}
/* =========================
   КНОПКИ ЧЕЛЛЕНДЖА
   ========================= */

.challenge-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;

    margin-top: 28px;
}

.challenge-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 150px;
    padding: 13px 24px;

    border-radius: 14px;

    font-family: inherit;
    font-size: 16px;
    font-weight: 700;

    cursor: pointer;

    transition:
            transform 0.2s ease,
            box-shadow 0.2s ease,
            background 0.2s ease;
}

.challenge-button:hover {
    transform: translateY(-2px);
}

.challenge-button.primary {
    background: white;
    color: #667eea;
    border: 2px solid white;

    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.challenge-button.primary:hover {
    background: #f7f7ff;
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.2);
}

.challenge-button.secondary {
    background: rgba(255, 255, 255, 0.12);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.7);
}

.challenge-button.secondary:hover {
    background: rgba(255, 255, 255, 0.22);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.daily-challenge {
    margin-top: 10px;
    margin-bottom: 30px;
}

.daily-challenge h2 {
    margin-bottom: 22px;
}

.daily-challenge p {
    margin-bottom: 0;
}

/* =========================
   ФИНАЛЬНЫЙ ВИД ЛИЧНОГО РАЗДЕЛА
   ========================= */

/* Имя пользователя */
.profile-name-form {
    margin-top: 55px;
    margin-bottom: 8px;
    text-align: center;
}

.profile-name-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    min-height: 52px;
}

.profile-name {
    margin: 0;
    font-size: 38px;
    font-weight: 800;
    color: white;
    text-shadow: 0 3px 12px rgba(0, 0, 0, 0.22);
    letter-spacing: 0.3px;
}

.edit-name-button {
    border: none;
    background: transparent;
    padding: 5px;
    font-size: 20px;
    line-height: 1;
    color: white;
    cursor: pointer;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.edit-name-button:hover {
    transform: scale(1.15);
}


/* Серия выполненных челленджей */
.challenge-streak {
    margin-top: 6px;
    margin-bottom: 42px;

    text-align: center;

    font-size: 22px;
    font-weight: 800;
    color: white;

    text-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
}


/* Кнопки челленджа */
.daily-challenge-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 28px;
}

.daily-challenge-actions form {
    margin: 0;
}


/* Приступить */
.challenge-start-button {
    min-width: 155px;
    padding: 13px 26px;

    border: 2px solid white;
    border-radius: 15px;

    background: white;
    color: #f57c00;

    font-family: inherit;
    font-size: 16px;
    font-weight: 700;

    cursor: pointer;

    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.18);

    transition:
            transform 0.2s ease,
            box-shadow 0.2s ease,
            background 0.2s ease;
}

.challenge-start-button:hover {
    transform: translateY(-3px);
    background: #fffaf5;
    box-shadow: 0 11px 24px rgba(0, 0, 0, 0.22);
}


/* Отказаться */
.challenge-decline-button {
    min-width: 155px;
    padding: 13px 26px;

    border: 2px solid rgba(255, 255, 255, 0.75);
    border-radius: 15px;

    background: rgba(255, 255, 255, 0.16);
    color: white;

    font-family: inherit;
    font-size: 16px;
    font-weight: 700;

    cursor: pointer;

    transition:
            transform 0.2s ease,
            background 0.2s ease,
            box-shadow 0.2s ease;
}

.challenge-decline-button:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}


/* Завершить занятие */
.challenge-complete-button {
    min-width: 220px;
    padding: 14px 30px;

    border: 2px solid white;
    border-radius: 15px;

    background: white;
    color: #e65100;

    font-family: inherit;
    font-size: 17px;
    font-weight: 800;

    cursor: pointer;

    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);

    transition:
            transform 0.2s ease,
            box-shadow 0.2s ease,
            background 0.2s ease;
}

.challenge-complete-button:hover {
    transform: translateY(-3px);
    background: #fff8f2;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24);
}


/* Немного воздуха внутри карточки */
.daily-challenge {
    margin-top: 10px;
    margin-bottom: 35px;
}

/* ========================================
   ЛИЧНЫЙ КАБИНЕТ — НОВЫЙ МАКЕТ
   ======================================== */

.section-page {
    min-height: 100vh;
}


/* Шапка на всю ширину */

.section-header {
    width: 100%;
    min-height: 76px;
    box-sizing: border-box;

    padding: 12px 4.5%;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    background: rgba(255, 255, 255, 0.10);
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.section-header-brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.section-header-brand .hero-badge {
    margin: 0;
}

.section-header-user {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 24px;
}

.section-header-username {
    color: white;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
}

.section-header .logout-form {
    margin: 0;
}

.section-header .logout-button {
    font-family: inherit;
    cursor: pointer;
}


/* Две колонки */

.section-layout {
    width: min(1400px, 92%);
    margin: 42px auto 60px;

    display: grid;
    grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.6fr);
    align-items: start;
    gap: 32px;
}


/* Левая колонка */

.section-sidebar {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.profile-card {
    padding: 34px 24px;
    border-radius: 24px;

    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.22);

    box-shadow: 0 14px 35px rgba(40, 25, 90, 0.13);

    text-align: center;
}

.profile-name-form {
    margin: 0;
    text-align: center;
}

.profile-name-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
}

.profile-name {
    max-width: 100%;
    overflow-wrap: anywhere;

    color: white;
    font-size: clamp(25px, 2.5vw, 36px);
    font-weight: 800;
    text-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
}

.profile-name.hide {
    display: none;
}

.profile-name-input {
    display: none;

    box-sizing: content-box;
    width: 10ch;
    max-width: 100%;

    padding: 7px 10px;
    border: 0;
    border-radius: 10px;

    background: white;
    color: #333;

    font: inherit;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
}

.profile-name-input.show {
    display: inline-block;
}

.edit-name-button {
    flex-shrink: 0;

    padding: 5px;
    border: 0;
    background: transparent;

    color: white;
    font-size: 19px;
    cursor: pointer;

    transition: transform 0.2s ease;
}

.edit-name-button:hover {
    transform: scale(1.12);
}


/* Огонёк */

.challenge-streak {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    margin: 15px 0 0;

    color: black;
    font-size: 23px;
    font-weight: 800;
    text-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.streak-label {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
    text-shadow: none;
}


/* Избранное */

.favorites-section-button {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    box-sizing: border-box;

    margin-top: 30px;
    padding: 17px 20px;

    border-radius: 15px;
    background: white;
    color: #667eea;

    font-size: 17px;
    font-weight: 800;
    text-decoration: none;

    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);

    transition:
            transform 0.2s ease,
            box-shadow 0.2s ease;
}

.favorites-section-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
}


/* Небольшой текст в левой колонке */

.profile-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;

    padding: 18px 20px;
    border-radius: 18px;

    background: rgba(255, 255, 255, 0.09);
    color: rgba(255, 255, 255, 0.9);
}

.profile-note-icon {
    font-size: 21px;
}

.profile-note p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
}


/* Правая колонка: карточка челленджа */

.section-main {
    min-width: 0;
}

.daily-challenge {
    box-sizing: border-box;
    width: 100%;

    margin: 0;
    padding: 30px clamp(22px, 3vw, 42px);

    border-radius: 25px;

    background: linear-gradient(135deg, #ffb900 0%, #ff7900 100%);
    color: white;

    box-shadow: 0 18px 42px rgba(65, 35, 90, 0.2);
}

.daily-challenge-heading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;

    margin-bottom: 26px;
}

.daily-challenge-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;

    width: 54px;
    height: 54px;

    border-radius: 17px;
    background: rgba(255, 255, 255, 0.2);

    font-size: 29px;
}

.daily-challenge-title {
    margin: 0;
    color: white;

    font-size: clamp(24px, 2.5vw, 32px);
    font-weight: 800;
}

.daily-challenge-subtitle {
    margin: 6px 0 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
}


/* Содержимое занятия */

.daily-challenge-content {
    min-width: 0;
}

.challenge-image {
    width: 100%;
    max-height: 340px;
    margin-bottom: 24px;
    overflow: hidden;
    border-radius: 18px;
}

.challenge-image img {
    display: block;
    width: 100%;
    max-height: 340px;
    object-fit: cover;
}

.challenge-activity-title {
    margin: 0 0 12px;

    color: white;
    font-size: clamp(23px, 2.3vw, 30px);
    line-height: 1.25;
    font-weight: 800;
}

.challenge-activity-description {
    margin: 0;

    color: rgba(255, 255, 255, 0.96);
    font-size: 16px;
    line-height: 1.7;
}

.challenge-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;

    margin-top: 20px;
}

.challenge-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 10px;

    background: rgba(255, 255, 255, 0.13);
    color: white;

    font-size: 14px;
    font-weight: 600;
}


/* Инструкция, польза, факт */

.challenge-info-section {
    margin-top: 24px;
    padding-top: 20px;

    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.challenge-info-section h3,
.challenge-materials h3 {
    margin: 0 0 10px;

    color: white;
    font-size: 18px;
    font-weight: 800;
}

.challenge-info-section p {
    margin: 0;

    color: rgba(255, 255, 255, 0.96);
    font-size: 15px;
    line-height: 1.75;

    white-space: pre-line;
}

.challenge-fact {
    padding: 18px;
    border: 0;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.14);
}


/* Материалы */

.challenge-materials {
    margin-top: 25px;
    padding-top: 22px;

    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.challenge-material-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.challenge-material-links .material-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    margin: 0;
    padding: 11px 16px;

    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 12px;

    background: rgba(255, 255, 255, 0.16);
    color: white;

    font-size: 14px;
    font-weight: 700;
    text-decoration: none;

    transition: background 0.2s ease, transform 0.2s ease;
}

.challenge-material-links .material-button:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.27);
}


/* Кнопки внизу карточки */

.daily-challenge-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    gap: 14px;

    margin-top: 30px;
    padding-top: 22px;

    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.daily-challenge-actions form {
    margin: 0;
}

.challenge-start-button,
.challenge-decline-button,
.challenge-complete-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 48px;
    box-sizing: border-box;
    padding: 12px 23px;

    border-radius: 13px;

    font-family: inherit;
    font-size: 15px;
    font-weight: 800;

    cursor: pointer;

    transition:
            transform 0.2s ease,
            box-shadow 0.2s ease,
            background 0.2s ease;
}

.challenge-start-button,
.challenge-complete-button {
    border: 2px solid white;
    background: white;
    color: #e66a00;

    box-shadow: 0 7px 18px rgba(110, 50, 0, 0.15);
}

.challenge-decline-button {
    border: 2px solid rgba(255, 255, 255, 0.75);
    background: rgba(255, 255, 255, 0.13);
    color: white;
}

.challenge-start-button:hover,
.challenge-decline-button:hover,
.challenge-complete-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(110, 50, 0, 0.2);
}

.challenge-decline-button:hover {
    background: rgba(255, 255, 255, 0.23);
}


/* Статусы */

.daily-challenge-status {
    margin-top: 28px;
    padding: 17px 20px;

    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 14px;

    background: rgba(255, 255, 255, 0.17);
    color: white;

    font-size: 17px;
    font-weight: 800;
    text-align: center;
}

.empty-challenge {
    min-height: 200px;
}

/* ========================================
   ЛИЧНЫЙ КАБИНЕТ — ЦЕНТРИРОВАННЫЙ МАКЕТ
   ======================================== */

/* Центральная область с полями по бокам */
.section-layout {
    width: min(1080px, calc(100% - 64px));
    margin: 36px auto 60px;

    display: grid;
    grid-template-columns: 280px minmax(0, 650px);
    justify-content: center;
    align-items: start;
    gap: 28px;
}

/* Левая колонка */
.section-sidebar {
    min-width: 0;
}

/* Карточка челленджа */
.section-main {
    min-width: 0;
    width: 100%;
    max-width: 650px;
    justify-self: center;
}

.daily-challenge {
    width: 100%;
    max-width: 650px;
    margin: 0 auto;
    padding: 26px 30px;
    box-sizing: border-box;
    border-radius: 22px;

}

/* Заголовок карточки */
.daily-challenge-heading {
    margin-bottom: 35px;
}

.daily-challenge-title {
    font-size: 27px;
    justify-content: center;
}

/* Немного компактнее содержимое */
.challenge-image {
    max-height: 280px;
}

.challenge-image img {
    max-height: 280px;
}

.challenge-activity-title {
    font-size: 25px;
}

.challenge-activity-description {
    font-size: 15px;
    line-height: 1.65;
}

/* Кнопки — по центру карточки */
.daily-challenge-actions {
    justify-content: center;
    align-items: center;
    gap: 14px;
}

.daily-challenge-actions form {
    display: flex;
    justify-content: center;
    margin: 0;
}

.challenge-start-button,
.challenge-decline-button,
.challenge-complete-button {
    min-width: 150px;
    padding: 11px 20px;
    font-size: 14px;
}

/* ========================================
   ЕДИНАЯ ШАПКА САЙТА
   ======================================== */

.site-header {
    width: 100%;
    min-height: 76px;
    box-sizing: border-box;

    padding: 12px clamp(20px, 4.5%, 72px);

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    background: rgba(255, 255, 255, 0.10);
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.site-header-brand {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
}

.site-header-brand .hero-badge {
    margin: 0;
}

.site-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 22px;
}

.site-header-username,
.site-header-link {
    color: white;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.site-header-username {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.site-header-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 9px 0;
    border: 0;
    background: transparent;
    cursor: pointer;

    transition: opacity 0.2s ease;
}

.site-header-link:hover,
.site-header-username:hover {
    opacity: 0.78;
}

.site-header-register {
    padding: 10px 17px;
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 11px;
}

.site-header-logout-form {
    display: inline-flex;
    margin: 0;
}

/* Правильное расположение шапки и содержимого */
body.page-with-header {
    display: block;
    min-height: 100vh;
}

body.page-with-header .site-header {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
}

body.page-with-header > .container {
    margin-left: auto;
    margin-right: auto;
}
/* =========================
   СВЁРНУТЫЕ КАРТОЧКИ ИЗБРАННОГО
   ========================= */

.favorite-accordion {
    padding: 0;
    overflow: hidden;
}

/* Заголовок карточки */
.favorite-accordion-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    padding: 24px 30px;

    color: #333;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.4;
    text-align: left;

    cursor: pointer;
    list-style: none;

    transition: background 0.2s ease;
}

/* Убираем стандартный маркер */
.favorite-accordion-title::-webkit-details-marker {
    display: none;
}

.favorite-accordion-title::marker {
    content: "";
}

.favorite-accordion-title:hover {
    background: #f5f4ff;
}

/* Стрелка */
.favorite-accordion-icon {
    flex-shrink: 0;
    color: #667eea;
    font-size: 26px;
    line-height: 1;

    transition: transform 0.25s ease;
}

/* Поворот стрелки при раскрытии */
.favorite-accordion[open] .favorite-accordion-icon {
    transform: rotate(180deg);
}

/* Содержимое раскрытой карточки */
.favorite-accordion-content {
    padding: 0 30px 30px;
    animation: favoriteContentAppear 0.25s ease;
}

.favorite-accordion-content .activity-description {
    margin-top: 0;
}

.favorite-accordion-content form {
    margin-top: 20px;
}

@keyframes favoriteContentAppear {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================
   ГАЛОЧКА ВЫПОЛНЕНИЯ
   ========================= */

.icon-button.completion-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;
    padding: 0;


    border-radius: 50%;

    background: white;
    color: black;

    font-size: 25px;
    font-weight: 800;
    line-height: 1;

    transition:
            transform 0.2s ease,
            background 0.2s ease,
            color 0.2s ease,
            box-shadow 0.2s ease;
}

/* Занятие уже выполнялось */
.icon-button.completion-button.completed {

    color: black;


}

/* Наведение */
.icon-button.completion-button:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(46, 157, 87, 0.25);
}

/* Фокус с клавиатуры */
.icon-button.completion-button:focus-visible {
    outline: 3px solid rgba(46, 157, 87, 0.4);
    outline-offset: 3px;
}
/* =========================
   КНОПКА «МОЯ АКТИВНОСТЬ»
   ========================= */

.my-activity-section-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
    margin-top: 10px;
    padding: 20px 20px;

    border: 2px solid #2e9d57;
    border-radius: 30px;

    background: #e4f7e9;
    color: #247a42;

    font-size: 16px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;

    transition:
            background 0.2s ease,
            color 0.2s ease,
            transform 0.2s ease,
            box-shadow 0.2s ease;
}

.my-activity-section-button:hover {
    background: #2e9d57;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 14px rgba(46, 157, 87, 0.22);
}

.my-activity-section-button:focus-visible {
    outline: 3px solid rgba(46, 157, 87, 0.4);
    outline-offset: 3px;
}

/* =========================
   КНОПКА ОТМЕНЫ ВЫПОЛНЕНИЯ
   ========================= */

.icon-button.cancel-completion-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;

    border-radius: 50%;
    color: #d9534f;

    font-size: 23px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;

    transition:
            transform 0.2s ease,
            background 0.2s ease,
            color 0.2s ease,
            box-shadow 0.2s ease;
}

.icon-button.cancel-completion-button:hover {
    transform: scale(1.1);
    background: #d9534f;
    color: #fff;
    box-shadow: 0 4px 12px rgba(217, 83, 79, 0.25);
}

.icon-button.cancel-completion-button:focus-visible {
    outline: 3px solid rgba(217, 83, 79, 0.35);
    outline-offset: 3px;
}

/* Адаптация под браузеры */

.activity-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    margin-top: 25px;
    width: 100%;
    flex-wrap: nowrap;
}

.activity-actions > div {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.activity-actions form {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    width: auto;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 44px;
    height: 44px;

    padding: 0;
    margin: 0;

    border: none;
    outline: none;

    background: transparent;
    color: #333;

    font-family: Arial, sans-serif;
    font-size: 32px;
    line-height: 1;

    cursor: pointer;

    -webkit-appearance: none;
    appearance: none;

    -webkit-tap-highlight-color: transparent;

    transition: transform 0.2s;
}

.icon-button:hover {
    transform: scale(1.2);
}

.icon-button.active {
    transform: scale(1.05);
}

.activity-actions form {
    display: flex;
    align-items: center;
    justify-content: center;

    margin: 0;
    padding: 0;
}

.activity-actions {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 18px;
    width: 100%;

    margin-top: 25px;
}

.challenge-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    width: 100%;
    flex-wrap: wrap;
    text-align: center;
}

.challenge-meta-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Для персональных занятий в календаре */
.day-details-header { display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 20px;
}

.day-details-header h2 {
    margin: 0;
}

.personal-activity-toggle {
    flex-shrink: 0;
}

.personal-activity-button {
    border: none;
    border-radius: 30px;
    padding: 12px 20px;
    background: #667eea;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.personal-activity-button:hover {
    background: #5668d8;
    transform: translateY(-1px);
}

.personal-activity-form {
    margin-bottom: 25px;
}

.personal-activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
}

.personal-activity-item {
    padding: 18px 20px;
    border-radius: 14px;
    background: #f7f7fb;
    border-left: 4px solid #667eea;
}

.personal-activity-item h3 {
    margin: 0 0 8px;
    color: #333;
    overflow-wrap: anywhere;
}

.personal-activity-item p {
    margin: 0 0 10px;
    color: #666;
    line-height: 1.5;
}

.personal-activity-item a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.personal-activity-item a:hover {
    text-decoration: underline;
}
.personal-activity-form {
    margin-top: 20px;
    padding: 24px;
    background: #f8f9ff;
    border-radius: 18px;
    border: 1px solid #e6e8f5;
}

.personal-activity-field {
    margin-bottom: 18px;
}

.personal-activity-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #444;
}

.personal-activity-field input,
.personal-activity-field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 13px 15px;
    border: 1px solid #d9dced;
    border-radius: 12px;
    background: white;
    color: #333;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.personal-activity-field input {
    height: 48px;
}

.personal-activity-field textarea {
    min-height: 110px;
    resize: vertical;
}

.personal-activity-field input::placeholder,
.personal-activity-field textarea::placeholder {
    color: #aaa;
}

.personal-activity-field input:focus,
.personal-activity-field textarea:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
    background: #fff;
}

.personal-activity-submit {
    width: 100%;
    margin-top: 5px;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.2s ease,
    box-shadow 0.2s ease,
    opacity 0.2s ease;
}

.personal-activity-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.3);
}

.personal-activity-submit:active:not(:disabled) {
    transform: translateY(0);
}

.personal-activity-submit:disabled {
    background: #d4d6df;
    color: #888;
    cursor: not-allowed;
    box-shadow: none;
}

.personal-activity-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 20px;
    border-radius: 14px;
    background: #f7f7fb;
    border-left: 4px solid #667eea;
}

.personal-activity-content {
    flex: 1;
    min-width: 0;
}

.personal-activity-delete-form {
    flex-shrink: 0;
    margin: 0;
}

.personal-activity-delete {
    padding: 9px 13px;
    border: none;
    border-radius: 10px;
    background: #fff0f0;
    color: #d9534f;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s ease,
    transform 0.2s ease;
}

.personal-activity-delete:hover {
    background: #ffe0e0;
    transform: translateY(-1px);
}

.personal-activity-delete:active {
    transform: translateY(0);
}

/* Запомнить меня */

.remember-me {
    margin: 15px 0 20px;
}

.remember-me label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 16px;
    cursor: pointer;
}

.remember-me input[type="checkbox"] {
    width: 17px;
    height: 17px;
    cursor: pointer;
    accent-color: #667eea;
}

/* =========================
   Достижения в личном кабинете
   ========================= */

.section-achievements {
    margin: 25px 0;
    text-align: center;
}

.section-achievements-empty {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.section-achievements-list {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.section-achievement-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 14px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 14px;
    text-decoration: none;
    color: #333;
    transition: transform 0.2s, box-shadow 0.2s;
}

.section-achievement-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.section-achievement-icon {
    font-size: 22px;
}

.section-achievement-title {
    font-size: 14px;
    font-weight: 600;
}

.section-achievements-link {
    display: inline-block;
    padding: 11px 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.section-achievements-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.achievements-section-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    width: 100%;
    min-height: 90px;

    box-sizing: border-box;

    background: white;
    border-radius: 20px;

    text-decoration: none;

    margin-top: 18px;

    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);

    transition:
            transform 0.2s ease,
            box-shadow 0.2s ease;
}

.achievements-section-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.12);
}

.achievements-section-button:active {
    transform: translateY(0);
}

.achievements-section-button-title {
    font-size: 19px;
    font-weight: 700;
    color: #667eea;
}

.achievements-section-button-progress {
    margin-top: 6px;
    font-size: 14px;
    color: #777;
}

.achievements-section-button-progress strong {
    color: #667eea;
    font-weight: 700;
}

/* =========================
   MINI GAMES ADMIN
   ========================= */

.mini-games-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 25px;
}

.mini-game-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 20px;
    box-sizing: border-box;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.07);
}

.mini-game-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.mini-game-info {
    min-width: 0;
}

.mini-game-title {
    font-size: 19px;
    font-weight: 700;
    color: #333;
}

.mini-game-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 14px;
    color: #777;
}

.mini-game-status {
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 600;
}

.mini-game-active {
    color: #35a66f;
}

.mini-game-inactive {
    color: #999;
}

.mini-game-description {
    margin-top: 12px;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.mini-game-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
}

.mini-game-edit-button,
.mini-game-delete-button {
    border: none;
    border-radius: 10px;
    padding: 9px 14px;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
}

.mini-game-edit-button {
    background: #f0f1ff;
    color: #667eea;
    font-weight: 600;
}

.mini-game-edit-button:hover {
    background: #e5e7ff;
}

.mini-game-delete-button {
    background: #f5f5f5;
    color: #888;
}

.mini-game-delete-button:hover {
    background: #eeeeee;
    color: #d9534f;
}

.mini-game-edit-form {
    margin-top: 18px;
    padding: 20px;
    background: #f7f7ff;
    border-radius: 15px;
}

.admin-edit-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.secondary-button {
    background: #eeeeee;
    color: #555;
}

.admin-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
}

.mini-game-tasks-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border-radius: 10px;
    background: #f0f1ff;
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.mini-game-tasks-button:hover {
    background: #e5e7ff;
}

.mini-game-tasks-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.mini-game-task-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 16px 18px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.06);
}

.mini-game-task-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.mini-game-task-content strong {
    color: #333;
}

.mini-game-task-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.empty-message {
    text-align: center;
    color: #888;
    padding: 25px;
}

.mini-game-task-main {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mini-game-task-status {
    font-size: 13px;
}

.mini-game-task-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mini-game-task-edit-form {
    margin-top: 15px;
    padding: 18px;
    background: #f7f7ff;
    border-radius: 14px;
}

.word-game-card {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.word-game-description {
    color: #777;
    margin-bottom: 30px;
}

.word-game-task {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 25px;
}

.word-game-letters,
.word-game-answer {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}

.word-game-letter,
.word-game-selected-letter {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 14px;
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
    background: white;
    color: #667eea;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: transform 0.2s ease;
}

.word-game-letter:hover,
.word-game-selected-letter:hover {
    transform: translateY(-2px);
}

.word-game-letter:disabled {
    opacity: 0.35;
    cursor: default;
}

.word-game-selected-letter {
    background: #667eea;
    color: white;
}

.word-game-check {
    margin-top: 25px;
}

.word-game-result {
    min-height: 30px;
    margin-top: 20px;
    font-size: 18px;
    font-weight: 600;
}

.word-game-result.success {
    color: #2e9d5b;
}

.word-game-result.error {
    color: #d9534f;
}

@media (max-width: 600px) {
    .day-details-header {
        align-items: flex-start;
        gap: 12px;
    }

    .day-details-header h2 {
        margin: 0;
    }

    .personal-activity-button {
        padding: 10px 14px;
        font-size: 14px;
    }
}

.activity-mini-game {
    margin: 30px 0;
    padding: 28px 20px;
    background: linear-gradient(135deg, #f5f3ff, #ffffff);
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.activity-mini-game-icon {
    font-size: 42px;
    margin-bottom: 10px;
}

.activity-mini-game h3 {
    margin: 0 0 10px;
    font-size: 24px;
    color: #667eea;
}

.activity-mini-game p {
    margin: 0 auto 20px;
    max-width: 500px;
    color: black;
}

.activity-mini-game-button {
    display: inline-block;
    margin-top: 5px;
    text-decoration: none;
}

.activity-mini-game-content {
    margin-top: 20px;
}

.mini-game-inline {
    margin-top: 20px;
}

.activity-mini-game-button:disabled {
    opacity: 0.7;
    cursor: wait;
}

/* =========================
   MEMORY GAME
   ========================= */

.memory-game {
    margin-top: 20px;
}

.memory-game-board {
    display: grid;
    grid-template-columns: repeat(3, 120px);
    gap: 12px;

    justify-content: center;

    margin: 20px auto;

    perspective: 1000px;
}

.memory-card {
    width: 120px;
    height: 120px;

    cursor: pointer;

    perspective: 1000px;
}

.memory-card-inner {
    position: relative;

    width: 100%;
    height: 100%;

    transform-style: preserve-3d;

    transition: transform 0.5s ease;
}

.memory-card.flipped .memory-card-inner,
.memory-card.matched .memory-card-inner {
    transform: rotateY(180deg);
}

.memory-card-front,
.memory-card-back {
    position: absolute;

    width: 100%;
    height: 100%;

    top: 0;
    left: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 14px;

    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;

    overflow: hidden;
}

.memory-card-front {
    background: #667eea;

    color: white;

    font-size: 36px;
    font-weight: bold;

    transform: rotateY(0deg);
}

.memory-card-back {
    background: white;

    transform: rotateY(180deg);
}

.memory-card-back img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
}

.memory-card.matched {
    cursor: default;
}

.memory-card.matched .memory-card-inner {
    box-shadow: 0 0 0 3px #4caf50;
}

.memory-game-result {
    margin-top: 15px;

    text-align: center;

    font-weight: bold;
}

.memory-game-result.success {
    color: #2e7d32;
}

.memory-game-result.error {
    color: #c62828;
}

/* =========================================================
   🐊 КРОКОДИЛ
   ========================================================= */

.crocodile-game {
    width: 100%;
    max-width: 650px;
    margin: 0 auto;
}


/* ---------- Настройка игры ---------- */

.crocodile-setup,
.crocodile-players-setup {
    animation: crocodileFadeIn 0.45s ease;
}

.crocodile-setup-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 24px;
    text-align: center;
}

.crocodile-setup-group {
    margin-bottom: 20px;
}

.crocodile-setup-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
}

.crocodile-setup select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e4e7f5;
    border-radius: 16px;
    background: #fff;
    font-size: 16px;
    cursor: pointer;
    margin: 9px;
}


/* ---------- Имена игроков ---------- */

.crocodile-player-input {
    margin-bottom: 14px;
}

.crocodile-player-input label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
}

.crocodile-player-name-input {
    width: 100%;
    box-sizing: border-box;
    padding: 13px 16px;
    border: 2px solid #e4e7f5;
    border-radius: 14px;
    font-size: 16px;
    outline: none;
    transition: 0.2s;
}

.crocodile-player-name-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.12);
}


/* ---------- Игровое поле ---------- */

.crocodile-play {
    animation: crocodileFadeIn 0.45s ease;
}

.crocodile-round-type {
    text-align: center;
    font-size: 22px;
    font-weight: 800;
    color: #667eea;
    margin-bottom: 8px;
}

.crocodile-player-name {
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 18px;
}


/* ---------- Таймер ---------- */

.crocodile-timer {
    width: fit-content;
    min-width: 110px;
    margin: 0 auto 24px;
    padding: 10px 20px;
    border-radius: 999px;
    background: #f1f3ff;
    color: #667eea;
    font-size: 30px;
    font-weight: 900;
    text-align: center;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 8px 25px rgba(70, 75, 150, 0.12);
}


/* ---------- Передача устройства ---------- */

.crocodile-task-hidden {
    text-align: center;
    color: #777;
    font-size: 16px;
    margin-bottom: 20px;
}


/* ---------- Кнопка показать ---------- */

.crocodile-show-task-button {
    display: block;
    margin: 0 auto;
}


/* ---------- Карточка задания ---------- */

.crocodile-task {
    min-height: 190px;
    padding: 30px;
    box-sizing: border-box;

    align-items: center;
    justify-content: center;
    text-align: center;

    border-radius: 28px;

    background:
            radial-gradient(
                    circle at top left,
                    rgba(255, 255, 255, 0.95),
                    rgba(238, 240, 255, 0.95)
            );

    border: 3px solid rgba(102, 126, 234, 0.15);

    box-shadow:
            0 20px 50px rgba(74, 78, 150, 0.16),
            inset 0 1px 0 rgba(255, 255, 255, 0.8);

    color: #25264a;

    font-weight: 900;

    animation:
            crocodileTaskAppear 0.45s cubic-bezier(.2,.8,.2,1);
}


/* Одно слово */

.crocodile-task-short {
    font-size: 48px;
    letter-spacing: 1px;
}


/* Словосочетание */

.crocodile-task-medium {
    font-size: 34px;
    line-height: 1.25;
}


/* Длинное предложение */

.crocodile-task-long {
    font-size: 25px;
    line-height: 1.4;
}


/* ---------- Игровые кнопки ---------- */

.crocodile-game-actions {
    display: flex;
    gap: 14px;
    margin-top: 22px;
}

.crocodile-game-actions button {
    flex: 1;
    min-height: 58px;
    border: none;
    border-radius: 18px;

    font-size: 17px;
    font-weight: 800;

    cursor: pointer;

    transition:
            transform 0.15s ease,
            box-shadow 0.15s ease;
}

.crocodile-game-actions button:hover {
    transform: translateY(-2px);
}

.crocodile-game-actions button:active {
    transform: translateY(1px);
}

.crocodile-guessed-button {
    background: linear-gradient(135deg, #43d17b, #27ae60);
    color: white;

    box-shadow:
            0 10px 25px rgba(39, 174, 96, 0.25);
}

.crocodile-skip-button {
    background: #f0f1f7;
    color: #555;

    box-shadow:
            0 8px 20px rgba(50, 50, 80, 0.08);
}


/* ---------- Финал ---------- */

.crocodile-results {
    animation: crocodileFadeIn 0.6s ease;
}

.crocodile-winner {
    position: relative;
    overflow: hidden;

    margin-bottom: 28px;
    padding: 35px 25px;

    text-align: center;

    border-radius: 30px;

    background:
            linear-gradient(
                    135deg,
                    #fff8d8,
                    #fff1a8
            );

    border: 3px solid #f4d35e;

    box-shadow:
            0 20px 50px rgba(180, 145, 30, 0.22);
}

.crocodile-winner-title {
    font-size: 20px;
    font-weight: 800;
    color: #8b6b00;
    margin-bottom: 10px;
}

.crocodile-winner-name {
    font-size: 38px;
    font-weight: 900;
    color: #5d4700;
}

.crocodile-winner-score {
    margin-top: 8px;
    font-size: 22px;
    font-weight: 800;
    color: #806500;
}


/* ---------- Заголовок результатов ---------- */

.crocodile-scoreboard-title {
    margin: 10px 0 14px;

    font-size: 20px;
    font-weight: 800;
}


/* ---------- Строки игроков ---------- */

.crocodile-score-row {
    display: grid;
    grid-template-columns: 42px 1fr auto;
    align-items: center;

    gap: 12px;

    margin-bottom: 10px;
    padding: 16px 18px;

    border-radius: 18px;

    background: #f7f8ff;

    box-shadow:
            0 5px 15px rgba(60, 65, 120, 0.06);

    animation: crocodileScoreAppear 0.35s ease both;
}

.crocodile-score-place {
    font-weight: 900;
    color: #667eea;
}

.crocodile-score-name {
    font-weight: 750;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crocodile-score-value {
    font-weight: 900;
    color: #667eea;
}


/* ---------- Сообщение сохранения ---------- */

.crocodile-save-message {
    margin-top: 18px;
    text-align: center;

    font-weight: 700;
    color: #667eea;
}


/* ---------- Анимации ---------- */

@keyframes crocodileFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


@keyframes crocodileTaskAppear {
    from {
        opacity: 0;
        transform: scale(0.88) rotate(-1deg);
    }

    to {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}


@keyframes crocodileScoreAppear {
    from {
        opacity: 0;
        transform: translateX(-15px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}


/* ---------- Телефон ---------- */

@media (max-width: 600px) {

    .crocodile-task {
        min-height: 160px;
        padding: 22px;
    }

    .crocodile-task-short {
        font-size: 38px;
    }

    .crocodile-task-medium {
        font-size: 27px;
    }

    .crocodile-task-long {
        font-size: 21px;
    }

    .crocodile-game-actions {
        flex-direction: column;
    }

    .crocodile-winner-name {
        font-size: 30px;
    }
}

/* =========================================================
   🎉 САЛЮТ КРОКОДИЛА
   ========================================================= */

.crocodile-confetti {
    position: fixed;

    top: -20px;

    width: 10px;
    height: 18px;

    z-index: 99999;

    pointer-events: none;

    border-radius: 2px;

    animation-name: crocodileConfettiFall;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}


@keyframes crocodileConfettiFall {

    0% {
        opacity: 1;
        transform:
                translateY(0)
                rotate(0deg);
    }

    25% {
        transform:
                translateY(25vh)
                translateX(20px)
                rotate(180deg);
    }

    60% {
        transform:
                translateY(65vh)
                translateX(-30px)
                rotate(420deg);
    }

    100% {
        opacity: 0;
        transform:
                translateY(110vh)
                translateX(40px)
                rotate(720deg);
    }
}

/* =========================================================
   🐊 КРОКОДИЛ — стартовая кнопка
   ========================================================= */

.crocodile-setup {
    min-height: 280px;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    text-align: center;
}


/* Иконка игры */

.crocodile-setup > div:first-child {
    font-size: 54px;
    margin-bottom: 14px;
}


/* Большая кнопка */

.crocodile-start-button {
    display: flex;
    align-items: center;
    justify-content: center;

    min-width: 250px;
    min-height: 72px;

    padding: 16px 34px;

    margin: 20px auto 0;

    border: none;
    border-radius: 22px;

    background: linear-gradient(
            135deg,
            #667eea,
            #764ba2
    );

    color: white;

    font-size: 21px;
    font-weight: 800;

    cursor: pointer;

    box-shadow:
            0 12px 28px rgba(102, 126, 234, 0.30);

    transition:
            transform 0.18s ease,
            box-shadow 0.18s ease;
}


.crocodile-start-button:hover {
    transform: translateY(-3px);

    box-shadow:
            0 16px 34px rgba(102, 126, 234, 0.38);
}


.crocodile-start-button:active {
    transform: translateY(1px);
}



/* Телефон */

/* =========================
   MEMORY GAME — MOBILE
   ========================= */

@media (max-width: 600px) {

    .memory-game {
        width: 100%;
        margin-top: 15px;
    }

    .memory-game-board {
        width: 100%;
        max-width: 360px;

        grid-template-columns: repeat(3, minmax(0, 1fr));

        gap: 8px;

        padding: 0 10px;
        box-sizing: border-box;
    }

    .memory-card {
        width: 100%;
        aspect-ratio: 1 / 1;
        height: auto;

        min-width: 0;
    }

    .memory-card-front {
        font-size: 28px;
    }

    .memory-card-front,
    .memory-card-back {
        border-radius: 10px;
    }

    .memory-game-result {
        padding: 0 15px;
        font-size: 16px;
    }
}

.site-header-brand-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pixel-console {
    display: block;
    width: 47px;
    height: 65px;
    object-fit: cover;
    image-rendering: pixelated;
}

.mini-games-header-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 10px;
    text-decoration: none;
    transition: transform 0.2s ease, background 0.2s ease;
}

.mini-games-header-link:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
}
       /* Страница мини-игр */

   .mini-games-page {
       width: min(1100px, calc(100% - 32px));
       margin: 40px auto;
   }

.mini-games-hero {
    text-align: center;
    margin-bottom: 35px;
}

.mini-games-hero h1 {
    margin-bottom: 10px;
}

.mini-games-hero p {
    opacity: 0.8;
}

.mini-games-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    align-items: stretch;
}

.mini-game-card {
    display: flex;
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 22px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 8px 24px rgba(50, 50, 100, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mini-game-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(50, 50, 100, 0.14);
}

.mini-game-card-content {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
}

.mini-game-card h2 {
    margin: 0 0 12px;
    overflow-wrap: anywhere;
}

.mini-game-description {
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.mini-game-type {
    margin-top: auto;
    padding-top: 12px;
    opacity: 0.7;
    font-size: 0.9rem;
}

.mini-game-toggle {
    align-self: center;
    margin-top: 20px;
    cursor: pointer;
}

.mini-game-details {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e5e5f5;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.mini-game-details[hidden] {
    display: none;
}

.mini-game-start {
    margin-top: 12px;
    cursor: pointer;
}

.mini-games-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 45px 20px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.8);
}

.mini-games-empty-icon {
    font-size: 42px;
}

.mini-games-back {
    display: flex;
    justify-content: center;
    margin-top: 35px;
}

.mini-game-card {
    background: #ffffff;
    color: #292447;
    border: 1px solid rgba(102, 126, 234, 0.2);
    box-shadow: 0 8px 24px rgba(35, 25, 80, 0.12);
}
.mini-game-card h2,
.mini-game-card h3,
.mini-game-card p,
.mini-game-card .mini-game-type,
.mini-game-card .mini-game-description { color: #292447;
} .mini-game-card .button {
      background: #667eea;
      color: #ffffff;
      border: none;
  }
.mini-game-card .button:hover {
    background: #5368d5;
}
.mini-game-details {
    color: #292447;
    border-top-color: rgba(102, 126, 234, 0.15);
}
.mini-game-details p,
.mini-game-details label { color: #292447;
}
       /* Каталог мини-игр */
.mini-games-grid {
       align-items: start;
   }

.mini-game-card {
    position: relative;
    background: #fff;
    color: #292447;
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 20px;
    transition: box-shadow 0.25s ease;
}

.mini-game-card h2,
.mini-game-card p {
    color: #292447;
}

/* Открытая игра занимает центральную область */
.mini-games-grid.mini-game-open {
    display: flex;
    justify-content: center;
}

.mini-games-grid.mini-game-open .mini-game-card:not(.is-expanded) {
    display: none;
}

.mini-games-grid.mini-game-open .mini-game-card.is-expanded {
    width: 100%;
    max-width: 850px;
}

/* Контейнер подробностей */
.mini-game-details {
    position: relative;
    margin-top: 20px;
    padding: 28px 12px 12px;
    border-top: 1px solid #e7e5f5;
    color: #292447;
}

/* Стрелка в углу */
.mini-game-collapse {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 36px;
    height: 32px;
    border: 0;
    border-radius: 10px;
    background: #f0efff;
    color: #5146a5;
    font-size: 24px;
    cursor: pointer;
}

.mini-game-collapse:hover {
    background: #e2dfff;
}

.mini-game-card .button {
    background: #667eea;
    color: #fff;
}

.mini-game-card .button:hover {
    background: #5368d5;
}
/* Мини-игровая: обновлённый дизайн карточек */
.mini-games-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 20px 48px;
}

.mini-games-hero {
    text-align: center;
    margin-bottom: 32px;
}

.mini-games-hero h1 {
    margin-bottom: 10px;
    font-size: clamp(2rem, 5vw, 3rem);
    letter-spacing: -0.04em;
}

.mini-games-hero p {
    color: white;
    font-size: 1.05rem;
}

.mini-games-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    align-items: start;
}

.mini-game-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(118, 75, 162, 0.13);
    border-radius: 24px;
    background: linear-gradient(145deg, #ffffff, #f8f7ff);
    box-shadow: 0 8px 24px rgba(45, 35, 85, 0.08);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.mini-game-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px rgba(45, 35, 85, 0.14);
}

.mini-game-card.is-expanded {
    grid-column: 1 / -1;
    border-color: rgba(102, 126, 234, 0.4);
    box-shadow: 0 18px 44px rgba(74, 64, 150, 0.14);
}

.mini-game-card-content {
    padding: 26px;
}

.mini-game-card h2 {
    margin: 0 0 12px;
    color: #292447;
    font-size: 1.35rem;
    line-height: 1.35;
}

.mini-game-description {
    color: #6b7280;
    line-height: 1.65;
    margin-bottom: 22px;
}

.mini-game-toggle {
    margin-top: 8px;
    min-width: 140px;
}

.mini-game-details {
    position: relative;
    margin-top: 20px;
    padding-top: 24px;
    border-top: 1px solid #ece9f7;
    animation: miniGameReveal 0.25s ease;
}

.mini-game-details[hidden] {
    display: none;
}

.mini-game-details > p {
    color: #5b5870;
    line-height: 1.7;
}

.mini-game-collapse {
    position: absolute;
    top: 10px;
    right: 0;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: #f0edff;
    color: #6652b8;
    font-size: 1.3rem;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.mini-game-collapse:hover {
    background: #e5dfff;
    transform: translateY(-2px);
}

.standalone-mini-game-content {
    margin-top: 20px;
}

.mini-games-completed {
    padding: 22px;
    border: 1px solid #d9f0e1;
    border-radius: 16px;
    background: #f0fbf4;
    color: #247747;
    font-weight: 700;
    text-align: center;
}

.mini-games-empty {
    grid-column: 1 / -1;
    padding: 48px 24px;
    border: 1px dashed #d8d2ef;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.7);
    text-align: center;
}

.mini-games-empty-icon {
    display: block;
    margin-bottom: 12px;
    font-size: 3rem;
}

.mini-games-back {
    margin-top: 32px;
    text-align: center;
}


/* ===== MINI GAMES: PIXEL ART DESIGN ===== */

.mini-games-page {
    position: relative;
    isolation: isolate;
    width: min(1200px, calc(100% - 40px));
    margin: 0 auto;
    padding: 54px 0 70px;
}

.mini-games-hero {
    position: relative;
    text-align: center;
    margin: 0 auto 38px;
    color: #fff;
}

.mini-games-hero h1 {
    margin: 0 0 12px;
    font-size: clamp(2.3rem, 5vw, 4rem);
    font-weight: 850;
    letter-spacing: -1.5px;
    text-shadow: 0 5px 0 rgba(68, 35, 150, 0.28);
}

.mini-games-hero p {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.08rem;
}

.mini-games-hero-console {
    position: absolute;
    top: -20px;
    left: calc(50% - 390px);
    transform: rotate(-9deg);
    animation: pixel-console-float 3.5s ease-in-out infinite;
}

.mini-games-hero-console img {
    display: block;
    width: 112px;
    height: 112px;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 8px 0 rgba(47, 24, 113, 0.2));
}

.mini-games-hero-sparkles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.pixel-star {
    position: absolute;
    color: #ffe878;
    font-size: 28px;
    text-shadow: 2px 2px 0 #b58aef;
    animation: pixel-twinkle 2.2s ease-in-out infinite;
}

.pixel-star-one {
    top: 8px;
    left: 16%;
}

.pixel-star-two {
    top: 36px;
    right: 19%;
    color: #ffc6fa;
    animation-delay: 0.5s;
}

.pixel-star-three {
    top: 74px;
    left: 24%;
    color: #b8f5ff;
    animation-delay: 1s;
}

.mini-games-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    align-items: stretch;
}

.mini-game-card {
    min-width: 0;
    border: 2px solid rgba(139, 92, 246, 0.75);
    border-radius: 26px;
    background: linear-gradient(145deg, #fff 0%, #f8f5ff 100%);
    box-shadow:
            0 7px 0 rgba(71, 35, 153, 0.25),
            0 15px 32px rgba(42, 24, 102, 0.17);
    transition:
            transform 180ms ease,
            box-shadow 180ms ease,
            border-color 180ms ease;
}

.mini-game-card:not(.is-expanded):hover {
    transform: translateY(-7px);
    border-color: #f1baff;
    box-shadow:
            0 10px 0 rgba(71, 35, 153, 0.23),
            0 23px 38px rgba(42, 24, 102, 0.22);
}

.mini-game-card-content {
    position: relative;
    display: flex;
    min-height: 340px;
    height: 100%;
    box-sizing: border-box;
    flex-direction: column;
    align-items: center;
    padding: 25px 22px 28px;
    text-align: center;
}

.mini-game-art {
    display: flex;
    min-height: 118px;
    width: 100%;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.mini-game-art-word,
.mini-game-art-memory {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.mini-game-art-word span {
    display: grid;
    width: 58px;
    height: 66px;
    place-items: center;
    border: 3px solid #5a39c7;
    border-radius: 12px;
    background: #ffd75e;
    color: #392078;
    font-size: 2rem;
    font-weight: 900;
    box-shadow: 0 5px 0 #ad83f5;
    transform: rotate(-9deg);
}

.mini-game-art-word span:nth-child(2) {
    background: #f4b8f7;
    transform: translateY(-7px) rotate(5deg);
}

.mini-game-art-word span:nth-child(3) {
    background: #8fe8ff;
    transform: rotate(12deg);
}

.mini-game-art-memory span {
    display: grid;
    width: 68px;
    height: 84px;
    place-items: center;
    border: 3px solid #6841d8;
    border-radius: 12px;
    background: #f5c4ff;
    color: #7138d2;
    font-size: 2.8rem;
    box-shadow: 0 5px 0 #b29af4;
    transform: rotate(-9deg);
}

.mini-game-art-memory span:nth-child(2) {
    background: #e3e9ff;
    color: #ffbf48;
    transform: translateY(4px) rotate(10deg);
}

.mini-game-art-crocodile,
.mini-game-art-default {
    font-size: 5rem;
    line-height: 1;
    filter: drop-shadow(0 5px 0 rgba(111, 75, 202, 0.2));
}

.mini-game-card h2 {
    margin: 0 0 20px;
    color: #302071;
    font-size: 1.4rem;
    font-weight: 1000;
}

.mini-game-description {
    max-width: 260px;
    min-height: 48px;
    margin: 0 0 22px;
    color: #7569a9;
    line-height: 1.5;
}

.mini-game-toggle,
.mini-game-next {
    margin-top: auto;
    min-width: 176px;
    padding: 14px 24px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #8351ff, #6336e8);
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    box-shadow: 0 5px 0 #4320b1;
    cursor: pointer;
    transition: transform 160ms ease, filter 160ms ease;
}

.mini-game-toggle:hover,
.mini-game-next:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

.mini-game-toggle:active,
.mini-game-next:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #4320b1;
}



@keyframes pixel-console-float {
    0%, 100% { transform: translateY(0) rotate(-9deg); }
    50% { transform: translateY(-8px) rotate(-5deg); }
}

@keyframes pixel-twinkle {
    0%, 100% { opacity: 0.65; }
    50% { opacity: 1; }
}


/* ===== EXPANDED MINI-GAME WINDOW ===== */

.mini-games-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(35, 20, 86, 0.72);
    backdrop-filter: blur(7px);
}

.mini-games-backdrop[hidden] {
    display: none;
}

.mini-game-card.is-expanded {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 1001;
    width: min(900px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    box-sizing: border-box;
    transform: translate(-50%, -50%);
    border: 3px solid #c5a7ff;
    border-radius: 26px;
    background: linear-gradient(145deg, #ffffff, #f4efff);
    box-shadow:
            0 0 0 5px rgba(210, 188, 255, 0.25),
            0 25px 80px rgba(20, 10, 60, 0.45);
}

.mini-game-card.is-expanded .mini-game-card-content {
    min-height: 0;
    height: auto;
    padding: 30px;
}

.mini-game-card.is-expanded .mini-game-art {
    min-height: 90px;
}

.mini-game-collapse {
    align-self: flex-end;
    position: absolute;
    top: 0;
    z-index: 2;
    width: 42px;
    height: 42px;
    margin: -12px -12px 8px auto;
    border: 2px solid #d8c8ff;
    border-radius: 12px;
    background: #f0e8ff;
    color: #5934bd;
    font-size: 24px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 3px 0 #c4a9ff;
}

.mini-game-collapse:hover {
    background: #e4d5ff;
}

.mini-game-details {
    width: 100%;
    box-sizing: border-box;
}

.mini-game-details[hidden] {
    display: none;
}

body.mini-game-modal-open {
    overflow: hidden;
}



/* ===== MINI-GAMES: PIXEL CLOUDS ===== */

.mini-games-page {
    position: relative;
    isolation: isolate;
    overflow: visible;
}

/* Общие стили для обоих облаков */
.mini-games-page::before,
.mini-games-page::after {
    content: "";
    position: fixed;
    z-index: 0;
    bottom: 0;
    width: 500px;
    height: 430px;
    pointer-events: none;
    opacity: 1;
    image-rendering: pixelated;
}

/* ЛЕВОЕ ОБЛАКО */
.mini-games-page::before {
    left: 0;
    background-image:
        /* --- Вертикальная линия (вверх по левому краю) --- */
            radial-gradient(circle at 0px 450px, #b99af7 0 140px, transparent 141px),
            radial-gradient(circle at 0px 350px, #b99af7 0 130px, transparent 131px),
            radial-gradient(circle at 0px 250px, #b99af7 0 120px, transparent 121px),
            radial-gradient(circle at 0px 150px, #b99af7 0 110px, transparent 111px),

                /* --- Горизонтальная линия (вправо по низу) --- */
            radial-gradient(circle at 100px 300px, #b99af7 0 130px, transparent 131px),
            radial-gradient(circle at 180px 450px, #b99af7 0 120px, transparent 121px),
            radial-gradient(circle at 250px 400px, #b99af7 0 110px, transparent 111px),
            radial-gradient(circle at 400px 400px, #b99af7 0 100px, transparent 101px),

                /* --- Заполнение внутреннего угла --- */
            radial-gradient(circle at 70px 70px, #b99af7 0 90px, transparent 91px),
            radial-gradient(circle at 150px 150px, #b99af7 0 80px, transparent 81px),

                /* --- НОВЫЕ 2 КРУГА (наложение по вашему рисунку) --- */
                /* Круг 1: Ниже и левее, создает "пухлость" в углу */
            radial-gradient(circle at 0px 450px, #b99af7 0 160px, transparent 161px),

            radial-gradient(circle at 100px 250px, #b99af7 0 100px, transparent 101px),

                /* --- Блики для объема --- */
            radial-gradient(circle at 30px 120px, #e5d7ff 0 35px, transparent 36px),
            radial-gradient(circle at 30px 320px, #e5d7ff 0 35px, transparent 36px),
            radial-gradient(circle at 250px 380px, #e5d7ff 0 35px, transparent 36px);
    background-repeat: no-repeat;
}

/* ПРАВОЕ ОБЛАКО */
.mini-games-page::after {
    right: 0;
    background-image:
        /* --- Вертикальная линия --- */
            radial-gradient(circle at 0px 450px, #b99af7 0 140px, transparent 141px),
            radial-gradient(circle at 0px 350px, #b99af7 0 130px, transparent 131px),
            radial-gradient(circle at 0px 250px, #b99af7 0 120px, transparent 121px),
            radial-gradient(circle at 0px 150px, #b99af7 0 110px, transparent 111px),

                /* --- Горизонтальная линия --- */
            radial-gradient(circle at 100px 300px, #b99af7 0 130px, transparent 131px),
            radial-gradient(circle at 180px 450px, #b99af7 0 120px, transparent 121px),
            radial-gradient(circle at 250px 400px, #b99af7 0 110px, transparent 111px),
            radial-gradient(circle at 400px 400px, #b99af7 0 100px, transparent 101px),

                /* --- Заполнение внутреннего угла --- */
            radial-gradient(circle at 70px 70px, #b99af7 0 90px, transparent 91px),
            radial-gradient(circle at 150px 150px, #b99af7 0 80px, transparent 81px),

                /* --- НОВЫЕ 2 КРУГА (наложение по вашему рисунку) --- */
            radial-gradient(circle at 0px 450px, #b99af7 0 160px, transparent 161px),
            radial-gradient(circle at 100px 250px, #b99af7 0 100px, transparent 101px),

                /* --- Блики для объема --- */
            radial-gradient(circle at 30px 120px, #e5d7ff 0 35px, transparent 36px),
            radial-gradient(circle at 30px 320px, #e5d7ff 0 35px, transparent 36px),
            radial-gradient(circle at 250px 380px, #e5d7ff 0 35px, transparent 36px);
    background-repeat: no-repeat;
    transform: scaleX(-1);
}

/* Контент страницы выше облаков */
.mini-games-page > * {
    position: relative;
    z-index: 1;
}

/* Адаптив для телефонов */
@media (max-width: 600px) {
    .mini-games-page::before,
    .mini-games-page::after {
        width: 280px;
        height: 280px;
        opacity: 0.8;
        transform: scale(0.7);
        transform-origin: bottom left;
    }

    .mini-games-page::after {
        transform: scale(0.7) scaleX(-1);
        transform-origin: bottom right;
    }
}




/* ===== CARD ENTRANCE ===== */

@keyframes mini-game-card-appear {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mini-game-card:not(.is-expanded) {
    animation: mini-game-card-appear 450ms ease both;
}

.mini-game-card:nth-child(2) {
    animation-delay: 80ms;
}

.mini-game-card:nth-child(3) {
    animation-delay: 160ms;
}


/* ===== MINI-GAME PLAY AREA ===== */

.standalone-mini-game-content {
    width: 100%;
    box-sizing: border-box;
    margin-top: 20px;
    padding: 24px;
    border: 2px solid #d8c5ff;
    border-radius: 22px;
    background:
            radial-gradient(
                    circle at 10px 10px,
                    rgba(153, 120, 255, 0.08) 2px,
                    transparent 2.5px
            ),
            linear-gradient(145deg, #faf7ff, #f0ebff);
    background-size: 20px 20px, auto;
    box-shadow: inset 0 2px 10px rgba(95, 60, 180, 0.06);
}

.standalone-mini-game-content:empty {
    display: none;
}

.standalone-mini-game-content .mini-game-inline,
.standalone-mini-game-content [data-memory-game],
.standalone-mini-game-content [data-crocodile-game] {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
}

.standalone-mini-game-content .word-game-task {
    margin: 0 0 22px;
    color: #382273;
    font-size: clamp(1.15rem, 3vw, 1.5rem);
    font-weight: 800;
    line-height: 1.5;
    text-align: center;
}

.standalone-mini-game-content .word-game-answer,
.standalone-mini-game-content .word-game-letters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 9px;
    min-height: 48px;
    margin: 14px 0;
}

.standalone-mini-game-content .word-game-letter,
.standalone-mini-game-content .word-game-selected-letter {
    min-width: 44px;
    min-height: 48px;
    padding: 8px;
    border: 2px solid #8b6ce3;
    border-radius: 10px;
    background: #fff;
    color: #492b9c;
    font-size: 1.2rem;
    font-weight: 800;
    box-shadow: 0 4px 0 #c4b0f5;
    cursor: pointer;
    transition: transform 140ms ease, background 140ms ease;
}

.standalone-mini-game-content .word-game-letter:hover,
.standalone-mini-game-content .word-game-selected-letter:hover {
    transform: translateY(-3px);
    background: #f0e9ff;
}

.standalone-mini-game-content .word-game-letter:disabled {
    opacity: 0.4;
    cursor: default;
    transform: none;
}

.standalone-mini-game-content .word-game-check {
    display: block;
    margin: 20px auto 0;
    padding: 13px 28px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #8556f6, #6035df);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 4px 0 #4623b2;
    cursor: pointer;
}

.standalone-mini-game-content .word-game-result {
    min-height: 28px;
    margin-top: 18px;
    font-weight: 800;
    text-align: center;
}

.standalone-mini-game-content .word-game-result.success {
    color: #16845d;
}

.standalone-mini-game-content .word-game-result.error {
    color: #c24167;
}

.mini-game-details > p {
    color: #6e6196;
    line-height: 1.6;
}

.mini-game-next {
    margin: 18px auto 0;
}

.mini-game-next[hidden] {
    display: none;
}

.mini-games-completed {
    padding: 24px 12px;
    color: #4d318c;
    font-size: 1.2rem;
    font-weight: 800;
    text-align: center;
}


/* Исправление отображения кнопки «Играть ещё» */
.mini-game-details .mini-game-next {
    position: relative;
    z-index: 5;
    display: block;
    visibility: visible;
    opacity: 1;
    margin: 18px auto 8px;
}

.mini-game-details .mini-game-next[hidden] {
    display: none !important;
}


/* ===== PIXEL BUTTONS INSIDE MINI-GAMES ===== */

.standalone-mini-game-content button {
    font-family: inherit;
    font-weight: 800;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 150ms ease, filter 150ms ease, box-shadow 150ms ease;
}

.standalone-mini-game-content button:not(:disabled):hover {
    filter: brightness(1.06);
    transform: translateY(-2px);
}

.standalone-mini-game-content button:not(:disabled):active {
    transform: translateY(2px);
}

.standalone-mini-game-content button:focus-visible,
.mini-game-next:focus-visible,
.mini-game-collapse:focus-visible {
    outline: 3px solid #ffcf5c;
    outline-offset: 4px;
}

.standalone-mini-game-content button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.mini-game-details .mini-game-next {
    border-radius: 12px;
    box-shadow: 0 4px 0 #4320b1;
}


/* ===== PIXEL MEMORY CARDS ===== */

.standalone-mini-game-content [data-memory-game] {
    text-align: center;
}

.standalone-mini-game-content [data-memory-game] button {
    border: 2px solid #8b6ce3;
    border-radius: 12px;
    background: linear-gradient(145deg, #ffffff, #eee7ff);
    color: #5634b5;
    box-shadow: 0 4px 0 #c3adf5;
}

.standalone-mini-game-content [data-memory-game] button:not(:disabled):hover {
    background: #e8ddff;
    box-shadow: 0 6px 0 #b29af0;
}

.standalone-mini-game-content [data-memory-game] button:active {
    box-shadow: 0 2px 0 #b29af0;
}

.standalone-mini-game-content [data-memory-game] button:disabled {
    opacity: 0.85;
}

/* Игровое поле */
.standalone-mini-game-content [data-memory-game] .memory-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    max-width: 480px;
    margin: 22px auto;
}


/* Компактнее расположение элементов в открытой игре */
.mini-game-card.is-expanded .mini-game-card-content {
    padding-top: 22px;
}

.mini-game-card.is-expanded .mini-game-art {
    min-height: 72px;
    margin-bottom: 6px;
}

.mini-game-card.is-expanded .mini-game-details > p {
    margin-top: 8px;
    margin-bottom: 14px;
}

.mini-game-card.is-expanded .mini-game-next {
    margin-top: 12px;
    margin-bottom: 12px;
}

.mini-game-card.is-expanded .standalone-mini-game-content {
    margin-top: 12px;
}


/* ===== MEMORY GAME: PIXEL CARD STYLE ===== */

/* Игровое поле */
.standalone-mini-game-content .memory-game-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 116px));
    justify-content: center;
    gap: 12px;
    width: 100%;
    max-width: 480px;
    margin: 22px auto;
}

/* Карточка */
.standalone-mini-game-content .memory-game-board .memory-card {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 1 / 1;
    min-width: 0;
    padding: 8px;
    overflow: hidden;
    border: 2px solid #c7b0ff;
    border-radius: 13px;
    background: linear-gradient(145deg, #ffffff, #eee7ff);
    box-shadow: 0 5px 0 #c1a8f5;
    cursor: pointer;
    transition:
            transform 150ms ease,
            box-shadow 150ms ease,
            border-color 150ms ease,
            background 150ms ease;
}

/* Наведение */
.standalone-mini-game-content .memory-game-board .memory-card:hover {
    transform: translateY(-3px);
    border-color: #8960e8;
    box-shadow: 0 8px 0 #b49aef;
}

/* Нажатие */
.standalone-mini-game-content .memory-game-board .memory-card:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #b49aef;
}

/* Открытая карточка */
.standalone-mini-game-content .memory-game-board .memory-card.flipped {
    border-color: #8a63e8;
    background: #ffffff;
    box-shadow: 0 4px 0 #c4adf6;
}

/* Найденная пара */
.standalone-mini-game-content .memory-game-board .memory-card.matched {
    border-color: #68cba3;
    background: linear-gradient(145deg, #effff7, #d7f8e9);
    box-shadow: 0 4px 0 #8bd9b7;
    cursor: default;
}

/* Картинка внутри карточки */
.standalone-mini-game-content .memory-game-board .memory-card img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Результат игры */
.standalone-mini-game-content .memory-game-result {
    min-height: 28px;
    margin: 18px auto;
    color: #493087;
    font-weight: 800;
    text-align: center;
}

.standalone-mini-game-content .memory-game-result.success {
    color: #16845d;
}

.standalone-mini-game-content .memory-game-result.error {
    color: #c24167;
}


/* ===== WORD GAME: PIXEL LETTER TILES ===== */

.standalone-mini-game-content .mini-game-inline[data-word-game] {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 22px;
    box-sizing: border-box;
    color: #382273;
    background: #f8f2ff;
    border: 3px solid #6040a8;
    border-radius: 8px;
    box-shadow: 6px 6px 0 #d6c5f5;
}

.standalone-mini-game-content .word-game-task {
    margin: 0 0 22px;
    color: #382273;
    font-size: 1.25rem;
    font-weight: 850;
    line-height: 1.5;
    text-align: center;
}

/* Поле собранного слова */
.standalone-mini-game-content .word-game-answer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 66px;
    margin: 18px 0;
    padding: 12px;
    box-sizing: border-box;
    border: 3px dashed #a58add;
    border-radius: 6px;
    background: #fff;
}

/* Перемешанные буквы */
.standalone-mini-game-content .word-game-letters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 24px 0;
}

.standalone-mini-game-content .word-game-letter,
.standalone-mini-game-content .word-game-selected-letter {
    display: inline-grid;
    place-items: center;
    min-width: 48px;
    min-height: 52px;
    padding: 8px 12px;
    box-sizing: border-box;
    border: 3px solid #6848b2;
    border-radius: 5px;
    background: #ffe58a;
    color: #392078;
    font-size: 1.25rem;
    font-weight: 900;
    box-shadow: 4px 4px 0 #c0a6ed;
    cursor: pointer;
    transition: transform 150ms ease, box-shadow 150ms ease;
}

.standalone-mini-game-content .word-game-letters
.word-game-letter:nth-child(3n + 2) {
    background: #f5c9f3;
}

.standalone-mini-game-content .word-game-letters
.word-game-letter:nth-child(3n) {
    background: #bcefff;
}

.standalone-mini-game-content .word-game-letter:not(:disabled):hover,
.standalone-mini-game-content .word-game-selected-letter:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #a58add;
}

.standalone-mini-game-content .word-game-letter:active,
.standalone-mini-game-content .word-game-selected-letter:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #a58add;
}

.standalone-mini-game-content .word-game-letter:disabled {
    opacity: 0.4;
    cursor: default;
    box-shadow: none;
}

/* Проверка ответа */
.standalone-mini-game-content .word-game-check {
    display: block;
    min-width: 170px;
    margin: 22px auto 0;
    padding: 13px 24px;
    border: 3px solid #45238e;
    border-radius: 5px;
    background: #8053e8;
    color: #fff;
    font-weight: 850;
    box-shadow: 4px 4px 0 #45238e;
    cursor: pointer;
    transition: transform 150ms ease, box-shadow 150ms ease;
}

.standalone-mini-game-content .word-game-check:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #45238e;
}

.standalone-mini-game-content .word-game-check:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #45238e;
}

.standalone-mini-game-content .word-game-result {
    min-height: 28px;
    margin: 18px 0 0;
    font-weight: 850;
    text-align: center;
}

.standalone-mini-game-content .word-game-result.success {
    color: #16845d;
}

.standalone-mini-game-content .word-game-result.error {
    color: #c24167;
}


/* ===== WORD GAME: PIXEL RESULT MESSAGES ===== */

.standalone-mini-game-content .word-game-result {
    min-height: 24px;
    margin: 22px auto 0;
    padding: 12px 16px;
    box-sizing: border-box;
    border: 2px solid transparent;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 850;
    line-height: 1.5;
    text-align: center;
    overflow-wrap: anywhere;
}

/* Правильный ответ */
.standalone-mini-game-content .word-game-result.success {
    color: #126b4b;
    background: #d9ffeb;
    border-color: #35ae7b;
    box-shadow: 3px 3px 0 #9cddbd;
}

/* Неправильный ответ */
.standalone-mini-game-content .word-game-result.error {
    color: #a52e52;
    background: #ffe2eb;
    border-color: #e77b9a;
    box-shadow: 3px 3px 0 #f3b7ca;
}

/* Кнопка после завершения игры */
.standalone-mini-game-content .word-game-check {
    font-size: 1rem;
    letter-spacing: 0.2px;
}

.standalone-mini-game-content .word-game-check:disabled {
    opacity: 0.65;
    cursor: default;
    transform: none;
}


/* ===== MEMORY GAME: PIXEL CARDS ===== */

.standalone-mini-game-content .memory-game-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 116px));
    justify-content: center;
    gap: 12px;
    width: 100%;
    margin: 24px auto;
}

.standalone-mini-game-content .memory-game-board .memory-card {
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 100px;
    padding: 10px;
    border: 3px solid #6848b2;
    border-radius: 5px;
    background: #e8dcff;
    color: #392078;
    font-size: 2rem;
    box-shadow: 4px 4px 0 #c0a6ed;
    cursor: pointer;
    transition: transform 150ms ease, box-shadow 150ms ease;
}

.standalone-mini-game-content .memory-game-board .memory-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #a58add;
}

.standalone-mini-game-content .memory-game-board .memory-card.flipped {
    background: #ffe58a;
}

.standalone-mini-game-content .memory-game-board .memory-card.matched {
    border-color: #35ae7b;
    background: #d9ffeb;
    box-shadow: 3px 3px 0 #9cddbd;
    cursor: default;
}


/* ===== CROCODILE: PIXEL GAME STYLE ===== */

.standalone-mini-game-content .crocodile-game {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 22px;
    box-sizing: border-box;
    color: #382273;
    background: #f8f2ff;
    border: 3px solid #6040a8;
    border-radius: 8px;
    box-shadow: 6px 6px 0 #d6c5f5;
}

/* Описание и заголовки */
.standalone-mini-game-content .crocodile-description,
.standalone-mini-game-content .crocodile-players-setup > p {
    margin: 0 0 22px;
    color: #5a4388;
    font-weight: 700;
    line-height: 1.6;
    text-align: center;
}

.standalone-mini-game-content .crocodile-players-setup h3,
.standalone-mini-game-content .crocodile-results h3 {
    margin: 0 0 16px;
    color: #51318f;
    font-size: 1.4rem;
    text-align: center;
}

/* Настройки игры */
.standalone-mini-game-content .crocodile-setup-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 18px 0;
}

.standalone-mini-game-content .crocodile-setup-block label,
.standalone-mini-game-content .crocodile-player-input label {
    color: #51318f;
    font-weight: 800;
}

.standalone-mini-game-content .crocodile-player-count,
.standalone-mini-game-content .crocodile-difficulty,
.standalone-mini-game-content .crocodile-player-name-input {
    width: 100%;
    min-height: 48px;
    padding: 10px 12px;
    box-sizing: border-box;
    border: 2px solid #a58add;
    border-radius: 5px;
    background: #fff;
    color: #382273;
    font: inherit;
}

.standalone-mini-game-content .crocodile-player-inputs {
    display: grid;
    gap: 14px;
    margin: 20px 0;
}

.standalone-mini-game-content .crocodile-player-input {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

/* Общий вид кнопок */
.standalone-mini-game-content .crocodile-game .button {
    min-height: 46px;
    padding: 11px 18px;
    border: 3px solid #45238e;
    border-radius: 5px;
    background: #8053e8;
    color: #fff;
    font-weight: 850;
    box-shadow: 4px 4px 0 #45238e;
    cursor: pointer;
    transition: transform 150ms ease, box-shadow 150ms ease;
}

.standalone-mini-game-content .crocodile-game .button:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #45238e;
}

.standalone-mini-game-content .crocodile-game .button:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #45238e;
}

.standalone-mini-game-content .crocodile-game .secondary-button {
    border-color: #67538b;
    background: #eee6ff;
    color: #51318f;
    box-shadow: 4px 4px 0 #b9a8d9;
}

.standalone-mini-game-content .crocodile-game .secondary-button:hover {
    box-shadow: 6px 6px 0 #b9a8d9;
}

/* Кнопки первого и второго экранов */
.standalone-mini-game-content .crocodile-next-button,
.standalone-mini-game-content .crocodile-start-button {
    display: block;
    margin: 24px auto 6px;
}

/* Информация о раунде */
.standalone-mini-game-content .crocodile-round-info {
    display: grid;
    gap: 12px;
    margin-bottom: 22px;
    text-align: center;
}

.standalone-mini-game-content .crocodile-round-type {
    padding: 10px;
    border: 2px solid #bda7f3;
    border-radius: 5px;
    background: #e8dcff;
    color: #51318f;
    font-size: 1.1rem;
    font-weight: 900;
}

.standalone-mini-game-content .crocodile-player-name {
    color: #51318f;
    font-size: 1.05rem;
    font-weight: 850;
}

/* Таймер */
.standalone-mini-game-content .crocodile-timer {
    justify-self: center;
    min-width: 112px;
    padding: 10px 18px;
    border: 3px solid #45238e;
    border-radius: 5px;
    background: #fff0a8;
    color: #382273;
    font-size: 1.8rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    box-shadow: 4px 4px 0 #c9a84b;
}

/* Область задания */
.standalone-mini-game-content .crocodile-task-area {
    display: grid;
    justify-items: center;
    gap: 16px;
    margin: 20px 0;
}

.standalone-mini-game-content .crocodile-task-hidden,
.standalone-mini-game-content .crocodile-task {
    width: 100%;
    min-height: 100px;
    padding: 20px;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    border: 3px dashed #a58add;
    border-radius: 6px;
    background: #fff;
    color: #51318f;
    font-size: 1.2rem;
    font-weight: 850;
    line-height: 1.5;
    text-align: center;
    overflow-wrap: anywhere;
}

.standalone-mini-game-content .crocodile-task {
    border-style: solid;
    border-color: #e2b84b;
    background: #fff5c7;
    box-shadow: 4px 4px 0 #e2d29a;
}

.standalone-mini-game-content .crocodile-task.crocodile-task-short {
    font-size: 1.8rem;
}

.standalone-mini-game-content .crocodile-task.crocodile-task-medium {
    font-size: 1.35rem;
}

.standalone-mini-game-content .crocodile-task.crocodile-task-long {
    font-size: 1.05rem;
}

/* Кнопки хода */
.standalone-mini-game-content .crocodile-game-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    margin-top: 22px;
}

/* Результаты */
.standalone-mini-game-content .crocodile-scoreboard {
    display: grid;
    gap: 10px;
    margin: 20px 0;
}

.standalone-mini-game-content .crocodile-winner {
    padding: 18px;
    border: 3px solid #d4a72c;
    border-radius: 6px;
    background: #fff0a8;
    color: #51318f;
    text-align: center;
    box-shadow: 4px 4px 0 #e2d29a;
}

.standalone-mini-game-content .crocodile-winner-title {
    font-weight: 900;
}

.standalone-mini-game-content .crocodile-winner-name {
    margin: 10px 0;
    font-size: 1.5rem;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.standalone-mini-game-content .crocodile-winner-score {
    font-weight: 800;
}

.standalone-mini-game-content .crocodile-scoreboard-title {
    margin: 12px 0 4px;
    color: #51318f;
    font-weight: 900;
    text-align: center;
}

.standalone-mini-game-content .crocodile-score-row {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 2px solid #d6c5f5;
    border-radius: 5px;
    background: #fff;
}

.standalone-mini-game-content .crocodile-score-place,
.standalone-mini-game-content .crocodile-score-value {
    color: #51318f;
    font-weight: 900;
}

.standalone-mini-game-content .crocodile-score-name {
    min-width: 0;
    overflow-wrap: anywhere;
}

.standalone-mini-game-content .crocodile-restart-button {
    display: block;
    margin: 20px auto 6px;
}

/* Сообщение о сохранении */
.standalone-mini-game-content .crocodile-save-message {
    margin-top: 18px;
    color: #16845d;
    font-weight: 800;
    line-height: 1.5;
    text-align: center;
    overflow-wrap: anywhere;
}


/* ===== MINI GAMES: PIXEL CARD POLISH ===== */

.mini-games-page .mini-games-grid {
    gap: 24px;
}

.mini-games-page .mini-game-card {
    border: 3px solid #6040a8;
    border-radius: 8px;
    background: #fbf8ff;
    box-shadow: 5px 5px 0 #d6c5f5;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.mini-games-page .mini-game-card:not(.is-expanded):hover {
    transform: translate(-3px, -3px);
    box-shadow: 8px 8px 0 #c0a6ed;
}

.mini-games-page .mini-game-card-content {
    padding: 22px;
}

.mini-games-page .mini-game-card h2 {
    color: #51318f;
    font-weight: 900;
    line-height: 1.3;
}

.mini-games-page .mini-game-description {
    color: #6b5a88;
    line-height: 1.6;
}

/* Иллюстрации */
.mini-games-page .mini-game-art {
    border: 2px solid #bda7f3;
    border-radius: 6px;
    background: #f0e8ff;
}

/* Кнопка «Играть» */
.mini-games-page .mini-game-toggle {
    border: 3px solid #45238e;
    border-radius: 5px;
    background: #8053e8;
    color: #fff;
    font-weight: 900;
    box-shadow: 4px 4px 0 #45238e;
    transition: transform 150ms ease, box-shadow 150ms ease;
}

.mini-games-page .mini-game-toggle:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #45238e;
}

.mini-games-page .mini-game-toggle:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #45238e;
}

/* ===== MINI-GAMES: DECORATIONS AROUND CARDS ===== */

.mini-games-page {
    position: relative;
    overflow: visible;
}

.mini-games-decorations {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

.game-decor {
    position: absolute;
    display: grid;
    place-items: center;
    line-height: 1;
    user-select: none;
    filter: drop-shadow(2px 3px 0 rgba(59, 32, 130, 0.35));
}

/* ===== ЗВЁЗДЫ ===== */
.decor-star {
    color: #ffe45f;
    font-size: 44px;
    -webkit-text-stroke: 1px #f6a52e;
    text-shadow: 2px 2px 0 #a45a27;
}

/* Левая сторона: звезда сверху */
.decor-star-left {
    top: 120px;
    left: -70px;
}

/* Левая сторона: звезда снизу */
.decor-star-left-bottom {
    top: 640px;
    left: -55px;
    font-size: 34px;
}

/* Правая сторона: звезда сверху */
.decor-star-right {
    top: 140px;
    right: -70px;
    font-size: 40px;
}

/* ===== МОНЕТЫ ===== */
.decor-coin {
    width: 38px;
    height: 38px;
    border: 4px solid #ffb52e;
    border-radius: 50%;
    box-sizing: border-box;
    background: #ffd95a;
    color: #a85b16;
    font-size: 18px;
    font-weight: 950;
    box-shadow:
            inset 0 0 0 3px #fff0a3,
            2px 3px 0 #a85b9e;
}

/* Левая монета — по центру */
.decor-coin-left {
    top: 400px;
    left: -60px;
}

/* Правая монета — сверху */
.decor-coin-right-top {
    top: 320px;
    right: -75px;
}

/* Правая монета — снизу */
.decor-coin-right-bottom {
    top: 620px;
    right: -55px;
}

/* ===== СЕРДЕЧКИ ===== */
.decor-heart {
    color: #ff9be9;
    font-size: 34px;
    -webkit-text-stroke: 1px #b44dd2;
    text-shadow: 2px 3px 0 #7838a5;
}

/* Левая сторона: сердечко сверху */
.decor-heart-left-top {
    top: 260px;
    left: -45px;
    font-size: 28px;
}

/* Левая сторона: сердечко снизу */
.decor-heart-left-bottom {
    top: 520px;
    left: -75px;
    font-size: 30px;
}

/* Правая сторона: сердечко */
.decor-heart-right {
    top: 460px;
    right: -80px;
}

/* ===== ИСКОРКИ ===== */
.decor-spark {
    color: #fce7ff;
    font-size: 27px;
    text-shadow: 0 0 10px #ffcbff;
}

/* Левая сторона: искорка сверху */
.decor-spark-left {
    top: 200px;
    left: -110px;
    font-size: 22px;
}

/* Левая сторона: искорка снизу */
.decor-spark-left-bottom {
    top: 580px;
    left: -30px;
    font-size: 24px;
}

/* Правая сторона: искорка */
.decor-spark-right {
    top: 540px;
    right: -40px;
}


/* ===== АДАПТИВ ДЕКОРАЦИЙ ===== */

/* На широких экранах элементы можно отодвинуть дальше от карточек */
@media (min-width: 1600px) {
    .decor-star-left { left: -160px; }
    .decor-star-left-bottom { left: -140px; }
    .decor-star-right { right: -160px; }
    .decor-coin-left { left: -140px; }
    .decor-coin-right-top { right: -155px; }
    .decor-coin-right-bottom { right: -135px; }
    .decor-heart-left-top { left: -125px; }
    .decor-heart-left-bottom { left: -150px; }
    .decor-heart-right { right: -170px; }
    .decor-spark-left { left: -190px; }
    .decor-spark-left-bottom { left: -110px; }
    .decor-spark-right { right: -120px; }
}

/* Планшеты — прижимаем к краю */
@media (max-width: 1300px) {
    .decor-star-left,
    .decor-star-left-bottom,
    .decor-star-right,
    .decor-coin-left,
    .decor-coin-right-top,
    .decor-coin-right-bottom,
    .decor-heart-left-top,
    .decor-heart-left-bottom,
    .decor-heart-right,
    .decor-spark-left,
    .decor-spark-left-bottom,
    .decor-spark-right {
        left: auto;
        right: auto;
    }

    .decor-star-left,
    .decor-star-left-bottom,
    .decor-coin-left,
    .decor-heart-left-top,
    .decor-heart-left-bottom,
    .decor-spark-left,
    .decor-spark-left-bottom {
        left: 4px;
    }

    .decor-star-right,
    .decor-coin-right-top,
    .decor-coin-right-bottom,
    .decor-heart-right,
    .decor-spark-right {
        right: 4px;
    }
}

/* Телефоны — оставляем только крупные декорации */
@media (max-width: 700px) {
    .game-decor {
        transform: scale(0.72);
    }

    .decor-star-left {
        top: 180px;
        left: -8px;
    }

    .decor-star-left-bottom {
        top: 640px;
        left: -8px;
    }

    .decor-coin-left {
        top: 380px;
        left: -8px;
    }

    .decor-star-right {
        top: 200px;
        right: -8px;
    }

    .decor-coin-right-top {
        top: 340px;
        right: -8px;
    }

    .decor-coin-right-bottom {
        top: 620px;
        right: -8px;
    }

    .decor-heart-left-top,
    .decor-heart-left-bottom,
    .decor-heart-right,
    .decor-spark-left,
    .decor-spark-left-bottom,
    .decor-spark-right {
        display: none;
    }
}

.mini-game-card.is-expanded .mini-game-toggle {
    display: none !important;
}



@media (max-width: 600px) {
    .mini-games-page .mini-games-grid {
        gap: 18px;
    }

    .mini-games-page .mini-game-card-content {
        padding: 16px;
    }
}

/* Маленькие экраны */
@media (max-width: 600px) {
    .standalone-mini-game-content .crocodile-game {
        padding: 14px;
    }

    .standalone-mini-game-content .crocodile-task-hidden,
    .standalone-mini-game-content .crocodile-task {
        padding: 14px;
    }

    .standalone-mini-game-content .crocodile-game-actions {
        flex-direction: column;
    }

    .standalone-mini-game-content .crocodile-game-actions .button {
        width: 100%;
    }

    .standalone-mini-game-content .crocodile-score-row {
        grid-template-columns: 24px minmax(0, 1fr);
    }

    .standalone-mini-game-content .crocodile-score-value {
        grid-column: 2;
    }
}

@media (max-width: 480px) {
    .standalone-mini-game-content .memory-game-board {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .standalone-mini-game-content .memory-game-board .memory-card {
        min-height: 76px;
        padding: 6px;
        font-size: 1.6rem;
    }
}

@media (max-width: 600px) {
    .standalone-mini-game-content .mini-game-inline[data-word-game] {
        padding: 14px;
    }

    .standalone-mini-game-content .word-game-letter,
    .standalone-mini-game-content .word-game-selected-letter {
        min-width: 42px;
        min-height: 46px;
        padding: 6px 9px;
    }
}

@media (max-width: 600px) {
    .standalone-mini-game-content .word-game-letter,
    .standalone-mini-game-content .word-game-selected-letter {
        min-width: 40px;
        min-height: 44px;
        padding: 6px 9px;
    }

    .standalone-mini-game-content .word-game-letters {
        gap: 8px;
    }
}

/* Мобильный экран */
@media (max-width: 600px) {
    .standalone-mini-game-content .memory-game-board {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        max-width: 360px;
    }

    .standalone-mini-game-content .memory-game-board .memory-card {
        padding: 5px;
        border-radius: 10px;
    }
}

/* Учитываем настройку уменьшения анимации */
@media (prefers-reduced-motion: reduce) {
    .standalone-mini-game-content .memory-game-board .memory-card {
        transition: none;
    }
}

/* Адаптация под телефон */
@media (max-width: 480px) {
    .standalone-mini-game-content [data-memory-game] .memory-grid {
        gap: 7px;
    }
}

@media (max-width: 600px) {
    .standalone-mini-game-content {
        padding: 16px 10px;
        border-radius: 16px;
    }

    .standalone-mini-game-content .word-game-letter,
    .standalone-mini-game-content .word-game-selected-letter {
        min-width: 38px;
        min-height: 42px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mini-game-card:not(.is-expanded) {
        animation: none;
    }
}

@media (max-width: 600px) {
    .mini-games-page::before {
        left: -7px;
        top: 250px;
        transform: scale(0.7);
    }

    .mini-games-page::after {
        right: -7px;
        top: 440px;
        transform: scale(0.7);
    }
}

@media (max-width: 600px) {
    .mini-game-card.is-expanded {
        width: calc(100vw - 18px);
        max-height: calc(100vh - 18px);
        border-radius: 20px;
    }

    .mini-game-card.is-expanded .mini-game-card-content {
        padding: 20px 16px;
    }
}

@media (max-width: 900px) {
    .mini-games-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mini-games-hero-console {
        left: 4%;
        top: -12px;
    }

    .mini-games-hero-console img {
        width: 76px;
        height: 76px;
    }
}

@media (max-width: 600px) {
    .mini-games-page {
        width: min(100% - 28px, 420px);
        padding-top: 38px;
    }

    .mini-games-hero {
        margin-bottom: 30px;
        padding-top: 62px;
    }

    .mini-games-hero-console {
        top: -8px;
        left: calc(50% - 34px);
    }

    .mini-games-hero-console img {
        width: 66px;
        height: 66px;
    }

    .mini-games-hero h1 {
        font-size: 2.2rem;
        letter-spacing: -0.8px;
    }

    .mini-games-hero p {
        max-width: 330px;
        margin: 0 auto;
        font-size: 0.95rem;
    }

    .pixel-star-one {
        left: 2%;
        top: 26px;
    }

    .pixel-star-two {
        right: 2%;
        top: 34px;
    }

    .pixel-star-three {
        left: 7%;
        top: 86px;
    }

    .mini-games-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .mini-game-card-content {
        min-height: 310px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mini-games-hero-console,
    .pixel-star {
        animation: none;
    }

    .mini-game-card,
    .mini-game-toggle,
    .mini-game-next {
        transition: none;
    }
}

@keyframes miniGameReveal {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 850px) {
    .mini-games-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .mini-games-page {
        padding: 24px 14px 36px;
    }

    .mini-games-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .mini-game-card-content {
        padding: 22px;
    }

    .mini-game-card.is-expanded {
        grid-column: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mini-game-card,
    .mini-game-collapse {
        transition: none;
    }

    .mini-game-details {
        animation: none;
    }
}

@media (max-width: 600px) {
    .mini-games-grid.mini-game-open .mini-game-card.is-expanded {
        max-width: 100%;
    }

    .mini-game-details {
        padding-left: 4px;
        padding-right: 4px;
    }
}


@media (max-width: 850px) {
    .mini-games-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .mini-games-grid {
        grid-template-columns: 1fr;
    }

    .mini-games-page {
        margin-top: 24px;
    }

    .mini-game-card {
        padding: 20px;
    }
}

@media (max-width: 380px) {

    .memory-game-board {
        max-width: 320px;
        gap: 6px;
        padding: 0 6px;
    }

    .memory-card-front {
        font-size: 24px;
    }

    .memory-card-front,
    .memory-card-back {
        border-radius: 8px;
    }
}

@media (max-width: 600px) {

    .crocodile-setup {
        min-height: 240px;
    }

    .crocodile-start-button {
        min-width: 220px;
        min-height: 64px;

        font-size: 19px;
    }
}

@media (max-width: 480px) {
    .challenge-meta {
        flex-direction: column;
        gap: 10px;
    }

    .challenge-meta-item {
        width: 100%;
        justify-content: center;
    }
}


/* Компактный вид на телефонах */
@media (max-width: 600px) {
    .favorite-accordion-title {
        padding: 20px;
        font-size: 18px;
    }

    .favorite-accordion-content {
        padding: 0 20px 20px;
    }
}

/* Учитываем настройку уменьшения анимации */
@media (prefers-reduced-motion: reduce) {
    .favorite-accordion-icon,
    .favorite-accordion-title {
        transition: none;
    }

    .favorite-accordion-content {
        animation: none;
    }
}

/* Адаптация для телефонов */

@media (max-width: 600px) {
    .site-header {
        min-height: 64px;
        padding: 10px 16px;
        gap: 12px;
    }

    .site-header-brand .hero-badge {
        font-size: 13px;
        padding: 9px 12px;
    }

    .site-header-actions {
        gap: 12px;
    }

    .site-header-username,
    .site-header-link {
        font-size: 13px;
    }

    .site-header-register {
        padding: 8px 10px;
    }
}

@media (max-width: 400px) {
    .site-header {
        align-items: flex-start;
    }

    .site-header-actions {
        gap: 8px 12px;
    }
}

/* Планшеты */
@media (max-width: 850px) {
    .section-layout {
        width: min(650px, calc(100% - 40px));
        margin: 28px auto 45px;
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
    }

    .section-main {
        max-width: none;
        justify-content: center;
        text-align: center;
    }

    .daily-challenge {
        max-width: none;
        justify-content: center;
        text-align: center;
    }
}

/* Телефоны */
@media (max-width: 560px) {
    .section-layout {
        width: calc(100% - 28px);
        margin-top: 20px;
    }

    .daily-challenge {
        padding: 22px 18px;
        justify-content: center;
    }

    .daily-challenge-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .daily-challenge-actions form,
    .daily-challenge-actions button {
        width: 100%;
    }
}

/* Адаптация под планшеты и телефоны */

@media (max-width: 850px) {
    .section-layout {
        grid-template-columns: minmax(0, 1fr);
        width: min(680px, 92%);
        gap: 24px;
        margin-top: 28px;
    }

    .section-sidebar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: stretch;
        gap: 16px;
    }

    .profile-card {
        padding: 25px 18px;
    }

    .profile-note {
        align-items: center;
    }
}

@media (max-width: 560px) {
    .section-header {
        min-height: 64px;
        padding: 10px 4%;
        gap: 10px;
    }

    .section-header .hero-badge {
        font-size: 13px;
        padding: 9px 12px;
    }

    .section-header-user {
        gap: 12px;
    }

    .section-header-username {
        font-size: 13px;
    }

    .section-header .logout-button {
        font-size: 13px;
        padding: 5px 0;
    }

    .section-layout {
        width: 92%;
        margin-top: 20px;
    }

    .section-sidebar {
        grid-template-columns: minmax(0, 1fr);
    }

    .profile-note {
        display: none;
    }

    .daily-challenge {
        padding: 23px 19px;
        border-radius: 20px;
        justify-content: center;
    }

    .daily-challenge-icon {
        width: 45px;
        height: 45px;
        font-size: 24px;
    }

    .challenge-meta {
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
    }

    .daily-challenge-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .daily-challenge-actions form,
    .daily-challenge-actions button {
        width: 100%;
    }

    .challenge-material-links {
        flex-direction: column;
    }

    .challenge-material-links .material-button {
        width: 100%;
        box-sizing: border-box;
    }
}

/* АДАПТИВНОСТЬ */

@media (max-width: 700px) {

    .activity-card {
        padding: 20px;
    }

    .activity-card h2 {
        font-size: 24px;
    }

    .activity-description {
        font-size: 16px;
    }

    .activity-info {
        flex-direction: column;

        align-items: center;

        gap: 10px;
    }

    .material-button {
        display: block;

        margin: 10px 0;
    }

}
/* =========================
   ПЛАНШЕТ
   ========================= */

@media (max-width: 900px) {

    .categories {
        grid-template-columns: repeat(3, 1fr);
    }

    .time-options {
        grid-template-columns: repeat(2, 1fr);
    }

}


/* =========================
   ТЕЛЕФОН
   ========================= */

@media (max-width: 600px) {

    .container {
        width: 90%;
        padding: 30px 10px;
    }

    h1 {
        font-size: 32px;
    }

    .hero {
        margin-top: 15px;
        margin-bottom: 30px;
    }

    .hero-badge {
        font-size: 13px;
        padding: 7px 15px;
    }

    .subtitle {
        font-size: 17px;
    }

    .categories {
        grid-template-columns: 1fr;
    }

    .category-content {
        min-height: 140px;
    }

    .time-options {
        grid-template-columns: repeat(2, 1fr);
    }

    .time-card {
        font-size: 14px;
    }

    .activity-card {
        padding: 25px;
    }

}

@media (max-width: 560px) {
    .personal-recommendation {
        margin-bottom: 22px;
        padding: 18px 16px;
        border-radius: 15px;
    }

    .personal-recommendation-title {
        font-size: 27px;
    }

    .personal-recommendation-text {
        font-size: 14px;
    }
}

/* Учитываем настройку пользователя на уменьшение анимации */
@media (prefers-reduced-motion: reduce) {
    .personal-recommendation {
        animation: none;
    }
}

@media (max-width: 480px) {
    .activity-actions {
        gap: 14px;
    }
    .icon-button {
        width: 42px;
        height: 42px;
        font-size: 30px;
    }
}

/* ===== MINI-GAMES PAGE: MATCH THE APPROVED MOCKUP ===== */
/* Эти правила относятся только к странице /mini-games. */

body.page-with-header:has(.mini-games-page) {
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 48% 36%, rgba(112, 105, 255, 0.42) 0%, transparent 48%),
        linear-gradient(112deg, #5d7cf4 0%, #665de8 43%, #8847c5 100%);
    color: #fff;
}

body.page-with-header:has(.mini-games-page) .site-header {
    min-height: 70px;
    padding: 12px 4.4%;
    background: rgba(255, 255, 255, 0.10);
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: none;
    backdrop-filter: blur(8px);
}

.mini-games-page {
    width: 100%;
    max-width: none;
    min-height: calc(100vh - 70px);
    margin: 0;
    padding: 28px 24px 54px;
    color: #fff;
    background: transparent;
}

.mini-games-page .mini-games-hero {
    width: min(100%, 1000px);
    min-height: 125px;
    margin: 0 auto 35px;
    padding: 0 0 0;
    color: #fff;
    text-align: center;
}

.mini-games-page .mini-games-hero h1 {
    margin: 0 0 12px;
    color: #fff;
    font-size: clamp(2.5rem, 4.3vw, 3.8rem);
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: -1.4px;
    text-shadow:
        0 4px 0 rgba(58, 35, 153, 0.30),
        0 8px 18px rgba(44, 30, 120, 0.16);
}

.mini-games-page .mini-games-hero p {
    margin: 0;
    color: rgba(255, 255, 255, 0.92);
    font-size: clamp(0.95rem, 1.2vw, 1.08rem);
    font-weight: 500;
    line-height: 1.6;
    text-shadow: 0 2px 7px rgba(47, 30, 121, 0.18);
}

.mini-games-page .mini-games-hero-console {
    top: -5px;
    left: calc(50% - 365px);
}

.mini-games-page .mini-games-hero-console img {
    width: 112px;
    height: 112px;
}

.mini-games-page .mini-games-hero-sparkles {
    overflow: visible;
}

.mini-games-page .pixel-star {
    text-shadow: 2px 2px 0 rgba(133, 69, 190, 0.7);
}

.mini-games-page .mini-games-grid {
    width: min(100%, 1020px);
    margin: 0 auto;
    gap: 20px;
}

@media (max-width: 900px) {
    .mini-games-page {
        padding: 30px 20px 44px;
    }

    .mini-games-page .mini-games-hero-console {
        left: 4%;
    }
}

@media (max-width: 600px) {
    .mini-games-page {
        padding: 28px 14px 36px;
    }

    .mini-games-page .mini-games-hero {
        padding-top: 60px;
        margin-bottom: 26px;
    }

    .mini-games-page .mini-games-hero h1 {
        font-size: 2.25rem;
        letter-spacing: -0.8px;
    }

    .mini-games-page .mini-games-hero-console {
        top: -8px;
        left: calc(50% - 33px);
    }

    .mini-games-page .mini-games-hero-console img {
        width: 66px;
        height: 66px;
    }
}

    /* ===== АДАПТАЦИЯ СТРАНИЦ АВТОРИЗАЦИИ ===== */

@media (max-width: 600px) {
    /* Контейнер страниц входа/регистрации */
    body:not(.page-with-header) .container {
        width: 100%;
        max-width: 100%;
        padding: 20px 16px;
        box-sizing: border-box;
    }

    /* Заголовок */
    body:not(.page-with-header) .container h1 {
        font-size: 28px;
        margin-bottom: 20px;
    }

    /* Форма авторизации */
    .auth-form {
        width: 100%;
        max-width: 100%;
        margin: 20px auto;
        padding: 0 4px;
        box-sizing: border-box;
    }

    .auth-form input {
        width: 100%;
        padding: 13px 14px;
        font-size: 16px;
        box-sizing: border-box;
    }

    .auth-form .button {
        width: 100%;
        margin-top: 16px;
        padding: 14px 20px;
        font-size: 16px;
    }

    /* Ссылка под формой */
    .auth-link {
        margin-top: 16px;
        top: 0;
        font-size: 15px;
        line-height: 1.5;
    }

    /* Чекбокс «Запомнить меня» */
    .remember-me {
        margin: 12px 0 16px;
    }

    .remember-me label {
        font-size: 15px;
    }

    /* Сообщения об ошибках */
    .auth-error,
    .auth-success {
        margin: 12px 0;
        font-size: 14px;
        line-height: 1.5;
    }
}

    /* Очень маленькие экраны */
@media (max-width: 380px) {
    body:not(.page-with-header) .container {
            padding: 16px 12px;
    }

    body:not(.page-with-header) .container h1 {
            font-size: 24px;
    }

    .auth-form input {
            padding: 12px;
            font-size: 15px;
    }

    .auth-form .button {
            padding: 13px 16px;
            font-size: 15px;
    }
}
/* =========================================
   COOKIE BANNER
   ========================================= */

.cookie-banner {
    position: relative;
    left: 50%;
    bottom: 20px;
    transform: translate(-50%, 140%);

    z-index: 9999;

    width: min(720px, calc(100% - 32px));
    box-sizing: border-box;

    padding: 18px 22px;

    border-radius: 18px;

    background: rgba(255, 255, 255, 0.97);
    color: #333;

    box-shadow:
            0 12px 40px rgba(20, 10, 60, 0.28),
            0 0 0 2px rgba(139, 92, 246, 0.25);

    opacity: 0;
    transition:
            transform 0.35s ease,
            opacity 0.35s ease;

    backdrop-filter: blur(8px);
}

.cookie-banner--visible {
    transform: translate(-50%, 0);
    opacity: 1;
}

.cookie-banner[hidden] {
    display: none;
}

.cookie-banner__content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.cookie-banner__text {
    margin: 0;
    flex: 1 1 320px;
    font-size: 14px;
    line-height: 1.55;
    color: #444;
}

.cookie-banner__link {
    color: #667eea;
    font-weight: 700;
    text-decoration: underline;
}

.cookie-banner__link:hover {
    color: #4a5cd0;
}

.cookie-banner__actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.cookie-banner__button {
    padding: 10px 18px;
    border: 0;
    border-radius: 12px;

    font-family: inherit;
    font-size: 14px;
    font-weight: 800;

    cursor: pointer;

    transition:
            transform 0.15s ease,
            box-shadow 0.15s ease,
            background 0.15s ease;
}

.cookie-banner__button:hover {
    transform: translateY(-2px);
}

.cookie-banner__button--accept {
    background: linear-gradient(135deg, #8351ff, #6336e8);
    color: #fff;
    box-shadow: 0 4px 0 #4320b1;
}

.cookie-banner__button--accept:hover {
    box-shadow: 0 6px 0 #4320b1;
}

.cookie-banner__button--accept:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #4320b1;
}

.cookie-banner__button--decline {
    background: #f0edff;
    color: #51318f;
    box-shadow: 0 4px 0 #c9bdf5;
}

.cookie-banner__button--decline:hover {
    background: #e5dfff;
    box-shadow: 0 6px 0 #c9bdf5;
}

.cookie-banner__button--decline:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #c9bdf5;
}

/* ===== Мобильные ===== */
@media (max-width: 600px) {
    .cookie-banner {
        left: 6px;
        right: 4px;
        bottom: 4px;
        width: auto;
        transform: translateY(140%);

        padding: 8px 8px;
        border-radius: 8px;

        /* Ограничиваем высоту, чтобы баннер не раздувался */
        max-height: 45vh;
        overflow-y: auto;
    }

    .cookie-banner--visible {
        transform: translateY(0);
    }

    .cookie-banner__content {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .cookie-banner__text {
        /* Убираем flex-basis, чтобы текст не растягивался */
        flex: 0 1 auto;
        font-size: 11px;
        line-height: 1.45;
        text-align: left;
        /* Ограничиваем текст двумя строками с многоточием */
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .cookie-banner__link {
        white-space: nowrap;
    }

    .cookie-banner__actions {
        /* Кнопки в ряд, а не в столбик */
        flex-direction: row;
        width: 100%;
        gap: 8px;
    }

    .cookie-banner__button {
        flex: 1;
        width: auto;
        padding: 10px 12px;
        font-size: 13.5px;
        border-radius: 10px;
    }
}

/* Очень маленькие экраны — кнопки всё-таки в столбик */
@media (max-width: 380px) {
    .cookie-banner__actions {
        flex-direction: column;
    }

    .cookie-banner__button {
        width: 100%;
    }
}
.mini-game-art-snake {
    font-size: 5rem;
    line-height: 1;
    filter: drop-shadow(0 5px 0 rgba(111, 75, 202, 0.2));
}

/* =========================================================
   🎄 ADVENT — базовое
   ========================================================= */

.advent-page {
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.advent-main {
    width: min(1000px, 100%);
    margin: 0 auto;
    padding: 40px 20px 80px;
    position: relative;
    z-index: 1;
}

/* =========================================================
   СЕЗОННЫЕ ФОНЫ
   ========================================================= */

.advent-page.season-spring {
    background:
            radial-gradient(circle at 20% 20%, rgba(255, 200, 230, 0.35), transparent 50%),
            radial-gradient(circle at 80% 30%, rgba(180, 240, 200, 0.35), transparent 50%),
            linear-gradient(160deg, #a8e6cf 0%, #dcedc1 50%, #ffd3e0 100%);
}

.advent-page.season-summer {
    background:
            radial-gradient(circle at 25% 25%, rgba(255, 240, 150, 0.45), transparent 55%),
            radial-gradient(circle at 75% 70%, rgba(130, 200, 250, 0.35), transparent 55%),
            linear-gradient(160deg, #ffe28a 0%, #ffb86b 45%, #5fb3e8 100%);
}

.advent-page.season-autumn {
    background:
            radial-gradient(circle at 20% 30%, rgba(255, 170, 90, 0.4), transparent 55%),
            radial-gradient(circle at 80% 70%, rgba(180, 110, 60, 0.35), transparent 55%),
            linear-gradient(160deg, #ffb26b 0%, #d97b3c 55%, #8b4513 100%);
}

.advent-page.season-winter {
    background:
            radial-gradient(circle at 25% 25%, rgba(180, 220, 255, 0.4), transparent 55%),
            radial-gradient(circle at 75% 70%, rgba(220, 240, 255, 0.35), transparent 55%),
            linear-gradient(160deg, #6a93d1 0%, #4a6fa5 45%, #2a3d66 100%);
}

/* =========================================================
   ЗАГОЛОВОК АДВЕНТА
   ========================================================= */

.advent-heading {
    text-align: center;
    color: #fff;
    margin-bottom: 32px;
}

.advent-heading-icon {
    display: inline-grid;
    place-items: center;
    width: 76px;
    height: 76px;
    margin-bottom: 14px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.4);
    font-size: 2.4rem;
    box-shadow: 0 10px 26px rgba(20, 20, 60, 0.2);
    animation: adventFloat 3.2s ease-in-out infinite;
}

@keyframes adventFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

.advent-heading-title {
    margin: 0 0 8px;
    color: #fff;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 900;
    letter-spacing: -0.6px;
    text-shadow: 0 4px 0 rgba(0, 0, 0, 0.18);
}

.advent-heading-subtitle {
    margin: 0;
    color: rgba(255, 255, 255, 0.92);
    font-size: 1rem;
}

/* =========================================================
   ПРОГРЕСС
   ========================================================= */

.advent-progress {
    width: min(100%, 640px);
    margin: 0 auto 28px;
    padding: 16px 20px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(8px);
    color: #fff;
}

.advent-progress-bar {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.25);
    overflow: hidden;
    margin-bottom: 10px;
}

.advent-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #fff2a8, #fff);
    border-radius: 999px;
    transition: width 0.4s ease;
}

.advent-progress-text {
    text-align: center;
    font-size: 0.95rem;
}

.advent-progress-text strong {
    color: #fff8d8;
    font-weight: 800;
}

/* =========================================================
   ЗАГЛУШКА ДЛЯ ГОСТЯ
   ========================================================= */

.advent-guest-overlay {
    position: relative;
    z-index: 5;
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.advent-guest-card {
    width: min(100%, 460px);
    padding: 32px 28px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.97);
    text-align: center;
    box-shadow:
            0 20px 50px rgba(20, 10, 60, 0.28),
            0 0 0 2px rgba(139, 92, 246, 0.25);
}

.advent-guest-icon {
    font-size: 2.8rem;
    margin-bottom: 12px;
}

.advent-guest-card h2 {
    margin: 0 0 12px;
    color: #302071;
    font-size: 1.4rem;
}

.advent-guest-card p {
    margin: 0 0 20px;
    color: #6b5a88;
    line-height: 1.6;
}

.advent-guest-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.advent-guest-actions .button {
    margin-top: 0;
    min-width: 130px;
}

/* =========================================================
   СЕТКА КАЛЕНДАРЯ
   ========================================================= */

.advent-calendar-wrap {
    position: relative;
    z-index: 1;
}

.advent-calendar-wrap.is-blurred {
    filter: blur(7px);
    pointer-events: none;
    user-select: none;
}

.advent-calendar {
    padding: 24px;
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 18px 40px rgba(20, 10, 60, 0.18);
    backdrop-filter: blur(4px);
}

.advent-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
    text-align: center;
    color: #6b5a88;
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
}

.advent-weekdays span {
    padding: 6px 0;
}

.advent-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

/* Пустая ячейка до начала месяца */
.advent-day--empty {
    visibility: hidden;
    pointer-events: none;
}

/* =========================================================
   ЯЧЕЙКА ДНЯ
   ========================================================= */

.advent-day {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;

    aspect-ratio: 1 / 1;
    padding: 8px 6px;

    border: 2px solid #d6c5f5;
    border-radius: 14px;

    background: linear-gradient(145deg, #ffffff, #f4efff);
    color: #302071;

    font: inherit;
    font-weight: 800;
    font-size: 0.95rem;

    cursor: pointer;
    transition:
            transform 0.15s ease,
            box-shadow 0.15s ease,
            border-color 0.15s ease,
            background 0.15s ease;
    box-shadow: 0 4px 0 #d6c5f5;
}

.advent-day:hover:not(.advent-day--future):not(.advent-day--ghost) {
    transform: translateY(-3px);
    box-shadow: 0 7px 0 #c0a6ed;
    border-color: #8960e8;
}

.advent-day:active:not(.advent-day--future):not(.advent-day--ghost) {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #c0a6ed;
}

.advent-day__number {
    font-size: 1rem;
    font-weight: 900;
    line-height: 1;
}

.advent-day__icon {
    font-size: 1.3rem;
    line-height: 1;
}

.advent-day__check {
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 0.75rem;
    color: #247a42;
    font-weight: 900;
}

/* Сегодня */
.advent-day--today {
    border-color: #ffb900;
    box-shadow:
            0 4px 0 #d68a00,
            0 0 0 3px rgba(255, 185, 0, 0.35);
    animation: adventPulse 1.8s ease-in-out infinite;
}

@keyframes adventPulse {
    0%, 100% { box-shadow: 0 4px 0 #d68a00, 0 0 0 3px rgba(255, 185, 0, 0.35); }
    50%      { box-shadow: 0 4px 0 #d68a00, 0 0 0 8px rgba(255, 185, 0, 0.12); }
}

/* Будущие ячейки — не кликабельны */
.advent-day--future {
    background: #f0ecff;
    color: #a99bd6;
    box-shadow: 0 4px 0 #e0d7f5;
    cursor: not-allowed;
    opacity: 0.7;
}

.advent-day--future .advent-day__icon {
    opacity: 0.55;
}

/* Открытая ячейка */
.advent-day[data-opened="true"] {
    background: linear-gradient(145deg, #fff9d6, #ffef9e);
    border-color: #f0c419;
    box-shadow: 0 4px 0 #d9a800;
    color: #5d4700;
}

/* Выполненная ячейка */
.advent-day[data-completed="true"] {
    background: linear-gradient(145deg, #e8fff0, #c7f5d7);
    border-color: #35ae7b;
    box-shadow: 0 4px 0 #7bd3a5;
    color: #126b4b;
}

/* Гость */
.advent-day--ghost {
    cursor: default;
    pointer-events: none;
}

/* =========================================================
   АНИМАЦИЯ ОТКРЫТИЯ
   ========================================================= */

.advent-day.is-opening {
    animation: adventOpenPulse 0.55s ease;
}

@keyframes adventOpenPulse {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* Разлетающиеся искорки (псевдо-элементы) */
.advent-day.is-opening::before,
.advent-day.is-opening::after {
    content: "✨";
    position: absolute;
    top: 50%;
    left: 50%;
    font-size: 1.2rem;
    pointer-events: none;
    animation: adventSpark 0.7s ease forwards;
}

.advent-day.is-opening::before {
    transform: translate(-50%, -50%) rotate(0deg);
}

.advent-day.is-opening::after {
    content: "❄️";
    animation-delay: 0.08s;
}

@keyframes adventSpark {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    40% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -200%) scale(1.4) rotate(180deg);
    }
}

/* =========================================================
   МОДАЛКА
   ========================================================= */

.advent-modal[hidden] {
    display: none;
}

.advent-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.advent-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 10, 60, 0.7);
    backdrop-filter: blur(6px);
    animation: adventFadeIn 0.25s ease;
}

@keyframes adventFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.advent-modal-window {
    position: relative;
    z-index: 1;
    width: min(560px, 100%);
    max-height: calc(100vh - 40px);
    overflow-y: auto;

    padding: 28px 26px;
    border-radius: 26px;
    background: #fff;
    box-shadow:
            0 0 0 3px rgba(139, 92, 246, 0.35),
            0 25px 60px rgba(20, 10, 60, 0.45);

    animation: adventModalPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes adventModalPop {
    from { opacity: 0; transform: scale(0.85) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.advent-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 12px;
    background: #f0edff;
    color: #51318f;
    font-size: 1.1rem;
    font-weight: 900;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.advent-modal-close:hover {
    background: #e5dfff;
    transform: scale(1.08);
}

/* =========================================================
   СОДЕРЖИМОЕ МОДАЛКИ
   ========================================================= */

.advent-modal-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
    padding-right: 44px;
}

.advent-modal-icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: #f0edff;
    font-size: 1.8rem;
}

.advent-modal-title {
    margin: 0;
    color: #302071;
    font-size: 1.35rem;
    font-weight: 900;
    line-height: 1.25;
}

.advent-modal-description {
    margin: 0 0 16px;
    color: #6b5a88;
    line-height: 1.6;
}

.advent-modal-image {
    margin: 0 0 16px;
    border-radius: 16px;
    overflow: hidden;
}

.advent-modal-image img {
    display: block;
    width: 100%;
    height: auto;
}

.advent-modal-section {
    margin-top: 16px;
    padding: 16px 18px;
    border-radius: 14px;
    background: #f7f4ff;
}

.advent-modal-section h3 {
    margin: 0 0 8px;
    color: #51318f;
    font-size: 1rem;
    font-weight: 900;
}

.advent-modal-section p {
    margin: 0;
    color: #4a3b70;
    line-height: 1.6;
    white-space: pre-line;
}

.advent-modal-materials {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.advent-modal-materials .material-button {
    margin: 0;
}

/* Кнопка «Выполнено» */
.advent-modal-actions {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #eee9ff;
    display: flex;
    justify-content: center;
}

.advent-complete-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 50px;
    padding: 12px 28px;

    border: 3px solid #35ae7b;
    border-radius: 14px;
    background: linear-gradient(135deg, #43d17b, #27ae60);
    color: #fff;

    font: inherit;
    font-size: 1rem;
    font-weight: 900;

    cursor: pointer;
    box-shadow: 0 5px 0 #1d8a4a;
    transition:
            transform 0.15s ease,
            box-shadow 0.15s ease,
            filter 0.15s ease;
}

.advent-complete-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 7px 0 #1d8a4a;
    filter: brightness(1.05);
}

.advent-complete-button:active:not(:disabled) {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #1d8a4a;
}

.advent-complete-button:disabled,
.advent-complete-button.is-completed {
    background: #e0f5e9;
    border-color: #8bd9b7;
    color: #126b4b;
    box-shadow: 0 5px 0 #b9e8d0;
    cursor: default;
}

/* Заглушки внутри модалки */
.advent-modal-auth,
.advent-modal-future,
.advent-modal-error {
    text-align: center;
    padding: 10px 0;
}

.advent-modal-auth-icon,
.advent-modal-future-icon,
.advent-modal-error-icon {
    font-size: 2.8rem;
    margin-bottom: 12px;
}

.advent-modal-auth h2,
.advent-modal-future h2,
.advent-modal-error h2 {
    margin: 0 0 10px;
    color: #302071;
}

.advent-modal-auth p,
.advent-modal-future p,
.advent-modal-error p {
    margin: 0 0 18px;
    color: #6b5a88;
}

.advent-modal-auth-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.advent-modal-auth-actions .button {
    margin-top: 0;
    min-width: 120px;
}

/* =========================================================
   НЕАКТИВНЫЙ СЕЗОН
   ========================================================= */

.advent-inactive {
    max-width: 560px;
    margin: 40px auto;
    padding: 40px 30px;
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.96);
    text-align: center;
    box-shadow: 0 18px 42px rgba(20, 10, 60, 0.2);
}

.advent-inactive-icon {
    font-size: 3.4rem;
    margin-bottom: 12px;
}

.advent-inactive h1 {
    margin: 0 0 12px;
    color: #302071;
    font-size: 1.6rem;
}

.advent-inactive p {
    margin: 0 0 22px;
    color: #6b5a88;
    line-height: 1.6;
}

.advent-inactive-seasons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 26px;
}

.advent-inactive-season {
    padding: 8px 14px;
    border-radius: 999px;
    background: #f0edff;
    color: #51318f;
    font-weight: 700;
    font-size: 0.9rem;
}

/* =========================================================
   ИКОНКА-КАЛЕНДАРИК В ШАПКЕ
   ========================================================= */

.advent-header-link {
    position: relative;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    width: 44px;
    height: 46px;
    flex-shrink: 0;

    border-radius: 8px;
    background: #fff;
    color: #51318f;

    text-decoration: none;

    box-shadow: 0 3px 0 #d6c5f5;
    transition: transform 0.15s ease, box-shadow 0.15s ease;

    overflow: hidden;
}

/* «Корешок» сверху — как у отрывного календаря */
.advent-header-link::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 4px;
    border-radius: 0 0 3px 3px;
    background: #d6c5f5;
}

/* Месяц */
.advent-header-link__month {
    margin-top: 0;
    padding: 0 4px;

    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.3px;
    text-transform: uppercase;

    color: #8960e8;
    line-height: 1;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 8px);
}

/* Горизонтальная черта */
.advent-header-link__divider {
    display: block;
    width: 60%;
    height: 1.5px;
    margin: 2px 0 1px;

    background: #e0d5f5;
    border-radius: 999px;
}

/* Число */
.advent-header-link__day {
    font-size: 15px;
    font-weight: 900;
    color: #302071;
    line-height: 1;
}

/* Если месяца нет — число центрируем чуть ниже */
.advent-header-link:not(:has(.advent-header-link__month))
.advent-header-link__day {
    margin-top: 4px;
}

/* Hover */
.advent-header-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 0 #c4a9ff;
}

/* Сезонные цвета «корешка» */
.season-spring .advent-header-link::before { background: #f8b8ce; }
.season-summer .advent-header-link::before { background: #f0c419; }
.season-autumn .advent-header-link::before { background: #d97b3c; }
.season-winter .advent-header-link::before { background: #6a93d1; }

/* Мобильные */
@media (max-width: 600px) {
    .advent-header-link {
        width: 40px;
        height: 42px;
    }

    .advent-header-link__month {
        font-size: 8px;
        margin-top: 4px;
    }

    .advent-header-link__day {
        font-size: 14px;
    }
}

/* =========================================================
   АДАПТИВ
   ========================================================= */

@media (max-width: 700px) {

    .advent-main {
        padding: 24px 12px 60px;
    }

    .advent-calendar {
        padding: 14px;
        border-radius: 20px;
    }

    .advent-days,
    .advent-weekdays {
        gap: 5px;
    }

    .advent-day {
        padding: 4px 3px;
        border-radius: 10px;
        border-width: 2px;
    }

    .advent-day__number {
        font-size: 0.85rem;
    }

    .advent-day__icon {
        font-size: 1rem;
    }

    .advent-day__check {
        top: 2px;
        right: 3px;
        font-size: 0.65rem;
    }

    .advent-heading-icon {
        width: 62px;
        height: 62px;
        font-size: 1.9rem;
    }

    .advent-modal-window {
        padding: 22px 18px;
        border-radius: 20px;
    }

    .advent-modal-icon {
        width: 46px;
        height: 46px;
        font-size: 1.5rem;
    }

    .advent-modal-title {
        font-size: 1.15rem;
    }

    .advent-guest-card {
        padding: 24px 20px;
        border-radius: 20px;
    }

    .advent-guest-actions {
        flex-direction: column;
    }

    .advent-guest-actions .button {
        width: 100%;
    }

    .advent-inactive {
        margin: 20px 12px;
        padding: 28px 20px;
    }
}

/* Уменьшение анимации */
@media (prefers-reduced-motion: reduce) {
    .advent-heading-icon,
    .advent-day--today,
    .advent-day.is-opening::before,
    .advent-day.is-opening::after {
        animation: none;
    }

    .advent-modal-window {
        animation: none;
    }
}
/* =========================================================
   🛠 ADVENT ADMIN — аккордеон и секции
   ========================================================= */

.admin-section-toggle {
    background: #fff;
    border-radius: 22px;
    margin-bottom: 22px;
    box-shadow: 0 8px 24px rgba(35, 25, 80, 0.08);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.admin-section-toggle[open] {
    box-shadow: 0 12px 32px rgba(35, 25, 80, 0.14);
}

.admin-section-toggle__header {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 20px 26px;

    cursor: pointer;
    user-select: none;
    list-style: none;

    font-size: 1.15rem;
    font-weight: 800;
    color: #302071;

    transition: background 0.2s ease;
}

.admin-section-toggle__header::-webkit-details-marker {
    display: none;
}

.admin-section-toggle__header:hover {
    background: #f7f5ff;
}

.admin-section-toggle__icon {
    font-size: 1.4rem;
    line-height: 1;
}

.admin-section-toggle__title {
    flex: 1;
    min-width: 0;
}

.admin-section-toggle__count {
    flex-shrink: 0;

    padding: 3px 12px;
    border-radius: 999px;

    background: #f0edff;
    color: #51318f;

    font-size: 0.85rem;
    font-weight: 800;
}

.admin-section-toggle__arrow {
    flex-shrink: 0;
    margin-left: 8px;

    color: #8053e8;
    font-size: 0.85rem;

    transition: transform 0.25s ease;
}

.admin-section-toggle[open] .admin-section-toggle__arrow {
    transform: rotate(180deg);
}

.admin-section-toggle__body {
    padding: 0 26px 26px;
    animation: adminReveal 0.25s ease;
}

@keyframes adminReveal {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   ПЛАШКИ ОШИБОК / УСПЕХА
   ========================================================= */

.admin-alert {
    max-width: 900px;
    margin: 0 auto 20px;
    padding: 14px 20px;

    border-radius: 14px;

    font-weight: 700;
    font-size: 0.95rem;
}

.admin-alert--error {
    background: #ffe2eb;
    border: 2px solid #e77b9a;
    color: #a52e52;
    box-shadow: 0 4px 0 #f3b7ca;
}

.admin-alert--success {
    background: #d9ffeb;
    border: 2px solid #35ae7b;
    color: #126b4b;
    box-shadow: 0 4px 0 #9cddbd;
}

/* =========================================================
   СТАТИСТИКА ПО СЕЗОНАМ
   ========================================================= */

.advent-admin-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;

    margin-bottom: 22px;
    padding: 16px;

    border-radius: 16px;
    background: #f7f4ff;
}

.advent-admin-stat {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 12px 14px;

    border-radius: 12px;
    background: #fff;

    box-shadow: 0 3px 8px rgba(80, 60, 150, 0.06);
}

.advent-admin-stat-icon {
    font-size: 1.6rem;
    line-height: 1;
}

.advent-admin-stat-label {
    font-size: 0.85rem;
    color: #6b5a88;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.advent-admin-stat-value {
    margin-top: 2px;
    color: #302071;
    font-weight: 800;
    font-size: 1.05rem;
}

/* =========================================================
   ФИЛЬТР ПО СЕЗОНУ
   ========================================================= */

.advent-admin-filter {
    display: flex;
    align-items: center;
    gap: 12px;

    margin-bottom: 22px;
    padding: 12px 16px;

    border-radius: 14px;
    background: #f7f4ff;
}

.advent-admin-filter label {
    font-weight: 700;
    color: #51318f;
    margin: 0;
    white-space: nowrap;
}

.advent-admin-filter select {
    flex: 1;
    min-width: 0;
}

/* =========================================================
   ФОРМА ДОБАВЛЕНИЯ АДВЕНТ-ЗАДАНИЯ
   ========================================================= */

.advent-admin-form-toggle {
    margin-bottom: 22px;

    border-radius: 16px;
    background: #fbf8ff;
    border: 2px solid #ece2ff;
    overflow: hidden;
}

.advent-admin-form-toggle__header {
    padding: 14px 20px;

    cursor: pointer;
    user-select: none;
    list-style: none;

    font-weight: 800;
    color: #51318f;

    background: #f0e8ff;

    transition: background 0.2s ease;
}

.advent-admin-form-toggle__header::-webkit-details-marker {
    display: none;
}

.advent-admin-form-toggle__header:hover {
    background: #e5daff;
}

.advent-admin-form-toggle__body {
    padding: 20px;
}

/* Общие стили для форм адвента */
.advent-admin-form-toggle label,
.advent-admin-edit-form label {
    display: block;
    margin-top: 14px;
    margin-bottom: 6px;

    color: #51318f;
    font-weight: 700;
    font-size: 0.9rem;
}

.advent-admin-form-toggle input,
.advent-admin-form-toggle textarea,
.advent-admin-form-toggle select,
.advent-admin-edit-form input,
.advent-admin-edit-form textarea,
.advent-admin-edit-form select {
    width: 100%;
    padding: 11px 14px;

    border: 2px solid #e4dcf5;
    border-radius: 12px;
    background: #fff;

    font-size: 15px;
    font-family: inherit;
    color: #302071;

    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.advent-admin-form-toggle input:focus,
.advent-admin-form-toggle textarea:focus,
.advent-admin-form-toggle select:focus,
.advent-admin-edit-form input:focus,
.advent-admin-edit-form textarea:focus,
.advent-admin-edit-form select:focus {
    outline: none;
    border-color: #8960e8;
    box-shadow: 0 0 0 3px rgba(137, 96, 232, 0.15);
}

.advent-admin-form-toggle textarea,
.advent-admin-edit-form textarea {
    resize: vertical;
    min-height: 70px;
}

.advent-admin-form-toggle button[type="submit"],
.advent-admin-edit-form button[type="submit"] {
    margin-top: 20px;
    width: 100%;
}

/* Строка с датой */
.advent-date-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.advent-date-row select {
    flex: 0 0 120px;
    width: 120px;
}

.advent-date-preview {
    padding: 10px 16px;
    border-radius: 10px;

    background: #f0edff;
    color: #51318f;

    font-weight: 800;
    font-size: 0.95rem;

    white-space: nowrap;
}

/* =========================================================
   КАРТОЧКИ ЗАДАНИЙ
   ========================================================= */

.advent-admin-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.advent-admin-card {
    padding: 18px 20px;
    border-radius: 16px;

    background: #fff;
    border-left: 4px solid #8053e8;
    box-shadow: 0 4px 12px rgba(80, 60, 150, 0.06);

    transition: box-shadow 0.2s ease;
}

.advent-admin-card:hover {
    box-shadow: 0 8px 20px rgba(80, 60, 150, 0.1);
}

.advent-admin-card__header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;

    margin-bottom: 8px;
}

.advent-admin-card__icon {
    font-size: 1.5rem;
    line-height: 1;
}

.advent-admin-card__title {
    flex: 1;
    min-width: 0;

    font-weight: 800;
    color: #302071;
    font-size: 1.05rem;

    overflow-wrap: anywhere;
}

.advent-admin-card__season {
    padding: 3px 10px;
    border-radius: 999px;

    background: #f0edff;
    color: #51318f;

    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.advent-admin-card__badge {
    padding: 3px 10px;
    border-radius: 999px;

    background: #fff0a8;
    color: #8b6b00;

    font-size: 0.8rem;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: 0 2px 0 #e2d29a;
}

.advent-admin-card__description {
    margin: 6px 0 12px;
    color: #6b5a88;
    font-size: 0.9rem;
    line-height: 1.5;
}

.advent-admin-card__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.advent-admin-card__actions form {
    margin: 0;
}

/* Inline-форма редактирования */
.advent-admin-edit-form {
    margin-top: 16px;
    padding: 18px;

    border-radius: 14px;
    background: #f7f4ff;
    border: 2px dashed #d6c5f5;
    animation: adminReveal 0.25s ease;
}

/* =========================================================
   СПИСОК ЗАНЯТИЙ В 4-Й СЕКЦИИ
   ========================================================= */

.admin-activity-row {
    padding: 16px 18px;
    margin-bottom: 12px;

    border-radius: 14px;
    background: #f9f7ff;
    border-left: 4px solid #667eea;
}

.admin-activity-row h3 {
    margin: 0 0 6px;
    color: #302071;
    font-size: 1.05rem;
    overflow-wrap: anywhere;
}

.admin-activity-row p {
    margin: 0 0 8px;
    color: #6b5a88;
    line-height: 1.5;
}

.admin-activity-meta {
    font-size: 0.85rem;
    color: #8c80b5;
}

.admin-activity-meta strong {
    color: #51318f;
}

.admin-activity-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 10px;
}

.admin-activity-actions form {
    margin: 0;
}

/* =========================================================
   АДАПТИВ
   ========================================================= */

@media (max-width: 700px) {

    .admin-section-toggle__header {
        padding: 16px 18px;
        font-size: 1rem;
        gap: 10px;
    }

    .admin-section-toggle__body {
        padding: 0 18px 20px;
    }

    .advent-admin-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        padding: 12px;
    }

    .advent-admin-stat {
        padding: 10px 12px;
    }

    .advent-admin-stat-icon {
        font-size: 1.3rem;
    }

    .advent-admin-filter {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .advent-date-row {
        flex-direction: column;
        align-items: stretch;
    }

    .advent-date-row select {
        width: 100%;
        flex: auto;
    }

    .advent-date-preview {
        text-align: center;
    }

    .advent-admin-card {
        padding: 14px 16px;
    }

    .advent-admin-card__title {
        font-size: 1rem;
    }

    .advent-admin-card__actions,
    .admin-activity-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .advent-admin-card__actions .mini-game-edit-button,
    .advent-admin-card__actions .mini-game-delete-button,
    .admin-activity-actions .mini-game-edit-button,
    .admin-activity-actions .mini-game-delete-button {
        width: 100%;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .admin-section-toggle__body,
    .advent-admin-edit-form {
        animation: none;
    }

    .admin-section-toggle__arrow {
        transition: none;
    }
}

/* =========================================================
   🧩 ПАЗЛЫ
   ========================================================= */

.puzzles-page,
.puzzle-main {
    width: min(1000px, 100%);
    margin: 0 auto;
    padding: 30px 20px 60px;
    color: #fff;
}

.puzzles-title,
.puzzle-title {
    color: #fff;
    text-align: center;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 900;
    letter-spacing: -0.5px;
    margin: 0 0 8px;
    text-shadow: 0 4px 0 rgba(0, 0, 0, 0.18);
}

.puzzles-subtitle {
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 28px;
}

/* =========================================================
   Сетка пазлов
   ========================================================= */

.puzzles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.puzzle-card {
    display: block;
    padding: 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.95);
    color: #302071;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(35, 25, 80, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.puzzle-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 34px rgba(35, 25, 80, 0.2);
}

.puzzle-card-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    background-size: cover;
    background-position: center;
    margin-bottom: 12px;
    background-color: #eee;
}

.puzzle-card-title {
    font-weight: 800;
    font-size: 1.05rem;
    margin-bottom: 6px;
    overflow-wrap: anywhere;
}

.puzzle-card-size {
    font-size: 0.9rem;
    color: #6b5a88;
}

.puzzle-card-size strong {
    color: #51318f;
}

.puzzles-empty {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    padding: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
}

.puzzles-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}

/* =========================================================
   Страница конкретного пазла
   ========================================================= */

.puzzle-heading {
    text-align: center;
    margin-bottom: 18px;
}

.puzzle-back {
    display: inline-block;
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
}

.puzzle-back:hover {
    color: #fff;
    text-decoration: underline;
}

.puzzle-sizes {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.puzzle-size-btn {
    padding: 8px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    text-decoration: none;
    font-weight: 800;
    font-size: 0.9rem;
    transition: background 0.2s ease, transform 0.2s ease;
}

.puzzle-size-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.puzzle-size-btn.active {
    background: #fff;
    color: #51318f;
    border-color: #fff;
}

.puzzle-info {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 16px;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
}

.puzzle-info strong {
    color: #fff8d8;
}

.puzzle-status {
    color: #c4ffd9;
}

/* =========================================================
   Доска пазла
   ========================================================= */

.puzzle-board {
    --cols: 3;
    --rows: 3;

    display: grid;
    grid-template-columns: repeat(var(--cols), 1fr);
    grid-template-rows: repeat(var(--rows), 1fr);

    width: min(100%, 560px);
    aspect-ratio: 1 / 1;

    margin: 0 auto 22px;
    padding: 8px;

    background-color: #fff;
    background-size: cover;
    background-position: center;
    border-radius: 22px;

    box-shadow:
            0 14px 40px rgba(20, 10, 60, 0.35),
            0 0 0 3px rgba(255, 255, 255, 0.4);

    gap: 3px;
    position: relative;
    user-select: none;
    touch-action: manipulation;
}

.puzzle-piece {
    --x: 0;
    --y: 0;

    position: relative;
    border-radius: 6px;
    cursor: pointer;

    background-image: inherit;
    background-size: calc(100% * var(--cols)) calc(100% * var(--rows));
    background-position:
            calc(-100% * var(--x)) calc(-100% * var(--y));
    background-repeat: no-repeat;

    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.puzzle-piece:hover {
    filter: brightness(1.08);
    transform: scale(1.01);
    z-index: 2;
}

.puzzle-piece.selected {
    box-shadow:
            inset 0 0 0 3px #ffd95a,
            0 0 20px rgba(255, 217, 90, 0.7);
    transform: scale(1.03);
    z-index: 3;
}

.puzzle-piece.animate {
    transform: scale(1.08);
    z-index: 4;
}

/* =========================================================
   Кнопки и заметки
   ========================================================= */

.puzzle-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 22px;
}

.puzzle-actions .button {
    margin: 0;
}

.puzzle-guest-note,
.puzzle-completed-note {
    text-align: center;
    margin-top: 18px;
    padding: 12px 18px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 0.95rem;
}

.puzzle-completed-note {
    background: rgba(217, 255, 235, 0.2);
    color: #d9ffeb;
}

/* =========================================================
   АДАПТИВ
   ========================================================= */

@media (max-width: 700px) {
    .puzzle-board {
        width: 100%;
        max-width: 420px;
        gap: 2px;
        padding: 5px;
        border-radius: 16px;
    }

    .puzzle-piece {
        border-radius: 4px;
    }

    .puzzle-card {
        padding: 10px;
    }

    .puzzle-card-title {
        font-size: 0.95rem;
    }

    .puzzle-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .puzzle-actions .button {
        width: 100%;
    }
}
/* =========================================================
   🧩 ПАЗЛ
   ========================================================= */

.standalone-mini-game-content .puzzle-game {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    padding: 22px;
    box-sizing: border-box;
    background: #f8f2ff;
    border: 3px solid #6040a8;
    border-radius: 8px;
    box-shadow: 6px 6px 0 #d6c5f5;
}

.puzzle-hint-text {
    margin: 0 0 14px;
    color: #6b5a88;
    font-size: 0.9rem;
    text-align: center;
}

.puzzle-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 8px 14px;
    background: #fff0a8;
    border: 2px solid #45238e;
    border-radius: 6px;
    color: #382273;
    font-weight: 800;
    font-size: 0.95rem;
}

.puzzle-board {
    display: grid;
    gap: 3px;
    width: 100%;
    aspect-ratio: 1 / 1;
    margin-bottom: 16px;
    background: #f0edff;
    padding: 3px;
    border-radius: 8px;
}

.puzzle-cell {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #e8e0ff;
    border-radius: 4px;
    overflow: hidden;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.puzzle-cell--hover {
    background: #d6c5f5;
    box-shadow: inset 0 0 0 2px #8960e8;
}

.puzzle-tile {
    position: absolute;
    inset: 0;
    background-repeat: no-repeat;
    border-radius: 4px;
    cursor: grab;
    transition: transform 0.12s ease, opacity 0.12s ease;
    touch-action: none;
}

.puzzle-tile:hover {
    transform: scale(0.97);
    box-shadow: inset 0 0 0 2px rgba(137, 96, 232, 0.6);
}

.puzzle-tile--dragging {
    opacity: 0.4;
    cursor: grabbing;
}

.puzzle-tile--touch-clone {
    border-radius: 4px;
    box-shadow: 0 8px 20px rgba(50, 30, 100, 0.4);
}

.puzzle-shuffle-button {
    display: block;
    margin: 0 auto;
    min-width: 160px;
    padding: 12px 22px;
    border: 3px solid #45238e;
    border-radius: 5px;
    background: #8053e8;
    color: #fff;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 4px 4px 0 #45238e;
}

.puzzle-shuffle-button:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #45238e;
}

.puzzle-result {
    min-height: 28px;
    margin: 14px 0;
    padding: 10px 14px;
    border-radius: 5px;
    text-align: center;
    font-weight: 800;
}

.puzzle-result.success {
    background: #d9ffeb;
    color: #126b4b;
    border: 2px solid #35ae7b;
}

.puzzle-sizes {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.puzzle-size-btn {
    padding: 8px 16px;
    border: 2px solid #bda7f3;
    border-radius: 10px;
    background: #fff;
    color: #51318f;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.puzzle-size-btn:hover {
    background: #f0e8ff;
}

.puzzle-size-btn.active {
    background: #8053e8;
    color: #fff;
    border-color: #45238e;
    box-shadow: 0 3px 0 #45238e;
}

.puzzle-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.puzzle-next-button {
    padding: 12px 22px;
    border: 3px solid #51318f;
    border-radius: 5px;
    background: #fff;
    color: #51318f;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 4px 4px 0 #bda7f3;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.puzzle-next-button:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #bda7f3;
}

.puzzle-next-button:disabled {
    opacity: 0.5;
    cursor: wait;
}

.mini-game-art-puzzle {
    font-size: 5rem;
    line-height: 1;
    filter: drop-shadow(0 5px 0 rgba(111, 75, 202, 0.2));
}

@media (max-width: 600px) {
    .standalone-mini-game-content .puzzle-game {
        padding: 14px;
    }
    .puzzle-board {
        gap: 2px;
        padding: 2px;
    }
}

/* =========================================================
   👁 ПОЛЕ ПАРОЛЯ С ГЛАЗИКОМ
   ========================================================= */

.password-field {
    position: relative;
    width: 100%;
}

.password-field input {
    width: 100%;
    padding-right: 48px;   /* место под кнопку */
    box-sizing: border-box;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);

    width: 36px;
    height: 36px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: none;
    background: transparent;
    color: #6b5a88;

    font-size: 1.1rem;
    line-height: 1;

    cursor: pointer;

    border-radius: 8px;

    transition: background 0.15s ease, color 0.15s ease;
}

.password-toggle:hover {
    background: rgba(137, 96, 232, 0.1);
    color: #51318f;
}

.password-toggle:focus-visible {
    outline: 2px solid #8960e8;
    outline-offset: 2px;
}

/* Когда пароль показан — можно поменять иконку */
.password-toggle.is-active {
    color: #8960e8;
}

.puzzle-preview-row {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}

.puzzle-preview-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 10px 20px;

    border: 2px solid #bda7f3;
    border-radius: 12px;

    background: #fff;
    color: #51318f;

    font-size: 0.95rem;
    font-weight: 800;

    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.puzzle-preview-button:hover {
    background: #f0e8ff;
    transform: translateY(-1px);
}

.puzzle-preview-button:active {
    transform: translateY(1px);
}

/* Модалка */
.puzzle-preview-modal[hidden] {
    display: none;
}

.puzzle-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;
}

.puzzle-preview-backdrop {
    position: absolute;
    inset: 0;

    background: rgba(20, 10, 60, 0.75);
    backdrop-filter: blur(6px);
}

.puzzle-preview-window {
    position: relative;
    z-index: 1;

    max-width: min(800px, 95vw);
    max-height: 90vh;

    padding: 12px;

    background: #fff;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(20, 10, 60, 0.5);


}

.puzzle-preview-image {
    display: block;
    max-width: 100%;
    max-height: calc(90vh - 60px);
    border-radius: 12px;
}

.puzzle-preview-close-btn {
    position: absolute;
    top: 8px;
    right: 8px;

    width: 38px;
    height: 38px;

    border: 2px solid #d8c8ff;
    border-radius: 50%;

    background: #fff;
    color: #51318f;

    font-size: 16px;
    font-weight: 900;

    cursor: pointer;
    box-shadow: 0 4px 12px rgba(20, 10, 60, 0.25);

    z-index: 2;   /* поверх картинки */
    transition: transform 0.15s ease;
}

.puzzle-preview-close-btn:hover {
    transform: scale(1.1);
}

.puzzle-preview-image {
    display: block;
    max-width: 100%;
    max-height: calc(90vh - 60px);
    border-radius: 12px;
    margin-top: 40px;   /* <-- отступ под крестик */
}



/* ===== Адаптация под планшеты ===== */
@media (max-width: 900px) {
    .puzzle-preview-button {
        padding: 12px 22px;
        font-size: 1rem;
        width: 100%;
        max-width: 320px;
    }
}

/* ===== Адаптация под телефоны ===== */
@media (max-width: 600px) {
    .puzzle-preview-close-btn {
        top: 6px;
        right: 6px;
        width: 34px;
        height: 34px;
        font-size: 14px;
    }

    .puzzle-preview-window {
        max-width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
        padding: 8px;
        border-radius: 14px;
    }

    .puzzle-preview-image {
        max-height: calc(100vh - 50px);
        border-radius: 10px;
    }

    .puzzle-preview-close-btn {
        top: -10px;
        right: -10px;

        width: 34px;
        height: 34px;

        font-size: 14px;
    }
}

/* Очень маленькие экраны */
@media (max-width: 380px) {
    .puzzle-preview-button {
        font-size: 0.9rem;
        padding: 10px 14px;
    }

    .puzzle-preview-close-btn {
        width: 30px;
        height: 30px;
        font-size: 13px;
    }
}

.memory-sizes {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.memory-size-btn {
    padding: 8px 16px;
    border: 2px solid #bda7f3;
    border-radius: 10px;
    background: #fff;
    color: #51318f;
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.memory-size-btn:hover {
    background: #f0e8ff;
}

.memory-size-btn.active {
    background: #8053e8;
    color: #fff;
    border-color: #45238e;
    box-shadow: 0 3px 0 #45238e;
}

@media (max-width: 600px) {
    .memory-size-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
}

.memory-sizes {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.memory-size-btn {
    padding: 8px 16px;
    border: 2px solid #bda7f3;
    border-radius: 10px;
    background: #fff;
    color: #51318f;
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.memory-size-btn:hover {
    background: #f0e8ff;
}

.memory-size-btn.active {
    background: #8053e8;
    color: #fff;
    border-color: #45238e;
    box-shadow: 0 3px 0 #45238e;
}

.memory-play-again-button {
    padding: 12px 24px;
    border: 3px solid #45238e;
    border-radius: 8px;
    background: #8053e8;
    color: #fff;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 4px 4px 0 #45238e;
}

.memory-play-again-button[hidden] {
    display: none;
}

.mini-game-art-sudoku {
    font-size: 5rem;
    line-height: 1;
    filter: drop-shadow(0 5px 0 rgba(111, 75, 202, 0.2));
}

/* =========================================================
   🔢 СУДОКУ — адаптация под телефоны и планшеты
   ========================================================= */

/* Общий контейнер */
.standalone-mini-game-content .sudoku-game {
    width: 100%;
    max-width: 520px; /* Чуть уменьшил для лучшего вида */
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
    background: #f8f2ff;
    border: 3px solid #6040a8;
    border-radius: 12px;
    box-shadow: 6px 6px 0 #d6c5f5;
}

/* Заголовок с кнопками сложности и таймером */
.sudoku-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.sudoku-difficulty {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.sudoku-diff-btn {
    flex: 1; /* Кнопки растягиваются на всю ширину */
    min-width: 90px;
    padding: 8px 10px;
    border: 2px solid #bda7f3;
    border-radius: 8px;
    background: #fff;
    color: #51318f;
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

.sudoku-diff-btn:hover {
    background: #f0e8ff;
}

.sudoku-diff-btn:active {
    transform: scale(0.96);
}

.sudoku-diff-btn.active {
    background: #8053e8;
    color: #fff;
    border-color: #45238e;
    box-shadow: 0 3px 0 #45238e;
}

.sudoku-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    font-weight: 700;
    color: #51318f;
    padding: 10px 14px;
    background: #fff0a8;
    border: 2px solid #45238e;
    border-radius: 8px;
}

/* Игровое поле */
.sudoku-board {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    width: 100%;
    max-width: 450px;
    margin: 0 auto 16px;
    border: 3px solid #45238e;
    border-radius: 6px;
    background: #fff;
    overflow: hidden; /* Чтобы внутренние ячейки не вылезали за скругленные края */
}

.sudoku-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1; /* Делаем ячейки идеально квадратными */
    border: 1px solid #d6c5f5; /* Тонкая рамка по умолчанию для всех */
    background: #fff;
    font-size: 1.2rem;
    font-weight: 800;
    color: #382273;
    position: relative;
    box-sizing: border-box; /* Важно: рамки не увеличивают размер ячейки */
}

/* Жирные границы справа для каждого 3-го столбца (кроме последнего) */
.sudoku-cell--right-border {
    border-right: 3px solid #45238e;
}

/* Жирные границы снизу для каждого 3-го ряда (кроме последнего) */
.sudoku-cell--bottom-border {
    border-bottom: 3px solid #45238e;
}

/* Убираем внешние границы у крайних ячеек, чтобы не было двойных линий с рамкой доски */
.sudoku-cell:nth-child(9n) {
    border-right: none;
}
.sudoku-cell:nth-last-child(-n+9) {
    border-bottom: none;
}

.sudoku-cell--fixed {
    background: #f0edff;
    color: #45238e;
}

.sudoku-cell--error {
    background: #ffe2eb;
    color: #a52e52;
    animation: shake 0.2s ease-in-out; /* Легкая анимация ошибки */
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

.sudoku-cell input {
    width: 100%;
    height: 100%;
    border: none;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 800;
    color: #51318f;
    background: transparent;
    outline: none;
    /* Убираем стрелочки у input type="number" */
    -moz-appearance: textfield;
}

.sudoku-cell input::-webkit-outer-spin-button,
.sudoku-cell input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.sudoku-cell input:focus {
    background: #fff9d6;
}

/* Результат */
.sudoku-result {
    min-height: 28px;
    margin: 14px 0;
    padding: 10px 14px;
    border-radius: 6px;
    text-align: center;
    font-weight: 800;
    font-size: 1rem;
}

.sudoku-result.success {
    background: #d9ffeb;
    color: #126b4b;
    border: 2px solid #35ae7b;
}

/* Кнопка «Играть ещё» */
.sudoku-actions {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}

.sudoku-new-btn {
    width: 100%;
    padding: 14px 20px;
    border: 3px solid #45238e;
    border-radius: 10px;
    background: #8053e8;
    color: #fff;
    font-weight: 900;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 4px 4px 0 #45238e;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.sudoku-new-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #45238e;
}

.sudoku-new-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #45238e;
}


/* =========================================================
   📱 Адаптация под планшеты (max-width: 768px)
   ========================================================= */
@media (max-width: 768px) {
    .standalone-mini-game-content .sudoku-game {
        padding: 16px;
        max-width: 460px;
    }

    .sudoku-board {
        border-width: 2px;
        aspect-ratio: auto;
    }

    .sudoku-cell {
        font-size: 1rem;
    }

    .sudoku-cell input {
        font-size: 1rem;
    }

    .sudoku-cell--right-border {
        border-right: 2px solid #45238e;
    }

    .sudoku-cell--bottom-border {
        border-bottom: 2px solid #45238e;
    }
}


/* =========================================================
   📱 Адаптация под телефоны (max-width: 480px)
   ========================================================= */
@media (max-width: 480px) {
    /* Контейнер: минимальные отступы, чтобы сетка была шире */
    .standalone-mini-game-content .sudoku-game {
        padding: 8px;
        border-width: 2px;
        border-radius: 8px;
        box-shadow: 4px 4px 0 #d6c5f5;
    }

    /* Кнопки сложности: компактнее */
    .sudoku-diff-btn {
        font-size: 0.75rem;
        padding: 6px 4px;
        min-width: 0;
        border-width: 1.5px;
    }

    /* Информация (ошибки и время) */
    .sudoku-info {
        font-size: 0.8rem;
        padding: 6px 8px;
        border-width: 1.5px;
    }

    /* Сетка */
    .sudoku-board {
        border-width: 2px; /* Тоньше внешняя рамка */
        border-radius: 4px;
        margin-bottom: 10px;
    }

    /* Клетки */
    .sudoku-cell {
        font-size: 0.75rem;
        border-width: 0.4px; /* Очень тонкие линии между клетками */
    }

    .sudoku-cell input {
        font-size: 0.85rem;
    }

    /* Границы между блоками 3х3 */
    .sudoku-cell--right-border {
        border-right: 1.5px solid #45238e;
    }

    .sudoku-cell--bottom-border {
        border-bottom: 1.5px solid #45238e;
    }

    /* Кнопка «Играть ещё» */
    .sudoku-new-btn {
        padding: 10px 12px;
        font-size: 0.8rem;
        border-width: 2px;
        box-shadow: 3px 3px 0 #45238e;
    }

    .sudoku-board {
        max-height: none;        /* Убираем ограничение */
        height: auto;
    }

    .sudoku-cell {
        padding: 0;              /* Убираем внутренние отступы */
        overflow: hidden;        /* Обрезаем всё, что вылезает */
    }

    .sudoku-cell input {
        width: 100%;
        height: 100%;
        padding: 0;              /* Убираем padding у инпута */
        margin: 0;
        font-size: 0.75rem;      /* Уменьшаем шрифт */
        line-height: 1;          /* Убираем лишнюю высоту строки */
        text-align: center;
        border: none;
        background: transparent;
        color: #51318f;
        /* Убираем стандартные отступы браузера */
        box-sizing: border-box;
    }

    /* Для Safari (iPhone) — убираем внутренние отступы */
    .sudoku-cell input::-webkit-outer-spin-button,
    .sudoku-cell input::-webkit-inner-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }
}

/* =========================================================
   📱 Очень маленькие экраны (max-width: 380px)
   ========================================================= */
@media (max-width: 380px) {
    .standalone-mini-game-content .sudoku-game {
        padding: 6px;
    }

    .sudoku-cell {
        font-size: 0.7rem;
    }

    .sudoku-cell input {
        font-size: 0.7rem;
    }

    .sudoku-diff-btn {
        font-size: 0.7rem;
        padding: 5px 2px;
    }

    .sudoku-board {
        aspect-ratio: auto;
        max-height: 340px;
    }

    .sudoku-cell {
        min-height: 32px;
    }

    .sudoku-cell input {
        font-size: 0.65rem;      /* Ещё меньше для маленьких экранов */
    }
}

.sudoku-cell--hint {
    background: #fff3c4;   /* Жёлтый фон */
    color: #805700;
    animation: hintPulse 0.5s ease;
}

@keyframes hintPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.sudoku-hint-btn {
    border: 3px solid #b58a2e;
    border-radius: 8px;
    background: #ffe58a;
    color: #805700;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 4px 4px 0 #b58a2e;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    margin-right: 10px;
}

.sudoku-hint-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #b58a2e;
}

.sudoku-hint-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #b58a2e;
}

.sudoku-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.mini-game-art-draw {
    font-size: 5rem;
    line-height: 1;
    filter: drop-shadow(0 5px 0 rgba(111, 75, 202, 0.2));
}

/* Обертка для холста: задает рамку и скрывает всё лишнее */
.standalone-mini-game-content .draw-canvas-wrapper {
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
    border: 3px solid #6040a8;
    box-shadow: 4px 4px 0 #d6c5f5;
    margin: 15px 0;
    background: #ffffff;
    display: flex;
}

/* Сам холст */
.standalone-mini-game-content .draw-canvas {
    /* Растягиваем на всю ширину обертки */
    width: 100%;
    /* Задаем жесткое соотношение сторон 1000:600 (то есть 5:3) */
    aspect-ratio: 1000 / 600;
    display: block;
    touch-action: none; /* Отключаем скролл при рисовании пальцем */
    cursor: crosshair;
    background: #fff;
}


.draw-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.draw-controls-row {
    display: flex;
    gap: 12px;
    width: 100%;
}

.draw-controls-row .button {
    flex: 1;
    margin-top: 0;
}

.draw-next-button {
    width: 100%;
    margin-top: 0;
}

.draw-room-code,
.draw-word-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.draw-room-code strong,
.draw-word-banner strong {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 10px;
}

.draw-word-banner {
    margin: 12px 0;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 12px;
}

@media (max-width: 480px) {
    .draw-controls-row {
        gap: 8px;
    }

    .draw-controls-row .button {
        padding: 12px 8px;
    }
}

       /* ================================
          DRAW & GUESS — ОБЩИЙ ДИЗАЙН
          ================================ */

.draw-game {
       --draw-purple: #6c55d9;
       --draw-purple-dark: #513bb5;
       --draw-ink: #292343;
       --draw-muted: #77738e;
       --draw-border: #e9e5f5;
       --draw-surface: #ffffff;

       width: 100%;
       max-width: 900px;
       margin: 24px auto;
       color: var(--draw-ink);
       box-sizing: border-box;
}

.draw-game *,
.draw-game *::before,
.draw-game *::after {
    box-sizing: border-box;
}

.draw-game [hidden] {
    display: none !important;
}

/* Лобби */

.draw-lobby {
    padding: clamp(20px, 4vw, 40px);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 28px;
    background:
            radial-gradient(ellipse at top left, #eeeaff 0, transparent 48%),
            linear-gradient(145deg, #ffffff, #f8f6ff);
    box-shadow: 0 18px 55px rgba(55, 38, 112, 0.12);
    text-align: center;
}

.draw-lobby-icon {
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    margin: 0 auto 16px;
    border: 1px solid #e4dcff;
    border-radius: 24px;
    background: #f0ebff;
    font-size: 38px;
}

.draw-title {
    margin: 0;
    color: var(--draw-ink);
    font-size: clamp(25px, 4vw, 34px);
    font-weight: 800;
    letter-spacing: -0.7px;
}

.draw-subtitle {
    max-width: 530px;
    margin: 12px auto 28px;
    color: var(--draw-muted);
    font-size: 15px;
    line-height: 1.65;
}

.draw-lobby-card {
    width: 100%;
    max-width: 540px;
    margin: 0 auto;
    padding: 24px;
    border: 1px solid var(--draw-border);
    border-radius: 22px;
    background: var(--draw-surface);
    box-shadow: 0 8px 24px rgba(56, 40, 105, 0.05);
}

.draw-card-icon {
    margin-bottom: 10px;
    font-size: 28px;
}

.draw-lobby-card h3 {
    margin: 0 0 8px;
    font-size: 19px;
    font-weight: 750;
}

.draw-lobby-card p {
    margin: 0 0 18px;
    color: var(--draw-muted);
    font-size: 14px;
    line-height: 1.55;
}

.draw-game .draw-primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    margin: 0;
    padding: 12px 22px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #7962e8, #6045cb);
    box-shadow: 0 6px 14px rgba(108, 85, 217, 0.22);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.draw-game .draw-primary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 9px 20px rgba(108, 85, 217, 0.3);
}

.draw-game .draw-primary-button:active {
    transform: translateY(0);
}

.draw-game .draw-primary-button:focus-visible,
.draw-game .button:focus-visible,
.draw-game input:focus-visible {
    outline: 3px solid rgba(108, 85, 217, 0.3);
    outline-offset: 3px;
}

.draw-or {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 540px;
    margin: 20px auto;
    color: #a29bb9;
    font-size: 13px;
}

.draw-or::before,
.draw-or::after {
    flex: 1;
    height: 1px;
    background: #e6e0f4;
    content: "";
}

.draw-join-form {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.draw-game .draw-code-input,
.draw-game .draw-guess-form input {
    display: block;
    flex: 1;
    width: 100%;
    min-width: 0;
    min-height: 48px;
    margin: 0;
    padding: 12px 14px;
    border: 1px solid #e2ddef;
    border-radius: 13px;
    background: #fbfaff;
    color: var(--draw-ink);
    font: inherit;
    font-size: 15px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.draw-game .draw-code-input {
    text-align: center;
    font-weight: 800;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.draw-game .draw-code-input:focus,
.draw-game .draw-guess-form input:focus {
    border-color: var(--draw-purple);
    outline: none;
    box-shadow: 0 0 0 4px rgba(108, 85, 217, 0.1);
}

.draw-lobby-status,
.draw-status {
    min-height: 22px;
    margin: 16px 0 0;
    color: var(--draw-muted);
    font-size: 14px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

/* Игровая комната */

.draw-play {
    padding: clamp(14px, 3vw, 28px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 26px;
    background:
            radial-gradient(ellipse at top right, #f0eaff 0, transparent 42%),
            #fbfaff;
    box-shadow: 0 18px 55px rgba(55, 38, 112, 0.12);
}

.draw-game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.draw-game-heading {
    min-width: 0;
}

.draw-eyebrow {
    display: block;
    margin-bottom: 6px;
    color: var(--draw-purple);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.draw-game-heading h2 {
    margin: 0;
    color: var(--draw-ink);
    font-size: clamp(22px, 3.5vw, 30px);
    font-weight: 800;
    letter-spacing: -0.5px;
}

.draw-timer-badge {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 6px;
    padding: 11px 15px;
    border: 1px solid #e6dfff;
    border-radius: 15px;
    background: #f0ebff;
    color: var(--draw-purple-dark);
    font-weight: 800;
}

.draw-timer {
    min-width: 22px;
    font-size: 22px;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.draw-timer-badge small {
    font-size: 11px;
    font-weight: 600;
}

.draw-info-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 12px;
    margin-bottom: 16px;
}

.draw-info-card {
    min-width: 0;
    padding: 15px 17px;
    border: 1px solid var(--draw-border);
    border-radius: 17px;
    background: #fff;
}

.draw-info-label {
    display: block;
    margin-bottom: 8px;
    color: var(--draw-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
}

.draw-role {
    display: inline-block;
    color: var(--draw-purple-dark);
    font-size: 16px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.draw-room-code {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.draw-room-code strong {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 6px 13px;
    border: 1px dashed #b7a8f1;
    border-radius: 10px;
    background: #f5f1ff;
    color: var(--draw-purple-dark);
    font-size: 19px;
    font-weight: 850;
    letter-spacing: 2px;
    overflow-wrap: anywhere;
}

.draw-game .draw-copy-button {
    min-height: 36px;
    margin: 0;
    padding: 7px 11px;
    border-radius: 10px;
    font-size: 12px;
}

/* Слово художника */

.draw-word-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 16px;
    padding: 16px 18px;
    border: 1px solid #d9cdfc;
    border-radius: 17px;
    background: linear-gradient(120deg, #f0eaff, #fff);
    box-shadow: 0 5px 18px rgba(108, 85, 217, 0.07);
}

.draw-word-icon {
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 45px;
    height: 45px;
    border-radius: 14px;
    background: #e4dcff;
    font-size: 23px;
}

.draw-word-banner strong {
    display: inline-block;
    padding: 5px 11px;
    border: 1px solid #c9baf9;
    border-radius: 9px;
    background: #fff;
    color: var(--draw-purple-dark);
    font-size: 20px;
    font-weight: 850;
    overflow-wrap: anywhere;
}

/* Холст */

.draw-board-card {
    min-width: 0;
    padding: clamp(10px, 2vw, 18px);
    border: 1px solid var(--draw-border);
    border-radius: 21px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(56, 40, 105, 0.05);
}

.draw-board-heading {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 13px;
    color: var(--draw-ink);
    font-size: 14px;
    font-weight: 800;
}

.draw-board-hint {
    margin-left: auto;
    color: #9791aa;
    font-size: 11px;
    font-weight: 500;
}

.draw-canvas-wrapper {
    width: 100%;
    overflow: hidden;
    border: 1px solid #e9e5f2;
    border-radius: 14px;
    background: #fff;
    line-height: 0;
}

.draw-game .draw-canvas {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 5 / 3;
    background: #fff;
    touch-action: none;
    cursor: crosshair;
}

/* Кнопки под холстом */

.draw-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}

.draw-controls-row {
    display: flex;
    width: 100%;
    gap: 10px;
}

.draw-controls-row .button,
.draw-next-button {
    display: inline-flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 46px;
    margin: 0;
    padding: 11px 15px;
    border-radius: 13px;
    font-size: 14px;
    font-weight: 750;
    cursor: pointer;
}

.draw-game .draw-next-button {
    width: 100%;
    flex: none;
    border: none;
    background: linear-gradient(135deg, #7962e8, #6045cb);
    color: #fff;
}

.draw-game button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

/* Поле угадывания */

.draw-guess {
    margin-top: 18px;
    padding: 17px;
    border: 1px solid #e2d9fc;
    border-radius: 16px;
    background: #f8f5ff;
}

.draw-guess label {
    display: block;
    margin-bottom: 10px;
    color: var(--draw-ink);
    font-size: 14px;
    font-weight: 750;
}

.draw-guess-form {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.draw-guess-form .draw-primary-button {
    flex-shrink: 0;
}

.draw-status {
    margin-top: 16px;
    text-align: center;
}

/* ================================
   АДАПТАЦИЯ ПОД ТЕЛЕФОНЫ
   ================================ */

@media (max-width: 600px) {
    .draw-game {
        margin: 12px auto;
        border-radius: 20px;
    }

    .draw-lobby {
        padding: 22px 14px;
        border-radius: 21px;
    }

    .draw-lobby-icon {
        width: 62px;
        height: 62px;
        margin-bottom: 12px;
        border-radius: 19px;
        font-size: 31px;
    }

    .draw-subtitle {
        margin: 10px auto 21px;
        font-size: 14px;
    }

    .draw-lobby-card {
        padding: 19px 14px;
        border-radius: 18px;
    }

    .draw-join-form {
        flex-direction: column;
    }

    .draw-join-form .button {
        width: 100%;
    }

    .draw-play {
        padding: 14px 10px;
        border-radius: 20px;
    }

    .draw-game-header {
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 14px;
    }

    .draw-eyebrow {
        font-size: 9px;
        letter-spacing: 1px;
    }

    .draw-game-heading h2 {
        font-size: 21px;
    }

    .draw-timer-badge {
        gap: 4px;
        padding: 8px 9px;
        border-radius: 12px;
    }

    .draw-timer {
        font-size: 19px;
    }

    .draw-info-grid {
        grid-template-columns: 1fr;
        gap: 9px;
        margin-bottom: 12px;
    }

    .draw-info-card {
        padding: 12px 13px;
        border-radius: 14px;
    }

    .draw-info-label {
        margin-bottom: 6px;
        font-size: 9px;
    }

    .draw-role {
        font-size: 15px;
    }

    .draw-room-code strong {
        font-size: 17px;
    }

    .draw-word-banner {
        gap: 10px;
        padding: 12px;
        border-radius: 14px;
    }

    .draw-word-icon {
        width: 38px;
        height: 38px;
        border-radius: 11px;
        font-size: 20px;
    }

    .draw-word-banner strong {
        font-size: 18px;
    }

    .draw-board-card {
        padding: 8px;
        border-radius: 16px;
    }

    .draw-board-heading {
        gap: 6px;
        margin-bottom: 9px;
        font-size: 12px;
    }

    .draw-board-hint {
        width: 100%;
        margin-left: 0;
        font-size: 10px;
    }

    .draw-canvas-wrapper {
        border-radius: 10px;
    }

    .draw-controls {
        gap: 8px;
        margin-top: 10px;
    }

    .draw-controls-row {
        gap: 8px;
    }

    .draw-controls-row .button,
    .draw-next-button {
        min-height: 46px;
        padding: 10px 7px;
        border-radius: 11px;
        font-size: 12px;
    }

    .draw-guess {
        margin-top: 12px;
        padding: 12px;
    }

    .draw-guess-form {
        flex-direction: column;
        gap: 8px;
    }

    .draw-guess-form .draw-primary-button {
        width: 100%;
    }
}

@media (max-width: 360px) {
    .draw-game-heading h2 {
        font-size: 18px;
    }

    .draw-timer-badge {
        padding: 7px;
    }

    .draw-room-code {
        align-items: flex-start;
    }

    .draw-game .draw-copy-button {
        width: 100%;
    }

    .draw-controls-row .button {
        font-size: 11px;
    }
}

.draw-game-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.draw-game .draw-exit-button {
    min-height: 36px;
    margin: 0;
    padding: 8px 13px;
    border: 1px solid #e5def5;
    border-radius: 11px;
    background: #fff;
    color: #65548e;
    font-size: 13px;
    font-weight: 700;
}

.draw-game .draw-exit-button:hover {
    background: #f1edfb;
}

@media (max-width: 600px) {
    .draw-game .draw-exit-button {
        min-height: 40px;
    }
}

.draw-timer-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.draw-pause-button {
    min-width: 44px;
    min-height: 44px;
    padding: 8px 12px;
    font-size: 22px;
    line-height: 1;
}

.draw-controls-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.draw-eraser-button[aria-pressed="true"] {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.draw-timer-controls {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.draw-timer-badge {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

.draw-pause-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    margin: 0;
    font-size: 22px;
    line-height: 1;
}

/* Центральное одноразовое уведомление о новом достижении */
.achievement-notification-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(20, 16, 42, 0.66);
    backdrop-filter: blur(5px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.achievement-notification-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.achievement-notification-modal {
    box-sizing: border-box;
    width: min(100%, 440px);
    padding: 34px 30px 30px;
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 28px;
    background: linear-gradient(155deg, #ffffff 0%, #f7f3ff 100%);
    box-shadow: 0 24px 80px rgba(15, 10, 40, 0.32);
    text-align: center;
    transform: translateY(18px) scale(0.97);
    transition: transform 0.25s ease;
}

.achievement-notification-overlay.is-visible .achievement-notification-modal {
    transform: translateY(0) scale(1);
}

.achievement-notification-confetti {
    margin-bottom: 10px;
    font-size: 23px;
    letter-spacing: 7px;
}

.achievement-notification-icon {
    display: grid;
    place-items: center;
    width: 88px;
    height: 88px;
    margin: 0 auto 16px;
    border-radius: 26px;
    background: linear-gradient(135deg, #eee7ff, #fff1cf);
    font-size: 48px;
    box-shadow: 0 8px 24px rgba(118, 85, 199, 0.16);
}

.achievement-notification-modal h2 {
    margin: 0 0 12px;
    color: #39265f;
    font-size: 27px;
}

.achievement-notification-intro {
    margin: 0 0 6px;
    color: #6d6680;
    font-size: 15px;
}

.achievement-notification-modal h3 {
    margin: 0 0 10px;
    color: #7655c7;
    font-size: 23px;
    overflow-wrap: anywhere;
}

.achievement-notification-description {
    margin: 0 auto 25px;
    max-width: 330px;
    color: #625b70;
    font-size: 15px;
    line-height: 1.5;
}

.achievement-notification-ok {
    min-width: 170px;
    padding: 13px 28px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #7655c7, #667eea);
    color: #fff;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 7px 18px rgba(102, 91, 202, 0.28);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.achievement-notification-ok:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 23px rgba(102, 91, 202, 0.34);
}

.achievement-notification-ok:focus-visible {
    outline: 3px solid #b8a5f0;
    outline-offset: 4px;
}

@media (max-width: 480px) {
    .achievement-notification-modal {
        padding: 28px 20px 24px;
        border-radius: 23px;
    }
    .achievement-notification-modal h2 { font-size: 24px; }
    .achievement-notification-modal h3 { font-size: 21px; }
}

/* Кнопка "Играть ещё" в игре "Собери слово" */
.word-game-play-again {
    display: block;
    margin: 20px auto 0; /* Центрируем */
    background: #8053e8; /* Фиолетовый, как у других кнопок */
    color: #fff;
    border: 3px solid #45238e;
    border-radius: 5px;
    padding: 12px 24px;
    font-weight: 900;
    box-shadow: 4px 4px 0 #45238e;
    cursor: pointer;
    transition: transform 150ms ease, box-shadow 150ms ease;
}

.word-game-play-again:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #45238e;
}

.word-game-play-again:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #45238e;
}

.word-game-play-again[hidden] {
    display: none !important;
}

/* Обертка для всей игры в карточке */
.standalone-mini-game-content .snake-game {
    width: 100%;
    max-width: 100%;
    padding: 0;
    box-sizing: border-box;
}

/* Шапка игры */
.snake-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    background: #fff0a8;
    border: 3px solid #45238e;
    border-radius: 8px;
    padding: 10px 15px;
    margin-bottom: 10px;
    box-shadow: 4px 4px 0 #c9a84b;
}

.snake-settings-button {
    background: #f0edff;
    border: 2px solid #6040a8;
    border-radius: 8px;
    font-size: 1.2rem;
    padding: 6px 10px;
    cursor: pointer;
    box-shadow: 2px 2px 0 #c0a6ed;
}

.snake-settings-button:active {
    transform: translateY(2px);
    box-shadow: none;
}

/* Меню настроек */
.snake-settings-menu {
    margin-bottom: 15px;
    padding: 15px;
    background: #f8f2ff;
    border: 3px solid #6040a8;
    border-radius: 8px;
    box-shadow: 4px 4px 0 #d6c5f5;
}

.snake-settings-title {
    margin: 0 0 12px;
    font-weight: 900;
    color: #382273;
    text-align: center;
    font-size: 1.1rem;
}

.snake-settings-option {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
    font-size: 0.95rem;
    color: #382273;
    cursor: pointer;
}

.snake-settings-note {
    margin: 12px 0;
    font-size: 0.85rem;
    color: #6b5a88;
    text-align: center;
}

.snake-settings-close-btn {
    width: 100%;
    margin-top: 10px;
}

/* Крестовина */
.snake-dpad {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin: 15px auto;
    width: fit-content;
}

.snake-dpad-middle {
    display: flex;
    gap: 70px;
}

.snake-dpad-btn {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
    font-weight: 900;
    color: #fff;
    background: #8053e8;
    border: 3px solid #45238e;
    border-radius: 12px;
    box-shadow: 0 5px 0 #45238e;
    cursor: pointer;
    transition: all 0.1s ease;
    user-select: none;
    -webkit-user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.snake-dpad-btn:active {
    transform: translateY(4px);
    box-shadow: 0 1px 0 #45238e;
}

/* Центрирование холста */
.snake-board-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 15px;
}

/* РАСШИРЕНИЕ ПОЛЯ НА ТЕЛЕФОНАХ */
@media (max-width: 600px) {
    /* Расширяем саму игровую область, отодвигая рамки карточки */
    .standalone-mini-game-content .snake-game {
        padding: 0 5px; /* Оставляем небольшой отступ, чтобы декорации не перекрывали */
    }

    .standalone-mini-game-content .snake-canvas {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        aspect-ratio: 1 / 1;
        display: block;
        box-sizing: border-box;
    }

    .snake-board-wrapper {
        margin: 0 0 15px 0;
        padding: 0;
        width: 100%;
    }
}

/* Жесткое скрытие крестовины, если на ней есть атрибут hidden */
.snake-dpad[hidden] {
    display: none !important;
}

/* Крестовина */
.snake-dpad {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin: 15px auto;
    width: fit-content;
}

/* =========================================================
   🐍 ЗМЕЙКА: НОВЫЙ ДИЗАЙН
   ========================================================= */

/* Общий контейнер */
.standalone-mini-game-content .snake-game {
    width: 100%;
    max-width: 100%;
    padding: 0;
    box-sizing: border-box;
    position: relative;
}

/* Шапка */
.snake-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff0a8;
    border: 3px solid #45238e;
    border-radius: 12px;
    padding: 10px 15px;
    margin-bottom: 15px;
    box-shadow: 0 4px 0 #c9a84b;
}

/* Левая и правая колонки (Длина и Рекорд) */
.snake-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 65px; /* Чтобы шестеренка всегда была ровно по центру */
}

.snake-stat-right {
    align-items: flex-end;
}

.snake-stat-label {
    font-size: 0.7rem;
    font-weight: 800;
    color: #8b6b00;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.snake-score,
.snake-best {
    font-size: 1.2rem;
    font-weight: 900;
    color: #382273;
    line-height: 1;
}

/* Шестеренка по центру */
.snake-settings-wrapper {
    display: flex;
    justify-content: center;
    flex: 1;
}

.snake-settings-button {
    background: #fff;
    border: 2px solid #6040a8;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 3px 0 #c0a6ed;
    transition: transform 0.1s, box-shadow 0.1s;
}

.snake-settings-button:active {
    transform: translateY(3px);
    box-shadow: none;
}

/* Модальное окно настроек */
.snake-settings-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(56, 34, 115, 0.7);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 12px;
}

.snake-settings-overlay[hidden] {
    display: none !important;
}

.snake-settings-modal {
    background: #f8f2ff;
    border: 3px solid #6040a8;
    border-radius: 16px;
    padding: 20px;
    width: 90%;
    max-width: 320px;
    box-shadow: 0 8px 0 #45238e;
}

.snake-settings-title {
    margin: 0 0 15px;
    font-size: 1.1rem;
    font-weight: 900;
    color: #382273;
    text-align: center;
}

/* Кастомные радио-кнопки */
.snake-settings-option {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    color: #382273;
    font-weight: 600;
}

.snake-settings-option input[type="radio"] {
    display: none;
}

.snake-radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #6040a8;
    border-radius: 50%;
    background: #fff;
    position: relative;
    flex-shrink: 0;
}

.snake-settings-option input[type="radio"]:checked + .snake-radio-custom::after {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: #8053e8;
    border-radius: 50%;
}

.snake-settings-note {
    margin: 15px 0;
    font-size: 0.8rem;
    color: #6b5a88;
    text-align: center;
    padding-top: 10px;
    border-top: 1px dashed #c0a6ed;
}

.snake-settings-close-btn {
    width: 100%;
    padding: 12px;
    background: #8053e8;
    color: #fff;
    border: 3px solid #45238e;
    border-radius: 8px;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 0 #45238e;
}

.snake-settings-close-btn:active {
    transform: translateY(4px);
    box-shadow: none;
}

/* Игровое поле */
.snake-board-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 15px;
}

.snake-canvas {
    border: 3px solid #6040a8;
    border-radius: 12px;
    box-shadow: 0 4px 0 #d6c5f5;
    background: #fff;
}

/* Крестовина */
.snake-dpad {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin: 10px auto;
    width: fit-content;
    user-select: none;
}

.snake-dpad[hidden] {
    display: none !important;
}

.snake-dpad-middle {
    display: flex;
    gap: 50px; /* Было 70px — теперь компактнее */
}

.snake-dpad-btn {
    width: 50px;      /* Было 60px */
    height: 50px;
    font-size: 1.2rem; /* Было 1.5rem */
    font-weight: 900;
    color: #fff;
    background: #8053e8;
    border: 3px solid #45238e;
    border-radius: 10px;
    box-shadow: 0 4px 0 #45238e;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.snake-dpad-btn:active {
    transform: translateY(4px);
    box-shadow: none;
}

/* Кнопки старта/рестарта */
.snake-controls {
    display: flex;
    justify-content: center;
}

.snake-start-button, .snake-restart-button {
    padding: 12px 24px;
    background: #8053e8;
    color: #fff;
    border: 3px solid #45238e;
    border-radius: 8px;
    font-weight: 900;
    font-size: 1rem;
    box-shadow: 0 4px 0 #45238e;
    cursor: pointer;
}

.snake-start-button:active, .snake-restart-button:active {
    transform: translateY(4px);
    box-shadow: none;
}

.snake-result {
    text-align: center;
    margin-top: 15px;
    font-weight: 800;
    color: #382273;
}

/* Мобильная адаптация */
@media (max-width: 600px) {
    .standalone-mini-game-content .snake-game {
        padding: 0 5px;
    }

    .snake-canvas {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 1 / 1;
    }

    .snake-header {
        padding: 8px 12px;
        margin-bottom: 10px;
    }

    .snake-score, .snake-best {
        font-size: 1.1rem;
    }

    .snake-dpad-btn {
        width: 55px;
        height: 55px;
        font-size: 1.3rem;
    }
    .snake-dpad-middle {
        gap: 55px;
    }
}

@media (min-width: 601px) and (max-width: 1024px) {
    /* Делаем игровое поле чуть больше, но не на весь экран */
    .snake-canvas {
        max-width: 500px;
        width: 100%;
        margin: 0 auto;
    }

    /* Увеличиваем шрифты в шапке, чтобы было удобнее смотреть */
    .snake-score,
    .snake-best {
        font-size: 1.4rem;
    }

    .snake-stat-label {
        font-size: 0.8rem;
    }

    /* Делаем кнопку настроек чуть больше */
    .snake-settings-button {
        width: 44px;
        height: 44px;
        font-size: 1.3rem;
    }

    /* Увеличиваем кнопки крестовины для пальцев */
    .snake-dpad-btn {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }

    .snake-dpad-middle {
        gap: 80px;
    }

    /* Меню настроек делаем чуть шире */
    .snake-settings-modal {
        max-width: 400px;
        padding: 24px;
    }

    .snake-settings-option {
        font-size: 1.05rem;
        margin-bottom: 14px;
    }

    .snake-settings-title {
        font-size: 1.25rem;
    }

    .snake-settings-close-btn {
        padding: 14px;
        font-size: 1.1rem;
    }
}

/* Маленькие планшеты в портретной ориентации (до 768px) */
@media (min-width: 601px) and (max-width: 768px) {
    .snake-canvas {
        max-width: 420px;
    }
}

/* =========================================================
   📌 СТРАНИЦА «ИЗБРАННОЕ» — ЖУРНАЛЬНЫЙ СТИЛЬ
   ========================================================= */

/* Фон для всей страницы (переопределяем стандартный body) */
body.favorites-page {
    background: #fdfaf6; /* Тёплый кремовый фон */
    background-image: radial-gradient(#f0e6d2 1px, transparent 1px);
    background-size: 30px 30px;
    color: #2c2a38;
}

/* Шапка сайта на этой странице */
body.favorites-page .site-header {
    border-bottom: 3px solid #e8e2d9;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

body.favorites-page .site-header-brand .hero-badge {
    color: #8b7355;
    border-color: #e8e2d9;
}

body.favorites-page .site-header-username,
body.favorites-page .site-header-link {
    color: #4a4a5a;
}

body.favorites-page .site-header-username:hover,
body.favorites-page .site-header-link:hover {
    color: #2c2a38;
}

/* Контейнер */
.favorites-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

/* Заголовок страницы */
.favorites-hero {
    text-align: center;
    margin-bottom: 40px;
}

.favorites-hero-icon {
    display: block;
    font-size: 48px;
    margin-bottom: 10px;
    filter: drop-shadow(0 4px 6px rgba(240, 180, 41, 0.3));
}

.favorites-hero h1 {
    margin: 0 0 8px;
    color: #2c2a38;
    font-size: clamp(28px, 5vw, 42px);
    font-weight: 900;
    letter-spacing: -1px;
}

.favorites-hero p {
    margin: 0;
    color: #8b8398;
    font-size: 16px;
}

/* Пустой экран */
.favorites-empty {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 24px;
    border: 2px dashed #e8e2d9;
    margin-top: 20px;
}

.favorites-empty-art {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.8;
}

.favorites-empty h2 {
    margin: 0 0 8px;
    color: #2c2a38;
    font-size: 24px;
}

.favorites-empty p {
    margin: 0 0 24px;
    color: #8b8398;
}

/* Сетка карточек */
.favorites-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Карточка */
.favorite-card {
    display: flex;
    background: #ffffff;
    background-image: repeating-linear-gradient(
            45deg,
            #fdfaf6,
            #fdfaf6 10px,
            #f7f0e6 10px,
            #f7f0e6 20px
    );
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(100, 80, 60, 0.08);
    border: 1px solid #f0e6d2;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    position: relative;
}

.favorite-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(100, 80, 60, 0.12);
}

.favorite-card.is-expanded {
    transform: translateY(0);
    box-shadow: 0 8px 25px rgba(100, 80, 60, 0.15);
}

.favorite-card.has-image {
    background-image: none;
    background: #ffffff;
}

.favorite-card-image {
    width: 280px;
    flex-shrink: 0;
    background: #f0e6d2;
    position: relative;
    display: flex;
}

.favorite-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.favorite-card-content {
    padding: 28px;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
}

.favorite-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.favorite-card-header h2 {
    margin: 0;
    color: #2c2a38;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.3;
}

/* Кнопка удаления */
.favorite-delete-form {
    margin: 0;
    flex-shrink: 0;
}

.favorite-delete-btn {
    background: #fdfaf6;
    border: 1px solid #e8e2d9;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8b8398;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.favorite-delete-btn:hover {
    background: #ffe2e2;
    color: #d9534f;
    border-color: #ffc9c9;
    transform: scale(1.1);
}

/* Теги (категория, время, место) */
.favorite-meta-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.favorite-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: #fdfaf6;
    border: 1px solid #f0e6d2;
    border-radius: 8px;
    color: #7a6e5f;
    font-size: 13px;
    font-weight: 600;
}

.favorite-tag--category {
    background: #f0e6d2;
    color: #5d4a37;
    border-color: #e0d0b8;
}

/* Описание */
.favorite-card-desc {
    margin: 0 0 20px;
    color: #6b6478;
    font-size: 15px;
    line-height: 1.6;
    flex: 1;
}

/* Детали (аккордеон) */
.favorite-details {
    margin-top: auto;
    border-top: 1px solid #f0e6d2;
    padding-top: 16px;
}

.favorite-details-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    color: #7a6e5f;
    font-size: 14px;
    font-weight: 700;
    list-style: none;
    padding: 8px 0;
}

.favorite-details-toggle::-webkit-details-marker {
    display: none;
}

.favorite-details-toggle:hover {
    color: #5d4a37;
}

.favorite-details-arrow {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.favorite-details[open] .favorite-details-arrow {
    transform: rotate(180deg);
}

.favorite-details-content {
    padding-top: 16px;
    animation: slideDown 0.3s ease;
}

.favorite-details-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding: 12px 16px;
    background: #fdfaf6;
    border: 1px solid #f0e6d2;
    border-radius: 12px;
    color: #7a6e5f;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.2s ease;
    user-select: none;
}

.favorite-details-trigger:hover {
    background: #f0e6d2;
    color: #5d4a37;
}

.favorite-trigger-arrow {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.favorite-details-trigger.is-open .favorite-trigger-arrow {
    transform: rotate(180deg);
}

/* Контент (скрыт по умолчанию) */
.favorite-details-content {
    display: none;
    margin-top: 16px;
    animation: slideDown 0.3s ease;
}

.favorite-details-content.is-open {
    display: block;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Секции внутри деталей */
.favorite-section {
    margin-bottom: 16px;
    padding: 16px;
    background: #fdfaf6;
    border-radius: 12px;
    border-left: 3px solid #d4c5b0;
}

.favorite-section h3 {
    margin: 0 0 8px;
    color: #5d4a37;
    font-size: 15px;
    font-weight: 800;
}

.favorite-section p {
    margin: 0;
    color: #6b6478;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-line;
}

.favorite-section--fact {
    background: #fffdf5;
    border-left-color: #f0b429;
}

/* Материалы */
.favorite-materials {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed #e8e2d9;
}

.favorite-materials h3 {
    margin: 0 0 12px;
    color: #5d4a37;
    font-size: 15px;
    font-weight: 800;
}

.favorite-materials-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.favorite-material-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #ffffff;
    border: 1px solid #e0d0b8;
    border-radius: 10px;
    color: #5d4a37;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.2s ease;
}

.favorite-material-btn:hover {
    background: #f0e6d2;
    transform: translateY(-2px);
}

/* Подвал */
.favorites-footer {
    text-align: center;
    margin-top: 48px;
}

.favorites-footer .button {
    background: #5d4a37;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 999px;
    font-weight: 700;
    box-shadow: 0 6px 20px rgba(93, 74, 55, 0.2);
}

.favorites-footer .button:hover {
    background: #4a3a2a;
    box-shadow: 0 8px 25px rgba(93, 74, 55, 0.3);
}

/* =========================================================
   АДАПТИВ ПОД МОБИЛЬНЫЕ
   ========================================================= */
@media (max-width: 768px) {
    .favorite-card {
        flex-direction: column;
        background: #ffffff;
        background-image: none;
        cursor: pointer;
    }

    .favorite-card.has-image .favorite-card-image {
        height: 180px;
    }

    .favorite-card-content {
        padding: 20px;
        background: transparent;
        backdrop-filter: none;
    }

    .favorite-card-header {
        margin-bottom: 12px;
    }

    .favorite-card-header h2 {
        font-size: 19px;
    }

    /* Скрываем длинное описание в свернутом виде, чтобы карточка была компактной */
    .favorite-card-desc {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin-bottom: 12px;
        font-size: 14px;
    }

    .favorite-card.is-expanded .favorite-card-desc {
        -webkit-line-clamp: unset;
        display: block;
    }

    /* Кнопка "Подробнее" на мобилке выглядит как большая зона для тапа */
    .favorite-details-trigger {
        margin-top: 8px;
        margin-bottom: 8px;
        padding: 14px;
        background: #fdfaf6;
        border: 2px dashed #e8e2d9;
        border-radius: 12px;
        justify-content: center;
        gap: 8px;
    }

    .favorite-details-trigger.is-open {
        background: #f0e6d2;
        border-style: solid;
    }

    /* Скрываем стрелочку, чтобы не загромождать */
    .favorite-trigger-arrow {
        display: none;
    }

    .favorite-trigger-text::after {
        content: " 👆";
    }

    .favorite-details-trigger.is-open .favorite-trigger-text::after {
        content: " 👇";
    }

    .favorite-details-content.is-open {
        padding-top: 8px;
    }
}

@media (max-width: 480px) {
    .favorites-container {
        padding: 20px 14px 60px;
    }

    .favorites-hero-icon {
        font-size: 38px;
    }

    .favorite-card-image {
        height: 160px;
    }
}

/* =========================================================
   🕵️ ШПИОН: ОБЩИЕ СТИЛИ
   ========================================================= */

/* Наследуем базовые стили от .draw-game, так как HTML использует те же классы */
.spy-game {
    width: 100%;
    max-width: 900px;
    margin: 24px auto;
    color: #292343;
    box-sizing: border-box;
}

/* Карточка с локацией/ролью */
.spy-card-display {
    background: linear-gradient(145deg, #ffffff, #f4efff);
    border: 2px solid #c5a7ff;
    border-radius: 20px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(80, 60, 150, 0.15);
    margin-bottom: 20px;
}

.spy-card-role {
    font-size: 2.5rem;
    font-weight: 900;
    color: #51318f;
    margin-bottom: 15px;
    text-shadow: 0 3px 0 rgba(111, 75, 202, 0.15);
}

.spy-card-location {
    font-size: 1.5rem;
    font-weight: 700;
    color: #6b5a88;
}

/* Список игроков */
.spy-players-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 10px;
}

.spy-player-tag {
    background: #f0edff;
    color: #51318f;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
}

/* Кнопка выхода (дверь) */
.draw-exit-button {
    background: #ffe2e2;
    color: #d9534f;
    border: 2px solid #ffc9c9;
    font-weight: 800;
    padding: 8px 16px;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.draw-exit-button:hover {
    background: #ffc9c9;
    transform: translateY(-2px);
}

/* Таймер */
.draw-timer-badge {
    background: #fff0a8;
    border: 2px solid #c9a84b;
    color: #8b6b00;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 900;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mini-game-art-spy {
    font-size: 5rem;
    line-height: 1;
    filter: drop-shadow(0 5px 0 rgba(111, 75, 202, 0.2));
}
/* =========================================================
   📱 АДАПТАЦИЯ ПОД ТЕЛЕФОНЫ И ПЛАНШЕТЫ
   ========================================================= */

@media (max-width: 768px) {
    .draw-game {
        margin: 12px auto;
    }

    .draw-lobby {
        padding: 20px 14px;
        border-radius: 20px;
    }

    .draw-play {
        padding: 16px 12px;
        border-radius: 20px;
    }

    .draw-game-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .draw-timer-controls {
        align-self: flex-end;
    }

    .draw-info-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .draw-info-card {
        padding: 12px 14px;
    }

    .spy-card-role {
        font-size: 2rem;
    }

    .spy-card-location {
        font-size: 1.2rem;
    }

    .draw-controls-row {
        flex-direction: column;
        gap: 8px;
    }

    .draw-controls-row .button,
    .draw-next-button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .draw-game-heading h2 {
        font-size: 20px;
    }

    .draw-room-code strong {
        font-size: 16px;
    }

    .spy-card-display {
        padding: 20px 12px;
    }

    .spy-card-role {
        font-size: 1.8rem;
    }

    .spy-card-location {
        font-size: 1rem;
    }

    .draw-join-form {
        flex-direction: column;
    }

    .draw-join-form .button {
        width: 100%;
    }
}

.spy-copy-button.copied {
    color: #26966d;
    background: #e8f8f0;
    border-color: #bcebd2;
}

.spy-copy-button {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e6f2;
    border-radius: 11px;
    background: #f6f6ff;
    color: var(--spy-primary);
    cursor: pointer;
    transition: background .2s, transform .2s;
}

.spy-copy-button:hover {
    background: #e9eaff;
    transform: translateY(-2px);
}

.spy-copy-button:active {
    transform: scale(.94);
}

.spy-copy-feedback {
    display: block;
    min-height: 15px;
    margin-top: 5px;
    color: #26966d;
    font-size: 11px;
}

/* ========================================
   SECRET SPY CARD
======================================== */

.spy-secret-card {
    position: relative;
    width: 100%;
    margin-top: 24px;
    overflow: hidden;
    border: 1px solid #e8e3fa;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 12px 35px rgba(78, 55, 130, .09);
}

.spy-secret-header {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 20px 24px;
    border-bottom: 1px solid #efedf7;
}

.spy-secret-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 43px;
    height: 43px;
    flex-shrink: 0;
    border-radius: 13px;
    background: #f0edff;
    font-size: 22px;
}

.spy-secret-header h3 {
    margin: 3px 0 0;
    color: #29264b;
    font-size: 17px;
    font-weight: 800;
}

.spy-secret-eyebrow {
    color: #8b78d6;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 2px;
}

.spy-secret-lock {
    margin-left: auto;
    font-size: 20px;
    opacity: .6;
}

.spy-secret-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 390px;
    padding: 45px 24px 38px;
    overflow: hidden;
    text-align: center;
    background:
            radial-gradient(ellipse at 50% 15%, rgba(255,255,255,.95), transparent 60%),
            linear-gradient(145deg, #f5f2ff 0%, #fdfbff 48%, #f0edff 100%);
}

.spy-secret-decoration {
    position: absolute;
    width: 190px;
    height: 190px;
    border: 1px solid rgba(128, 104, 202, .09);
    border-radius: 50%;
    pointer-events: none;
}

.spy-decoration-one {
    top: -105px;
    right: -65px;
}

.spy-decoration-two {
    bottom: -135px;
    left: -70px;
    width: 250px;
    height: 250px;
}

.spy-secret-symbol {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 112px;
    height: 112px;
    margin-bottom: 24px;
    border: 1px solid rgba(255,255,255,.8);
    border-radius: 32px;
    background: linear-gradient(145deg, #fff, #eae4ff);
    box-shadow:
            0 12px 30px rgba(105, 80, 180, .13),
            inset 0 1px 2px #fff;
}

.spy-secret-symbol span {
    font-size: 57px;
    line-height: 1;
}

.spy-secret-caption {
    position: relative;
    color: #8979bd;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 3px;
}

.spy-secret-content h1 {
    position: relative;
    margin: 12px 0 17px;
    color: #5841a3;
    font-size: clamp(29px, 5vw, 42px);
    line-height: 1.15;
    font-weight: 900;
    letter-spacing: 1px;
}

.spy-secret-divider {
    width: 55px;
    height: 3px;
    margin: 0 auto 20px;
    border-radius: 5px;
    background: linear-gradient(90deg, #8c72ed, #c0a5f5);
}

.spy-secret-location {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    max-width: 100%;
    padding: 13px 20px;
    border: 1px solid #e7e0fa;
    border-radius: 14px;
    background: rgba(255,255,255,.78);
    box-shadow: 0 5px 15px rgba(80, 60, 130, .04);
}

.spy-location-icon {
    font-size: 20px;
}

.spy-secret-location p {
    margin: 0;
    color: #51456e;
    font-size: 19px;
    font-weight: 700;
}

.spy-secret-hint {
    position: relative;
    max-width: 360px;
    margin: 22px 0 0;
    color: #88829d;
    font-size: 12px;
    line-height: 1.6;
}

.spy-secret-footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 15px 23px;
    color: #aaa3c2;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

/* Телефоны */

@media (max-width: 600px) {
    .spy-secret-header {
        padding: 16px;
    }

    .spy-secret-content {
        min-height: 340px;
        padding: 35px 16px;
    }

    .spy-secret-symbol {
        width: 95px;
        height: 95px;
        border-radius: 27px;
    }

    .spy-secret-symbol span {
        font-size: 49px;
    }

    .spy-secret-location p {
        font-size: 16px;
    }

    .spy-secret-footer {
        padding: 13px 15px;
        font-size: 8px;
    }
}

.draw-join-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.draw-join-form input {
    box-sizing: border-box;
    width: 100%;
    min-height: 46px;
    padding: 12px 15px;
    border: 1px solid #ded9ec;
    border-radius: 12px;
    background: #fff;
    font-size: 15px;
    outline: none;
}

.draw-join-form input:focus {
    border-color: #8b78d6;
    box-shadow: 0 0 0 3px rgba(139, 120, 214, .12);
}

.draw-join-form button {
    width: 100%;
    min-height: 46px;
}

/* =========================================================
   🏠 ГЛАВНАЯ СТРАНИЦА: ФОН
   ========================================================= */

body.main-page {
    /* Путь к картинке (положите файл в static/images/) */
    background-image: url('/images/indexfon.png');

    /* Растягиваем картинку на весь экран */
    background-size: cover;

    /* Центрируем */
    background-position: center center;

    /* Фон не скроллится при прокрутке */
    background-attachment: fixed;

    /* Запасной цвет на время загрузки */
    background-color: #e6e2fa;

    /* Убираем старый градиент у этой страницы */
    background-repeat: no-repeat;
}

/* Легкая затемняющая подложка для читаемости текста (опционально) */
body.main-page::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.15); /* Совсем легкая дымка */
    pointer-events: none;
    z-index: 0;
}

/* Контент должен быть выше дымки */
body.main-page .site-header,
body.main-page .container,
body.main-page .cookie-banner {
    position: relative;
    z-index: 1;
}

/* ========================================
   ЕДИНАЯ ШАПКА САЙТА (ОБНОВЛЕННАЯ)
   ======================================== */

.site-header {
    width: 100%;
    min-height: 76px;
    box-sizing: border-box;

    padding: 12px clamp(20px, 4.5%, 72px);

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    /* Полупрозрачный фон с эффектом стекла */
    background: rgba(255, 255, 255, 0.65); /* Белый с прозрачностью */
    backdrop-filter: blur(12px); /* Размытие того, что под шапкой */
    -webkit-backdrop-filter: blur(12px); /* Для Safari */

    /* Легкая тень, чтобы отделить от контента */
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);

    /* Фиксируем шапку сверху (опционально, но удобно) */
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Меняем цвета текста на шапке для контраста */
.site-header-username,
.site-header-link {
    color: #382273; /* Темно-фиолетовый текст вместо белого */
    font-family: inherit;
    font-size: 15px;
    font-weight: 700; /* Сделал чуть жирнее для читаемости */
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.2s ease;
}

.site-header-username:hover,
.site-header-link:hover {
    opacity: 0.7;
}

.site-header-register {
    padding: 10px 17px;
    border: 2px solid #6040a8; /* Фиолетовая рамка */
    border-radius: 11px;
    color: #6040a8;
}

.site-header-register:hover {
    background: #6040a8;
    color: white;
}

.site-header-brand .hero-badge {
    background: rgba(255, 255, 255, 0.5);
    border-color: rgba(96, 64, 168, 0.3);
    color: #382273; /* Темный текст */
    backdrop-filter: none;
}

/* =========================================================
   🎨 ЦВЕТА ТЕКСТА ДЛЯ ГЛАВНОЙ СТРАНИЦЫ
   ========================================================= */

/* Основной текст и заголовки */
body.main-page {
    color: #382273; /* Темно-фиолетовый для всего текста */
}

/* Заголовок H1 (Чем займёмся сегодня?) */
body.main-page h1 {
    color: #ffffff; /* Оставляем белым, но добавим тень */
    text-shadow: 0 4px 15px rgba(56, 34, 115, 0.4),
    0 2px 4px rgba(0, 0, 0, 0.2);
    font-weight: 900;
}

/* Подзаголовок */
body.main-page .subtitle {
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(56, 34, 115, 0.3);
    font-weight: 600;
    font-size: 18px;
}

/* Заголовки секций (Что тебе хочется?, Сколько у тебя времени?) */
body.main-page h2,
body.main-page .section-title {
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(56, 34, 115, 0.3);/* Легкая белая тень для объема */
    font-weight: 800;
}

/* Текст в карточках (Активность, Творчество и т.д.) */
body.main-page .category-title {
    color: #302c3b;
    text-shadow: none;
}

body.main-page .category-description {
    color: #7a758a;
    text-shadow: none;
}

/* =========================================================
   🔐 СТРАНИЦЫ ВХОДА И РЕГИСТРАЦИИ
   ========================================================= */

/* Фон для этих страниц (та же картинка, что и на главной) */
body:has(.auth-container) {
    background-image: url('/images/main-bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-color: #e6e2fa;
}

/* Контейнер по центру экрана */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 100px); /* Вычитаем высоту шапки */
    padding: 40px 20px;
}

/* Сама карточка (эффект матового стекла) */
.auth-card {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 50px rgba(56, 34, 115, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.6);
    animation: authAppear 0.4s ease-out;
}

@keyframes authAppear {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Заголовок и иконка */
.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-icon {
    display: inline-block;
    font-size: 48px;
    margin-bottom: 10px;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.1));
}

.auth-header h1 {
    font-size: 32px;
    color: #382273;
    margin: 0 0 8px 0;
    font-weight: 900;
}

.auth-subtitle {
    color: #6b5a88;
    font-size: 15px;
    margin: 0;
}

/* Форма */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-form label {
    color: #382273;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: -8px; /* Прижимаем к полю */
}

.auth-form input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e5e0f0;
    border-radius: 14px;
    background: #fbfaff;
    color: #333;
    font-size: 16px;
    transition: all 0.2s ease;
}

.auth-form input:focus {
    outline: none;
    border-color: #8351ff;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(131, 81, 255, 0.15);
}

/* Поле пароля (чтобы глазик был внутри) */
.password-field {
    position: relative;
    display: flex;
    align-items: center;
}

.password-field input {
    padding-right: 48px; /* Место под кнопку */
}

/* Кнопка "Войти" */
.auth-form .button {
    margin-top: 10px;
    padding: 16px;
    font-size: 17px;
    border-radius: 14px;
    background: linear-gradient(135deg, #8351ff, #6336e8);
    box-shadow: 0 8px 20px rgba(99, 54, 232, 0.3);
    color: white;
    font-weight: 800;
    text-transform: none; /* Убираем капс, если был */
    letter-spacing: 0.5px;
}

.auth-form .button:hover {
    background: linear-gradient(135deg, #9571ff, #7348f0);
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(99, 54, 232, 0.4);
}

/* Ссылки внизу */
.auth-link {
    text-align: center;
    margin-top: 25px;
    color: #6b5a88;
    font-size: 15px;
}

.auth-link a {
    color: #8351ff;
    font-weight: 800;
    text-decoration: none;
    transition: color 0.2s;
}

.auth-link a:hover {
    color: #6336e8;
    text-decoration: underline;
}

/* Сообщения об ошибках */
.auth-error {
    background: #ffe2eb;
    color: #a52e52;
    border: 1px solid #f3b7ca;
    padding: 12px;
    border-radius: 12px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 20px;
}

.auth-success {
    background: #d9ffeb;
    color: #126b4b;
    border: 1px solid #9cddbd;
    padding: 12px;
    border-radius: 12px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 20px;
}

/* Адаптация под телефоны */
@media (max-width: 480px) {
    .auth-card {
        padding: 30px 20px;
        border-radius: 20px;
    }

    .auth-header h1 {
        font-size: 26px;
    }

    .auth-icon {
        font-size: 38px;
    }
}

/* =========================================================
   📖 СТРАНИЦА ЗАНЯТИЯ: НОВЫЙ НЕЖНЫЙ ФОН
   ========================================================= */

/* 1. Красивый градиентный фон (лаванда + персик) */
body.activity-page {
    background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%) !important;
    background-attachment: fixed !important;
    min-height: 100vh;
}

/* 2. Заголовок страницы (чтобы был виден на фоне) */
body.activity-page h1 {
    color: #ffffff !important;
    text-shadow: 0 4px 15px rgba(56, 34, 115, 0.4) !important;
    font-weight: 900 !important;
}

/* 3. Убедимся, что контейнер не растягивается */
body.activity-page .container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

/* 4. Плашка "Для тебя" (если есть) — делаем контрастнее на фоне */
body.activity-page .personal-recommendation {
    background: linear-gradient(135deg, #fff0c9 0%, #ffe4a3 100%) !important;
    border: 1px solid #f0c419 !important;
    box-shadow: 0 10px 30px rgba(240, 196, 25, 0.2) !important;
}

/* =========================================================
   👤 ЛИЧНЫЙ КАБИНЕТ: ФИНАЛЬНЫЙ ДИЗАЙН (ПЕРЕБИВАЕТ ВСЁ)
   ========================================================= */

/* --- 1. ОБЩИЙ ФОН И ШАПКА --- */
body.section-page {
    background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%) !important;
    background-attachment: fixed !important;
    color: #2d3748 !important;
    min-height: 100vh;
}

body.section-page .section-header {
    background: rgba(255, 255, 255, 0.6) !important;
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.8) !important;
}

/* --- 2. СЕТКА (ДВЕ КОЛОНКИ) --- */
body.section-page .section-layout {
    display: grid !important;
    grid-template-columns: 340px 1fr !important;
    gap: 30px !important;
    max-width: 1100px !important;
    margin: 40px auto 60px !important;
    padding: 0 20px !important;
    align-items: start !important;
}

/* --- 3. ЛЕВАЯ КОЛОНКА (ПРОФИЛЬ) --- */
body.section-page .profile-card {
    background: #ffffff !important; /* Чистый белый */
    border-radius: 32px !important;
    padding: 40px 30px !important;
    box-shadow: 0 20px 40px rgba(160, 140, 220, 0.15) !important;
    border: 1px solid #ffffff !important;
    text-align: center !important;
}

body.section-page .profile-name {
    font-size: 28px !important;
    font-weight: 900 !important;
    color: #1a202c !important;
}

/* Сетка кнопок */
body.section-page .profile-actions-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    margin-top: 25px !important;
}

/* Общие стили кнопок */
body.section-page .achievements-section-button,
body.section-page .favorites-section-button,
body.section-page .my-activity-section-button {
    background: #f8fafc !important;
    border: 2px solid #f0ebff !important;
    border-radius: 20px !important;
    padding: 16px 20px !important;
    min-height: 72px !important; /* Одинаковая высота */
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    color: #4a5568 !important;
    font-weight: 800 !important;
    font-size: 16px !important;
    text-decoration: none !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02) !important;
    transition: all 0.3s ease !important;
    margin: 0 !important; /* Убираем старые отступы */
}

/* Эффект наведения */
body.section-page .achievements-section-button:hover,
body.section-page .favorites-section-button:hover,
body.section-page .my-activity-section-button:hover {
    background: #ffffff !important;
    border-color: #8351ff !important;
    color: #8351ff !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 10px 25px rgba(131, 81, 255, 0.15) !important;
}

body.section-page .achievements-section-button-progress {
    margin-top: 4px !important;
    font-size: 13px !important;
    color: #a0aec0 !important;
    font-weight: 600 !important;
}

body.section-page .achievements-section-button-progress strong {
    color: #8351ff !important;
}

/* --- 4. ПРАВАЯ КОЛОНКА (ЧЕЛЛЕНДЖ) --- */
body.section-page .daily-challenge {
    background: #ffffff !important; /* БЕЛЫЙ фон вместо оранжевого */
    border-radius: 32px !important;
    padding: 40px !important;
    color: #2d3748 !important;
    box-shadow: 0 20px 50px rgba(160, 140, 220, 0.2) !important;
    border: 1px solid #ffffff !important;
    position: relative !important;
    overflow: hidden !important;
}

/* Цветная полоска сверху */
body.section-page .daily-challenge::before {
    content: "" !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 8px !important;
    background: linear-gradient(90deg, #667eea, #764ba2, #ff9a9e) !important;
}

/* Текст в челлендже (темный!) */
body.section-page .daily-challenge-title {
    color: #1a202c !important;
    font-size: 32px !important;
    font-weight: 900 !important;
}

body.section-page .daily-challenge-subtitle {
    color: #718096 !important;
}

body.section-page .challenge-activity-title {
    color: #1a202c !important;
    font-size: 28px !important;
    font-weight: 900 !important;
}

body.section-page .challenge-activity-description {
    color: #4a5568 !important;
    font-size: 16px !important;
}

/* Мета-данные (Время, Место) */
body.section-page .challenge-meta-item {
    background: #f7fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #4a5568 !important;
    border-radius: 14px !important;
    padding: 10px 18px !important;
    font-weight: 700 !important;
}

/* Секции (Инструкция, Факт) */
body.section-page .challenge-info-section {
    border-top: 2px dashed #e2e8f0 !important;
    padding-top: 20px !important;
    margin-top: 25px !important;
}

body.section-page .challenge-info-section h3 {
    color: #1a202c !important;
    font-weight: 800 !important;
}

body.section-page .challenge-info-section p {
    color: #4a5568 !important;
}

body.section-page .challenge-fact {
    background: #f0ebff !important;
    border-radius: 20px !important;
    padding: 24px !important;
    border: none !important;
}

body.section-page .challenge-fact h3,
body.section-page .challenge-fact p {
    color: #51318f !important;
}

/* Кнопки в челлендже */
body.section-page .challenge-start-button,
body.section-page .challenge-complete-button {
    background: linear-gradient(135deg, #8351ff, #6336e8) !important;
    color: #ffffff !important;
    border-radius: 20px !important;
    padding: 16px 36px !important;
    font-weight: 900 !important;
    box-shadow: 0 10px 25px rgba(131, 81, 255, 0.3) !important;
    border: none !important;
}

body.section-page .challenge-decline-button {
    background: #f7fafc !important;
    color: #718096 !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 20px !important;
    padding: 16px 36px !important;
    font-weight: 800 !important;
}

body.section-page .daily-challenge-status {
    background: #f0fff4 !important;
    color: #276749 !important;
    border: 1px solid #9ae6b4 !important;
    border-radius: 20px !important;
    padding: 18px !important;
    font-weight: 800 !important;
}

/* Ссылки на материалы */
body.section-page .material-button {
    background: #f7fafc !important;
    color: #4a5568 !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 14px !important;
    padding: 12px 24px !important;
    font-weight: 700 !important;
}

body.section-page .material-button:hover {
    background: #8351ff !important;
    color: #ffffff !important;
    border-color: #8351ff !important;
}

/* --- 5. АДАПТИВ --- */
@media (max-width: 900px) {
    body.section-page .section-layout {
        grid-template-columns: 1fr !important;
    }
    body.section-page .daily-challenge {
        padding: 25px 20px !important;
    }
}

/* Исправление цвета текста в шапке личного кабинета */
body.section-page .section-header-username,
body.section-page .section-header-username span,
body.section-page .top-link,
body.section-page .logout-button {
    color: #382273 !important;
    font-weight: 800 !important;
}

body.section-page .section-header-username:hover,
body.section-page .top-link:hover {
    opacity: 0.7 !important;
}

/* Убираем лишнюю полоску сверху */
body.section-page .daily-challenge::before {
    display: none !important;
    content: none !important;
}

