/* =================== АДАПТИВНЫЕ СТИЛИ ДЛЯ ВЫВОДА РОБУКСОВ =================== */

/* Базовые стили для всех устройств */
.popup-withdraw {
    max-width: 550px;
    width: 90%;
    margin: 0 auto;
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
}

.popup-withdraw .modal-content {
    padding: 20px;
    box-sizing: border-box;
}

/* Прокрутка для мобильных устройств */
@media (max-height: 600px) {
    .popup-withdraw {
        max-height: 95vh;
        overflow-y: auto;
        margin-top: 2.5vh;
        margin-bottom: 2.5vh;
    }
    
    .overlay {
        padding: 2.5vh 0;
        overflow-y: auto;
    }
}

/* =================== ОЧЕНЬ МАЛЕНЬКИЕ ЭКРАНЫ (до 380px) =================== */
@media (max-width: 380px) {
    .popup-withdraw {
        width: 95%;
        max-width: none;
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
        height: 100vh;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        overflow-y: auto;
    }
    
    .overlay {
        padding: 0;
        align-items: stretch;
    }
    
    .popup-withdraw .modal-title {
        padding: 15px;
        font-size: 16px;
        position: sticky;
        top: 0;
        background: #4c536a;
        z-index: 10;
        border-bottom: 1px solid #3e4458;
    }
    
    .popup-withdraw .modal-title span {
        font-size: 16px;
        font-weight: 600;
    }
    
    .popup-withdraw .modal-content {
        padding: 15px;
        flex: 1;
    }
    
    .popup-withdraw .banner {
        padding: 10px 15px;
        font-size: 12px;
        margin: 10px 0;
    }
    
    .popup-withdraw .withdraw-title {
        padding: 15px;
        margin: 15px 0;
    }
    
    .popup-withdraw .withdraw-title h2 {
        font-size: 16px;
        line-height: 1.3;
    }
    
    .popup-withdraw .withdraw-title p {
        font-size: 12px;
        margin-top: 5px;
    }
    
    .amount-buttons {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin: 15px 0;
        padding: 0;
    }
    
    .amount-btn {
        padding: 12px 8px;
        font-size: 13px;
        border-radius: 8px;
        min-height: 44px;
        white-space: nowrap;
    }
    
    .custom-amount {
        margin: 15px 0;
        padding: 0;
    }
    
    .amount-input {
        max-width: 150px;
        padding: 12px 15px;
        font-size: 16px;
    }
    
    .amount-input input {
        font-size: 16px;
    }
    
    .currency-symbol {
        font-size: 16px;
    }
    
    .amount-hint {
        font-size: 11px;
        margin-top: 8px;
    }
    
    .amount-total {
        margin: 15px 0;
        padding: 12px;
    }
    
    .amount-total span {
        font-size: 16px;
    }
    
    .amount-total b {
        font-size: 18px;
    }
    
    .continue-btn {
        padding: 14px 20px;
        font-size: 14px;
        border-radius: 8px;
        min-height: 48px;
    }
    
    /* Этап 2: Никнейм */
    .username-input {
        margin: 15px 0;
    }
    
    .username-input input {
        padding: 14px 15px;
        font-size: 16px;
        border-radius: 8px;
        min-height: 48px;
    }
    
    .username-title h2 {
        font-size: 18px;
    }
    
    .username-title p {
        font-size: 13px;
    }
    
    /* Этап 3: Персонаж */
    .character-title h2 {
        font-size: 18px;
    }
    
    .character-title p {
        font-size: 13px;
    }
    
    .character-selection {
        margin: 15px 0;
    }
    
    .character-item {
        padding: 12px;
        margin-bottom: 10px;
        border-radius: 8px;
        flex-direction: column;
        text-align: center;
    }
    
    .character-avatar {
        width: 50px;
        height: 50px;
        margin: 0 0 10px 0;
    }
    
    .character-name {
        font-size: 14px;
    }
    
    /* Этап 4: Место */
    .place-title h2 {
        font-size: 18px;
    }
    
    .place-selection {
        margin: 15px 0;
    }
    
    .place-item {
        padding: 12px;
        margin-bottom: 10px;
        border-radius: 8px;
        flex-direction: column;
        text-align: center;
    }
    
    .place-image {
        width: 50px;
        height: 50px;
        margin: 0 0 10px 0;
    }
    
    .place-name {
        font-size: 14px;
    }
    
    /* Этап 5: GamePass */
    .gamepass-title h2 {
        font-size: 18px;
    }
    
    .gamepass-title p {
        font-size: 13px;
    }
    
    .gamepass-calculator {
        margin: 15px 0;
    }
    
    .calculator-info {
        padding: 12px 15px;
        border-radius: 8px;
        flex-direction: column;
        text-align: center;
        gap: 5px;
    }
    
    .calculator-info span:first-child {
        font-size: 14px;
    }
    
    .calculator-info span:last-child {
        font-size: 18px;
    }
    
    .gamepass-instruction {
        margin: 15px 0;
    }
    
    .transfer-instruction-gamepass__instruction-video {
        border-radius: 8px;
    }
    
    /* Этап 6: Настройка */
    .gamepass-config-title h2 {
        font-size: 18px;
    }
    
    .gamepass-config-title p {
        font-size: 13px;
    }
    
    /* Этап 7: Финал */
    .steps-indicator {
        gap: 8px;
        margin-bottom: 15px;
        padding: 0 10px;
    }
    
    .step-item {
        width: 35px;
        height: 35px;
        font-size: 14px;
        border-radius: 50%;
    }
    
    .step-item:not(:last-child)::after {
        width: 8px;
        height: 2px;
    }
    
    .final-title {
        font-size: 20px;
        margin-bottom: 8px;
    }
    
    .final-subtitle {
        font-size: 12px;
        margin-bottom: 20px;
        line-height: 1.4;
    }
    
    .order-details {
        padding: 15px;
        gap: 15px;
        border-radius: 8px;
        margin: 15px 0;
    }
    
    .user-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 10px;
    }
    
    .user-avatar {
        width: 45px;
        height: 45px;
    }
    
    .user-name {
        font-size: 14px;
    }
    
    .order-info {
        width: 100%;
        margin: 15px 0;
    }
    
    .place-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 10px;
    }
    
    .place-image {
        width: 45px;
        height: 45px;
    }
    
    .place-name {
        font-size: 14px;
    }
    
    .gamepass-name {
        font-size: 11px;
        padding: 3px 8px;
        border-radius: 4px;
    }
    
    .order-amount {
        text-align: center;
        margin-top: 15px;
    }
    
    .amount-value {
        font-size: 24px;
        font-weight: 700;
    }
    
    .amount-label {
        font-size: 12px;
        margin-top: 5px;
    }
    
    .final-submit-btn {
        padding: 14px 20px;
        font-size: 14px;
        border-radius: 8px;
        min-height: 48px;
        margin-top: 15px;
    }
    
    .final-submit-btn i {
        margin-left: 8px;
    }
    
    /* Кнопка назад */
    .back-button {
        padding: 10px 0;
        margin-bottom: 15px;
    }
    
    .back-button a {
        font-size: 16px;
        padding: 8px 12px;
        border-radius: 6px;
        display: inline-flex;
        align-items: center;
        background: rgba(174, 187, 232, 0.1);
    }
    
    .back-button a:hover {
        background: rgba(174, 187, 232, 0.2);
    }
    
    /* Кнопка истории */
    .modal-title-actions {
        gap: 8px;
    }
    
    .history-btn {
        padding: 6px 10px;
        font-size: 12px;
        border-radius: 6px;
    }
    
    .history-btn span {
        display: none;
    }
    
    .modal-title-actions .close {
        font-size: 18px;
        padding: 6px;
        width: 30px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 6px;
        background: rgba(255, 255, 255, 0.1);
    }
    
    .modal-title-actions .close:hover {
        background: rgba(255, 255, 255, 0.2);
    }
}

