* {
    margin: 0;
    padding: 0;
    text-decoration: none;
    list-style: none;
    box-sizing: border-box;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

*:focus {
    outline: none;
}

h1 {
    font-size: 2em;
}

h2 {
    font-size: 1.5em;
}

h3 {
    font-size: 1.3em;
}

h4 {
    font-size: 1em;
}

h5 {
    font-size: 0.8em;
}

h6 {
    font-size: 0.7em;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: normal;
    font-style: normal;
}

i {
    margin-right: 0.3rem;
}

input {
    font-size: 1rem;
    padding: 0.4rem;
    margin: 1rem 0 0.5rem 0;
    background: transparent;
    border: solid 1px;
    color: white;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

select {
    cursor: pointer;
    font-size: 1rem;
    width: 100%;
    padding: 0.4rem;
    background: transparent;
    border: solid 1px white;
    color: white;
    border-radius: 0.3rem;
    -webkit-border-radius: 0.3rem;
    -moz-border-radius: 0.3rem;
    -ms-border-radius: 0.3rem;
    -o-border-radius: 0.3rem;
    text-indent: 1px;
    text-overflow: '';
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

option {
    background-color: #030303;
}

img {
    pointer-events: none;
    margin-top: 1rem;
}

body {
    background: -webkit-linear-gradient(360deg, #030303 10%, #1f1f1f 360%);
    background: linear-gradient(360deg, #030303 10%, #1f1f1f 360%);
    font-family: Futura, Trebuchet MS, Arial, sans-serif;
    font-size: 1rem;
    color: white;
    height: 100vh;
}

main {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 1.25rem;
}

::-webkit-scrollbar-track {
    background-color: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: #d6dee1;
    border-radius: 1.25rem;
    border: 6px solid transparent;
    background-clip: content-box;
    -webkit-border-radius: 1.25rem;
    -moz-border-radius: 1.25rem;
    -ms-border-radius: 1.25rem;
    -o-border-radius: 1.25rem;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #a8bbbf;
}

/* Utility */
.w-100 {
    width: 100%;
}

.row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.row span {
    width: 1rem;
    text-align: center;
}

.center-text {
    text-align: center;
}

.pad {
    padding: 0.3em;
}

.lvltier {
    margin: -0.5rem 0 -0.3rem 0.7rem;
}

/* Combat Log */
.logBox {
    margin: 0.5rem;
    height: 100%;
    min-height: 10rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0.5em;
    overflow: auto;
}

.logBox #dungeonAction {
    text-align: center;
}

.logBox p {
    margin: 0.3rem 0;
    padding: 0.3rem;
}

#dungeonLog {
    overflow: auto;
}

#combatLogBox {
    overflow: auto;
}

#playerInventory {
    height: 100%;
}

/* Save indicator */
#save-indicator {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 12px;
    padding: 4px 10px;
    margin-left: 8px;
    font-size: 0.85rem;
    line-height: 1.1rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    white-space: nowrap;
}

/* Auto-save status in dungeon head */
#auto-save-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    font-size: 0.9rem;
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 0.3rem;
    background: transparent;
    white-space: nowrap;
    cursor: default;
}

/* Match button hover vibe slightly without full inversion */
#auto-save-status.success {
    border-color: rgba(74, 222, 128, 0.9);
}
#auto-save-status.error {
    border-color: rgba(255, 99, 71, 0.9);
}

#save-indicator .dot,
#auto-save-status .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ffcc00;
    box-shadow: 0 0 6px rgba(255, 204, 0, 0.8);
    opacity: 0.35;
    animation: dotPulse 1.4s infinite ease-in-out;
}

#save-indicator.success .dot,
#auto-save-status.success .dot {
    background: #4ade80;
    box-shadow: 0 0 6px rgba(74, 222, 128, 0.8);
    opacity: 0.9;
}

#save-indicator.error,
#auto-save-status.error {
    border-color: rgba(255, 99, 71, 0.8);
}

#save-indicator.error .dot,
#auto-save-status.error .dot {
    background: #ff6347;
    box-shadow: 0 0 6px rgba(255, 99, 71, 0.8);
    opacity: 0.9;
}

/* Dots wrapper for leading animation */
#auto-save-status .dots {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
#auto-save-status .dot:nth-child(1) { animation-delay: 0s; }
#auto-save-status .dot:nth-child(2) { animation-delay: 0.2s; }
#auto-save-status .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.35; }
    40% { transform: scale(1); opacity: 0.9; }
}

#playerEquipment {
    /* Use a 3-column grid so equipment slots render 3 per row */
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* row-gap column-gap: keep horizontal gap, tighten vertical spacing */
    gap: 0.04rem 0.15rem;
    margin: 0; /* center within box padding */
    justify-items: center;
    align-items: center;
}

/* Ensure items inside equipment area are square buttons matching empty-slot appearance */
#playerEquipment .items {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    /* reduce reserved vertical space so rows sit closer together */
    min-height: 2.6rem;
    padding: 0;
    box-sizing: border-box;
}

/* Make the button itself match the red frame size the user highlighted */
/* Make buttons rectangular and restore visible white border */
#playerEquipment .items button {
    width: 4.4rem; /* wider rectangle */
    height: 2.6rem; /* slightly shorter height */
    padding: 0;
    border-radius: 0.35rem;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 1.05rem;
    box-sizing: border-box;
    border: 1px solid rgba(255,255,255,0.9); /* restore white border look */
    background: transparent;
}

