.pet-overlay {
    position: fixed;
    inset: 0;
    z-index: 100002;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px 12px 86px;
    background: rgba(0, 0, 0, .58);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.pet-overlay.is-open { display: flex; }
body.pet-lock { overflow: hidden !important; }

.pet-dialog {
    position: relative;
    width: min(540px, calc(100vw - 24px));
    max-height: min(86vh, 790px);
    overflow: visible;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(255,247,236,.98) 100%);
    color: #1b1b1f;
    box-shadow: 0 28px 90px rgba(0, 0, 0, .45), 0 0 0 3px rgba(255, 138, 0, .22);
    font-family: inherit;
    display: flex;
    flex-direction: column;
    isolation: isolate;
}
.pet-dialog::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 118px;
    width: 126%;
    height: 338px;
    transform: translateX(-50%);
    background: url('../img/pet-gacha/popup_bg_cyberspace.png') center top / contain no-repeat;
    opacity: .97;
    pointer-events: none;
    z-index: 2;
    filter: drop-shadow(0 16px 24px rgba(0,0,0,.14));
}
.pet-dialog::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 128px;
    height: 330px;
    background: linear-gradient(180deg, rgba(72, 235, 255, .05), rgba(255,255,255,0));
    pointer-events: none;
    z-index: 2;
}

.pet-header {
    position: sticky;
    top: 0;
    z-index: 8;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 18px;
    background: linear-gradient(90deg, #ff2632, #ff8a00);
    color: #fff;
    border-radius: 22px 22px 0 0;
}
.pet-header__badge {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .22);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .16);
    font-size: 22px;
}
.pet-title-wrap { min-width: 0; }
.pet-title {
    margin: 0;
    font-size: 24px;
    line-height: 1.05;
    font-weight: 900;
    text-shadow: 0 2px 0 rgba(0, 0, 0, .12);
}
.pet-icon-row {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    min-height: 22px;
}
.pet-icon-row img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 2px 1px rgba(0,0,0,.24));
    animation: pet-icon-bounce 1.75s ease-in-out infinite;
}
.pet-icon-row img:nth-child(2) { animation-delay: .12s; }
.pet-icon-row img:nth-child(3) { animation-delay: .24s; }
.pet-icon-row img:nth-child(4) { animation-delay: .36s; }
.pet-icon-row img:nth-child(5) { animation-delay: .48s; }
@keyframes pet-icon-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.pet-refresh,
.pet-close-x {
    border: 0;
    background: rgba(255, 255, 255, .22);
    color: #fff;
    cursor: pointer;
}
.pet-refresh {
    margin-left: auto;
    width: 38px;
    height: 38px;
    border-radius: 12px;
}
.pet-close-x {
    position: absolute;
    right: 8px;
    top: -42px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 28px;
    line-height: 1;
    z-index: 9;
}
.pet-loading {
    position: relative;
    z-index: 1;
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #ff6b00;
    font-weight: 800;
}
.pet-body { position: relative; z-index: 3; padding: 16px 18px 20px; max-height: calc(min(86vh, 790px) - 82px); overflow-y: auto; overflow-x: visible; }
.pet-body::-webkit-scrollbar { width: 5px; }
.pet-body::-webkit-scrollbar-thumb { background: #ff9a21; border-radius: 999px; }

.pet-wallet-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}
.pet-wallet-pill {
    min-height: 62px;
    padding: 10px 9px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,247,238,.94));
    border: 1px solid rgba(255, 138, 0, .18);
    box-shadow: 0 10px 26px rgba(255,122,0,.08), inset 0 1px 0 rgba(255,255,255,.78);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-align: center;
    font-weight: 800;
    color: #777;
}
.pet-wallet-pill i,
.pet-wallet-pill img { width: 21px; height: 21px; object-fit: contain; color: #ff3a00; }
.pet-wallet-pill span { font-size: 12px; line-height: 1; }
.pet-wallet-pill strong,
.pet-wallet-gem strong { color: #ff3a00; font-size: 17px; line-height: 1; font-weight: 900; }
.pet-wallet-gem strong { color: #f59e0b; }

.pet-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}
.pet-tab {
    border: 1px solid rgba(255, 138, 0, .18);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255,255,255,.97), rgba(255,247,238,.95));
    color: #ff5b00;
    min-height: 46px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(0,0,0,.05);
    transition: transform .14s ease, box-shadow .18s ease, border-color .18s ease;
}
.pet-tab:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(255,122,0,.12); }
.pet-tab.is-active {
    background: linear-gradient(90deg, #ff2632, #ff8a00);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 10px 24px rgba(255, 82, 0, .25);
}
.pet-tab-panel { display: none; }
.pet-tab-panel.is-active { display: block; }

.pet-gacha-card { position: relative; margin: 0 -8px 12px; }
.pet-gacha-stage {
    position: relative;
    min-height: 290px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    width: calc(100% + 36px);
    margin-left: -18px;
    margin-right: -18px;
    border-radius: 26px;
    background:
        radial-gradient(circle at 50% 15%, rgba(255, 243, 182, .36), transparent 24%),
        linear-gradient(180deg, #fffefb 0%, #fff1da 100%);
    border: 2px solid rgba(255, 138, 0, .24);
    box-shadow: 0 22px 46px rgba(255, 108, 22, .12), inset 0 1px 0 rgba(255,255,255,.85);
}
.pet-gacha-stage::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,0) 24%, rgba(255,255,255,.10) 100%);
    border-radius: inherit;
}
.pet-gacha-stage.is-rolling::after {
    content: "";
    position: absolute;
    inset: -42%;
    z-index: 2;
    background: conic-gradient(from 0deg, transparent, rgba(255,255,255,.22), transparent, rgba(255, 138, 0, .46), transparent, rgba(255, 38, 50, .42), transparent);
    animation: petSpin .72s linear infinite;
}
.pet-gacha-bg {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 0;
    width: calc(100% + 54px);
    max-width: none;
    height: auto;
    object-fit: contain;
    transform: translate(-50%, -50%);
    user-select: none;
    pointer-events: none;
    animation: petBgFloat 8s ease-in-out infinite;
    filter: drop-shadow(0 12px 22px rgba(39, 23, 89, .18));
}
.pet-gacha-texture {
    position: relative;
    z-index: 3;
    max-width: 65%;
    max-height: 148px;
    object-fit: contain;
    opacity: .74;
    filter: drop-shadow(0 14px 20px rgba(0,0,0,.20));
    user-select: none;
    pointer-events: none;
    animation: petFloat 3s ease-in-out infinite;
}
.pet-gacha-featured-pet {
    position: absolute;
    left: 50%;
    bottom: 14px;
    z-index: 6;
    transform: translateX(-50%);
    max-width: 38%;
    max-height: 70%;
    object-fit: contain;
    filter: drop-shadow(0 16px 22px rgba(0, 0, 0, .34));
    user-select: none;
    pointer-events: none;
    animation: petFloatCenter 2.8s ease-in-out infinite;
}
.pet-ball-ring {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
}
.pet-ball-ring img {
    position: absolute;
    width: 38px;
    height: 38px;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 6px 4px rgba(0,0,0,.22));
    animation: petFloat 2.8s ease-in-out infinite;
}
.pet-ball-ring img:nth-child(1) { left: 5%; top: 18%; animation-delay: .1s; }
.pet-ball-ring img:nth-child(2) { right: 6%; top: 16%; animation-delay: .35s; }
.pet-ball-ring img:nth-child(3) { left: 7%; bottom: 18%; animation-delay: .65s; }
.pet-ball-ring img:nth-child(4) { right: 8%; bottom: 18%; animation-delay: .95s; }
.pet-ball-ring img:nth-child(5) { left: 50%; top: 14%; width: 30px; height: 30px; animation-delay: 1.2s; }
.pet-ball-ring img:nth-child(6) { left: 50%; bottom: 12%; width: 32px; height: 32px; animation-delay: 1.45s; }
.pet-stage-glow {
    position: absolute;
    left: 50%;
    bottom: 20px;
    z-index: 3;
    transform: translateX(-50%);
    width: 270px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 138, 0, .22);
    filter: blur(12px);
}
.pet-gacha-result {
    position: absolute;
    z-index: 7;
    text-align: center;
    min-width: 170px;
    padding: 13px 14px;
    border-radius: 18px;
    background: rgba(255,255,255,.96);
    border: 1px solid rgba(255, 138, 0, .25);
    box-shadow: 0 18px 42px rgba(0,0,0,.22);
    animation: petPop .24s ease both;
}
.pet-gacha-result img { width: 112px; height: 112px; object-fit: contain; display: block; margin: 0 auto 8px; }
.pet-gacha-result strong { display: block; font-size: 20px; color: #151515; font-weight: 900; }
.pet-gacha-result span { color: #ff3a00; font-weight: 900; text-transform: uppercase; }

.pet-gacha-info {
    position: relative;
    z-index: 6;
    margin-top: -2px;
    padding: 16px 16px 18px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255,255,255,.99), rgba(255,250,245,.98));
    box-shadow: 0 16px 36px rgba(255, 88, 0, .12);
    border: 1px solid rgba(255, 138, 0, .16);
}
.pet-name-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.pet-gacha-name {
    font-size: 22px;
    line-height: 1.12;
    font-weight: 900;
    color: #1a1a1a;
    text-shadow: 0 1px 0 rgba(255,255,255,.58);
}
.pet-gacha-price {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #fff1bf;
    color: #e55500;
    font-weight: 900;
    white-space: nowrap;
}
.pet-subtitle {
    margin: 12px 0 0;
    color: #454545;
    font-size: 14px;
    line-height: 1.42;
    font-weight: 700;
    text-align: center;
}
.pet-main-btn {
    width: 100%;
    min-height: 52px;
    margin-top: 14px;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(90deg, #ff5a6c 0%, #ff8a00 100%);
    color: #fff;
    font-size: 18px;
    font-weight: 900;
    letter-spacing: .45px;
    cursor: pointer;
    box-shadow: 0 14px 28px rgba(255, 82, 0, .24), inset 0 1px 0 rgba(255,255,255,.25);
    transition: transform .1s ease, opacity .15s ease, box-shadow .18s ease;
}
.pet-main-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 18px 32px rgba(255, 82, 0, .30), inset 0 1px 0 rgba(255,255,255,.25); }
.pet-main-btn:hover:not(:disabled) { transform: translateY(-1px); }
.pet-main-btn:active:not(:disabled) { transform: translateY(1px) scale(.99); }
.pet-main-btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.pet-note {
    margin: 10px 0 0;
    color: #777;
    font-size: 13px;
    font-weight: 800;
    text-align: center;
}

