/* ═══ MASTERS MODAL — 4 COMPACT CARDS ═══ */
.modal-masters {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 2000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none;
    transition: opacity .3s ease;
    background: rgba(0,0,0,0.45);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
.modal-masters.active {
    opacity: 1; pointer-events: all;
}

.mm-inner {
    background: #faf6f3;
    border-radius: 24px;
    padding: 18px 16px 14px;
    width: calc(100vw - 60px);
    max-width: 1500px;
    height: calc(100vh - 60px);
    max-height: 850px;
    display: flex;
    flex-direction: column;
    transform: scale(0.92) translateY(20px);
    transition: transform .4s cubic-bezier(.4,0,.2,1);
    position: relative;
    overflow: hidden;
}
.modal-masters.active .mm-inner {
    transform: scale(1) translateY(0);
}

/* Close */
.mm-close {
    position: absolute; top: 10px; right: 10px;
    background: rgba(0,0,0,0.05);
    border: none; border-radius: 50%;
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all .2s; z-index: 10;
    color: #666; font-size: 16px;
}
.mm-close:hover { background: rgba(0,0,0,0.1); transform: rotate(90deg); }

/* Header */
.mm-header {
    text-align: center;
    margin-bottom: 10px;
    flex-shrink: 0;
}
.mm-header h2 {
    font-size: 18px;
    font-weight: 800;
    color: #1a1a1a;
    margin: 0 0 2px;
}
.mm-header p {
    font-size: 11px;
    color: #999;
    margin: 0;
    font-weight: 500;
}

/* Grid */
.mm-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* ═══ 3D FLIP ═══ */
.mm-card-wrapper {
    perspective: 1200px;
    animation: mmCardIn .5s ease both;
    overflow: hidden;
}
@keyframes mmCardIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
.mm-card-flipper {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.7s cubic-bezier(.4,0,.2,1);
    transform-style: preserve-3d;
}
.mm-card-wrapper.flipped .mm-card-flipper {
    transform: rotateY(180deg);
}
.mm-card-front,
.mm-card-back {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* ═══ FRONT ═══ */
.mm-card-front.mm-card {
    position: relative;
    z-index: 2;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.04);
    transition: all .3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.mm-card-front.mm-card:hover {
    box-shadow: 0 8px 30px rgba(232,135,154,0.15);
    border-color: rgba(232,135,154,0.12);
}

/* Photo — компактное */
.mm-card-media {
    position: relative;
    width: 100%;
    padding-top: 100%;
    overflow: hidden;
    background: linear-gradient(135deg, #f8e8ec, #fdf2f5);
    flex-shrink: 0;
}
.mm-card-media .mm-photo,
.mm-card-media .mm-video {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.mm-card-media .mm-photo {
    display: block;
    transition: opacity .4s ease, transform .4s ease;
}
.mm-card-front:hover .mm-photo { transform: scale(1.03); }
.mm-card-media .mm-video {
    opacity: 0; transition: opacity .4s ease;
}
.mm-card-front:hover .mm-video { opacity: 1; }
.mm-card-front:hover .mm-photo { opacity: 0; }

.mm-card-overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    height: 30px;
    background: linear-gradient(transparent, rgba(0,0,0,0.05));
    pointer-events: none;
}
.mm-card-status {
    position: absolute; top: 6px; right: 6px;
    background: rgba(255,255,255,0.9);
    backdrop-filter: none;
    padding: 2px 7px;
    border-radius: 20px;
    font-size: 8px;
    font-weight: 700;
    color: #34c759;
}

/* Body */
.mm-card-body {
    padding: 10px 12px 12px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.mm-card-body::-webkit-scrollbar { width: 2px; }
.mm-card-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.06); border-radius: 2px; }

.mm-card-name {
    font-size: 16px;
    font-weight: 800;
    color: #1a1a1a;
    margin: 0 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mm-card-spec {
    font-size: 11px;
    font-weight: 600;
    color: #e8879a;
    display: block;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Stats — compact */
.mm-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}
.mm-stat-row {
    display: flex;
    align-items: center;
    gap: 4px;
}
.mm-stat-label {
    font-size: 10px;
    font-weight: 600;
    color: #999;
    min-width: 44px;
}
.mm-stat-bar {
    flex: 1;
    height: 5px;
    background: rgba(0,0,0,0.04);
    border-radius: 5px;
    overflow: hidden;
}
.mm-stat-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #e8879a, #d4627a);
    transition: width 1s cubic-bezier(.4,0,.2,1);
}
.mm-stat-val {
    font-size: 12px;
    font-weight: 800;
    color: #1a1a1a;
    min-width: 16px;
    text-align: right;
}

/* Bio */
.mm-card-bio {
    font-size: 11px;
    color: #888;
    line-height: 1.4;
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Works */
.mm-works {
    margin: 4px 0 8px;
    overflow: hidden;
    border-radius: 6px;
}
.mm-works-scroll {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}
.mm-works-scroll::-webkit-scrollbar { display: none; }
.mm-work-thumb {
    width: 56px;
    height: 80px;
    min-width: 56px;
    flex-shrink: 0;
    border-radius: 6px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s;
    border: 1px solid rgba(0,0,0,0.06);
}
.mm-work-thumb:hover { transform: scale(1.05); }

/* CTA */
.mm-card-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 12px;
    background: linear-gradient(135deg, #e8879a, #d4627a);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 4px 16px rgba(232,135,154,0.3);
    margin-top: auto;
    flex-shrink: 0;
    letter-spacing: 0.3px;
}
.mm-card-btn:hover {
    box-shadow: 0 5px 18px rgba(232,135,154,0.35);
}

/* ═══ BACK ═══ */
.mm-card-back {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    transform: rotateY(180deg);
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}
.mm-card-back-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: linear-gradient(135deg, #e8879a, #d4627a);
    color: #fff;
    flex-shrink: 0;
}
.mm-card-back-header span {
    font-size: 11px;
    font-weight: 700;
}
.mm-card-back-close {
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    transition: background .2s;
}
.mm-card-back-close:hover {
    background: rgba(255,255,255,0.35);
}
.mm-card-back iframe {
    flex: 1;
    width: 100%;
    border: none;
}