/* Make the plus in the buy-slot more prominent */
#playerEquipment .items button.buy-slot {
    font-size: 1.6rem; /* larger + */
    font-weight: 700;
    line-height: 1;
    padding: 0;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

/* Slightly increase empty-slot symbol size if used */
#playerEquipment .items button.empty-slot {
    font-size: 1.1rem;
}

/* Keep icons visible when hovering equipment slots and avoid inverting colors */
#playerEquipment .items button i,
#playerEquipment .items button img {
    color: #fff;
    opacity: 1;
    visibility: visible;
}

#playerEquipment .items button:hover {
    /* avoid the site-wide button:hover inversion (white bg / black text)
       so equipment slots don't visually disappear */
    background-color: rgba(255,255,255,0.04);
    color: inherit;
}

#playerEquipment .items button:hover i,
#playerEquipment .items button:hover img {
    color: #fff !important;
    opacity: 1 !important;
    visibility: visible !important;
    filter: none !important;
}

/* Make hover a bit brighter so slot clearly lights up */
#playerEquipment .items button:hover {
    background-color: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,1);
}

/* Ensure item rarity colors remain visible when an item is placed in a slot.
   Use higher specificity so these colors win over general button hover rules. */
/* Rarity classes may be applied on the button itself (e.g. <button class="Rare">).
    Target the button and any icon/image inside so the rarity color shows when equipped. */
#playerEquipment .items button.Common,
#playerEquipment .items button.Common i,
#playerEquipment .items button.Common img { color: #ffffff !important; }

#playerEquipment .items button.Uncommon,
#playerEquipment .items button.Uncommon i,
#playerEquipment .items button.Uncommon img { color: #1eff00 !important; }

#playerEquipment .items button.Rare,
#playerEquipment .items button.Rare i,
#playerEquipment .items button.Rare img { color: #0070dd !important; }

#playerEquipment .items button.Epic,
#playerEquipment .items button.Epic i,
#playerEquipment .items button.Epic img { color: #a335ee !important; }

#playerEquipment .items button.Legendary,
#playerEquipment .items button.Legendary i,
#playerEquipment .items button.Legendary img { color: #ffd700 !important; }

#playerEquipment .items button.Heirloom,
#playerEquipment .items button.Heirloom i,
#playerEquipment .items button.Heirloom img { color: #e30b5c !important; }

/* Some icons use classes on the button itself (r- prefixes or rarity classes).
   Keep borders/glow for those too when present. */
#playerEquipment .items button.r-Rare,
#playerEquipment .items button.r-Uncommon,
#playerEquipment .items button.r-Epic,
#playerEquipment .items button.r-Legendary,
#playerEquipment .items button.r-Heirloom {
    box-shadow: none;
}

/* Price tooltip/span: hidden until hover */
/* Price tooltip/span: hidden until hover (shown as yellow text under button)
   Always reserve the vertical space to avoid layout shifts. */
/* Hide hover price: modal shows price on click, so no hover price needed */
#playerEquipment .slot-price {
    display: none;
}

/* Cursor for interactive buttons */
#playerEquipment .items button.buy-slot,
#playerEquipment .items button.empty-slot {
    cursor: pointer;
}

#playerEquipment .items button.locked-slot {
    cursor: default;
}

#playerEquipment i {
    margin: 0 0.4rem;
}

.inventorySlots {
    display: flex;
    flex-direction: column;
    overflow: auto;
}

.inventorySlots p,
#playerEquipment p {
    transition: .2s;
    -webkit-transition: .2s;
    -moz-transition: .2s;
    -ms-transition: .2s;
    -o-transition: .2s;
}

.inventorySlots p:hover,
#playerEquipment p:hover {
    background-color: grey;
    color: white;
    cursor: pointer;
}

#menuModal content {
    background-color: red;
}

#menu-btn {
    width: 15rem;
    max-width: calc(100% - 1rem);
    margin: 0.5rem;
}

/* Shadows */
.primary-panel {
    border-radius: 0.3rem;
    border: solid 1px;
}

/* Buttons */
button {
    display: inline-block;
    text-align: center;
    background-color: transparent;
    color: white;
    font-size: 1rem;
    padding: 0.4rem 1rem;
    border-radius: 0.3rem;
    border: solid 1px;
    -webkit-border-radius: 0.3rem;
    -moz-border-radius: 0.3rem;
    -ms-border-radius: 0.3rem;
    -o-border-radius: 0.3rem;
    cursor: pointer;
    transition: .2s;
    -webkit-transition: .2s;
    -moz-transition: .2s;
    -ms-transition: .2s;
    -o-transition: .2s;
    -webkit-tap-highlight-color: transparent;
}

button:hover {
    background-color: white;
    color: black;
}

button:focus {
    outline: none;
    box-shadow: none;
}

/* Rarity Colors */
.Common {
    color: #ffffff;
}

.Uncommon {
    color: #1eff00;
}

.Rare {
    color: #0070dd;
}

.Epic {
    color: #a335ee;
}

.Legendary {
    color: #ffd700;
}

.Heirloom {
    color: #e30b5c;
}

/* Game */
.game-container {
    display: inline-block;
    position: relative;
    width: 100%;
    max-width: 35rem;
    height: 100%;
}

.game {
    display: flex;
    flex-direction: column;
}

.game * {
    margin: 0.3rem;
}

/* Modals */
/* Main containter for modals */
.modal-container {
    pointer-events: auto;
    display: none;
    align-items: center;
    justify-content: center;
    position: fixed;
    z-index: 1002;
    width: 100vw;
    height: 100vh;
}

