﻿/* Оценка игры за наряд (Yandex feedback) */
.review-dress-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.78);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2625;
    padding: 20px;
    box-sizing: border-box;
}
.review-dress-content {
    background: linear-gradient(165deg, #5b21b6 0%, #7c3aed 55%, #a78bfa 100%);
    border-radius: 24px;
    max-width: 360px;
    width: 100%;
    padding: 24px 22px 20px;
    box-shadow: 0 14px 48px rgba(0, 0, 0, 0.45);
    text-align: center;
}
.review-dress-emoji {
    font-size: 42px;
    line-height: 1;
    margin-bottom: 8px;
    font-family: var(--emoji-fonts);
    font-variant-emoji: emoji;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
}
.review-dress-title {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 10px;
}
.review-dress-text {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    margin: 0 0 16px;
    line-height: 1.45;
}
.review-dress-preview {
    margin-bottom: 14px;
}
.review-dress-preview-img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.95);
    padding: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}
.review-dress-preview-caption {
    font-size: 13px;
    font-weight: 700;
    color: #fef3c7;
    margin: 10px 0 0;
}
.review-dress-status {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 12px;
}
.review-dress-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.review-dress-btn {
    width: 100%;
    padding: 14px 18px;
    font-size: 15px;
    font-weight: 800;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: transform 0.15s;
}
.review-dress-btn:disabled {
    opacity: 0.55;
    cursor: default;
}
.review-dress-btn:active:not(:disabled) {
    transform: scale(0.98);
}
.review-dress-btn--primary {
    background: #fff;
    color: #5b21b6;
}
.review-dress-btn--ghost {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.45);
}

