body {
    margin: 0;
    background-color: #f0f0f0;
    overflow: hidden;
    font-family: 'Nunito Sans', sans-serif;
}

/* ===========================
   Loading Screen
   =========================== */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

#loading-screen.hidden {
    display: none;
}

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

/* 3D Cube Stack Container */
.cube-stack-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 30px;
}

.cube-stack {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transform: rotateX(-25deg) rotateY(-40deg);
}

/* Cube size and gap */
:root {
    --cube-size: 40px;
    --cube-gap: 2px;
    --cube-total: 42px; /* cube-size + gap */
}

/* Individual Loading Cubes */
.loading-cube {
    position: absolute;
    width: var(--cube-size);
    height: var(--cube-size);
    left: 50%;
    top: 50%;
    transform-style: preserve-3d;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Cube faces */
.cube-face {
    position: absolute;
    width: var(--cube-size);
    height: var(--cube-size);
}

.cube-face.front {
    transform: translateZ(calc(var(--cube-size) / 2));
    box-shadow: inset 0 0 8px rgba(255,255,255,0.3);
}

.cube-face.back {
    transform: translateZ(calc(var(--cube-size) / -2)) rotateY(180deg);
}

.cube-face.top {
    transform: rotateX(90deg) translateZ(calc(var(--cube-size) / 2));
    box-shadow: inset 0 0 12px rgba(255,255,255,0.4);
}

.cube-face.bottom {
    transform: rotateX(-90deg) translateZ(calc(var(--cube-size) / 2));
}

.cube-face.left {
    transform: rotateY(-90deg) translateZ(calc(var(--cube-size) / 2));
}

.cube-face.right {
    transform: rotateY(90deg) translateZ(calc(var(--cube-size) / 2));
    box-shadow: inset 0 0 8px rgba(255,255,255,0.25);
}

/* Cube 0 - Red */
.cube-0 { --offset-x: -0.5; --offset-y: 0; --offset-z: -0.5; }
.cube-0 .front { background: #dc2626; }
.cube-0 .back { background: #991b1b; }
.cube-0 .top { background: #ef4444; }
.cube-0 .bottom { background: #7f1d1d; }
.cube-0 .left { background: #b91c1c; }
.cube-0 .right { background: #f87171; }

/* Cube 1 - Orange */
.cube-1 { --offset-x: 0.5; --offset-y: 0; --offset-z: -0.5; }
.cube-1 .front { background: #ea580c; }
.cube-1 .back { background: #9a3412; }
.cube-1 .top { background: #f97316; }
.cube-1 .bottom { background: #7c2d12; }
.cube-1 .left { background: #c2410c; }
.cube-1 .right { background: #fb923c; }

/* Cube 2 - Yellow */
.cube-2 { --offset-x: -0.5; --offset-y: 0; --offset-z: 0.5; }
.cube-2 .front { background: #ca8a04; }
.cube-2 .back { background: #854d0e; }
.cube-2 .top { background: #eab308; }
.cube-2 .bottom { background: #713f12; }
.cube-2 .left { background: #a16207; }
.cube-2 .right { background: #facc15; }

/* Cube 3 - Green */
.cube-3 { --offset-x: 0.5; --offset-y: 0; --offset-z: 0.5; }
.cube-3 .front { background: #16a34a; }
.cube-3 .back { background: #166534; }
.cube-3 .top { background: #22c55e; }
.cube-3 .bottom { background: #14532d; }
.cube-3 .left { background: #15803d; }
.cube-3 .right { background: #4ade80; }

/* Cube 4 - Blue */
.cube-4 { --offset-x: -0.5; --offset-y: 1; --offset-z: -0.5; }
.cube-4 .front { background: #2563eb; }
.cube-4 .back { background: #1e40af; }
.cube-4 .top { background: #3b82f6; }
.cube-4 .bottom { background: #1e3a8a; }
.cube-4 .left { background: #1d4ed8; }
.cube-4 .right { background: #60a5fa; }

/* Cube 5 - Purple */
.cube-5 { --offset-x: 0.5; --offset-y: 1; --offset-z: -0.5; }
.cube-5 .front { background: #7c3aed; }
.cube-5 .back { background: #5b21b6; }
.cube-5 .top { background: #8b5cf6; }
.cube-5 .bottom { background: #4c1d95; }
.cube-5 .left { background: #6d28d9; }
.cube-5 .right { background: #a78bfa; }

/* Cube 6 - Pink */
.cube-6 { --offset-x: -0.5; --offset-y: 1; --offset-z: 0.5; }
.cube-6 .front { background: #db2777; }
.cube-6 .back { background: #9d174d; }
.cube-6 .top { background: #ec4899; }
.cube-6 .bottom { background: #831843; }
.cube-6 .left { background: #be185d; }
.cube-6 .right { background: #f472b6; }

/* Cube 7 - Teal */
.cube-7 { --offset-x: 0.5; --offset-y: 1; --offset-z: 0.5; }
.cube-7 .front { background: #0d9488; }
.cube-7 .back { background: #115e59; }
.cube-7 .top { background: #14b8a6; }
.cube-7 .bottom { background: #134e4a; }
.cube-7 .left { background: #0f766e; }
.cube-7 .right { background: #2dd4bf; }

/* Cube 8 - Rose */
.cube-8 { --offset-x: -0.5; --offset-y: 2; --offset-z: -0.5; }
.cube-8 .front { background: #e11d48; }
.cube-8 .back { background: #9f1239; }
.cube-8 .top { background: #f43f5e; }
.cube-8 .bottom { background: #881337; }
.cube-8 .left { background: #be123c; }
.cube-8 .right { background: #fb7185; }

/* Cube 9 - Cyan */
.cube-9 { --offset-x: 0.5; --offset-y: 2; --offset-z: -0.5; }
.cube-9 .front { background: #0891b2; }
.cube-9 .back { background: #155e75; }
.cube-9 .top { background: #06b6d4; }
.cube-9 .bottom { background: #164e63; }
.cube-9 .left { background: #0e7490; }
.cube-9 .right { background: #22d3ee; }

/* Cube 10 - Lime */
.cube-10 { --offset-x: -0.5; --offset-y: 2; --offset-z: 0.5; }
.cube-10 .front { background: #65a30d; }
.cube-10 .back { background: #3f6212; }
.cube-10 .top { background: #84cc16; }
.cube-10 .bottom { background: #365314; }
.cube-10 .left { background: #4d7c0f; }
.cube-10 .right { background: #a3e635; }

/* Cube 11 - Fuchsia */
.cube-11 { --offset-x: 0.5; --offset-y: 2; --offset-z: 0.5; }
.cube-11 .front { background: #9333ea; }
.cube-11 .back { background: #6b21a8; }
.cube-11 .top { background: #a855f7; }
.cube-11 .bottom { background: #581c87; }
.cube-11 .left { background: #7e22ce; }
.cube-11 .right { background: #c084fc; }

/* Active state - cube visible and in position */
.loading-cube.active {
    opacity: 1;
}

/* Floor shadow */
.cube-shadow {
    position: absolute;
    width: 180px;
    height: 180px;
    background: radial-gradient(ellipse, rgba(0, 0, 0, 0.15) 0%, transparent 70%);
    transform: rotateX(90deg) translateZ(-80px);
    filter: blur(15px);
    left: 50%;
    top: 50%;
    margin-left: -90px;
    margin-top: -90px;
}

/* Loading Text */
.loading-text {
    color: #333;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
    100% { content: ''; }
}

/* Progress Bar */
.loading-progress {
    width: 250px;
    margin: 0 auto;
}

.progress-bar {
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899);
    background-size: 200% 100%;
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
    animation: shimmer 2s linear infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.progress-text {
    color: rgba(0, 0, 0, 0.5);
    font-size: 14px;
    font-family: 'Courier New', monospace;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .loading-cube {
        transition: opacity 0.2s;
    }
    .loading-dots::after {
        animation: none;
        content: '...';
    }
    .progress-fill {
        animation: none;
    }
}

/* Header Bar */
.header-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50px;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 100;
    box-sizing: border-box;
}

/* Footer Bar */
.footer-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: row;
    /* Changed to row */
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    z-index: 100;
    box-sizing: border-box;
    height: 60px;
    /* Fixed height */
    overflow-x: auto;
    /* Allow scroll on very small screens */
}

/* Tool Buttons */
.tool-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.tool-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #ccc;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    font-size: 16px;
    transition: all 0.2s;
}

.tool-btn:hover {
    background: #eee;
}

.tool-btn.active {
    background: #ddd;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    border-color: #999;
}

.tool-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Coming Soon Button */
.tool-btn.coming-soon-btn {
    position: relative;
    opacity: 0.6;
    cursor: pointer;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    border: 1px dashed #aaa;
}

.tool-btn.coming-soon-btn:hover {
    opacity: 0.8;
    background: linear-gradient(135deg, #e8e8e8 0%, #d5d5d5 100%);
    border-color: #888;
}

.tool-btn.coming-soon-btn i {
    color: #888;
}

/* Coming Soon Tooltip */
#coming-soon-tooltip {
    position: fixed;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    transform: translateY(5px);
    text-align: center;
    pointer-events: none;
    white-space: nowrap;
}

#coming-soon-tooltip::before {
    content: '🚀';
    margin-right: 8px;
}

#coming-soon-tooltip::after {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-bottom-color: #667eea;
    border-top: none;
}

#coming-soon-tooltip.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Color Palette (Footer) */
.palette-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    margin-bottom: 8px;
}

.palette-color {
    width: 25px;
    height: 25px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    cursor: pointer;
    border-radius: 2px;
    transition: transform 0.1s;
}

.palette-color:hover {
    transform: scale(1.1);
    z-index: 1;
}

.palette-color.active {
    border: 2px solid #000;
    transform: scale(1.1);
    z-index: 1;
}

/* Info & Status */
.status-info {
    font-size: 12px;
    color: #666;
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Auth Buttons */
.auth-btn {
    background: #333;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
    font-family: 'Nunito Sans', sans-serif;
}

.auth-btn:hover {
    background: #555;
}

/* Side Panel Removed */

/* High Value Indicator */
#high-value-indicator {
    display: none;
    /* Managed by JS */
    align-items: center;
    gap: 6px;
    background: rgba(255, 215, 0, 0.1);
    padding: 0 12px;
    height: 36px;
    border-radius: 18px;
    border: 1px solid rgba(255, 215, 0, 0.4);
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    margin: 0 auto;
}

#high-value-indicator:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: scale(1.02);
}

.trophy-icon {
    font-size: 16px;
}

.hv-label {
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
    margin-right: 2px;
    font-weight: bold;
}

.hv-price {
    font-size: 14px;
    font-weight: bold;
    color: #d4af37;
}

.hv-owner {
    font-size: 11px;
    color: #999;
}

@media (max-width: 600px) {
    #high-value-indicator {
        padding: 0 8px;
    }

    .hv-label {
        display: none;
    }

    .hv-owner {
        display: none;
    }
}

/* Ranking Header */
#header-ranking {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: 15px;
    margin-right: auto;
    /* Push remaining items to right */
    overflow: hidden;
}

/* Ranking Tabs */
.ranking-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 15px;
    margin-right: auto;
}

.ranking-tabs {
    display: flex;
    gap: 2px;
    background: #eee;
    padding: 2px;
    border-radius: 14px;
}

.ranking-tab {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    transition: all 0.2s;
    font-weight: bold;
}

.ranking-tab:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #555;
}

.ranking-tab.active {
    background: white;
    color: #333;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Adjust existing ranking header margin */
#header-ranking {
    margin-left: 0;
    /* Reset margin as it's now inside container */
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #555;
    background: rgba(255, 255, 255, 0.5);
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid #eee;
    white-space: nowrap;
}

.ranking-rank {
    font-weight: bold;
    color: #333;
    background: #ffd700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
}

.ranking-item:nth-child(2) .ranking-rank {
    background: #c0c0c0;
    /* Silver */
}

.ranking-item:nth-child(3) .ranking-rank {
    background: #cd7f32;
    /* Bronze */
}

.ranking-name {
    font-weight: 600;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ranking-price {
    color: #d4af37;
    font-weight: bold;
}

@media (max-width: 900px) {
    #header-ranking {
        display: none;
    }
}

/* Dialogs */
.modal-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 200;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
}

.modal-overlay.active {
    display: flex;
}

.dialog-content {
    background: rgba(255, 255, 255, 0.98);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 320px;
    max-width: 90%;
    text-align: center;
}

/* Face Grid */
.face-grid {
    display: grid;
    grid-template-columns: 50px 50px 50px;
    grid-template-rows: 50px 50px 50px;
    gap: 4px;
    justify-content: center;
    margin-bottom: 15px;
}

.face-cell {
    width: 50px;
    height: 50px;
    background-color: #eee;
    border: 1px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    background-size: cover;
}

.face-top {
    grid-column: 2;
    grid-row: 1;
}

.face-left {
    grid-column: 1;
    grid-row: 2;
}

.face-front {
    grid-column: 2;
    grid-row: 2;
}

.face-right {
    grid-column: 3;
    grid-row: 2;
}

.face-back {
    grid-column: 2;
    grid-row: 3;
}

/* Controls (Bottom Left) - REMOVED */


/* Tooltip */
#tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    /* Default none, auto when pinned */
    display: none;
    z-index: 150;
}

/* Mobile */
@media (max-width: 600px) {
    .header-bar {
        padding: 0 8px;
    }

    .footer-bar {
        padding: 8px;
    }

    .palette-color {
        width: 20px;
        height: 20px;
    }

    #side-panel {
        display: none !important;
    }
}

/* Language Dropdown */
.lang-dropdown {
    position: relative;
    display: inline-block;
}

.lang-btn {
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    height: 28px;
    box-sizing: border-box;
}

.lang-btn:hover {
    background-color: #f9f9f9;
}

.lang-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 200;
    min-width: 80px;
    margin-top: 4px;
}

.lang-menu.show {
    display: block;
}

.lang-option {
    padding: 6px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.lang-option:hover {
    background-color: #f0f0f0;
}

.lang-flag {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border: 1px solid #eee;
}

/* Footer Redesign - Single Row */
/* Removed old row classes */

/* Face Selector */
.face-selector {
    display: flex;
    gap: 2px;
    background: #eee;
    padding: 2px;
    border-radius: 4px;
}

.face-btn {
    border: 1px solid transparent;
    background: white;
    padding: 4px 8px;
    font-size: 10px;
    cursor: pointer;
    border-radius: 2px;
    color: #555;
    min-width: 40px;
    transition: all 0.2s;
}

.face-btn:hover {
    background: #f5f5f5;
}

.face-btn.active {
    background: #333;
    color: white;
    border-color: #333;
}

/* Footer Palette */
.palette-container-footer {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    max-width: 200px;
    padding: 2px;
    background: #f9f9f9;
    border-radius: 4px;
    /* Hide scrollbar */
    scrollbar-width: none;
}

.palette-container-footer::-webkit-scrollbar {
    display: none;
}

.style-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.small-btn {
    width: 28px;
    height: 28px;
    font-size: 12px;
}

/* Inputs */
.input-group {
    display: flex;
    gap: 5px;
}

.footer-input {
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    font-family: 'Nunito Sans', sans-serif;
}

#footer-link-name {
    width: 100px;
}

#footer-link-url {
    width: 120px;
}

.price-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: bold;
    color: #555;
    background: #f9f9f9;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid #eee;
}

.price-field {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.price-label {
    font-size: 9px;
    color: #888;
    text-transform: uppercase;
    line-height: 1;
    margin-bottom: 2px;
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 2px;
}

.price-input {
    text-align: right;
    width: 60px;
    border: none;
    background: transparent;
    font-weight: bold;
    font-size: 14px;
    padding: 0;
}

.price-input:focus {
    outline: none;
    background: #fff;
}

.price-separator {
    width: 1px;
    height: 24px;
    background: #ddd;
    margin: 0 4px;
}

.total-display {
    font-size: 16px;
    color: #333;
    font-weight: 800;
}

.currency-sym {
    font-size: 0.9em;
}

.help-icon-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    margin-left: 4px;
}

.help-icon-btn:hover {
    color: #555;
}

/* Price Rules Modal Content */
#price-rules-modal .modal-body ul {
    padding-left: 20px;
    margin: 5px 0 15px 0;
    font-size: 13px;
    color: #555;
}

#price-rules-modal .modal-body p {
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.4;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 5px;
}

.cancel-btn {
    background: #999;
}

.cancel-btn:hover {
    background: #777;
}

.confirm-btn {
    background: #4caf50;
}

.confirm-btn:hover {
    background: #43a047;
}

.placement-info {
    font-size: 10px;
    color: #666;
    font-family: monospace;
    background: #eee;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Mobile Adjustments for Footer */
@media (max-width: 600px) {
    .footer-bar {
        padding: 8px 4px;
    }

    .footer-row-appearance {
        flex-wrap: wrap;
        justify-content: center;
    }

    .face-btn {
        min-width: 30px;
        padding: 4px;
    }

    .footer-row-actions {
        gap: 5px;
    }

    #footer-link-name,
    #footer-link-url {
        width: 80px;
    }

    .palette-container-footer {
        max-width: 150px;
    }
}

/* Info Dialog */
#info-dialog ul {
    padding-left: 20px;
    margin: 10px 0;
}

#info-dialog li {
    margin-bottom: 5px;
}

#info-dialog a {
    color: #333;
    text-decoration: underline;
}

#info-dialog a:hover {
    color: #000;
}

/* Inventory Modal Styles */
.inventory-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 5px;
    margin-top: 10px;
    background: #f9f9f9;
}

.inventory-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.inventory-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    background: white;
    margin-bottom: 4px;
    border-radius: 4px;
}

.inventory-item:last-child {
    margin-bottom: 0;
}

.inventory-item:hover {
    background: #f0f0f0;
}

.item-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.item-id {
    font-size: 11px;
    color: #666;
}

.item-price {
    font-weight: bold;
    color: #333;

    /* Notification System */
    #notification-container {
        position: fixed;
        top: 60px;
        /* Below header */
        right: 20px;
        z-index: 1000;
        display: flex;
        flex-direction: column;
        gap: 10px;
        pointer-events: none;
        /* Let clicks pass through container area */
    }

    .notification {
        background: white;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        border-radius: 8px;
        padding: 12px 16px;
        min-width: 250px;
        display: flex;
        align-items: center;
        gap: 12px;
        transform: translateX(120%);
        transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
        pointer-events: auto;
        /* Re-enable clicks on notifications */
        border-left: 4px solid #ccc;
        font-size: 13px;
        color: #333;
    }

    .notification.show {
        transform: translateX(0);
    }

    .notification-info {
        border-left-color: #2196F3;
    }

    .notification-success {
        border-left-color: #4CAF50;
    }

    .notification-error {
        border-left-color: #F44336;
    }

    .notification-king {
        border-left-color: #FFD700;
        background: #fffdf0;
    }

    .notification i {
        font-size: 16px;
    }

    .notification-info i {
        color: #2196F3;
    }

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

    .notification-error i {
        color: #F44336;
    }

    .notification-king i {
        color: #FFD700;
    }

    .notification-close {
        margin-left: auto;
        background: none;
        border: none;
        font-size: 18px;
        color: #999;
        cursor: pointer;
        line-height: 1;
        padding: 0;
    }

    .notification-close:hover {
        color: #555;
    }
}

.locate-btn {
    background: none;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #555;
    transition: all 0.2s;
}

.locate-btn:hover {
    background: #333;
    color: white;
    border-color: #333;
}

/* Kings Modal Styles */
.kings-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.king-item {
    display: flex;
    align-items: center;
    padding: 10px;
    background: white;
    border-radius: 8px;
    border: 1px solid #eee;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.king-tier-badge {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
    color: #555;
    margin-right: 15px;
    border: 2px solid #ddd;
    flex-shrink: 0;
    text-align: center;
    line-height: 1.2;
}

.king-tier-badge.tier-1k {
    border-color: #cd7f32;
    color: #cd7f32;
    background: #fff8e1;
}

/* Bronze-ish */
.king-tier-badge.tier-5k {
    border-color: #c0c0c0;
    color: #777;
    background: #f5f5f5;
}

/* Silver-ish */
.king-tier-badge.tier-10k {
    border-color: #ffd700;
    color: #d4af37;
    background: #fffde7;
}

/* Gold-ish */
.king-tier-badge.tier-all {
    border-color: #e91e63;
    color: #e91e63;
    background: #fce4ec;
}

/* Special */

.king-info {
    flex-grow: 1;
}

.king-name {
    font-weight: bold;
    font-size: 14px;
    color: #333;
}

.king-price {
    font-size: 12px;
    color: #666;
}

.king-coords {
    font-size: 11px;
    color: #999;
}

/* Currency Selector */
.currency-selector {
    display: flex;
    align-items: center;
}

.currency-select {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 11px;
    font-family: 'Nunito Sans', sans-serif;
    background: white;
    cursor: pointer;
    color: #555;
    font-weight: bold;
}

.currency-select:focus {
    outline: none;
    border-color: #999;
}

.currency-select option {
    font-size: 12px;
}

/* Purchase Button Styles */
.purchase-btn {
    background: linear-gradient(135deg, #4caf50, #388e3c);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 80px;
    padding: 8px 16px;
    font-weight: bold;
    transition: all 0.2s;
}

.purchase-btn:hover {
    background: linear-gradient(135deg, #43a047, #2e7d32);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
}

.purchase-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.purchase-btn .btn-spinner {
    display: none;
}

.purchase-btn.loading .btn-text {
    display: none;
}

.purchase-btn.loading .btn-spinner {
    display: inline-flex !important;
}

.purchase-btn .btn-spinner i {
    font-size: 14px;
}

/* Payment Processing Overlay */
.payment-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.payment-overlay-content {
    background: white;
    padding: 30px 40px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.payment-overlay h3 {
    margin: 0 0 15px 0;
    color: #333;
}

.payment-overlay .spinner {
    font-size: 32px;
    color: #4caf50;
    margin-bottom: 15px;
}

.payment-overlay p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* Mobile Adjustments for Currency Selector */
@media (max-width: 600px) {
    .currency-selector {
        display: none;
    }
}

/* CNY Payment Method Selector */
.cny-payment-method {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cny-payment-method label {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
}

#cny-payment-select {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    background: white;
    color: #333;
    font-size: 14px;
    cursor: pointer;
}

#cny-payment-select:hover {
    border-color: #999;
}

#cny-payment-select:focus {
    outline: none;
    border-color: #4caf50;
}

/* WeChat Pay QR Modal */
.wechat-modal {
    text-align: center;
}

#qr-code-container {
    padding: 20px;
    background: white;
    border-radius: 8px;
    margin: 15px 0;
    border: 1px solid #eee;
}

#wechat-qr-img {
    max-width: 200px;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Conflict Popup - appears at 3D cube position with countdown timer */
.conflict-popup {
    position: fixed;
    background: rgba(244, 67, 54, 0.95);
    color: white;
    min-width: 48px;
    padding: 8px 12px;
    border-radius: 24px;
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(244, 67, 54, 0.5), 0 0 0 4px rgba(244, 67, 54, 0.2);
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.conflict-popup.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    animation: pulse-conflict 1.5s ease-in-out infinite;
}

.conflict-popup .conflict-icon {
    font-size: 20px;
    line-height: 1;
}

.conflict-popup .conflict-timer {
    font-size: 12px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    line-height: 1;
}

@keyframes pulse-conflict {

    0%,
    100% {
        box-shadow: 0 4px 20px rgba(244, 67, 54, 0.5), 0 0 0 4px rgba(244, 67, 54, 0.2);
    }

    50% {
        box-shadow: 0 4px 25px rgba(244, 67, 54, 0.7), 0 0 0 8px rgba(244, 67, 54, 0.1);
    }
}

/* ===========================
   King Celebration Modal
   =========================== */

.celebration-overlay {
    background: rgba(0, 0, 0, 0.85);
}

.celebration-overlay:not(.active) {
    display: none;
}

.celebration-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.celebration-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #1a1a2e 100%);
    border: 2px solid #FFD700;
    border-radius: 20px;
    padding: 40px 50px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 60px rgba(255, 215, 0, 0.3),
                0 0 100px rgba(255, 215, 0, 0.1);
    transform: scale(0.8);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.celebration-content.animate {
    transform: scale(1);
    opacity: 1;
}

.celebration-content::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    animation: celebrate-rotate 4s linear infinite;
}

@keyframes celebrate-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.celebration-trophy {
    font-size: 80px;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
    animation: trophy-bounce 1s ease-in-out infinite;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
}

@keyframes trophy-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.celebration-title {
    font-size: 28px;
    font-weight: bold;
    color: #FFD700;
    margin: 0 0 10px 0;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 10px rgba(255, 215, 0, 0.5);
}

.celebration-subtitle {
    font-size: 18px;
    color: #fff;
    margin: 0 0 20px 0;
    position: relative;
    z-index: 1;
    opacity: 0.9;
}

.celebration-price {
    font-size: 36px;
    font-weight: bold;
    color: #FFD700;
    margin-bottom: 25px;
    position: relative;
    z-index: 1;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.twitter-btn {
    background: #000;
    color: #fff;
}

.twitter-btn:hover {
    background: #333;
    transform: scale(1.05);
}

.celebration-close-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.7);
    padding: 10px 30px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    position: relative;
    z-index: 1;
    transition: all 0.2s;
}

.celebration-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .celebration-content {
        padding: 30px 25px;
    }

    .celebration-trophy {
        font-size: 60px;
    }

    .celebration-title {
        font-size: 22px;
    }

    .celebration-subtitle {
        font-size: 14px;
    }

    .celebration-price {
        font-size: 28px;
    }

    .share-btn {
        padding: 10px 20px;
        font-size: 13px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .celebration-content::before {
        animation: none;
    }

    .celebration-trophy {
        animation: none;
    }

    .celebration-content {
        transition: opacity 0.2s;
        transform: scale(1);
    }
}