.modal-container .content {
    background: -webkit-linear-gradient(360deg, #030303 10%, #1f1f1f 360%);
    background: linear-gradient(360deg, #030303 10%, #1f1f1f 360%);
    color: #fff;
    border-radius: 0.3rem;
    border: solid 1px;
    max-width: 25rem;
    padding: 0.5em;
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    margin: 0.5rem;
    -webkit-border-radius: 0.3rem;
    -moz-border-radius: 0.3rem;
    -ms-border-radius: 0.3rem;
    -o-border-radius: 0.3rem;
}

.modal-container .content .button-container {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

/* Equipment Info */
#equipmentInfo .content ul {
    margin-left: 1rem;
}

/* Inventory */
#inventory {
    flex-direction: column;
}

#inventory .content {
    padding: 0;
    gap: 0;
    height: 35rem;
    width: 16rem;
}

#inventory .content .inventorySlots {
    padding: 0 0.7em 0.4em;
}

/* Menu Modal */
#menuModal .content {
    min-width: 15rem;
}

#menuModal .content-head {
    padding: 0;
}

/* Default Modal */
#defaultModal .content-head {
    padding: 0;
}

/* General Content */
.content-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4em 0.7em;
    gap: 0.3rem;
}

.content .content-head i {
    margin: 0;
}

.content .content-head p {
    cursor: pointer;
    z-index: 1000;
    position: relative;
}

.content .content-head p:hover {
    opacity: 0.7;
}

/* Battle/Combat Panel */
#combatPanel .content {
    height: 100%;
    width: 100%;
    max-height: 40rem;
    padding: 0.5em;
}

.battle-info-panel {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.7rem;
    margin: 0 0.5rem;
}

#enemyPanel {
    align-items: center;
}

#lvlupPanel .content {
    width: 100%;
    max-width: 24em;
}

#lvlupPanel h1 {
    text-align: center;
}

/* Battle Bars */
.battle-bar {
    font-size: 0.8rem;
    border-radius: 0.3rem;
    -webkit-border-radius: 0.3rem;
    -moz-border-radius: 0.3rem;
    -ms-border-radius: 0.3rem;
    -o-border-radius: 0.3rem;
}

.bb-hp {
    height: 1rem;
}

.bb-xb {
    height: 0.4rem;
}

.empty-bar {
    width: 100%;
    background-color: grey;
}

.bb-hp .current {
    background-color: #e40000;
    margin-top: -1rem;
    transition: .1s;
    -webkit-transition: .1s;
    -moz-transition: .1s;
    -ms-transition: .1s;
    -o-transition: .1s;
}

.bb-xb .current {
    color: transparent;
    background-color: #9a00b9;
    transition: .1s;
    -webkit-transition: .1s;
    -moz-transition: .1s;
    -ms-transition: .1s;
    -o-transition: .1s;
}

.bb-hp .dmg {
    background-color: #dbc72a;
    transition-duration: 0.5s;
    transition-timing-function: cubic-bezier(1, 0.1, 0.1, 0.1);
}

/* Title Screen */
#title-screen {
    display: none;
    justify-content: space-around;
    align-items: center;
    text-align: center;
    flex-direction: column;
    cursor: pointer;
}

#title-screen h1 {
    font-family: 'Rubik Vinyl';
    font-size: 2.5rem;
    font-weight: 400;
    margin: 0 1rem;
}

#title-screen i {
    margin: 0 0 1rem;
}

#title-screen p {
    animation: blinker 1s linear infinite;
    -webkit-animation: blinker 1s linear infinite;
}

@keyframes blinker {
    50% {
        opacity: 0;
    }
}

/* Login Screen */
#login-screen {
    display: none;
    justify-content: center;
    align-items: center;
    text-align: center;
    flex-direction: column;
}

#login-panel,
#register-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 400px;
    width: 100%;
    padding: 20px;
}

#login-form,
#register-form {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 300px;
}

#login-form input,
#register-form input {
    font-family: Arial, Helvetica, sans-serif;
    width: 100%;
    margin: 0.5rem 0;
}

#login-form button,
#register-form button {
    margin: 0.5rem 0;
    padding: 0.7rem;
}

/* Character Creation */
#character-creation {
    display: none;
    justify-content: center;
    align-items: center;
    text-align: center;
    flex-direction: column;
}

#character-creation button {
    margin: 2rem 0 0 0;
}

/* Auth Alerts */
#auth-alert,
#register-alert {
    min-height: 20px;
}
.auth-info {
    color: #ddd;
}
.auth-success {
    color: #2ecc71;
}
.auth-error {
    color: #ff4444;
}

/* Button Loading State + Dots */
.btn-primary.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.9;
}
.btn-primary.btn-loading .btn-label {
    visibility: hidden;
}
.btn-primary.btn-loading .loading-dots {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}
.loading-dots .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ffd500; /* vàng */
    box-shadow: 0 0 6px rgba(255, 213, 0, 0.8);
    animation: dotBlink 1s infinite ease-in-out;
}
.loading-dots .dot:nth-child(2) { animation-delay: 0.15s; }
.loading-dots .dot:nth-child(3) { animation-delay: 0.3s; }
.loading-dots .dot:nth-child(4) { animation-delay: 0.45s; }
.loading-dots .dot:nth-child(5) { animation-delay: 0.6s; }

/* dotBlink đã định nghĩa ở dưới, sử dụng chung */

#character-creation input {
    font-family: Arial, Helvetica, sans-serif;
    width: 20rem;
    max-width: calc(100% - 2rem);
}

