* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

/* Safe area support for devices with notches */
:root {
    --safe-area-inset-top: env(safe-area-inset-top);
    --safe-area-inset-right: env(safe-area-inset-right);
    --safe-area-inset-bottom: env(safe-area-inset-bottom);
    --safe-area-inset-left: env(safe-area-inset-left);
}

body {
    background-color: #f0f2f5;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(to right, #6a11cb, #2575fc);
    background-size: cover;
    background-position: center;
    color: #333;
}

/* Prevent transitions during page load */
.preload * {
    transition: none !important;
    animation: none !important;
}

.auction-container {
    width: 100%;
    max-width: 1200px;
    background-color: rgba(255, 255, 255, 0.85);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Header Styles */
.auction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: linear-gradient(135deg, #7579ff, #b224ef);
    color: white;
    border-bottom: 3px solid #e0e0e0;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

#user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

#username {
    font-weight: 500;
    margin-right: 10px;
}

/* Content Styles */
.auction-content {
    display: flex;
    padding: 20px;
    flex: 1;
    background-image: url('../images/content-bg.svg');
    background-size: cover;
    background-position: center;
    position: relative;
    min-height: 600px;
    gap: 20px;
}

.bidders-area {
    flex: 1.5;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    position: relative;
    height: 780px;
    overflow: hidden;
    background: url('../images/podium.png') no-repeat center bottom;
    background-size: 150%;
    background-position: center bottom 0px;
    margin-top: 20px;
    padding-bottom: 10px;
}

.bidder {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform-origin: bottom center;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Champion Spotlight - 1st Place with Golden Glow */
.first-place {
    z-index: 5;
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%) scale(1.3);
}

.first-place::before {
    content: '';
    position: absolute;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.3), rgba(255, 215, 0, 0.1) 50%, transparent 70%);
    border-radius: 50%;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: -1;
    animation: pulse-gold 2s ease-in-out infinite;
}

@keyframes pulse-gold {

    0%,
    100% {
        opacity: 0.6;
        transform: translateX(-50%) scale(1);
    }

    50% {
        opacity: 1;
        transform: translateX(-50%) scale(1.1);
    }
}

/* 2nd Place with Silver Glow */
.second-place {
    z-index: 4;
    position: absolute;
    bottom: 30px;
    right: 20%;
    transform: translateX(50%) scale(1.1);
}

.second-place::before {
    content: '';
    position: absolute;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(192, 192, 192, 0.25), rgba(192, 192, 192, 0.08) 50%, transparent 70%);
    border-radius: 50%;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: -1;
    animation: pulse-silver 2.5s ease-in-out infinite;
}

@keyframes pulse-silver {

    0%,
    100% {
        opacity: 0.5;
        transform: translateX(-50%) scale(1);
    }

    50% {
        opacity: 0.8;
        transform: translateX(-50%) scale(1.08);
    }
}

/* 3rd Place with Bronze Glow */
.third-place {
    z-index: 4;
    position: absolute;
    bottom: 10px;
    left: 22%;
    transform: translateX(-50%) scale(1.0);
}

.third-place::before {
    content: '';
    position: absolute;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(205, 127, 50, 0.25), rgba(205, 127, 50, 0.08) 50%, transparent 70%);
    border-radius: 50%;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: -1;
    animation: pulse-bronze 2.5s ease-in-out infinite;
}

@keyframes pulse-bronze {

    0%,
    100% {
        opacity: 0.5;
        transform: translateX(-50%) scale(1);
    }

    50% {
        opacity: 0.8;
        transform: translateX(-50%) scale(1.08);
    }
}

.character {
    position: relative;
    height: 200px;
    display: flex;
    justify-content: center;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.15));
}

.first-place .character {
    height: 200px;
    top: -20px;
}

.second-place .character {
    height: 200px;
    top: 35px;
    right: 0px;
}

.third-place .character {
    height: 200px;
    top: 35px;
    right: 0px;
}

/* Adjust container ONLY for real ZRenderer images (not fallback M/F copies) */
.first-place .character:has(img[src*="cache/zrenderer"]:not([src*="fallback"])) {
    height: 200px;
    top: -10px;
}

.second-place .character:has(img[src*="cache/zrenderer"]:not([src*="fallback"])) {
    height: 200px;
    top: 50px;
}

.third-place .character:has(img[src*="cache/zrenderer"]:not([src*="fallback"])) {
    height: 200px;
    top: 40px;
}

.gold {
    background: linear-gradient(145deg, rgba(255, 235, 150, 0.95), rgba(255, 200, 80, 0.95));
    border-image: linear-gradient(145deg, rgba(255, 245, 180, 1), rgba(255, 215, 0, 0.9), rgba(255, 245, 180, 1)) 1;
    box-shadow:
        0 5px 20px rgba(255, 215, 0, 0.4),
        0 0 25px rgba(255, 215, 0, 0.3),
        inset 0 2px 0 rgba(255, 255, 220, 0.6),
        inset 0 -2px 0 rgba(200, 150, 0, 0.3);
    position: absolute;
    bottom: 50px;
    left: 0;
    right: 0;
    animation: podium-gold-glow 3s ease-in-out infinite;
}

@keyframes podium-gold-glow {

    0%,
    100% {
        box-shadow:
            0 5px 20px rgba(255, 215, 0, 0.4),
            0 0 25px rgba(255, 215, 0, 0.3),
            inset 0 2px 0 rgba(255, 255, 220, 0.6),
            inset 0 -2px 0 rgba(200, 150, 0, 0.3);
    }

    50% {
        box-shadow:
            0 5px 25px rgba(255, 215, 0, 0.6),
            0 0 35px rgba(255, 215, 0, 0.5),
            inset 0 2px 0 rgba(255, 255, 220, 0.6),
            inset 0 -2px 0 rgba(200, 150, 0, 0.3);
    }
}