/* =================== МОБИЛЬНЫЕ ТЕЛЕФОНЫ (380px - 768px) =================== */
@media (min-width: 380px) and (max-width: 768px) {
    .popup-withdraw {
        width: 85%;
        max-width: 420px;
        margin: 20px auto;
        border-radius: 12px;
    }
    
    .popup-withdraw .modal-title {
        padding: 18px 20px;
        font-size: 18px;
    }
    
    .popup-withdraw .modal-content {
        padding: 20px;
    }
    
    .popup-withdraw .banner {
        padding: 12px 18px;
        font-size: 13px;
        margin: 12px 0;
    }
    
    .popup-withdraw .withdraw-title {
        padding: 18px;
        margin: 20px 0;
    }
    
    .popup-withdraw .withdraw-title h2 {
        font-size: 18px;
    }
    
    .popup-withdraw .withdraw-title p {
        font-size: 13px;
    }
    
    .amount-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin: 20px 0;
    }
    
    .amount-btn {
        padding: 14px 16px;
        font-size: 14px;
        border-radius: 10px;
        min-height: 50px;
    }
    
    .custom-amount {
        margin: 20px 0;
    }
    
    .amount-input {
        max-width: 180px;
        padding: 14px 18px;
    }
    
    .amount-input input {
        font-size: 17px;
    }
    
    .currency-symbol {
        font-size: 17px;
    }
    
    .amount-hint {
        font-size: 12px;
    }
    
    .amount-total {
        margin: 20px 0;
        padding: 14px;
    }
    
    .amount-total span {
        font-size: 17px;
    }
    
    .amount-total b {
        font-size: 19px;
    }
    
    .continue-btn {
        padding: 16px 25px;
        font-size: 15px;
        border-radius: 10px;
        min-height: 52px;
    }
    
    /* Этапы 2-7 */
    .username-input input,
    .character-item,
    .place-item {
        min-height: 52px;
        border-radius: 10px;
    }
    
    .character-selection,
    .place-selection {
        margin: 20px 0;
    }
    
    .character-item,
    .place-item {
        padding: 14px;
        margin-bottom: 12px;
        flex-direction: row;
        align-items: center;
    }
    
    .character-avatar,
    .place-image {
        width: 55px;
        height: 55px;
        margin-right: 15px;
        margin-bottom: 0;
    }
    
    .character-name,
    .place-name {
        font-size: 15px;
    }
    
    .gamepass-calculator {
        margin: 20px 0;
    }
    
    .calculator-info {
        padding: 14px 18px;
        border-radius: 10px;
    }
    
    .calculator-info span:first-child {
        font-size: 15px;
    }
    
    .calculator-info span:last-child {
        font-size: 17px;
    }
    
    .steps-indicator {
        gap: 12px;
        margin-bottom: 20px;
    }
    
    .step-item {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .step-item:not(:last-child)::after {
        width: 12px;
        height: 2px;
    }
    
    .final-title {
        font-size: 22px;
    }
    
    .final-subtitle {
        font-size: 13px;
    }
    
    .order-details {
        padding: 18px;
        gap: 18px;
    }
    
    .user-avatar,
    .place-image {
        width: 50px;
        height: 50px;
    }
    
    .user-name,
    .place-name {
        font-size: 15px;
    }
    
    .gamepass-name {
        font-size: 12px;
        padding: 4px 8px;
    }
    
    .amount-value {
        font-size: 28px;
    }
    
    .amount-label {
        font-size: 13px;
    }
    
    .final-submit-btn {
        padding: 16px 25px;
        font-size: 15px;
        border-radius: 10px;
        min-height: 52px;
    }
    
    /* Навигация */
    .back-button a {
        font-size: 17px;
        padding: 10px 15px;
        border-radius: 8px;
    }
    
    .history-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .modal-title-actions .close {
        font-size: 20px;
        padding: 8px;
        width: 36px;
        height: 36px;
        border-radius: 8px;
    }
}

