@font-face {
    font-family: 'Dancing Script Bold';
    src: url('assets/fonts/DancingScript-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

/* .settings-icon {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
}

.settings-icon:hover {
    background: rgba(255, 255, 255, 0.2);
} */


/* Web cha - làm nổi bật nút cài đặt */
body.web-cha .settings-icon {
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 2px 12px rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.4);
}

body.web-cha .settings-icon:hover {
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

body.web-cha .settings-icon i {
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.controls {
    position: fixed;
    right: 10px;
    top: 10px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    color: white;
    z-index: 1000;
    max-height: 80vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(0, 0, 0, 0.2);
    min-width: 250px;
}

.controls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.controls-header h3 {
    margin: 0;
    font-size: 16px;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    font-size: 18px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.color-mode {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.color-mode button {
    flex: 1;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.color-mode button.active {
    background: rgba(255, 255, 255, 0.3);
}

.color-picker {
    margin-bottom: 15px;
}

.color-picker label {
    display: block;
    margin-bottom: 5px;
}

.color-picker input[type="color"] {
    width: 100%;
    height: 40px;
    border: none;
    border-radius: 5px;
    background: none;
}

.control-group {
    margin-bottom: 15px;
}

.control-group label {
    display: block;
    margin-bottom: 5px;
}

input[type="range"] {
    width: 100%;
    margin: 10px 0;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    height: 5px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
}

.speed-buttons {
    display: flex;
    gap: 5px;
    margin-top: 10px;
}

.speed-btn {
    flex: 1;
    padding: 5px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    border-radius: 3px;
    font-size: 12px;
    transition: all 0.3s ease;
}

.speed-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.speed-btn.active {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
}

.particle-colors {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.particle-colors .color-picker {
    display: flex;
    align-items: center;
    gap: 10px;
}

.particle-colors label {
    min-width: 100px;
    color: #fff;
}

.particle-colors input[type="color"] {
    width: 50px;
    height: 30px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.particle-colors input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.particle-colors input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.controls::-webkit-scrollbar {
    width: 4px;
}

.controls::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.controls::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.controls::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

.section-divider {
    margin: 0 0 10px 0;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.section-divider h4 {
    margin: 0;
    color: #ffccf2;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.help-icon {
    position: fixed;
    top: 70px;
    left: 20px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.help-icon:hover {
    background: rgba(255, 255, 255, 0.2);
}

.VIpgJd-ZVi9od-ORHb-OEVmcd {
    display: none;
}

/* Web cha - làm nổi bật nút hướng dẫn */
body.web-cha .help-icon {
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 2px 12px rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.4);
}

body.web-cha .help-icon:hover {
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

body.web-cha .help-icon::before {
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.help-panel {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 10px;
    color: white;
    z-index: 1000;
    max-height: 80vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(0, 0, 0, 0.2);
    min-width: 300px;
    display: none;
}

.help-panel.active {
    display: block;
}

/* Bảng hướng dẫn ở giữa màn hình khi lần đầu mở */
.help-panel.center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 80%;
    min-width: 60%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.help-panel h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #ffccf2;
}

.help-panel .close-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
}

.help-section {
    margin-bottom: 20px;
}

.help-section h4 {
    color: #ffccf2;
    margin: 0 0 10px 0;
    font-size: 14px;
}

.help-section p {
    margin: 5px 0;
    font-size: 13px;
    line-height: 1.5;
}

.help-section ul {
    margin: 5px 0;
    padding-left: 20px;
}

.help-section li {
    margin: 5px 0;
    font-size: 13px;
    line-height: 1.5;
}

.help-panel::-webkit-scrollbar {
    width: 4px;
}

.help-panel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.help-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.help-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

.help-panel .controls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.help-panel .section-divider {
    margin: 15px 0 10px 0;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.help-panel .section-divider h4 {
    margin: 0;
    color: #ffccf2;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.google-login-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
    background: #fff;
    color: #ea4335;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    z-index: 1001;
    transition: background 0.2s, box-shadow 0.2s;
    font-size: 20px;
    padding: 0;
}

.google-login-btn i {
    font-size: 22px;
    color: #ea4335;
}

.google-login-btn:hover {
    background: #f5f5f5;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* User logo styles */
#userLogoContainer {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1002;
}

#userLogo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s, box-shadow 0.2s;
}

#userLogo:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* User dropdown styles */
#userDropdown {
    position: fixed;
    top: 70px;
    left: 20px;
    z-index: 1003;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    backdrop-filter: blur(10px);
    animation: dropdownFadeIn 0.3s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#userDropdown #logoutBtn:hover {
    background: #e53935;
}

.touch-explore-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    font-size: 2rem;
    font-weight: bold;
    letter-spacing: 2px;
    text-shadow: 0 2px 8px #000, 0 0 20px #ffccf2;
    user-select: none;
    transition: opacity 0.3s;
}




.gift-btn {
    position: fixed;
    top: 18px;
    left: 50%;
    right: auto;
    z-index: 10000;
    background: rgba(255, 255, 255, 0.1);
    color: #353232;
    border: 1px solid #ff6b6b;
    border-radius: 50%;
    padding: 8px 8px;
    font-size: 18px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: background 0.2s, border 0.2s;
    transform: translateX(-50%);
}

.gift-btn:active {
    background: #242222;
}

.gift-btn img {
    display: block;
    margin: 0 auto;
    pointer-events: none;
    /* Để click vào nút vẫn nhận sự kiện */
}

/* Letter button - giống hệt gift-btn nhưng chỉ hiển thị ở web con */
.letter-btn {
    position: fixed;
    top: 18px;
    left: 50%;
    right: auto;
    z-index: 10000;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid #ff6b6b;
    border-radius: 50%;
    padding: 8px 8px;
    font-size: 18px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: background 0.2s, border 0.2s;
    transform: translateX(-50%);
    display: none;
    /* Mặc định ẩn, chỉ hiển thị ở web con */
}

.letter-btn:active {
    background: #242222;
}

.letter-btn img {
    display: block;
    margin: 0 auto;
    pointer-events: none;
    /* Để click vào nút vẫn nhận sự kiện */
}

.label-pc {
    display: inline-block;
    background: #007bff;
    color: #fff;
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 12px;
    margin-right: 6px;
    font-weight: 600;
}

.label-mobile {
    display: inline-block;
    background: #28a745;
    color: #fff;
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 12px;
    margin-right: 6px;
    font-weight: 600;
}

.controls.dashboard {
    max-width: 90vw;
    min-width: 60vw;
    max-height: 80vh;
    overflow-y: auto;
    background: #181c2a;
    border-radius: 2vw;
    box-shadow: 0 0.7vh 2.9vh rgba(0, 0, 0, 0.25);
    padding: 1vh 1vw 1vh 1vw;
    color: #fff;
    z-index: 9000000;
}

.tab-bar {
    display: flex;
    gap: 0;
    border-bottom: 1.5px solid #e8eaff;
    margin-bottom: 12px;
}

.tab-btn {
    flex: 1;
    background: #23284a;
    color: #fff;
    border: none;
    border-radius: 1vw 1vw 0 0;
    padding: 1.2vh 0;
    font-size: 1.2vw;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.tab-btn.active {
    background: #ff6b6b;
    color: #fff;
}

.preset-list {
    display: flex;
    gap: 1.5vw;
    margin-bottom: 1vh;
    flex-wrap: wrap;
    justify-content: space-between;
}

.preset-item {
    width: 6vw;
    height: 6vw;
    border-radius: 1.5vw;
    box-shadow: 0 0.2vw 1vw rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: transform 0.15s, box-shadow 0.15s;
    border: 0.3vw solid transparent;
}

.preset-item span {
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 1vw;
    border-radius: 0 0 1.2vw 1.2vw;
    padding: 0.4vh 1vw 0.7vh 1vw;
    width: 100%;
    text-align: center;
}

.preset-item:hover,
.preset-item.selected {
    transform: scale(1.08);
    box-shadow: 0 0.4vw 1.6vw rgba(0, 0, 0, 0.18);
    border: 0.3vw solid #ff6b6b;
}

.preset-group-title {
    font-size: 1.1vw;
    font-weight: 700;
    color: #ff6b6b;
    margin: 1.2vh 0 0.5vh 0;
    text-align: left;
    letter-spacing: 0.05vw;
}

.preset-row {
    display: flex;
    gap: 1vw;
    justify-content: center;
    flex-wrap: wrap;
}

/* Bảng hướng dẫn nhanh */
.quick-help-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0;
    border-radius: 15px;
    z-index: 10000;
    max-width: 90%;
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    display: none;
}

.quick-help-panel.active {
    display: block;
    animation: quickHelpFadeIn 0.3s ease;
}

@keyframes quickHelpFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.quick-help-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px 15px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.quick-help-header h3 {
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
    color: #fff;
}

.quick-help-close-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    font-size: 16px;
}

.quick-help-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.quick-help-content {
    padding: 20px 25px 25px 25px;
}

.quick-help-section {
    margin-bottom: 20px;
}

.quick-help-section:last-child {
    margin-bottom: 0;
}

.quick-help-section h4 {
    margin: 0 0 8px 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-help-section p {
    margin: 0 0 8px 0;
    font-size: 0.95em;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
}

.quick-help-section p:last-child {
    margin-bottom: 0;
}

.quick-help-section strong {
    color: #ff6b6b;
    font-weight: 600;
}

/* Scrollbar cho quick-help-panel */
.quick-help-panel::-webkit-scrollbar {
    width: 4px;
}

.quick-help-panel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.quick-help-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.quick-help-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Nút close luôn sát mép phải trên cùng */
.close-btn {
    position: absolute;
    top: 1vh;
    right: 1vw;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 2vw;
    cursor: pointer;
    padding: 0.5vh 1vw;
    z-index: 10;
}

.close-btn:hover {
    color: #ff6b6b;
}

/* Bảng giá luôn nằm trong header, không bị cuộn */
#priceTableDetails {
    position: relative;
    z-index: 1;
}

.controls.dashboard .controls-header {
    position: sticky;
    top: 0;
    background: #181c2a;
    z-index: 2;
    padding-bottom: 8px;
}

.controls.dashboard #priceTableDetails {
    position: sticky;
    top: 56px;
    background: #181c2a;
    z-index: 1;
}

/* Sticky dashboard header: chứa nút close, tiêu đề, bảng giá */
.dashboard-header {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #181c2a;
    /* Không bo góc trên */
    padding: 2vh 2vw 1vh 2vw;
    box-shadow: 0 0.2vw 0.8vw rgba(0, 0, 0, 0.08);
}

.dashboard-content {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Đảm bảo controls-header không flex ngang nữa */
.dashboard-header .controls-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 0;
    padding-right: 40px;
    /* chừa chỗ cho nút close */
}

.dashboard-title {
    font-size: 1.3vw;
    max-width: 60%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    font-family: 'Dancing Script Bold', cursive;
}

.price-table-btn {
    font-size: 1vw;
    padding: 0.4vh 1vw;
    margin-left: 1vw;
    white-space: nowrap;
    max-width: 38%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Responsive cho mobile nhỏ hơn */
@media (max-width: 480px) {
    .quick-help-panel {
        max-width: 99%;
        width: 99%;
        max-height: 45vh;
        border-radius: 10px;
    }

    .quick-help-header {
        padding: 10px 12px 6px 12px;
    }

    .quick-help-header h3 {
        font-size: 0.9em;
    }

    .quick-help-content {
        padding: 10px 12px 12px 12px;
    }

    .quick-help-section {
        margin-bottom: 12px;
    }

    .quick-help-section h4 {
        font-size: 0.9em;
        margin-bottom: 5px;
    }

    .quick-help-section p {
        font-size: 0.8em;
        line-height: 1.3;
        margin-bottom: 5px;
    }
}

@media (max-width: 600px) {
    .quick-help-panel {
        max-width: 80%;
        width: 98%;
        max-height: 55vh;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        border-radius: 12px;
    }

    .quick-help-header {
        padding: 12px 15px 8px 15px;
    }

    .quick-help-header h3 {
        font-size: 0.9em;
    }

    .quick-help-content {
        padding: 12px 15px 15px 15px;
    }

    .quick-help-section {
        margin-bottom: 15px;
    }

    .quick-help-section h4 {
        font-size: 0.95em;
        margin-bottom: 6px;
    }

    .quick-help-section p {
        font-size: 0.85em;
        line-height: 1.4;
        margin-bottom: 6px;
    }

    .preset-item {
        width: 50px !important;
        height: 50px !important;
        min-width: 50px !important;
        min-height: 50px !important;
        max-width: 80px !important;
        max-height: 80px !important;
        border-radius: 16px !important;
    }

    .preset-item span {
        font-size: 0.85em !important;
        border-radius: 0 0 12px 12px !important;
    }

    /* Dashboard responsive cho mobile */
    .dashboard {
        max-width: 98vw !important;
        min-width: unset !important;
        max-height: 80vh;
        height: 80vh;
        width: 98vw !important;
        left: 0 !important;
        right: 0 !important;
        border-radius: 2vw !important;
        padding: 0 1vw 1vh 1vw !important;
        box-sizing: border-box !important;
        font-size: 1.08em !important;
    }

    .dashboard .controls-header h2 {
        font-size: 1.15em !important;
    }

    .dashboard input[type="range"],
    .dashboard input[type="color"],
    .dashboard input[type="file"],
    .dashboard button,
    .dashboard label {
        font-size: 0.85em !important;
        min-height: 38px;
    }

    .dashboard .tab-bar button {
        font-size: 0.85em !important;
        min-width: 80px;
        padding: 4px 0;
    }

    .dashboard .close-btn {
        min-width: 38px;
        min-height: 38px;
        top: 0px;
        right: -10px;
    }

    .dashboard-content {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }

    .dashboard-content>*:first-child {
        margin-top: 0 !important;
        padding-top: 0 !important;
        border-top: none !important;
    }

    .dashboard-header {
        position: sticky;
        top: 0;
        z-index: 2;
        background: #181c2a;
        /* Không bo góc trên */
        padding: 10px 24px 10px 24px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

    .dashboard-header .controls-header {
        padding-right: 0;
        gap: 4px;
    }

    .dashboard-title {
        font-size: 1.3em;
        max-width: 55%;
    }

    .price-table-btn {
        font-size: 0.9em;
        padding: 2px 6px;
        max-width: 40%;
    }

    .dashboard-content,
    .dashboard-content>*,
    .tab-bar,
    .tab-content,
    .control-section,
    .section-divider {
        margin-top: 0 !important;
        padding-top: 0 !important;
        border-top: none !important;
    }

    /* Help panel center mobile */
    .help-panel.center {
        min-width: 80%;
        max-width: 95%;
        max-height: 60%;
        padding: 8px;
        border-radius: 8px;
    }

    .help-panel.center h3 {
        font-size: 14px;
    }

    .help-panel.center .help-section h4 {
        font-size: 10px;
    }

    .help-panel.center .help-section p,
    .help-panel.center .help-section li {
        font-size: 11px;
    }
}



/* Ẩn bảng hướng dẫn nhanh trên mobile nếu là desktop help */
@media (max-width: 799px) {
    .desktop-help {
        display: none !important;
    }
}




/* Responsive cho tablet */
@media (min-width: 601px) and (max-width: 1024px) {
    .help-panel.center {
        min-width: 80%;
        max-width: 80%;
        max-height: 60%;
    }

    /* Điều chỉnh kích thước gift-btn cho tablet */
    .gift-btn {
        padding: 12px 12px !important;
        font-size: 16px !important;
    }
}

@media (max-width: 400px) and (orientation: landscape) {
    .quick-help-panel {
        max-width: 100%;
        width: 100%;
        max-height: 22vh;
        top: 68%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
}







@media (max-width: 900px) and (orientation: landscape) {

    .quick-help-panel {
        max-width: 80vw;
        width: 98vw;
        max-height: 70vh;
        top: 55%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    .help-panel.center {
        max-height: 45%;
        top: 55%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    .preset-item {
        width: 50px !important;
        height: 50px !important;
        min-width: 50px !important;
        min-height: 50px !important;
        max-width: 80px !important;
        max-height: 80px !important;
        border-radius: 16px !important;
    }

    .dashboard {
        height: 75vh !important;
        max-height: 80vh !important;
        min-height: 60vh !important;
        max-width: 45vw !important;
        box-sizing: border-box !important;
        overflow-y: auto !important;
    }
}

/* Cho mobile devices có màn hình lớn khi landscape */
@media (min-width: 900px) and (max-width: 1400px) and (orientation: landscape) {
    .dashboard {
        /* Styles cho tablet/mobile lớn landscape */
        max-width: 40vw !important;
        max-height: 80vh !important;
        padding: 0 2vw 2vh 2vw !important;
    }

    .preset-item {
        width: 60px !important;
        height: 60px !important;
        max-width: 80px !important;
        max-height: 80px !important;
    }

    .quick-help-panel {
        max-width: 50vw;
        width: 98vw;
        max-height: 60vh;
        top: 55%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    .help-panel.center {
        max-height: 45%;
        top: 55%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

}





/* Reponsive desktop  */

@media (max-width: 900px) {
    .dashboard {
        height: 80vh !important;
        max-height: 100vh !important;
        min-height: 60vh !important;
        box-sizing: border-box !important;
        overflow-y: auto !important;
    }
}

@media (min-width: 1025px) {
    .help-panel.center {
        min-width: 400px;
        max-width: 600px;
    }

    .preset-item {
        width: 5vw !important;
        height: 5vw !important;
        max-width: 100px !important;
        max-height: 100px !important;
        border-radius: 22px !important;
    }
}

/* Ẩn bảng hướng dẫn nhanh trên desktop nếu là mobile help */
@media (min-width: 800px) {
    .mobile-help {
        display: none !important;
    }

    .touch-explore-overlay {
        display: none !important;
    }
}

@media (max-width: 1560px) {
    .preset-item {
        width: 6vw !important;
        height: 6vw !important;
        min-width: 60px !important;
        min-height: 60px !important;
        max-width: 90px !important;
        max-height: 90px !important;
        border-radius: 22px !important;
    }

    .preset-item span {
        font-size: 1em !important;
        border-radius: 0 0 18px 18px !important;
    }

    .dashboard {
        padding: 0 1vw 1vh 1vw !important;
    }

}

@media (max-width: 1920px) {
    .preset-item {
        width: 5vw !important;
        height: 5vw !important;
        max-width: 100px !important;
        max-height: 100px !important;
        border-radius: 22px !important;
    }

    .preset-item span {
        font-size: 1em !important;
        border-radius: 0 0 18px 18px !important;
    }

    .dashboard {
        padding: 0 1vw 2vh 1vw !important;
    }
}

#presetAudioSelect {
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1.5px solid #fff;
    background: rgba(255, 255, 255, 0.85);
    color: #222;
    font-size: 1em;
    font-weight: 600;
    margin-bottom: 8px;
    transition: border 0.2s, background 0.2s;
    max-height: 150px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(0, 0, 0, 0.2);

}

#presetAudioSelect:focus {
    border: 2px solid #ff6b6b;
    outline: none;
    background: #fff;
}

select#textEffect {
    color: #fff !important;
    background: rgba(30, 30, 40, 0.95) !important;
    border: 1.5px solid #4ecdc4 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

select#textEffect option {
    color: #222;
    background: #fff;
}

select#textFont {
    color: #fff !important;
    background: rgba(30, 30, 40, 0.95) !important;
    border: 1.5px solid #4ecdc4 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

select#textFont option {
    color: #222;
    background: #fff;
}

select#textAppearEffect {
    color: #fff !important;
    background: rgba(30, 30, 40, 0.95) !important;
    border: 1.5px solid #4ecdc4 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

select#textAppearEffect option {
    color: #222;
    background: #fff;
}

/* Rule tổng hợp cho gift-btn - ghi đè tất cả media queries khác */
/* Web con (có config hoặc id) - gift-btn nằm góc phải */
body.web-con .gift-btn {
    right: 20px !important;
    top: 20px !important;
    left: auto !important;
    transform: none !important;
}

/* Web cha (không có config hoặc id) - gift-btn nằm giữa */
body.web-cha .gift-btn {
    left: 50% !important;
    top: 20px !important;
    right: auto !important;
    transform: translateX(-50%) !important;
}

/* Ẩn gift-btn trên desktop portrait (>1025px) */
@media (min-width: 1025px) and (orientation: portrait) {
    .gift-btn {
        display: none !important;
    }

    /* Letter-btn thay thế vị trí gift-btn trên web con desktop */
    body.web-con .letter-btn {
        display: block !important;
        right: 20px !important;
        top: 20px !important;
        left: auto !important;
        transform: none !important;
    }
}

/* Ẩn gift-btn trên desktop landscape lớn (>1380px) */
@media (min-width: 1381px) and (orientation: landscape) {
    .gift-btn {
        display: none !important;
    }

    /* Letter-btn thay thế vị trí gift-btn trên web con desktop */
    body.web-con .letter-btn {
        display: block !important;
        right: 20px !important;
        top: 20px !important;
        left: auto !important;
        transform: none !important;
    }
}

/* Rule cuối cùng - Ẩn gift-btn trên desktop landscape lớn */
@media (min-width: 1381px) and (orientation: landscape) {
    .gift-btn {
        display: none !important;
    }

    /* Letter-btn thay thế vị trí gift-btn trên web con desktop */
    body.web-con .letter-btn {
        display: block !important;
        right: 20px !important;
        top: 20px !important;
        left: auto !important;
        transform: none !important;
    }
}

/* Rule mạnh nhất - Ẩn gift-btn trên desktop portrait */
@media (min-width: 1025px) and (orientation: portrait) {
    .gift-btn {
        display: none !important;
    }

    /* Letter-btn thay thế vị trí gift-btn trên web con desktop */
    body.web-con .letter-btn {
        display: block !important;
        right: 20px !important;
        top: 20px !important;
        left: auto !important;
        transform: none !important;
    }
}

/* Rule mạnh nhất - Ẩn gift-btn trên desktop landscape */
@media (min-width: 1025px) and (orientation: landscape) {
    .gift-btn {
        display: none !important;
    }

    /* Letter-btn thay thế vị trí gift-btn trên web con desktop */
    body.web-con .letter-btn {
        display: block !important;
        right: 20px !important;
        top: 20px !important;
        left: auto !important;
        transform: none !important;
    }
}

/* iPad landscape - letter-btn nằm giữa màn hình */
@media (min-width: 1025px) and (max-width: 1380px) and (orientation: landscape) and (pointer: coarse) {
    body.web-con .letter-btn {
        left: 50% !important;
        top: 20px !important;
        right: auto !important;
        transform: translateX(-50%) !important;
    }
}

/* Hiển thị gift-btn trên iPad portrait width 768px, 820px, 1024px */
@media (max-width: 820px) and (orientation: portrait) {
    .gift-btn {
        display: block !important;
    }
}

@media (min-width: 821px) and (max-width: 1024px) and (orientation: portrait) {
    .gift-btn {
        display: block !important;
    }
}

@media (min-width: 1025px) and (max-width: 1379px) and (orientation: landscape) and (pointer: coarse) {
    .gift-btn {
        display: block !important;
    }
}

/* Letter button responsive rules - chỉ hiển thị ở web con */
/* Web con - letter-btn nằm giữa màn hình (mobile/tablet) */
body.web-con .letter-btn {
    left: 50% !important;
    top: 20px !important;
    right: auto !important;
    transform: translateX(-50%) !important;
}

/* Rule tổng hợp cho letter-btn - ghi đè tất cả media queries khác */
/* Web con desktop - letter-btn nằm góc phải (thay thế gift-btn) */
@media (min-width: 1025px) and (pointer: fine) {
    body.web-con .letter-btn {
        right: 20px !important;
        top: 20px !important;
        left: auto !important;
        transform: none !important;
    }
}

/* Web cha - letter-btn ẩn hoàn toàn */
body.web-cha .letter-btn {
    display: none !important;
}

/* Ẩn letter-btn khi text trống (web con) */
body.web-con .letter-btn.hidden-when-empty {
    display: none !important;
}

/* Hiển thị letter-btn trên iPad portrait width 768px, 820px, 1024px */
@media (max-width: 820px) and (orientation: portrait) {
    body.web-con .letter-btn {
        display: block !important;
    }
}

@media (min-width: 821px) and (max-width: 1024px) and (orientation: portrait) {
    body.web-con .letter-btn {
        display: block !important;
    }
}

@media (min-width: 1025px) and (max-width: 1379px) and (orientation: landscape) and (pointer: coarse) {
    body.web-con .letter-btn {
        display: block !important;
    }
}

@media (max-width: 700px) {
    .dashboard-actions button {
        width: 45% !important;
        min-width: 80px !important;
        font-size: 1em !important;
        padding: 10px 0 !important;
        margin-bottom: 8px !important;
        box-sizing: border-box;
    }

    .dashboard-actions {
        display: flex;
        flex-direction: row;
        justify-content: center;
        gap: 10px;
        flex-wrap: wrap;
    }
}

#applyTextBtn,
#applyAppearEffectBtn {
    background: #249e9c !important;
    color: #fff !important;
    border: none !important;
    border-radius: 4px !important;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

#applyTextBtn:hover,
#applyAppearEffectBtn:hover {
    background: #197c7a !important;
}

#finishCreateBtn {
    background: #249e9c !important;
    color: #fff !important;
    border: none !important;
    border-radius: 10px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

#finishCreateBtn:hover {
    background: #197c7a !important;
}

#tab-preset,
#tab-custom {
    background: #444a57 !important;
    color: #bbb !important;
    border: none !important;
    border-radius: 6px 6px 0 0 !important;
    font-weight: 600;
    transition: background 0.2s, color 0.2s;
    margin-right: 2px;
}

#tab-preset.active,
#tab-custom.active {
    background: #249e9c !important;
    color: #fff !important;
}

#tab-preset:hover:not(.active),
#tab-custom:hover:not(.active) {
    background: #5a6170 !important;
    color: #fff !important;
}

select#textEffect,
select#textAppearEffect {
    border: 1.5px solid #249e9c !important;
}

.help-title {
    font-size: 1.25em;
}

@media (max-width: 600px) {
    .help-title {
        font-size: 1em;
    }
}

/* UI polish for Galaxy Creation Dashboard */
.controls.dashboard {
  background: rgba(24, 28, 42, 0.88);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Dashboard header visual improvements */
.dashboard-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Price table button hover */
.price-table-btn {
  border-color: rgba(255, 255, 255, 0.25) !important;
  color: rgba(255, 255, 255, 0.85) !important;
  background: rgba(255, 255, 255, 0.06) !important;
}
.price-table-btn:hover {
  border-color: #ff6b6b !important;
  color: #fff !important;
  background: rgba(255, 107, 107, 0.25) !important;
}

/* Toggle section button (override inline for consistency) */
.toggle-section {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  color: rgba(255, 255, 255, 0.9) !important;
  padding: 4px 10px !important;
  border-radius: 6px !important;
}
.toggle-section:hover {
  border-color: #4ecdc4 !important;
}

/* Tabs improvements */
.tab-btn {
  letter-spacing: 0.2px;
}
.tab-btn:hover:not(.active) {
  filter: brightness(1.1);
}

/* Payment method card states */
.payment-method-card .payment-method-content {
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.payment-method-card .payment-method-content:hover {
  border-color: rgba(255, 255, 255, 0.35) !important;
  background: rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
.payment-method-card input:checked + .payment-method-content {
  border-color: #ff6b6b !important;
  box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.35);
}

/* Preset selection: add checkmark for clarity */
.preset-item {
  position: relative;
}
.preset-item.selected::after {
  content: "✓";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #16a34a;
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

/* Improve focus visibility for keyboard users */
.controls.dashboard button:focus,
.controls.dashboard input:focus,
.controls.dashboard select:focus {
  outline: 2px solid #4ecdc4;
  outline-offset: 2px;
}

/* Larger touch targets on small screens */
@media (max-width: 600px) {
  .tab-btn { padding: 10px 0; }
  .toggle-section { padding: 6px 12px !important; }
  .price-table-btn { padding: 6px 10px !important; }
}

/* Payment method radios wrapper spacing */
.payment-methods .payment-method-card + .payment-method-card {
  margin-top: 6px;
}

/* Subtle divider between sections inside dashboard */
.controls.dashboard .control-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Remove horizontal scroll on mobile for Galaxy Creation Dashboard */
@media (max-width: 700px) {
  .controls.dashboard {
    overflow-x: hidden !important;
  }
}

/* Lock horizontal pan for the Galaxy Creation Dashboard on mobile */
@media (max-width: 700px) {
  .controls.dashboard {
    touch-action: pan-y !important;            /* chỉ cho phép kéo dọc */
    overscroll-behavior-x: none;               /* chặn kéo tràn ngang */
    -webkit-overflow-scrolling: touch;        /* cuộn dọc mượt trên iOS */
  }
  .controls.dashboard * {
    touch-action: pan-y !important;            /* ngăn phần tử con kích hoạt pan ngang */
  }
}

/* Fix right offset on mobile: ensure full-width without side padding causing visual gap */
@media (max-width: 700px) {
  .controls.dashboard {
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 1vh 1vw 1vh 1vw;

  }
}