.silver {
    background: linear-gradient(145deg, rgba(240, 240, 240, 0.95), rgba(200, 200, 210, 0.95));
    border-image: linear-gradient(145deg, rgba(255, 255, 255, 1), rgba(192, 192, 192, 0.8), rgba(255, 255, 255, 1)) 1;
    box-shadow:
        0 4px 15px rgba(192, 192, 192, 0.3),
        0 0 20px rgba(192, 192, 192, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        inset 0 -1px 0 rgba(150, 150, 160, 0.3);
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
}

.bronze {
    background: linear-gradient(145deg, rgba(235, 180, 140, 0.95), rgba(210, 140, 90, 0.95));
    border-image: linear-gradient(145deg, rgba(255, 220, 180, 1), rgba(205, 127, 50, 0.8), rgba(255, 220, 180, 1)) 1;
    box-shadow:
        0 4px 15px rgba(205, 127, 50, 0.3),
        0 0 20px rgba(205, 127, 50, 0.2),
        inset 0 1px 0 rgba(255, 230, 200, 0.5),
        inset 0 -1px 0 rgba(160, 90, 30, 0.3);
    position: absolute;
    bottom: 5px;
    left: 0;
    right: 0;
}

.rank {
    font-weight: 800;
    font-size: 14px;
    color: #7579ff;
    position: relative;
    display: inline-block;
    padding: 0 3px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.gold .rank {
    color: #fff;
    font-size: 16px;
    text-shadow:
        0 2px 3px rgba(0, 0, 0, 0.5),
        0 0 10px rgba(255, 215, 0, 0.8);
    font-weight: 900;
}

.silver .rank {
    color: #333;
    text-shadow:
        0 1px 2px rgba(255, 255, 255, 0.8),
        0 0 5px rgba(192, 192, 192, 0.5);
    font-weight: 800;
}

.bronze .rank {
    color: #fff;
    text-shadow:
        0 1px 3px rgba(0, 0, 0, 0.4),
        0 0 8px rgba(205, 127, 50, 0.6);
    font-weight: 800;
}

.bidder-info {
    margin-top: 3px;
    padding: 2px 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.bidder-name {
    font-weight: 700;
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100px;
    margin: 0 auto;
    color: #333;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.gold .bidder-name {
    color: #2c2000;
    text-shadow: 0 1px 2px rgba(255, 255, 200, 0.8);
}

.silver .bidder-name {
    color: #222;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9);
}

.bronze .bidder-name {
    color: #4a2500;
    text-shadow: 0 1px 2px rgba(255, 230, 200, 0.8);
}

.popularity,
.guild {
    font-size: 9px;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.popularity::before {
    content: '★';
    color: #ffc107;
    font-size: 10px;
}

.guild {
    font-size: 9px;
    font-weight: 600;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.6);
    gap: 3px;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.bid-bubble {
    position: absolute;
    bottom: 180px;
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    min-width: 120px;
    max-width: 200px;
    background: linear-gradient(145deg, rgba(90, 103, 216, 0.95), rgba(117, 121, 255, 0.95));
    color: white;
    padding: 10px 35px;
    border-radius: 12px;
    z-index: 10;
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: box-shadow 0.3s ease, filter 0.3s ease, opacity 0.3s ease;
    border: 3px solid;
    border-image: linear-gradient(145deg, rgba(255, 255, 255, 0.8), rgba(200, 200, 255, 0.6), rgba(255, 255, 255, 0.8)) 1;
}

/* Corner gems/decorations */
.bid-bubble::before {
    content: '◆';
    position: absolute;
    top: -3px;
    left: 50%;
    transform: translateX(-50%) scale(1.25);
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 0 10px rgba(117, 121, 255, 0.8);
    z-index: 2;
}

.bid-bubble::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 15px;
    box-shadow: 0 0 25px 4px rgba(117, 121, 255, 0.5);
    z-index: -1;
    animation: bubble-pulse 2s ease-in-out infinite;
}

@keyframes bubble-pulse {

    0%,
    100% {
        box-shadow: 0 0 25px 4px rgba(117, 121, 255, 0.5);
    }

    50% {
        box-shadow: 0 0 38px 6px rgba(117, 121, 255, 0.7);
    }
}

.first-place .bid-bubble {
    bottom: 405px;
    transform: translateX(-50%) scale(1.4);
    background: linear-gradient(145deg, rgba(255, 215, 0, 0.98), rgba(255, 180, 0, 0.98));
    box-shadow:
        0 10px 30px rgba(255, 215, 0, 0.5),
        inset 0 2px 0 rgba(255, 255, 200, 0.6),
        inset 0 -2px 0 rgba(200, 140, 0, 0.4);
    z-index: 20;
    border: 3px solid;
    border-image: linear-gradient(145deg, rgba(255, 240, 150, 1), rgba(255, 215, 0, 0.8), rgba(255, 240, 150, 1)) 1;
}

/* Crown icon for 1st place */
.first-place .bid-bubble::before {
    content: '';
    width: 48px;
    height: 48px;
    background-image: url('../images/crown.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    top: -30px;
    animation: crown-float 2s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.8));
}

@keyframes crown-float {

    0%,
    100% {
        transform: translateX(-50%) translateY(0) scale(0.71);
    }

    50% {
        transform: translateX(-50%) translateY(-5px) scale(0.71);
    }
}

.first-place .bid-bubble::after {
    box-shadow: 0 0 21px 3.5px rgba(255, 215, 0, 0.7);
    animation: gold-pulse 2s ease-in-out infinite;
}

@keyframes gold-pulse {

    0%,
    100% {
        box-shadow: 0 0 21px 3.5px rgba(255, 215, 0, 0.7);
    }

    50% {
        box-shadow: 0 0 29px 5.5px rgba(255, 215, 0, 0.9);
    }
}

.second-place .bid-bubble {
    bottom: 305px;
    transform: translateX(-50%) scale(1.0);
    z-index: 10;
    background: linear-gradient(145deg, rgba(220, 220, 220, 0.95), rgba(192, 192, 192, 0.95));
    border-image: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(192, 192, 192, 0.7), rgba(255, 255, 255, 0.9)) 1;
}

.second-place .bid-bubble::before {
    transform: translateX(-50%) scale(1.0);
}

.second-place .bid-bubble::after {
    box-shadow: 0 0 20px 3px rgba(192, 192, 192, 0.6);
    animation: silver-pulse 2s ease-in-out infinite;
}

@keyframes silver-pulse {

    0%,
    100% {
        box-shadow: 0 0 20px 3px rgba(192, 192, 192, 0.6);
    }

    50% {
        box-shadow: 0 0 30px 5px rgba(192, 192, 192, 0.8);
    }
}

.third-place .bid-bubble {
    bottom: 350px;
    transform: translateX(-50%) scale(0.9);
    z-index: 10;
    background: linear-gradient(145deg, rgba(225, 160, 130, 0.95), rgba(205, 127, 50, 0.95));
    border-image: linear-gradient(145deg, rgba(255, 200, 150, 0.9), rgba(205, 127, 50, 0.7), rgba(255, 200, 150, 0.9)) 1;
}

.third-place .bid-bubble::before {
    transform: translateX(-50%) scale(1.11);
}

.third-place .bid-bubble::after {
    box-shadow: 0 0 22px 3.5px rgba(205, 127, 50, 0.6);
    animation: bronze-pulse 2s ease-in-out infinite;
}

@keyframes bronze-pulse {

    0%,
    100% {
        box-shadow: 0 0 22px 3.5px rgba(205, 127, 50, 0.6);
    }

    50% {
        box-shadow: 0 0 33px 5.5px rgba(205, 127, 50, 0.8);
    }
}

.bid-amount {
    font-weight: 800;
    font-size: 17px;
    text-shadow:
        0 2px 4px rgba(0, 0, 0, 0.5),
        0 0 10px rgba(255, 255, 255, 0.3);
    letter-spacing: 0.5px;
}

.first-place .bid-amount {
    font-size: 20px;
    color: #fff;
    text-shadow:
        0 2px 4px rgba(0, 0, 0, 0.6),
        0 0 15px rgba(255, 215, 0, 0.8),
        0 0 30px rgba(255, 215, 0, 0.4);
}

.bid-text {
    font-size: 10px;
    opacity: 0.9;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.auction-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    z-index: 5;
}

.price-display {
    background-color: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    border: 2px solid rgba(117, 121, 255, 0.3);
    position: relative;
    z-index: 6;
}

.price-header {
    text-align: center;
    font-weight: 600;
    margin-bottom: 10px;
    color: #7579ff;
    position: relative;
    font-size: 1.1rem;
}

.price-header::before,
.price-header::after {
    content: "";
    position: absolute;
    height: 2px;
    width: 30px;
    background-color: rgba(117, 121, 255, 0.3);
    top: 50%;
}

.price-header::before {
    left: 20px;
}

.price-header::after {
    right: 20px;
}

.price-counter {
    display: flex;
    justify-content: center;
    gap: 4px;
}

.digit {
    width: 28px;
    height: 38px;
    background-color: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    font-size: 22px;
    color: #333;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.changing {
    animation: flash 1s ease;
}

/* Winner price animations */
.winner-price {
    animation: winnerPriceGlow 2.5s infinite alternate;
}

.winner-digit {
    background: linear-gradient(135deg, #fffde7, #ffd700);
    color: #b27e01;
    border-color: #e6c200;
    transform: scale(1.15);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.7);
    animation: winnerDigitPulse 2s infinite alternate;
}

@keyframes winnerPriceGlow {
    0% {
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
        border-color: rgba(255, 215, 0, 0.4);
    }

    100% {
        box-shadow: 0 0 25px rgba(255, 215, 0, 0.8);
        border-color: rgba(255, 215, 0, 0.9);
    }
}

@keyframes winnerDigitPulse {
    0% {
        transform: scale(1.15);
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    }

    100% {
        transform: scale(1.25);
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.9);
    }
}

