.mode-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.mode-rules-backdrop[hidden] {
    display: none;
}

.mode-rules-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(0, 8, 15, 0.82);
    backdrop-filter: blur(8px);
}

.mode-rules-card {
    position: relative;
    width: min(620px, 100%);
    max-height: min(86vh, 780px);
    overflow-y: auto;
    padding: 30px clamp(20px, 5vw, 38px);
    border: 1px solid rgba(77, 208, 225, 0.48);
    border-top: 5px solid #00b4d8;
    border-radius: 18px;
    background: linear-gradient(160deg, #102b3b, #071722 70%);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.66), 0 0 36px rgba(0, 180, 216, 0.12);
    color: #e8f9ff;
}

.mode-rules-kicker {
    color: #70e3f2;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.mode-rules-card h2 {
    margin: 8px 44px 10px 0;
    color: #fff;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: clamp(30px, 6vw, 42px);
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
}

.mode-rules-card > p {
    margin: 0 0 18px;
    color: rgba(232, 249, 255, 0.76);
    font-size: 16px;
    line-height: 1.5;
}

.mode-rules-card ul {
    display: grid;
    gap: 10px;
    margin: 0;
    padding-left: 22px;
    color: rgba(232, 249, 255, 0.9);
    line-height: 1.5;
}

.mode-rules-card ul.mode-rules-list {
    gap: 12px;
    padding: 0;
    list-style: none;
}

.mode-rules-list li {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
}

.mode-rules-list li > span:first-child {
    width: 26px;
    text-align: center;
    font-size: 18px;
    line-height: 1.4;
}

body.shell-page .mode-rules-card button.mode-rules-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid rgba(77, 208, 225, 0.35);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.24);
    color: #e8f9ff;
    box-shadow: none;
    font-size: 25px;
    line-height: 1;
}

body.shell-page .mode-rules-card button.mode-rules-done {
    display: block;
    width: 100%;
    margin-top: 22px;
    padding: 12px 18px;
    border: 1px solid rgba(77, 208, 225, 0.3);
    border-radius: 12px;
    background: linear-gradient(135deg, #00b4d8, #0088a0);
    color: #fff;
    box-shadow: 0 10px 22px rgba(0, 180, 216, 0.2);
    font-weight: 800;
}

@media (max-width: 720px) {
    .mode-header-actions {
        width: 100%;
    }

    body.mode-v3-page .mode-header-actions .home-btn {
        width: auto;
        flex: 1;
        padding-right: 8px;
        padding-left: 8px;
    }

    .mode-rules-card {
        max-height: 88vh;
        padding-top: 28px;
        padding-bottom: 22px;
    }
}