.puzzle-roulette-content .memo-roulette-block {
    display: block;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.puzzle-roulette-content .memo-roulette-heading {
    color: #fff;
    text-align: center;
}

.puzzle-roulette-content .memo-roulette-legend {
    color: rgba(255, 255, 255, 0.92);
}

.puzzle-roulette-content .memo-roulette-result {
    color: #ffd166;
}

.puzzle-roulette-content .memo-roulette-respin-btn {
    margin-bottom: 0;
}

@media (max-height: 740px) {
    .puzzle-roulette-content .memo-roulette-scene {
        width: min(168px, 58vw);
        height: min(168px, 58vw);
        margin-bottom: 8px;
    }
    .puzzle-roulette-content .memo-roulette-heading {
        margin-bottom: 6px;
        font-size: 13px;
    }
    .puzzle-roulette-content .memo-roulette-legend {
        gap: 4px 8px;
        font-size: 9px;
        margin-bottom: 6px;
    }
    .puzzle-roulette-content .memo-roulette-result {
        min-height: 1.8em;
        font-size: 12px;
        margin-bottom: 6px;
    }
    .puzzle-roulette-content .memo-roulette-spin-btn,
    .puzzle-roulette-content .memo-roulette-respin-btn {
        padding: 10px 12px;
        font-size: 13px;
    }
}

@media (max-height: 640px) {
    .puzzle-roulette-content .memo-roulette-scene {
        width: min(148px, 52vw);
        height: min(148px, 52vw);
    }
}

.memo-roulette-block {
    margin: 12px 0 14px;
    padding-top: 4px;
    border-top: 1px solid rgba(124, 58, 237, 0.15);
}
.memo-roulette-heading {
    font-size: 14px;
    font-weight: 800;
    color: #6d28d9;
    margin: 0 0 10px;
}
.memo-roulette-scene {
    position: relative;
    width: min(200px, 72vw);
    height: min(200px, 72vw);
    margin: 0 auto 10px;
}
.memo-roulette-pointer {
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 16px solid #7c3aed;
    z-index: 3;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.2));
}
.memo-roulette-wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    box-sizing: border-box;
    border: 4px solid #fff;
    box-shadow: 0 4px 16px rgba(109, 40, 217, 0.35), inset 0 0 0 2px rgba(124, 58, 237, 0.25);
    background: conic-gradient(
        #f472b6 0deg 90deg,
        #fbbf24 90deg 180deg,
        #a78bfa 180deg 270deg,
        #94a3b8 270deg 360deg
    );
    transition: transform 4s cubic-bezier(0.15, 0.85, 0.2, 1);
    will-change: transform;
    overflow: hidden;
}
.memo-roulette-sector-emoji {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 2.4em;
    height: 2.4em;
    margin-left: -1.2em;
    margin-top: -1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(20px, 6.5vw, 30px);
    line-height: 1;
    font-family: var(--emoji-fonts);
    font-variant-emoji: emoji;
    pointer-events: none;
    z-index: 1;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.35));
    --roulette-emoji-r: clamp(48px, 13vw, 68px);
}
.memo-roulette-sector-emoji[data-sector="dress"] {
    transform: rotate(45deg) translateY(calc(-1 * var(--roulette-emoji-r))) rotate(-45deg);
}
.memo-roulette-sector-emoji[data-sector="xp2"] {
    transform: rotate(135deg) translateY(calc(-1 * var(--roulette-emoji-r))) rotate(-135deg);
}
.memo-roulette-sector-emoji[data-sector="xp3"] {
    transform: rotate(225deg) translateY(calc(-1 * var(--roulette-emoji-r))) rotate(-225deg);
}
.memo-roulette-sector-emoji[data-sector="normal"] {
    transform: rotate(315deg) translateY(calc(-1 * var(--roulette-emoji-r))) rotate(-315deg);
}
.memo-roulette-wheel-hub {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 22%;
    height: 22%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: #fff;
    border: 2px solid #e9d5ff;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.15);
    z-index: 2;
    pointer-events: none;
}
.memo-roulette-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 10px;
    font-size: 10px;
    font-weight: 700;
    color: #6b7280;
    margin: 0 0 8px;
    list-style: none;
    padding: 0;
}
.memo-roulette-legend li {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.memo-roulette-legend-emoji {
    font-size: 14px;
    line-height: 1;
    font-family: var(--emoji-fonts);
    font-variant-emoji: emoji;
}
.memo-roulette-result {
    min-height: 2.6em;
    font-size: 13px;
    font-weight: 700;
    color: #4c1d95;
    margin: 0 0 8px;
}
.memo-roulette-result-prize-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 6px;
    border-radius: 8px;
}
.memo-roulette-spin-btn,
.memo-roulette-respin-btn {
    width: 100%;
    padding: 11px 12px;
    font-size: 14px;
    font-weight: 800;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    margin-bottom: 6px;
}
.memo-roulette-spin-btn {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #422006;
}
.memo-roulette-respin-btn {
    background: linear-gradient(135deg, #c4b5fd 0%, #7c3aed 100%);
    color: #fff;
}
.memo-roulette-spin-btn:disabled,
.memo-roulette-respin-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Гардероб */
.wardrobe-modal {
    position: absolute;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(12px, env(safe-area-inset-top, 0px)) max(10px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px));
    box-sizing: border-box;
}
.wardrobe-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 10, 30, 0.65);
}
.wardrobe-modal-panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(420px, calc(100% - 20px));
    max-height: min(86vh, 640px);
    height: auto;
    margin: 0;
    background: linear-gradient(165deg, #fdf4ff 0%, #ede9fe 45%, #fae8ff 100%);
    border-radius: 18px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
    padding: 14px 12px 12px;
    box-sizing: border-box;
    overflow: hidden;
}
@supports (height: 100dvh) {
    .wardrobe-modal-panel {
        max-height: min(86dvh, 640px);
    }
}
.wardrobe-close-btn {
    flex-shrink: 0;
    width: 100%;
    margin-top: 10px;
    padding: 14px 16px;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 800;
    font-family: inherit;
    line-height: 1.2;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, #ec4899 0%, #a855f7 100%);
    box-shadow: 0 4px 16px rgba(168, 85, 247, 0.35);
    -webkit-tap-highlight-color: transparent;
}
.wardrobe-close-btn:active {
    transform: scale(0.98);
}
.wardrobe-title {
    margin: 0 4px 8px 4px;
    font-size: 18px;
    color: #5b21b6;
    flex-shrink: 0;
}
.wardrobe-preview {
    position: relative;
    flex-shrink: 0;
    height: min(160px, 26vh);
    margin: 0 auto 10px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
@supports (height: 100dvh) {
    .wardrobe-preview {
        height: min(160px, 24dvh);
    }
}
.wardrobe-character-base,
.wardrobe-dress-layer {
    max-height: 100%;
    max-width: min(160px, 42vw);
    width: auto;
    height: auto;
    object-fit: contain;
    pointer-events: none;
}
.wardrobe-dress-layer {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
}
.wardrobe-grid-scroll {
    flex: 1 1 auto;
    min-height: 120px;
    max-height: min(50vh, 400px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
@supports (height: 100dvh) {
    .wardrobe-grid-scroll {
        max-height: min(48dvh, 400px);
    }
}

/* Гардероб на узких экранах */
@media (max-width: 720px) {
    .wardrobe-modal {
        padding: max(10px, env(safe-area-inset-top, 0px)) 8px max(10px, env(safe-area-inset-bottom, 0px)) 8px;
    }
    .wardrobe-modal-panel {
        width: calc(100% - 16px);
        max-height: min(90vh, calc(100% - 20px));
        border-radius: 16px;
        padding: 12px 10px 10px;
    }
    .wardrobe-preview {
        height: min(130px, 22vh);
    }
    .wardrobe-character-base,
    .wardrobe-dress-layer {
        max-width: min(150px, 40vw);
    }
    .wardrobe-grid-scroll {
        min-height: 100px;
        max-height: min(52vh, 360px);
    }
    .wardrobe-grid {
        gap: 6px;
    }
    .wardrobe-close-btn {
        padding: 12px 14px;
        font-size: 15px;
    }
}
@supports (height: 100dvh) {
    @media (max-width: 720px) {
        .wardrobe-modal-panel {
            max-height: min(90dvh, calc(100% - 20px));
        }
        .wardrobe-preview {
            height: min(130px, 20dvh);
        }
        .wardrobe-grid-scroll {
            max-height: min(50dvh, 360px);
        }
    }
}
.wardrobe-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 4px 2px 8px;
}
.wardrobe-item {
    position: relative;
    aspect-ratio: 3 / 4;
    border: 2px solid rgba(124, 58, 237, 0.25);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.75);
    padding: 0;
    cursor: pointer;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}
.wardrobe-item--locked {
    cursor: default;
    background: rgba(30, 27, 75, 0.08);
}
.wardrobe-item--locked .wardrobe-item-img {
    opacity: 0.22;
    filter: brightness(0) contrast(1.2);
}
.wardrobe-item--equipped {
    border-color: #ec4899;
    box-shadow: 0 0 0 2px rgba(236, 72, 153, 0.35);
}
.wardrobe-item-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
}
.wardrobe-item-lock {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-family: var(--emoji-fonts);
    font-variant-emoji: emoji;
    color: rgba(91, 33, 182, 0.85);
    text-shadow: 0 1px 0 #fff;
    pointer-events: none;
}