.pet-section {
    position: relative;
    z-index: 3;
    margin-top: 12px;
    padding: 14px 14px 15px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,248,239,.94));
    border: 1px solid rgba(255, 138, 0, .15);
    box-shadow: 0 10px 24px rgba(0,0,0,.05);
}
.pet-section-title {
    color: #ff3a00;
    font-size: 15px;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 10px;
}
.pet-catalog-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.pet-catalog-card,
.pet-owned-card {
    border-radius: 14px;
    background: #fff7ea;
    border: 1px solid rgba(255, 138, 0, .16);
    box-shadow: 0 8px 18px rgba(0,0,0,.04);
}
.pet-catalog-card { padding: 10px; display: flex; flex-direction: column; }
.pet-catalog-card img {
    width: 100%;
    height: 112px;
    object-fit: contain;
    border-radius: 12px;
    background: radial-gradient(circle, rgba(255, 212, 89, .28), rgba(255, 255, 255, .62));
}
.pet-catalog-card h4 {
    margin: 8px 0 6px;
    padding: 0;
    border-radius: 0;
    color: #ff7a00;
    font-size: 15px;
    line-height: 1.28;
    font-weight: 900;
    background: transparent;
    box-shadow: none;
    min-height: 38px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: none;
    word-break: break-word;
}
.pet-owned-main h4 {
    margin: 8px 0 4px;
    color: #ff7a00;
    font-size: 15px;
    font-weight: 900;
    line-height: 1.3;
    word-break: break-word;
}
.pet-rarity {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    border-radius: 999px;
    background: #fff1bf;
    border: 1px solid #ffd26a;
    color: #e55500;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}
.pet-drop-mini {
    display: flex;
    margin-top: auto;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    color: #777;
    font-weight: 800;
}
.pet-drop-mini img {
    width: 25px !important;
    height: 25px !important;
    object-fit: contain;
    border-radius: 7px;
    background: rgba(255,255,255,.9);
    border: 1px solid rgba(255,138,0,.14);
    padding: 2px;
}
.pet-owned-list { display: grid; gap: 10px; }
.pet-owned-card {
    display: grid;
    grid-template-columns: 112px 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px;
}
.pet-owned-img {
    width: 112px;
    height: 112px;
    object-fit: contain;
    border-radius: 14px;
    background: radial-gradient(circle, rgba(255, 212, 89, .32), rgba(255, 255, 255, .7));
    border: 1px solid rgba(255,138,0,.13);
}
.pet-level-line {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    color: #575757;
    font-size: 13px;
    font-weight: 800;
    margin: 6px 0;
}
.pet-action-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.pet-action-btn {
    border: 1px solid rgba(255, 138, 0, .18);
    border-radius: 12px;
    padding: 9px 12px;
    background: rgba(255, 255, 255, .94);
    color: #ff3a00;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
}
.pet-action-btn.feed { background: linear-gradient(90deg, #ffd86b, #ff9f1a); color: #301700; border-color: transparent; }
.pet-action-btn.claim { background: linear-gradient(90deg, #ff2632, #ff8a00); color: #fff; border-color: transparent; }
.pet-action-btn:disabled { opacity: .48; cursor: not-allowed; }
.pet-countdown {
    margin-top: 7px;
    padding: 8px 10px;
    border-radius: 12px;
    background: #fff7df;
    border: 1px solid #ffd26a;
    color: #9b5a00;
    font-size: 13px;
    font-weight: 900;
}
.pet-countdown span { color: #ff3a00; letter-spacing: .5px; }
.pet-empty {
    grid-column: 1 / -1;
    border: 1px dashed rgba(255, 138, 0, .32);
    border-radius: 14px;
    padding: 18px;
    text-align: center;
    color: #777;
    font-weight: 800;
    background: #fffaf1;
}
.pet-recent-list { display: grid; gap: 7px; }
.pet-recent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #fff7ea;
    color: #333;
    font-weight: 800;
    font-size: 13px;
}
.pet-recent-item span { overflow: hidden; text-overflow: ellipsis; }
.pet-recent-item strong { color: #111; }
.pet-recent-item em { color: #777; white-space: nowrap; font-style: normal; }
.pet-close-bottom {
    position: fixed;
    left: 50%;
    bottom: 34px;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid #fff;
    background: transparent;
    color: #fff;
    font-size: 32px;
    line-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100003;
}

@keyframes petSpin { to { transform: rotate(360deg); } }
@keyframes petFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes petFloatCenter { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-8px); } }
@keyframes petBgFloat { 0%,100% { transform: scale(1); } 50% { transform: scale(1.03); } }
@keyframes petPop { from { transform: scale(.82); opacity: 0; } to { transform: scale(1); opacity: 1; } }

@media (max-width: 560px) {
    .pet-overlay { padding: 68px 8px 76px; align-items: flex-start; }
    .pet-dialog { width: calc(100vw - 16px); max-height: calc(100vh - 148px); border-radius: 18px; }
    .pet-dialog::before { width: 136%; top: 110px; height: 250px; }
    .pet-dialog::after { top: 118px; height: 238px; }
    .pet-header { padding: 13px 14px; border-radius: 18px 18px 0 0; }
    .pet-title { font-size: 20px; }
    .pet-body { padding: 12px; max-height: calc(100vh - 232px); }
    .pet-wallet-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .pet-wallet-pill { min-height: 58px; padding: 8px 5px; }
    .pet-wallet-pill strong { font-size: 15px; }
    .pet-gacha-stage { min-height: 226px; width: calc(100% + 22px); margin-left: -11px; margin-right: -11px; }
    .pet-gacha-texture { max-width: 72%; max-height: 126px; }
    .pet-name-row { align-items: flex-start; }
    .pet-gacha-name { font-size: 18px; }
    .pet-gacha-price { font-size: 13px; }
    .pet-main-btn { min-height: 48px; font-size: 17px; }
    .pet-catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pet-catalog-card img { height: 94px; }
    .pet-catalog-card h4 { min-height: 34px; font-size: 13px; padding: 0; }
    .pet-owned-card { grid-template-columns: 86px 1fr; }
    .pet-owned-img { width: 86px; height: 86px; }
    .pet-action-row { gap: 6px; }
    .pet-action-btn { padding: 8px 9px; font-size: 12px; }
    .pet-close-x { display: none; }
}

@media (max-width: 390px) {
    .pet-dialog::before { width: 148%; top: 106px; height: 226px; }
    .pet-wallet-row { grid-template-columns: 1fr; }
    .pet-catalog-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .pet-gacha-featured-pet { max-width: 44%; max-height: 67%; bottom: 14px; }
    .pet-gacha-texture { max-width: 72%; max-height: 132px; }
}

.pet-name-label { display:inline-block; max-width:100%; }


.pet-wallet-row,
.pet-tabs,
.pet-gacha-info,
.pet-section {
    position: relative;
    z-index: 3;
}
.pet-gacha-card {
    position: relative;
    z-index: 4;
}
.pet-gacha-stage {
    z-index: 4;
}


/* v38: cân lại ảnh cyberspace - nằm trên popup nhưng sau pet cố định, không che ví/tab */
.pet-dialog::before {
    top: 188px !important;
    width: 116% !important;
    height: 258px !important;
    opacity: .92 !important;
    z-index: 1 !important;
    background-size: contain !important;
    background-position: center top !important;
}
.pet-dialog::after {
    top: 196px !important;
    height: 248px !important;
    z-index: 1 !important;
}
.pet-body { position: relative !important; z-index: 3 !important; }
.pet-wallet-row,
.pet-tabs { position: relative !important; z-index: 5 !important; }
.pet-gacha-card { position: relative !important; z-index: 6 !important; margin: 0 -2px 12px !important; }
.pet-gacha-stage {
    width: calc(100% + 12px) !important;
    margin-left: -6px !important;
    margin-right: -6px !important;
    min-height: 232px !important;
    overflow: visible !important;
    border-radius: 20px !important;
    background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,244,224,.92)) !important;
}
.pet-gacha-bg {
    width: 112% !important;
    max-width: none !important;
    height: auto !important;
    top: 50% !important;
    opacity: .96 !important;
    z-index: 0 !important;
    object-fit: contain !important;
    filter: drop-shadow(0 12px 18px rgba(0,0,0,.18)) !important;
}
/* Không hiện thêm texture giữa stage để tránh bị trùng/che pet cố định */
.pet-gacha-texture { display: none !important; }
.pet-gacha-featured-pet {
    z-index: 9 !important;
    bottom: 16px !important;
    max-width: 36% !important;
    max-height: 70% !important;
    filter: drop-shadow(0 16px 22px rgba(0,0,0,.36)) !important;
}
.pet-stage-glow { z-index: 2 !important; opacity: .55 !important; }
.pet-ball-ring { z-index: 8 !important; }
.pet-gacha-info,
.pet-section { position: relative !important; z-index: 7 !important; }
.pet-catalog-card h4,
.pet-owned-main h4 {
    color: #ff7a00 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    text-shadow: none !important;
}
.pet-catalog-card h4 {
    min-height: 34px !important;
    font-size: 15px !important;
    line-height: 1.22 !important;
}
@media (max-width: 560px) {
    .pet-dialog::before { top: 174px !important; width: 122% !important; height: 226px !important; }
    .pet-dialog::after { top: 182px !important; height: 220px !important; }
    .pet-gacha-stage { min-height: 210px !important; width: calc(100% + 8px) !important; margin-left: -4px !important; margin-right: -4px !important; }
    .pet-gacha-bg { width: 116% !important; }
    .pet-gacha-featured-pet { max-width: 42% !important; max-height: 66% !important; bottom: 14px !important; }
    .pet-catalog-card h4 { min-height: 32px !important; font-size: 13px !important; }
}
@media (max-width: 390px) {
    .pet-dialog::before { top: 166px !important; width: 128% !important; height: 210px !important; }
    .pet-gacha-featured-pet { max-width: 46% !important; }
}


/* v41 mobile hotfix: tối ưu popup Gacha Pet trên điện thoại, không đổi logic */
.pet-gacha-result:empty { display: none !important; }

@media (max-width: 768px) {
    .pet-dialog::before,
    .pet-dialog::after {
        display: none !important;
    }

    .pet-body {
        padding: 10px !important;
        max-height: calc(100dvh - 220px) !important;
    }

    .pet-wallet-row {
        gap: 8px !important;
    }

    .pet-wallet-pill {
        min-height: 56px !important;
        padding: 8px 6px !important;
    }

    .pet-wallet-pill span {
        font-size: 12px !important;
    }

    .pet-wallet-pill strong {
        font-size: 14px !important;
    }

    .pet-tabs {
        gap: 8px !important;
    }

    .pet-tab {
        min-height: 42px !important;
        font-size: 13px !important;
        padding: 0 10px !important;
    }

    .pet-gacha-card {
        margin: 0 0 10px !important;
    }

    .pet-gacha-stage {
        width: 100% !important;
        margin: 0 !important;
        min-height: 186px !important;
        border-radius: 18px !important;
        overflow: hidden !important;
    }

    .pet-gacha-bg {
        width: 108% !important;
        opacity: .34 !important;
        filter: drop-shadow(0 8px 14px rgba(0,0,0,.12)) !important;
    }

    .pet-gacha-featured-pet {
        max-width: 30% !important;
        max-height: 58% !important;
        bottom: 10px !important;
    }

    .pet-ball-ring img {
        width: 30px !important;
        height: 30px !important;
    }

    .pet-ball-ring img:nth-child(1) { left: 4% !important; top: 20% !important; }
    .pet-ball-ring img:nth-child(2) { right: 4% !important; top: 20% !important; }
    .pet-ball-ring img:nth-child(3) { left: 7% !important; bottom: 18% !important; }
    .pet-ball-ring img:nth-child(4) { right: 7% !important; bottom: 18% !important; }
    .pet-ball-ring img:nth-child(5) { left: 50% !important; top: 12% !important; width: 26px !important; height: 26px !important; }
    .pet-ball-ring img:nth-child(6) { left: 50% !important; bottom: 10% !important; width: 28px !important; height: 28px !important; }

    .pet-stage-glow {
        opacity: .32 !important;
    }

    .pet-gacha-info {
        margin-top: 8px !important;
        padding: 14px 12px 16px !important;
        border-radius: 18px !important;
    }

    .pet-name-row {
        align-items: center !important;
        gap: 8px !important;
    }

    .pet-gacha-name {
        font-size: 18px !important;
    }

    .pet-gacha-price {
        font-size: 12px !important;
        padding: 6px 10px !important;
        border-radius: 999px !important;
    }

    .pet-subtitle {
        margin-top: 10px !important;
        font-size: 12px !important;
        line-height: 1.35 !important;
    }

    .pet-main-btn {
        min-height: 48px !important;
        font-size: 16px !important;
        margin-top: 12px !important;
    }

    .pet-note {
        margin-top: 10px !important;
        font-size: 11.5px !important;
        line-height: 1.35 !important;
    }

    .pet-section {
        padding: 12px !important;
    }

    .pet-section-title {
        font-size: 15px !important;
    }

    .pet-catalog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    .pet-catalog-card img {
        height: 82px !important;
    }

    .pet-catalog-card h4 {
        min-height: 32px !important;
        font-size: 13px !important;
    }
}

@media (max-width: 420px) {
    .pet-overlay {
        padding: 62px 8px 82px !important;
    }

    .pet-dialog {
        width: calc(100vw - 14px) !important;
        max-height: calc(100dvh - 128px) !important;
        border-radius: 18px !important;
    }

    .pet-header {
        padding: 12px !important;
    }

    .pet-header__badge {
        width: 48px !important;
        height: 48px !important;
    }

    .pet-title {
        font-size: 19px !important;
    }

    .pet-icon-row img {
        width: 22px !important;
        height: 22px !important;
    }

    .pet-wallet-row {
        gap: 6px !important;
    }

    .pet-wallet-pill {
        min-height: 54px !important;
    }

    .pet-wallet-pill strong {
        font-size: 13px !important;
    }

    .pet-gacha-stage {
        min-height: 170px !important;
    }

    .pet-gacha-bg {
        width: 104% !important;
    }

    .pet-gacha-featured-pet {
        max-width: 28% !important;
        max-height: 54% !important;
    }

    .pet-ball-ring img {
        width: 28px !important;
        height: 28px !important;
    }

    .pet-gacha-price {
        font-size: 11px !important;
    }

    .pet-subtitle {
        font-size: 11.5px !important;
    }

    .pet-note {
        font-size: 11px !important;
    }
}

@media (max-width: 360px) {
    .pet-wallet-row {
        grid-template-columns: 1fr !important;
    }

    .pet-catalog-grid {
        grid-template-columns: 1fr !important;
    }
}


/* v42 mobile hotfix 2: sửa popup Gacha Pet trên điện thoại gọn và ổn định hơn */
@media (max-width: 768px) {
    .pet-dialog {
        overflow: hidden !important;
    }

    .pet-close-bottom {
        bottom: 92px !important;
        width: 44px !important;
        height: 44px !important;
        font-size: 34px !important;
        line-height: 30px !important;
        background: rgba(84,84,84,.28) !important;
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
    }

    .pet-gacha-stage {
        min-height: 158px !important;
        padding: 0 !important;
        align-items: center !important;
        justify-content: center !important;
        background: linear-gradient(180deg, rgba(255,255,255,.97), rgba(255,244,224,.96)) !important;
    }

    .pet-gacha-bg {
        width: 96% !important;
        left: 50% !important;
        top: auto !important;
        bottom: -4px !important;
        transform: translateX(-50%) !important;
        opacity: .22 !important;
        object-position: center bottom !important;
    }

    .pet-gacha-texture {
        display: none !important;
    }

    .pet-gacha-featured-pet {
        max-width: 24% !important;
        max-height: 52% !important;
        bottom: 10px !important;
    }

    .pet-ball-ring {
        z-index: 5 !important;
    }

    .pet-ball-ring img {
        width: 24px !important;
        height: 24px !important;
        opacity: .95 !important;
    }

    .pet-ball-ring img:nth-child(1) { left: 5% !important; top: 22% !important; }
    .pet-ball-ring img:nth-child(2) { right: 5% !important; top: 22% !important; }
    .pet-ball-ring img:nth-child(3) { left: 7% !important; bottom: 20% !important; }
    .pet-ball-ring img:nth-child(4) { right: 7% !important; bottom: 20% !important; }
    .pet-ball-ring img:nth-child(5) { left: 52% !important; top: 14% !important; width: 22px !important; height: 22px !important; }
    .pet-ball-ring img:nth-child(6) { left: 52% !important; bottom: 12% !important; width: 24px !important; height: 24px !important; }

    .pet-stage-glow {
        width: 180px !important;
        height: 22px !important;
        bottom: 10px !important;
        opacity: .24 !important;
    }

    .pet-gacha-info {
        margin-top: 10px !important;
        padding: 14px 12px 14px !important;
    }

    .pet-name-row {
        margin-bottom: 4px !important;
    }

    .pet-gacha-name {
        font-size: 17px !important;
    }

    .pet-subtitle {
        margin-top: 8px !important;
        margin-bottom: 0 !important;
        font-size: 11.5px !important;
        line-height: 1.34 !important;
    }

    .pet-main-btn {
        min-height: 46px !important;
        font-size: 15px !important;
        margin-top: 10px !important;
    }

    .pet-note {
        margin-top: 8px !important;
        font-size: 11px !important;
    }
}

@media (max-width: 430px) {
    .pet-dialog {
        width: calc(100vw - 16px) !important;
        max-height: calc(100dvh - 140px) !important;
    }

    .pet-wallet-row {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .pet-wallet-pill {
        min-height: 50px !important;
        padding: 7px 4px !important;
        border-radius: 14px !important;
    }

    .pet-wallet-pill i,
    .pet-wallet-pill img {
        margin-bottom: 2px !important;
        width: 18px !important;
        height: 18px !important;
    }

    .pet-wallet-pill span {
        font-size: 11px !important;
    }

    .pet-wallet-pill strong {
        font-size: 12px !important;
    }

    .pet-tab {
        min-height: 40px !important;
        font-size: 12px !important;
        border-radius: 14px !important;
    }

    .pet-gacha-stage {
        min-height: 148px !important;
    }

    .pet-gacha-featured-pet {
        max-width: 22% !important;
        max-height: 48% !important;
    }

    .pet-ball-ring img {
        width: 22px !important;
        height: 22px !important;
    }

    .pet-ball-ring img:nth-child(5) { width: 20px !important; height: 20px !important; }
    .pet-ball-ring img:nth-child(6) { width: 22px !important; height: 22px !important; }

    .pet-gacha-price {
        font-size: 11px !important;
        padding: 5px 9px !important;
    }

    .pet-section {
        padding: 10px !important;
    }
}

@media (max-width: 375px) {
    .pet-wallet-row {
        grid-template-columns: 1fr !important;
    }

    .pet-tabs {
        grid-template-columns: 1fr !important;
    }

    .pet-gacha-stage {
        min-height: 142px !important;
    }

    .pet-ball-ring img:nth-child(2),
    .pet-ball-ring img:nth-child(4) {
        right: 6% !important;
    }
}


/* v43 mobile hotfix 3: sửa lỗi popup Gacha Pet bị đè/nút đóng che nội dung trên điện thoại */
@media (max-width: 768px) {
    .pet-overlay {
        align-items: flex-start !important;
        padding: max(54px, env(safe-area-inset-top)) 8px max(92px, env(safe-area-inset-bottom)) !important;
    }

    .pet-dialog {
        width: calc(100vw - 16px) !important;
        max-height: calc(100svh - 170px) !important;
        overflow: hidden !important;
    }

    .pet-body {
        max-height: calc(100svh - 250px) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 9px !important;
    }

    .pet-close-bottom {
        display: none !important;
    }

    .pet-close-x {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        top: 16px !important;
        right: 58px !important;
        width: 34px !important;
        height: 34px !important;
        border-radius: 12px !important;
        background: rgba(255,255,255,.20) !important;
        color: #fff !important;
        border: 0 !important;
        font-size: 24px !important;
        line-height: 1 !important;
        z-index: 10 !important;
    }

    .pet-header {
        flex-shrink: 0 !important;
    }

    .pet-wallet-row,
    .pet-tabs {
        margin-bottom: 9px !important;
    }

    .pet-gacha-stage {
        min-height: 136px !important;
        border-radius: 16px !important;
    }

    .pet-gacha-bg {
        width: 96% !important;
        opacity: .18 !important;
        bottom: -8px !important;
    }

    .pet-gacha-featured-pet {
        max-width: 20% !important;
        max-height: 46% !important;
        bottom: 9px !important;
    }

    .pet-ball-ring img {
        width: 21px !important;
        height: 21px !important;
    }

    .pet-ball-ring img:nth-child(1) { left: 6% !important; top: 24% !important; }
    .pet-ball-ring img:nth-child(2) { right: 6% !important; top: 24% !important; }
    .pet-ball-ring img:nth-child(3) { left: 8% !important; bottom: 22% !important; }
    .pet-ball-ring img:nth-child(4) { right: 8% !important; bottom: 22% !important; }
    .pet-ball-ring img:nth-child(5) { left: 51% !important; top: 16% !important; width: 19px !important; height: 19px !important; }
    .pet-ball-ring img:nth-child(6) { left: 51% !important; bottom: 15% !important; width: 20px !important; height: 20px !important; }

    .pet-gacha-info {
        margin-top: 8px !important;
        padding: 12px 11px 13px !important;
        border-radius: 16px !important;
    }

    .pet-gacha-name {
        font-size: 16px !important;
        line-height: 1.12 !important;
    }

    .pet-gacha-price {
        font-size: 10.5px !important;
        min-height: 28px !important;
        padding: 4px 8px !important;
    }

    .pet-subtitle {
        font-size: 10.8px !important;
        line-height: 1.28 !important;
        margin-top: 7px !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 3 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
    }

    .pet-main-btn {
        min-height: 42px !important;
        font-size: 14px !important;
        margin-top: 9px !important;
        border-radius: 14px !important;
    }

    .pet-note {
        display: none !important;
    }

    .pet-section {
        margin-top: 8px !important;
    }
}

@media (max-width: 430px) {
    .pet-overlay {
        padding-top: max(50px, env(safe-area-inset-top)) !important;
        padding-bottom: max(88px, env(safe-area-inset-bottom)) !important;
    }

    .pet-dialog {
        max-height: calc(100svh - 156px) !important;
    }

    .pet-body {
        max-height: calc(100svh - 232px) !important;
    }

    .pet-header {
        padding: 10px 12px !important;
    }

    .pet-header__badge {
        width: 42px !important;
        height: 42px !important;
    }

    .pet-title {
        font-size: 18px !important;
    }

    .pet-icon-row {
        gap: 4px !important;
        margin-top: 4px !important;
    }

    .pet-icon-row img {
        width: 20px !important;
        height: 20px !important;
    }

    .pet-refresh {
        width: 36px !important;
        height: 36px !important;
        border-radius: 12px !important;
    }

    .pet-close-x {
        top: 13px !important;
        right: 54px !important;
        width: 32px !important;
        height: 32px !important;
    }

    .pet-wallet-pill {
        min-height: 46px !important;
    }

    .pet-tab {
        min-height: 38px !important;
        font-size: 11.5px !important;
    }

    .pet-gacha-stage {
        min-height: 126px !important;
    }

    .pet-gacha-featured-pet {
        max-width: 19% !important;
        max-height: 43% !important;
    }

    .pet-subtitle {
        -webkit-line-clamp: 2 !important;
    }
}

@media (max-width: 375px) {
    .pet-gacha-stage {
        min-height: 118px !important;
    }

    .pet-gacha-featured-pet {
        max-width: 18% !important;
        max-height: 40% !important;
    }
}


/* v44 mobile final: popup Gacha Pet lớn hơn, dễ đọc hơn trên điện thoại */
@media (max-width: 430px) {
    .pet-overlay {
        padding: max(16px, env(safe-area-inset-top)) 4px max(74px, env(safe-area-inset-bottom)) !important;
        align-items: flex-start !important;
    }

    .pet-dialog {
        width: calc(100vw - 8px) !important;
        max-width: 430px !important;
        max-height: calc(100svh - 92px) !important;
        border-radius: 20px !important;
    }

    .pet-header {
        padding: 12px 14px !important;
        border-radius: 20px 20px 0 0 !important;
    }

    .pet-title {
        font-size: 20px !important;
    }

    .pet-close-x {
        top: 14px !important;
        right: 58px !important;
        width: 34px !important;
        height: 34px !important;
        display: flex !important;
    }

    .pet-refresh {
        width: 38px !important;
        height: 38px !important;
    }

    .pet-close-bottom {
        display: none !important;
    }

    .pet-body {
        padding: 12px !important;
        max-height: calc(100svh - 190px) !important;
    }

    .pet-wallet-row {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }

    .pet-wallet-pill {
        min-height: 56px !important;
        padding: 8px 6px !important;
    }

    .pet-wallet-pill span {
        font-size: 12px !important;
    }

    .pet-wallet-pill strong {
        font-size: 14px !important;
    }

    .pet-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }

    .pet-tab {
        min-height: 42px !important;
        font-size: 13px !important;
    }

    .pet-gacha-card {
        margin: 0 0 12px !important;
    }

    .pet-gacha-stage {
        min-height: 190px !important;
        border-radius: 18px !important;
    }

    .pet-gacha-bg {
        width: 112% !important;
        opacity: .24 !important;
        bottom: -8px !important;
    }

    .pet-gacha-featured-pet {
        max-width: 30% !important;
        max-height: 62% !important;
        bottom: 10px !important;
    }

    .pet-ball-ring img {
        width: 25px !important;
        height: 25px !important;
    }

    .pet-ball-ring img:nth-child(1) { left: 6% !important; top: 24% !important; }
    .pet-ball-ring img:nth-child(2) { right: 6% !important; top: 24% !important; }
    .pet-ball-ring img:nth-child(3) { left: 8% !important; bottom: 20% !important; }
    .pet-ball-ring img:nth-child(4) { right: 8% !important; bottom: 20% !important; }
    .pet-ball-ring img:nth-child(5) { left: 52% !important; top: 16% !important; width: 22px !important; height: 22px !important; }
    .pet-ball-ring img:nth-child(6) { left: 52% !important; bottom: 13% !important; width: 24px !important; height: 24px !important; }

    .pet-gacha-info {
        margin-top: 10px !important;
        padding: 14px 14px 16px !important;
        border-radius: 18px !important;
    }

    .pet-gacha-name {
        font-size: 18px !important;
    }

    .pet-gacha-price {
        font-size: 12px !important;
        padding: 6px 10px !important;
        min-height: 30px !important;
    }

    .pet-subtitle {
        font-size: 12.5px !important;
        line-height: 1.34 !important;
        margin-top: 8px !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 4 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
    }

    .pet-main-btn {
        min-height: 46px !important;
        font-size: 15px !important;
        margin-top: 10px !important;
    }

    .pet-note {
        display: none !important;
    }

    .pet-section {
        margin-top: 10px !important;
        padding: 12px !important;
        border-radius: 16px !important;
    }

    .pet-section-title {
        font-size: 16px !important;
    }

    .pet-catalog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    .pet-catalog-card img {
        height: 90px !important;
    }

    .pet-catalog-card h4 {
        font-size: 13px !important;
        min-height: 34px !important;
    }
}

@media (max-width: 375px) {
    .pet-dialog {
        width: calc(100vw - 6px) !important;
    }

    .pet-gacha-stage {
        min-height: 176px !important;
    }

    .pet-gacha-featured-pet {
        max-width: 28% !important;
        max-height: 58% !important;
    }

    .pet-subtitle {
        font-size: 12px !important;
    }
}


/* v45 REAL FIX: mobile Gacha Pet - làm pet/stage to rõ, bỏ cắt chữ mô tả */
@media (max-width: 520px) {
    .pet-overlay {
        padding: max(10px, env(safe-area-inset-top)) 4px max(66px, env(safe-area-inset-bottom)) !important;
        align-items: flex-start !important;
    }
    .pet-dialog {
        width: calc(100vw - 8px) !important;
        max-width: none !important;
        max-height: calc(100svh - 76px) !important;
        border-radius: 22px !important;
    }
    .pet-header {
        padding: 12px 14px !important;
        min-height: 74px !important;
        border-radius: 22px 22px 0 0 !important;
    }
    .pet-header__badge { width: 48px !important; height: 48px !important; }
    .pet-title { font-size: 21px !important; line-height: 1.05 !important; }
    .pet-icon-row img { width: 22px !important; height: 22px !important; }
    .pet-close-x {
        display: flex !important;
        top: 16px !important;
        right: 58px !important;
        width: 38px !important;
        height: 38px !important;
        background: rgba(255,255,255,.20) !important;
        color: #fff !important;
        border-radius: 14px !important;
        align-items: center !important;
        justify-content: center !important;
    }
    .pet-refresh { width: 40px !important; height: 40px !important; border-radius: 14px !important; }
    .pet-close-bottom { display:none !important; }
    .pet-body {
        padding: 12px !important;
        max-height: calc(100svh - 150px) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    .pet-wallet-row { grid-template-columns: repeat(3, minmax(0,1fr)) !important; gap: 8px !important; margin-bottom: 10px !important; }
    .pet-wallet-pill { min-height: 58px !important; padding: 8px 4px !important; border-radius: 16px !important; }
    .pet-wallet-pill i,.pet-wallet-pill img{ width:20px!important;height:20px!important; }
    .pet-wallet-pill span { font-size: 12px !important; }
    .pet-wallet-pill strong { font-size: 14px !important; }
    .pet-tabs { grid-template-columns: repeat(2,minmax(0,1fr)) !important; gap: 8px !important; margin-bottom: 10px !important; }
    .pet-tab { min-height: 44px !important; font-size: 13px !important; border-radius: 16px !important; }
    .pet-gacha-card { margin: 0 0 12px !important; }
    .pet-gacha-stage {
        width: 100% !important;
        margin: 0 !important;
        min-height: 218px !important;
        border-radius: 20px !important;
        overflow: hidden !important;
        background: linear-gradient(180deg, rgba(255,255,255,.97), rgba(255,244,224,.96)) !important;
    }
    .pet-gacha-bg {
        width: 118% !important;
        opacity: .30 !important;
        bottom: -10px !important;
        left:50%!important;
        top:auto!important;
        transform:translateX(-50%)!important;
    }
    .pet-gacha-texture { display:none!important; }
    .pet-gacha-featured-pet {
        max-width: 46% !important;
        max-height: 76% !important;
        bottom: 12px !important;
        z-index: 9 !important;
    }
    .pet-ball-ring img { width: 27px !important; height: 27px !important; }
    .pet-ball-ring img:nth-child(1){left:6%!important;top:21%!important;}
    .pet-ball-ring img:nth-child(2){right:6%!important;top:21%!important;}
    .pet-ball-ring img:nth-child(3){left:8%!important;bottom:19%!important;}
    .pet-ball-ring img:nth-child(4){right:8%!important;bottom:19%!important;}
    .pet-ball-ring img:nth-child(5){left:52%!important;top:12%!important;width:23px!important;height:23px!important;}
    .pet-ball-ring img:nth-child(6){left:52%!important;bottom:10%!important;width:25px!important;height:25px!important;}
    .pet-gacha-info { margin-top: 10px !important; padding: 14px 14px 16px !important; border-radius: 19px !important; }
    .pet-gacha-name { font-size: 19px !important; line-height: 1.15 !important; }
    .pet-gacha-price { font-size: 12px !important; min-height: 30px !important; padding: 6px 10px !important; }
    .pet-subtitle {
        font-size: 12.5px !important;
        line-height: 1.32 !important;
        margin-top: 8px !important;
        display: block !important;
        overflow: visible !important;
        -webkit-line-clamp: unset !important;
        -webkit-box-orient: unset !important;
        text-overflow: clip !important;
    }
    .pet-main-btn { min-height: 48px !important; font-size: 16px !important; margin-top: 12px !important; border-radius: 16px !important; }
    .pet-note { display:none!important; }
    .pet-section { margin-top: 10px !important; padding: 12px !important; border-radius: 16px !important; }
    .pet-section-title { font-size: 16px !important; }
    .pet-catalog-grid { grid-template-columns:repeat(2,minmax(0,1fr))!important; gap:10px!important; }
    .pet-catalog-card img { height: 96px !important; }
}
@media (max-width: 380px) {
    .pet-gacha-stage { min-height: 200px !important; }
    .pet-gacha-featured-pet { max-width: 44% !important; }
    .pet-subtitle { font-size: 12px !important; }
}


/* v46 FINAL REAL FIX: Gacha Pet rõ hơn trên cả PC và mobile */
.pet-dialog{
    width:min(660px, calc(100vw - 20px)) !important;
    max-height:min(88dvh, 860px) !important;
}
.pet-dialog::before{
    width:118% !important;
    top:126px !important;
    height:356px !important;
    opacity:.92 !important;
}
.pet-dialog::after{
    top:136px !important;
    height:344px !important;
}
.pet-body{
    padding:14px 16px 16px !important;
}
.pet-gacha-stage{
    min-height:276px !important;
    border-radius:22px !important;
}
.pet-gacha-bg{
    width:110% !important;
    opacity:.30 !important;
}
.pet-gacha-featured-pet{
    max-width:50% !important;
    max-height:82% !important;
    bottom:10px !important;
    transform:translateX(-50%) scale(1.38) !important;
    transform-origin:bottom center !important;
}
.pet-gacha-info{
    padding:18px 18px 20px !important;
}
.pet-gacha-name{
    font-size:24px !important;
}
.pet-subtitle{
    display:block !important;
    overflow:visible !important;
    text-overflow:clip !important;
    white-space:normal !important;
    line-height:1.4 !important;
}
.pet-note{
    display:block !important;
}
.pet-catalog-card h4{
    color:#f26b00 !important;
}

@media (max-width: 520px){
    .pet-overlay{
        padding:max(8px, env(safe-area-inset-top)) 2px max(60px, env(safe-area-inset-bottom)) !important;
    }
    .pet-dialog{
        width:calc(100vw - 4px) !important;
        max-width:none !important;
        max-height:calc(100svh - 66px) !important;
        border-radius:20px !important;
    }
    .pet-header{
        padding:12px 12px !important;
    }
    .pet-title{font-size:20px !important;}
    .pet-close-x{right:56px !important; width:36px !important; height:36px !important;}
    .pet-refresh{width:38px !important; height:38px !important;}
    .pet-body{
        padding:10px 10px 12px !important;
        max-height:calc(100svh - 136px) !important;
    }
    .pet-wallet-pill{min-height:56px !important;}
    .pet-gacha-stage{
        min-height:214px !important;
    }
    .pet-gacha-bg{
        width:114% !important;
        opacity:.26 !important;
    }
    .pet-gacha-featured-pet{
        max-width:48% !important;
        max-height:78% !important;
        transform:translateX(-50%) scale(1.34) !important;
    }
    .pet-gacha-name{font-size:18px !important;}
    .pet-subtitle{font-size:12.5px !important;}
    .pet-main-btn{min-height:46px !important;}
    .pet-note{display:none !important;}
}

@media (max-width: 380px){
    .pet-gacha-stage{min-height:196px !important;}
    .pet-gacha-featured-pet{transform:translateX(-50%) scale(1.26) !important;}
    .pet-subtitle{font-size:12px !important;}
}


/* v47 FINAL COMPACT FIX: Gacha Pet gọn hơn, bỏ lớp mờ/viền cam khu skin */
.pet-dialog::before,
.pet-dialog::after{
    display:none !important;
    content:none !important;
}
.pet-dialog{
    width:min(600px, calc(100vw - 16px)) !important;
    max-height:min(86dvh, 810px) !important;
}
.pet-body{
    padding:12px 14px 14px !important;
}
.pet-gacha-card{
    margin:0 0 10px !important;
}
.pet-gacha-stage{
    min-height:228px !important;
    background:linear-gradient(180deg, #fffdfa 0%, #fff8ef 100%) !important;
    border:0 !important;
    box-shadow:none !important;
    outline:0 !important;
    border-radius:20px !important;
    overflow:hidden !important;
}
.pet-gacha-stage::before,
.pet-gacha-stage::after{
    display:none !important;
    content:none !important;
}
.pet-gacha-bg{
    width:96% !important;
    opacity:.18 !important;
    left:50% !important;
    top:50% !important;
    bottom:auto !important;
    transform:translate(-50%, -50%) !important;
    filter:none !important;
}
.pet-gacha-featured-pet{
    max-width:34% !important;
    max-height:64% !important;
    bottom:12px !important;
    transform:translateX(-50%) scale(1) !important;
    filter:drop-shadow(0 10px 16px rgba(0,0,0,.22)) !important;
}
.pet-ball-ring img{
    width:34px !important;
    height:34px !important;
}
.pet-gacha-info{
    margin-top:8px !important;
    padding:16px 16px 18px !important;
    border-radius:18px !important;
    box-shadow:none !important;
}
.pet-gacha-name{
    font-size:20px !important;
}
.pet-subtitle{
    margin-top:10px !important;
    font-size:13px !important;
    line-height:1.38 !important;
}
.pet-note{
    display:block !important;
    margin-top:8px !important;
}
@media (max-width: 520px){
    .pet-dialog{
        width:calc(100vw - 8px) !important;
        max-height:calc(100svh - 70px) !important;
        border-radius:18px !important;
    }
    .pet-header{
        padding:11px 12px !important;
    }
    .pet-title{font-size:19px !important;}
    .pet-body{
        padding:10px 10px 12px !important;
        max-height:calc(100svh - 134px) !important;
    }
    .pet-wallet-row,
    .pet-tabs{
        gap:8px !important;
        margin-bottom:8px !important;
    }
    .pet-wallet-pill{min-height:54px !important;}
    .pet-gacha-stage{
        min-height:168px !important;
        border-radius:18px !important;
    }
    .pet-gacha-bg{
        width:92% !important;
        opacity:.16 !important;
    }
    .pet-gacha-featured-pet{
        max-width:30% !important;
        max-height:58% !important;
        bottom:10px !important;
    }
    .pet-ball-ring img{
        width:30px !important;
        height:30px !important;
    }
    .pet-gacha-info{
        margin-top:8px !important;
        padding:14px 14px 16px !important;
        border-radius:16px !important;
    }
    .pet-gacha-name{font-size:18px !important;}
    .pet-subtitle{font-size:12px !important;}
    .pet-main-btn{min-height:46px !important; margin-top:10px !important;}
    .pet-note{display:none !important;}
}
@media (max-width: 380px){
    .pet-gacha-stage{min-height:154px !important;}
    .pet-gacha-featured-pet{max-width:28% !important; max-height:54% !important;}
}
