html {
    height: 100%;
}

.home {
    background-position: center;
    width: 100%;
    background-origin: content-box;
    background-size: cover;
}

.home-container {
    width: 100%;
    min-height: 100vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    max-width: 100%;
    padding: clamp(20px, 2vw, 48px);
    box-sizing: border-box;
}

.home-text {
    text-align: center;
    margin-bottom: 15px;
}

.home-logo {
    width: 320px;
    max-width: min(320px, 90vw);
    display: block;
    margin: clamp(40px, 12vw, 180px) auto 40px auto;
}

#home-section .home-logo {
    margin-top: clamp(-80px, -6vw, -30px);
}

/* Login home: logo up, input centered */
.home-container .home-inner-login {
    align-self: stretch;
    min-height: 100vh;
    justify-content: flex-start;
    padding-top: clamp(40px, 8vh, 120px);
}

#home-section .home-inner-login .home-logo-top {
    margin: clamp(24px, 4vh, 72px) auto 0 auto;
    flex-shrink: 0;
}

.home-inner-login .home-form-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.home-inner-login .home-form-center .phone-input {
    margin-left: auto;
    margin-right: auto;
}

.home-input-slot {
    width: 100%;
    min-height: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.home-input-slot .phone-input {
    margin-bottom: 0;
}

.login-btn-img {
    cursor: pointer;
    max-width: 200px;
    width: 90%;
    height: auto;
    margin-top: 20px;
    transition: transform 0.2s, filter 0.2s;
}

.login-btn-img:hover {
    transform: scale(1.05);
    filter: brightness(0.95);
}

.login-btn-img:active {
    transform: scale(0.98);
}

/* Hurd wheel image */
.hurd-img {
    width: 90%;
    max-width: 400px;
    margin-top: clamp(16px, 2vw, 48px);
    margin-left: auto;
    margin-right: auto;
    display: block;
}

.start-btn-img {
    cursor: pointer;
    max-width: min(24rem, 90vw);
    width: 90%;
    height: auto;
    display: block;
    margin: 0 auto;
    background: none;
    border: none;
    padding: 0;
    transition: transform 0.2s, filter 0.2s;
    margin-top: clamp(16px, 2vw, 48px);
}

.start-btn-img img {
    display: block;
    pointer-events: none;
    width: 100%;
}

.start-btn-wrap {
    text-align: center;
}

.start-btn-img:hover {
    transform: scale(1.05);
    filter: brightness(0.95);
}

.start-btn-img:active {
    transform: scale(0.98);
}

.phone-input {
    width: 90%;
    min-width: 280px;
    max-width: 400px;
    padding: 10px 24px;
    font-size: 18px;
    border: 1px solid #FFFFFF;
    border-radius: 50px;
    background-color: #FFFFFF;
    color: #000;
    text-align: center;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
    height: 50px;
    display: block;
    margin: 0 auto 20px auto;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
}

.phone-input::placeholder {
    color: #bcc8e0;
}

body {
    font-family: 'Calibri', sans-serif;
    font-size: 14px;
    color: #000;
    background-size: cover !important;
    background-color: #F4F6F8;
}

input[type='number'] {
    -moz-appearance: textfield;
    appearance: textfield;
}

button:focus {
    outline: 0 !important;
}

.homebtn {
    display: inline-block;
    padding: 8px 26px;
    font-size: 14px;
    font-weight: 700;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    box-shadow: 7px 7px 0 0 #4578f7;
    letter-spacing: 1px;
    transition: box-shadow 0.16s, background 0.16s, transform 0.12s;
}

.homebtn:hover {
    transform: translate(3px, 3px) scale(0.97);
    box-shadow: 8px 8px 0 0 #4578f7;
}

.homebtn:active {
    box-shadow: none;
    transform: translate(5px, 5px) scale(0.97);
}

.surpbtn {
    font-size: 13px;
    padding: 5px 8px;
    width: 100px;
    outline: none;
    border: none;
    border-radius: 30px;
    background-color: #0046C3;
    color: white;
    box-sizing: border-box;
    white-space: nowrap;
    box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
}

.surpbtn:hover {
    color: white;
    box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
}

.valtext,
.hyper {
    margin-top: 10px;
    font-size: 16px;
    color: #000;
    font-weight: 200;
}

.hyper {
    cursor: pointer;
}

.hyper:hover {
    text-decoration: underline;
}

.space {
    min-height: 15px;
}

.close img {
    width: 25px;
}

/* Modal (Bootstrap override) */
.modal-content {
    background: white;
    padding: 20px;
    width: 95%;
    max-width: 400px;
    text-align: center;
    position: relative;
    border-radius: 22px;
    background: #FFF;
    box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
}

/* ========== prepaidGiftModal - flex ашиглан төвлөрүүлэх ========== */
#prepaidGiftModal.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    z-index: 1050;
}
#prepaidGiftModal.modal.fade {
    transition: opacity 0s ease-out;
}
#prepaidGiftModal.modal.fade .modal-dialog {
    transition: transform 0s ease-out;
}
/* Modal backdrop хурдасгах */
body .modal-backdrop.fade {
    transition: opacity 0s ease-out;
}
#prepaidGiftModal.modal.in {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
#prepaidGiftModal .modal-dialog.gift-modal-dialog {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    width: 95%;
    max-width: 500px;
    margin: 0;
}
#prepaidGiftModal .gift-modal {
    background: #fff;
    border-radius: 20px;
    padding: 24px;
    overflow: visible;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 400px;
}
#prepaidGiftModal .gift-img-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 20px;
    overflow: visible;
}
#prepaidGiftModal .gift-modal-x-btn {
    position: absolute;
    top: -20px;
    right: -20px;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
    margin: 0;
    border: none;
    background: none;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