/* Stat Allocation */
#allocate-stats {
    width: 18rem;
}

/* Header */
header {
    border-radius: 0.3rem;
    border: solid 1px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.5rem;
    margin: 0.5rem 0.5rem 0;
}

header button {
    width: auto;
    padding: 0.5rem 0.7rem;
}

header button i {
    margin: 0;
}

/* Dungeon */
#dungeon-main {
    display: none;
    flex-direction: column;
}

#dungeon-main h1 {
    margin-top: 1rem;
    text-align: center;
    letter-spacing: 0.5rem;
}

.dungeon-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0.2rem 1rem;
}

/* Stat Panel */
.stat-panel {
    display: flex;
    margin: 0.5rem;
    gap: 0.5rem;
}

.stat-panel .box {
    white-space: nowrap;
    border: solid 1px;
    border-radius: 0.3rem;
    -webkit-border-radius: 0.3rem;
    -moz-border-radius: 0.3rem;
    -ms-border-radius: 0.3rem;
    -o-border-radius: 0.3rem;
    width: 100%;
    padding: 0.5rem;
    overflow: hidden;
}

.stat-panel .box::-webkit-scrollbar {
    display: none;
}

.stat-panel .box h4 {
    font-weight: bold;
}

/* Decision Panel */
.decision-panel {
    display: flex;
    gap: 1rem;
    margin: 0.5rem;
}

/* Box Header */
.box-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5em;
}

.box-head i {
    margin: 0;
}

.box-head p:hover {
    cursor: pointer;
}

/* loader */
#loading {
    display: none;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.loader {
    border: 0.5rem solid #f3f3f3;
    border-top: 0.5rem solid grey;
    border-radius: 50%;
    width: 3.8rem;
    height: 3.8rem;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Scroll */
.scrollable {
    overflow: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.scrollable::-webkit-scrollbar {
    display: none;
}

/* Volume Tab */
#volume-tab {
    gap: 0;
}

#volume-tab input {
    margin: 0;
}

/* ===== Animations ===== */
/* Shake Animation */
.animation-shake {
    animation: shake 0.2s;
    -webkit-animation: shake 0.2s;
}

@keyframes shake {
    0% {
        transform: translate(1px, 1px) rotate(0deg);
        -webkit-transform: translate(1px, 1px) rotate(0deg);
        -moz-transform: translate(1px, 1px) rotate(0deg);
        -ms-transform: translate(1px, 1px) rotate(0deg);
        -o-transform: translate(1px, 1px) rotate(0deg);
    }

    10% {
        transform: translate(-1px, -2px) rotate(-1deg);
        -webkit-transform: translate(-1px, -2px) rotate(-1deg);
        -moz-transform: translate(-1px, -2px) rotate(-1deg);
        -ms-transform: translate(-1px, -2px) rotate(-1deg);
        -o-transform: translate(-1px, -2px) rotate(-1deg);
    }

    20% {
        transform: translate(-3px, 0px) rotate(1deg);
        -webkit-transform: translate(-3px, 0px) rotate(1deg);
        -moz-transform: translate(-3px, 0px) rotate(1deg);
        -ms-transform: translate(-3px, 0px) rotate(1deg);
        -o-transform: translate(-3px, 0px) rotate(1deg);
    }

    30% {
        transform: translate(3px, 2px) rotate(0deg);
        -webkit-transform: translate(3px, 2px) rotate(0deg);
        -moz-transform: translate(3px, 2px) rotate(0deg);
        -ms-transform: translate(3px, 2px) rotate(0deg);
        -o-transform: translate(3px, 2px) rotate(0deg);
    }

    40% {
        transform: translate(1px, -1px) rotate(1deg);
        -webkit-transform: translate(1px, -1px) rotate(1deg);
        -moz-transform: translate(1px, -1px) rotate(1deg);
        -ms-transform: translate(1px, -1px) rotate(1deg);
        -o-transform: translate(1px, -1px) rotate(1deg);
    }

    50% {
        transform: translate(-1px, 2px) rotate(-1deg);
        -webkit-transform: translate(-1px, 2px) rotate(-1deg);
        -moz-transform: translate(-1px, 2px) rotate(-1deg);
        -ms-transform: translate(-1px, 2px) rotate(-1deg);
        -o-transform: translate(-1px, 2px) rotate(-1deg);
    }

    60% {
        transform: translate(-3px, 1px) rotate(0deg);
        -webkit-transform: translate(-3px, 1px) rotate(0deg);
        -moz-transform: translate(-3px, 1px) rotate(0deg);
        -ms-transform: translate(-3px, 1px) rotate(0deg);
        -o-transform: translate(-3px, 1px) rotate(0deg);
    }

    70% {
        transform: translate(3px, 1px) rotate(-1deg);
        -webkit-transform: translate(3px, 1px) rotate(-1deg);
        -moz-transform: translate(3px, 1px) rotate(-1deg);
        -ms-transform: translate(3px, 1px) rotate(-1deg);
        -o-transform: translate(3px, 1px) rotate(-1deg);
    }

    80% {
        transform: translate(-1px, -1px) rotate(1deg);
        -webkit-transform: translate(-1px, -1px) rotate(1deg);
        -moz-transform: translate(-1px, -1px) rotate(1deg);
        -ms-transform: translate(-1px, -1px) rotate(1deg);
        -o-transform: translate(-1px, -1px) rotate(1deg);
    }

    90% {
        transform: translate(1px, 2px) rotate(0deg);
        -webkit-transform: translate(1px, 2px) rotate(0deg);
        -moz-transform: translate(1px, 2px) rotate(0deg);
        -ms-transform: translate(1px, 2px) rotate(0deg);
        -o-transform: translate(1px, 2px) rotate(0deg);
    }

    100% {
        transform: translate(1px, -2px) rotate(-1deg);
        -webkit-transform: translate(1px, -2px) rotate(-1deg);
        -moz-transform: translate(1px, -2px) rotate(-1deg);
        -ms-transform: translate(1px, -2px) rotate(-1deg);
        -o-transform: translate(1px, -2px) rotate(-1deg);
    }
}