.item-display {
    background-color: white;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.item-img {
    width: 100px;
    height: 100px;
    background-color: #f8f8f8;
    border-radius: 10%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

.item-img img {
    width: 70%;
    height: 70%;
    object-fit: contain;
}

.item-name {
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 10px;
}

.item-details {
    margin-top: 5px;
    font-size: 13px;
    color: #555;
    padding: 0 10px;
    text-align: center;
}

.item-owner {
    margin-bottom: 5px;
    font-weight: 500;
    color: #7579ff;
}

.item-specs {
    font-size: 12px;
    color: #777;
}

.timer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-weight: 500;
}

.bid-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    background-color: #7579ff;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 44px;
    /* Consistent button height */
    white-space: nowrap;
    /* Prevent text wrapping */
    font-size: 14px;
}

.action-btn:hover:not(:disabled) {
    background-color: #5c60cc;
}

.action-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
    filter: grayscale(20%);
}

/* Scheduled auction button styling */
.action-btn.scheduled-btn {
    background-color: #ffa500;
}

.action-btn.scheduled-btn:hover:not(:disabled) {
    background-color: #ff8c00;
}

.bid-table {
    background-color: white;
    border-radius: 10px;
    padding: 0px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    flex: 1;
    overflow: auto;
    max-height: 210px;
    /* Increased to match chat better */
    z-index: 5;
}

.table-header {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
    font-weight: 600;
    position: sticky;
    top: 0;
    background-color: white;
    z-index: 2;
}

.table-row {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s;
}

.table-row:last-child {
    border-bottom: none;
}

.col {
    flex: 1;
    padding: 0 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.9rem;
}

.col:first-child {
    flex: 2;
    justify-content: flex-start;
    font-weight: 500;
}

.col:last-child {
    justify-content: flex-end;
    color: #5c60cc;
    font-weight: 600;
}

.col:nth-child(2) {
    flex: 1.5;
}

.col:nth-child(3),
.col:nth-child(4),
.col:nth-child(5) {
    justify-content: flex-end;
    color: #5c60cc;
    font-weight: 600;
}