#prepaidGiftModal .gift-modal-x-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}
#prepaidGiftModal .gift-img-wrap .reveal-img {
    max-width: min(260px, 65vw);
    width: 100%;
    display: block;
    object-fit: contain;
    transition: none;
}
#prepaidGiftModal .gift-modal-close-btn {
    max-width: 350px;
    width: 75%;
    cursor: pointer;
    display: block;
}
#prepaidGiftModal .gift-modal-congrats {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    pointer-events: none;
}

#giftReveal {
    background-color: white;
    max-width: 800px;
    width: 90%;
    background: white;
    padding: 20px;
    border-radius: 20px;
}

#giftReveal .row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

#giftReveal .col-xs-12,
#giftReveal .col-md-6 {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.reveal {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.reveal-img {
    width: 90%;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

#loader2 {
    position: relative;
    opacity: 1;
    transform: translateX(0);
    transition: opacity 1s ease, transform 1s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.animate-gift {
    opacity: 1;
    transform: translateX(0);
}

/* Sections container - center content (modal-тэй ижил төвлөрөлт) */
#sections-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding-top: 80px;
    padding-bottom: 100px;
    padding-left: 0;
    padding-right: 0;
    min-height: 100vh;
    overflow-y: auto;
    margin-left: 0;
    margin-right: 0;
}

#rule-section,
#wheel-section,
#history-section {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Logo: ижил байрлал, 3 tab дээр дээш */
#sections-container #rule-section .home-logo,
#sections-container #wheel-section .home-logo,
#sections-container #history-section .home-logo {
    margin: clamp(24px, 4vh, 72px) auto 20px auto;
}

/* Swap layout - center section content */
.row.swap-md {
    margin-left: 0;
    margin-right: 0;
}

.swap-md {
    display: grid;
    width: 100%;
    justify-items: center;
}

.swap-md .col-xs-12 {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 clamp(16px, 2vw, 48px);
    box-sizing: border-box;
    margin-left: 0;
    margin-right: 0;
}

.section-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-align: center;
}

/* Bottom navigation - Bootstrap row margin-ийг арилгах */
#bottom-nav.row {
    margin-left: 0;
    margin-right: 0;
}

#bottom-nav {
    display: none;
    justify-content: center;
    align-items: center;
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    width: 100%;
    padding: 12px 0 20px;
    z-index: 100;
    background: transparent;
}

#bottom-nav .col-xs-12 {
    text-align: center;
    display: flex;
    justify-content: center;
    margin-left: 0;
    margin-right: 0;
    padding-left: 15px;
    padding-right: 15px;
}

