body {
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    background: radial-gradient(circle at top, #1e1e2f, #0f0f1a);
    color: #fff;
}

.main-header {
    text-align: center;
    padding: 10px 20px;
    grid-row: 1;
    grid-column: span 3;
}

.main-header h1 {
    margin: 0;
    font-size: 32px;
}

.main-header p {
    opacity: 0.8;
}

.game {
    max-width: 640px;
    grid-row: 2;
    grid-column: 2;
}

.profile-card {
    display: grid;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    margin-bottom: 30px;
}
.profile-rating {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.15);

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

    font-size: 1.05rem;
}

.profile-rating strong {
    font-size: 1.4rem;
    color: #ffd54a;
    font-weight: 700;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
}

.form-group label {
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 6px;
}

input {
    padding: 12px;
    border-radius: 10px;
    border: none;
    outline: none;
    font-size: 15px;
}

.primary-btn {
    width: 100%;
    padding: 14px;
    margin-top: 10px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #6c63ff, #8a7bff);
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(108,99,255,0.4);
}

.error-text {
    color: #ff6b6b;
    margin-top: 10px;
    font-size: 14px;
}

.profile-info {
    margin-bottom: 20px;
}

.profile-name {
    font-size: 18px;
    font-weight: bold;
}

.profile-email {
    opacity: 0.8;
}

.attempts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.fade-in {
    animation: fade 0.5s ease;
}

@keyframes fade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.main-footer {
    text-align: center;
    padding: 20px;
    opacity: 0.6;
    font-size: 13px;
}
.stages-block {
    margin-top: 25px;
}

.stage-card {
    display:  grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: auto auto;
    background: rgba(255,255,255,0.05);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 14px;
}

.stage-header {
    grid-row: 1;
    gap: 14px;
    align-items: center;
}

.stage-num {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #6c63ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.stage-card h4 {
    margin: 0;
}

.stage-card p {
    margin: 4px 0 0;
    font-size: 13px;
    opacity: 0.8;
}

.progress-wrapper {
    margin-top: 14px;
    grid-row: span 2;
    grid-column: span 2;
}
.score {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 12px;
    background: linear-gradient(
        135deg,
        rgba(108, 99, 255, 0.15),
        rgba(138, 123, 255, 0.25)
    );

    box-shadow:
        inset 0 0 10px rgba(108, 99, 255, 0.2),
        0 4px 10px rgba(0, 0, 0, 0.2);

    font-weight: 600;
    white-space: nowrap;
}
.score-icon {
    font-size: 18px;
    filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.6));
}

.stage-score {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 6px rgba(255,255,255,0.4);
}

.score-label {
    font-size: 12px;
    opacity: 0.8;
}

.progress {
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
    margin: 12px 5px;
    overflow: hidden;
}

.progress-bar {
    height: 150%;
    background: linear-gradient(90deg, #6c63ff, #d17bff);
    box-shadow: 0 0 8px rgba(108, 99, 255, 0.8);
}
.progress-bar {
    transition: width 0.6s ease;
}
.stage-btn {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 10px;
    background: #6c63ff;
    color: white;
    text-decoration: none;
    font-size: 14px;
}

.stage-btn:hover {
    opacity: 0.9;
}

.stage-card.disabled {
    opacity: 0.4;
}

.stage-btn.locked {
    background: transparent;
    border: 1px dashed rgba(255,255,255,0.4);
    cursor: default;
}
/* Контейнер блоков */
.blocks-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 15px 0;
}


@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.layout {
    display: grid;
    grid-template-columns: auto 60% auto;
    grid-template-rows: auto auto;
    gap: 24px;

    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    align-items: start;
}
/* Боковая панель */
.sidebar {
    grid-column: 1 / 2; /* оставляем слева в grid */
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 20px;
    gap: 16px;
    min-width: 240px;
    max-width: 280px;
    height: fit-content;
}

/* Заголовок */
.sidebar-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding-bottom: 8px;
}

/* Обертка таблицы для скролла */
.leaderboard-wrapper {
    max-height: 400px;
    overflow-y: auto;
}

/* Таблица */
.leaderboard {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.leaderboard th, .leaderboard td {
    padding: 6px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.leaderboard th {
    font-weight: 600;
    color: #6c63ff;
}

.leaderboard td {
    color: #eee;
}

.leaderboard tbody tr:nth-child(even) {
    background: rgba(108, 99, 255, 0.05);
}

/* Кнопка logout */
.logout-btn {
    margin-top: auto; /* прижать вниз панели */
    padding: 10px 14px;
    border-radius: 10px;
    border: none;
    background: #ff6b6b;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.logout-btn:hover {
    background: #ff4c4c;
}