.auction-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background-color: #f8f8f8;
    border-top: 1px solid #e0e0e0;
}

.navigation-dots {
    display: flex;
    gap: 5px;
}

.navigation-dots span {
    width: 10px;
    height: 10px;
    background-color: #e0e0e0;
    border-radius: 50%;
    cursor: pointer;
}

.navigation-dots span:first-child {
    background-color: #7579ff;
}

.chat-box {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    max-width: 700px;
    margin: 0 auto;
    background-color: #f8f8f8;
    border-radius: 25px;
    padding: 5px 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.chat-icon img,
.chat-icon svg {
    width: 24px;
    height: 24px;
    fill: #7579ff;
}

.chat-box input {
    flex: 1;
    padding: 10px 15px;
    border: none;
    background: transparent;
    border-radius: 20px;
    outline: none;
    font-size: 15px;
}

.chat-box input:focus {
    background-color: rgba(255, 255, 255, 0.8);
}

.chat-box .send-btn {
    background-color: #7579ff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.chat-box .send-btn:hover {
    background-color: #5a5ee5;
    transform: translateY(-2px);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 100;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: popIn 0.3s ease;
}

.modal-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, #7579ff, #b224ef);
    color: white;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-button {
    cursor: pointer;
    font-size: 24px;
}

.modal-body {
    padding: 20px;
}

.item-preview {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    align-items: center;
}

.preview-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    background-color: #f8f8f8;
    border-radius: 10px;
    padding: 10px;
    border: 1px solid #e0e0e0;
}

.item-details h3 {
    margin-bottom: 5px;
    color: #333;
}

.item-details p {
    font-size: 14px;
    color: #666;
}

.current-bid {
    background-color: #f8f8f8;
    padding: 15px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.bid-label {
    font-weight: 500;
    color: #666;
}

.bid-value {
    font-weight: 700;
    color: #7579ff;
}

.bid-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bid-input-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bid-input-area label {
    font-weight: 500;
    color: #333;
}

.bid-input-area input {
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    font-size: 16px;
}

.bid-note {
    font-size: 12px;
    color: #666;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.cash-balance {
    font-size: 14px;
    color: #666;
}

#userBalance {
    color: #5c60cc;
    font-weight: 600;
}

.cancel-btn,
.confirm-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-btn {
    background-color: #f0f0f0;
    color: #666;
    margin-right: 10px;
}

.confirm-btn {
    background-color: #7579ff;
    color: white;
}

/* Animations */
@keyframes floating {
    0% {
        transform: translateY(0px) rotate(0deg);
    }

    25% {
        transform: translateY(-5px) rotate(1deg);
    }

    50% {
        transform: translateY(-10px) rotate(0deg);
    }

    75% {
        transform: translateY(-5px) rotate(-1deg);
    }

    100% {
        transform: translateY(0px) rotate(0deg);
    }
}

/* Floating animation with scale for ZRenderer images */
@keyframes floatingScaled {
    0% {
        transform: translateY(0px) rotate(0deg) scale(1.3);
    }

    25% {
        transform: translateY(-5px) rotate(1deg) scale(1.3);
    }

    50% {
        transform: translateY(-10px) rotate(0deg) scale(1.3);
    }

    75% {
        transform: translateY(-5px) rotate(-1deg) scale(1.3);
    }

    100% {
        transform: translateY(0px) rotate(0deg) scale(1.3);
    }
}