/* Segmented Tab Navigation */
.segmented {
    --pill-bg: linear-gradient(180deg, #f6fbfe 0%, #eef6fb 100%);
    --accent-shadow: rgba(30, 96, 255, 0.28);
    --muted-blue: #8fbbe9;

    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    padding: 8px;
    background: var(--pill-bg);
    border-radius: 30px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
    max-width: 350px;
    margin: 0 auto;
}

.segmented .option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 22px;
    cursor: pointer;
    user-select: none;
    transition: all 200ms cubic-bezier(.2, .9, .3, 1);
    background: transparent;
    border: none;
    outline: none;
    font-weight: 600;
    font-size: 14px;
    color: var(--muted-blue);
    min-width: 100px;
    height: 40px;
}

.segmented .option .icon {
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    flex: 0 0 16px;
    display: block;
    object-fit: contain;
    object-position: center;
}

.segmented .option .label {
    font-size: 18px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    color: inherit;
    text-align: center;
    margin: 0;
}

.segmented .option.selected {
    color: #fff;
    background: linear-gradient(180deg, #1D5FD3 0%, #1e56d6 100%);
    box-shadow: 0 10px 26px var(--accent-shadow), 0 2px 8px rgba(27, 84, 214, 0.12);
}

.segmented .option:not(.selected) .icon {
    color: var(--muted-blue);
}

.segmented .option:not(.selected) .label {
    color: #1D5FD3;
}

.segmented .option:focus-visible {
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.back-btn-fixed {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
    object-fit: contain;
}

.back-btn-fixed:hover {
    transform: scale(1.1);
    filter: brightness(1.1);
}

.back-btn-fixed:active {
    transform: scale(0.95);
}

#userBalanceContainer {
    display: flex;
    align-items: stretch;
    gap: 14px;
    color: #333;
}

#userBalanceContainer .user-info-block {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

#userBalanceContainer .user-info-block:first-child {
    background: rgba(255, 255, 255, 0.95);
}

#userBalanceContainer .user-profile-icon {
    width: 52px;
    height: 52px;
    object-fit: contain;
    flex-shrink: 0;
}

#userBalanceContainer .user-info-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#userBalanceContainer .user-info-label {
    font-size: 15px;
    font-weight: 400;
    color: #666;
    line-height: 1.2;
}

#userBalanceContainer .user-info-value {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    line-height: 1.2;
}

/* History section */
#history-section {
    padding-bottom: 60px;
}


.history-white-box {
    margin: clamp(36px, 6vh, 100px) auto 60px auto;
    padding: 24px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-height: 200px;
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
}

.history-state {
    display: none;
    text-align: center;
    padding: clamp(1.5rem, 8vw, 3rem);
    color: #666;
}

#history-loading img {
    width: 40px;
    height: 40px;
}

#history-loading p {
    margin-top: 10px;
}

#history-empty {
    font-size: clamp(14px, calc(14px + 0.5vw), 18px);
}

#history-list {
    display: none;
    max-height: 50vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#history-prizes {
    list-style: none;
    padding: 0;
    margin: 0;
}

.history-prize-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    font-size: clamp(13px, calc(13px + 0.4vw), 16px);
    color: #000;
}

.history-prize-date {
    color: #000;
    flex-shrink: 0;
    margin-right: 16px;
    font-size: 14px;
}

.history-prize-date-bold {
    font-weight: bold;
    font-size: 14px;
}

.history-prize-name {
    font-weight: bold;
    text-align: right;
    font-size: 14px;
}

/* Rule section */

.rule-white-box {
    margin: clamp(36px, 6vh, 100px) auto 60px auto;
    padding: 24px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
    text-align: left;
}

.rule-title {
    font-size: 18px;
    font-weight: bold;
    text-align: left;
}

.rule-intro {
    font-size: 14px;
    color: #000;
    line-height: 1.5;
}

.rule-prize-list {
    list-style: disc;
    padding-left: 24px;
    font-size: 14px;
    color: #000;
    text-align: left;
}

.rule-prize-list li {
    padding: 4px 0;
}

