.stack {
    display: grid;
    gap: 18px;
}

.session-card {
    display: grid;
    grid-template-columns: 88px 1fr auto;
    gap: 20px;
    align-items: center;
    padding: 22px;
}

.session-number-badge {
    width: 88px;
    height: 88px;
    border-radius: 22px;
    background: linear-gradient(135deg, var(--primary), #a6a3d6);
    color: white;
    display: grid;
    place-items: center;
    font-size: 1.65rem;
    font-weight: 800;
    box-shadow: 0 12px 25px rgba(124, 121, 184, 0.28);
}

.session-content h3 {
    margin: 0 0 8px;
    font-size: 1.35rem;
}

.session-content p {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.objectives-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 24px;
}

.objective-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow);
}

.objective-box h3 {
    margin: 0 0 10px;
    font-size: 1rem;
}

.objective-box p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.games-list {
    display: grid;
    gap: 16px;
    margin-top: 22px;
}

.game-card {
    padding: 22px;
    display: grid;
    grid-template-columns: 90px 1fr auto;
    gap: 18px;
    align-items: start;
}

.game-order {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    display: grid;
    place-items: center;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary-dark);
}

.game-content h3 {
    margin: 0 0 8px;
    font-size: 1.2rem;
}

.game-content p {
    margin: 0 0 10px;
    color: var(--muted);
    line-height: 1.65;
}

.game-aside {
    text-align: right;
    min-width: 120px;
}

.duration-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 999px;
    background: #eef8f1;
    color: var(--success);
    font-weight: 800;
    border: 1px solid #d7ebdd;
}

.game-card-clickable {
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.game-card-clickable:hover {
    transform: translateY(-2px);
    border-color: rgba(124, 121, 184, 0.25);
}

.game-open-hint {
    margin-top: 14px !important;
    font-weight: 700;
    color: var(--primary-dark) !important;
}

@media (max-width: 900px) {
    .session-card,
    .game-card {
        grid-template-columns: 1fr;
    }

    .session-number-badge,
    .game-order {
        width: 72px;
        height: 72px;
    }

    .objectives-grid {
        grid-template-columns: 1fr;
    }

    .game-aside {
        text-align: left;
    }
}
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(24, 28, 45, 0.42);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 28px;
    z-index: 9999;
}

.modal-overlay.open {
    display: flex;
}

.modal-dialog {
    width: min(1180px, 100%);
    height: min(90vh, 980px);
    background: #ffffff;
    border: 1px solid #e6e9f3;
    border-radius: 34px;
    box-shadow: 0 28px 80px rgba(26, 31, 54, 0.18);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.modal-body {
    padding: 34px 38px 72px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;
    min-height: 0;
    box-sizing: border-box;
}
.modal-body::-webkit-scrollbar {
    width: 10px;
}

.modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #d7dbea;
    border-radius: 999px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #c5cbdf;
}

.modal-close {
    position: absolute;
    top: 22px;
    right: 22px;
    width: 62px;
    height: 62px;
    border-radius: 999px;
    border: 1px solid #dde1ef;
    background: #f7f8fc;
    color: #707792;
    font-size: 2rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.18s ease;
    z-index: 3;
}

.modal-close:hover {
    background: #eceff8;
    color: #434966;
    transform: scale(1.03);
}

.modal-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding-right: 104px;
    margin-bottom: 26px;
}

.modal-title-block h2 {
    margin: 0;
    font-size: clamp(2.4rem, 4vw, 3.6rem);
    line-height: 1.04;
    color: #212435;
    letter-spacing: -0.03em;
}

.modal-subtitle {
    margin: 10px 0 0;
    color: #727995;
    font-size: 1.15rem;
    line-height: 1.45;
}

.modal-hero-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.modal-admin-actions {
    display: flex;
    align-items: center;
}

.modal-edit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 999px;
    background: #f1f2fb;
    border: 1px solid #d8dcee;
    color: #6167a3;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 700;
    transition: all 0.18s ease;
}

.modal-edit-button:hover {
    background: #817cc5;
    border-color: #817cc5;
    color: #ffffff;
}