.character img {
    animation: floating 6s ease-in-out infinite;
    max-height: 160px;
    max-width: 160px;
    width: auto;
    height: auto;
    object-fit: scale-down;
    background-color: transparent;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Use scaled floating animation ONLY for real ZRenderer images (not fallback M/F copies) */
.character img[src*="cache/zrenderer"]:not([src*="fallback"]) {
    animation: floatingScaled 6s ease-in-out infinite !important;
}

/* Fallback M/F images in cache (char_XXX_fallback.png) use normal animation (no scale) */
.character img[src*="fallback.png"] {
    animation: floating 6s ease-in-out infinite !important;
}

.first-place .character img {
    animation-duration: 6s;
}

.second-place .character img {
    animation-duration: 7s;
}

.third-place .character img {
    animation-duration: 8s;
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }

    80% {
        transform: scale(1.05);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes flash {
    0% {
        background-color: #f8f8f8;
    }

    50% {
        background-color: #ffeb3b;
    }

    100% {
        background-color: #f8f8f8;
    }
}

.character:hover {
    transform: translateY(-10px);
}

.bid-animation {
    animation: popIn 0.5s ease;
}

/* Media Queries */
@media (max-width: 1200px) {
    .auction-info {
        max-width: 100%;
    }

    .chat-section {
        flex: 0 0 300px;
    }
}

@media (max-width: 1000px) {
    .auction-content {
        flex-direction: column;
    }

    .bidders-area {
        height: 500px;
    }

    .auction-info {
        padding-right: 0;
        max-width: 100%;
    }

    .chat-section {
        width: 100%;
        flex: none;
        min-height: 280px;
    }

    .first-place {
        top: 210px;
    }

    .first-place .bid-bubble {
        top: -75px;
    }

    .second-place {
        bottom: 60px;
        left: 28%;
    }

    .third-place {
        bottom: 50px;
        right: 28%;
    }
}

@media (max-width: 768px) {

    /* Container adjustments for mobile */
    .auction-container {
        border-radius: 0;
        max-width: 100%;
        width: 100%;
    }

    /* Header responsive */
    .auction-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px 15px;
        padding-left: max(15px, env(safe-area-inset-left));
        padding-right: max(15px, env(safe-area-inset-right));
        padding-top: max(12px, env(safe-area-inset-top));
        gap: 10px;
    }

    .logo {
        font-size: 18px;
        width: 100%;
    }

    #user-info {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        width: 100%;
        margin-right: 0;
    }

    #user-info #username {
        font-size: 14px;
        margin-right: 0;
        margin-bottom: 5px;
    }

    #user-info .action-btn,
    #login-btn,
    #logout-btn {
        width: 100%;
        padding: 10px 15px;
        font-size: 14px;
        text-align: center;
        margin: 0;
    }

    /* Auction content padding */
    .auction-content {
        min-height: 700px;
        padding: 15px;
        padding-left: max(15px, env(safe-area-inset-left));
        padding-right: max(15px, env(safe-area-inset-right));
    }

    /* Auction info area - fix right padding */
    .auction-info {
        padding: 15px;
        padding-left: max(15px, env(safe-area-inset-left));
        padding-right: max(15px, env(safe-area-inset-right));
    }

    /* Bidders area */
    .bidders-area {
        height: 400px;
        /* Hide podium background on mobile to show characters clearly */
        background: none;
    }

    /* Hide bidder connections on mobile */
    .bidder-connections {
        display: none;
    }

    .first-place {
        top: 180px;
        transform: translateX(-50%) scale(1.1);
    }

    .first-place .bid-bubble {
        top: -70px;
    }

    .second-place {
        bottom: 50px;
        left: 30%;
    }

    .third-place {
        bottom: 40px;
        right: 30%;
    }

    .podium {
        min-width: 100px;
        padding: 6px 8px;
    }

    .bidder-name {
        font-size: 12px;
        max-width: 110px;
    }

    /* Gold podium now uses absolute positioning - no margin override needed */

    .chat-section {
        height: 250px;
    }

    .chat-toggle-container {
        bottom: 280px;
    }

    /* Chat input area - ensure proper padding and button visibility */
    .chat-input-area {
        padding: 10px 15px;
        padding-left: max(15px, env(safe-area-inset-left));
        padding-right: max(15px, env(safe-area-inset-right));
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }

    .chat-input {
        flex: 1;
        padding: 10px 12px;
        margin-right: 8px;
        font-size: 14px;
        min-width: 0;
    }

    .send-btn {
        padding: 10px 16px;
        border-radius: 20px;
        font-size: 14px;
        white-space: nowrap;
        flex-shrink: 0;
        min-width: fit-content;
    }

    .bid-table {
        max-height: 120px;
    }

    .bid-actions {
        flex-wrap: wrap;
    }

    .action-btn {
        flex-basis: 48%;
        min-width: 0;
        font-size: 14px;
    }

    .chat-message {
        max-width: 95%;
    }

    /* Winner celebration responsive */
    .celebration-content {
        padding: 20px 15px;
        padding-left: max(15px, env(safe-area-inset-left));
        padding-right: max(15px, env(safe-area-inset-right));
        padding-bottom: max(20px, env(safe-area-inset-bottom));
        max-width: 95%;
        margin: 0 10px;
        box-sizing: border-box;
    }

    .celebration-title {
        font-size: 24px;
        margin-bottom: 15px;
    }

    .winner-name {
        font-size: 32px;
        margin-bottom: 0;
    }

    .character-portrait {
        width: 180px;
        height: 180px;
        margin: 15px auto;
    }

    .celebration-character {
        transform: scale(1.2);
        margin: 40px 0;
    }

    .celebration-content .item-preview {
        flex-direction: column;
        padding: 10px;
        margin-bottom: 20px;
    }

    .celebration-img {
        width: 100px;
        height: 100px;
        margin-right: 0;
        margin-bottom: 10px;
    }

    .celebration-content .item-details {
        text-align: center;
    }

    .celebration-content .item-details h3 {
        font-size: 18px;
    }

    .celebration-item-specs {
        font-size: 14px;
    }

    .celebration-details {
        font-size: 16px;
        margin-bottom: 20px;
    }

    .close-celebration {
        padding: 10px 24px;
        font-size: 14px;
    }

    /* Auction footer safe area */
    .auction-footer {
        padding-left: max(15px, env(safe-area-inset-left));
        padding-right: max(15px, env(safe-area-inset-right));
        padding-bottom: max(15px, env(safe-area-inset-bottom));
    }
}

/* Extra small devices (phones in portrait, less than 576px) */
@media (max-width: 576px) {
    .auction-info {
        padding: 12px;
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }

    .chat-input-area {
        padding: 8px 12px;
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }

    .send-btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    .celebration-content {
        padding: 15px 10px;
        padding-left: max(10px, env(safe-area-inset-left));
        padding-right: max(10px, env(safe-area-inset-right));
    }

    .celebration-title {
        font-size: 20px;
    }

    .winner-name {
        font-size: 28px;
    }

    .character-portrait {
        width: 150px;
        height: 150px;
    }
}

/* Character Selection Modal */
.character-selection {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
    max-height: 65vh;
    overflow-y: auto;
    padding-right: 10px;
}

.character-card {
    background-color: #fff;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.character-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.character-avatar {
    width: 120px;
    height: 120px;
    margin: 0 auto 12px;
    border-radius: 10px;
    overflow: hidden;
    background-color: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
}

.character-avatar img {
    max-width: 95%;
    height: auto;
    object-fit: contain;
    background-color: transparent;
}

.character-info {
    text-align: center;
}

.character-info h3 {
    margin: 3px 0;
    color: #333;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.character-info p {
    margin: 2px 0;
    color: #666;
    font-size: 14px;
}

.cashpoints-info {
    background-color: #f4f7ff;
    border: 1px solid #d0d8ff;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 12px;
    text-align: center;
    color: #4a4a4a;
}

.cashpoints-info.standalone {
    margin-bottom: 20px;
    padding: 12px 15px;
    font-size: 15px;
    border-left: 3px solid #7579ff;
    background-color: #f0f4ff;
}

.cashpoints-info.standalone p {
    margin: 0;
    font-size: 15px;
    line-height: 1.4;
}

.cashpoints-info p {
    margin: 0;
    font-size: 14px;
}

.points-display {
    font-weight: 600;
    color: #7579ff;
    font-size: 14px;
}

/* Modal content size adjustment for character selection */
#characterModal .modal-content {
    max-width: 900px;
    max-height: 85vh;
}