/* Жижиг дэлгэц - давхардалгүй (1366x768, 1280x800, 1024x768, 1024x600) */
@media (max-height: 900px) {
    #sections-container {
        padding-top: 70px;
        padding-bottom: 90px;
    }

    #sections-container #rule-section .home-logo,
    #sections-container #wheel-section .home-logo,
    #sections-container #history-section .home-logo {
        margin: clamp(16px, 3vh, 40px) auto 16px auto;
    }

    .history-white-box,
    .rule-white-box {
        margin: clamp(24px, 4vh, 60px) auto 40px;
    }

    .hurd-img {
        margin-top: clamp(12px, 1.5vw, 32px);
    }

    .start-btn-img {
        margin-top: clamp(12px, 1.5vw, 32px);
    }
}

/* 768px өндөр (1366x768, 1024x768) */
@media (max-height: 800px) {
    #sections-container {
        padding-top: 60px;
        padding-bottom: 85px;
    }

    #sections-container #rule-section .home-logo,
    #sections-container #wheel-section .home-logo,
    #sections-container #history-section .home-logo {
        width: 260px;
        max-width: min(260px, 85vw);
        margin: 12px auto 12px auto;
    }

    .history-white-box,
    .rule-white-box {
        margin: 16px auto 24px;
        padding: 16px;
        min-height: 120px;
    }

    .rule-prize-list li {
        padding: 2px 0;
    }

    .hurd-img {
        max-width: 380px;
        margin-top: 12px;
    }

    .start-btn-img {
        max-width: min(20rem, 85vw);
        margin-top: 12px;
    }

    #history-section {
        padding-bottom: 40px;
    }

    #bottom-nav {
        padding: 8px 0 0;
        bottom: 12px;
    }

    .segmented {
        padding: 6px;
        gap: 6px;
    }

    .segmented .option {
        min-width: 80px;
        padding: 6px 10px;
        height: 36px;
        font-size: 12px;
    }

    .segmented .option .label {
        font-size: 14px;
    }

    .segmented .option .icon {
        width: 14px;
        height: 14px;
        min-width: 14px;
        min-height: 14px;
        flex: 0 0 14px;
        object-fit: contain;
    }
}

@media (max-width: 1200px) {
    #backButtonContainer {
        left: 20px !important;
        top: 20px !important;
    }

    #skytelLogoContainer {
        right: 20px !important;
        top: 20px !important;
    }

    #userBalanceContainer {
        left: 80px !important;
        top: 20px !important;
        font-size: 12px !important;
    }

    #userBalanceContainer .user-profile-icon {
        width: 42px;
        height: 42px;
    }

    #userBalanceContainer .user-info-label {
        font-size: 13px;
    }

    #userBalanceContainer .user-info-value {
        font-size: 20px;
    }

    .segmented {
        max-width: min(350px, 90vw);
        padding: 6px;
        gap: 8px;
    }

    .segmented .option {
        min-width: 80px;
        padding: 6px 12px;
        font-size: 13px;
    }

    .segmented .option .label {
        font-size: 15px;
    }
}

/* 1024px өргөн - нарийн дэлгэц */
@media (max-width: 1100px) {
    #backButtonContainer {
        left: 16px !important;
        top: 16px !important;
    }

    #skytelLogoContainer {
        right: 16px !important;
        top: 16px !important;
    }

    #userBalanceContainer {
        left: 75px !important;
        top: 16px !important;
        font-size: 12px !important;
    }

    .swap-md .col-xs-12 {
        padding: 0 12px;
    }

    .phone-input {
        min-width: 240px;
    }
}

