        body {
            font-family: 'Plus Jakarta Sans', sans-serif;
            background-color: #020617;
            background-image: 
                radial-gradient(at 0% 0%, rgba(34, 211, 238, 0.15) 0px, transparent 50%),
                radial-gradient(at 100% 100%, rgba(59, 130, 246, 0.15) 0px, transparent 50%);
            color: #f8fafc;
            min-height: 100vh;
            margin: 0;
            overflow-x: hidden;
        }
        @keyframes rainbowBorder {
            0% { border-color: #ff0000; box-shadow: 0 0 16px rgba(255, 0, 0, 0.7), 0 0 32px rgba(255, 0, 0, 0.4); }
            16.67% { border-color: #ff7f00; box-shadow: 0 0 16px rgba(255, 127, 0, 0.7), 0 0 32px rgba(255, 127, 0, 0.4); }
            33.33% { border-color: #ffff00; box-shadow: 0 0 16px rgba(255, 255, 0, 0.7), 0 0 32px rgba(255, 255, 0, 0.4); }
            50% { border-color: #00ff00; box-shadow: 0 0 16px rgba(0, 255, 0, 0.7), 0 0 32px rgba(0, 255, 0, 0.4); }
            66.67% { border-color: #0000ff; box-shadow: 0 0 16px rgba(0, 0, 255, 0.7), 0 0 32px rgba(0, 0, 255, 0.4); }
            83.33% { border-color: #4b0082; box-shadow: 0 0 16px rgba(75, 0, 130, 0.7), 0 0 32px rgba(75, 0, 130, 0.4); }
            100% { border-color: #ff0000; box-shadow: 0 0 16px rgba(255, 0, 0, 0.7), 0 0 32px rgba(255, 0, 0, 0.4); }
        }
        .rainbow-border {
            animation: rainbowBorder 6s linear infinite;
            max-height: 90vh;
            max-width: min(90vh, 90vw);
            aspect-ratio: 1/1;
        }

        body.game-active { overflow: hidden !important; height: 100vh; }

        .glass-card {
            background: rgba(15, 23, 42, 0.6);
            backdrop-filter: blur(12px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 1.5rem;
            box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
        }

        .login-input {
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            color: white;
            transition: all 0.3s;
        }

        .login-input:focus {
            border-color: #22d3ee;
            background: rgba(255, 255, 255, 0.1);
            outline: none;
            box-shadow: 0 0 15px rgba(34, 211, 238, 0.2);
        }

        .play-button {
            background: linear-gradient(135deg, #22d3ee 0%, #0ea5e9 100%);
            color: #020617;
            font-weight: 800;
            text-transform: uppercase;
            box-shadow: 0 0 20px rgba(34, 211, 238, 0.3);
            transition: all 0.3s;
        }

        .play-button:hover:not(:disabled) {
            transform: translateY(-2px);
            box-shadow: 0 5px 25px rgba(34, 211, 238, 0.5);
        }

        .game-full-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            background: #020617;
            z-index: 9999;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .pipe-grid {
            display: grid;
            background: #000;
            padding: 10px;
            border: none;
            border-radius: 0;
            width: 100%;
            height: 100%;
            aspect-ratio: 1/1;
            gap: 0;
        }

        .pipe-cell {
            aspect-ratio: 1/1;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            background: #0a0f1e;
            border: 1px solid rgba(255,255,255,0.02);
            transition: all 0.2s;
        }

        .pipe-cell.is-dirt {
            background-color: #3e2723;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3E%3Cpath fill='%235d4037' fill-opacity='0.4' d='M1 3h1v1H1V3zm2-2h1v1H2V1z'%3E%3C/path%3E%3C/svg%3E");
        }

        .hint-flash {
            z-index: 40;
            animation: border-flash-animation 1s ease-in-out 3;
        }

        @keyframes border-flash-animation {
            0%, 100% { outline: 0px solid transparent; box-shadow: none; }
            50% { 
                outline: 2px solid #f59e0b; 
                outline-offset: -2px;
                background-color: rgba(245, 158, 11, 0.2); 
                box-shadow: inset 0 0 10px #f59e0b; 
            }
        }
        
        .tutorial-highlight {
            outline: 4px solid #f59e0b;
            outline-offset: -4px;
            z-index: 50;
            animation: pulse-border 1.2s infinite;
        }

        @keyframes pulse-border {
            0% { outline-color: #f59e0b; transform: scale(1); }
            50% { outline-color: #fbbf24; transform: scale(1.05); }
            100% { outline-color: #f59e0b; transform: scale(1); }
        }

        .pipe-svg { width: 100%; height: 100%; transition: transform 0.2s ease; }
        .pipe-active { stroke: #22d3ee; filter: drop-shadow(0 0 8px #22d3ee); stroke-width: 28; stroke-linecap: round; }
        .pipe-inactive { stroke: #1e293b; stroke-width: 24; stroke-linecap: round; }
        
.source-valve-rotating {
    display: inline-block;
    /* Animation xoay */
    animation: valve-spin 2s linear infinite;
    
    /* ĐẢM BẢO CÁC DÒNG NÀY CÓ MẶT */
    transform-origin: center !important;
    transform-box: fill-box !important; 
}

@keyframes valve-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}
        .coin-float {
            position: absolute;
            width: 45%;
            height: 45%;
            z-index: 20;
            animation: bounce 2s infinite ease-in-out;
            pointer-events: none;
        }

        @keyframes bounce {
            0%, 100% { transform: translateY(0) scale(1); }
            50% { transform: translateY(-5px) scale(1.1); }
        }

        @keyframes flow { to { stroke-dashoffset: -40; } }
        .flowing { stroke-dasharray: 20, 15; animation: flow 1s linear infinite; }

        @keyframes valve-rotate {
            from { transform: rotate(0deg); }
            to { transform: rotate(1080deg); }
        }
        .sink-valve-active {
            animation: valve-rotate 2s cubic-bezier(0.45, 0, 0.55, 1) forwards;
            transform-origin: center;
        }

        .toast-container {
            position: fixed;
            top: 40px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 100000;
            pointer-events: none;
        }
        .toast {
            padding: 1rem 2rem;
            border-radius: 1rem;
            font-weight: 800;
            box-shadow: 0 10px 25px rgba(0,0,0,0.5);
            animation: toast-in 0.3s ease-out, toast-out 0.3s ease-in 2.7s forwards;
            display: flex;
            align-items: center;
            gap: 12px;
        }
        @keyframes toast-in { from { transform: translateY(-50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
        @keyframes toast-out { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-50px); opacity: 0; } }

        .menu-item {
            width: 100%;
            padding: 12px 16px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            gap: 12px;
            font-weight: 700;
            transition: all 0.2s;
            color: #94a3b8;
        }
        .menu-item:hover {
            background: rgba(34, 211, 238, 0.1);
            color: #22d3ee;
        }

        .hint-btn {
            background: linear-gradient(to right, #f59e0b, #d97706);
            color: #000;
            font-weight: 800;
            padding: 0.8rem 1rem;
            border-radius: 0.75rem;
            font-size: 0.85rem;
            transition: all 0.2s;
            text-align: center;
            width: 100%;
            display: flex;
            flex-direction: column;
            gap: 4px;
        }
        .hint-btn:disabled { opacity: 0.5; filter: grayscale(1); cursor: not-allowed; }

        .tutorial-banner {
            background: linear-gradient(to right, #f59e0b, #d97706);
            color: #000;
            padding: 8px 16px;
            font-weight: 800;
            font-size: 14px;
            text-align: center;
            width: 100%;
            z-index: 1000;
            animation: slide-down 0.5s ease-out;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
        }

        @keyframes slide-down {
            from { transform: translateY(-100%); }
            to { transform: translateY(0); }
        }

        .quantity-input::-webkit-inner-spin-button,
        .quantity-input::-webkit-outer-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }
        .quantity-input {
            -moz-appearance: textfield;
        }

        .game-logo-text {
            font-size: 3rem;
            font-weight: 900;
            background: linear-gradient(to bottom, #22d3ee 0%, #0ea5e9 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            text-transform: uppercase;
            letter-spacing: -0.05em;
            font-style: italic;
            line-height: 1;
            filter: drop-shadow(0 0 10px rgba(34, 211, 238, 0.4));
            margin-bottom: 1rem;
        }
        .game-logo-sub {
            color: #64748b;
            font-weight: 800;
            font-size: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 0.3em;
            margin-bottom: 2.5rem;
        }

/* ===== FLOW SKIN SHOP SYSTEM ===== */

/* Modal overlay and backdrop */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modal-fade-in 0.3s ease-out;
}

.modal.hidden {
    display: none;
    animation: modal-fade-out 0.3s ease-out;
}

@keyframes modal-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modal-fade-out {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Modal overlay - dark background with blur */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    z-index: -1;
}

/* Modal content container */
.modal-content {
    position: relative;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border: 2px solid rgba(34, 211, 238, 0.3);
    border-radius: 1.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(34, 211, 238, 0.1);
    backdrop-filter: blur(12px);
    max-width: 900px;
    width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: modal-slide-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

@keyframes modal-slide-in {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Modal header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(34, 211, 238, 0.15);
    background: rgba(34, 211, 238, 0.05);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 900;
    color: #22d3ee;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-shadow: 0 0 20px rgba(34, 211, 238, 0.2);
}

.modal-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
}

.modal-close:hover {
    color: #22d3ee;
    background: rgba(34, 211, 238, 0.1);
    transform: rotate(90deg);
}

/* Modal body - scrollable skins list */
.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 2rem;
    display: flex;
    flex-direction: column;
}

.skin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

/* Individual skin card */
.skin-card {
    display: flex;
    flex-direction: column;
    background: rgba(30, 41, 59, 0.8);
    border: 2px solid rgba(71, 85, 105, 0.5);
    border-radius: 1rem;
    padding: 1rem;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.skin-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.skin-card:hover::before {
    left: 100%;
}

.skin-card:hover {
    border-color: rgba(34, 211, 238, 0.4);
    background: rgba(30, 41, 59, 0.95);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(34, 211, 238, 0.15);
}

.skin-card.equipped {
    border-color: rgba(34, 211, 238, 0.8);
    background: rgba(34, 211, 238, 0.05);
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.3), inset 0 0 20px rgba(34, 211, 238, 0.05);
}

.skin-card.equipped::after {
    content: '✓';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 1.5rem;
    height: 1.5rem;
    background: linear-gradient(135deg, #22d3ee 0%, #0ea5e9 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    color: #020617;
    font-size: 0.8rem;
}

/* Skin card header with icon */
.skin-card-header {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 2.5rem;
    margin-bottom: 0.5rem;
}

.skin-icon {
    font-size: 2rem;
    animation: icon-bounce 2s ease-in-out infinite;
}

@keyframes icon-bounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-8px) scale(1.1);
    }
}

/* Skin preview circle */
.skin-preview {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.skin-card:hover .skin-preview {
    border-color: rgba(34, 211, 238, 0.3);
}

.skin-preview-inner {
    width: 60%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: inherit;
    filter: brightness(1.2);
    animation: skin-pulse 2s ease-in-out infinite;
}

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

/* Skin info */
.skin-info {
    flex: 1;
    margin-bottom: 1rem;
}

.skin-info h3 {
    margin: 0 0 0.25rem 0;
    font-size: 0.95rem;
    font-weight: 800;
    color: #f1f5f9;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.skin-price {
    margin: 0;
    font-size: 0.8rem;
    color: #94a3b8;
    font-weight: 700;
}

/* Skin action button */
.skin-action-btn {
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.6rem 1rem;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
    letter-spacing: 0.05em;
}

.skin-action-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.5);
    background: linear-gradient(135deg, #8b5cf6 0%, #b794f6 100%);
}

.skin-action-btn:active:not(:disabled) {
    transform: translateY(0);
}

.skin-action-btn.equipped {
    background: linear-gradient(135deg, #22d3ee 0%, #0ea5e9 100%);
    color: #020617;
    font-weight: 900;
    box-shadow: 0 4px 12px rgba(34, 211, 238, 0.4);
    cursor: default;
}

.skin-action-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: linear-gradient(135deg, #475569 0%, #64748b 100%);
    box-shadow: none;
}

/* Modal footer */
.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-top: 1px solid rgba(34, 211, 238, 0.15);
    background: rgba(34, 211, 238, 0.03);
}

.coins-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(34, 211, 238, 0.1);
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(34, 211, 238, 0.2);
}

.coins-amount {
    font-size: 1.5rem;
    font-weight: 900;
    color: #fbbf24;
    font-family: 'Courier New', monospace;
}

.coins-icon {
    font-size: 1.5rem;
    animation: coin-float 2s ease-in-out infinite;
}

@keyframes coin-float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

/* Close button */
.modal-btn-close {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: #f1f5f9;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    padding: 0.75rem 1.5rem;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.05em;
}

.modal-btn-close:hover {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

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

/* Shop button in game UI */
.shop-button {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #000;
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 0.75rem;
    padding: 0.75rem 1.5rem;
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    letter-spacing: 0.05em;
}

.shop-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.5);
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

.shop-button:active {
    transform: translateY(0);
}

/* Smooth pipe transition for flow skin changes */
.pipe-active {
    transition: stroke 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                filter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                stroke-width 0.3s ease;
}

/* Scrollbar styling for modal body */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.3);
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: rgba(34, 211, 238, 0.3);
    border-radius: 10px;
    transition: background 0.3s;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(34, 211, 238, 0.6);
}
    @keyframes shake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
  100% { transform: translateX(0); }
}

.shake {
  animation: shake 0.25s;
}
/* Thêm vào phần style trong index.html */
.game-container {
    display: flex;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
}
.right-panel {
    flex: 1;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid #06b6d4;
    border-radius: 12px;
    padding: 16px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #22d3ee;
    height: 600px;
    overflow-y: auto;
}