/* Style for repeated bidders in the bid history */
.repeat-bidder {
    background-color: rgba(117, 121, 255, 0.05);
}

.repeat-badge {
    display: inline-block;
    color: #7579ff;
    font-weight: bold;
    margin-left: 4px;
    font-size: 14px;
}

.own-bid {
    background-color: rgba(255, 215, 0, 0.1);
    border-left: 3px solid gold;
}

.item-data-preview {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 1rem;
    margin-top: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
}

.item-data-preview pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: monospace;
    font-size: 0.9rem;
    color: #495057;
}

#inventory-table {
    margin-top: 1rem;
}

#inventory-table th,
#inventory-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

#inventory-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

#inventory-table tr:hover {
    background-color: #f8f9fa;
}

#inventory-table .item-name {
    font-weight: 500;
}

#inventory-table .item-refine {
    color: #6c757d;
}

#inventory-table .item-cards {
    color: #dc3545;
}

#inventory-table .action-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.admin-subtitle {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-row .form-group {
    flex: 1;
}

.form-group.full-width {
    width: 100%;
}

.item-owner-info {
    margin-top: 10px;
    font-size: 14px;
    color: #7579ff;
    font-weight: 500;
}

.item-specs-info {
    font-size: 13px;
    color: #666;
    margin-top: 5px;
}

/* Chat Section Styles */
.chat-section {
    flex: 0 0 300px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 10;
    transition: all 0.3s ease-in-out;
    position: relative;
    height: 800px;
    /* Fixed height to match typical content */
    margin-top: 0;
}

.chat-header {
    background-color: #7579ff;
    color: white;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.chat-header h3 {
    margin: 0;
    font-size: 16px;
}

.toggle-chat-btn {
    background-color: transparent;
    border: none;
    color: #333;
    padding: 5px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.toggle-chat-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px 15px;
    background-color: #f8f9fa;
    min-height: 100px;
    scroll-behavior: smooth;
    /* Remove max-height to let it fill the chat-section naturally */
}

.chat-message {
    margin-bottom: 10px;
    padding: 10px 14px;
    border-radius: 18px;
    max-width: auto;
    word-wrap: break-word;
}

.chat-message.own-message {
    background-color: #e3f2fd;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.chat-message.other-message {
    background-color: #f1f1f1;
    margin-right: auto;
    border-bottom-left-radius: 4px;
}

.system-message {
    text-align: center;
    margin: 5px 0;
    padding: 4px 8px;
    background-color: rgba(76, 175, 80, 0.1);
    border-radius: 6px;
    border-left: 3px solid #4caf50;
    font-size: 11px;
}

.system-name {
    display: inline;
    color: #4caf50;
    font-weight: bold;
    font-size: 11px;
}

.system-content {
    display: inline;
    color: #4caf50;
    font-weight: bold;
    font-size: 11px;
}

.chat-sender {
    font-weight: bold;
    margin-bottom: 4px;
    font-size: 14px;
    color: #555;
}

.chat-content {
    font-size: 15px;
    line-height: 1.4;
}

.chat-timestamp {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
    text-align: right;
}

.chat-input-area {
    display: flex;
    padding: 12px;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}

.chat-input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    margin-right: 10px;
    outline: none;
    font-size: 15px;
}

.chat-input:focus {
    border-color: #7579ff;
}

.send-btn {
    background-color: #7579ff;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.send-btn:hover {
    background-color: #5a5ee5;
}

.send-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Chat controls */
.chat-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.expand-chat-btn {
    background-color: transparent;
    border: none;
    color: #333;
    padding: 5px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.expand-chat-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

/* Fullscreen chat styles */
.chat-section.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    max-width: 100%;
    margin: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    border-radius: 0;
}

.chat-section.fullscreen .chat-messages {
    flex: 1;
    height: auto;
}

.chat-section.fullscreen .chat-header {
    border-radius: 0;
}

.chat-section.fullscreen .chat-input-area {
    padding: 15px;
}

/* Add styles for character names in chat */
.chat-sender .character-name {
    color: #3e6bff;
    font-weight: bold;
    position: relative;
    padding-left: 20px;
}

.chat-sender .character-name::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%233e6bff"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1h-6v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z"/></svg>');
    background-repeat: no-repeat;
    background-size: contain;
}

.chat-sender .username {
    color: #666;
    font-weight: normal;
}

/* Staff tag base styling */
.staff-tag {
    display: inline-block;
    font-size: 9px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    border: 1px solid;
}