/* 600px өндөр (1024x600) - маш нягт - Хэрэглэгч back доор, Таны нэгж лого доор */
@media (max-height: 650px) {
    #sections-container {
        padding-top: 52px;
        padding-bottom: 78px;
    }

    #backButtonContainer {
        top: 12px !important;
        left: 12px !important;
    }

    #skytelLogoContainer {
        top: 12px !important;
        right: 12px !important;
    }

    #userBalanceContainer {
        display: contents;
    }

    #userBalanceContainer .user-info-block:first-child {
        position: fixed !important;
        top: 50px !important;
        left: 12px !important;
        right: auto !important;
        transform: none !important;
        z-index: 997;
    }

    #userBalanceContainer .user-info-block:last-child {
        position: fixed !important;
        top: 50px !important;
        right: 12px !important;
        left: auto !important;
        transform: none !important;
        z-index: 997;
    }

    #userBalanceContainer .user-info-block {
        padding: 8px 12px !important;
        gap: 8px !important;
    }

    #userBalanceContainer .user-profile-icon {
        width: 32px !important;
        height: 32px !important;
    }

    #userBalanceContainer .user-info-label {
        font-size: 11px !important;
    }

    #userBalanceContainer .user-info-value {
        font-size: 16px !important;
    }

    #skytelLogoContainer img {
        height: 24px !important;
    }

    #sections-container #rule-section .home-logo,
    #sections-container #wheel-section .home-logo,
    #sections-container #history-section .home-logo {
        width: 200px;
        max-width: min(200px, 80vw);
        margin: 8px auto 8px auto;
    }

    .history-white-box,
    .rule-white-box {
        margin: 12px auto 16px;
        padding: 12px;
        min-height: 80px;
        border-radius: 16px;
    }

    .rule-title {
        font-size: 16px;
    }

    .rule-intro,
    .rule-prize-list {
        font-size: 13px;
    }

    .rule-prize-list li {
        padding: 1px 0;
    }

    .hurd-img {
        max-width: 300px;
        margin-top: 8px;
    }

    .start-btn-img {
        max-width: min(16rem, 80vw);
        margin-top: 8px;
    }

    .history-prize-item {
        padding: 8px 0;
        font-size: 13px;
    }

    #history-section {
        padding-bottom: 24px;
    }

    #bottom-nav {
        padding: 6px 0 0;
        bottom: 8px;
    }

    .segmented {
        padding: 4px;
        gap: 4px;
        max-width: 320px;
    }

    .segmented .option {
        min-width: 70px;
        padding: 4px 8px;
        height: 32px;
        font-size: 11px;
    }

    .segmented .option .label {
        font-size: 13px;
    }

    .segmented .option .icon {
        width: 12px;
        height: 12px;
        min-width: 12px;
        min-height: 12px;
        flex: 0 0 12px;
        object-fit: contain;
    }
}

/* Утасны дэлгэц: Хэрэглэгч - back доор, Таны нэгж - лого доор, жижиг хэмжээ */
@media (max-width: 768px) {
    #userBalanceContainer {
        display: contents;
    }

    #userBalanceContainer .user-info-block {
        padding: 8px 12px !important;
        gap: 8px !important;
        border-radius: 12px !important;
    }

    #userBalanceContainer .user-profile-icon {
        width: 32px !important;
        height: 32px !important;
    }

    #userBalanceContainer .user-info-label {
        font-size: 11px !important;
    }

    #userBalanceContainer .user-info-value {
        font-size: 16px !important;
    }

    #userBalanceContainer .user-info-block:first-child {
        position: fixed !important;
        top: 55px !important;
        left: 20px !important;
        right: auto !important;
        transform: none !important;
        z-index: 997;
    }

    #userBalanceContainer .user-info-block:last-child {
        position: fixed !important;
        top: 55px !important;
        right: 20px !important;
        left: auto !important;
        transform: none !important;
        z-index: 997;
    }
}