/* Damage Numbers */
.dmg-container {
    position: relative;
}

.dmg-numbers {
    color: white;
    font-size: 1.8em;
    font-weight: 500;
    animation: dmg-numbers 0.7s;
    -webkit-animation: dmg-numbers 0.7s;
    position: absolute;
    z-index: 1;
}

@keyframes dmg-numbers {
    100% {
        opacity: 0;
        transform: translateY(-3rem);
        -webkit-transform: translateY(-3rem);
        -moz-transform: translateY(-3rem);
        -ms-transform: translateY(-3rem);
        -o-transform: translateY(-3rem);
    }

    15% {
        opacity: 1;
        transform: translateY(0);
        -webkit-transform: translateY(0);
        -moz-transform: translateY(0);
        -ms-transform: translateY(0);
        -o-transform: translateY(0);
    }

    0% {
        transform: scale(1.5);
        -webkit-transform: scale(1.5);
        -moz-transform: scale(1.5);
        -ms-transform: scale(1.5);
        -o-transform: scale(1.5);
    }
}

/* Gacha modal styles */
#gachaModal .content { width: 300px; max-width: 90%; padding: 12px; background: rgba(0,0,0,0.92); border: 2px solid #fff; border-radius: 6px; }
.gachabtn {
  width: 100%;
  padding: 10px;
  margin-top: 6px;
  background: linear-gradient(135deg, #d4af37 0%, #f4e19c 50%, #d4af37 100%);
  border: none;
  color: #000;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(212, 175, 55, 0.3);
}
.gachabtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(212, 175, 55, 0.5);
  background: linear-gradient(135deg, #e0c050 0%, #fff8dc 50%, #e0c050 100%);
}
.gachabtn:active { transform: scale(0.98); }
.modal-btn { width:100%; padding:8px 10px; border-radius:6px; border:none; cursor:pointer; }

.gacha-spinning {
  font-size: 20px;
  font-weight: bold;
  color: #ffd700;
  text-align: center;
  padding: 20px;
  animation: pulse 0.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

.gacha-shake {
    animation: gachaShake 0.42s ease-in-out;
}
.gacha-flash {
    animation: gachaFlash 0.4s ease-out;
}
.gacha-pop {
    animation: gachaPop 0.5s cubic-bezier(.2,.9,.2,1) forwards;
}

@keyframes shake {
    0% { transform: translate(0, 0); }
    25% { transform: translate(-4px, 0); }
    50% { transform: translate(4px, 0); }
    75% { transform: translate(-3px, 0); }
    100%{ transform: translate(0, 0); }
}

@keyframes flash {
    0% { filter: brightness(1); }
    50% { filter: brightness(2.5); }
    100% { filter: brightness(1); }
}

@keyframes pop-in {
    0% { transform: scale(0.4); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.gacha-item-img {
    width: 96px;
    height: 96px;
    border: 4px solid #fff;
    border-radius: 12px;
}

.gacha-item-img-small {
    width: 56px;
    height: 56px;
    border: 3px solid #fff;
    border-radius: 8px;
    margin: 4px;
}

/* Gacha Button */
#gachaModal .content {
    animation: gachaPop 0.3s ease-out;
}

.gachabtn {
    background: #ffcc00;
    border: none;
    padding: 10px 14px;
    font-size: 15px;
    border-radius: 8px;
    cursor: pointer;
}

.gacha-body {
    padding: 10px 12px;
}

.gacha-result-area {
    margin-top: 12px;
    font-size: 14px;
    min-height: 36px;
}

/* hiệu ứng rung */
@keyframes gachaShake {
    0% { transform: rotate(-1deg) }
    25% { transform: rotate(1deg) }
    50% { transform: rotate(-1deg) }
    75% { transform: rotate(1deg) }
    100% { transform: rotate(0deg) }
}

/* hiệu ứng pop */
@keyframes gachaPop {
    0% { transform: scale(0.85); opacity: 0 }
    100% { transform: scale(1); opacity: 1 }
}

.gacha-button {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: #ffd500;
    color: black;
    font-weight: bold;
    padding: 12px 25px;
    border-radius: 12px;
    border: 2px solid #000;
    font-size: 18px;
    cursor: pointer;
    z-index: 9999;
}


/* ==== GACHA STYLES (appended) ==== */
#gachaModal .content { width: 300px; max-width: 92%; padding: 12px; background: rgba(0,0,0,0.92); border: 2px solid #fff; border-radius: 8px; }
.gachabtn {
  width: 100%;
  padding: 10px;
  margin-top: 6px;
  background: #d4af37;
  border: none;
  color: #000;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
}
.modal-btn { width:100%; padding:8px 10px; border-radius:6px; border:none; cursor:pointer; }

.gacha-result-area { 
  margin-top: 12px; 
  font-size: 14px; 
  min-height: 48px; 
  max-height: 400px;
  overflow-y: auto;
  color: #fff; 
  display:flex; 
  flex-direction:column; 
  gap:6px; 
  align-items:center; 
  justify-content:flex-start; 
  padding: 8px;
}

.gacha-item-row { 
  display:flex; 
  align-items:center; 
  gap:10px; 
  padding:10px 12px; 
  border-radius:8px; 
  width:100%; 
  justify-content:flex-start; 
  box-sizing:border-box;
  transition: all 0.3s ease;
  opacity: 0;
  transform: scale(0.9);
}

.gacha-item-row.gacha-pop {
  opacity: 1;
  transform: scale(1);
}

.gacha-item-row:hover {
  transform: translateX(4px) scale(1.02);
  filter: brightness(1.2);
}

.r-Common { 
  border: 2px solid #bfbfbf; 
  background: linear-gradient(135deg, rgba(191,191,191,0.08) 0%, rgba(191,191,191,0.02) 100%);
}

.r-empty {
  border: 2px solid #555;
  background: linear-gradient(135deg, rgba(85,85,85,0.08) 0%, rgba(85,85,85,0.02) 100%);
}
.r-Uncommon { 
  border: 2px solid #1eff00; 
  background: linear-gradient(135deg, rgba(30,255,0,0.08) 0%, rgba(30,255,0,0.02) 100%);
}
.r-Rare { 
  border: 2px solid #0070dd; 
  background: linear-gradient(135deg, rgba(0,112,221,0.08) 0%, rgba(0,112,221,0.02) 100%);
}
.r-Epic { 
  border: 2px solid #a335ee; 
  background: linear-gradient(135deg, rgba(163,53,238,0.08) 0%, rgba(163,53,238,0.02) 100%);
}
.r-Legendary { 
  border: 2px solid #ffd700; 
  background: linear-gradient(135deg, rgba(255,215,0,0.08) 0%, rgba(255,215,0,0.02) 100%);
  box-shadow: 0 0 10px rgba(255,215,0,0.3);
}
.r-Heirloom { 
  border: 2px solid #ff4c9e; 
  background: linear-gradient(135deg, rgba(255,76,158,0.08) 0%, rgba(255,76,158,0.02) 100%);
  box-shadow: 0 0 10px rgba(255,76,158,0.3);
}

.gacha-shake { animation: gachaShake 0.42s ease-in-out; }
.gacha-flash { animation: gachaFlash 0.22s ease-out; }
.gacha-pop { animation: gachaPop 0.36s cubic-bezier(.2,.9,.2,1) forwards; }

@keyframes gachaShake {
  0%{ transform: translateX(0) rotate(0deg) }
  15%{ transform: translateX(-8px) rotate(-2deg) }
  30%{ transform: translateX(8px) rotate(2deg) }
  45%{ transform: translateX(-6px) rotate(-1deg) }
  60%{ transform: translateX(6px) rotate(1deg) }
  75%{ transform: translateX(-4px) rotate(-0.5deg) }
  90%{ transform: translateX(4px) rotate(0.5deg) }
  100%{ transform: translateX(0) rotate(0deg) }
}
@keyframes gachaFlash {
  0%{ filter: brightness(1); box-shadow: 0 0 0 rgba(255,215,0,0); }
  50%{ filter: brightness(2.5); box-shadow: 0 0 20px rgba(255,215,0,0.8); }
  100%{ filter: brightness(1); box-shadow: 0 0 0 rgba(255,215,0,0); }
}

/* Improved flash animation for gacha results */
.gacha-flash {
  animation: gachaFlash 0.5s ease-out;
}

@keyframes gachaPop {
  0%{ transform: scale(.3) rotate(-10deg); opacity: 0 }
  50%{ transform: scale(1.12) rotate(5deg); opacity: 1 }
  100%{ transform: scale(1) rotate(0deg); opacity: 1 }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.08); }
}

.gacha-spinning {
  font-size: 18px;
  font-weight: bold;
  color: #ffd700;
  text-align: center;
  padding: 20px;
  animation: pulse 0.6s ease-in-out infinite;
}

.gacha-thumb { width:56px; height:56px; border-radius:8px; object-fit:cover; border:3px solid #fff; }

@media (max-width:480px){
  #gachaModal .content { width: 92%; padding:10px; }
  .gachabtn { padding:10px; font-size:14px; }
}

.gacha-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 9999;
}

.gacha-content {
    background: #222;
    padding: 20px;
    width: 300px;
    margin: 120px auto;
    border-radius: 12px;
    border: 2px solid gold;
    position: relative;
    animation: popIn 0.25s ease-out;
}

.close-btn {
    position: absolute;
    right: 10px;
    top: 6px;
    font-size: 26px;
    cursor: pointer;
    color: #fff;
}

#gachaModal {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#gachaModal .content {
  position: relative;
  z-index: 10000;
}

