* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*::selection {
    background-color: #2bec72;
    color: white;
}

html {
    overflow-x: hidden;
}

body {
    font-family: 'Arial', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    padding-bottom: 200px;
    position: relative;
    overflow-x: hidden;
    background-attachment: fixed;
}

/* Background Animated Coins */
#coinsContainer {
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.coin {
    position: absolute;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    opacity: 0.8;
    transition: transform 0.3s;
    animation: float 3s ease-in-out infinite;
    color: white;
    z-index: 1000;
    background: radial-gradient(circle at 30% 30%, #FFD700, #FFA500);
    user-select: none;
    cursor: pointer;
}

.coin:hover {
    transform: scale(1.2);
    opacity: 1;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }

    100% {
        transform: translateY(0px);
    }
}

.coin-bg {
    position: absolute;
    width: 40px;
    height: 40px;
    background: radial-gradient(circle at 30% 30%, #FFD700, #FFA500);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    opacity: 0.5;
    animation: floatCoin 4s ease-in-out infinite;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}

@keyframes floatCoin {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-30px) rotate(180deg);
    }
}

.main-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    gap: 30px;
    width: 100%;
    max-width: 1200px;
    margin: 40px auto;
    position: relative;
    z-index: 10;
}

.left-section {
    grid-column: 1;
    grid-row: 1;
}

.right-section {
    grid-column: 2;
    grid-row: 1;
}

.center-section {
    grid-column: 1 / span 2;
    grid-row: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    position: relative;
    z-index: 100;
    pointer-events: none;
    margin: 0 auto;
    width: 100%;
}

.center-section>.draggable-coin {
    pointer-events: auto;
    margin: 0 auto;
}

.section-title {
    font-size: 28px;
    text-align: center;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    font-weight: 700;
}

[data-heading="dark"] {
    color: white;
}

[data-heading="light"] {
    color: black;
}

.theme-oriented {
    /* For JS theme switching */
}

/* Items Grid */
.items-container {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    border-radius: 25px;
    padding: 30px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    height: 100%;
    min-height: 400px;
}

.items-grid {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-top: 20px;
}

.item-card {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px dashed #d1cbcb;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.item-card:hover {
    transform: translateY(-8px);
    border-color: #4CAF50;
    box-shadow: 0 15px 40px rgba(76, 175, 80, 0.3);
}

.item-card img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.item-card:hover img {
    transform: scale(1.1) rotate(5deg);
}

.item-details {
    flex: 1;
}

.item-details h3 {
    font-size: 24px;
    margin-bottom: 10px;
    font-weight: 600;
}

.price {
    font-size: 28px;
    font-weight: 700;
    color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
    padding: 8px 20px;
    border-radius: 15px;
    display: inline-block;
}

.balance-container {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    border-radius: 25px;
    padding: 30px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    height: 100%;
    min-height: 400px;
}

.balance-display {
    text-align: center;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.balance-amount {
    font-size: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3), 0 0 30px rgba(255, 255, 255, 0.5);
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.currency {
    font-size: 60px;
    vertical-align: top;
}

.balance-label {
    font-size: 18px;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

/* Piggy Bank */
.piggy-bank {
    text-align: center;
}

.piggy-title {
    font-size: 22px;
    margin-bottom: 20px;
    font-weight: 600;
}

.piggy {
    width: 200px;
    height: 200px;
    margin: 0 auto 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 5px solid rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
    animation: piggyPulse 2s infinite ease-in-out;
}

.piggy:hover {
    transform: scale(1.08);
    border-color: #FF69B4;
    box-shadow: 0 0 40px rgba(255, 105, 180, 0.5);
}

.piggy img {
    width: 85%;
    height: 85%;
    object-fit: contain;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
}

.piggy.drag-over {
    background: rgba(255, 105, 180, 0.3);
    border-color: #FF1493;
    animation: piggyPulse 0.5s infinite alternate;
}

/* Glow + scale pulse */
@keyframes piggyPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(255, 105, 180, 0.0);
    }

    50% {
        transform: scale(1.08);
        box-shadow: 0 0 40px rgba(255, 105, 180, 0.7);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(255, 105, 180, 0.0);
    }
}

.piggy-info {
    font-size: 20px;
    font-weight: 800;
}

/* Center Draggable Coin */
.draggable-coin {
    width: 120px;
    height: 120px;
    background: radial-gradient(circle at 35% 35%, #FFD700, #FF8C00);
    color: white;
    border: 8px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    font-weight: bold;
    cursor: grab;
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.8), 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: coinFloat 3s ease-in-out infinite;
    position: relative;
    z-index: 1000;
    transition: all 0.3s ease;
    user-select: none;
    -webkit-user-drag: element;
}

.draggable-coin:active {
    cursor: grabbing;
    transform: scale(0.95);
}

.draggable-coin:hover {
    animation: coinFloat 1.5s ease-in-out infinite;
    box-shadow: 0 0 70px rgba(255, 215, 0, 1), 0 25px 70px rgba(0, 0, 0, 0.5);
}