/* =================== ПЛАНШЕТЫ (768px - 1024px) =================== */
@media (min-width: 768px) and (max-width: 1024px) {
    .popup-withdraw {
        width: 70%;
        max-width: 480px;
        margin: 30px auto;
    }
    
    .popup-withdraw .modal-title {
        padding: 20px 25px;
        font-size: 19px;
    }
    
    .popup-withdraw .modal-content {
        padding: 25px;
    }
    
    .popup-withdraw .banner {
        padding: 14px 20px;
        font-size: 14px;
        margin: 15px 0;
    }
    
    .popup-withdraw .withdraw-title {
        padding: 20px;
        margin: 25px 0;
    }
    
    .popup-withdraw .withdraw-title h2 {
        font-size: 19px;
    }
    
    .popup-withdraw .withdraw-title p {
        font-size: 14px;
    }
    
    .amount-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin: 25px 0;
    }
    
    .amount-btn {
        padding: 15px 20px;
        font-size: 15px;
        border-radius: 10px;
        min-height: 54px;
    }
    
    .custom-amount {
        margin: 25px 0;
    }
    
    .amount-input {
        max-width: 200px;
        padding: 15px 20px;
    }
    
    .amount-input input {
        font-size: 18px;
    }
    
    .currency-symbol {
        font-size: 18px;
    }
    
    .amount-hint {
        font-size: 13px;
    }
    
    .amount-total {
        margin: 25px 0;
        padding: 15px;
    }
    
    .amount-total span {
        font-size: 18px;
    }
    
    .amount-total b {
        font-size: 20px;
    }
    
    .continue-btn {
        padding: 17px 30px;
        font-size: 16px;
        border-radius: 11px;
        min-height: 54px;
    }
    
    /* Этапы 2-7 */
    .username-input input {
        min-height: 54px;
        border-radius: 10px;
        padding: 15px 20px;
        font-size: 16px;
    }
    
    .character-item,
    .place-item {
        padding: 15px;
        margin-bottom: 14px;
        border-radius: 10px;
        min-height: 54px;
    }
    
    .character-avatar,
    .place-image {
        width: 60px;
        height: 60px;
        margin-right: 18px;
    }
    
    .character-name,
    .place-name {
        font-size: 16px;
    }
    
    .gamepass-calculator {
        margin: 25px 0;
    }
    
    .calculator-info {
        padding: 15px 20px;
        border-radius: 10px;
    }
    
    .calculator-info span:first-child {
        font-size: 16px;
    }
    
    .calculator-info span:last-child {
        font-size: 18px;
    }
    
    .steps-indicator {
        gap: 15px;
        margin-bottom: 25px;
    }
    
    .step-item {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .step-item:not(:last-child)::after {
        width: 15px;
        height: 2px;
    }
    
    .final-title {
        font-size: 24px;
    }
    
    .final-subtitle {
        font-size: 14px;
    }
    
    .order-details {
        padding: 20px;
        gap: 20px;
    }
    
    .user-avatar,
    .place-image {
        width: 55px;
        height: 55px;
    }
    
    .user-name,
    .place-name {
        font-size: 16px;
    }
    
    .gamepass-name {
        font-size: 13px;
        padding: 4px 10px;
    }
    
    .amount-value {
        font-size: 32px;
    }
    
    .amount-label {
        font-size: 14px;
    }
    
    .final-submit-btn {
        padding: 17px 30px;
        font-size: 16px;
        border-radius: 11px;
        min-height: 54px;
    }
}