/* Notification System */
#notification-container {
    position: static;
    margin: 0 auto 0 auto;
    width: 98%;
    max-width: 900px;
    z-index: 1;
    pointer-events: none;
}

.notification-move-down {
    margin-top: 340px !important;
}

.notification-item {
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.95) 0%, rgba(15, 15, 15, 0.95) 100%);
    border: 2px solid #ffd700;
    border-radius: 8px;
    padding: 5px 14px;
    margin-bottom: 0;
    box-shadow: 
        0 0 20px rgba(255, 215, 0, 0.3),
        inset 0 0 20px rgba(255, 215, 0, 0.1),
        0 4px 15px rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 0.88rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: slideInDown 0.4s cubic-bezier(0.23, 1, 0.32, 1), slideOutUp 0.4s cubic-bezier(0.23, 1, 0.32, 1) 4.6s forwards;
    pointer-events: auto;
@keyframes slideOutUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-30px);
    }
}
}

.notification-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.2), transparent);
    animation: shine 2s infinite;
}

.notification-item i {
    margin-right: 8px;
    color: #ffd700;
    font-size: 1.1rem;
}

.notification-item.success {
    border-color: #4ade80;
    box-shadow: 
        0 0 20px rgba(74, 222, 128, 0.3),
        inset 0 0 20px rgba(74, 222, 128, 0.1),
        0 4px 15px rgba(0, 0, 0, 0.5);
}

