/* Основные стили модального окна GM */
#gmModal {
    display: none;
    position: fixed;
    inset: 0;
    backdrop-filter: blur(5px);
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 0.5rem;
}

#gmModal.show {
    display: flex;
}

#gmModal .modal-content {
    background: white;
    border-radius: clamp(0.75rem, 2vw, 1.5rem);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: min(90vw, 520px);
    height: auto;
    max-height: min(95vh, 800px);
    overflow: hidden;
    box-sizing: border-box;
}

/* Кнопка закрытия */
#gmModal .close-button {
    position: absolute;
    top: clamp(0.75rem, 3vw, 1.5rem);
    right: clamp(0.75rem, 3vw, 1.5rem);
    width: clamp(28px, 6vw, 36px);
    height: clamp(28px, 6vw, 36px);
    border: none;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666;
    font-size: clamp(14px, 3vw, 18px);
    z-index: 20;
    transition: all 0.2s ease;
}

#gmModal .close-button:hover {
    background: rgba(0, 0, 0, 0.2);
    color: #333;
    transform: scale(1.1);
}

/* Индикаторы экранов */
#gmModal .screen-indicator {
    display: flex;
    justify-content: center;
    padding: clamp(0.75rem, 2vw, 1rem) 0 clamp(0.5rem, 1.5vw, 0.75rem);
    background: white;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

#gmModal .indicator-dot {
    width: clamp(8px, 2vw, 12px);
    height: clamp(8px, 2vw, 12px);
    border-radius: 50%;
    background: #d1d5db;
    margin: 0 clamp(3px, 1vw, 6px);
    transition: all 0.3s ease;
}

#gmModal .indicator-dot.active {
    background: #667eea;
    transform: scale(1.3);
}

/* Контейнер экранов */
#gmModal .screens-container {
    display: grid;
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Экраны */
#gmModal .screen {
    grid-area: 1 / 1;
    opacity: 0;
    visibility: hidden;
    transform: translateX(100%);
    transition: transform 0.4s ease, opacity 0.4s ease;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

#gmModal .screen.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
    z-index: 1;
}

#gmModal .screen.initial {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

/* Внутренний контент экрана */
#gmModal .screen-inner {
    padding: clamp(0.75rem, 3vw, 1.5rem);
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#gmModal .screen-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: clamp(0.75rem, 2vw, 1.25rem);
}

/* Типографика */
#gmModal .screen-title {
    font-size: clamp(1.25rem, 4vw, 2rem);
    font-weight: bold;
    color: #1f2937;
    margin-bottom: clamp(0.5rem, 1.5vw, 1rem);
    line-height: 1.2;
}

#gmModal .screen-subtitle {
    font-size: clamp(0.875rem, 2.5vw, 1rem);
    color: #6b7280;
    margin-bottom: clamp(0.75rem, 2vw, 1rem);
}

/* D20-иконка */
#gmModal .d20-icon {
    width: clamp(50px, 12vw, 70px);
    height: clamp(50px, 12vw, 70px);
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    color: #667eea;
    margin: 0 auto clamp(0.75rem, 2vw, 1rem);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

#gmModal .pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* Иконки */
#gmModal .icon-large {
    font-size: clamp(2.5rem, 8vw, 4rem);
    margin-bottom: clamp(0.75rem, 2vw, 1rem);
}

/* Баннер */
#gmModal .gm-banner {
    border-radius: clamp(8px, 2vw, 16px);
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    margin-bottom: clamp(0.75rem, 2vw, 1rem);
}

#gmModal .gm-banner img {
    width: 100%;
    height: clamp(100px, 20vw, 160px);
    object-fit: cover;
}

/* Информационные блоки */
#gmModal .info-block {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: clamp(8px, 2vw, 16px);
    padding: clamp(0.75rem, 3vw, 1.25rem);
    text-align: left;
}

#gmModal .info-title {
    font-size: clamp(1rem, 3vw, 1.25rem);
    font-weight: 600;
    color: #1f2937;
    margin-bottom: clamp(0.5rem, 1.5vw, 0.75rem);
}

#gmModal .info-text {
    font-size: clamp(0.875rem, 2.5vw, 1rem);
    color: #374151;
    line-height: 1.5;
    margin-bottom: clamp(0.5rem, 1.5vw, 0.75rem);
}

#gmModal .info-text:last-child {
    margin-bottom: 0;
}

#gmModal .info-link {
    color: #3b82f6;
    text-decoration: underline;
    transition: color 0.2s ease;
}

#gmModal .info-link:hover {
    color: #1d4ed8;
}

/* Контейнеры для элементов */
#gmModal .benefits-container,
#gmModal .events-container {
    display: flex;
    flex-direction: column;
    gap: clamp(0.5rem, 1.5vw, 0.75rem);
}