/* GM tag - Red/Gold gradient */
.gm-tag {
    background: linear-gradient(135deg, #FF4444, #FFD700);
    color: #FFF;
    border-color: #FF4444;
    box-shadow: 0 1px 3px rgba(255, 68, 68, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Law Enforcement tag - Blue gradient */
.law-tag {
    background: linear-gradient(135deg, #2196F3, #64B5F6);
    color: #FFF;
    border-color: #2196F3;
    box-shadow: 0 1px 3px rgba(33, 150, 243, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* VIP tag - Cyan/Turquoise gradient */
.vip-tag {
    background: linear-gradient(135deg, #00BCD4, #4DD0E1);
    color: #FFF;
    border-color: #00BCD4;
    box-shadow: 0 1px 3px rgba(0, 188, 212, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Event Manager tag - Purple gradient */
.event-tag {
    background: linear-gradient(135deg, #9C27B0, #CE93D8);
    color: #FFF;
    border-color: #9C27B0;
    box-shadow: 0 1px 3px rgba(156, 39, 176, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Script Manager tag - Green gradient */
.script-tag {
    background: linear-gradient(135deg, #4CAF50, #81C784);
    color: #FFF;
    border-color: #4CAF50;
    box-shadow: 0 1px 3px rgba(76, 175, 80, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Super Player tag - Yellow/Gold gradient */
.super-tag {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
    border-color: #FFD700;
    box-shadow: 0 1px 3px rgba(255, 215, 0, 0.4);
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.3);
}

/* Normal Player tag - Gray gradient */
.normal-tag {
    background: linear-gradient(135deg, #757575, #9E9E9E);
    color: #FFF;
    border-color: #757575;
    box-shadow: 0 1px 3px rgba(117, 117, 117, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Error highlighting for bid form */
.bid-form.error-highlight {
    border: 2px solid #ff5252;
    box-shadow: 0 0 10px rgba(255, 82, 82, 0.5);
    animation: shake 0.5s linear;
}

/* Shake animation for error state */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-5px);
    }

    40%,
    80% {
        transform: translateX(5px);
    }
}

/* Message popups */
.message-popup {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    transform: translateX(120%);
    transition: transform 0.3s ease-out;
    max-width: 350px;
    word-wrap: break-word;
}

.message-popup.visible {
    transform: translateX(0);
}

.message-popup.info {
    background: #2196F3;
    color: white;
}

.message-popup.success {
    background: #4CAF50;
    color: white;
}

.message-popup.error {
    background: #F44336;
    color: white;
}

/* Add a container for the toggle button when chat is hidden */
.chat-toggle-container {
    position: absolute;
    right: 0;
    top: 20px;
    z-index: 11;
    background-color: #7579ff;
    border-radius: 10px 0 0 10px;
    padding: 8px;
    cursor: pointer;
    transform: translateX(0);
    transition: transform 0.3s ease-in-out;
    display: none;
    /* Initially hidden */
}

.chat-toggle-container .toggle-chat-btn {
    padding: 5px 10px;
    white-space: nowrap;
}

/* Add a subtle podium effect */
.podium::before {
    content: '';
    position: absolute;
    height: 6px;
    bottom: -6px;
    left: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.03);
    border-radius: 0 0 10px 10px;
    z-index: -1;
}

/* Make the gold podium more subtle */
.gold::after {
    display: none;
    /* Hide the crown emoji */
}

/* Create a more subtle ribbon effect for first place */
.first-place .podium::before {
    display: none;
    /* Hide the ribbon/corner decoration */
}

/* Remove any bronze-specific decorations */
.bronze::before,
.bronze::after {
    display: none;
}


/* Create visual connections between bidders */
.bidder-connections {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    z-index: 0;
    overflow: hidden;
}

.connection {
    position: absolute;
    height: 2px;
    background: linear-gradient(to right, transparent, rgba(117, 121, 255, 0.3), transparent);
    bottom: 50px;
    left: 25%;
    right: 25%;
}


/* Add sparkling effects for the winner */
@keyframes sparkle {
    0% {
        opacity: 0;
        transform: scale(0);
    }

    50% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(0);
    }
}

.sparkle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle, #fff 0%, rgba(255, 215, 0, 0.8) 60%, transparent 100%);
    box-shadow: 0 0 10px 2px rgba(255, 215, 0, 0.5);
    pointer-events: none;
}

.sparkle-1 {
    top: 15%;
    left: 30%;
    animation: sparkle 3s infinite;
}

.sparkle-2 {
    top: 10%;
    right: 25%;
    animation: sparkle 4s infinite 0.5s;
}

.sparkle-3 {
    top: 40%;
    left: 20%;
    animation: sparkle 5s infinite 1s;
}

.sparkle-4 {
    top: 30%;
    right: 15%;
    animation: sparkle 3.5s infinite 1.5s;
}

.podium {
    background: linear-gradient(145deg, rgba(240, 240, 250, 0.9), rgba(220, 220, 235, 0.9));
    padding: 6px 8px;
    border-radius: 10px;
    margin-top: 2px;
    text-align: center;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    min-width: 100px;
    max-width: 120px;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(8px);
    border: 2px solid;
    border-image: linear-gradient(145deg, rgba(255, 255, 255, 0.8), rgba(200, 200, 220, 0.5), rgba(255, 255, 255, 0.8)) 1;
}

/* Winner celebration animations */
@keyframes celebrate {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(255, 215, 0, 0);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(255, 215, 0, 0);
    }
}

@keyframes confetti {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(1000%) rotate(720deg);
        opacity: 0;
    }
}

.winner-celebration {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9998;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease-in-out;
}

.winner-celebration.show {
    opacity: 1;
    pointer-events: auto;
}

.celebration-content {
    background: #fff8e1;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 90%;
    position: relative;
    animation: celebrate 2s infinite;
}

.celebration-title {
    font-size: 32px;
    font-weight: 700;
    color: #ff9800;
    margin-bottom: 20px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.winner-name {
    font-size: 48px;
    font-weight: 800;
    background: linear-gradient(45deg, #ff9800, #ff5722);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.celebration-content .item-preview {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.celebration-img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-right: 20px;
    border-radius: 10px;
    background: white;
    padding: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.celebration-content .item-details {
    text-align: left;
}

.celebration-content .item-details h3 {
    font-size: 24px;
    color: #333;
    margin-bottom: 10px;
}

.celebration-item-specs {
    color: #666;
    font-size: 16px;
    margin-bottom: 0;
}

.celebration-details {
    font-size: 18px;
    color: #666;
    margin-bottom: 30px;
}

/* Character portrait in celebration */
.character-portrait {
    width: 250px;
    height: 250px;
    margin: 20px auto 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: transparent;
}

.celebration-character {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 8px 15px rgba(0, 0, 0, 0.2));
    transform: scale(1.5);
    margin: 60px 0;
}

.close-celebration {
    background-color: #ff9800;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 20px;
}

.close-celebration:hover {
    background-color: #f57c00;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #ffeb3b;
    opacity: 0.8;
    z-index: 9997;
    animation: confetti 5s ease-in-out forwards;
}

.confetti:nth-child(odd) {
    background-color: #ff9800;
}

.confetti:nth-child(3n) {
    background-color: #4caf50;
}

.confetti:nth-child(4n) {
    background-color: #2196f3;
}

.confetti:nth-child(5n) {
    background-color: #9c27b0;
}

/* Add subtle highlight effects on hover */
.bidder:hover .podium {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Gold podium hover - simple translateY since it's relatively positioned */
.bidder:hover .gold {
    transform: translateY(-3px);
}

.bidder:hover .character {
    transform: translateY(-3px);
}

/* Add glow effect on hover to make bubbles more noticeable */
.bid-bubble:hover {
    transform: translateX(-50%) scale(0.84);
    box-shadow: 0 4px 15px rgba(117, 121, 255, 0.3);
}

.first-place .bid-bubble:hover {
    transform: translateX(-50%) scale(1.47);
    box-shadow: 0 6px 18px rgba(255, 106, 136, 0.4);
}

.second-place .bid-bubble:hover {
    transform: translateX(-50%) scale(1.05);
}

.third-place .bid-bubble:hover {
    transform: translateX(-50%) scale(0.945);
}

/* Guild emblem styling */
.guild-info {
    display: flex;
    align-items: center;
    margin-top: 2px;
}

.guild-emblem {
    width: 16px;
    height: 16px;
    margin-right: 3px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background-color: rgba(0, 0, 0, 0.2);
    object-fit: contain;
}

.guild {
    flex: 1;
    font-size: 0.75rem;
    opacity: 0.8;
}

@keyframes rankChanged {
    0% {
        transform: translateY(0) scale(1) rotate(0deg);
        filter: brightness(1);
    }

    20% {
        transform: translateY(-40px) scale(1.2) rotate(-5deg);
        filter: brightness(1.3) drop-shadow(0 0 15px rgba(255, 215, 0, 0.7));
    }

    40% {
        transform: translateY(-20px) scale(1.15) rotate(5deg);
        filter: brightness(1.2) drop-shadow(0 0 10px rgba(255, 215, 0, 0.6));
    }

    60% {
        transform: translateY(-30px) scale(1.1) rotate(-3deg);
        filter: brightness(1.1) drop-shadow(0 0 8px rgba(255, 215, 0, 0.5));
    }

    80% {
        transform: translateY(-10px) scale(1.05) rotate(2deg);
        filter: brightness(1.05) drop-shadow(0 0 5px rgba(255, 215, 0, 0.3));
    }

    100% {
        transform: translateY(0) scale(1) rotate(0deg);
        filter: brightness(1);
    }
}

.rank-changed .character {
    animation: rankChanged 1.5s ease-out;
}

.rank-changed .character::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    right: 0;
    height: 10px;
    background: radial-gradient(ellipse at center, rgba(255, 215, 0, 0.6) 0%, rgba(255, 215, 0, 0) 70%);
    border-radius: 50%;
    opacity: 0;
    animation: rankChangedShadow 1.5s ease-out;
}

@keyframes rankChangedShadow {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    30% {
        opacity: 1;
        transform: scale(1.5);
    }

    100% {
        opacity: 0;
        transform: scale(0.5);
    }
}

.rank-changed.move-up .character {
    animation: rankChangedUp 1.5s ease-out;
}

.rank-changed.move-down .character {
    animation: rankChangedDown 1.5s ease-out;
}

@keyframes rankChangedUp {
    0% {
        transform: translateY(0) scale(1) rotate(0deg);
        filter: brightness(1);
    }

    20% {
        transform: translateY(-60px) scale(1.3) rotate(-8deg);
        filter: brightness(1.4) drop-shadow(0 0 20px rgba(255, 215, 0, 0.8));
    }

    40% {
        transform: translateY(-30px) scale(1.2) rotate(5deg);
        filter: brightness(1.3) drop-shadow(0 0 15px rgba(255, 215, 0, 0.7));
    }

    60% {
        transform: translateY(-40px) scale(1.15) rotate(-3deg);
        filter: brightness(1.2) drop-shadow(0 0 10px rgba(255, 215, 0, 0.6));
    }

    80% {
        transform: translateY(-15px) scale(1.05) rotate(2deg);
        filter: brightness(1.1) drop-shadow(0 0 5px rgba(255, 215, 0, 0.4));
    }

    100% {
        transform: translateY(0) scale(1) rotate(0deg);
        filter: brightness(1);
    }
}

@keyframes rankChangedDown {
    0% {
        transform: translateY(0) scale(1) rotate(0deg);
        filter: brightness(1);
    }

    15% {
        transform: translateY(30px) scale(0.9) rotate(5deg);
        filter: brightness(0.9);
    }

    30% {
        transform: translateY(-20px) scale(1.1) rotate(-3deg);
        filter: brightness(1.1);
    }

    45% {
        transform: translateY(10px) scale(0.95) rotate(2deg);
        filter: brightness(0.95);
    }

    60% {
        transform: translateY(-10px) scale(1.05) rotate(-1deg);
        filter: brightness(1.05);
    }

    75% {
        transform: translateY(5px) scale(0.98) rotate(1deg);
        filter: brightness(0.98);
    }

    100% {
        transform: translateY(0) scale(1) rotate(0deg);
        filter: brightness(1);
    }
}

.rank-change-splash {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    border-radius: 50%;
    pointer-events: none;
    animation: splash 1.2s ease-out forwards;
}

@keyframes splash {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.8);
        opacity: 1;
    }

    100% {
        box-shadow: 0 0 0 100px rgba(255, 215, 0, 0);
        opacity: 0;
    }
}

/* Scheduled Auction Status */
.auction-status.scheduled {
    background-color: #ffa500;
    color: white;
    font-weight: bold;
    padding: 8px 16px;
    border-radius: 20px;
    animation: pulse-orange 2s infinite;
}

@keyframes pulse-orange {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Bid History Scrollable */
#bid-history {
    max-height: 300px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

/* Smooth scrollbar styling for bid history */
#bid-history::-webkit-scrollbar {
    width: 8px;
}

#bid-history::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#bid-history::-webkit-scrollbar-thumb {
    background: #7579ff;
    border-radius: 4px;
}

#bid-history::-webkit-scrollbar-thumb:hover {
    background: #5559cc;
}

/* Chat scrollbar styling */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #7579ff;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #5559cc;
}