.notification-item.success i {
    color: #4ade80;
}

.notification-item.warning {
    border-color: #fb923c;
    box-shadow: 
        0 0 20px rgba(251, 146, 60, 0.3),
        inset 0 0 20px rgba(251, 146, 60, 0.1),
        0 4px 15px rgba(0, 0, 0, 0.5);
}

.notification-item.warning i {
    color: #fb923c;
}

.notification-item.error {
    border-color: #ef4444;
    box-shadow: 
        0 0 20px rgba(239, 68, 68, 0.3),
        inset 0 0 20px rgba(239, 68, 68, 0.1),
        0 4px 15px rgba(0, 0, 0, 0.5);
}

.notification-item.error i {
    color: #ef4444;
}

.notification-item.legendary {
    border-color: #a855f7;
    background: linear-gradient(135deg, rgba(30, 20, 40, 0.95) 0%, rgba(15, 10, 25, 0.95) 100%);
    box-shadow: 
        0 0 25px rgba(168, 85, 247, 0.5),
        inset 0 0 25px rgba(168, 85, 247, 0.2),
        0 4px 20px rgba(0, 0, 0, 0.6);
}

.notification-item.legendary i {
    color: #a855f7;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(20px);
    }
}

@keyframes shine {
    0% {
        left: -100%;
    }
    50%, 100% {
        left: 100%;
    }
}

/* Daily Reward Modal */
.daily-reward-content {
    max-width: 450px !important;
    width: 90%;
}

.daily-reward-body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem 0;
}

.reward-day-info {
    text-align: center;
    padding: 0.75rem;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 165, 0, 0.1) 100%);
    border: 2px solid #ffd700;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.reward-day-info h2 {
    font-size: 2rem;
    color: #ffd700;
    margin-bottom: 0.3rem;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.reward-subtitle {
    color: #ccc;
    font-size: 0.85rem;
}

.reward-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    min-height: 120px;
}

.reward-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    animation: bounceIn 0.6s ease-out;
}

.reward-item i {
    filter: drop-shadow(0 0 10px currentColor);
    font-size: 2.5rem !important;
}

.reward-item p {
    font-size: 1rem;
    font-weight: bold;
    color: #fff;
    text-align: center;
}

.reward-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(40, 40, 40, 0.8) 0%, rgba(20, 20, 20, 0.8) 100%);
    border: 2px solid #444;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.calendar-day:hover {
    transform: scale(1.05);
    border-color: #666;
}

.calendar-day.claimed {
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.2) 0%, rgba(34, 197, 94, 0.2) 100%);
    border-color: #4ade80;
}

.calendar-day.claimed::after {
    content: '✓';
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 0.8rem;
    color: #4ade80;
    font-weight: bold;
}

.calendar-day.current {
    border-color: #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    animation: pulse 2s infinite;
}

.calendar-day.special {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.3) 0%, rgba(126, 34, 206, 0.3) 100%);
    border-color: #a855f7;
}

.day-number {
    font-size: 1rem;
    font-weight: bold;
    color: #fff;
    margin-bottom: 0.25rem;
}

.day-icon {
    font-size: 1.2rem;
    color: #ffd700;
}

.calendar-day.special .day-icon {
    color: #a855f7;
}

/* Tooltip for calendar days */
.calendar-day {
    position: relative;
}

.calendar-day .tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.98) 0%, rgba(10, 10, 10, 0.98) 100%);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 1000;
    border: 1px solid #ffd700;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), 0 0 10px rgba(255, 215, 0, 0.3);
}

.calendar-day .tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(20, 20, 20, 0.98);
}

.calendar-day:hover .tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(-12px);
}

.calendar-day.special .tooltip {
    border-color: #a855f7;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), 0 0 15px rgba(168, 85, 247, 0.5);
}

.calendar-day.special .tooltip::after {
    border-top-color: rgba(20, 20, 20, 0.98);
}

.tooltip .reward-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    text-align: left;
}

.tooltip .reward-info span {
    display: block;
    font-size: 0.7rem;
}

.tooltip .reward-info .gold {
    color: #ffd700;
}

.tooltip .reward-info .item {
    color: #a855f7;
}

.tooltip .reward-info .buff {
    color: #4ade80;
}

.claim-btn {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: bold;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #000;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.claim-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.6);
}

.claim-btn:active {
    transform: translateY(0);
}

.claim-btn:disabled {
    background: linear-gradient(135deg, #666 0%, #888 100%);
    cursor: not-allowed;
    opacity: 0.5;
}

.claim-btn i {
    margin-right: 0.5rem;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    }
    50% {
        box-shadow: 0 0 25px rgba(255, 215, 0, 0.8);
    }
}