/* Элементы преимуществ */
#gmModal .benefit-item {
    background: rgba(34, 197, 94, 0.08);
    border-left: 4px solid #22c55e;
    border-radius: clamp(6px, 1.5vw, 10px);
    padding: clamp(0.625rem, 2vw, 1rem);
    transition: all 0.3s ease;
}

#gmModal .benefit-item:hover {
    background: rgba(34, 197, 94, 0.12);
    transform: translateX(3px);
}

#gmModal .benefit-content {
    display: flex;
    align-items: flex-start;
    gap: clamp(0.5rem, 2vw, 0.75rem);
}

#gmModal .benefit-content i {
    font-size: clamp(1rem, 3vw, 1.5rem);
    flex-shrink: 0;
    margin-top: 2px;
}

#gmModal .benefit-title {
    font-size: clamp(0.875rem, 2.5vw, 1rem);
    font-weight: 600;
    color: #1f2937;
    margin-bottom: clamp(0.25rem, 1vw, 0.5rem);
}

#gmModal .benefit-text {
    font-size: clamp(0.8125rem, 2.25vw, 0.875rem);
    color: #374151;
    line-height: 1.4;
}

/* Элементы информации */
#gmModal .info-item {
    background: rgba(59, 130, 246, 0.08);
    border-left: 4px solid #3b82f6;
    border-radius: clamp(6px, 1.5vw, 10px);
    padding: clamp(0.625rem, 2vw, 1rem);
    transition: all 0.3s ease;
}

#gmModal .info-item:hover {
    background: rgba(59, 130, 246, 0.12);
    transform: translateX(3px);
}

#gmModal .info-content {
    display: flex;
    align-items: flex-start;
    gap: clamp(0.5rem, 2vw, 0.75rem);
}

#gmModal .info-content i {
    font-size: clamp(1rem, 3vw, 1.5rem);
    flex-shrink: 0;
    margin-top: 2px;
}

/* Элементы требований */
#gmModal .requirement-item {
    background: rgba(233, 213, 255, 0.6);
    border-left: 4px solid #a855f7;
    border-radius: clamp(6px, 1.5vw, 10px);
    padding: clamp(0.625rem, 2vw, 1rem);
    transition: all 0.3s ease;
}

#gmModal .requirement-item:hover {
    background: rgba(233, 213, 255, 0.8);
    transform: translateX(3px);
}

#gmModal .requirement-content {
    display: flex;
    align-items: flex-start;
    gap: clamp(0.5rem, 2vw, 0.75rem);
}

#gmModal .requirement-content i {
    font-size: clamp(1rem, 3vw, 1.5rem);
    flex-shrink: 0;
    margin-top: 2px;
}

#gmModal .requirement-title {
    font-size: clamp(0.875rem, 2.5vw, 1rem);
    font-weight: 600;
    color: #1f2937;
    margin-bottom: clamp(0.25rem, 1vw, 0.5rem);
}

#gmModal .requirement-text {
    font-size: clamp(0.8125rem, 2.25vw, 0.875rem);
    color: #374151;
    line-height: 1.4;
}

/* Форма контакта */
#gmModal .contact-form {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: clamp(8px, 2vw, 16px);
    padding: clamp(0.875rem, 3vw, 1.25rem);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

#gmModal .contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(0.75rem, 2vw, 1rem);
    margin-bottom: clamp(0.75rem, 2vw, 1rem);
}

#gmModal .contact-field {
    display: flex;
    flex-direction: column;
    gap: clamp(0.375rem, 1vw, 0.5rem);
}

#gmModal .contact-label {
    font-size: clamp(0.8125rem, 2.25vw, 0.875rem);
    font-weight: 500;
    color: #374151;
    display: flex;
    align-items: center;
}

#gmModal .contact-input,
#gmModal .contact-textarea {
    background: white;
    border: 2px solid #d1d5db;
    border-radius: clamp(6px, 1.5vw, 10px);
    padding: clamp(0.625rem, 2vw, 0.875rem);
    color: #1f2937;
    font-size: clamp(0.8125rem, 2.25vw, 0.875rem);
    transition: all 0.3s ease;
    resize: none;
}

#gmModal .contact-input:focus,
#gmModal .contact-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#gmModal .contact-textarea {
    min-height: clamp(80px, 20vw, 120px);
    max-height: clamp(120px, 30vw, 200px);
    resize: vertical;
}

/* Уведомление */
#gmModal .contact-notice {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: clamp(6px, 1.5vw, 10px);
    padding: clamp(0.625rem, 2vw, 0.875rem);
    margin-top: clamp(0.75rem, 2vw, 1rem);
}