/* Полноэкранный приз рулетки */
.roulette-prize-overlay {
    position: fixed;
    inset: 0;
    z-index: 2600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(12px, env(safe-area-inset-top, 0px)) 12px max(12px, env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    pointer-events: none;
    opacity: 0;
}
.roulette-prize-overlay__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 10, 30, 0.82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.roulette-prize-overlay__panel {
    position: relative;
    z-index: 1;
    width: min(100%, 360px);
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 28px 20px 24px;
    border-radius: 24px;
    background: linear-gradient(165deg, #fff 0%, #f5f3ff 55%, #fce7f3 100%);
    box-shadow: 0 20px 60px rgba(76, 29, 149, 0.45);
    transform: scale(0.72) translateY(24px);
    opacity: 0;
    overflow: hidden;
    box-sizing: border-box;
    pointer-events: auto;
}
.roulette-prize-overlay--visible {
    pointer-events: auto;
    opacity: 1;
    animation: prize-overlay-fade-in 0.35s ease forwards;
}
.roulette-prize-overlay--visible .roulette-prize-overlay__panel {
    animation: prize-panel-pop 0.65s cubic-bezier(0.34, 1.45, 0.64, 1) forwards;
}
.roulette-prize-overlay--leaving {
    animation: prize-overlay-fade-out 0.3s ease forwards;
}
.roulette-prize-overlay__glow {
    position: absolute;
    top: -40%;
    left: 50%;
    width: 140%;
    height: 80%;
    transform: translateX(-50%);
    background: radial-gradient(circle, rgba(251, 191, 36, 0.45) 0%, transparent 70%);
    pointer-events: none;
    animation: prize-glow-pulse 1.8s ease-in-out infinite;
}
.roulette-prize-overlay__visual {
    position: relative;
    z-index: 1;
    width: min(220px, 72vw);
    height: min(220px, 52vh);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}
.roulette-prize-overlay__dress-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 8px 20px rgba(124, 58, 237, 0.35));
    animation: prize-dress-in 0.7s cubic-bezier(0.34, 1.4, 0.64, 1) 0.15s both;
}
.roulette-prize-overlay__xp-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: min(140px, 40vw);
    height: min(140px, 40vw);
    border-radius: 50%;
    font-size: clamp(28px, 8vw, 40px);
    font-weight: 900;
    font-family: var(--emoji-fonts), sans-serif;
    font-variant-emoji: emoji;
    color: #fff;
    line-height: 1.1;
    background: linear-gradient(145deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
    box-shadow: 0 12px 32px rgba(217, 119, 6, 0.45), inset 0 2px 0 rgba(255, 255, 255, 0.4);
    animation: prize-badge-pop 0.65s cubic-bezier(0.34, 1.5, 0.64, 1) 0.1s both;
}
.roulette-prize-overlay__xp-badge--triple {
    background: linear-gradient(145deg, #c4b5fd 0%, #8b5cf6 50%, #6d28d9 100%);
    box-shadow: 0 12px 32px rgba(109, 40, 217, 0.45), inset 0 2px 0 rgba(255, 255, 255, 0.35);
}
.roulette-prize-overlay__xp-badge--normal {
    font-size: clamp(36px, 10vw, 48px);
    background: linear-gradient(145deg, #94a3b8 0%, #64748b 100%);
    box-shadow: 0 10px 24px rgba(71, 85, 105, 0.35);
}
.roulette-prize-overlay__title {
    position: relative;
    z-index: 1;
    margin: 0 0 6px;
    font-size: clamp(20px, 5.5vw, 24px);
    font-weight: 800;
    color: #4c1d95;
    line-height: 1.2;
}
.roulette-prize-overlay__sub {
    position: relative;
    z-index: 1;
    margin: 0 0 18px;
    font-size: clamp(13px, 3.8vw, 15px);
    color: #6b7280;
    line-height: 1.35;
}
.roulette-prize-overlay__claim {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 280px;
    padding: 14px 20px;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, #ec4899 0%, #a855f7 100%);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4);
    -webkit-tap-highlight-color: transparent;
    animation: prize-claim-in 0.5s ease 0.35s both;
}
.roulette-prize-overlay__claim:active {
    transform: scale(0.98);
}

@keyframes prize-overlay-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes prize-overlay-fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}
@keyframes prize-panel-pop {
    from { transform: scale(0.72) translateY(24px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}
@keyframes prize-dress-in {
    from { transform: scale(0.5) rotate(-8deg); opacity: 0; }
    to { transform: scale(1) rotate(0); opacity: 1; }
}
@keyframes prize-badge-pop {
    from { transform: scale(0.4); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
@keyframes prize-glow-pulse {
    0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
    50% { opacity: 1; transform: translateX(-50%) scale(1.08); }
}
@keyframes prize-claim-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Окно просмотра наряда (мобильная карточка) */
.dress-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 2700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(12px, env(safe-area-inset-top, 0px)) 12px max(12px, env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    opacity: 0;
    pointer-events: none;
}
.dress-preview-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 8, 28, 0.55);
}
.dress-preview-modal__card {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: min(100%, 360px);
    max-height: min(88vh, 640px);
    padding: 16px 14px 14px;
    border-radius: 20px;
    background: linear-gradient(165deg, #fdf4ff 0%, #f5f3ff 100%);
    box-shadow: 0 16px 48px rgba(76, 29, 149, 0.35);
    box-sizing: border-box;
    transform: scale(0.92) translateY(12px);
    opacity: 0;
    pointer-events: auto;
}
.dress-preview-modal--visible {
    pointer-events: auto;
    opacity: 1;
}
.dress-preview-modal--visible .dress-preview-modal__card {
    animation: dress-preview-pop 0.38s cubic-bezier(0.34, 1.35, 0.64, 1) forwards;
}
.dress-preview-modal--leaving .dress-preview-modal__card {
    animation: dress-preview-out 0.26s ease forwards;
}
.dress-preview-modal__plaque {
    flex: 1;
    min-height: min(42vh, 360px);
    max-height: min(58vh, 480px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    margin-bottom: 10px;
    border-radius: 16px;
    background: #fff;
    box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.12);
    box-sizing: border-box;
    overflow: hidden;
}
.dress-preview-modal__img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}
.dress-preview-modal__img--locked {
    opacity: 0.2;
    filter: brightness(0) contrast(1.15);
}
.dress-preview-modal__lock {
    margin: 0 0 10px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    color: #6d28d9;
    text-align: center;
    background: rgba(237, 233, 254, 0.9);
    border-radius: 10px;
}
.dress-preview-modal__close-btn {
    flex-shrink: 0;
    width: 100%;
    padding: 14px 16px;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, #ec4899 0%, #a855f7 100%);
    box-shadow: 0 4px 16px rgba(168, 85, 247, 0.35);
    -webkit-tap-highlight-color: transparent;
}
.dress-preview-modal__close-btn:active {
    transform: scale(0.98);
}

@keyframes dress-preview-pop {
    from { transform: scale(0.92) translateY(12px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}
@keyframes dress-preview-out {
    from { transform: scale(1); opacity: 1; }
    to { transform: scale(0.94) translateY(8px); opacity: 0; }
}

.puzzle-win-scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.puzzle-icon-btn--wardrobe { font-size: 18px; }