/* ===== Auth Alert Countdown Enhancements ===== */
#auth-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ff4444;
}
.auth-info { color: #cccccc !important; }
.auth-success { color: #4ade80 !important; }

/* Ensure both login/register panels align consistently */
#login-panel, #register-panel {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
#login-panel { display: flex; }
#login-screen { display: flex; align-items: center; justify-content: center; }

/* ===== Auth buttons polish ===== */
#show-login,
#show-register,
#login-form button[type="submit"],
#register-form button[type="submit"] {
    border: 2px solid #fff;
    background: rgba(255,255,255,0.08);
    color: #fff;
    backdrop-filter: blur(12px);
    box-shadow: inset 0 0 24px rgba(255,255,255,0.1), 0 4px 12px rgba(0,0,0,0.35);
    transition: transform .15s ease, box-shadow .15s ease, background .2s ease;
}

#show-login:hover,
#show-register:hover,
#login-form button[type="submit"]:hover,
#register-form button[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: inset 0 0 28px rgba(255,255,255,0.15), 0 6px 16px rgba(0,0,0,0.45);
    background: rgba(255,255,255,0.12);
}

#show-login:active,
#show-register:active,
#login-form button[type="submit"]:active,
#register-form button[type="submit"]:active {
    transform: translateY(0);
}

#show-login:disabled { opacity: .6; cursor: not-allowed; }

/* Shared layout for auth buttons */
.button-row { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; width: 100%; }
.btn-primary { flex: 2 1 auto; }
.btn-secondary { flex: 1 1 auto; }
.button-row button {
    height: 40px;
    padding: 10px 16px;
    font-size: 1rem;
}

/* Consistent form width to prevent layout shift */
#login-form, #register-form {
    width: 360px;
    max-width: 90vw;
}

.loading-dots {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}
.loading-dots .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ffd500; /* vàng */
    opacity: 0.9;
    box-shadow: 0 0 6px rgba(255, 213, 0, 0.8);
    animation: dotBlink 1s infinite ease-in-out;
}
.loading-dots .dot:nth-child(2) { animation-delay: 0.15s; }
.loading-dots .dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes dotBlink {
    0%, 100% { opacity: 0.35; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-1px); }
}
.countdown-text { font-weight: 600; }

/* Button loading progress helper */
.btn-loading {
    position: relative;
    overflow: hidden;
}
.btn-loading::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    height: 100%;
    width: var(--load-progress, 0%);
    background: var(--progress-color, #0066cc); /* dynamic color */
    pointer-events: none;
        transition: width .15s linear, background-color .25s linear, box-shadow .25s ease, filter .2s ease;
        /* Stronger glow for a more diffused feel */
        box-shadow: 0 0 16px rgba(0,0,0,0.45), 0 0 18px currentColor;
        /* Soften leading/trailing edges using wider mask */
        -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
            mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
        /* Subtle blur of the overlay itself to enhance smoothness */
        filter: blur(1.2px);
}
/* Optional subtle pulsing while waiting */
.btn-loading.wait-phase::before { animation: progressPulse 1.2s ease-in-out infinite; }
@keyframes progressPulse { 0%,100% { filter: drop-shadow(0 0 4px rgba(0,0,0,0.4)); } 50% { filter: drop-shadow(0 0 8px rgba(0,0,0,0.6)); } }

/* ===== Password Strength Bar ===== */
.pw-strength-wrap { position: relative; width: 100%; margin: 4px 0 8px; }
.pw-strength-track { height: 6px; width: 100%; background: rgba(255,255,255,0.15); border-radius: 999px; overflow: hidden; }
.pw-strength-bar { height: 100%; width: 0%; border-radius: 999px; transition: width .2s ease; background: rgba(46,204,113,0.65); box-shadow: 0 0 6px rgba(46,204,113,0.6); }
/* (Đã bỏ animation màu nút đăng nhập – dùng overlay progress thay thế) */
.pw-tooltip {
    position: absolute;
    top: -8px;
    right: 0;
    transform: translateY(-100%);
    background: linear-gradient(135deg, rgba(20,20,30,0.98) 0%, rgba(30,30,45,0.98) 100%);
    color: #fff;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.5;
    width: 240px;
    display: none;
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: 0 8px 20px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.05) inset;
    backdrop-filter: blur(10px);
    z-index: 1000;
}
/* Arrow indicator */
.pw-tooltip::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid rgba(30,30,45,0.98);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}
.pw-strength-wrap:hover .pw-tooltip {
    display: block;
    animation: tooltipFadeIn 0.2s ease;
}
@keyframes tooltipFadeIn {
    from { opacity: 0; transform: translateY(-90%); }
    to { opacity: 1; transform: translateY(-100%); }
}
.pw-tooltip-title {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 8px;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    padding-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.pw-tooltip-title i {
    color: #ffd500;
    margin: 0;
}
.pw-tooltip-title .icon-left {
    order: 0;
}
.pw-tooltip-title .icon-right {
    order: 2;
}
.pw-tooltip-title span {
    order: 1;
}
#tip-register-password {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.pw-requirement {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 5px 0;
    transition: all 0.3s ease;
    width: 100%;
    justify-content: flex-start;
}
.pw-requirement i {
    font-size: 13px;
    width: 16px;
    text-align: center;
    margin: 0;
    transition: all 0.3s ease;
    flex-shrink: 0;
}
.pw-requirement span {
    transition: all 0.3s ease;
    text-align: left;
}
.pw-requirement.ok i {
    color: #2ecc71;
}
.pw-requirement.ok span {
    color: #2ecc71;
}
.pw-requirement.bad i {
    color: #e74c3c;
    opacity: 0.6;
}
.pw-requirement.bad span {
    color: #aaa;
}