#gmModal .notice-text {
    font-size: clamp(0.75rem, 2vw, 0.8125rem);
    color: #1f2937;
    line-height: 1.4;
}

/* Кнопки */
#gmModal .screen-buttons {
    margin-top: auto;
    padding-top: clamp(1rem, 3vw, 1.5rem);
    position: sticky;
    bottom: 0;
    background: white;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

#gmModal .buttons-grid {
    display: flex;
    justify-content: space-between;
    gap: clamp(0.5rem, 2vw, 0.75rem);
    flex-wrap: nowrap;
}

@media (max-width: 479px) {
    #gmModal .buttons-grid {
        flex-direction: column;
    }

    #gmModal .btn-primary,
    #gmModal .btn-outline,
    #gmModal .btn-secondary {
        width: 100%;
    }
}


#gmModal .btn-primary,
#gmModal .btn-secondary,
#gmModal .btn-outline {
    flex: 1;
    padding: clamp(0.65rem, 2vw, 0.85rem) clamp(1rem, 2.5vw, 1.25rem);
    border-radius: clamp(6px, 1.5vw, 10px);
    font-size: clamp(0.8125rem, 2vw, 0.9375rem);
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

#gmModal .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    grid-column: 1 / -1;
}

#gmModal .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

#gmModal .btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

#gmModal .btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(240, 147, 251, 0.3);
}

#gmModal .btn-outline {
    border: 2px solid #667eea;
    background: transparent;
    color: #667eea;
}

#gmModal .btn-outline:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

/* Анимация появления */
#gmModal .fade-in {
    animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Цветовые переопределения */
#gmModal .text-red-600 {
    color: #22c55e !important;
}

#gmModal .text-green-600 {
    color: #22c55e !important;
}

#gmModal .text-blue-600 {
    color: #3b82f6 !important;
}

#gmModal .text-pink-600 {
    color: #a855f7 !important;
}

#gmModal .text-purple-600 {
    color: #764ba2 !important;
}

#gmModal .text-indigo-600 {
    color: #667eea !important;
}

#gmModal .text-blue-500 {
    color: #3b82f6 !important;
}

/* Адаптивные breakpoints */
@media (min-width: 480px) {
    #gmModal .contact-grid {
        grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
        gap: clamp(0.75rem, 2vw, 1rem);
    }

    #gmModal .contact-input {
        width: 100%;
        min-width: 0;
    }
}

@media (min-width: 768px) {
    #gmModal {
        padding: 1rem;
    }

    #gmModal .modal-content {
        max-height: 90vh;
    }
}

@media (max-width: 479px) {
    #gmModal {
        padding: 0.25rem;
        align-items: flex-start;
        padding-top: 1rem;
    }

    #gmModal .modal-content {
        max-height: 95vh;
        border-radius: 1rem;
    }

    #gmModal .buttons-grid {
        grid-template-columns: 1fr;
    }

    #gmModal .btn-primary {
        grid-column: 1;
    }
}

@media (max-height: 600px) {
    #gmModal .screen-inner {
        padding: 0.75rem;
    }

    #gmModal .d20-icon {
        margin-bottom: 0.5rem;
    }

    #gmModal .screen-content {
        gap: 0.75rem;
    }
}

/* Горизонтальная ориентация на мобильных */
@media (max-height: 500px) and (orientation: landscape) {
    #gmModal {
        align-items: flex-start;
        padding: 0.5rem 0.25rem;
    }

    #gmModal .modal-content {
        max-height: 98vh;
    }

    #gmModal .screen-indicator {
        padding: 0.5rem 0 0.25rem;
    }

    #gmModal .screen-inner {
        padding: 0.5rem;
    }

    #gmModal .screen-title {
        font-size: 1.25rem;
        margin-bottom: 0.25rem;
    }

    #gmModal .icon-large {
        font-size: 2rem;
        margin-bottom: 0.25rem;
    }

    #gmModal .d20-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
        margin-bottom: 0.25rem;
    }
}

/* Улучшения для скроллинга */
#gmModal .screen-inner::-webkit-scrollbar {
    width: 6px;
}

#gmModal .screen-inner::-webkit-scrollbar-track {
    background: transparent;
}

#gmModal .screen-inner::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

#gmModal .screen-inner::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* Улучшения для фокуса и доступности */
#gmModal button:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

#gmModal .contact-input:focus-visible,
#gmModal .contact-textarea:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Плавные переходы для всех интерактивных элементов */
#gmModal * {
    -webkit-tap-highlight-color: transparent;
}

#gmModal button,
#gmModal input,
#gmModal textarea {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

#gmModal .contact-grid,
#gmModal .contact-input {
    max-width: 100%;
    box-sizing: border-box;
}