.modal-hero-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 22px;
    border-radius: 999px;
    background: #eef8f0;
    border: 1px solid #cfe7d4;
    color: #2f7b52;
    font-size: 1.05rem;
    font-weight: 800;
    white-space: nowrap;
}

.modal-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.modal-meta-card {
    background: #f7f8fd;
    border: 1px solid #e1e5f1;
    border-radius: 22px;
    padding: 18px 22px;
}

.modal-meta-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #7a8099;
}

.modal-meta-value {
    color: #23263a;
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.35;
}

.modal-section {
    margin-top: 26px;
}

.modal-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.modal-section-header h3 {
    margin: 0;
    font-size: 1.9rem;
    line-height: 1.15;
    color: #222433;
    letter-spacing: -0.02em;
}

.modal-section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 44px;
    padding: 0 14px;
    border-radius: 999px;
    background: #f1f2fb;
    border: 1px solid #daddef;
    color: #676ca5;
    font-weight: 800;
    font-size: 1rem;
}

.modal-rich-card {
    background: #ffffff;
    border: 1px solid #e0e4f1;
    border-radius: 28px;
    padding: 26px 28px;
    box-shadow: 0 8px 24px rgba(34, 36, 58, 0.04);
}

.modal-rich-card p {
    margin: 0;
    color: #2e3147;
    font-size: 1.05rem;
    line-height: 1.75;
}

.modal-rich-card p + p {
    margin-top: 14px;
}

.modal-muted {
    margin-top: 8px;
    color: #717892;
    line-height: 1.65;
}

.modal-list {
    display: grid;
    gap: 18px;
}

.modal-list-item {
    background: #f8f9fd;
    border: 1px solid #e2e6f1;
    border-radius: 26px;
    padding: 22px 24px;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.modal-list-item:hover {
    transform: translateY(-1px);
    border-color: #d5dbeb;
    box-shadow: 0 10px 24px rgba(34, 36, 58, 0.06);
}

.modal-item-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 10px;
}

.modal-item-title {
    margin: 0;
    font-size: 1.9rem;
    line-height: 1.1;
    color: #222433;
    letter-spacing: -0.02em;
}

.modal-item-subtitle {
    color: #727995;
    font-size: 1rem;
    font-weight: 600;
}

.modal-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.modal-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 6px 14px;
    border-radius: 999px;
    background: #f1f2fb;
    border: 1px solid #d9ddee;
    color: #646aa5;
    font-size: 0.93rem;
    font-weight: 700;
    line-height: 1;
}

.modal-empty {
    background: #f8f9fd;
    border: 1px dashed #d7dceb;
    border-radius: 22px;
    padding: 18px 20px;
    color: #737a95;
    font-size: 1rem;
}

.modal-link {
    display: inline-flex;
    align-items: center;
    margin-top: 12px;
    color: #6d68bf;
    font-weight: 700;
    text-decoration: none;
}

.modal-link:hover {
    text-decoration: underline;
}

.modal-loading {
    padding: 48px 10px;
    text-align: center;
    color: #717892;
    font-size: 1.05rem;
}

body.modal-open {
    overflow: hidden;
}

@media (max-width: 900px) {
    .modal-body {
        padding: 24px 22px 26px;
    }

    .modal-hero {
        flex-direction: column;
        padding-right: 74px;
    }

    .modal-hero-right {
        width: 100%;
        justify-content: flex-start;
    }

    .modal-meta-grid {
        grid-template-columns: 1fr;
    }

    .modal-section-header h3 {
        font-size: 1.5rem;
    }

    .modal-item-title {
        font-size: 1.45rem;
    }

    .modal-rich-card,
    .modal-list-item {
        padding: 20px;
    }
}

@media (max-width: 640px) {
    .modal-overlay {
        padding: 12px;
    }

    .modal-dialog {
        border-radius: 24px;
    }

    .modal-close {
        top: 14px;
        right: 14px;
        width: 50px;
        height: 50px;
        font-size: 1.6rem;
    }

    .modal-hero {
        padding-right: 0;
        margin-bottom: 20px;
    }

    .modal-title-block h2 {
        font-size: 2.1rem;
    }

    .modal-section-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