/* ========== Mobile devices (phones) ========== */
@media (max-width: 480px) {
    html {
        -webkit-text-size-adjust: 100%;
        -webkit-tap-highlight-color: transparent;
    }

    body {
        overflow-x: hidden;
    }

    #backButtonContainer {
        top: max(12px, env(safe-area-inset-top)) !important;
        left: max(12px, env(safe-area-inset-left)) !important;
    }

    .back-btn-fixed {
        min-width: 44px;
        min-height: 44px;
        padding: 7px;
        box-sizing: border-box;
    }

    #skytelLogoContainer {
        top: max(12px, env(safe-area-inset-top)) !important;
        right: max(12px, env(safe-area-inset-right)) !important;
    }

    #userBalanceContainer .user-info-block {
        padding: 6px 10px !important;
        gap: 6px !important;
        border-radius: 10px !important;
    }

    #userBalanceContainer .user-profile-icon {
        width: 28px !important;
        height: 28px !important;
    }

    #userBalanceContainer .user-info-label {
        font-size: 10px !important;
    }

    #userBalanceContainer .user-info-value {
        font-size: 14px !important;
    }

    #userBalanceContainer .user-info-block:first-child {
        top: max(55px, calc(env(safe-area-inset-top) + 44px)) !important;
        left: max(12px, env(safe-area-inset-left)) !important;
    }

    #userBalanceContainer .user-info-block:last-child {
        top: max(55px, calc(env(safe-area-inset-top) + 44px)) !important;
        right: max(12px, env(safe-area-inset-right)) !important;
    }

    #skytelLogoContainer img {
        height: 24px !important;
    }

    .home-container .home-inner-login {
        padding-top: max(clamp(24px, 6vh, 80px), env(safe-area-inset-top));
    }

    #home-section .home-inner-login .home-logo-top {
        margin: clamp(16px, 3vh, 48px) auto 0 auto;
    }

    .home-logo {
        width: min(280px, 85vw);
        max-width: 85vw;
        margin-left: auto;
        margin-right: auto;
    }

    .home-inner {
        align-items: center;
        text-align: center;
    }

    .home-form-center {
        align-items: center;
        width: 100%;
    }

    .phone-input {
        width: calc(100% - 24px);
        min-width: 0;
        max-width: 380px;
        font-size: 16px;
        padding: 12px 24px;
        height: 48px;
        margin-left: auto;
        margin-right: auto;
    }

    .login-btn-img {
        min-height: 44px;
        padding: 8px 0;
        margin-left: auto;
        margin-right: auto;
        display: block;
    }

    .home-text {
        text-align: center;
        width: 100%;
    }

    #sections-container {
        padding-top: max(60px, env(safe-area-inset-top));
        padding-bottom: max(100px, env(safe-area-inset-bottom));
    }

    #sections-container #rule-section .home-logo,
    #sections-container #wheel-section .home-logo,
    #sections-container #history-section .home-logo {
        width: min(260px, 80vw);
        max-width: 80vw;
    }

    .swap-md .col-xs-12 {
        padding: 0 16px;
        margin-left: 0;
        margin-right: 0;
    }

    .row.swap-md {
        margin-left: 0;
        margin-right: 0;
    }

    .history-white-box,
    .rule-white-box {
        width: calc(100% - 32px);
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }

    .hurd-img {
        width: 95%;
        max-width: 320px;
        margin-top: clamp(24px, 4vh, 48px);
        margin-left: auto;
        margin-right: auto;
        display: block;
    }

    .start-btn-wrap {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .start-btn-img {
        max-width: min(14rem, 72vw);
        width: 72%;
        min-height: 44px;
        margin-left: auto;
        margin-right: auto;
    }

    #bottom-nav.row {
        margin-left: 0;
        margin-right: 0;
    }

    #bottom-nav {
        bottom: max(12px, env(safe-area-inset-bottom));
        padding: 8px 12px max(16px, env(safe-area-inset-bottom));
        left: 0;
        right: 0;
    }

    #bottom-nav .col-xs-12 {
        max-width: 320px;
        margin: 0 auto;
        padding-left: 0;
        padding-right: 0;
    }

    .segmented {
        max-width: min(100%, 300px);
        width: 100%;
        margin-left: auto;
        margin-right: auto;
        padding: 4px;
        gap: 4px;
        border-radius: 22px;
    }

    .segmented .option {
        min-width: 0;
        flex: 1;
        min-height: 36px;
        padding: 4px 8px;
        font-size: 11px;
        border-radius: 18px;
    }

    .segmented .option .label {
        font-size: 13px;
    }

    .segmented .option .icon {
        width: 12px;
        height: 12px;
        min-width: 12px;
        min-height: 12px;
        flex: 0 0 12px;
    }

    /* Gift modal - mobile */
    #prepaidGiftModal .modal-dialog.gift-modal-dialog {
        overflow: visible;
    }
    #prepaidGiftModal .gift-modal {
        padding: 16px;
        min-height: 350px;
    }
    /* X товч - утасны touch target (40px) */
    #prepaidGiftModal .gift-modal-x-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        top: -12px;
        right: -12px;
    }


    .surpbtn {
        min-height: 44px;
        padding: 10px 16px;
    }

    .homebtn {
        min-height: 44px;
        padding: 12px 24px;
    }

    .hyper {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 8px 16px;
    }
}