/* =================== ДЕСКТОПЫ (1024px+) =================== */
@media (min-width: 1024px) {
    .popup-withdraw {
        width: 550px;
        max-width: 550px;
        margin: 40px auto;
    }
    
    .popup-withdraw .modal-title {
        padding: 20px 30px;
        font-size: 20px;
    }
    
    .popup-withdraw .modal-content {
        padding: 30px;
    }
    
    .amount-buttons {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
        margin: 25px 0;
    }
    
    .amount-btn {
        padding: 15px 20px;
        font-size: 16px;
        border-radius: 10px;
        min-height: 56px;
    }
    
    .custom-amount {
        margin: 25px 0;
    }
    
    .amount-input {
        max-width: 200px;
        padding: 15px 20px;
    }
    
    .amount-input input {
        font-size: 18px;
    }
    
    .currency-symbol {
        font-size: 18px;
    }
    
    .continue-btn {
        padding: 18px 35px;
        font-size: 16px;
        border-radius: 12px;
        min-height: 56px;
    }
    
    /* Этапы 2-7 */
    .username-input input {
        min-height: 56px;
        border-radius: 12px;
        padding: 15px 25px;
        font-size: 16px;
    }
    
    .character-item,
    .place-item {
        padding: 15px 20px;
        margin-bottom: 15px;
        border-radius: 12px;
        min-height: 56px;
    }
    
    .character-avatar,
    .place-image {
        width: 65px;
        height: 65px;
        margin-right: 20px;
    }
    
    .character-name,
    .place-name {
        font-size: 16px;
    }
    
    .gamepass-calculator {
        margin: 25px 0;
    }
    
    .calculator-info {
        padding: 15px 20px;
        border-radius: 12px;
    }
    
    .calculator-info span:first-child {
        font-size: 16px;
    }
    
    .calculator-info span:last-child {
        font-size: 18px;
    }
    
    .steps-indicator {
        gap: 20px;
        margin-bottom: 30px;
    }
    
    .step-item {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .step-item:not(:last-child)::after {
        width: 20px;
        height: 2px;
    }
    
    .final-title {
        font-size: 26px;
    }
    
    .final-subtitle {
        font-size: 15px;
    }
    
    .order-details {
        padding: 25px;
        gap: 25px;
    }
    
    .user-avatar,
    .place-image {
        width: 60px;
        height: 60px;
    }
    
    .user-name,
    .place-name {
        font-size: 17px;
    }
    
    .gamepass-name {
        font-size: 14px;
        padding: 5px 12px;
    }
    
    .amount-value {
        font-size: 36px;
    }
    
    .amount-label {
        font-size: 15px;
    }
    
    .final-submit-btn {
        padding: 18px 35px;
        font-size: 16px;
        border-radius: 12px;
        min-height: 56px;
    }
}

/* =================== ДОПОЛНИТЕЛЬНЫЕ АДАПТИВНЫЕ УЛУЧШЕНИЯ =================== */

/* Улучшения для касаний на мобильных устройствах */
@media (max-width: 768px) {
    .amount-btn,
    .continue-btn,
    .character-item,
    .place-item,
    .final-submit-btn {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    
    .amount-btn:active,
    .continue-btn:active,
    .character-item:active,
    .place-item:active,
    .final-submit-btn:active {
        transform: scale(0.98);
    }
    
    /* Увеличиваем размер области касания для кнопок */
    .back-button a,
    .history-btn,
    .modal-title-actions .close {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* Улучшения скролла */
@media (max-width: 768px) {
    .popup-withdraw {
        -webkit-overflow-scrolling: touch;
        overflow-y: auto;
    }
    
    .character-selection,
    .place-selection {
        -webkit-overflow-scrolling: touch;
        overflow-y: auto;
        max-height: 300px;
    }
}

/* Анимации для мобильных устройств */
@media (max-width: 768px) {
    .popup-withdraw .modal-content {
        transition: all 0.2s ease;
    }
    
    .amount-btn,
    .continue-btn,
    .character-item,
    .place-item {
        transition: all 0.2s ease;
    }
    
    .amount-btn:hover,
    .continue-btn:hover,
    .character-item:hover,
    .place-item:hover {
        transform: translateY(-1px);
    }
    
    .amount-btn.active {
        transform: translateY(-1px) scale(1.02);
    }
}

/* Ориентация экрана */
@media (max-width: 768px) and (orientation: landscape) {
    .popup-withdraw {
        width: 70%;
        max-width: 600px;
        max-height: 85vh;
        margin: 7.5vh auto;
    }
    
    .popup-withdraw .modal-title {
        padding: 12px 20px;
        font-size: 16px;
    }
    
    .popup-withdraw .modal-content {
        padding: 15px 20px;
    }
    
    .amount-buttons {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
        margin: 15px 0;
    }
    
    .amount-btn {
        padding: 10px 12px;
        font-size: 14px;
        min-height: 40px;
    }
    
    .popup-withdraw .withdraw-title {
        padding: 15px;
        margin: 15px 0;
    }
    
    .popup-withdraw .withdraw-title h2 {
        font-size: 16px;
    }
    
    .popup-withdraw .withdraw-title p {
        font-size: 12px;
    }
    
    .continue-btn {
        padding: 12px 25px;
        font-size: 14px;
        min-height: 44px;
    }
    
    .steps-indicator {
        gap: 8px;
        margin-bottom: 15px;
    }
    
    .step-item {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .final-title {
        font-size: 18px;
    }
    
    .final-subtitle {
        font-size: 12px;
    }
    
    .order-details {
        padding: 15px;
        gap: 15px;
    }
}

/* Высокие экраны */
@media (min-height: 800px) {
    .popup-withdraw {
        margin: 50px auto;
    }
}

/* Очень высокие экраны */
@media (min-height: 1000px) {
    .popup-withdraw {
        margin: 80px auto;
    }
}

/* Темная тема для мобильных устройств */
@media (prefers-color-scheme: dark) and (max-width: 768px) {
    .popup-withdraw {
        background: #2a2f3a;
        border: 1px solid #3e4458;
    }
    
    .popup-withdraw .modal-title {
        background: #2a2f3a;
        border-bottom: 1px solid #3e4458;
    }
    
    .amount-btn {
        background: #2a2f3a;
        border-color: #3e4458;
        color: #aebbe8;
    }
    
    .amount-btn:hover {
        background: #3a3f57;
        border-color: #4a4f67;
    }
    
    .amount-input {
        background: #2a2f3a;
        border-color: #3e4458;
    }
    
    .character-item,
    .place-item {
        background: #2a2f3a;
        border: 1px solid #3e4458;
    }
    
    .character-item:hover,
    .place-item:hover {
        background: #3a3f57;
        border-color: #4a4f67;
    }
    
    .order-details {
        background: #2a2f3a;
        border: 1px solid #3e4458;
    }
} 