@keyframes coinFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* Drag Effects */
.item-card.drag-over {
    background: rgba(144, 238, 144, 0.5);
    border-color: #4CAF50;
    box-shadow: 0 0 40px rgba(76, 175, 80, 0.8);
}

/* ================= DRAG HINT ================= */
.drag-hint {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    pointer-events: none;
    z-index: 1200;
    animation: hintFade 3s infinite;
    height: 180px;
    width: 180px;
}

.hand {
    width: inherit;
    font-size: 40px;
    animation: fingerMove 1.5s infinite ease-in-out;
    height: inherit;
}

.hint-text {
    font-size: 20px;
    font-weight: 700;
    color: white;
    letter-spacing: 1px;
}

/* finger move animation */
@keyframes fingerMove {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }

    100% {
        transform: translateY(0);
    }
}

/* soft fade */
@keyframes hintFade {
    0% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.3;
    }
}

/* Footer */
.footer-bar-design {
    position: fixed;
    width: 100%;
    height: 125px;
    overflow: visible;
    background: linear-gradient(326deg, #a4508b 0%, #FFD700 15%, #6824d6 30%, #FFA500 45%, #fe3258 60%, #FF69B4 75%, #87CEEB 85%, #98FB98 100%);
    filter: opacity(0.6);
    bottom: 0;
    left: 0;
    z-index: 1;
}

.footer-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 180px;
    background: url(https://1.bp.blogspot.com/-NYl6L8pz8B4/XoIVXwfhlNI/AAAAAAAAU3k/nxJKiLT706Mb7jUFiM5vdCsOSNnFAh0yQCLcBGAsYHQ/s1600/hero-wave.png) repeat-x;
    animation: wave 10s linear infinite;
    transform: scaleY(-1);
    z-index: 1;
}

@keyframes wave {
    0% {
        background-position: 0;
    }

    100% {
        background-position: 1440px;
    }
}

/* PROCEED BUTTON */
a.proceedBtn {
    position: fixed;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(326deg, #a4508b 50%, #FF69B4 50%);
    padding: 18px 60px;
    text-decoration: none;
    font-size: 20px;
    box-shadow: 0 10px 40px rgba(255, 107, 157, 0.5), 0 0 20px rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    z-index: 150;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: white;
    cursor: pointer;
}

a.proceedBtn:hover {
    box-shadow: 0 12px 50px rgba(255, 107, 157, 0.7);
    background: linear-gradient(135deg, #a4508b 50%, #FF69B4 50%);
    transform: translateX(-50%) translateY(-3px);
}

/* Responsive Design */
@media (max-width: 1024px) {
    body {
        padding-bottom: 180px;
    }

    .main-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 25px;
    }

    .left-section {
        grid-column: 1;
        grid-row: 1;
        order: 1;
    }

    .center-section {
        grid-column: 1;
        grid-row: 2;
        height: 180px;
        margin: 20px auto;
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        order: 2;
    }

    .right-section {
        grid-column: 1;
        grid-row: 3;
        order: 3;
    }

    .draggable-coin {
        width: 130px;
        height: 130px;
        font-size: 70px;
        margin: 0 auto;
    }

    .balance-amount {
        font-size: 60px;
    }

    .footer-bar-design {
        height: 110px;
    }

    .footer-wave {
        height: 160px;
    }

    a.proceedBtn {
        padding: 16px 50px;
        font-size: 19px;
        bottom: 35px;
    }
}

@media (max-width: 768px) {
    body {
        padding-bottom: 180px;
    }

    .main-container {
        margin: 20px auto;
    }

    .center-section {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
    }

    .items-container,
    .balance-container {
        padding: 20px;
    }

    .item-card {
        padding: 20px;
        gap: 20px;
    }

    .item-card img {
        width: 80px;
        height: 80px;
    }

    .item-details h3 {
        font-size: 20px;
    }

    .price {
        font-size: 24px;
        padding: 6px 16px;
    }

    .piggy {
        width: 160px;
        height: 160px;
    }

    .draggable-coin {
        width: 110px;
        height: 110px;
        font-size: 60px;
        margin: 0 auto;
    }

    .balance-amount {
        font-size: 50px;
    }

    .footer-bar-design {
        height: 100px;
    }

    .footer-wave {
        height: 150px;
    }

    a.proceedBtn {
        padding: 15px 40px;
        font-size: 18px;
        bottom: 30px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 15px;
        padding-bottom: 180px;
    }

    .main-container {
        gap: 0;
    }

    .section-title {
        font-size: 24px;
    }

    .center-section {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
    }

    .item-card {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }

    .piggy {
        width: 140px;
        height: 140px;
    }

    .draggable-coin {
        width: 90px;
        height: 90px;
        font-size: 50px;
        margin: 0 auto;
    }

    .footer-bar-design {
        height: 100px;
    }

    .footer-wave {
        height: 150px;
    }

    a.proceedBtn {
        padding: 14px 35px;
        font-size: 16px;
        bottom: 30px;
    }

    .coin-tooltip {
        font-size: 14px;
        bottom: -40px;
        padding: 8px 15px;
    }
}