/* 360x740 гэх мэт нарийн утас - илүү жижиг */
@media (max-width: 400px) {
    #userBalanceContainer .user-info-block {
        padding: 5px 8px !important;
        gap: 5px !important;
        border-radius: 8px !important;
    }

    #userBalanceContainer .user-profile-icon {
        width: 24px !important;
        height: 24px !important;
    }

    #userBalanceContainer .user-info-label {
        font-size: 9px !important;
    }

    #userBalanceContainer .user-info-value {
        font-size: 12px !important;
    }

    #userBalanceContainer .user-info-block:first-child {
        top: max(50px, calc(env(safe-area-inset-top) + 40px)) !important;
        left: max(8px, env(safe-area-inset-left)) !important;
    }

    #userBalanceContainer .user-info-block:last-child {
        top: max(50px, calc(env(safe-area-inset-top) + 40px)) !important;
        right: max(8px, env(safe-area-inset-right)) !important;
    }
}

/* Extra small phones (320px–375px) */
@media (max-width: 375px) {
    .home-logo {
        width: min(240px, 90vw);
    }

    #sections-container #rule-section .home-logo,
    #sections-container #wheel-section .home-logo,
    #sections-container #history-section .home-logo {
        width: min(220px, 85vw);
    }

    .phone-input {
        font-size: 16px;
    }

    .segmented .option .label {
        font-size: 13px;
    }

    .rule-white-box,
    .history-white-box {
        padding: 16px;
    }

    .rule-prize-list {
        padding-left: 20px;
    }
}

/* Desktop - бага зэрэг дээшлүүлж scroll хэрэггүй болгох */
@media (min-width: 769px) {
    #sections-container {
        padding-top: 55px;
        padding-bottom: 85px;
    }

    #sections-container #rule-section .home-logo,
    #sections-container #wheel-section .home-logo,
    #sections-container #history-section .home-logo {
        margin: clamp(16px, 2.5vh, 48px) auto 16px auto;
    }

    .rule-white-box,
    .history-white-box {
        margin: clamp(24px, 4vh, 70px) auto 40px;
    }

    .hurd-img {
        margin-top: clamp(12px, 1.5vw, 32px);
    }

    .start-btn-img {
        margin-top: clamp(12px, 1.5vw, 32px);
    }

    /* Gift modal - desktop width ихэсгэх, height хэвэндээ */
    #prepaidGiftModal .modal-dialog.gift-modal-dialog {
        max-width: 750px;
        width: 90%;
    }
    #prepaidGiftModal .gift-modal {
        padding: 36px 48px;
    }
    #prepaidGiftModal .gift-img-wrap .reveal-img {
        max-width: 420px;
    }
    #prepaidGiftModal .gift-modal-close-btn {
        max-width: 450px;
    }
}

/* Mobile landscape - short height */
@media (max-width: 480px) and (max-height: 500px) {
    .home-container .home-inner-login {
        padding-top: max(16px, env(safe-area-inset-top));
    }

    #home-section .home-inner-login .home-logo-top {
        margin-top: 8px;
    }

    .home-form-center {
        padding: 8px 0;
    }

    #sections-container {
        padding-top: max(50px, env(safe-area-inset-top));
        padding-bottom: max(80px, env(safe-area-inset-bottom));
    }

    #sections-container #rule-section .home-logo,
    #sections-container #wheel-section .home-logo,
    #sections-container #history-section .home-logo {
        margin: 8px auto 12px auto;
    }

    .hurd-img {
        max-width: 260px;
        margin-top: 8px;
    }

    .start-btn-img {
        margin-top: 8px;
    }

    .history-white-box,
    .rule-white-box {
        margin: 12px auto 20px;
    }
}